CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HLT1CaloJetEnergy.cc
Go to the documentation of this file.
1 
14 
16 
20 
23 
25 
26 //
27 // constructors and destructor
28 //
30  inputTag_ (iConfig.getParameter<edm::InputTag>("inputTag")),
31  saveTag_ (iConfig.getUntrackedParameter<bool>("saveTag",false)),
32  min_E_ (iConfig.getParameter<double> ("MinE" )),
33  max_Eta_ (iConfig.getParameter<double> ("MaxEta" )),
34  min_N_ (iConfig.getParameter<int> ("MinN" ))
35 {
36  LogDebug("") << "Input/ecut/etacut/ncut : "
37  << inputTag_.encode() << " "
38  << min_E_ << " "
39  << max_Eta_ << " "
40  << min_N_ ;
41 
42  //register your products
43  produces<trigger::TriggerFilterObjectWithRefs>();
44 }
45 
47 {
48 }
49 
50 //
51 // member functions
52 //
53 
54 // ------------ method called to produce the data ------------
55 bool
57 {
58  using namespace std;
59  using namespace edm;
60  using namespace reco;
61  using namespace trigger;
62 
63  // All HLT filters must create and fill an HLT filter object,
64  // recording any reconstructed physics objects satisfying (or not)
65  // this HLT filter, and place it in the Event.
66 
67  // The filter object
68  auto_ptr<TriggerFilterObjectWithRefs>
69  filterobject (new TriggerFilterObjectWithRefs(path(),module()));
70  if (saveTag_) filterobject->addCollectionTag(inputTag_);
71  // Ref to Candidate object to be recorded in filter object
73 
74 
75  // get hold of collection of objects
77  iEvent.getByLabel (inputTag_,jets);
78 
79  // look at all objects, check cuts and add to filter object
80  int n(0);
81  CaloJetCollection::const_iterator i ( jets->begin() );
82  for (; i!=jets->end(); i++) {
83  if ( i->energy() >= min_E_ &&
84  fabs(i->eta()) <= max_Eta_ ) {
85  n++;
86  ref=Ref<CaloJetCollection>(jets,distance(jets->begin(),i));
87  filterobject->addObject(TriggerJet,ref);
88  }
89  }
90 
91  // filter decision
92  bool accept(n>=min_N_);
93 
94  // put filter object into the Event
95  iEvent.put(filterobject);
96 
97  return accept;
98 }
99 
100 
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
int module() const
Definition: HLTadd.h:12
HLT1CaloJetEnergy(const edm::ParameterSet &)
edm::InputTag inputTag_
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:21
std::string encode() const
Definition: InputTag.cc:72
int path() const
Definition: HLTadd.h:3
int iEvent
Definition: GenABIO.cc:243
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:84
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:359
virtual bool filter(edm::Event &, const edm::EventSetup &)