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)
 
static void prevalidate (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/09 13:58:42
Revision:
1.16
Author
Martin Grunewald

See header file for documentation

Date:
2012/01/30 09:40:35
Revision:
1.45
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 60 of file TriggerSummaryProducerAOD.cc.

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

60  :
61  pn_(ps.getParameter<std::string>("processName")),
63  tns_(),
64  filterTagsEvent_(pn_!="*"),
65  filterTagsGlobal_(pn_!="*"),
68  toc_(),
69  tags_(),
70  offset_(),
71  fobs_(),
72  keys_(),
73  ids_(),
74  maskFilters_()
75 {
76  if (pn_=="@") {
77  // use tns
79  // get tns pointer
81  if (tns_!=0) {
83  } else {
84  edm::LogError("TriggerSummaryProducerAOD") << "HLT Error: TriggerNamesService pointer = 0!";
85  pn_="*";
86  }
87  } else {
88  edm::LogError("TriggerSummaryProducerAOD") << "HLT Error: TriggerNamesService not available!";
89  pn_="*";
90  }
96  }
97  LogDebug("TriggerSummaryProducerAOD") << "Using process name: '" << pn_ <<"'";
98 
99  filterTagsGlobal_.clear();
100  collectionTagsGlobal_.clear();
101 
102  produces<trigger::TriggerEvent>();
103 
104 }
#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 106 of file TriggerSummaryProducerAOD.cc.

107 {
108 }

Member Function Documentation

void TriggerSummaryProducerAOD::endJob ( void  )
virtual

Reimplemented from edm::EDProducer.

Definition at line 521 of file TriggerSummaryProducerAOD.cc.

References collectionTagsGlobal_, benchmark_cfg::fb, vdt::fe, and filterTagsGlobal_.

521  {
522 
523  using namespace std;
524  using namespace edm;
525  using namespace trigger;
526 
527  LogVerbatim("TriggerSummaryProducerAOD") << endl;
528  LogVerbatim("TriggerSummaryProducerAOD") << "TriggerSummaryProducerAOD::endJob - accumulated tags:" << endl;
529 
530  const unsigned int nc(collectionTagsGlobal_.size());
531  const unsigned int nf(filterTagsGlobal_.size());
532  LogVerbatim("TriggerSummaryProducerAOD") << " Overall number of Collections/Filters: "
533  << nc << "/" << nf << endl;
534 
535  LogVerbatim("TriggerSummaryProducerAOD") << " The collections: " << nc << endl;
536  const InputTagSet::const_iterator cb(collectionTagsGlobal_.begin());
537  const InputTagSet::const_iterator ce(collectionTagsGlobal_.end());
538  for ( InputTagSet::const_iterator ci=cb; ci!=ce; ++ci) {
539  LogVerbatim("TriggerSummaryProducerAOD") << " " << distance(cb,ci) << " " << ci->encode() << endl;
540  }
541 
542  LogVerbatim("TriggerSummaryProducerAOD") << " The filters:" << nf << endl;
543  const InputTagSet::const_iterator fb(filterTagsGlobal_.begin());
544  const InputTagSet::const_iterator fe(filterTagsGlobal_.end());
545  for ( InputTagSet::const_iterator fi=fb; fi!=fe; ++fi) {
546  LogVerbatim("TriggerSummaryProducerAOD") << " " << distance(fb,fi) << " " << fi->encode() << endl;
547  }
548 
549  LogVerbatim("TriggerSummaryProducerAOD") << "TriggerSummaryProducerAOD::endJob." << endl;
550  LogVerbatim("TriggerSummaryProducerAOD") << endl;
551 
552  return;
553 
554 }
double & fe
Definition: VDTMath.h:196
template<typename C >
void TriggerSummaryProducerAOD::fillFilterObjectMember ( const int &  offset,
const int &  id,
const edm::Ref< C > &  ref 
)

Definition at line 449 of file TriggerSummaryProducerAOD.cc.

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

Referenced by fillFilterObjectMembers().

449  {
450 
451  keys_.push_back(offset+ref.key());
452  ids_.push_back(id);
453 
454  return;
455 }
unsigned int offset(bool)
key_type key() const
Accessor for product key.
Definition: Ref.h:266
void TriggerSummaryProducerAOD::fillFilterObjectMember ( const int &  offset,
const int &  id,
const edm::Ref< l1extra::L1HFRingsCollection > &  ref 
)

Definition at line 457 of file TriggerSummaryProducerAOD.cc.

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

457  {
458 
459  using namespace trigger;
460 
461  if (id==TriggerL1HfBitCounts) {
462  keys_.push_back(offset+2*ref.key()+1);
463  } else { // if (ids[i]==TriggerL1HfRingEtSums) {
464  keys_.push_back(offset+2*ref.key()+0);
465  }
466  ids_.push_back(id);
467 
468  return;
469 }
unsigned int offset(bool)
key_type key() const
Accessor for product key.
Definition: Ref.h:266
void TriggerSummaryProducerAOD::fillFilterObjectMember ( const int &  offset,
const int &  id,
const edm::Ref< l1extra::L1EtMissParticleCollection > &  ref 
)

Definition at line 471 of file TriggerSummaryProducerAOD.cc.

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

471  {
472 
473  using namespace trigger;
474 
475  if ( (id==TriggerL1ETT) || (id==TriggerL1HTT) ) {
476  keys_.push_back(offset+2*ref.key()+1);
477  } else {
478  keys_.push_back(offset+2*ref.key()+0);
479  }
480  ids_.push_back(id);
481 
482  return;
483 }
unsigned int offset(bool)
key_type key() const
Accessor for product key.
Definition: Ref.h:266
void TriggerSummaryProducerAOD::fillFilterObjectMember ( const int &  offset,
const int &  id,
const edm::Ref< reco::CaloMETCollection > &  ref 
)

Definition at line 485 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.

485  {
486 
487  using namespace trigger;
488 
489  if ( (id==TriggerTHT) || (id==TriggerTET) ) {
490  keys_.push_back(offset+4*ref.key()+1);
491  } else if ( (id==TriggerMETSig) || (id==TriggerMHTSig) ) {
492  keys_.push_back(offset+4*ref.key()+2);
493  } else if ( (id==TriggerELongit) || (id==TriggerHLongit) ) {
494  keys_.push_back(offset+4*ref.key()+3);
495  } else {
496  keys_.push_back(offset+4*ref.key()+0);
497  }
498  ids_.push_back(id);
499 
500  return;
501 }
unsigned int offset(bool)
key_type key() const
Accessor for product key.
Definition: Ref.h:266
void TriggerSummaryProducerAOD::fillFilterObjectMember ( const int &  offset,
const int &  id,
const edm::Ref< reco::METCollection > &  ref 
)

Definition at line 503 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.

503  {
504 
505  using namespace trigger;
506 
507  if ( (id==TriggerTHT) || (id==TriggerTET) ) {
508  keys_.push_back(offset+4*ref.key()+1);
509  } else if ( (id==TriggerMETSig) || (id==TriggerMHTSig) ) {
510  keys_.push_back(offset+4*ref.key()+2);
511  } else if ( (id==TriggerELongit) || (id==TriggerHLongit) ) {
512  keys_.push_back(offset+4*ref.key()+3);
513  } else {
514  keys_.push_back(offset+4*ref.key()+0);
515  }
516  ids_.push_back(id);
517 
518  return;
519 }
unsigned int offset(bool)
key_type key() const
Accessor for product key.
Definition: Ref.h:266
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 408 of file TriggerSummaryProducerAOD.cc.

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

Referenced by produce().

408  {
409 
413 
414  using namespace std;
415  using namespace edm;
416  using namespace reco;
417  using namespace l1extra;
418  using namespace trigger;
419 
420  if (ids.size()!=refs.size()) {
421  LogError("TriggerSummaryProducerAOD") << "Vector length is different: "
422  << ids.size() << " " << refs.size();
423  }
424 
425  const unsigned int n(min(ids.size(),refs.size()));
426  for (unsigned int i=0; i!=n; ++i) {
427  const ProductID pid(refs[i].id());
428  if (offset_.find(pid)==offset_.end()) {
429  const string& label(iEvent.getProvenance(pid).moduleLabel());
430  const string& instance(iEvent.getProvenance(pid).productInstanceName());
431  const string& process(iEvent.getProvenance(pid).processName());
432  LogError("TriggerSummaryProducerAOD")
433  << "Uunknown pid:"
434  << " FilterTag/Key: " << tag.encode()
435  << "/" << i
436  << " CollectionTag/Key: "
438  << "/" << refs[i].key()
439  << " CollectionType: " << typeid(C).name();
440  } else {
441  fillFilterObjectMember(offset_[pid],ids[i],refs[i]);
442  }
443  }
444  return;
445 
446 }
int i
Definition: DBlmapReader.cc:9
static PFTauRenderPlugin instance
#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
std::string const & productInstanceName() const
Definition: Provenance.h:64
tuple process
Definition: LaserDQM_cfg.py:3
Provenance getProvenance(BranchID const &theID) const
Definition: Event.cc:60
template<typename T >
void TriggerSummaryProducerAOD::fillTriggerObject ( const T object)

Definition at line 337 of file TriggerSummaryProducerAOD.cc.

References toc_.

Referenced by fillTriggerObjectCollections().

337  {
338 
339  using namespace trigger;
340  toc_.push_back( TriggerObject(object) );
341 
342  return;
343 }
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 345 of file TriggerSummaryProducerAOD.cc.

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

345  {
346 
347  using namespace l1extra;
348  using namespace trigger;
349 
351  object.hfEtSum(L1HFRings::kRing1PosEta),
352  object.hfEtSum(L1HFRings::kRing1NegEta),
353  object.hfEtSum(L1HFRings::kRing2PosEta),
354  object.hfEtSum(L1HFRings::kRing2NegEta) ) );
356  object.hfBitCount(L1HFRings::kRing1PosEta),
357  object.hfBitCount(L1HFRings::kRing1NegEta),
358  object.hfBitCount(L1HFRings::kRing2PosEta),
359  object.hfBitCount(L1HFRings::kRing2NegEta) ) );
360 
361  return;
362 }
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 364 of file TriggerSummaryProducerAOD.cc.

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

364  {
365 
366  using namespace l1extra;
367  using namespace trigger;
368 
369  toc_.push_back( TriggerObject(object) );
370  if (object.type()==L1EtMissParticle::kMET) {
371  toc_.push_back(TriggerObject(TriggerL1ETT,object.etTotal(),0.0,0.0,0.0));
372  } else if (object.type()==L1EtMissParticle::kMHT) {
373  toc_.push_back(TriggerObject(TriggerL1HTT,object.etTotal(),0.0,0.0,0.0));
374  } else {
375  toc_.push_back(TriggerObject(0, object.etTotal(),0.0,0.0,0.0));
376  }
377 
378  return;
379 }
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 381 of file TriggerSummaryProducerAOD.cc.

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

381  {
382 
383  using namespace reco;
384  using namespace trigger;
385 
386  toc_.push_back( TriggerObject(object) );
387  toc_.push_back(TriggerObject(TriggerTET ,object.sumEt() ,0.0,0.0,0.0));
388  toc_.push_back(TriggerObject(TriggerMETSig ,object.mEtSig() ,0.0,0.0,0.0));
389  toc_.push_back(TriggerObject(TriggerELongit,object.e_longitudinal(),0.0,0.0,0.0));
390 
391  return;
392 }
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 394 of file TriggerSummaryProducerAOD.cc.

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

394  {
395 
396  using namespace reco;
397  using namespace trigger;
398 
399  toc_.push_back( TriggerObject(object) );
400  toc_.push_back(TriggerObject(TriggerTHT ,object.sumEt() ,0.0,0.0,0.0));
401  toc_.push_back(TriggerObject(TriggerMHTSig ,object.mEtSig() ,0.0,0.0,0.0));
402  toc_.push_back(TriggerObject(TriggerHLongit,object.e_longitudinal(),0.0,0.0,0.0));
403 
404  return;
405 }
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 296 of file TriggerSummaryProducerAOD.cc.

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

296  {
297 
301 
302  using namespace std;
303  using namespace edm;
304  using namespace reco;
305  using namespace l1extra;
306  using namespace trigger;
307 
308  vector<Handle<C> > collections;
309  iEvent.getMany(selector_,collections);
310  const unsigned int nc(collections.size());
311 
312  for (unsigned int ic=0; ic!=nc; ++ic) {
313  const Provenance& provenance(*(collections[ic].provenance()));
314  const string& label (provenance.moduleLabel());
315  const string& instance (provenance.productInstanceName());
316  const string& process (provenance.processName());
317  const InputTag collectionTag(label,instance,process);
318 
319  if (collectionTagsEvent_.find(collectionTag)!=collectionTagsEvent_.end()) {
320  const ProductID pid(collections[ic].provenance()->productID());
321  if (offset_.find(pid)!=offset_.end()) {
322  LogError("TriggerSummaryProducerAOD") << "Duplicate pid!";
323  }
324  offset_[pid]=toc_.size();
325  const unsigned int n(collections[ic]->size());
326  for (unsigned int i=0; i!=n; ++i) {
327  fillTriggerObject( (*collections[ic])[i] );
328  }
329  tags_.push_back(collectionTag.encode());
330  keys_.push_back(toc_.size());
331  }
332 
333  }
334 }
int i
Definition: DBlmapReader.cc:9
trigger::TriggerObjectCollection toc_
trigger object collection
static PFTauRenderPlugin instance
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:388
std::map< edm::ProductID, unsigned int > offset_
global map for indices into toc_: offset per input L3 collection
InputTagSet collectionTagsEvent_
list of L3 collection tags
tuple process
Definition: LaserDQM_cfg.py:3
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 144 of file TriggerSummaryProducerAOD.cc.

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

145 {
146  using namespace std;
147  using namespace edm;
148  using namespace reco;
149  using namespace l1extra;
150  using namespace trigger;
151 
154  fobs_.clear();
155  iEvent.getMany(selector_,fobs_);
156  const unsigned int nfob(fobs_.size());
157  LogTrace("TriggerSummaryProducerAOD") << "Number of filter objects found: " << nfob;
158 
159  string tagLabel,tagInstance,tagProcess;
160 
166  maskFilters_.clear();
167  maskFilters_.resize(nfob);
168  filterTagsEvent_.clear();
169  collectionTagsEvent_.clear();
170  unsigned int nf(0);
171  for (unsigned int ifob=0; ifob!=nfob; ++ifob) {
172  maskFilters_[ifob]=false;
173  const vector<string>& collectionTags_(fobs_[ifob]->getCollectionTagsAsStrings());
174  const unsigned int ncol(collectionTags_.size());
175  if (ncol>0) {
176  nf++;
177  maskFilters_[ifob]=true;
178  const string& label (fobs_[ifob].provenance()->moduleLabel());
179  const string& instance (fobs_[ifob].provenance()->productInstanceName());
180  const string& process (fobs_[ifob].provenance()->processName());
182  for (unsigned int icol=0; icol!=ncol; ++icol) {
183  // overwrite process name (usually not set)
184  tokenizeTag(collectionTags_[icol],tagLabel,tagInstance,tagProcess);
185  collectionTagsEvent_.insert(InputTag(tagLabel,tagInstance,pn_));
186  }
187  }
188  }
190  if (filterTagsEvent_.size()!=nf) {
191  LogError("TriggerSummaryProducerAOD")
192  << "Mismatch in number of filter tags: "
193  << filterTagsEvent_.size() << "!=" << nf ;
194  }
195 
199 
201  if (isDebugEnabled()) {
202 
204  const unsigned int nc(collectionTagsEvent_.size());
205  LogTrace("TriggerSummaryProducerAOD") << "Number of unique collections requested " << nc;
206  const InputTagSet::const_iterator cb(collectionTagsEvent_.begin());
207  const InputTagSet::const_iterator ce(collectionTagsEvent_.end());
208  for ( InputTagSet::const_iterator ci=cb; ci!=ce; ++ci) {
209  LogTrace("TriggerSummaryProducerAOD") << distance(cb,ci) << " " << ci->encode();
210  }
211  const unsigned int nf(filterTagsEvent_.size());
212  LogTrace("TriggerSummaryProducerAOD") << "Number of unique filters requested " << nf;
213  const InputTagSet::const_iterator fb(filterTagsEvent_.begin());
214  const InputTagSet::const_iterator fe(filterTagsEvent_.end());
215  for ( InputTagSet::const_iterator fi=fb; fi!=fe; ++fi) {
216  LogTrace("TriggerSummaryProducerAOD") << distance(fb,fi) << " " << fi->encode();
217  }
218 
219  }
220 
226  toc_.clear();
227  tags_.clear();
228  keys_.clear();
229  offset_.clear();
230  fillTriggerObjectCollections< RecoEcalCandidateCollection>(iEvent);
231  fillTriggerObjectCollections< ElectronCollection>(iEvent);
232  fillTriggerObjectCollections< RecoChargedCandidateCollection>(iEvent);
233  fillTriggerObjectCollections< CaloJetCollection>(iEvent);
234  fillTriggerObjectCollections< CompositeCandidateCollection>(iEvent);
235  fillTriggerObjectCollections< METCollection>(iEvent);
236  fillTriggerObjectCollections< CaloMETCollection>(iEvent);
237  fillTriggerObjectCollections<IsolatedPixelTrackCandidateCollection>(iEvent);
239  fillTriggerObjectCollections< L1EmParticleCollection>(iEvent);
240  fillTriggerObjectCollections< L1MuonParticleCollection>(iEvent);
241  fillTriggerObjectCollections< L1JetParticleCollection>(iEvent);
242  fillTriggerObjectCollections< L1EtMissParticleCollection>(iEvent);
243  fillTriggerObjectCollections< L1HFRingsCollection>(iEvent);
245  fillTriggerObjectCollections< PFJetCollection>(iEvent);
246  fillTriggerObjectCollections< PFTauCollection>(iEvent);
248  const unsigned int nk(tags_.size());
249  LogDebug("TriggerSummaryProducerAOD") << "Number of collections found: " << nk;
250  const unsigned int no(toc_.size());
251  LogDebug("TriggerSummaryProducerAOD") << "Number of physics objects found: " << no;
252 
255  auto_ptr<TriggerEvent> product(new TriggerEvent(pn_,nk,no,nf));
256 
258  product->addCollections(tags_,keys_);
259  product->addObjects(toc_);
260 
262  for (unsigned int ifob=0; ifob!=nfob; ++ifob) {
263  if (maskFilters_[ifob]) {
264  const string& label (fobs_[ifob].provenance()->moduleLabel());
265  const string& instance (fobs_[ifob].provenance()->productInstanceName());
266  const string& process (fobs_[ifob].provenance()->processName());
267  const edm::InputTag filterTag(label,instance,process);
268  ids_.clear();
269  keys_.clear();
270  fillFilterObjectMembers(iEvent,filterTag,fobs_[ifob]->photonIds() ,fobs_[ifob]->photonRefs());
271  fillFilterObjectMembers(iEvent,filterTag,fobs_[ifob]->electronIds() ,fobs_[ifob]->electronRefs());
272  fillFilterObjectMembers(iEvent,filterTag,fobs_[ifob]->muonIds() ,fobs_[ifob]->muonRefs());
273  fillFilterObjectMembers(iEvent,filterTag,fobs_[ifob]->jetIds() ,fobs_[ifob]->jetRefs());
274  fillFilterObjectMembers(iEvent,filterTag,fobs_[ifob]->compositeIds(),fobs_[ifob]->compositeRefs());
275  fillFilterObjectMembers(iEvent,filterTag,fobs_[ifob]->basemetIds() ,fobs_[ifob]->basemetRefs());
276  fillFilterObjectMembers(iEvent,filterTag,fobs_[ifob]->calometIds() ,fobs_[ifob]->calometRefs());
277  fillFilterObjectMembers(iEvent,filterTag,fobs_[ifob]->pixtrackIds() ,fobs_[ifob]->pixtrackRefs());
278  fillFilterObjectMembers(iEvent,filterTag,fobs_[ifob]->l1emIds() ,fobs_[ifob]->l1emRefs());
279  fillFilterObjectMembers(iEvent,filterTag,fobs_[ifob]->l1muonIds() ,fobs_[ifob]->l1muonRefs());
280  fillFilterObjectMembers(iEvent,filterTag,fobs_[ifob]->l1jetIds() ,fobs_[ifob]->l1jetRefs());
281  fillFilterObjectMembers(iEvent,filterTag,fobs_[ifob]->l1etmissIds() ,fobs_[ifob]->l1etmissRefs());
282  fillFilterObjectMembers(iEvent,filterTag,fobs_[ifob]->l1hfringsIds(),fobs_[ifob]->l1hfringsRefs());
283  fillFilterObjectMembers(iEvent,filterTag,fobs_[ifob]->pfjetIds() ,fobs_[ifob]->pfjetRefs());
284  fillFilterObjectMembers(iEvent,filterTag,fobs_[ifob]->pftauIds() ,fobs_[ifob]->pftauRefs());
285  product->addFilter(filterTag,ids_,keys_);
286  }
287  }
288 
289  OrphanHandle<TriggerEvent> ref = iEvent.put(product);
290  LogTrace("TriggerSummaryProducerAOD") << "Number of physics objects packed: " << ref->sizeObjects();
291  LogTrace("TriggerSummaryProducerAOD") << "Number of filter objects packed: " << ref->sizeFilters();
292 
293 }
#define LogDebug(id)
bool isDebugEnabled()
The single EDProduct to be saved for each event (AOD case)
Definition: TriggerEvent.h:27
trigger::TriggerObjectCollection toc_
trigger object collection
static PFTauRenderPlugin instance
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:85
void getMany(SelectorBase const &sel, std::vector< Handle< PROD > > &results) const
Definition: Event.h:388
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)
double & fe
Definition: VDTMath.h:196
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
tuple process
Definition: LaserDQM_cfg.py:3

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().