1 #ifndef PhysicsTools_TagAndProbe_BaseTreeFiller_h
2 #define PhysicsTools_TagAndProbe_BaseTreeFiller_h
19 #include <boost/utility.hpp>
float * address() const
Addess for ROOT Branch.
bool addEventVariablesInfo_
Add branches with event variables: met, sum ET, .. etc.
ProbeVariable(const std::string &name, const std::string &expression)
Create a ProbeVariable to be evaluated on the fly from a string expression.
bool external_
true if it's an external ValueMap, false if it's a StringParser function
std::string name_
the name of the variable, which becomes the ROOT branch name
BaseTreeFiller(const char *name, const edm::ParameterSet config)
specify the name of the TTree, and the configuration for it
void init(const edm::Event &iEvent) const
To be called at the beginning of the event (will fetch Candidate View if needed)
bool addRunLumiInfo_
Add branches with run and lumisection number.
void writeProvenance(const edm::ParameterSet &pset) const
std::vector< ProbeVariable > vars_
void fill(const reco::CandidateBaseRef &probe) const
To be called for each item.
ProbeFlag(const std::string &name, const std::string &cut)
Create a ProbeFlag to be evaluated on the fly from a string cut.
StringCutObjectSelector< reco::Candidate, true > cut_
implementation of the cut using a string selector
~ProbeFlag()
Destructor (does nothing)
std::string name_
the name of the variable, which becomes the ROOT branch name
void init(const edm::Event &iEvent) const
To be called at the beginning of the event (will fetch ValueMap if needed)
void fill(const reco::CandidateBaseRef &probe) const
To be called once per probe, to fill the values for this probe.
A variable for the probe: can be a string expression or an external ValueMap<float> ...
int main(int argc, char **argv)
int32_t * address() const
Addess for ROOT Branch.
const std::string & name() const
name
ProbeVariable(const std::string &name, const edm::InputTag &src)
Create a ProbeVariable to be read from a ValueMap.
std::vector< ProbeFlag > flags_
~BaseTreeFiller()
Destructor, does nothing but it's out-of-line as we have complex data members.
edm::Handle< edm::ValueMap< float > > handle_
the handle to keep the ValueMap
ProbeFlag(const std::string &name, const edm::InputTag &src)
Create a ProbeFlag to be read from a ValueMap.
void init(const edm::Event &iEvent) const
To be called once per event, to load possible external variables.
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
int32_t value_
the place where we store the value, and that ROOT uses to fill the tree
~ProbeVariable()
Destructor (does nothing)
WeightMode
How event weights are defined: 'None' = no weights, 'Fixed' = one value specified in cfg file...
void fill(const reco::CandidateBaseRef &probe) const
To be called for each item.
bool ignoreExceptions_
Ignore exceptions when evaluating variables.
edm::InputTag src_
the external collection
bool external_
true if it's an external Candidate View, false if it's a StringParser cut
StringObjectFunction< reco::Candidate, true > function_
a lazy-parsed StringObjectFunction<reco::Candidate> that gets all the methods of daughter classes too...
const std::string & name() const
name
std::vector< reco::CandidateBaseRef > passingProbes_
the handle to keep the refs to the passing probes
edm::InputTag src_
the external valuemap
float value_
the place where we store the value, and that ROOT uses to fill the tree
void addBranches_(TTree *tree, const edm::ParameterSet &iConfig, const std::string &branchNamePrefix="")