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 Member Functions | Private Attributes
HGCalTriggerNtupleHGCTowers Class Reference
Inheritance diagram for HGCalTriggerNtupleHGCTowers:
HGCalTriggerNtupleBase

Public Member Functions

void fill (const edm::Event &e, const HGCalTriggerNtupleEventSetup &es) final
 
 HGCalTriggerNtupleHGCTowers (const edm::ParameterSet &conf)
 
void initialize (TTree &, const edm::ParameterSet &, edm::ConsumesCollector &&) final
 
 ~HGCalTriggerNtupleHGCTowers () override
 
- Public Member Functions inherited from HGCalTriggerNtupleBase
bool accessEventSetup () const
 
virtual void fill (const edm::Event &, const edm::EventSetup &)
 
 HGCalTriggerNtupleBase (const edm::ParameterSet &conf)
 
const std::string & name () const
 
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

- Protected Attributes inherited from HGCalTriggerNtupleBase
bool accessEventSetup_ = true
 
const std::string name_
 

Detailed Description

Definition at line 4 of file HGCalTriggerNtupleTowers.cc.

Constructor & Destructor Documentation

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

Definition at line 29 of file HGCalTriggerNtupleTowers.cc.

References HGCalTriggerNtupleBase::accessEventSetup_.

29  : HGCalTriggerNtupleBase(conf) {
30  accessEventSetup_ = false;
31 }
HGCalTriggerNtupleBase(const edm::ParameterSet &conf)
HGCalTriggerNtupleHGCTowers::~HGCalTriggerNtupleHGCTowers ( )
inlineoverride

Definition at line 7 of file HGCalTriggerNtupleTowers.cc.

7 {};

Member Function Documentation

void HGCalTriggerNtupleHGCTowers::clear ( void  )
finalprivatevirtual

Implements HGCalTriggerNtupleBase.

Definition at line 79 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().

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

Reimplemented from HGCalTriggerNtupleBase.

Definition at line 57 of file HGCalTriggerNtupleTowers.cc.

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

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

Implements HGCalTriggerNtupleBase.

Definition at line 33 of file HGCalTriggerNtupleTowers.cc.

References edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), PostProcessorHGCAL_cfi::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_.

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

Member Data Documentation

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

Definition at line 18 of file HGCalTriggerNtupleTowers.cc.

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

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

Definition at line 19 of file HGCalTriggerNtupleTowers.cc.

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

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

Definition at line 21 of file HGCalTriggerNtupleTowers.cc.

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

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

Definition at line 22 of file HGCalTriggerNtupleTowers.cc.

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

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

Definition at line 23 of file HGCalTriggerNtupleTowers.cc.

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

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

Definition at line 24 of file HGCalTriggerNtupleTowers.cc.

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

int HGCalTriggerNtupleHGCTowers::tower_n_
private

Definition at line 16 of file HGCalTriggerNtupleTowers.cc.

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

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

Definition at line 20 of file HGCalTriggerNtupleTowers.cc.

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

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

Definition at line 17 of file HGCalTriggerNtupleTowers.cc.

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

edm::EDGetToken HGCalTriggerNtupleHGCTowers::towers_token_
private

Definition at line 14 of file HGCalTriggerNtupleTowers.cc.

Referenced by fill(), and initialize().