8 #include <TObjString.h> 21 passingProbes_.clear();
22 for (
size_t i = 0,
n = view->size();
i <
n; ++
i)
23 passingProbes_.push_back(view->refAt(
i));
29 value_ = (
std::find(passingProbes_.begin(), passingProbes_.end(), probe) != passingProbes_.end());
31 value_ =
bool(cut_(*probe));
41 addBranches_(tree_, iConfig, iC,
"");
44 if (iConfig.
existsAs<
double>(
"eventWeight")) {
48 weightMode_ = External;
53 if (weightMode_ !=
None) {
54 tree_->Branch(
"weight", &weight_,
"weight/F");
55 tree_->Branch(
"totWeight", &totWeight_,
"totWeight/F");
61 tree_->Branch(
"PUweight", &PUweight_,
"PUweight/F");
68 addRunLumiInfo_ = iConfig.
existsAs<
bool>(
"addRunLumiInfo") ? iConfig.
getParameter<
bool>(
"addRunLumiInfo") :
false;
69 if (addRunLumiInfo_) {
70 tree_->Branch(
"run", &run_,
"run/i");
71 tree_->Branch(
"lumi", &lumi_,
"lumi/i");
72 tree_->Branch(
"event", &
event_,
"event/l");
73 tree_->Branch(
"truePU", &truePU_,
"truePU/I");
75 addEventVariablesInfo_ =
76 iConfig.
existsAs<
bool>(
"addEventVariablesInfo") ? iConfig.
getParameter<
bool>(
"addEventVariablesInfo") :
false;
77 if (addEventVariablesInfo_) {
95 addCaloMet_ = iConfig.
existsAs<
bool>(
"addCaloMet") ? iConfig.
getParameter<
bool>(
"addCaloMet") :
true;
96 tree_->Branch(
"event_nPV", &mNPV_,
"mNPV/I");
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");
103 tree_->Branch(
"event_met_tcmet", &mtcMET_,
"mtcMET/F");
104 tree_->Branch(
"event_met_tcsumet", &mtcSumET_,
"mtcSumET/F");
105 tree_->Branch(
"event_met_tcmetsignificance", &mtcMETSign_,
"mtcMETSign/F");
107 tree_->Branch(
"event_met_pfmet", &mpfMET_,
"mpfMET/F");
108 tree_->Branch(
"event_met_pfphi", &mpfPhi_,
"mpfPhi/F");
109 tree_->Branch(
"event_met_pfsumet", &mpfSumET_,
"mpfSumET/F");
111 tree_->Branch(
"event_met_pfmetsignificance", &mpfMETSign_,
"mpfMETSign/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");
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) {
158 for (std::vector<std::string>::const_iterator it = stringFlags.begin(), ed = stringFlags.end(); it != ed; ++it) {
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());
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()) {
319 list->Add(
new TObjString(pset.
dump().c_str()));
bool addEventVariablesInfo_
Add branches with event variables: met, sum ET, .. etc.
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Analysis-level MET class.
T getParameter(std::string const &) const
EventNumber_t event() const
edm::EDGetTokenT< reco::PFMETCollection > pfmetToken_
bool existsAs(std::string const ¶meterName, bool trackiness=true) const
checks if a parameter exists as a given type
void init(const edm::Event &iEvent) const
To be called at the beginning of the event (will fetch Candidate View if needed)
edm::EDGetTokenT< GenEventInfoProduct > weightSrcToken_
EDGetTokenT< ProductType > mayConsume(edm::InputTag const &tag)
bool addRunLumiInfo_
Add branches with run and lumisection number.
void writeProvenance(const edm::ParameterSet &pset) const
std::string dump(unsigned int indent=0) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< MET > METCollection
edm::EDGetTokenT< double > PUweightSrcToken_
std::vector< ProbeVariable > vars_
void fill(const reco::CandidateBaseRef &probe) const
To be called for each item.
~ProbeFlag()
Destructor (does nothing)
double pt() const final
transverse momentum
std::vector< Vertex > VertexCollection
collection of Vertex objects
T * make(const Args &...args) const
make new ROOT object
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
LuminosityBlockNumber_t luminosityBlock() const
std::vector< reco::MET > METCollection
collection of MET objects
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> ...
std::vector< std::string > getParameterNamesForType(bool trackiness=true) const
std::vector< ProbeFlag > flags_
~BaseTreeFiller()
Destructor, does nothing but it's out-of-line as we have complex data members.
edm::EDGetTokenT< reco::CaloMETCollection > metToken_
edm::EDGetTokenT< pat::METCollection > pfmetTokenMiniAOD_
edm::EDGetTokenT< reco::METCollection > tcmetToken_
void init(const edm::Event &iEvent) const
To be called once per event, to load possible external variables.
edm::EDGetTokenT< double > rhoToken_
~ProbeVariable()
Destructor (does nothing)
void addBranches_(TTree *tree, const edm::ParameterSet &iConfig, edm::ConsumesCollector &iC, const std::string &branchNamePrefix="")
std::vector< reco::CaloMET > CaloMETCollection
collection of CaloMET objects
edm::EDGetTokenT< reco::VertexCollection > recVtxsToken_
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
std::vector< reco::PFMET > PFMETCollection
collection of PFMET objects
bool isUninitialized() const
const Point & position() const
position
edm::EDGetTokenT< std::vector< PileupSummaryInfo > > pileupInfoToken_
double significance() const
double phi() const final
momentum azimuthal angle
bool storePUweight_
Store Pileup weight when running over Monte Carlo.
BaseTreeFiller(const char *name, const edm::ParameterSet &config, edm::ConsumesCollector &&iC)
specify the name of the TTree, and the configuration for it
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