|
|
#include <BaseTreeFiller.h>
|
| BaseTreeFiller (BaseTreeFiller &main, const edm::ParameterSet &iConfig, edm::ConsumesCollector &&iC, const std::string &branchNamePrefix) |
| Add branches to an existing TTree managed by another BaseTreeFiller. More...
|
|
| BaseTreeFiller (const char *name, const edm::ParameterSet &config, edm::ConsumesCollector &&iC) |
| specify the name of the TTree, and the configuration for it More...
|
|
| BaseTreeFiller (const char *name, const edm::ParameterSet &config, edm::ConsumesCollector &iC) |
|
void | fill (const reco::CandidateBaseRef &probe) const |
| To be called once per probe, to fill the values for this probe. More...
|
|
void | init (const edm::Event &iEvent) const |
| To be called once per event, to load possible external variables. More...
|
|
bool | storePUweight () const |
|
void | writeProvenance (const edm::ParameterSet &pset) const |
|
| ~BaseTreeFiller () |
| Destructor, does nothing but it's out-of-line as we have complex data members. More...
|
|
|
enum | WeightMode { None,
Fixed,
External
} |
| How event weights are defined: 'None' = no weights, 'Fixed' = one value specified in cfg file, 'External' = read weight from the event (as double) More...
|
|
Definition at line 137 of file BaseTreeFiller.h.
◆ WeightMode
How event weights are defined: 'None' = no weights, 'Fixed' = one value specified in cfg file, 'External' = read weight from the event (as double)
Enumerator |
---|
None | |
Fixed | |
External | |
Definition at line 174 of file BaseTreeFiller.h.
◆ BaseTreeFiller() [1/3]
specify the name of the TTree, and the configuration for it
Definition at line 140 of file BaseTreeFiller.h.
◆ BaseTreeFiller() [2/3]
FC (EGM) - add possibility to customize collections (can run other miniAOD)
Definition at line 35 of file BaseTreeFiller.cc.
44 if (iConfig.existsAs<
double>(
"eventWeight")) {
46 weight_ = iConfig.getParameter<
double>(
"eventWeight");
68 addRunLumiInfo_ = iConfig.existsAs<
bool>(
"addRunLumiInfo") ? iConfig.getParameter<
bool>(
"addRunLumiInfo") :
false;
76 iConfig.existsAs<
bool>(
"addEventVariablesInfo") ? iConfig.getParameter<
bool>(
"addEventVariablesInfo") :
false;
95 addCaloMet_ = iConfig.existsAs<
bool>(
"addCaloMet") ? iConfig.getParameter<
bool>(
"addCaloMet") :
true;
100 tree_->Branch(
"event_met_calomet", &
mMET_,
"mMET/F");
101 tree_->Branch(
"event_met_calosumet", &
mSumET_,
"mSumET/F");
102 tree_->Branch(
"event_met_calometsignificance", &
mMETSign_,
"mMETSign/F");
112 tree_->Branch(
"event_PrimaryVertex_x", &
mPVx_,
"mPVx/F");
113 tree_->Branch(
"event_PrimaryVertex_y", &
mPVy_,
"mPVy/F");
114 tree_->Branch(
"event_PrimaryVertex_z", &
mPVz_,
"mPVz/F");
115 tree_->Branch(
"event_BeamSpot_x", &
mBSx_,
"mBSx/F");
116 tree_->Branch(
"event_BeamSpot_y", &
mBSy_,
"mBSy/F");
117 tree_->Branch(
"event_BeamSpot_z", &
mBSz_,
"mBSz/F");
123 tree_->Branch(
"event_rho", &
rho_,
"rho/F");
References edm::ConsumesCollector::consumes(), event_(), edm::ParameterSet::existsAs(), edm::ParameterSet::getParameter(), HLT_2018_cff::InputTag, TFileService::make(), edm::ConsumesCollector::mayConsume(), Skims_PA_cff::name, and None.
◆ BaseTreeFiller() [3/3]
◆ ~BaseTreeFiller()
tnp::BaseTreeFiller::~BaseTreeFiller |
( |
| ) |
|
Destructor, does nothing but it's out-of-line as we have complex data members.
Definition at line 178 of file BaseTreeFiller.cc.
◆ addBranches_()
Definition at line 137 of file BaseTreeFiller.cc.
145 for (std::vector<std::string>::const_iterator it = stringVars.begin(), ed = stringVars.end(); it != ed; ++it) {
150 for (std::vector<std::string>::const_iterator it = inputTagVars.begin(), ed = inputTagVars.end(); it != ed; ++it) {
157 std::vector<std::string> stringFlags =
flags.getParameterNamesForType<
std::string>();
158 for (std::vector<std::string>::const_iterator it = stringFlags.begin(), ed = stringFlags.end(); it != ed; ++it) {
162 std::vector<std::string> inputTagFlags =
flags.getParameterNamesForType<
edm::InputTag>();
163 for (std::vector<std::string>::const_iterator it = inputTagFlags.begin(), ed = inputTagFlags.end(); it != ed; ++it) {
169 for (std::vector<tnp::ProbeVariable>::iterator it =
vars_.begin(), ed =
vars_.end(); it != ed; ++it) {
170 tree->Branch(it->name().c_str(), it->address(), (it->name() +
"/F").c_str());
173 for (std::vector<tnp::ProbeFlag>::iterator it =
flags_.begin(), ed =
flags_.end(); it != ed; ++it) {
174 tree->Branch(it->name().c_str(), it->address(), (it->name() +
"/I").c_str());
References edm::ConsumesCollector::consumes(), HLT_2018_cff::flags, edm::ParameterSet::getParameter(), AlCaHLTBitMon_QueryRunRegistry::string, and L1TEGammaDiff_cfi::variables.
Referenced by BaseTreeFiller().
◆ fill()
◆ init()
void tnp::BaseTreeFiller::init |
( |
const edm::Event & |
iEvent | ) |
const |
To be called once per event, to load possible external variables.
*********** store some event variables: MET, SumET ****** ///////// Primary vertex //////////////
Definition at line 180 of file BaseTreeFiller.cc.
189 truePU_ = PupInfo->begin()->getTrueNumInteractions();
193 for (std::vector<tnp::ProbeVariable>::const_iterator it =
vars_.begin(), ed =
vars_.end(); it != ed; ++it) {
196 for (std::vector<tnp::ProbeFlag>::const_iterator it =
flags_.begin(), ed =
flags_.end(); it != ed; ++it) {
229 for (
unsigned int ind = 0; ind < recVtxs->size(); ind++) {
230 if (!((*recVtxs)[ind].isFake()) && ((*recVtxs)[ind].ndof() > 4) && (fabs((*recVtxs)[ind].
z()) <= 24.0) &&
231 ((*recVtxs)[ind].position().Rho() <= 2.0)) {
234 mPVx_ = (*recVtxs)[ind].x();
235 mPVy_ = (*recVtxs)[ind].y();
236 mPVz_ = (*recVtxs)[ind].z();
257 mMET_ = (*met)[0].et();
265 if (tcmet->empty()) {
280 if (pfmet->empty()) {
References pwdgSkimBPark_cfi::beamSpot, event_(), dqmMemoryStats::float, iEvent, edm::HandleBase::isValid(), BTaggingMonitor_cfi::met, and mps_merge::weight.
Referenced by tnp::TPTreeFiller::init().
◆ storePUweight()
bool tnp::BaseTreeFiller::storePUweight |
( |
| ) |
const |
|
inline |
◆ writeProvenance()
Write a string dump of this PSet into the TTree header. see macro in test directory for how to retrieve it from the output root file
Definition at line 317 of file BaseTreeFiller.cc.
319 list->Add(
new TObjString(
pset.dump().c_str()));
References list(), and muonDTDigis_cfi::pset.
◆ addCaloMet_
bool tnp::BaseTreeFiller::addCaloMet_ |
|
protected |
◆ addEventVariablesInfo_
bool tnp::BaseTreeFiller::addEventVariablesInfo_ |
|
protected |
Add branches with event variables: met, sum ET, .. etc.
Definition at line 194 of file BaseTreeFiller.h.
◆ addRho_
bool tnp::BaseTreeFiller::addRho_ |
|
protected |
◆ addRunLumiInfo_
bool tnp::BaseTreeFiller::addRunLumiInfo_ |
|
protected |
◆ beamSpotToken_
◆ event_
uint64_t tnp::BaseTreeFiller::event_ |
|
mutableprotected |
◆ flags_
std::vector<ProbeFlag> tnp::BaseTreeFiller::flags_ |
|
protected |
◆ lumi_
uint32_t tnp::BaseTreeFiller::lumi_ |
|
mutableprotected |
◆ mBSx_
float tnp::BaseTreeFiller::mBSx_ |
|
mutableprotected |
◆ mBSy_
float tnp::BaseTreeFiller::mBSy_ |
|
mutableprotected |
◆ mBSz_
float tnp::BaseTreeFiller::mBSz_ |
|
mutableprotected |
◆ metToken_
◆ mMET_
float tnp::BaseTreeFiller::mMET_ |
|
mutableprotected |
◆ mMETSign_
float tnp::BaseTreeFiller::mMETSign_ |
|
mutableprotected |
◆ mNPV_
uint32_t tnp::BaseTreeFiller::mNPV_ |
|
mutableprotected |
◆ mpfMET_
float tnp::BaseTreeFiller::mpfMET_ |
|
mutableprotected |
◆ mpfMETSign_
float tnp::BaseTreeFiller::mpfMETSign_ |
|
mutableprotected |
◆ mpfPhi_
float tnp::BaseTreeFiller::mpfPhi_ |
|
mutableprotected |
◆ mpfSumET_
float tnp::BaseTreeFiller::mpfSumET_ |
|
mutableprotected |
◆ mPVx_
float tnp::BaseTreeFiller::mPVx_ |
|
mutableprotected |
◆ mPVy_
float tnp::BaseTreeFiller::mPVy_ |
|
mutableprotected |
◆ mPVz_
float tnp::BaseTreeFiller::mPVz_ |
|
mutableprotected |
◆ mSumET_
float tnp::BaseTreeFiller::mSumET_ |
|
mutableprotected |
◆ mtcMET_
float tnp::BaseTreeFiller::mtcMET_ |
|
mutableprotected |
◆ mtcMETSign_
float tnp::BaseTreeFiller::mtcMETSign_ |
|
mutableprotected |
◆ mtcSumET_
float tnp::BaseTreeFiller::mtcSumET_ |
|
mutableprotected |
◆ pfmetToken_
◆ pfmetTokenMiniAOD_
◆ pileupInfoToken_
◆ PUweight_
float tnp::BaseTreeFiller::PUweight_ |
|
mutableprotected |
◆ PUweightSrcToken_
◆ recVtxsToken_
◆ rho_
float tnp::BaseTreeFiller::rho_ |
|
mutableprotected |
◆ rhoToken_
◆ run_
uint32_t tnp::BaseTreeFiller::run_ |
|
mutableprotected |
◆ storePUweight_
bool tnp::BaseTreeFiller::storePUweight_ |
|
protected |
◆ tcmetToken_
◆ totWeight_
float tnp::BaseTreeFiller::totWeight_ |
|
mutableprotected |
◆ tree_
TTree* tnp::BaseTreeFiller::tree_ |
|
mutableprotected |
◆ truePU_
int tnp::BaseTreeFiller::truePU_ |
|
mutableprotected |
◆ vars_
◆ weight_
float tnp::BaseTreeFiller::weight_ |
|
mutableprotected |
◆ weightMode_
◆ weightSrcToken_
std::vector< reco::PFMET > PFMETCollection
collection of PFMET objects
edm::EDGetTokenT< double > rhoToken_
std::vector< Vertex > VertexCollection
collection of Vertex objects
edm::EDGetTokenT< reco::CaloMETCollection > metToken_
bool storePUweight_
Store Pileup weight when running over Monte Carlo.
std::vector< reco::MET > METCollection
collection of MET objects
bool addRunLumiInfo_
Add branches with run and lumisection number.
bool isUninitialized() const
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
edm::EDGetTokenT< std::vector< PileupSummaryInfo > > pileupInfoToken_
edm::EDGetTokenT< GenEventInfoProduct > weightSrcToken_
EDGetTokenT< ProductType > mayConsume(edm::InputTag const &tag)
Analysis-level MET class.
BaseTreeFiller(const char *name, const edm::ParameterSet &config, edm::ConsumesCollector &&iC)
specify the name of the TTree, and the configuration for it
edm::EDGetTokenT< reco::VertexCollection > recVtxsToken_
std::vector< MET > METCollection
std::vector< ProbeFlag > flags_
bool addEventVariablesInfo_
Add branches with event variables: met, sum ET, .. etc.
std::vector< ProbeVariable > vars_
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::PFMETCollection > pfmetToken_
edm::EDGetTokenT< reco::METCollection > tcmetToken_
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*", "!HLTx*" if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL. It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of "!*" before the partial wildcard feature was incorporated). Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run
std::vector< reco::CaloMET > CaloMETCollection
collection of CaloMET objects
A variable for the probe: can be a string expression or an external ValueMap<float>
void addBranches_(TTree *tree, const edm::ParameterSet &iConfig, edm::ConsumesCollector &iC, const std::string &branchNamePrefix="")
edm::EDGetTokenT< double > PUweightSrcToken_
T * make(const Args &... args) const
make new ROOT object
edm::EDGetTokenT< pat::METCollection > pfmetTokenMiniAOD_