Skip to content

Commit

Permalink
Added a filter for selecting events where a tag-jet pair is near the …
Browse files Browse the repository at this point in the history
…Z mass.
  • Loading branch information
aehart committed Mar 20, 2018
1 parent d304cee commit ec3d057
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion BackgroundEstimation/plugins/EventTPProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ template<class T, class... Args>
EventTPProducer<T, Args...>::EventTPProducer (const edm::ParameterSet &cfg) :
EventVariableProducer(cfg),
doFilter_ (cfg.getParameter<bool> ("doFilter")),
doSSFilter_ (cfg.getParameter<bool> ("doSSFilter"))
doSSFilter_ (cfg.getParameter<bool> ("doSSFilter")),
doJetFilter_ (cfg.getParameter<bool> ("doJetFilter"))
{
tokenTags_ = consumes<vector<T> > (collections_.getParameter<edm::InputTag> (tagCollectionParameter ()));
tokenProbes_ = consumes<vector<osu::Track> > (collections_.getParameter<edm::InputTag> ("tracks"));
Expand Down Expand Up @@ -121,6 +122,7 @@ EventTPProducer<T, Args...>::AddVariables (const edm::Event &event)
(*eventvariables)["nGoodTagJetPairs"] = nGoodTagJetPairs;
(*eventvariables)["nGoodTagPFCHPairs"] = nGoodTagPFCHPairs;

bool tagJetMassNearZ = false;
for (unsigned i = 0; i < 10; i++)
{
stringstream ss;
Expand All @@ -134,12 +136,16 @@ EventTPProducer<T, Args...>::AddVariables (const edm::Event &event)
(*eventvariables)["jetNeutralHadronEnergyFraction_" + ss.str ()] = (jetNeutralHadronEnergyFractions.size () > i ? jetNeutralHadronEnergyFractions.at (i) : INVALID_VALUE);
(*eventvariables)["tagPFCHMass_" + ss.str ()] = (tagPFCHMasses.size () > i ? tagPFCHMasses.at (i) : INVALID_VALUE);
(*eventvariables)["pfchRelIso_" + ss.str ()] = (pfchRelIsos.size () > i ? pfchRelIsos.at (i) : INVALID_VALUE);

tagJetMassNearZ = (tagJetMassNearZ || (fabs ((*eventvariables)["tagJetMass_" + ss.str ()] - 95.0) < 10.0));
}

if (doFilter_)
(*eventvariables)["EventVariableProducerFilterDecision"] = (nProbesPassingVeto > 0);
if (doSSFilter_)
(*eventvariables)["EventVariableProducerFilterDecision"] = (nSSProbesPassingVeto > 0);
if (doJetFilter_)
(*eventvariables)["EventVariableProducerFilterDecision"] = tagJetMassNearZ;
}

template<class T, class... Args> const string
Expand Down
1 change: 1 addition & 0 deletions BackgroundEstimation/plugins/EventTPProducer.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ template<class T, class... Args> class EventTPProducer : public EventVariablePro
edm::EDGetTokenT<vector<pat::PackedCandidate> > tokenPFCands_;
bool doFilter_;
bool doSSFilter_;
bool doJetFilter_;

const string tagCollectionParameter () const;
bool goodInvMass (const T &, const osu::Track &, double &) const;
Expand Down

0 comments on commit ec3d057

Please sign in to comment.