CMS 3D CMS Logo

EventDependentAbsVetos.h
Go to the documentation of this file.
1 #ifndef PhysicsTools_IsolationAlgos_EventDependentAbsVetos_h
2 #define PhysicsTools_IsolationAlgos_EventDependentAbsVetos_h
3 
11 
12 namespace reco {
13  namespace isodeposit {
15  public:
18  src_(iC.consumes<edm::View<reco::Candidate> >(candidates)), deltaR2_(deltaR*deltaR) { }
19 
20  // Virtual destructor (should always be there)
22 
25  bool veto(double eta, double phi, float value) const override ;
26 
28  void centerOn(double eta, double phi) override { }
29 
31  void setEvent(const edm::Event &iEvent, const edm::EventSetup &iSetup) override ;
32 
33  private:
35  float deltaR2_;
36  std::vector<Direction> items_;
37  };
38 
40  public:
43  src_(iC.consumes<edm::View<reco::Candidate> >(candidates)), veto_(veto) { }
44 
45  // Virtual destructor (should always be there)
46  ~OtherCandVeto() override {}
47 
50  bool veto(double eta, double phi, float value) const override ;
51 
53  void centerOn(double eta, double phi) override { }
54 
56  void setEvent(const edm::Event &iEvent, const edm::EventSetup &iSetup) override ;
57 
58  private:
60  std::vector<Direction> items_;
61  std::unique_ptr<AbsVeto> veto_;
62  };
63 
65  public:
67  OtherJetConstituentsDeltaRVeto(Direction dir, const edm::InputTag& jets, double dRjet, const edm::InputTag& pfCandAssocMap, double dRconstituent, edm::ConsumesCollector& iC)
68  : evt_(nullptr),
69  vetoDir_(dir),
70  srcJets_(iC.consumes<reco::PFJetCollection>(jets)),
71  dR2jet_(dRjet*dRjet),
72  srcPFCandAssocMap_(iC.consumes<JetToPFCandidateAssociation>(pfCandAssocMap)),
73  dR2constituent_(dRconstituent*dRconstituent)
74  {
75  //std::cout << "<OtherJetConstituentsDeltaRVeto::OtherJetConstituentsDeltaRVeto>:" << std::endl;
76  //std::cout << " vetoDir: eta = " << vetoDir_.eta() << ", phi = " << vetoDir_.phi() << std::endl;
77  //std::cout << " srcJets = " << srcJets_.label() << ":" << srcJets_.instance() << std::endl;
78  //std::cout << " dRjet = " << sqrt(dR2jet_) << std::endl;
79  //std::cout << " srcPFCandAssocMap = " << srcPFCandAssocMap_.label() << ":" << srcPFCandAssocMap_.instance() << std::endl;
80  //std::cout << " dRconstituent = " << sqrt(dR2constituent_) << std::endl;
81  }
82 
83  // Virtual destructor (should always be there)
85 
88  bool veto(double eta, double phi, float value) const override;
89 
91  void centerOn(double eta, double phi) override;
92 
94  void setEvent(const edm::Event& evt, const edm::EventSetup& es) override;
95 
96  private:
97  typedef edm::AssociationMap<edm::OneToMany<std::vector<reco::PFJet>, std::vector<reco::PFCandidate>, unsigned int> > JetToPFCandidateAssociation;
98 
99  void initialize();
100 
101  const edm::Event* evt_;
102 
105  double dR2jet_;
108  std::vector<Direction> items_;
109  };
110  }
111 }
112 #endif
edm::AssociationMap< edm::OneToMany< std::vector< reco::PFJet >, std::vector< reco::PFCandidate >, unsigned int > > JetToPFCandidateAssociation
static AlgebraicMatrix initialize()
edm::EDGetTokenT< edm::View< reco::Candidate > > src_
void centerOn(double eta, double phi) override
Nothing to do for this.
#define nullptr
edm::EDGetTokenT< edm::View< reco::Candidate > > src_
bool veto(double eta, double phi, float value) const override
int iEvent
Definition: GenABIO.cc:224
vector< PseudoJet > jets
edm::EDGetTokenT< JetToPFCandidateAssociation > srcPFCandAssocMap_
void centerOn(double eta, double phi) override
Nothing to do for this.
void setEvent(const edm::Event &iEvent, const edm::EventSetup &iSetup) override
Picks up the directions of the given candidates.
OtherJetConstituentsDeltaRVeto(Direction dir, const edm::InputTag &jets, double dRjet, const edm::InputTag &pfCandAssocMap, double dRconstituent, edm::ConsumesCollector &iC)
Create a veto specifying the input collection of the jets, the candidates, and the deltaR...
Definition: value.py:1
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:28
std::unique_ptr< AbsVeto > veto_
edm::EDGetTokenT< reco::PFJetCollection > srcJets_
OtherCandidatesDeltaRVeto(const edm::InputTag &candidates, double deltaR, edm::ConsumesCollector &iC)
Create a veto specifying the input collection of the candidates, and the deltaR.
std::vector< PFJet > PFJetCollection
collection of PFJet objects
fixed size matrix
HLT enums.
dbl *** dir
Definition: mlp_gen.cc:35
OtherCandVeto(const edm::InputTag &candidates, AbsVeto *veto, edm::ConsumesCollector &iC)
Create a veto specifying the input collection of the candidates, and the deltaR.