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 ( const edm::ParameterSet conf)

Definition at line 31 of file HGCalTriggerNtupleTowers.cc.

32  : HGCalTriggerNtupleBase(conf) {}
HGCalTriggerNtupleBase(const edm::ParameterSet &conf)
HGCalTriggerNtupleHGCTowers::~HGCalTriggerNtupleHGCTowers ( )
inlineoverride

Definition at line 9 of file HGCalTriggerNtupleTowers.cc.

References clear(), MillePedeFileConverter_cfg::e, fill(), and initialize().

9 {};

Member Function Documentation

void HGCalTriggerNtupleHGCTowers::clear ( void  )
finalprivatevirtual

Implements HGCalTriggerNtupleBase.

Definition at line 76 of file HGCalTriggerNtupleTowers.cc.

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

Referenced by fill(), and ~HGCalTriggerNtupleHGCTowers().

76  {
77  tower_n_ = 0;
78  tower_pt_.clear();
79  tower_energy_.clear();
80  tower_eta_.clear();
81  tower_phi_.clear();
82  tower_etEm_.clear();
83  tower_etHad_.clear();
84  tower_iEta_.clear();
85  tower_iPhi_.clear();
86 }
void HGCalTriggerNtupleHGCTowers::fill ( const edm::Event e,
const edm::EventSetup es 
)
finalvirtual

Implements HGCalTriggerNtupleBase.

Definition at line 50 of file HGCalTriggerNtupleTowers.cc.

References BXVector< T >::begin(), clear(), BXVector< T >::end(), geometry, edm::EventSetup::get(), edm::Event::getByToken(), tower_energy_, tower_eta_, tower_etEm_, tower_etHad_, tower_iEta_, tower_iPhi_, tower_n_, tower_phi_, tower_pt_, and towers_token_.

Referenced by ~HGCalTriggerNtupleHGCTowers().

50  {
51  // retrieve towers
53  e.getByToken(towers_token_, towers_h);
54  const l1t::HGCalTowerBxCollection& towers = *towers_h;
55 
56  // retrieve geometry
58  es.get<CaloGeometryRecord>().get(geometry);
59 
60  clear();
61  for (auto tower_itr = towers.begin(0); tower_itr != towers.end(0); tower_itr++) {
62  tower_n_++;
63  // physical values
64  tower_pt_.emplace_back(tower_itr->pt());
65  tower_energy_.emplace_back(tower_itr->energy());
66  tower_eta_.emplace_back(tower_itr->eta());
67  tower_phi_.emplace_back(tower_itr->phi());
68  tower_etEm_.emplace_back(tower_itr->etEm());
69  tower_etHad_.emplace_back(tower_itr->etHad());
70 
71  tower_iEta_.emplace_back(tower_itr->id().iEta());
72  tower_iPhi_.emplace_back(tower_itr->id().iPhi());
73  }
74 }
const_iterator end(int bx) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
ESHandle< TrackerGeometry > geometry
T get() const
Definition: EventSetup.h:71
const_iterator begin(int bx) const
void HGCalTriggerNtupleHGCTowers::initialize ( TTree &  tree,
const edm::ParameterSet conf,
edm::ConsumesCollector &&  collector 
)
finalvirtual

Implements HGCalTriggerNtupleBase.

Definition at line 34 of file HGCalTriggerNtupleTowers.cc.

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

Referenced by ~HGCalTriggerNtupleHGCTowers().

36  {
38 
39  tree.Branch("tower_n", &tower_n_, "tower_n/I");
40  tree.Branch("tower_pt", &tower_pt_);
41  tree.Branch("tower_energy", &tower_energy_);
42  tree.Branch("tower_eta", &tower_eta_);
43  tree.Branch("tower_phi", &tower_phi_);
44  tree.Branch("tower_etEm", &tower_etEm_);
45  tree.Branch("tower_etHad", &tower_etHad_);
46  tree.Branch("tower_iEta", &tower_iEta_);
47  tree.Branch("tower_iPhi", &tower_iPhi_);
48 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
Definition: tree.py:1

Member Data Documentation

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

Definition at line 20 of file HGCalTriggerNtupleTowers.cc.

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

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

Definition at line 21 of file HGCalTriggerNtupleTowers.cc.

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

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

Definition at line 23 of file HGCalTriggerNtupleTowers.cc.

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

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

Definition at line 24 of file HGCalTriggerNtupleTowers.cc.

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

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

Definition at line 25 of file HGCalTriggerNtupleTowers.cc.

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

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

Definition at line 26 of file HGCalTriggerNtupleTowers.cc.

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

int HGCalTriggerNtupleHGCTowers::tower_n_
private

Definition at line 18 of file HGCalTriggerNtupleTowers.cc.

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

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

Definition at line 22 of file HGCalTriggerNtupleTowers.cc.

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

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

Definition at line 19 of file HGCalTriggerNtupleTowers.cc.

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

edm::EDGetToken HGCalTriggerNtupleHGCTowers::towers_token_
private

Definition at line 16 of file HGCalTriggerNtupleTowers.cc.

Referenced by fill(), and initialize().