CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 }
void SetHCAL(const HcalTrigPrimDigiCollection &hcalTPs)
bool verbose
double sign(double x)
void push_back(T const &t)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
Log< level::Info, false > LogInfo
size_type size() const
void SetECAL(const EcalTrigPrimDigiCollection &ecalTPs)