SimCalorimetry/HcalTrigPrimAlgos/src/HcalFinegrainBit.cc
// timing/depth LLP bit setting
timing/depth LLP bit setting
timing / depth LLP bit setting
std::bitset<6> HcalFinegrainBit::compute(const HcalFinegrainBit::TowerTDC& tower, const HcalTrigTowerDetId& id) const {
  std::bitset<6> result;
  int tp_ieta = id.ieta();
  int Ndelayed = 0;
  int NveryDelayed = 0;
  int Nprompt = 0;
  int EarlyEnergy = 0;
  int DeepEnergy = 0;
  for (size_t i = 0; i < 7; i++) {
    int bit12_15set = tower[i].first.first;
    bool is_compressed = tower[i].first.second;
    int bit12 = (bit12_15set & 0b0001);       
    int bit13 = (bit12_15set & 0b0010) >> 1;  
    int bit14 = (bit12_15set & 0b0100) >> 2;  
    int bit15 = (bit12_15set & 0b1000) >> 3;  
    int TDC = tower[i].second.first;
    int ADC = tower[i].second.second;
    if (TDC < 50) {  
      if ((abs(tp_ieta) <= 16) || (i >= 1)) {
        if (is_compressed == 1) {
          if (TDC == 1 && bit15 == 1)
            Ndelayed += 1;
          if (TDC == 2 && bit15 == 1)
            NveryDelayed += 1;
          if (TDC == 0 && bit14 == 1)
            Nprompt += 1;
        } else {
          if (TDC > tdc_boundary[abs(tp_ieta) - 1][i] && TDC <= tdc_boundary[abs(tp_ieta) - 1][i] + 2 && bit15 == 1)
            Ndelayed += 1;
          if (TDC > tdc_boundary[abs(tp_ieta) - 1][i] + 2 && bit15 == 1)
            NveryDelayed += 1;
          if (TDC <= tdc_boundary[abs(tp_ieta) - 1][i] && TDC >= 0 && bit14 == 1)
            Nprompt += 1;
        }
      }
    }
    if (ADC > 0 && bit12 == 0)
      EarlyEnergy +=
          1;  
    if (ADC > 0 && bit13 == 1)
      DeepEnergy +=
          1;  
  }
  if (DeepEnergy > 0 && EarlyEnergy == 0)
    result[0] = true;  
  else
    result[0] = false;
  if (Nprompt > 0)
    result[1] = true;  
  else
    result[1] = false;
  if (Ndelayed > 0)
    result[2] = true;  
  else
    result[2] = false;
  if (NveryDelayed > 0)
    result[3] = true;  
  else
    result[3] = false;
  result[4] = result[5] = false;  
  return result;
}
std :: bitset < 6 > HcalFinegrainBit :: compute ( const HcalFinegrainBit :: TowerTDC & tower , const HcalTrigTowerDetId & id ) const { std :: bitset < 6 > result ; int tp_ieta = id . ieta ( ) ; int Ndelayed = 0 ; int NveryDelayed = 0 ; int Nprompt = 0 ; int EarlyEnergy = 0 ; int DeepEnergy = 0 ; for ( size_t i = 0 ; i < 7 ; i ++ ) { int bit12_15set = tower [ i ] . first . first ; bool is_compressed = tower [ i ] . first . second ; int bit12 = ( bit12_15set & 0b0001 ) ; int bit13 = ( bit12_15set & 0b0010 ) >> 1 ; int bit14 = ( bit12_15set & 0b0100 ) >> 2 ; int bit15 = ( bit12_15set & 0b1000 ) >> 3 ; int TDC = tower [ i ] . second . first ; int ADC = tower [ i ] . second . second ; if ( TDC < 50 ) { if ( ( abs ( tp_ieta ) <= 16 ) || ( i >= 1 ) ) { if ( is_compressed == 1 ) { if ( TDC == 1 && bit15 == 1 ) Ndelayed += 1 ; if ( TDC == 2 && bit15 == 1 ) NveryDelayed += 1 ; if ( TDC == 0 && bit14 == 1 ) Nprompt += 1 ; } else { if ( TDC > tdc_boundary [ abs ( tp_ieta ) - 1 ] [ i ] && TDC <= tdc_boundary [ abs ( tp_ieta ) - 1 ] [ i ] + 2 && bit15 == 1 ) Ndelayed += 1 ; if ( TDC > tdc_boundary [ abs ( tp_ieta ) - 1 ] [ i ] + 2 && bit15 == 1 ) NveryDelayed += 1 ; if ( TDC <= tdc_boundary [ abs ( tp_ieta ) - 1 ] [ i ] && TDC >= 0 && bit14 == 1 ) Nprompt += 1 ; } } } if ( ADC > 0 && bit12 == 0 ) EarlyEnergy += 1 ; if ( ADC > 0 && bit13 == 1 ) DeepEnergy += 1 ; } if ( DeepEnergy > 0 && EarlyEnergy == 0 ) result [ 0 ] = true ; else result [ 0 ] = false ; if ( Nprompt > 0 ) result [ 1 ] = true ; else result [ 1 ] = false ; if ( Ndelayed > 0 ) result [ 2 ] = true ; else result [ 2 ] = false ; if ( NveryDelayed > 0 ) result [ 3 ] = true ; else result [ 3 ] = false ; result [ 4 ] = result [ 5 ] = false ; return result ; }
timing/depth LLP bit setting
timing / depth LLP bit setting
// low depth 1,2 energy // high depth 3+ energy // prompt energy passed // delayed energy passed // timing bits // exclude error code for TDC in HE (unpacked) // count delayed / prompt hits either in HB, or in HE (excluding depth 1 due to backgrounds in HE) // Sim packing into Raw, has uncompressed TDC values (0-49) at the trigger primitive level. Packing (compressing HB TDC 6:2) happens in packer. // Hcal digis have compressed HB TDC (0-3) // depth bit // early layers, depth 1 and 2. If bit12 = 0, too much energy in early layers. Require ADC > 0 to ensure valid hit in cell // deep layers, 3+. If bit13 = 1, energy in deep layers. Require ADC > 0 to ensure valid hit in cell // very delayed (001000), slightly delayed (000100), prompt (000010), depth flag (000001), 2 reserved bits (110000) // 000001 // 000010 // 000100 // 001000 // 110000 in HcalTriggerPrimitiveAlgo.cc, set to MIP bits from above