CMS 3D CMS Logo

TPTreeFiller.cc
Go to the documentation of this file.
2 
4  tnp::BaseTreeFiller("fitter_tree",config, iC)
5 {
6  // Add extra branch for the mass
7  tree_->Branch("mass", &mass_, "mass/F");
8 
9  // set up MC if needed
10  if (config.getParameter<bool>("isMC")) {
11  tree_->Branch("mcTrue", &mcTrue_, "mcTrue/I");
12  tree_->Branch("mcMass", &mcMass_, "mcMass/F");
13  }
14 
15 }
16 
18 
21 }
22 
23 void tnp::TPTreeFiller::fill(const reco::CandidateBaseRef &probe, double mass, bool mcTrue, float mcMass) const {
24  mass_ = mass;
25  mcTrue_ = mcTrue;
26  mcMass_ = mcMass;
28 }
T getParameter(std::string const &) const
TPTreeFiller(const edm::ParameterSet &config, edm::ConsumesCollector &&iC)
Definition: TPTreeFiller.h:9
void init(const edm::Event &iEvent) const
Definition: TPTreeFiller.cc:19
Definition: config.py:1
void fill(const reco::CandidateBaseRef &probe) const
To be called once per probe, to fill the values for this probe.
int iEvent
Definition: GenABIO.cc:230
void init(const edm::Event &iEvent) const
To be called once per event, to load possible external variables.
float mass_
extra branch for the mass
Definition: TPTreeFiller.h:19
int32_t mcTrue_
extra branch for the mc truth
Definition: TPTreeFiller.h:21
void fill(const reco::CandidateBaseRef &probe, double mass, bool mcTrue=false, float mcMass=0.0) const
Definition: TPTreeFiller.cc:23
float mcMass_
extra branch for the mc-truth mass
Definition: TPTreeFiller.h:23