CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
L1Analysis::L1AnalysisCaloTP Class Reference

#include <L1AnalysisCaloTP.h>

Public Member Functions

L1AnalysisCaloTPDataFormatgetData ()
 
 L1AnalysisCaloTP ()
 
 L1AnalysisCaloTP (bool verbose)
 
void Reset ()
 
void SetECAL (const EcalTrigPrimDigiCollection &ecalTPs)
 
void setEcalScale (const L1CaloEcalScale *ecalScale)
 
void SetHCAL (const HcalTrigPrimDigiCollection &hcalTPs)
 
void setHcalScale (const L1CaloHcalScale *hcalScale)
 
 ~L1AnalysisCaloTP ()
 

Private Attributes

const L1CaloEcalScaleecalScale_
 
const L1CaloHcalScalehcalScale_
 
L1AnalysisCaloTPDataFormat tp_
 
bool verbose_
 

Detailed Description

Definition at line 24 of file L1AnalysisCaloTP.h.

Constructor & Destructor Documentation

L1Analysis::L1AnalysisCaloTP::L1AnalysisCaloTP ( )

Definition at line 8 of file L1AnalysisCaloTP.cc.

8  :verbose_(false)
9 {
10 }
L1Analysis::L1AnalysisCaloTP::L1AnalysisCaloTP ( bool  verbose)

Definition at line 12 of file L1AnalysisCaloTP.cc.

References verbose, and verbose_.

13 {
14  verbose_ = verbose;
15 }
static int verbose
L1Analysis::L1AnalysisCaloTP::~L1AnalysisCaloTP ( )

Definition at line 17 of file L1AnalysisCaloTP.cc.

18 {
19 
20 }

Member Function Documentation

L1AnalysisCaloTPDataFormat* L1Analysis::L1AnalysisCaloTP::getData ( void  )
inline

Definition at line 49 of file L1AnalysisCaloTP.h.

References tp_.

49 {return &tp_;}
L1AnalysisCaloTPDataFormat tp_
void L1Analysis::L1AnalysisCaloTP::Reset ( )
inline
void L1Analysis::L1AnalysisCaloTP::SetECAL ( const EcalTrigPrimDigiCollection ecalTPs)

Definition at line 56 of file L1AnalysisCaloTP.cc.

References funct::abs(), ecalScale_, L1Analysis::L1AnalysisCaloTPDataFormat::ecalTPCaliphi, L1Analysis::L1AnalysisCaloTPDataFormat::ecalTPcompEt, L1Analysis::L1AnalysisCaloTPDataFormat::ecalTPet, L1Analysis::L1AnalysisCaloTPDataFormat::ecalTPfineGrain, L1Analysis::L1AnalysisCaloTPDataFormat::ecalTPieta, L1Analysis::L1AnalysisCaloTPDataFormat::ecalTPiphi, stringResolutionProvider_cfi::et, L1CaloEcalScale::et(), mps_fire::i, L1Analysis::L1AnalysisCaloTPDataFormat::nECALTP, Validation_hcalonly_cfi::sign, edm::SortedCollection< T, SORT >::size(), tp_, and verbose_.

Referenced by setHcalScale().

56  {
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_!=nullptr) 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 }
L1AnalysisCaloTPDataFormat tp_
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 L1Analysis::L1AnalysisCaloTP::setEcalScale ( const L1CaloEcalScale ecalScale)
inline

Definition at line 32 of file L1AnalysisCaloTP.h.

References ecalScale_.

32  {
33  edm::LogInfo("L1NTUPLE") << "Setting ECAL TP scale " << ecalScale << std::endl;
34  ecalScale_ = ecalScale;
35  }
const L1CaloEcalScale * ecalScale_
void L1Analysis::L1AnalysisCaloTP::SetHCAL ( const HcalTrigPrimDigiCollection hcalTPs)

Definition at line 22 of file L1AnalysisCaloTP.cc.

References funct::abs(), stringResolutionProvider_cfi::et, L1CaloHcalScale::et(), hcalScale_, L1Analysis::L1AnalysisCaloTPDataFormat::hcalTPCaliphi, L1Analysis::L1AnalysisCaloTPDataFormat::hcalTPcompEt, L1Analysis::L1AnalysisCaloTPDataFormat::hcalTPet, L1Analysis::L1AnalysisCaloTPDataFormat::hcalTPfineGrain, L1Analysis::L1AnalysisCaloTPDataFormat::hcalTPieta, L1Analysis::L1AnalysisCaloTPDataFormat::hcalTPiphi, mps_fire::i, L1Analysis::L1AnalysisCaloTPDataFormat::nHCALTP, Validation_hcalonly_cfi::sign, edm::SortedCollection< T, SORT >::size(), tp_, and verbose_.

Referenced by setHcalScale().

22  {
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_!=nullptr) 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 }
L1AnalysisCaloTPDataFormat tp_
const L1CaloHcalScale * hcalScale_
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
et
define resolution functions of each parameter
size_type size() const
void L1Analysis::L1AnalysisCaloTP::setHcalScale ( const L1CaloHcalScale hcalScale)
inline

Definition at line 37 of file L1AnalysisCaloTP.h.

References hcalScale_, SetECAL(), and SetHCAL().

37  {
38  edm::LogInfo("L1NTUPLE") << "Setting HCAL TP scale " << hcalScale << std::endl;
39  hcalScale_ = hcalScale;
40  }
const L1CaloHcalScale * hcalScale_

Member Data Documentation

const L1CaloEcalScale* L1Analysis::L1AnalysisCaloTP::ecalScale_
private

Definition at line 55 of file L1AnalysisCaloTP.h.

Referenced by SetECAL(), and setEcalScale().

const L1CaloHcalScale* L1Analysis::L1AnalysisCaloTP::hcalScale_
private

Definition at line 56 of file L1AnalysisCaloTP.h.

Referenced by SetHCAL(), and setHcalScale().

L1AnalysisCaloTPDataFormat L1Analysis::L1AnalysisCaloTP::tp_
private

Definition at line 53 of file L1AnalysisCaloTP.h.

Referenced by getData(), Reset(), SetECAL(), and SetHCAL().

bool L1Analysis::L1AnalysisCaloTP::verbose_
private

Definition at line 52 of file L1AnalysisCaloTP.h.

Referenced by L1AnalysisCaloTP(), SetECAL(), and SetHCAL().