CMS 3D CMS Logo

L1AnalysisCaloTP.cc
Go to the documentation of this file.
3 
6 
7 
9 {
10 }
11 
13 {
14  verbose_ = verbose;
15 }
16 
18 {
19 
20 }
21 
23 
24  if (verbose_) edm::LogInfo("L1Ntuple") << "HCAL TPs : " << hcalTPs.size() << std::endl;
25 
26  for (unsigned i=0; i<hcalTPs.size(); ++i) {
27 
28  short ieta = (short) hcalTPs[i].id().ieta();
29  unsigned short absIeta = (unsigned short) abs(ieta);
30  short sign = ieta/absIeta;
31 
32  unsigned short cal_iphi = (unsigned short) hcalTPs[i].id().iphi();
33  unsigned short iphi = (72 + 18 - cal_iphi) % 72;
34  if (absIeta >= 29) { // special treatment for HF
35  iphi = iphi/4;
36  }
37 
38  unsigned short compEt = hcalTPs[i].SOI_compressedEt();
39  double et = 0.;
40  if (hcalScale_!=0) et = hcalScale_->et( compEt, absIeta, sign );
41 
42  unsigned short fineGrain = (unsigned short) hcalTPs[i].SOI_fineGrain();
43 
44  tp_.hcalTPieta.push_back( ieta );
45  tp_.hcalTPCaliphi.push_back( cal_iphi );
46  tp_.hcalTPiphi.push_back( iphi );
47  tp_.hcalTPet.push_back( et );
48  tp_.hcalTPcompEt.push_back( compEt );
49  tp_.hcalTPfineGrain.push_back( fineGrain );
50  tp_.nHCALTP++;
51 
52  }
53 
54 }
55 
57 
58  if (verbose_) edm::LogInfo("L1Ntuple") << "ECAL TPs : " << ecalTPs.size() << std::endl;
59 
60  for (unsigned i=0; i<ecalTPs.size(); ++i) {
61 
62  short ieta = (short) ecalTPs[i].id().ieta();
63  unsigned short absIeta = (unsigned short) abs(ieta);
64  short sign = ieta/absIeta;
65 
66  unsigned short cal_iphi = (unsigned short) ecalTPs[i].id().iphi();
67  unsigned short iphi = (72 + 18 - cal_iphi) % 72; // transform TOWERS (not regions) into local rct (intuitive) phi bins
68 
69  unsigned short compEt = ecalTPs[i].compressedEt();
70  double et = 0.;
71  if (ecalScale_!=0) et = ecalScale_->et( compEt, absIeta, sign );
72 
73  unsigned short fineGrain = (unsigned short) ecalTPs[i].fineGrain(); // 0 or 1
74 
75  tp_.ecalTPieta.push_back( ieta );
76  tp_.ecalTPCaliphi.push_back( cal_iphi );
77  tp_.ecalTPiphi.push_back( iphi );
78  tp_.ecalTPet.push_back( et );
79  tp_.ecalTPcompEt.push_back( compEt );
80  tp_.ecalTPfineGrain.push_back( fineGrain );
81  tp_.nECALTP++;
82 
83  }
84 
85 
86 }
void SetHCAL(const HcalTrigPrimDigiCollection &hcalTPs)
bool verbose
L1AnalysisCaloTPDataFormat tp_
const L1CaloHcalScale * hcalScale_
double et(unsigned short rank, unsigned short eta, short etaSign) const
convert from rank to physically meaningful quantity
double et(unsigned short rank, unsigned short eta, short etaSign) const
convert from rank to physically meaningful quantity
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const L1CaloEcalScale * ecalScale_
et
define resolution functions of each parameter
size_type size() const
void SetECAL(const EcalTrigPrimDigiCollection &ecalTPs)