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 7 of file HGCalTriggerNtupleGenJet.cc.

Constructor & Destructor Documentation

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

Definition at line 28 of file HGCalTriggerNtupleGenJet.cc.

28 : HGCalTriggerNtupleBase(conf) {}
HGCalTriggerNtupleBase(const edm::ParameterSet &conf)

Member Function Documentation

void HGCalTriggerNtupleGenJet::clear ( void  )
finalprivatevirtual

Implements HGCalTriggerNtupleBase.

Definition at line 60 of file HGCalTriggerNtupleGenJet.cc.

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

Referenced by fill().

60  {
61  genjet_n_ = 0;
62  genjet_energy_.clear();
63  genjet_pt_.clear();
64  genjet_eta_.clear();
65  genjet_phi_.clear();
66 }
std::vector< float > genjet_energy_
void HGCalTriggerNtupleGenJet::fill ( const edm::Event e,
const edm::EventSetup es 
)
finalvirtual

Implements HGCalTriggerNtupleBase.

Definition at line 41 of file HGCalTriggerNtupleGenJet.cc.

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

41  {
43  e.getByToken(genjet_token_, genjets_h);
44  const reco::GenJetCollection& genjets = *genjets_h;
45 
46  clear();
47  genjet_n_ = genjets.size();
48  genjet_energy_.reserve(genjet_n_);
49  genjet_pt_.reserve(genjet_n_);
50  genjet_eta_.reserve(genjet_n_);
51  genjet_phi_.reserve(genjet_n_);
52  for (const auto& jet : genjets) {
53  genjet_energy_.emplace_back(jet.energy());
54  genjet_pt_.emplace_back(jet.pt());
55  genjet_eta_.emplace_back(jet.eta());
56  genjet_phi_.emplace_back(jet.phi());
57  }
58 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
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 30 of file HGCalTriggerNtupleGenJet.cc.

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

32  {
34  tree.Branch("genjet_n", &genjet_n_, "genjet_n/I");
35  tree.Branch("genjet_energy", &genjet_energy_);
36  tree.Branch("genjet_pt", &genjet_pt_);
37  tree.Branch("genjet_eta", &genjet_eta_);
38  tree.Branch("genjet_phi", &genjet_phi_);
39 }
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 20 of file HGCalTriggerNtupleGenJet.cc.

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

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

Definition at line 22 of file HGCalTriggerNtupleGenJet.cc.

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

int HGCalTriggerNtupleGenJet::genjet_n_
private

Definition at line 19 of file HGCalTriggerNtupleGenJet.cc.

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

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

Definition at line 23 of file HGCalTriggerNtupleGenJet.cc.

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

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

Definition at line 21 of file HGCalTriggerNtupleGenJet.cc.

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

edm::EDGetToken HGCalTriggerNtupleGenJet::genjet_token_
private

Definition at line 17 of file HGCalTriggerNtupleGenJet.cc.

Referenced by fill(), and initialize().