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

Definition at line 28 of file HGCalTriggerNtupleGenJet.cc.

28 : HGCalTriggerNtupleBase(conf) {}

Member Function Documentation

◆ clear()

void HGCalTriggerNtupleGenJet::clear ( void  )
finalprivatevirtual

Implements HGCalTriggerNtupleBase.

Definition at line 60 of file HGCalTriggerNtupleGenJet.cc.

60  {
61  genjet_n_ = 0;
62  genjet_energy_.clear();
63  genjet_pt_.clear();
64  genjet_eta_.clear();
65  genjet_phi_.clear();
66 }

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

Referenced by fill().

◆ fill()

void HGCalTriggerNtupleGenJet::fill ( const edm::Event e,
const edm::EventSetup es 
)
finalvirtual

Implements HGCalTriggerNtupleBase.

Definition at line 41 of file HGCalTriggerNtupleGenJet.cc.

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 }

References clear(), MillePedeFileConverter_cfg::e, genjet_energy_, genjet_eta_, genjet_n_, genjet_phi_, genjet_pt_, genjet_token_, and metsig::jet.

◆ initialize()

void HGCalTriggerNtupleGenJet::initialize ( TTree &  tree,
const edm::ParameterSet conf,
edm::ConsumesCollector &&  collector 
)
finalvirtual

Implements HGCalTriggerNtupleBase.

Definition at line 30 of file HGCalTriggerNtupleGenJet.cc.

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 }

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

Member Data Documentation

◆ genjet_energy_

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

Definition at line 20 of file HGCalTriggerNtupleGenJet.cc.

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

◆ genjet_eta_

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

Definition at line 22 of file HGCalTriggerNtupleGenJet.cc.

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

◆ genjet_n_

int HGCalTriggerNtupleGenJet::genjet_n_
private

Definition at line 19 of file HGCalTriggerNtupleGenJet.cc.

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

◆ genjet_phi_

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

Definition at line 23 of file HGCalTriggerNtupleGenJet.cc.

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

◆ genjet_pt_

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

Definition at line 21 of file HGCalTriggerNtupleGenJet.cc.

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

◆ genjet_token_

edm::EDGetToken HGCalTriggerNtupleGenJet::genjet_token_
private

Definition at line 17 of file HGCalTriggerNtupleGenJet.cc.

Referenced by fill(), and initialize().

HGCalTriggerNtupleGenJet::genjet_pt_
std::vector< float > genjet_pt_
Definition: HGCalTriggerNtupleGenJet.cc:21
reco::GenJetCollection
std::vector< GenJet > GenJetCollection
collection of GenJet objects
Definition: GenJetCollection.h:14
HGCalTriggerNtupleGenJet::genjet_n_
int genjet_n_
Definition: HGCalTriggerNtupleGenJet.cc:19
tree
Definition: tree.py:1
edm::Handle< reco::GenJetCollection >
HGCalTriggerNtupleBase::HGCalTriggerNtupleBase
HGCalTriggerNtupleBase(const edm::ParameterSet &conf)
Definition: HGCalTriggerNtupleBase.h:12
HGCalTriggerNtupleGenJet::genjet_phi_
std::vector< float > genjet_phi_
Definition: HGCalTriggerNtupleGenJet.cc:23
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:55
HGCalTriggerNtupleGenJet::genjet_energy_
std::vector< float > genjet_energy_
Definition: HGCalTriggerNtupleGenJet.cc:20
HGCalTriggerNtupleGenJet::clear
void clear() final
Definition: HGCalTriggerNtupleGenJet.cc:60
HGCalTriggerNtupleGenJet::genjet_eta_
std::vector< float > genjet_eta_
Definition: HGCalTriggerNtupleGenJet.cc:22
metsig::jet
Definition: SignAlgoResolutions.h:47
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
HGCalTriggerNtupleGenJet::genjet_token_
edm::EDGetToken genjet_token_
Definition: HGCalTriggerNtupleGenJet.cc:17
edm::InputTag
Definition: InputTag.h:15
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37