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
HGCalTriggerNtupleGenJet Class Reference
Inheritance diagram for HGCalTriggerNtupleGenJet:
HGCalTriggerNtupleBase

Public Member Functions

void fill (const edm::Event &, const HGCalTriggerNtupleEventSetup &) final
 
 HGCalTriggerNtupleGenJet (const edm::ParameterSet &)
 
void initialize (TTree &, const edm::ParameterSet &, edm::ConsumesCollector &&) final
 
- 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 > 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

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

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.

References HGCalTriggerNtupleBase::accessEventSetup_.

28  : HGCalTriggerNtupleBase(conf) {
29  accessEventSetup_ = false;
30 }
HGCalTriggerNtupleBase(const edm::ParameterSet &conf)

Member Function Documentation

void HGCalTriggerNtupleGenJet::clear ( void  )
finalprivatevirtual

Implements HGCalTriggerNtupleBase.

Definition at line 62 of file HGCalTriggerNtupleGenJet.cc.

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

Referenced by fill().

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

Reimplemented from HGCalTriggerNtupleBase.

Definition at line 43 of file HGCalTriggerNtupleGenJet.cc.

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

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

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

34  {
36  tree.Branch("genjet_n", &genjet_n_, "genjet_n/I");
37  tree.Branch("genjet_energy", &genjet_energy_);
38  tree.Branch("genjet_pt", &genjet_pt_);
39  tree.Branch("genjet_eta", &genjet_eta_);
40  tree.Branch("genjet_phi", &genjet_phi_);
41 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
std::vector< GenJet > GenJetCollection
collection of GenJet objects
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::vector< float > genjet_energy_

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().