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 23 of file L1AnalysisCaloTP.h.

Constructor & Destructor Documentation

◆ L1AnalysisCaloTP() [1/2]

L1Analysis::L1AnalysisCaloTP::L1AnalysisCaloTP ( )

Definition at line 7 of file L1AnalysisCaloTP.cc.

7 : verbose_(false) {}

◆ L1AnalysisCaloTP() [2/2]

L1Analysis::L1AnalysisCaloTP::L1AnalysisCaloTP ( bool  verbose)

Definition at line 9 of file L1AnalysisCaloTP.cc.

9 { verbose_ = verbose; }

References verbose.

◆ ~L1AnalysisCaloTP()

L1Analysis::L1AnalysisCaloTP::~L1AnalysisCaloTP ( )

Definition at line 11 of file L1AnalysisCaloTP.cc.

11 {}

Member Function Documentation

◆ getData()

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

Definition at line 46 of file L1AnalysisCaloTP.h.

46 { return &tp_; }

References tp_.

◆ Reset()

void L1Analysis::L1AnalysisCaloTP::Reset ( )
inline

Definition at line 44 of file L1AnalysisCaloTP.h.

44 { tp_.Reset(); }

References L1Analysis::L1AnalysisCaloTPDataFormat::Reset(), and tp_.

◆ SetECAL()

void L1Analysis::L1AnalysisCaloTP::SetECAL ( const EcalTrigPrimDigiCollection ecalTPs)

Definition at line 45 of file L1AnalysisCaloTP.cc.

45  {
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 }

References funct::abs(), EgHLTOffHistBins_cfi::et, mps_fire::i, LEDCalibrationChannels::ieta, LEDCalibrationChannels::iphi, edm::SortedCollection< T, SORT >::push_back(), Validation_hcalonly_cfi::sign, and edm::SortedCollection< T, SORT >::size().

◆ setEcalScale()

void L1Analysis::L1AnalysisCaloTP::setEcalScale ( const L1CaloEcalScale ecalScale)
inline

Definition at line 30 of file L1AnalysisCaloTP.h.

30  {
31  edm::LogInfo("L1NTUPLE") << "Setting ECAL TP scale " << ecalScale << std::endl;
32  ecalScale_ = ecalScale;
33  }

References ecalScale_.

◆ SetHCAL()

void L1Analysis::L1AnalysisCaloTP::SetHCAL ( const HcalTrigPrimDigiCollection hcalTPs)

Definition at line 13 of file L1AnalysisCaloTP.cc.

13  {
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 }

References funct::abs(), EgHLTOffHistBins_cfi::et, mps_fire::i, LEDCalibrationChannels::ieta, LEDCalibrationChannels::iphi, edm::SortedCollection< T, SORT >::push_back(), Validation_hcalonly_cfi::sign, and edm::SortedCollection< T, SORT >::size().

◆ setHcalScale()

void L1Analysis::L1AnalysisCaloTP::setHcalScale ( const L1CaloHcalScale hcalScale)
inline

Definition at line 35 of file L1AnalysisCaloTP.h.

35  {
36  edm::LogInfo("L1NTUPLE") << "Setting HCAL TP scale " << hcalScale << std::endl;
37  hcalScale_ = hcalScale;
38  }

References hcalScale_.

Member Data Documentation

◆ ecalScale_

const L1CaloEcalScale* L1Analysis::L1AnalysisCaloTP::ecalScale_
private

Definition at line 52 of file L1AnalysisCaloTP.h.

Referenced by setEcalScale().

◆ hcalScale_

const L1CaloHcalScale* L1Analysis::L1AnalysisCaloTP::hcalScale_
private

Definition at line 53 of file L1AnalysisCaloTP.h.

Referenced by setHcalScale().

◆ tp_

L1AnalysisCaloTPDataFormat L1Analysis::L1AnalysisCaloTP::tp_
private

Definition at line 50 of file L1AnalysisCaloTP.h.

Referenced by getData(), and Reset().

◆ verbose_

bool L1Analysis::L1AnalysisCaloTP::verbose_
private

Definition at line 49 of file L1AnalysisCaloTP.h.

L1Analysis::L1AnalysisCaloTPDataFormat::hcalTPiphi
std::vector< short > hcalTPiphi
Definition: L1AnalysisCaloTPDataFormat.h:39
L1Analysis::L1AnalysisCaloTP::hcalScale_
const L1CaloHcalScale * hcalScale_
Definition: L1AnalysisCaloTP.h:53
L1Analysis::L1AnalysisCaloTPDataFormat::nECALTP
short nECALTP
Definition: L1AnalysisCaloTPDataFormat.h:45
mps_fire.i
i
Definition: mps_fire.py:355
L1Analysis::L1AnalysisCaloTP::tp_
L1AnalysisCaloTPDataFormat tp_
Definition: L1AnalysisCaloTP.h:50
edm::LogInfo
Definition: MessageLogger.h:254
L1CaloHcalScale::et
double et(unsigned short rank, unsigned short eta, short etaSign) const
convert from rank to physically meaningful quantity
Definition: L1CaloHcalScale.cc:64
L1CaloEcalScale::et
double et(unsigned short rank, unsigned short eta, short etaSign) const
convert from rank to physically meaningful quantity
Definition: L1CaloEcalScale.cc:64
Validation_hcalonly_cfi.sign
sign
Definition: Validation_hcalonly_cfi.py:32
edm::SortedCollection::size
size_type size() const
Definition: SortedCollection.h:215
L1Analysis::L1AnalysisCaloTP::verbose_
bool verbose_
Definition: L1AnalysisCaloTP.h:49
LEDCalibrationChannels.iphi
iphi
Definition: LEDCalibrationChannels.py:64
L1Analysis::L1AnalysisCaloTPDataFormat::Reset
void Reset()
Definition: L1AnalysisCaloTPDataFormat.h:18
L1Analysis::L1AnalysisCaloTP::ecalScale_
const L1CaloEcalScale * ecalScale_
Definition: L1AnalysisCaloTP.h:52
L1Analysis::L1AnalysisCaloTPDataFormat::hcalTPcompEt
std::vector< short > hcalTPcompEt
Definition: L1AnalysisCaloTPDataFormat.h:42
verbose
static constexpr int verbose
Definition: HLTExoticaSubAnalysis.cc:25
L1Analysis::L1AnalysisCaloTPDataFormat::nHCALTP
short nHCALTP
Definition: L1AnalysisCaloTPDataFormat.h:37
L1Analysis::L1AnalysisCaloTPDataFormat::ecalTPCaliphi
std::vector< short > ecalTPCaliphi
Definition: L1AnalysisCaloTPDataFormat.h:48
LEDCalibrationChannels.ieta
ieta
Definition: LEDCalibrationChannels.py:63
L1Analysis::L1AnalysisCaloTPDataFormat::hcalTPet
std::vector< float > hcalTPet
Definition: L1AnalysisCaloTPDataFormat.h:41
L1Analysis::L1AnalysisCaloTPDataFormat::hcalTPCaliphi
std::vector< short > hcalTPCaliphi
Definition: L1AnalysisCaloTPDataFormat.h:40
EgHLTOffHistBins_cfi.et
et
Definition: EgHLTOffHistBins_cfi.py:8
L1Analysis::L1AnalysisCaloTPDataFormat::ecalTPet
std::vector< float > ecalTPet
Definition: L1AnalysisCaloTPDataFormat.h:49
L1Analysis::L1AnalysisCaloTPDataFormat::ecalTPiphi
std::vector< short > ecalTPiphi
Definition: L1AnalysisCaloTPDataFormat.h:47
L1Analysis::L1AnalysisCaloTPDataFormat::hcalTPfineGrain
std::vector< short > hcalTPfineGrain
Definition: L1AnalysisCaloTPDataFormat.h:43
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
L1Analysis::L1AnalysisCaloTPDataFormat::hcalTPieta
std::vector< short > hcalTPieta
Definition: L1AnalysisCaloTPDataFormat.h:38
L1Analysis::L1AnalysisCaloTPDataFormat::ecalTPieta
std::vector< short > ecalTPieta
Definition: L1AnalysisCaloTPDataFormat.h:46
L1Analysis::L1AnalysisCaloTPDataFormat::ecalTPcompEt
std::vector< short > ecalTPcompEt
Definition: L1AnalysisCaloTPDataFormat.h:50
L1Analysis::L1AnalysisCaloTPDataFormat::ecalTPfineGrain
std::vector< short > ecalTPfineGrain
Definition: L1AnalysisCaloTPDataFormat.h:51