CMS 3D CMS Logo

L1AnalysisCaloTP.cc
Go to the documentation of this file.
3 
6 
8 
10 
12 
14  if (verbose_)
15  edm::LogInfo("L1Ntuple") << "HCAL TPs : " << hcalTPs.size() << std::endl;
16 
17  for (unsigned i = 0; i < hcalTPs.size(); ++i) {
18  short ieta = (short)hcalTPs[i].id().ieta();
19  unsigned short absIeta = (unsigned short)abs(ieta);
20  short sign = ieta / absIeta;
21 
22  unsigned short cal_iphi = (unsigned short)hcalTPs[i].id().iphi();
23  unsigned short iphi = (72 + 18 - cal_iphi) % 72;
24  if (absIeta >= 29) { // special treatment for HF
25  iphi = iphi / 4;
26  }
27 
28  unsigned short compEt = hcalTPs[i].SOI_compressedEt();
29  double et = 0.;
30  if (hcalScale_ != nullptr)
31  et = hcalScale_->et(compEt, absIeta, sign);
32 
33  unsigned short fineGrain = (unsigned short)hcalTPs[i].SOI_fineGrain();
34 
35  tp_.hcalTPieta.push_back(ieta);
36  tp_.hcalTPCaliphi.push_back(cal_iphi);
37  tp_.hcalTPiphi.push_back(iphi);
38  tp_.hcalTPet.push_back(et);
39  tp_.hcalTPcompEt.push_back(compEt);
40  tp_.hcalTPfineGrain.push_back(fineGrain);
41  tp_.nHCALTP++;
42  }
43 }
44 
46  if (verbose_)
47  edm::LogInfo("L1Ntuple") << "ECAL TPs : " << ecalTPs.size() << std::endl;
48 
49  for (unsigned i = 0; i < ecalTPs.size(); ++i) {
50  short ieta = (short)ecalTPs[i].id().ieta();
51  unsigned short absIeta = (unsigned short)abs(ieta);
52  short sign = ieta / absIeta;
53 
54  unsigned short cal_iphi = (unsigned short)ecalTPs[i].id().iphi();
55  unsigned short iphi =
56  (72 + 18 - cal_iphi) % 72; // transform TOWERS (not regions) into local rct (intuitive) phi bins
57 
58  unsigned short compEt = ecalTPs[i].compressedEt();
59  double et = 0.;
60  if (ecalScale_ != nullptr)
61  et = ecalScale_->et(compEt, absIeta, sign);
62 
63  unsigned short fineGrain = (unsigned short)ecalTPs[i].fineGrain(); // 0 or 1
64 
65  tp_.ecalTPieta.push_back(ieta);
66  tp_.ecalTPCaliphi.push_back(cal_iphi);
67  tp_.ecalTPiphi.push_back(iphi);
68  tp_.ecalTPet.push_back(et);
69  tp_.ecalTPcompEt.push_back(compEt);
70  tp_.ecalTPfineGrain.push_back(fineGrain);
71  tp_.nECALTP++;
72  }
73 }
mps_fire.i
i
Definition: mps_fire.py:428
L1AnalysisCaloTP.h
MessageLogger.h
funct::false
false
Definition: Factorize.h:29
edm::SortedCollection
Definition: SortedCollection.h:49
Validation_hcalonly_cfi.sign
sign
Definition: Validation_hcalonly_cfi.py:32
L1Analysis::L1AnalysisCaloTP::SetECAL
void SetECAL(const EcalTrigPrimDigiCollection &ecalTPs)
Definition: L1AnalysisCaloTP.cc:45
edm::SortedCollection::size
size_type size() const
Definition: SortedCollection.h:215
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
edm::SortedCollection::push_back
void push_back(T const &t)
Definition: SortedCollection.h:188
L1CaloHcalScale.h
LEDCalibrationChannels.iphi
iphi
Definition: LEDCalibrationChannels.py:64
L1Analysis::L1AnalysisCaloTP::SetHCAL
void SetHCAL(const HcalTrigPrimDigiCollection &hcalTPs)
Definition: L1AnalysisCaloTP.cc:13
verbose
static constexpr int verbose
Definition: HLTExoticaSubAnalysis.cc:25
L1Analysis::L1AnalysisCaloTP::L1AnalysisCaloTP
L1AnalysisCaloTP()
Definition: L1AnalysisCaloTP.cc:7
LEDCalibrationChannels.ieta
ieta
Definition: LEDCalibrationChannels.py:63
L1Analysis::L1AnalysisCaloTP::~L1AnalysisCaloTP
~L1AnalysisCaloTP()
Definition: L1AnalysisCaloTP.cc:11
EgHLTOffHistBins_cfi.et
et
Definition: EgHLTOffHistBins_cfi.py:8
L1CaloEcalScale.h
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22