CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
HLTFiltCand Class Reference

#include <HLTFiltCand.h>

Inheritance diagram for HLTFiltCand:
HLTFilter edm::EDFilter edm::ProducerBase edm::ProductRegistryHelper

Public Member Functions

virtual bool filter (edm::Event &, const edm::EventSetup &)
 
 HLTFiltCand (const edm::ParameterSet &)
 
 ~HLTFiltCand ()
 
- Public Member Functions inherited from HLTFilter
 HLTFilter ()
 
virtual ~HLTFilter ()
 
- Public Member Functions inherited from edm::EDFilter
 EDFilter ()
 
virtual ~EDFilter ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Private Attributes

edm::InputTag ecalTag_
 
edm::InputTag elecTag_
 
edm::InputTag jetsTag_
 
edm::InputTag metsTag_
 
edm::InputTag mhtsTag_
 
double min_Pt_
 
edm::InputTag muonTag_
 
edm::InputTag photTag_
 
bool saveTags_
 
edm::InputTag tausTag_
 
edm::InputTag trckTag_
 

Additional Inherited Members

- Public Types inherited from edm::EDFilter
typedef EDFilter ModuleType
 
typedef WorkerT< EDFilterWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDFilter
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDFilter
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

Detailed Description

This class is an HLTFilter (-> EDFilter) implementing a very basic HLT trigger acting on candidates, requiring a g/e/m/j tuple above pt cuts

Date:
2008/05/05 15:48:33
Revision:
1.3
Author
Martin Grunewald

See header file for documentation

Date:
2008/05/09 05:59:22
Revision:
1.12
Author
Martin Grunewald

This class is an HLTFilter (-> EDFilter) implementing a minimum-bias HLT trigger acting on candidates, requiring tracks in Pixel det

Date:
29.3.2007 16:02:42
Author
Mika Huhtinen

This class is an HLTFilter (-> EDFilter) implementing a minimum-bias HLT trigger acting on candidates, requiring tracks in Pixel det

Date:
2007/07/26 13:56:52
Author
Mika Huhtinen

Definition at line 24 of file HLTFiltCand.h.

Constructor & Destructor Documentation

HLTFiltCand::HLTFiltCand ( const edm::ParameterSet iConfig)
explicit

Definition at line 45 of file HLTFiltCand.cc.

References ecalTag_, elecTag_, edm::InputTag::encode(), jetsTag_, LogDebug, metsTag_, mhtsTag_, min_Pt_, muonTag_, photTag_, tausTag_, and trckTag_.

45  :
46  photTag_ (iConfig.getParameter<edm::InputTag>("photTag")),
47  elecTag_ (iConfig.getParameter<edm::InputTag>("elecTag")),
48  muonTag_ (iConfig.getParameter<edm::InputTag>("muonTag")),
49  tausTag_ (iConfig.getParameter<edm::InputTag>("tausTag")),
50  jetsTag_ (iConfig.getParameter<edm::InputTag>("jetsTag")),
51  metsTag_ (iConfig.getParameter<edm::InputTag>("metsTag")),
52  mhtsTag_ (iConfig.getParameter<edm::InputTag>("mhtsTag")),
53  trckTag_ (iConfig.getParameter<edm::InputTag>("trckTag")),
54  ecalTag_ (iConfig.getParameter<edm::InputTag>("ecalTag")),
55  saveTags_(iConfig.getUntrackedParameter<bool>("saveTags",false)),
56  min_Pt_ (iConfig.getParameter<double>("MinPt"))
57 {
58  LogDebug("") << "MinPt cut " << min_Pt_
59  << " g: " << photTag_.encode()
60  << " e: " << elecTag_.encode()
61  << " m: " << muonTag_.encode()
62  << " t: " << tausTag_.encode()
63  << " j: " << jetsTag_.encode()
64  << " M: " << metsTag_.encode()
65  << " H: " << mhtsTag_.encode()
66  <<" TR: " << trckTag_.encode()
67  <<" SC: " << ecalTag_.encode()
68  ;
69 
70  //register your products
71  produces<trigger::TriggerFilterObjectWithRefs>();
72 }
#define LogDebug(id)
edm::InputTag elecTag_
Definition: HLTFiltCand.h:33
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
bool saveTags_
Definition: HLTFiltCand.h:42
edm::InputTag muonTag_
Definition: HLTFiltCand.h:34
std::string encode() const
Definition: InputTag.cc:72
edm::InputTag mhtsTag_
Definition: HLTFiltCand.h:38
edm::InputTag metsTag_
Definition: HLTFiltCand.h:37
edm::InputTag photTag_
Definition: HLTFiltCand.h:32
edm::InputTag jetsTag_
Definition: HLTFiltCand.h:36
edm::InputTag ecalTag_
Definition: HLTFiltCand.h:40
double min_Pt_
Definition: HLTFiltCand.h:44
edm::InputTag tausTag_
Definition: HLTFiltCand.h:35
edm::InputTag trckTag_
Definition: HLTFiltCand.h:39
HLTFiltCand::~HLTFiltCand ( )

Definition at line 74 of file HLTFiltCand.cc.

75 {
76 }

Member Function Documentation

bool HLTFiltCand::filter ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements HLTFilter.

Definition at line 84 of file HLTFiltCand.cc.

References accept(), ecalTag_, elecTag_, edm::Event::getByLabel(), analyzePatCleaning_cfg::jets, jetsTag_, LogDebug, metsTag_, mhtsTag_, min_Pt_, module(), ExpressReco_HICollisions_FallBack::muons, muonTag_, path(), ExpressReco_HICollisions_FallBack::photons, photTag_, edm::Event::put(), dt_offlineAnalysis_common_cff::reco, saveTags_, tausTag_, trckTag_, trigger::TriggerCluster, trigger::TriggerElectron, trigger::TriggerJet, trigger::TriggerMET, trigger::TriggerMHT, trigger::TriggerMuon, trigger::TriggerPhoton, trigger::TriggerTau, and trigger::TriggerTrack.

85 {
86  using namespace std;
87  using namespace edm;
88  using namespace reco;
89  using namespace trigger;
90 
91  // All HLT filters must create and fill an HLT filter object,
92  // recording any reconstructed physics objects satisfying (or not)
93  // this HLT filter, and place it in the Event.
94 
95  // The filter object
96  auto_ptr<TriggerFilterObjectWithRefs>
97  filterobject (new TriggerFilterObjectWithRefs(path(),module()));
98  if (saveTags_) {
99  filterobject->addCollectionTag(photTag_);
100  filterobject->addCollectionTag(elecTag_);
101  filterobject->addCollectionTag(muonTag_);
102  filterobject->addCollectionTag(tausTag_);
103  filterobject->addCollectionTag(jetsTag_);
104  filterobject->addCollectionTag(metsTag_);
105  filterobject->addCollectionTag(mhtsTag_);
106  filterobject->addCollectionTag(trckTag_);
107  filterobject->addCollectionTag(ecalTag_);
108  }
109 
110  // Specific filter code
111 
112  // get hold of products from Event
113 
115  Handle<ElectronCollection> electrons;
123 
124  iEvent.getByLabel(photTag_,photons );
125  iEvent.getByLabel(elecTag_,electrons);
126  iEvent.getByLabel(muonTag_,muons );
127  iEvent.getByLabel(tausTag_,taus );
128  iEvent.getByLabel(jetsTag_,jets );
129  iEvent.getByLabel(metsTag_,mets );
130  iEvent.getByLabel(mhtsTag_,mhts );
131  iEvent.getByLabel(trckTag_,trcks );
132  iEvent.getByLabel(ecalTag_,ecals );
133 
134 
135  // look for at least one g,e,m,t,j,M,H,TR,SC above its pt cut
136 
137  // photons
138  int nphot(0);
139  RecoEcalCandidateCollection::const_iterator aphot(photons->begin());
140  RecoEcalCandidateCollection::const_iterator ophot(photons->end());
141  RecoEcalCandidateCollection::const_iterator iphot;
142  for (iphot=aphot; iphot!=ophot; iphot++) {
143  if (iphot->pt() >= min_Pt_) {
144  nphot++;
145  RecoEcalCandidateRef ref(RecoEcalCandidateRef(photons,distance(aphot,iphot)));
146  filterobject->addObject(TriggerPhoton,ref);
147  }
148  }
149 
150  // electrons
151  int nelec(0);
152  ElectronCollection::const_iterator aelec(electrons->begin());
153  ElectronCollection::const_iterator oelec(electrons->end());
154  ElectronCollection::const_iterator ielec;
155  for (ielec=aelec; ielec!=oelec; ielec++) {
156  if (ielec->pt() >= min_Pt_) {
157  nelec++;
158  ElectronRef ref(ElectronRef(electrons,distance(aelec,ielec)));
159  filterobject->addObject(-TriggerElectron,ref);
160  }
161  }
162 
163  // muon
164  int nmuon(0);
165  RecoChargedCandidateCollection::const_iterator amuon(muons->begin());
166  RecoChargedCandidateCollection::const_iterator omuon(muons->end());
167  RecoChargedCandidateCollection::const_iterator imuon;
168  for (imuon=amuon; imuon!=omuon; imuon++) {
169  if (imuon->pt() >= min_Pt_) {
170  nmuon++;
171  RecoChargedCandidateRef ref(RecoChargedCandidateRef(muons,distance(amuon,imuon)));
172  filterobject->addObject(TriggerMuon,ref);
173  }
174  }
175 
176  // taus (are stored as jets)
177  int ntaus(0);
178  CaloJetCollection::const_iterator ataus(taus->begin());
179  CaloJetCollection::const_iterator otaus(taus->end());
180  CaloJetCollection::const_iterator itaus;
181  for (itaus=ataus; itaus!=otaus; itaus++) {
182  if (itaus->pt() >= min_Pt_) {
183  ntaus++;
184  CaloJetRef ref(CaloJetRef(taus,distance(ataus,itaus)));
185  filterobject->addObject(-TriggerTau,ref);
186  }
187  }
188 
189  // jets
190  int njets(0);
191  CaloJetCollection::const_iterator ajets(jets->begin());
192  CaloJetCollection::const_iterator ojets(jets->end());
193  CaloJetCollection::const_iterator ijets;
194  for (ijets=ajets; ijets!=ojets; ijets++) {
195  if (ijets->pt() >= min_Pt_) {
196  njets++;
197  CaloJetRef ref(CaloJetRef(jets,distance(ajets,ijets)));
198  filterobject->addObject(TriggerJet,ref);
199  }
200  }
201 
202  // mets
203  int nmets(0);
204  CaloMETCollection::const_iterator amets(mets->begin());
205  CaloMETCollection::const_iterator omets(mets->end());
206  CaloMETCollection::const_iterator imets;
207  for (imets=amets; imets!=omets; imets++) {
208  if (imets->pt() >= min_Pt_) {
209  nmets++;
210  CaloMETRef ref(CaloMETRef(mets,distance(amets,imets)));
211  filterobject->addObject(TriggerMET,ref);
212  }
213  }
214 
215  // mhts
216  int nmhts(0);
217  METCollection::const_iterator amhts(mhts->begin());
218  METCollection::const_iterator omhts(mhts->end());
219  METCollection::const_iterator imhts;
220  for (imhts=amhts; imhts!=omhts; imhts++) {
221  if (imhts->pt() >= min_Pt_) {
222  nmhts++;
223  METRef ref(METRef(mhts,distance(amhts,imhts)));
224  filterobject->addObject(TriggerMHT,ref);
225  }
226  }
227 
228  // trcks
229  int ntrck(0);
230  RecoChargedCandidateCollection::const_iterator atrcks(trcks->begin());
231  RecoChargedCandidateCollection::const_iterator otrcks(trcks->end());
232  RecoChargedCandidateCollection::const_iterator itrcks;
233  for (itrcks=atrcks; itrcks!=otrcks; itrcks++) {
234  if (itrcks->pt() >= min_Pt_) {
235  ntrck++;
236  RecoChargedCandidateRef ref(RecoChargedCandidateRef(trcks,distance(atrcks,itrcks)));
237  filterobject->addObject(TriggerTrack,ref);
238  }
239  }
240 
241  // ecals
242  int necal(0);
243  RecoEcalCandidateCollection::const_iterator aecals(ecals->begin());
244  RecoEcalCandidateCollection::const_iterator oecals(ecals->end());
245  RecoEcalCandidateCollection::const_iterator iecals;
246  for (iecals=aecals; iecals!=oecals; iecals++) {
247  if (iecals->pt() >= min_Pt_) {
248  necal++;
249  RecoEcalCandidateRef ref(RecoEcalCandidateRef(ecals,distance(aecals,iecals)));
250  filterobject->addObject(TriggerCluster,ref);
251  }
252  }
253 
254  // error case
255  // filterobject->addObject(0,Ref<vector<int> >());
256 
257  // final filter decision:
258  const bool accept ( (nphot>0) && (nelec>0) && (nmuon>0) && (ntaus>0) &&
259  (njets>0) && (nmets>0) && (nmhts>=0) && (ntrck>0) && (necal>0) );
260 
261  // All filters: put filter object into the Event
262  iEvent.put(filterobject);
263 
264  LogDebug("") << "Number of g/e/m/t/j/M/H/TR/SC objects accepted:"
265  << " " << nphot
266  << " " << nelec
267  << " " << nmuon
268  << " " << ntaus
269  << " " << njets
270  << " " << nmets
271  << " " << nmhts
272  << " " << ntrck
273  << " " << necal
274  ;
275 
276  // return with final filter decision
277  return accept;
278 }
#define LogDebug(id)
edm::InputTag elecTag_
Definition: HLTFiltCand.h:33
bool saveTags_
Definition: HLTFiltCand.h:42
int module() const
Definition: HLTadd.h:12
edm::InputTag muonTag_
Definition: HLTFiltCand.h:34
edm::Ref< RecoChargedCandidateCollection > RecoChargedCandidateRef
reference to an object in a collection of RecoChargedCandidate objects
edm::Ref< RecoEcalCandidateCollection > RecoEcalCandidateRef
reference to an object in a collection of RecoEcalCandidate objects
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:21
edm::Ref< ElectronCollection > ElectronRef
reference to an object in a collection of Electron objects
Definition: ElectronFwd.h:15
int path() const
Definition: HLTadd.h:3
edm::InputTag mhtsTag_
Definition: HLTFiltCand.h:38
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:84
edm::InputTag metsTag_
Definition: HLTFiltCand.h:37
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:359
edm::Ref< CaloJetCollection > CaloJetRef
edm references
edm::InputTag photTag_
Definition: HLTFiltCand.h:32
edm::InputTag jetsTag_
Definition: HLTFiltCand.h:36
edm::InputTag ecalTag_
Definition: HLTFiltCand.h:40
edm::Ref< CaloMETCollection > CaloMETRef
edm references
Definition: CaloMETFwd.h:14
edm::Ref< METCollection > METRef
edm references
Definition: METFwd.h:14
double min_Pt_
Definition: HLTFiltCand.h:44
edm::InputTag tausTag_
Definition: HLTFiltCand.h:35
edm::InputTag trckTag_
Definition: HLTFiltCand.h:39

Member Data Documentation

edm::InputTag HLTFiltCand::ecalTag_
private

Definition at line 40 of file HLTFiltCand.h.

Referenced by filter(), and HLTFiltCand().

edm::InputTag HLTFiltCand::elecTag_
private

Definition at line 33 of file HLTFiltCand.h.

Referenced by filter(), and HLTFiltCand().

edm::InputTag HLTFiltCand::jetsTag_
private

Definition at line 36 of file HLTFiltCand.h.

Referenced by filter(), and HLTFiltCand().

edm::InputTag HLTFiltCand::metsTag_
private

Definition at line 37 of file HLTFiltCand.h.

Referenced by filter(), and HLTFiltCand().

edm::InputTag HLTFiltCand::mhtsTag_
private

Definition at line 38 of file HLTFiltCand.h.

Referenced by filter(), and HLTFiltCand().

double HLTFiltCand::min_Pt_
private

Definition at line 44 of file HLTFiltCand.h.

Referenced by filter(), and HLTFiltCand().

edm::InputTag HLTFiltCand::muonTag_
private

Definition at line 34 of file HLTFiltCand.h.

Referenced by filter(), and HLTFiltCand().

edm::InputTag HLTFiltCand::photTag_
private

Definition at line 32 of file HLTFiltCand.h.

Referenced by filter(), and HLTFiltCand().

bool HLTFiltCand::saveTags_
private

Definition at line 42 of file HLTFiltCand.h.

Referenced by filter().

edm::InputTag HLTFiltCand::tausTag_
private

Definition at line 35 of file HLTFiltCand.h.

Referenced by filter(), and HLTFiltCand().

edm::InputTag HLTFiltCand::trckTag_
private

Definition at line 39 of file HLTFiltCand.h.

Referenced by filter(), and HLTFiltCand().