CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
HGCalTriggerNtupleHGCTowers Class Reference
Inheritance diagram for HGCalTriggerNtupleHGCTowers:
HGCalTriggerNtupleBase

Public Member Functions

void fill (const edm::Event &e, const edm::EventSetup &es) final
 
 HGCalTriggerNtupleHGCTowers (const edm::ParameterSet &conf)
 
void initialize (TTree &, const edm::ParameterSet &, edm::ConsumesCollector &&) final
 
 ~HGCalTriggerNtupleHGCTowers () override
 
- Public Member Functions inherited from HGCalTriggerNtupleBase
 HGCalTriggerNtupleBase (const edm::ParameterSet &conf)
 
virtual ~HGCalTriggerNtupleBase ()
 

Private Member Functions

void clear () final
 

Private Attributes

std::vector< float > tower_energy_
 
std::vector< float > tower_eta_
 
std::vector< float > tower_etEm_
 
std::vector< float > tower_etHad_
 
std::vector< int > tower_iEta_
 
std::vector< int > tower_iPhi_
 
int tower_n_
 
std::vector< float > tower_phi_
 
std::vector< float > tower_pt_
 
edm::EDGetToken towers_token_
 

Additional Inherited Members

Detailed Description

Definition at line 6 of file HGCalTriggerNtupleTowers.cc.

Constructor & Destructor Documentation

◆ HGCalTriggerNtupleHGCTowers()

HGCalTriggerNtupleHGCTowers::HGCalTriggerNtupleHGCTowers ( const edm::ParameterSet conf)

Definition at line 31 of file HGCalTriggerNtupleTowers.cc.

32  : HGCalTriggerNtupleBase(conf) {}

◆ ~HGCalTriggerNtupleHGCTowers()

HGCalTriggerNtupleHGCTowers::~HGCalTriggerNtupleHGCTowers ( )
inlineoverride

Definition at line 9 of file HGCalTriggerNtupleTowers.cc.

9 {};

Member Function Documentation

◆ clear()

void HGCalTriggerNtupleHGCTowers::clear ( void  )
finalprivatevirtual

Implements HGCalTriggerNtupleBase.

Definition at line 84 of file HGCalTriggerNtupleTowers.cc.

84  {
85  tower_n_ = 0;
86  tower_pt_.clear();
87  tower_energy_.clear();
88  tower_eta_.clear();
89  tower_phi_.clear();
90  tower_etEm_.clear();
91  tower_etHad_.clear();
92  tower_iEta_.clear();
93  tower_iPhi_.clear();
94 }

References tower_energy_, tower_eta_, tower_etEm_, tower_etHad_, tower_iEta_, tower_iPhi_, tower_n_, tower_phi_, and tower_pt_.

Referenced by fill().

◆ fill()

void HGCalTriggerNtupleHGCTowers::fill ( const edm::Event e,
const edm::EventSetup es 
)
finalvirtual

Implements HGCalTriggerNtupleBase.

Definition at line 58 of file HGCalTriggerNtupleTowers.cc.

58  {
59  // retrieve towers
61  e.getByToken(towers_token_, towers_h);
62  const l1t::HGCalTowerBxCollection& towers = *towers_h;
63 
64  // retrieve geometry
67 
68  clear();
69  for (auto tower_itr = towers.begin(0); tower_itr != towers.end(0); tower_itr++) {
70  tower_n_++;
71  // physical values
72  tower_pt_.emplace_back(tower_itr->pt());
73  tower_energy_.emplace_back(tower_itr->energy());
74  tower_eta_.emplace_back(tower_itr->eta());
75  tower_phi_.emplace_back(tower_itr->phi());
76  tower_etEm_.emplace_back(tower_itr->etEm());
77  tower_etHad_.emplace_back(tower_itr->etHad());
78 
79  tower_iEta_.emplace_back(tower_itr->id().iEta());
80  tower_iPhi_.emplace_back(tower_itr->id().iPhi());
81  }
82 }

References clear(), MillePedeFileConverter_cfg::e, geometry, edm::EventSetup::get(), get, tower_energy_, tower_eta_, tower_etEm_, tower_etHad_, tower_iEta_, tower_iPhi_, tower_n_, tower_phi_, tower_pt_, HLT_2018_cff::towers, and towers_token_.

◆ initialize()

void HGCalTriggerNtupleHGCTowers::initialize ( TTree &  tree,
const edm::ParameterSet conf,
edm::ConsumesCollector &&  collector 
)
finalvirtual

Implements HGCalTriggerNtupleBase.

Definition at line 34 of file HGCalTriggerNtupleTowers.cc.

36  {
38 
39  std::string prefix(conf.getUntrackedParameter<std::string>("Prefix", "tower"));
40 
41  std::string bname;
42  auto withPrefix([&prefix, &bname](char const* vname) -> char const* {
43  bname = prefix + "_" + vname;
44  return bname.c_str();
45  });
46 
47  tree.Branch(withPrefix("n"), &tower_n_, (prefix + "_n/I").c_str());
48  tree.Branch(withPrefix("pt"), &tower_pt_);
49  tree.Branch(withPrefix("energy"), &tower_energy_);
50  tree.Branch(withPrefix("eta"), &tower_eta_);
51  tree.Branch(withPrefix("phi"), &tower_phi_);
52  tree.Branch(withPrefix("etEm"), &tower_etEm_);
53  tree.Branch(withPrefix("etHad"), &tower_etHad_);
54  tree.Branch(withPrefix("iEta"), &tower_iEta_);
55  tree.Branch(withPrefix("iPhi"), &tower_iPhi_);
56 }

References edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), ZMuMuAnalysisNtupler_cff::prefix, AlCaHLTBitMon_QueryRunRegistry::string, tower_energy_, tower_eta_, tower_etEm_, tower_etHad_, tower_iEta_, tower_iPhi_, tower_n_, tower_phi_, tower_pt_, and towers_token_.

Member Data Documentation

◆ tower_energy_

std::vector<float> HGCalTriggerNtupleHGCTowers::tower_energy_
private

Definition at line 20 of file HGCalTriggerNtupleTowers.cc.

Referenced by clear(), fill(), and initialize().

◆ tower_eta_

std::vector<float> HGCalTriggerNtupleHGCTowers::tower_eta_
private

Definition at line 21 of file HGCalTriggerNtupleTowers.cc.

Referenced by clear(), fill(), and initialize().

◆ tower_etEm_

std::vector<float> HGCalTriggerNtupleHGCTowers::tower_etEm_
private

Definition at line 23 of file HGCalTriggerNtupleTowers.cc.

Referenced by clear(), fill(), and initialize().

◆ tower_etHad_

std::vector<float> HGCalTriggerNtupleHGCTowers::tower_etHad_
private

Definition at line 24 of file HGCalTriggerNtupleTowers.cc.

Referenced by clear(), fill(), and initialize().

◆ tower_iEta_

std::vector<int> HGCalTriggerNtupleHGCTowers::tower_iEta_
private

Definition at line 25 of file HGCalTriggerNtupleTowers.cc.

Referenced by clear(), fill(), and initialize().

◆ tower_iPhi_

std::vector<int> HGCalTriggerNtupleHGCTowers::tower_iPhi_
private

Definition at line 26 of file HGCalTriggerNtupleTowers.cc.

Referenced by clear(), fill(), and initialize().

◆ tower_n_

int HGCalTriggerNtupleHGCTowers::tower_n_
private

Definition at line 18 of file HGCalTriggerNtupleTowers.cc.

Referenced by clear(), fill(), and initialize().

◆ tower_phi_

std::vector<float> HGCalTriggerNtupleHGCTowers::tower_phi_
private

Definition at line 22 of file HGCalTriggerNtupleTowers.cc.

Referenced by clear(), fill(), and initialize().

◆ tower_pt_

std::vector<float> HGCalTriggerNtupleHGCTowers::tower_pt_
private

Definition at line 19 of file HGCalTriggerNtupleTowers.cc.

Referenced by clear(), fill(), and initialize().

◆ towers_token_

edm::EDGetToken HGCalTriggerNtupleHGCTowers::towers_token_
private

Definition at line 16 of file HGCalTriggerNtupleTowers.cc.

Referenced by fill(), and initialize().

HGCalTriggerNtupleHGCTowers::tower_phi_
std::vector< float > tower_phi_
Definition: HGCalTriggerNtupleTowers.cc:22
geometry
ESHandle< TrackerGeometry > geometry
Definition: TkLasBeamFitter.cc:200
CaloGeometryRecord
Definition: CaloGeometryRecord.h:30
tree
Definition: tree.py:1
geometry
Definition: geometry.py:1
HGCalTriggerNtupleHGCTowers::tower_energy_
std::vector< float > tower_energy_
Definition: HGCalTriggerNtupleTowers.cc:20
HGCalTriggerNtupleHGCTowers::tower_etEm_
std::vector< float > tower_etEm_
Definition: HGCalTriggerNtupleTowers.cc:23
HGCalTriggerNtupleHGCTowers::tower_eta_
std::vector< float > tower_eta_
Definition: HGCalTriggerNtupleTowers.cc:21
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edm::Handle
Definition: AssociativeIterator.h:50
BXVector
Definition: BXVector.h:15
HGCalTriggerNtupleBase::HGCalTriggerNtupleBase
HGCalTriggerNtupleBase(const edm::ParameterSet &conf)
Definition: HGCalTriggerNtupleBase.h:12
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
HGCalTriggerNtupleHGCTowers::towers_token_
edm::EDGetToken towers_token_
Definition: HGCalTriggerNtupleTowers.cc:16
HGCalTriggerNtupleHGCTowers::tower_etHad_
std::vector< float > tower_etHad_
Definition: HGCalTriggerNtupleTowers.cc:24
edm::ESHandle< HGCalTriggerGeometryBase >
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:49
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HGCalTriggerNtupleHGCTowers::clear
void clear() final
Definition: HGCalTriggerNtupleTowers.cc:84
HGCalTriggerNtupleHGCTowers::tower_iEta_
std::vector< int > tower_iEta_
Definition: HGCalTriggerNtupleTowers.cc:25
HGCalTriggerNtupleHGCTowers::tower_iPhi_
std::vector< int > tower_iPhi_
Definition: HGCalTriggerNtupleTowers.cc:26
get
#define get
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
HLT_2018_cff.towers
towers
Definition: HLT_2018_cff.py:35030
HGCalTriggerNtupleHGCTowers::tower_n_
int tower_n_
Definition: HGCalTriggerNtupleTowers.cc:18
HGCalTriggerNtupleHGCTowers::tower_pt_
std::vector< float > tower_pt_
Definition: HGCalTriggerNtupleTowers.cc:19
edm::InputTag
Definition: InputTag.h:15
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
ZMuMuAnalysisNtupler_cff.prefix
prefix
Definition: ZMuMuAnalysisNtupler_cff.py:14