CMS 3D CMS Logo

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

Public Member Functions

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

Private Member Functions

void clear () final
 

Private Attributes

std::vector< float > genjet_energy_
 
std::vector< float > genjet_eta_
 
int genjet_n_
 
std::vector< float > genjet_phi_
 
std::vector< float > genjet_pt_
 
edm::EDGetToken genjet_token_
 

Additional Inherited Members

Detailed Description

Definition at line 9 of file HGCalTriggerNtupleGenJet.cc.

Constructor & Destructor Documentation

HGCalTriggerNtupleGenJet::HGCalTriggerNtupleGenJet ( const edm::ParameterSet conf)

Definition at line 37 of file HGCalTriggerNtupleGenJet.cc.

References initialize().

38 {
39 }
HGCalTriggerNtupleBase(const edm::ParameterSet &conf)

Member Function Documentation

void HGCalTriggerNtupleGenJet::clear ( void  )
finalprivatevirtual

Implements HGCalTriggerNtupleBase.

Definition at line 82 of file HGCalTriggerNtupleGenJet.cc.

References genjet_energy_, genjet_eta_, genjet_n_, genjet_phi_, and genjet_pt_.

Referenced by fill().

83 {
84  genjet_n_ = 0;
85  genjet_energy_.clear();
86  genjet_pt_.clear();
87  genjet_eta_.clear();
88  genjet_phi_.clear();
89 }
std::vector< float > genjet_energy_
void HGCalTriggerNtupleGenJet::fill ( const edm::Event e,
const edm::EventSetup es 
)
finalvirtual

Implements HGCalTriggerNtupleBase.

Definition at line 57 of file HGCalTriggerNtupleGenJet.cc.

References clear(), genjet_energy_, genjet_eta_, genjet_n_, genjet_phi_, genjet_pt_, genjet_token_, edm::Event::getByToken(), and metsig::jet.

Referenced by initialize().

58 {
60  e.getByToken(genjet_token_, genjets_h);
61  const reco::GenJetCollection& genjets = *genjets_h;
62 
63  clear();
64  genjet_n_ = genjets.size();
65  genjet_energy_.reserve(genjet_n_);
66  genjet_pt_.reserve(genjet_n_);
67  genjet_eta_.reserve(genjet_n_);
68  genjet_phi_.reserve(genjet_n_);
69  for(const auto& jet : genjets)
70  {
71  genjet_energy_.emplace_back(jet.energy());
72  genjet_pt_.emplace_back(jet.pt());
73  genjet_eta_.emplace_back(jet.eta());
74  genjet_phi_.emplace_back(jet.phi());
75  }
76 
77 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
std::vector< GenJet > GenJetCollection
collection of GenJet objects
std::vector< float > genjet_energy_
void HGCalTriggerNtupleGenJet::initialize ( TTree &  tree,
const edm::ParameterSet conf,
edm::ConsumesCollector &&  collector 
)
finalvirtual

Implements HGCalTriggerNtupleBase.

Definition at line 43 of file HGCalTriggerNtupleGenJet.cc.

References fill(), genjet_energy_, genjet_eta_, genjet_n_, genjet_phi_, genjet_pt_, genjet_token_, and edm::ParameterSet::getParameter().

Referenced by HGCalTriggerNtupleGenJet().

44 {
45 
47  tree.Branch("genjet_n", &genjet_n_, "genjet_n/I");
48  tree.Branch("genjet_energy", &genjet_energy_);
49  tree.Branch("genjet_pt", &genjet_pt_);
50  tree.Branch("genjet_eta", &genjet_eta_);
51  tree.Branch("genjet_phi", &genjet_phi_);
52 
53 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
std::vector< GenJet > GenJetCollection
collection of GenJet objects
std::vector< float > genjet_energy_
Definition: tree.py:1

Member Data Documentation

std::vector<float> HGCalTriggerNtupleGenJet::genjet_energy_
private

Definition at line 24 of file HGCalTriggerNtupleGenJet.cc.

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

std::vector<float> HGCalTriggerNtupleGenJet::genjet_eta_
private

Definition at line 26 of file HGCalTriggerNtupleGenJet.cc.

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

int HGCalTriggerNtupleGenJet::genjet_n_
private

Definition at line 23 of file HGCalTriggerNtupleGenJet.cc.

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

std::vector<float> HGCalTriggerNtupleGenJet::genjet_phi_
private

Definition at line 27 of file HGCalTriggerNtupleGenJet.cc.

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

std::vector<float> HGCalTriggerNtupleGenJet::genjet_pt_
private

Definition at line 25 of file HGCalTriggerNtupleGenJet.cc.

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

edm::EDGetToken HGCalTriggerNtupleGenJet::genjet_token_
private

Definition at line 21 of file HGCalTriggerNtupleGenJet.cc.

Referenced by fill(), and initialize().