CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HLTEgammaTriggerFilterObjectWrapper.cc
Go to the documentation of this file.
1 
9 
11 
13 
15 
20 
21 #define TWOPI 6.283185308
22 //
23 // constructors and destructor
24 //
26 {
27  candIsolatedTag_ = iConfig.getParameter< edm::InputTag > ("candIsolatedTag");
28  candNonIsolatedTag_ = iConfig.getParameter< edm::InputTag > ("candNonIsolatedTag");
29  doIsolated_ = iConfig.getParameter<bool>("doIsolated");
30  candIsolatedToken_ = consumes<reco::RecoEcalCandidateCollection>(candIsolatedTag_);
31  if(!doIsolated_) candNonIsolatedToken_ = consumes<reco::RecoEcalCandidateCollection>(candNonIsolatedTag_);
32 }
33 
34 void
38  desc.add<edm::InputTag>("candIsolatedTag",edm::InputTag("hltL1IsoRecoEcalCandidate"));
39  desc.add<edm::InputTag>("candNonIsolatedTag",edm::InputTag("hltL1NonIsoRecoEcalCandidate"));
40  desc.add<bool>("doIsolated",false);
41  descriptions.add("hltEgammaTriggerFilterObjectWrapper",desc);
42 }
43 
45 
46 
47 // ------------ method called to produce the data ------------
49 {
50  using namespace trigger;
51  using namespace l1extra;
52 
53  // Get the recoEcalCandidates
55  iEvent.getByToken(candIsolatedToken_,recoIsolecalcands);
56 
58  // transform the L1Iso_RecoEcalCandidate into the TriggerFilterObjectWithRefs
59  for (reco::RecoEcalCandidateCollection::const_iterator recoecalcand= recoIsolecalcands->begin(); recoecalcand!=recoIsolecalcands->end(); recoecalcand++) {
60  ref = edm::Ref<reco::RecoEcalCandidateCollection>(recoIsolecalcands, distance(recoIsolecalcands->begin(),recoecalcand) );
61  filterproduct.addObject(TriggerCluster, ref);
62  }
63 
64  if(!doIsolated_) {
65  // transform the L1NonIso_RecoEcalCandidate into the TriggerFilterObjectWithRefs and add them to the L1Iso ones.
67  iEvent.getByToken(candNonIsolatedToken_,recoNonIsolecalcands);
68  for (reco::RecoEcalCandidateCollection::const_iterator recoecalcand= recoNonIsolecalcands->begin(); recoecalcand!=recoNonIsolecalcands->end(); recoecalcand++) {
69  ref = edm::Ref<reco::RecoEcalCandidateCollection>(recoNonIsolecalcands, distance(recoNonIsolecalcands->begin(),recoecalcand) );
70  filterproduct.addObject(TriggerCluster, ref);
71  }
72  }
73 
74  return true;
75  }
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::RecoEcalCandidateCollection > candIsolatedToken_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:464
virtual bool hltFilter(edm::Event &, const edm::EventSetup &, trigger::TriggerFilterObjectWithRefs &filterproduct) const override
void addObject(int id, const reco::RecoEcalCandidateRef &ref)
setters for L3 collections: (id=physics type, and Ref&lt;C&gt;)
int iEvent
Definition: GenABIO.cc:230
ParameterDescriptionBase * add(U const &iLabel, T const &value)
edm::EDGetTokenT< reco::RecoEcalCandidateCollection > candNonIsolatedToken_
static void makeHLTFilterDescription(edm::ParameterSetDescription &desc)
Definition: HLTFilter.cc:29
void add(std::string const &label, ParameterSetDescription const &psetDescription)