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

 HLTFiltCand (const edm::ParameterSet &)
 
virtual bool hltFilter (edm::Event &, const edm::EventSetup &, trigger::TriggerFilterObjectWithRefs &filterproduct)
 
 ~HLTFiltCand ()
 
- Public Member Functions inherited from HLTFilter
 HLTFilter (const edm::ParameterSet &config)
 
int module () const
 
const std::string * moduleLabel () const
 
int path () const
 
const std::string * pathName () const
 
std::pair< int, int > pmid () const
 
bool saveTags () const
 
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_
 
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 HLTFilter
static void makeHLTFilterDescription (edm::ParameterSetDescription &desc)
 
- Static Public Member Functions inherited from edm::EDFilter
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- 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:
2012/01/21 14:56:58
Revision:
1.5
Author
Martin Grunewald

See header file for documentation

Date:
2012/01/21 14:56:59
Revision:
1.18
Author
Martin Grunewald

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

Date:
2012/01/21 15:00:14
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  : HLTFilter(iConfig),
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  min_Pt_ (iConfig.getParameter<double>("MinPt"))
56 {
57  LogDebug("") << "MinPt cut " << min_Pt_
58  << " g: " << photTag_.encode()
59  << " e: " << elecTag_.encode()
60  << " m: " << muonTag_.encode()
61  << " t: " << tausTag_.encode()
62  << " j: " << jetsTag_.encode()
63  << " M: " << metsTag_.encode()
64  << " H: " << mhtsTag_.encode()
65  <<" TR: " << trckTag_.encode()
66  <<" SC: " << ecalTag_.encode()
67  ;
68 }
#define LogDebug(id)
edm::InputTag elecTag_
Definition: HLTFiltCand.h:33
T getParameter(std::string const &) const
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
HLTFilter(const edm::ParameterSet &config)
Definition: HLTFilter.cc:18
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:42
edm::InputTag tausTag_
Definition: HLTFiltCand.h:35
edm::InputTag trckTag_
Definition: HLTFiltCand.h:39
HLTFiltCand::~HLTFiltCand ( )

Definition at line 70 of file HLTFiltCand.cc.

71 {
72 }

Member Function Documentation

bool HLTFiltCand::hltFilter ( edm::Event iEvent,
const edm::EventSetup iSetup,
trigger::TriggerFilterObjectWithRefs filterproduct 
)
virtual

Implements HLTFilter.

Definition at line 80 of file HLTFiltCand.cc.

References accept(), trigger::TriggerFilterObjectWithRefs::addCollectionTag(), trigger::TriggerRefsCollections::addObject(), ecalTag_, elecTag_, HI_PhotonSkim_cff::electrons, edm::Event::getByLabel(), fwrapper::jets, jetsTag_, LogDebug, metsTag_, mhtsTag_, min_Pt_, patZpeak::muons, muonTag_, interactiveExample::photons, photTag_, dt_dqm_sourceclient_common_cff::reco, HLTFilter::saveTags(), tausTag_, trckTag_, trigger::TriggerCluster, trigger::TriggerElectron, trigger::TriggerJet, trigger::TriggerMET, trigger::TriggerMHT, trigger::TriggerMuon, trigger::TriggerPhoton, trigger::TriggerTau, and trigger::TriggerTrack.

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

edm::InputTag HLTFiltCand::elecTag_
private

Definition at line 33 of file HLTFiltCand.h.

Referenced by HLTFiltCand(), and hltFilter().

edm::InputTag HLTFiltCand::jetsTag_
private

Definition at line 36 of file HLTFiltCand.h.

Referenced by HLTFiltCand(), and hltFilter().

edm::InputTag HLTFiltCand::metsTag_
private

Definition at line 37 of file HLTFiltCand.h.

Referenced by HLTFiltCand(), and hltFilter().

edm::InputTag HLTFiltCand::mhtsTag_
private

Definition at line 38 of file HLTFiltCand.h.

Referenced by HLTFiltCand(), and hltFilter().

double HLTFiltCand::min_Pt_
private

Definition at line 42 of file HLTFiltCand.h.

Referenced by HLTFiltCand(), and hltFilter().

edm::InputTag HLTFiltCand::muonTag_
private

Definition at line 34 of file HLTFiltCand.h.

Referenced by HLTFiltCand(), and hltFilter().

edm::InputTag HLTFiltCand::photTag_
private

Definition at line 32 of file HLTFiltCand.h.

Referenced by HLTFiltCand(), and hltFilter().

edm::InputTag HLTFiltCand::tausTag_
private

Definition at line 35 of file HLTFiltCand.h.

Referenced by HLTFiltCand(), and hltFilter().

edm::InputTag HLTFiltCand::trckTag_
private

Definition at line 39 of file HLTFiltCand.h.

Referenced by HLTFiltCand(), and hltFilter().