CMS 3D CMS Logo

HLTEcalIsolationFilter.cc
Go to the documentation of this file.
2 
4 
6 
8 
12 
14 {
15  candTag_ = iConfig.getParameter<edm::InputTag> ("EcalIsolatedParticleSource");
16  maxhitout = iConfig.getParameter<int> ("MaxNhitOuterCone");
17  maxhitin = iConfig.getParameter<int> ("MaxNhitInnerCone");
18  maxenin = iConfig.getParameter<double> ("MaxEnergyInnerCone");
19  maxenout = iConfig.getParameter<double> ("MaxEnergyOuterCone");
20  maxetacand = iConfig.getParameter<double> ("MaxEtaCandidate");
21  candToken_ = consumes<reco::IsolatedPixelTrackCandidateCollection>(candTag_);
22 }
23 
25 
26 void
30  desc.add<edm::InputTag>("EcalIsolatedParticleSource",edm::InputTag("ecalIsolPartProd"));
31  desc.add<int>("MaxNhitInnerCone",1000);
32  desc.add<int>("MaxNhitOuterCone",0);
33  desc.add<double>("MaxEnergyOuterCone",10000.);
34  desc.add<double>("MaxEnergyInnerCone",10000.);
35  desc.add<double>("MaxEtaCandidate",1.3);
36  descriptions.add("hltEcalIsolationFilter",desc);
37 }
38 
40 {
41 
42  // Ref to Candidate object to be recorded in filter object
44 
45  // get hold of filtered candidates
47  iEvent.getByToken(candToken_,ecIsolCands);
48 
49  //Filtering
50 
51  unsigned int n=0;
52  for (unsigned int i=0; i<ecIsolCands->size(); i++)
53  {
55 
56  if ((candref->nHitIn()<=maxhitin)&&(candref->nHitOut()<=maxhitout)&&(candref->energyOut()<maxenout)&&(candref->energyIn()<maxenin)&&fabs(candref->eta())<maxetacand)
57  {
58  filterproduct.addObject(trigger::TriggerTrack, candref);
59  n++;
60  }
61  }
62 
63 
64  bool accept(n>0);
65 
66  return accept;
67 
68 }
69 
70 
71 // declare this class as a framework plugin
T getParameter(std::string const &) const
~HLTEcalIsolationFilter() override
edm::EDGetTokenT< reco::IsolatedPixelTrackCandidateCollection > candToken_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:30
HLTEcalIsolationFilter(const edm::ParameterSet &)
void addObject(int id, const reco::RecoEcalCandidateRef &ref)
setters for L3 collections: (id=physics type, and Ref<C>)
int iEvent
Definition: GenABIO.cc:224
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
ParameterDescriptionBase * add(U const &iLabel, T const &value)
bool hltFilter(edm::Event &, const edm::EventSetup &, trigger::TriggerFilterObjectWithRefs &filterproduct) const override
static void makeHLTFilterDescription(edm::ParameterSetDescription &desc)
Definition: HLTFilter.cc:29
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void add(std::string const &label, ParameterSetDescription const &psetDescription)