CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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

L1Analysis::L1AnalysisCaloTP::L1AnalysisCaloTP ( )

Definition at line 7 of file L1AnalysisCaloTP.cc.

L1Analysis::L1AnalysisCaloTP::L1AnalysisCaloTP ( bool  verbose)

Definition at line 9 of file L1AnalysisCaloTP.cc.

References verbose.

9 { verbose_ = verbose; }
static constexpr int verbose
L1Analysis::L1AnalysisCaloTP::~L1AnalysisCaloTP ( )

Definition at line 11 of file L1AnalysisCaloTP.cc.

11 {}

Member Function Documentation

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

Definition at line 46 of file L1AnalysisCaloTP.h.

References tp_.

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

Definition at line 45 of file L1AnalysisCaloTP.cc.

References funct::abs(), mps_fire::i, edm::SortedCollection< T, SORT >::push_back(), jetcorrextractor::sign(), and edm::SortedCollection< T, SORT >::size().

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 }
double sign(double x)
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_
Log< level::Info, false > LogInfo
size_type size() const
void L1Analysis::L1AnalysisCaloTP::setEcalScale ( const L1CaloEcalScale ecalScale)
inline

Definition at line 30 of file L1AnalysisCaloTP.h.

References ecalScale_.

30  {
31  edm::LogInfo("L1NTUPLE") << "Setting ECAL TP scale " << ecalScale << std::endl;
32  ecalScale_ = ecalScale;
33  }
const L1CaloEcalScale * ecalScale_
Log< level::Info, false > LogInfo
void L1Analysis::L1AnalysisCaloTP::SetHCAL ( const HcalTrigPrimDigiCollection hcalTPs)

Definition at line 13 of file L1AnalysisCaloTP.cc.

References funct::abs(), mps_fire::i, edm::SortedCollection< T, SORT >::push_back(), jetcorrextractor::sign(), and edm::SortedCollection< T, SORT >::size().

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 }
double sign(double x)
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
Log< level::Info, false > LogInfo
size_type size() const
void L1Analysis::L1AnalysisCaloTP::setHcalScale ( const L1CaloHcalScale hcalScale)
inline

Definition at line 35 of file L1AnalysisCaloTP.h.

References hcalScale_.

35  {
36  edm::LogInfo("L1NTUPLE") << "Setting HCAL TP scale " << hcalScale << std::endl;
37  hcalScale_ = hcalScale;
38  }
const L1CaloHcalScale * hcalScale_
Log< level::Info, false > LogInfo

Member Data Documentation

const L1CaloEcalScale* L1Analysis::L1AnalysisCaloTP::ecalScale_
private

Definition at line 52 of file L1AnalysisCaloTP.h.

Referenced by setEcalScale().

const L1CaloHcalScale* L1Analysis::L1AnalysisCaloTP::hcalScale_
private

Definition at line 53 of file L1AnalysisCaloTP.h.

Referenced by setHcalScale().

L1AnalysisCaloTPDataFormat L1Analysis::L1AnalysisCaloTP::tp_
private

Definition at line 50 of file L1AnalysisCaloTP.h.

Referenced by getData(), and Reset().

bool L1Analysis::L1AnalysisCaloTP::verbose_
private

Definition at line 49 of file L1AnalysisCaloTP.h.