File indexing completed on 2024-04-06 12:24:11
0001 #ifndef PhysicsTools_TagAndProbe_TagProbePairMaker_h
0002 #define PhysicsTools_TagAndProbe_TagProbePairMaker_h
0003
0004 #include "DataFormats/Candidate/interface/CandidateFwd.h"
0005 #include "FWCore/Framework/interface/Event.h"
0006 #include "FWCore/Framework/interface/ConsumesCollector.h"
0007 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0008 #include "FWCore/Utilities/interface/InputTag.h"
0009
0010 #include "DataFormats/Candidate/interface/Candidate.h"
0011
0012 #include "TRandom2.h"
0013
0014 namespace tnp {
0015
0016
0017 struct TagProbePair {
0018 reco::CandidateBaseRef tag, probe, pair;
0019 float mass;
0020 TagProbePair() {}
0021 TagProbePair(const reco::CandidateBaseRef &t,
0022 const reco::CandidateBaseRef &p,
0023 const reco::CandidateBaseRef &tp,
0024 float m)
0025 : tag(t), probe(p), pair(tp), mass(m) {}
0026 };
0027 typedef std::vector<TagProbePair> TagProbePairs;
0028
0029 class TagProbePairMaker {
0030 public:
0031 TagProbePairMaker(const edm::ParameterSet &iConfig, edm::ConsumesCollector &&iC);
0032
0033 ~TagProbePairMaker() { delete randGen_; }
0034
0035 TagProbePairs run(const edm::Event &iEvent) const;
0036
0037 private:
0038 edm::EDGetTokenT<reco::CandidateView> srcToken_;
0039 enum Arbitration { None, OneProbe, BestMass, Random2, NonDuplicate, OnePair, HighestPt };
0040 Arbitration arbitration_;
0041 double arbitrationMass_;
0042 void arbitrate(TagProbePairs &pairs) const;
0043 TRandom2 *randGen_;
0044
0045
0046 bool phiCutForTwoLeg_;
0047 void phiCutByEventNumber(TagProbePairs &pairs, int eventNumber) const;
0048 };
0049 }
0050
0051 #endif