CMS 3D CMS Logo

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

#include <TriggerSummaryProducerAOD.h>

Inheritance diagram for TriggerSummaryProducerAOD:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

Classes

struct  OrderInputTag
 InputTag ordering class. More...
 

Public Member Functions

virtual void endJob ()
 
template<typename C >
void fillFilterObjectMember (const int &, const int &, const edm::Ref< C > &)
 
void fillFilterObjectMember (const int &, const int &, const edm::Ref< l1extra::L1HFRingsCollection > &)
 
void fillFilterObjectMember (const int &, const int &, const edm::Ref< l1extra::L1EtMissParticleCollection > &)
 
void fillFilterObjectMember (const int &, const int &, const edm::Ref< reco::CaloMETCollection > &)
 
void fillFilterObjectMember (const int &, const int &, const edm::Ref< reco::METCollection > &)
 
template<typename C >
void fillFilterObjectMembers (const edm::Event &, const edm::InputTag &tag, const trigger::Vids &, const std::vector< edm::Ref< C > > &)
 
template<typename T >
void fillTriggerObject (const T &)
 
void fillTriggerObject (const l1extra::L1HFRings &)
 
void fillTriggerObject (const l1extra::L1EtMissParticle &)
 
void fillTriggerObject (const reco::CaloMET &)
 
void fillTriggerObject (const reco::MET &)
 
template<typename C >
void fillTriggerObjectCollections (const edm::Event &)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
 TriggerSummaryProducerAOD (const edm::ParameterSet &)
 
 ~TriggerSummaryProducerAOD ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- 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 Types

typedef std::set
< edm::InputTag, OrderInputTag
InputTagSet
 

Private Attributes

InputTagSet collectionTagsEvent_
 list of L3 collection tags More...
 
InputTagSet collectionTagsGlobal_
 
InputTagSet filterTagsEvent_
 list of L3 filter tags More...
 
InputTagSet filterTagsGlobal_
 
std::vector< edm::Handle
< trigger::TriggerFilterObjectWithRefs > > 
fobs_
 handles to the filter objects More...
 
trigger::Vids ids_
 ids More...
 
trigger::Keys keys_
 keys More...
 
std::vector< bool > maskFilters_
 packing decision More...
 
std::map< edm::ProductID,
unsigned int > 
offset_
 global map for indices into toc_: offset per input L3 collection More...
 
std::string pn_
 process name More...
 
edm::ProcessNameSelector selector_
 selector for getMany methods More...
 
std::vector< std::string > tags_
 
edm::service::TriggerNamesServicetns_
 the pointer to the current TriggerNamesService More...
 
trigger::TriggerObjectCollection toc_
 trigger object collection More...
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDProducer
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 EDProducer making the HLT summary object for AOD

Date:
2010/11/08 15:47:45
Revision:
1.15
Author
Martin Grunewald

See header file for documentation

Date:
2010/11/08 15:47:45
Revision:
1.42
Author
Martin Grunewald

Definition at line 43 of file TriggerSummaryProducerAOD.h.

Member Typedef Documentation

Definition at line 101 of file TriggerSummaryProducerAOD.h.

Constructor & Destructor Documentation

TriggerSummaryProducerAOD::TriggerSummaryProducerAOD ( const edm::ParameterSet ps)
explicit

Definition at line 55 of file TriggerSummaryProducerAOD.cc.

References collectionTagsEvent_, collectionTagsGlobal_, filterTagsEvent_, filterTagsGlobal_, edm::service::TriggerNamesService::getProcessName(), LogDebug, cmsCodeRules.cppFunctionSkipper::operator, pn_, selector_, and tns_.

55  :
56  pn_(ps.getParameter<std::string>("processName")),
58  tns_(),
59  filterTagsEvent_(pn_!="*"),
60  filterTagsGlobal_(pn_!="*"),
63  toc_(),
64  tags_(),
65  offset_(),
66  fobs_(),
67  keys_(),
68  ids_(),
69  maskFilters_()
70 {
71  if (pn_=="@") {
72  // use tns
74  // get tns pointer
76  if (tns_!=0) {
78  } else {
79  edm::LogError("TriggerSummaryProducerAOD") << "HLT Error: TriggerNamesService pointer = 0!";
80  pn_="*";
81  }
82  } else {
83  edm::LogError("TriggerSummaryProducerAOD") << "HLT Error: TriggerNamesService not available!";
84  pn_="*";
85  }
91  }
92  LogDebug("TriggerSummaryProducerAOD") << "Using process name: '" << pn_ <<"'";
93 
94  filterTagsGlobal_.clear();
95  collectionTagsGlobal_.clear();
96 
97  produces<trigger::TriggerEvent>();
98 
99 }
#define LogDebug(id)
T getParameter(std::string const &) const
std::string const & getProcessName() const
trigger::TriggerObjectCollection toc_
trigger object collection
std::vector< bool > maskFilters_
packing decision
std::set< edm::InputTag, OrderInputTag > InputTagSet
edm::ProcessNameSelector selector_
selector for getMany methods
edm::service::TriggerNamesService * tns_
the pointer to the current TriggerNamesService
std::vector< std::string > tags_
std::map< edm::ProductID, unsigned int > offset_
global map for indices into toc_: offset per input L3 collection
std::vector< edm::Handle< trigger::TriggerFilterObjectWithRefs > > fobs_
handles to the filter objects
InputTagSet collectionTagsEvent_
list of L3 collection tags
std::string pn_
process name
InputTagSet filterTagsEvent_
list of L3 filter tags
TriggerSummaryProducerAOD::~TriggerSummaryProducerAOD ( )

Definition at line 101 of file TriggerSummaryProducerAOD.cc.

102 {
103 }

Member Function Documentation

void TriggerSummaryProducerAOD::endJob ( void  )
virtual

Reimplemented from edm::EDProducer.

Definition at line 511 of file TriggerSummaryProducerAOD.cc.

References collectionTagsGlobal_, benchmark_cfg::fb, and filterTagsGlobal_.

511  {
512 
513  using namespace std;
514  using namespace edm;
515  using namespace trigger;
516 
517  LogVerbatim("TriggerSummaryProducerAOD") << endl;
518  LogVerbatim("TriggerSummaryProducerAOD") << "TriggerSummaryProducerAOD::endJob - accumulated tags:" << endl;
519 
520  const unsigned int nc(collectionTagsGlobal_.size());
521  const unsigned int nf(filterTagsGlobal_.size());
522  LogVerbatim("TriggerSummaryProducerAOD") << " Overall number of Collections/Filters: "
523  << nc << "/" << nf << endl;
524 
525  LogVerbatim("TriggerSummaryProducerAOD") << " The collections: " << nc << endl;
526  const InputTagSet::const_iterator cb(collectionTagsGlobal_.begin());
527  const InputTagSet::const_iterator ce(collectionTagsGlobal_.end());
528  for ( InputTagSet::const_iterator ci=cb; ci!=ce; ++ci) {
529  LogVerbatim("TriggerSummaryProducerAOD") << " " << distance(cb,ci) << " " << ci->encode() << endl;
530  }
531 
532  LogVerbatim("TriggerSummaryProducerAOD") << " The filters:" << nf << endl;
533  const InputTagSet::const_iterator fb(filterTagsGlobal_.begin());
534  const InputTagSet::const_iterator fe(filterTagsGlobal_.end());
535  for ( InputTagSet::const_iterator fi=fb; fi!=fe; ++fi) {
536  LogVerbatim("TriggerSummaryProducerAOD") << " " << distance(fb,fi) << " " << fi->encode() << endl;
537  }
538 
539  LogVerbatim("TriggerSummaryProducerAOD") << "TriggerSummaryProducerAOD::endJob." << endl;
540  LogVerbatim("TriggerSummaryProducerAOD") << endl;
541 
542  return;
543 
544 }
template<typename C >
void TriggerSummaryProducerAOD::fillFilterObjectMember ( const int &  offset,
const int &  id,
const edm::Ref< C > &  ref 
)

Definition at line 439 of file TriggerSummaryProducerAOD.cc.

References ids_, edm::Ref< C, T, F >::key(), and keys_.

Referenced by fillFilterObjectMembers().

439  {
440 
441  keys_.push_back(offset+ref.key());
442  ids_.push_back(id);
443 
444  return;
445 }
unsigned int offset(bool)
key_type key() const
Accessor for product key.
Definition: Ref.h:265
void TriggerSummaryProducerAOD::fillFilterObjectMember ( const int &  offset,
const int &  id,
const edm::Ref< l1extra::L1HFRingsCollection > &  ref 
)

Definition at line 447 of file TriggerSummaryProducerAOD.cc.

References ids_, edm::Ref< C, T, F >::key(), keys_, and trigger::TriggerL1HfBitCounts.

447  {
448 
449  using namespace trigger;
450 
451  if (id==TriggerL1HfBitCounts) {
452  keys_.push_back(offset+2*ref.key()+1);
453  } else { // if (ids[i]==TriggerL1HfRingEtSums) {
454  keys_.push_back(offset+2*ref.key()+0);
455  }
456  ids_.push_back(id);
457 
458  return;
459 }
unsigned int offset(bool)
key_type key() const
Accessor for product key.
Definition: Ref.h:265
void TriggerSummaryProducerAOD::fillFilterObjectMember ( const int &  offset,
const int &  id,
const edm::Ref< l1extra::L1EtMissParticleCollection > &  ref 
)

Definition at line 461 of file TriggerSummaryProducerAOD.cc.

References ids_, edm::Ref< C, T, F >::key(), keys_, trigger::TriggerL1ETT, and trigger::TriggerL1HTT.

461  {
462 
463  using namespace trigger;
464 
465  if ( (id==TriggerL1ETT) || (id==TriggerL1HTT) ) {
466  keys_.push_back(offset+2*ref.key()+1);
467  } else {
468  keys_.push_back(offset+2*ref.key()+0);
469  }
470  ids_.push_back(id);
471 
472  return;
473 }
unsigned int offset(bool)
key_type key() const
Accessor for product key.
Definition: Ref.h:265
void TriggerSummaryProducerAOD::fillFilterObjectMember ( const int &  offset,
const int &  id,
const edm::Ref< reco::CaloMETCollection > &  ref 
)

Definition at line 475 of file TriggerSummaryProducerAOD.cc.

References ids_, edm::Ref< C, T, F >::key(), keys_, trigger::TriggerELongit, trigger::TriggerHLongit, trigger::TriggerMETSig, trigger::TriggerMHTSig, trigger::TriggerTET, and trigger::TriggerTHT.

475  {
476 
477  using namespace trigger;
478 
479  if ( (id==TriggerTHT) || (id==TriggerTET) ) {
480  keys_.push_back(offset+4*ref.key()+1);
481  } else if ( (id==TriggerMETSig) || (id==TriggerMHTSig) ) {
482  keys_.push_back(offset+4*ref.key()+2);
483  } else if ( (id==TriggerELongit) || (id==TriggerHLongit) ) {
484  keys_.push_back(offset+4*ref.key()+3);
485  } else {
486  keys_.push_back(offset+4*ref.key()+0);
487  }
488  ids_.push_back(id);
489 
490  return;
491 }
unsigned int offset(bool)
key_type key() const
Accessor for product key.
Definition: Ref.h:265
void TriggerSummaryProducerAOD::fillFilterObjectMember ( const int &  offset,
const int &  id,
const edm::Ref< reco::METCollection > &  ref 
)

Definition at line 493 of file TriggerSummaryProducerAOD.cc.

References ids_, edm::Ref< C, T, F >::key(), keys_, trigger::TriggerELongit, trigger::TriggerHLongit, trigger::TriggerMETSig, trigger::TriggerMHTSig, trigger::TriggerTET, and trigger::TriggerTHT.

493  {
494 
495  using namespace trigger;
496 
497  if ( (id==TriggerTHT) || (id==TriggerTET) ) {
498  keys_.push_back(offset+4*ref.key()+1);
499  } else if ( (id==TriggerMETSig) || (id==TriggerMHTSig) ) {
500  keys_.push_back(offset+4*ref.key()+2);
501  } else if ( (id==TriggerELongit) || (id==TriggerHLongit) ) {
502  keys_.push_back(offset+4*ref.key()+3);
503  } else {
504  keys_.push_back(offset+4*ref.key()+0);
505  }
506  ids_.push_back(id);
507 
508  return;
509 }
unsigned int offset(bool)
key_type key() const
Accessor for product key.
Definition: Ref.h:265
template<typename C >
void TriggerSummaryProducerAOD::fillFilterObjectMembers ( const edm::Event iEvent,
const edm::InputTag tag,
const trigger::Vids ids,
const std::vector< edm::Ref< C > > &  refs 
)

this routine takes a vector of Ref<C>s and determines the corresponding vector of keys (i.e., indices) into the TriggerObjectCollection

Definition at line 398 of file TriggerSummaryProducerAOD.cc.

References funct::C, edm::InputTag::encode(), fillFilterObjectMember(), edm::Event::getProvenance(), i, label, min, edm::Provenance::moduleLabel(), n, mergeVDriftHistosByStation::name, offset_, evf::utils::pid, align_tpl::process, edm::Provenance::processName(), edm::Provenance::productInstanceName(), and dt_dqm_sourceclient_common_cff::reco.

Referenced by produce().

398  {
399 
403 
404  using namespace std;
405  using namespace edm;
406  using namespace reco;
407  using namespace l1extra;
408  using namespace trigger;
409 
410  if (ids.size()!=refs.size()) {
411  LogError("TriggerSummaryProducerAOD") << "Vector length is different: "
412  << ids.size() << " " << refs.size();
413  }
414 
415  const unsigned int n(min(ids.size(),refs.size()));
416  for (unsigned int i=0; i!=n; ++i) {
417  const ProductID pid(refs[i].id());
418  if (offset_.find(pid)==offset_.end()) {
419  const string& label(iEvent.getProvenance(pid).moduleLabel());
420  const string& instance(iEvent.getProvenance(pid).productInstanceName());
421  const string& process(iEvent.getProvenance(pid).processName());
422  LogError("TriggerSummaryProducerAOD")
423  << "Uunknown pid:"
424  << " FilterTag/Key: " << tag.encode()
425  << "/" << i
426  << " CollectionTag/Key: "
427  << InputTag(label,instance,process).encode()
428  << "/" << refs[i].key()
429  << " CollectionType: " << typeid(C).name();
430  } else {
431  fillFilterObjectMember(offset_[pid],ids[i],refs[i]);
432  }
433  }
434  return;
435 
436 }
int i
Definition: DBlmapReader.cc:9
const std::string & label
Definition: MVAComputer.cc:186
#define min(a, b)
Definition: mlp_lapack.h:161
void fillFilterObjectMember(const int &, const int &, const edm::Ref< C > &)
std::string const & processName() const
Definition: Provenance.h:63
std::string encode() const
Definition: InputTag.cc:72
std::map< edm::ProductID, unsigned int > offset_
global map for indices into toc_: offset per input L3 collection
std::string const & moduleLabel() const
Definition: Provenance.h:62
tuple process
Definition: align_tpl.py:3
std::string const & productInstanceName() const
Definition: Provenance.h:65
Provenance getProvenance(BranchID const &theID) const
Definition: Event.cc:61
template<typename T >
void TriggerSummaryProducerAOD::fillTriggerObject ( const T object)

Definition at line 327 of file TriggerSummaryProducerAOD.cc.

References toc_.

Referenced by fillTriggerObjectCollections().

327  {
328 
329  using namespace trigger;
330  toc_.push_back( TriggerObject(object) );
331 
332  return;
333 }
trigger::TriggerObjectCollection toc_
trigger object collection
Single trigger physics object (e.g., an isolated muon)
Definition: TriggerObject.h:24
void TriggerSummaryProducerAOD::fillTriggerObject ( const l1extra::L1HFRings object)

Definition at line 335 of file TriggerSummaryProducerAOD.cc.

References toc_, trigger::TriggerL1HfBitCounts, and trigger::TriggerL1HfRingEtSums.

335  {
336 
337  using namespace l1extra;
338  using namespace trigger;
339 
341  object.hfEtSum(L1HFRings::kRing1PosEta),
342  object.hfEtSum(L1HFRings::kRing1NegEta),
343  object.hfEtSum(L1HFRings::kRing2PosEta),
344  object.hfEtSum(L1HFRings::kRing2NegEta) ) );
346  object.hfBitCount(L1HFRings::kRing1PosEta),
347  object.hfBitCount(L1HFRings::kRing1NegEta),
348  object.hfBitCount(L1HFRings::kRing2PosEta),
349  object.hfBitCount(L1HFRings::kRing2NegEta) ) );
350 
351  return;
352 }
trigger::TriggerObjectCollection toc_
trigger object collection
Single trigger physics object (e.g., an isolated muon)
Definition: TriggerObject.h:24
void TriggerSummaryProducerAOD::fillTriggerObject ( const l1extra::L1EtMissParticle object)

Definition at line 354 of file TriggerSummaryProducerAOD.cc.

References toc_, trigger::TriggerL1ETT, and trigger::TriggerL1HTT.

354  {
355 
356  using namespace l1extra;
357  using namespace trigger;
358 
359  toc_.push_back( TriggerObject(object) );
360  if (object.type()==L1EtMissParticle::kMET) {
361  toc_.push_back(TriggerObject(TriggerL1ETT,object.etTotal(),0.0,0.0,0.0));
362  } else if (object.type()==L1EtMissParticle::kMHT) {
363  toc_.push_back(TriggerObject(TriggerL1HTT,object.etTotal(),0.0,0.0,0.0));
364  } else {
365  toc_.push_back(TriggerObject(0, object.etTotal(),0.0,0.0,0.0));
366  }
367 
368  return;
369 }
type
Definition: HCALResponse.h:22
trigger::TriggerObjectCollection toc_
trigger object collection
Single trigger physics object (e.g., an isolated muon)
Definition: TriggerObject.h:24
void TriggerSummaryProducerAOD::fillTriggerObject ( const reco::CaloMET object)

Definition at line 371 of file TriggerSummaryProducerAOD.cc.

References dt_dqm_sourceclient_common_cff::reco, toc_, trigger::TriggerELongit, trigger::TriggerMETSig, and trigger::TriggerTET.

371  {
372 
373  using namespace reco;
374  using namespace trigger;
375 
376  toc_.push_back( TriggerObject(object) );
377  toc_.push_back(TriggerObject(TriggerTET ,object.sumEt() ,0.0,0.0,0.0));
378  toc_.push_back(TriggerObject(TriggerMETSig ,object.mEtSig() ,0.0,0.0,0.0));
379  toc_.push_back(TriggerObject(TriggerELongit,object.e_longitudinal(),0.0,0.0,0.0));
380 
381  return;
382 }
trigger::TriggerObjectCollection toc_
trigger object collection
Single trigger physics object (e.g., an isolated muon)
Definition: TriggerObject.h:24
void TriggerSummaryProducerAOD::fillTriggerObject ( const reco::MET object)

Definition at line 384 of file TriggerSummaryProducerAOD.cc.

References dt_dqm_sourceclient_common_cff::reco, toc_, trigger::TriggerHLongit, trigger::TriggerMHTSig, and trigger::TriggerTHT.

384  {
385 
386  using namespace reco;
387  using namespace trigger;
388 
389  toc_.push_back( TriggerObject(object) );
390  toc_.push_back(TriggerObject(TriggerTHT ,object.sumEt() ,0.0,0.0,0.0));
391  toc_.push_back(TriggerObject(TriggerMHTSig ,object.mEtSig() ,0.0,0.0,0.0));
392  toc_.push_back(TriggerObject(TriggerHLongit,object.e_longitudinal(),0.0,0.0,0.0));
393 
394  return;
395 }
trigger::TriggerObjectCollection toc_
trigger object collection
Single trigger physics object (e.g., an isolated muon)
Definition: TriggerObject.h:24
template<typename C >
void TriggerSummaryProducerAOD::fillTriggerObjectCollections ( const edm::Event iEvent)

this routine accesses the original (L3) collections (with C++ typename C), extracts 4-momentum and id of each collection member, and packs this up

end loop over handles

Definition at line 286 of file TriggerSummaryProducerAOD.cc.

References collectionTagsEvent_, fillTriggerObject(), edm::Event::getMany(), i, keys_, label, edm::Provenance::moduleLabel(), n, offset_, evf::utils::pid, align_tpl::process, edm::Provenance::processName(), edm::Provenance::productInstanceName(), dt_dqm_sourceclient_common_cff::reco, selector_, findQualityFiles::size, tags_, and toc_.

286  {
287 
291 
292  using namespace std;
293  using namespace edm;
294  using namespace reco;
295  using namespace l1extra;
296  using namespace trigger;
297 
298  vector<Handle<C> > collections;
299  iEvent.getMany(selector_,collections);
300  const unsigned int nc(collections.size());
301 
302  for (unsigned int ic=0; ic!=nc; ++ic) {
303  const Provenance& provenance(*(collections[ic].provenance()));
304  const string& label (provenance.moduleLabel());
305  const string& instance (provenance.productInstanceName());
306  const string& process (provenance.processName());
307  const InputTag collectionTag(label,instance,process);
308 
309  if (collectionTagsEvent_.find(collectionTag)!=collectionTagsEvent_.end()) {
310  const ProductID pid(collections[ic].provenance()->productID());
311  if (offset_.find(pid)!=offset_.end()) {
312  LogError("TriggerSummaryProducerAOD") << "Duplicate pid!";
313  }
314  offset_[pid]=toc_.size();
315  const unsigned int n(collections[ic]->size());
316  for (unsigned int i=0; i!=n; ++i) {
317  fillTriggerObject( (*collections[ic])[i] );
318  }
319  tags_.push_back(collectionTag.encode());
320  keys_.push_back(toc_.size());
321  }
322 
323  }
324 }
int i
Definition: DBlmapReader.cc:9
const std::string & label
Definition: MVAComputer.cc:186
trigger::TriggerObjectCollection toc_
trigger object collection
edm::ProcessNameSelector selector_
selector for getMany methods
std::vector< std::string > tags_
void getMany(SelectorBase const &sel, std::vector< Handle< PROD > > &results) const
Definition: Event.h:387
std::map< edm::ProductID, unsigned int > offset_
global map for indices into toc_: offset per input L3 collection
tuple process
Definition: align_tpl.py:3
InputTagSet collectionTagsEvent_
list of L3 collection tags
tuple size
Write out results.
void TriggerSummaryProducerAOD::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

get hold of filter objects

check whether collection tags are recorded in filterobjects; if so, these are L3 collections to be packed up, and the corresponding filter is a L3 filter also to be packed up. Record the InputTags of those L3 filters and L3 collections.

check uniqueness count

accumulate for endJob printout

debug printout

event-by-event tags

Now the processing: first trigger objects from L3 collections, then L3 filter objects

create trigger objects, fill triggerobjectcollection and offset map

construct single AOD product, reserving capacity

fill trigger object collection

fill the L3 filter objects

Implements edm::EDProducer.

Definition at line 139 of file TriggerSummaryProducerAOD.cc.

References collectionTagsEvent_, collectionTagsGlobal_, benchmark_cfg::fb, fillFilterObjectMembers(), filterTagsEvent_, filterTagsGlobal_, fobs_, edm::Event::getMany(), ids_, iEvent, edm::isDebugEnabled(), keys_, label, LogDebug, LogTrace, maskFilters_, moduleLabel(), offset_, pn_, align_tpl::process, edm::Event::put(), dt_dqm_sourceclient_common_cff::reco, selector_, tags_, and toc_.

140 {
141  using namespace std;
142  using namespace edm;
143  using namespace reco;
144  using namespace l1extra;
145  using namespace trigger;
146 
149  fobs_.clear();
150  iEvent.getMany(selector_,fobs_);
151  const unsigned int nfob(fobs_.size());
152  LogTrace("TriggerSummaryProducerAOD") << "Number of filter objects found: " << nfob;
153 
154  string tagLabel,tagInstance,tagProcess;
155 
161  maskFilters_.clear();
162  maskFilters_.resize(nfob);
163  filterTagsEvent_.clear();
164  collectionTagsEvent_.clear();
165  unsigned int nf(0);
166  for (unsigned int ifob=0; ifob!=nfob; ++ifob) {
167  maskFilters_[ifob]=false;
168  const vector<string>& collectionTags_(fobs_[ifob]->getCollectionTagsAsStrings());
169  const unsigned int ncol(collectionTags_.size());
170  if (ncol>0) {
171  nf++;
172  maskFilters_[ifob]=true;
173  const string& label (fobs_[ifob].provenance()->moduleLabel());
174  const string& instance (fobs_[ifob].provenance()->productInstanceName());
175  const string& process (fobs_[ifob].provenance()->processName());
176  filterTagsEvent_.insert(InputTag(label,instance,process));
177  for (unsigned int icol=0; icol!=ncol; ++icol) {
178  // overwrite process name (usually not set)
179  tokenizeTag(collectionTags_[icol],tagLabel,tagInstance,tagProcess);
180  collectionTagsEvent_.insert(InputTag(tagLabel,tagInstance,pn_));
181  }
182  }
183  }
185  if (filterTagsEvent_.size()!=nf) {
186  LogError("TriggerSummaryProducerAOD")
187  << "Mismatch in number of filter tags: "
188  << filterTagsEvent_.size() << "!=" << nf ;
189  }
190 
194 
196  if (isDebugEnabled()) {
197 
199  const unsigned int nc(collectionTagsEvent_.size());
200  LogTrace("TriggerSummaryProducerAOD") << "Number of unique collections requested " << nc;
201  const InputTagSet::const_iterator cb(collectionTagsEvent_.begin());
202  const InputTagSet::const_iterator ce(collectionTagsEvent_.end());
203  for ( InputTagSet::const_iterator ci=cb; ci!=ce; ++ci) {
204  LogTrace("TriggerSummaryProducerAOD") << distance(cb,ci) << " " << ci->encode();
205  }
206  const unsigned int nf(filterTagsEvent_.size());
207  LogTrace("TriggerSummaryProducerAOD") << "Number of unique filters requested " << nf;
208  const InputTagSet::const_iterator fb(filterTagsEvent_.begin());
209  const InputTagSet::const_iterator fe(filterTagsEvent_.end());
210  for ( InputTagSet::const_iterator fi=fb; fi!=fe; ++fi) {
211  LogTrace("TriggerSummaryProducerAOD") << distance(fb,fi) << " " << fi->encode();
212  }
213 
214  }
215 
221  toc_.clear();
222  tags_.clear();
223  keys_.clear();
224  offset_.clear();
225  fillTriggerObjectCollections< RecoEcalCandidateCollection>(iEvent);
226  fillTriggerObjectCollections< ElectronCollection>(iEvent);
227  fillTriggerObjectCollections< RecoChargedCandidateCollection>(iEvent);
228  fillTriggerObjectCollections< CaloJetCollection>(iEvent);
229  fillTriggerObjectCollections< CompositeCandidateCollection>(iEvent);
230  fillTriggerObjectCollections< METCollection>(iEvent);
231  fillTriggerObjectCollections< CaloMETCollection>(iEvent);
232  fillTriggerObjectCollections<IsolatedPixelTrackCandidateCollection>(iEvent);
234  fillTriggerObjectCollections< L1EmParticleCollection>(iEvent);
235  fillTriggerObjectCollections< L1MuonParticleCollection>(iEvent);
236  fillTriggerObjectCollections< L1JetParticleCollection>(iEvent);
237  fillTriggerObjectCollections< L1EtMissParticleCollection>(iEvent);
238  fillTriggerObjectCollections< L1HFRingsCollection>(iEvent);
240  const unsigned int nk(tags_.size());
241  LogDebug("TriggerSummaryProducerAOD") << "Number of collections found: " << nk;
242  const unsigned int no(toc_.size());
243  LogDebug("TriggerSummaryProducerAOD") << "Number of physics objects found: " << no;
244 
247  auto_ptr<TriggerEvent> product(new TriggerEvent(pn_,nk,no,nf));
248 
250  product->addCollections(tags_,keys_);
251  product->addObjects(toc_);
252 
254  for (unsigned int ifob=0; ifob!=nfob; ++ifob) {
255  if (maskFilters_[ifob]) {
256  const string& label (fobs_[ifob].provenance()->moduleLabel());
257  const string& instance (fobs_[ifob].provenance()->productInstanceName());
258  const string& process (fobs_[ifob].provenance()->processName());
259  const edm::InputTag filterTag(label,instance,process);
260  ids_.clear();
261  keys_.clear();
262  fillFilterObjectMembers(iEvent,filterTag,fobs_[ifob]->photonIds() ,fobs_[ifob]->photonRefs());
263  fillFilterObjectMembers(iEvent,filterTag,fobs_[ifob]->electronIds() ,fobs_[ifob]->electronRefs());
264  fillFilterObjectMembers(iEvent,filterTag,fobs_[ifob]->muonIds() ,fobs_[ifob]->muonRefs());
265  fillFilterObjectMembers(iEvent,filterTag,fobs_[ifob]->jetIds() ,fobs_[ifob]->jetRefs());
266  fillFilterObjectMembers(iEvent,filterTag,fobs_[ifob]->compositeIds(),fobs_[ifob]->compositeRefs());
267  fillFilterObjectMembers(iEvent,filterTag,fobs_[ifob]->basemetIds() ,fobs_[ifob]->basemetRefs());
268  fillFilterObjectMembers(iEvent,filterTag,fobs_[ifob]->calometIds() ,fobs_[ifob]->calometRefs());
269  fillFilterObjectMembers(iEvent,filterTag,fobs_[ifob]->pixtrackIds() ,fobs_[ifob]->pixtrackRefs());
270  fillFilterObjectMembers(iEvent,filterTag,fobs_[ifob]->l1emIds() ,fobs_[ifob]->l1emRefs());
271  fillFilterObjectMembers(iEvent,filterTag,fobs_[ifob]->l1muonIds() ,fobs_[ifob]->l1muonRefs());
272  fillFilterObjectMembers(iEvent,filterTag,fobs_[ifob]->l1jetIds() ,fobs_[ifob]->l1jetRefs());
273  fillFilterObjectMembers(iEvent,filterTag,fobs_[ifob]->l1etmissIds() ,fobs_[ifob]->l1etmissRefs());
274  fillFilterObjectMembers(iEvent,filterTag,fobs_[ifob]->l1hfringsIds(),fobs_[ifob]->l1hfringsRefs());
275  product->addFilter(filterTag,ids_,keys_);
276  }
277  }
278 
279  OrphanHandle<TriggerEvent> ref = iEvent.put(product);
280  LogTrace("TriggerSummaryProducerAOD") << "Number of physics objects packed: " << ref->sizeObjects();
281  LogTrace("TriggerSummaryProducerAOD") << "Number of filter objects packed: " << ref->sizeFilters();
282 
283 }
#define LogDebug(id)
bool isDebugEnabled()
The single EDProduct to be saved for each event (AOD case)
Definition: TriggerEvent.h:27
const std::string & label
Definition: MVAComputer.cc:186
trigger::TriggerObjectCollection toc_
trigger object collection
std::vector< bool > maskFilters_
packing decision
edm::ProcessNameSelector selector_
selector for getMany methods
std::vector< std::string > tags_
int iEvent
Definition: GenABIO.cc:243
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:84
void getMany(SelectorBase const &sel, std::vector< Handle< PROD > > &results) const
Definition: Event.h:387
std::map< edm::ProductID, unsigned int > offset_
global map for indices into toc_: offset per input L3 collection
void fillFilterObjectMembers(const edm::Event &, const edm::InputTag &tag, const trigger::Vids &, const std::vector< edm::Ref< C > > &)
#define LogTrace(id)
std::vector< edm::Handle< trigger::TriggerFilterObjectWithRefs > > fobs_
handles to the filter objects
tuple process
Definition: align_tpl.py:3
InputTagSet collectionTagsEvent_
list of L3 collection tags
std::string pn_
process name
InputTagSet filterTagsEvent_
list of L3 filter tags
const std::string * moduleLabel() const
Definition: HLTadd.h:40

Member Data Documentation

InputTagSet TriggerSummaryProducerAOD::collectionTagsEvent_
private

list of L3 collection tags

Definition at line 108 of file TriggerSummaryProducerAOD.h.

Referenced by fillTriggerObjectCollections(), produce(), and TriggerSummaryProducerAOD().

InputTagSet TriggerSummaryProducerAOD::collectionTagsGlobal_
private

Definition at line 109 of file TriggerSummaryProducerAOD.h.

Referenced by endJob(), produce(), and TriggerSummaryProducerAOD().

InputTagSet TriggerSummaryProducerAOD::filterTagsEvent_
private

list of L3 filter tags

Definition at line 104 of file TriggerSummaryProducerAOD.h.

Referenced by produce(), and TriggerSummaryProducerAOD().

InputTagSet TriggerSummaryProducerAOD::filterTagsGlobal_
private

Definition at line 105 of file TriggerSummaryProducerAOD.h.

Referenced by endJob(), produce(), and TriggerSummaryProducerAOD().

std::vector<edm::Handle<trigger::TriggerFilterObjectWithRefs> > TriggerSummaryProducerAOD::fobs_
private

handles to the filter objects

Definition at line 118 of file TriggerSummaryProducerAOD.h.

Referenced by produce().

trigger::Vids TriggerSummaryProducerAOD::ids_
private

ids

Definition at line 122 of file TriggerSummaryProducerAOD.h.

Referenced by fillFilterObjectMember(), and produce().

trigger::Keys TriggerSummaryProducerAOD::keys_
private
std::vector<bool> TriggerSummaryProducerAOD::maskFilters_
private

packing decision

Definition at line 125 of file TriggerSummaryProducerAOD.h.

Referenced by produce().

std::map<edm::ProductID,unsigned int> TriggerSummaryProducerAOD::offset_
private

global map for indices into toc_: offset per input L3 collection

Definition at line 115 of file TriggerSummaryProducerAOD.h.

Referenced by fillFilterObjectMembers(), fillTriggerObjectCollections(), and produce().

std::string TriggerSummaryProducerAOD::pn_
private

process name

Definition at line 75 of file TriggerSummaryProducerAOD.h.

Referenced by produce(), and TriggerSummaryProducerAOD().

edm::ProcessNameSelector TriggerSummaryProducerAOD::selector_
private

selector for getMany methods

Definition at line 78 of file TriggerSummaryProducerAOD.h.

Referenced by fillTriggerObjectCollections(), produce(), and TriggerSummaryProducerAOD().

std::vector<std::string> TriggerSummaryProducerAOD::tags_
private

Definition at line 113 of file TriggerSummaryProducerAOD.h.

Referenced by fillTriggerObjectCollections(), and produce().

edm::service::TriggerNamesService* TriggerSummaryProducerAOD::tns_
private

the pointer to the current TriggerNamesService

Definition at line 81 of file TriggerSummaryProducerAOD.h.

Referenced by TriggerSummaryProducerAOD().

trigger::TriggerObjectCollection TriggerSummaryProducerAOD::toc_
private

trigger object collection

Definition at line 112 of file TriggerSummaryProducerAOD.h.

Referenced by fillTriggerObject(), fillTriggerObjectCollections(), and produce().