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::EDConsumerBase 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 &, edm::GetterOfProducts< C > &)
 
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 &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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_
 
edm::GetterOfProducts
< reco::CaloJetCollection
getCaloJetCollection_
 
edm::GetterOfProducts
< reco::CaloMETCollection
getCaloMETCollection_
 
edm::GetterOfProducts
< reco::CompositeCandidateCollection
getCompositeCandidateCollection_
 
edm::GetterOfProducts
< reco::ElectronCollection
getElectronCollection_
 
edm::GetterOfProducts
< reco::IsolatedPixelTrackCandidateCollection
getIsolatedPixelTrackCandidateCollection_
 
edm::GetterOfProducts
< l1extra::L1EmParticleCollection
getL1EmParticleCollection_
 
edm::GetterOfProducts
< l1extra::L1EtMissParticleCollection
getL1EtMissParticleCollection_
 
edm::GetterOfProducts
< l1extra::L1HFRingsCollection
getL1HFRingsCollection_
 
edm::GetterOfProducts
< l1extra::L1JetParticleCollection
getL1JetParticleCollection_
 
edm::GetterOfProducts
< l1extra::L1MuonParticleCollection
getL1MuonParticleCollection_
 
edm::GetterOfProducts
< reco::METCollection
getMETCollection_
 
edm::GetterOfProducts
< reco::PFJetCollection
getPFJetCollection_
 
edm::GetterOfProducts
< reco::PFTauCollection
getPFTauCollection_
 
edm::GetterOfProducts
< reco::RecoChargedCandidateCollection
getRecoChargedCandidateCollection_
 
edm::GetterOfProducts
< reco::RecoEcalCandidateCollection
getRecoEcalCandidateCollection_
 
edm::GetterOfProducts
< trigger::TriggerFilterObjectWithRefs
getTriggerFilterObjectWithRefs_
 
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...
 
std::vector< std::string > tags_
 
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
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

This class is an EDProducer making the HLT summary object for AOD

Date:
2012/08/09 20:00:18
Revision:
1.17
Author
Martin Grunewald

See header file for documentation

Date:
2012/08/09 20:00:20
Revision:
1.46
Author
Martin Grunewald

Definition at line 62 of file TriggerSummaryProducerAOD.h.

Member Typedef Documentation

Definition at line 114 of file TriggerSummaryProducerAOD.h.

Constructor & Destructor Documentation

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

Definition at line 52 of file TriggerSummaryProducerAOD.cc.

References edm::ProducerBase::callWhenNewProductsRegistered(), collectionTagsEvent_, collectionTagsGlobal_, filterTagsEvent_, filterTagsGlobal_, getCaloJetCollection_, getCaloMETCollection_, getCompositeCandidateCollection_, getElectronCollection_, getIsolatedPixelTrackCandidateCollection_, getL1EmParticleCollection_, getL1EtMissParticleCollection_, getL1HFRingsCollection_, getL1JetParticleCollection_, getL1MuonParticleCollection_, getMETCollection_, getPFJetCollection_, getPFTauCollection_, edm::service::TriggerNamesService::getProcessName(), getRecoChargedCandidateCollection_, getRecoEcalCandidateCollection_, getTriggerFilterObjectWithRefs_, edm::Service< T >::isAvailable(), LogDebug, and pn_.

52  :
53  pn_(ps.getParameter<std::string>("processName")),
54  filterTagsEvent_(pn_!="*"),
55  filterTagsGlobal_(pn_!="*"),
58  toc_(),
59  tags_(),
60  offset_(),
61  keys_(),
62  ids_(),
63  maskFilters_()
64 {
65  if (pn_=="@") {
67  if (tns.isAvailable()) {
68  pn_ = tns->getProcessName();
69  } else {
70  edm::LogError("TriggerSummaryProducerAOD") << "HLT Error: TriggerNamesService not available!";
71  pn_="*";
72  }
73 
78  }
79  LogDebug("TriggerSummaryProducerAOD") << "Using process name: '" << pn_ <<"'";
80 
81  filterTagsGlobal_.clear();
82  collectionTagsGlobal_.clear();
83 
84  produces<trigger::TriggerEvent>();
85 
102 
110  getMETCollection_(bd);
120  });
121 }
#define LogDebug(id)
T getParameter(std::string const &) const
void callWhenNewProductsRegistered(std::function< void(BranchDescription const &)> const &func)
Definition: ProducerBase.h:44
edm::GetterOfProducts< l1extra::L1JetParticleCollection > getL1JetParticleCollection_
edm::GetterOfProducts< reco::IsolatedPixelTrackCandidateCollection > getIsolatedPixelTrackCandidateCollection_
edm::GetterOfProducts< reco::RecoEcalCandidateCollection > getRecoEcalCandidateCollection_
std::string const & getProcessName() const
edm::GetterOfProducts< l1extra::L1MuonParticleCollection > getL1MuonParticleCollection_
trigger::TriggerObjectCollection toc_
trigger object collection
edm::GetterOfProducts< reco::PFTauCollection > getPFTauCollection_
std::vector< bool > maskFilters_
packing decision
edm::GetterOfProducts< reco::METCollection > getMETCollection_
std::set< edm::InputTag, OrderInputTag > InputTagSet
edm::GetterOfProducts< reco::CaloJetCollection > getCaloJetCollection_
edm::GetterOfProducts< l1extra::L1EtMissParticleCollection > getL1EtMissParticleCollection_
std::vector< std::string > tags_
edm::GetterOfProducts< reco::PFJetCollection > getPFJetCollection_
edm::GetterOfProducts< reco::RecoChargedCandidateCollection > getRecoChargedCandidateCollection_
edm::GetterOfProducts< l1extra::L1HFRingsCollection > getL1HFRingsCollection_
bool isAvailable() const
Definition: Service.h:47
std::map< edm::ProductID, unsigned int > offset_
global map for indices into toc_: offset per input L3 collection
edm::GetterOfProducts< reco::CaloMETCollection > getCaloMETCollection_
edm::GetterOfProducts< reco::ElectronCollection > getElectronCollection_
InputTagSet collectionTagsEvent_
list of L3 collection tags
edm::GetterOfProducts< reco::CompositeCandidateCollection > getCompositeCandidateCollection_
edm::GetterOfProducts< trigger::TriggerFilterObjectWithRefs > getTriggerFilterObjectWithRefs_
std::string pn_
process name
InputTagSet filterTagsEvent_
list of L3 filter tags
edm::GetterOfProducts< l1extra::L1EmParticleCollection > getL1EmParticleCollection_
TriggerSummaryProducerAOD::~TriggerSummaryProducerAOD ( )

Definition at line 123 of file TriggerSummaryProducerAOD.cc.

124 {
125 }

Member Function Documentation

void TriggerSummaryProducerAOD::endJob ( void  )
virtual

Reimplemented from edm::EDProducer.

Definition at line 537 of file TriggerSummaryProducerAOD.cc.

References collectionTagsGlobal_, benchmark_cfg::fb, and filterTagsGlobal_.

537  {
538 
539  using namespace std;
540  using namespace edm;
541  using namespace trigger;
542 
543  LogVerbatim("TriggerSummaryProducerAOD") << endl;
544  LogVerbatim("TriggerSummaryProducerAOD") << "TriggerSummaryProducerAOD::endJob - accumulated tags:" << endl;
545 
546  const unsigned int nc(collectionTagsGlobal_.size());
547  const unsigned int nf(filterTagsGlobal_.size());
548  LogVerbatim("TriggerSummaryProducerAOD") << " Overall number of Collections/Filters: "
549  << nc << "/" << nf << endl;
550 
551  LogVerbatim("TriggerSummaryProducerAOD") << " The collections: " << nc << endl;
552  const InputTagSet::const_iterator cb(collectionTagsGlobal_.begin());
553  const InputTagSet::const_iterator ce(collectionTagsGlobal_.end());
554  for ( InputTagSet::const_iterator ci=cb; ci!=ce; ++ci) {
555  LogVerbatim("TriggerSummaryProducerAOD") << " " << distance(cb,ci) << " " << ci->encode() << endl;
556  }
557 
558  LogVerbatim("TriggerSummaryProducerAOD") << " The filters:" << nf << endl;
559  const InputTagSet::const_iterator fb(filterTagsGlobal_.begin());
560  const InputTagSet::const_iterator fe(filterTagsGlobal_.end());
561  for ( InputTagSet::const_iterator fi=fb; fi!=fe; ++fi) {
562  LogVerbatim("TriggerSummaryProducerAOD") << " " << distance(fb,fi) << " " << fi->encode() << endl;
563  }
564 
565  LogVerbatim("TriggerSummaryProducerAOD") << "TriggerSummaryProducerAOD::endJob." << endl;
566  LogVerbatim("TriggerSummaryProducerAOD") << endl;
567 
568  return;
569 
570 }
template<typename C >
void TriggerSummaryProducerAOD::fillFilterObjectMember ( const int &  offset,
const int &  id,
const edm::Ref< C > &  ref 
)

Definition at line 465 of file TriggerSummaryProducerAOD.cc.

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

Referenced by fillFilterObjectMembers().

465  {
466 
467  keys_.push_back(offset+ref.key());
468  ids_.push_back(id);
469 
470  return;
471 }
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 473 of file TriggerSummaryProducerAOD.cc.

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

473  {
474 
475  using namespace trigger;
476 
477  if (id==TriggerL1HfBitCounts) {
478  keys_.push_back(offset+2*ref.key()+1);
479  } else { // if (ids[i]==TriggerL1HfRingEtSums) {
480  keys_.push_back(offset+2*ref.key()+0);
481  }
482  ids_.push_back(id);
483 
484  return;
485 }
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 487 of file TriggerSummaryProducerAOD.cc.

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

487  {
488 
489  using namespace trigger;
490 
491  if ( (id==TriggerL1ETT) || (id==TriggerL1HTT) ) {
492  keys_.push_back(offset+2*ref.key()+1);
493  } else {
494  keys_.push_back(offset+2*ref.key()+0);
495  }
496  ids_.push_back(id);
497 
498  return;
499 }
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 501 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.

501  {
502 
503  using namespace trigger;
504 
505  if ( (id==TriggerTHT) || (id==TriggerTET) ) {
506  keys_.push_back(offset+4*ref.key()+1);
507  } else if ( (id==TriggerMETSig) || (id==TriggerMHTSig) ) {
508  keys_.push_back(offset+4*ref.key()+2);
509  } else if ( (id==TriggerELongit) || (id==TriggerHLongit) ) {
510  keys_.push_back(offset+4*ref.key()+3);
511  } else {
512  keys_.push_back(offset+4*ref.key()+0);
513  }
514  ids_.push_back(id);
515 
516  return;
517 }
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 519 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.

519  {
520 
521  using namespace trigger;
522 
523  if ( (id==TriggerTHT) || (id==TriggerTET) ) {
524  keys_.push_back(offset+4*ref.key()+1);
525  } else if ( (id==TriggerMETSig) || (id==TriggerMHTSig) ) {
526  keys_.push_back(offset+4*ref.key()+2);
527  } else if ( (id==TriggerELongit) || (id==TriggerHLongit) ) {
528  keys_.push_back(offset+4*ref.key()+3);
529  } else {
530  keys_.push_back(offset+4*ref.key()+0);
531  }
532  ids_.push_back(id);
533 
534  return;
535 }
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 424 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 L1Trigger_dataformats::reco.

Referenced by produce().

424  {
425 
429 
430  using namespace std;
431  using namespace edm;
432  using namespace reco;
433  using namespace l1extra;
434  using namespace trigger;
435 
436  if (ids.size()!=refs.size()) {
437  LogError("TriggerSummaryProducerAOD") << "Vector length is different: "
438  << ids.size() << " " << refs.size();
439  }
440 
441  const unsigned int n(min(ids.size(),refs.size()));
442  for (unsigned int i=0; i!=n; ++i) {
443  const ProductID pid(refs[i].id());
444  if (offset_.find(pid)==offset_.end()) {
445  const string& label(iEvent.getProvenance(pid).moduleLabel());
446  const string& instance(iEvent.getProvenance(pid).productInstanceName());
447  const string& process(iEvent.getProvenance(pid).processName());
448  LogError("TriggerSummaryProducerAOD")
449  << "Uunknown pid:"
450  << " FilterTag/Key: " << tag.encode()
451  << "/" << i
452  << " CollectionTag/Key: "
454  << "/" << refs[i].key()
455  << " CollectionType: " << typeid(C).name();
456  } else {
457  fillFilterObjectMember(offset_[pid],ids[i],refs[i]);
458  }
459  }
460  return;
461 
462 }
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:164
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:68
template<typename T >
void TriggerSummaryProducerAOD::fillTriggerObject ( const T object)

Definition at line 353 of file TriggerSummaryProducerAOD.cc.

References toc_.

Referenced by fillTriggerObjectCollections().

353  {
354 
355  using namespace trigger;
356  toc_.push_back( TriggerObject(object) );
357 
358  return;
359 }
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 361 of file TriggerSummaryProducerAOD.cc.

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

361  {
362 
363  using namespace l1extra;
364  using namespace trigger;
365 
367  object.hfEtSum(L1HFRings::kRing1PosEta),
368  object.hfEtSum(L1HFRings::kRing1NegEta),
369  object.hfEtSum(L1HFRings::kRing2PosEta),
370  object.hfEtSum(L1HFRings::kRing2NegEta) ) );
372  object.hfBitCount(L1HFRings::kRing1PosEta),
373  object.hfBitCount(L1HFRings::kRing1NegEta),
374  object.hfBitCount(L1HFRings::kRing2PosEta),
375  object.hfBitCount(L1HFRings::kRing2NegEta) ) );
376 
377  return;
378 }
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 380 of file TriggerSummaryProducerAOD.cc.

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

380  {
381 
382  using namespace l1extra;
383  using namespace trigger;
384 
385  toc_.push_back( TriggerObject(object) );
386  if (object.type()==L1EtMissParticle::kMET) {
387  toc_.push_back(TriggerObject(TriggerL1ETT,object.etTotal(),0.0,0.0,0.0));
388  } else if (object.type()==L1EtMissParticle::kMHT) {
389  toc_.push_back(TriggerObject(TriggerL1HTT,object.etTotal(),0.0,0.0,0.0));
390  } else {
391  toc_.push_back(TriggerObject(0, object.etTotal(),0.0,0.0,0.0));
392  }
393 
394  return;
395 }
type
Definition: HCALResponse.h:21
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 397 of file TriggerSummaryProducerAOD.cc.

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

397  {
398 
399  using namespace reco;
400  using namespace trigger;
401 
402  toc_.push_back( TriggerObject(object) );
403  toc_.push_back(TriggerObject(TriggerTET ,object.sumEt() ,0.0,0.0,0.0));
404  toc_.push_back(TriggerObject(TriggerMETSig ,object.mEtSig() ,0.0,0.0,0.0));
405  toc_.push_back(TriggerObject(TriggerELongit,object.e_longitudinal(),0.0,0.0,0.0));
406 
407  return;
408 }
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 410 of file TriggerSummaryProducerAOD.cc.

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

410  {
411 
412  using namespace reco;
413  using namespace trigger;
414 
415  toc_.push_back( TriggerObject(object) );
416  toc_.push_back(TriggerObject(TriggerTHT ,object.sumEt() ,0.0,0.0,0.0));
417  toc_.push_back(TriggerObject(TriggerMHTSig ,object.mEtSig() ,0.0,0.0,0.0));
418  toc_.push_back(TriggerObject(TriggerHLongit,object.e_longitudinal(),0.0,0.0,0.0));
419 
420  return;
421 }
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,
edm::GetterOfProducts< C > &  getter 
)

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 312 of file TriggerSummaryProducerAOD.cc.

References collectionTagsEvent_, edm::GetterOfProducts< T >::fillHandles(), fillTriggerObject(), i, instance, keys_, diffTwoXMLs::label, edm::Provenance::moduleLabel(), n, offset_, evf::utils::pid, LaserDQM_cfg::process, edm::Provenance::processName(), edm::Provenance::productInstanceName(), L1Trigger_dataformats::reco, findQualityFiles::size, tags_, and toc_.

312  {
313 
317 
318  using namespace std;
319  using namespace edm;
320  using namespace reco;
321  using namespace l1extra;
322  using namespace trigger;
323 
324  vector<Handle<C> > collections;
325  getter.fillHandles(iEvent, collections);
326  const unsigned int nc(collections.size());
327 
328  for (unsigned int ic=0; ic!=nc; ++ic) {
329  const Provenance& provenance(*(collections[ic].provenance()));
330  const string& label (provenance.moduleLabel());
331  const string& instance (provenance.productInstanceName());
332  const string& process (provenance.processName());
333  const InputTag collectionTag(label,instance,process);
334 
335  if (collectionTagsEvent_.find(collectionTag)!=collectionTagsEvent_.end()) {
336  const ProductID pid(collections[ic].provenance()->productID());
337  if (offset_.find(pid)!=offset_.end()) {
338  LogError("TriggerSummaryProducerAOD") << "Duplicate pid!";
339  }
340  offset_[pid]=toc_.size();
341  const unsigned int n(collections[ic]->size());
342  for (unsigned int i=0; i!=n; ++i) {
343  fillTriggerObject( (*collections[ic])[i] );
344  }
345  tags_.push_back(collectionTag.encode());
346  keys_.push_back(toc_.size());
347  }
348 
349  }
350 }
int i
Definition: DBlmapReader.cc:9
trigger::TriggerObjectCollection toc_
trigger object collection
static PFTauRenderPlugin instance
std::vector< std::string > tags_
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
void fillHandles(edm::Event const &event, std::vector< edm::Handle< T > > &handles) const
tuple process
Definition: LaserDQM_cfg.py:3
tuple size
Write out results.
void TriggerSummaryProducerAOD::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

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 161 of file TriggerSummaryProducerAOD.cc.

References collectionTagsEvent_, collectionTagsGlobal_, benchmark_cfg::fb, fillFilterObjectMembers(), edm::GetterOfProducts< T >::fillHandles(), filterTagsEvent_, filterTagsGlobal_, getCaloJetCollection_, getCaloMETCollection_, getCompositeCandidateCollection_, getElectronCollection_, getIsolatedPixelTrackCandidateCollection_, getL1EmParticleCollection_, getL1EtMissParticleCollection_, getL1HFRingsCollection_, getL1JetParticleCollection_, getL1MuonParticleCollection_, getMETCollection_, getPFJetCollection_, getPFTauCollection_, getRecoChargedCandidateCollection_, getRecoEcalCandidateCollection_, getTriggerFilterObjectWithRefs_, ids_, iEvent, instance, edm::isDebugEnabled(), keys_, diffTwoXMLs::label, LogDebug, LogTrace, maskFilters_, offset_, pn_, LaserDQM_cfg::process, edm::Event::put(), L1Trigger_dataformats::reco, tags_, and toc_.

162 {
163  using namespace std;
164  using namespace edm;
165  using namespace reco;
166  using namespace l1extra;
167  using namespace trigger;
168 
169  std::vector<edm::Handle<trigger::TriggerFilterObjectWithRefs> > fobs;
171 
172  const unsigned int nfob(fobs.size());
173  LogTrace("TriggerSummaryProducerAOD") << "Number of filter objects found: " << nfob;
174 
175  string tagLabel,tagInstance,tagProcess;
176 
182  maskFilters_.clear();
183  maskFilters_.resize(nfob);
184  filterTagsEvent_.clear();
185  collectionTagsEvent_.clear();
186  unsigned int nf(0);
187  for (unsigned int ifob=0; ifob!=nfob; ++ifob) {
188  maskFilters_[ifob]=false;
189  const vector<string>& collectionTags_(fobs[ifob]->getCollectionTagsAsStrings());
190  const unsigned int ncol(collectionTags_.size());
191  if (ncol>0) {
192  nf++;
193  maskFilters_[ifob]=true;
194  const string& label (fobs[ifob].provenance()->moduleLabel());
195  const string& instance (fobs[ifob].provenance()->productInstanceName());
196  const string& process (fobs[ifob].provenance()->processName());
198  for (unsigned int icol=0; icol!=ncol; ++icol) {
199  // overwrite process name (usually not set)
200  tokenizeTag(collectionTags_[icol],tagLabel,tagInstance,tagProcess);
201  collectionTagsEvent_.insert(InputTag(tagLabel,tagInstance,pn_));
202  }
203  }
204  }
206  if (filterTagsEvent_.size()!=nf) {
207  LogError("TriggerSummaryProducerAOD")
208  << "Mismatch in number of filter tags: "
209  << filterTagsEvent_.size() << "!=" << nf ;
210  }
211 
215 
217  if (isDebugEnabled()) {
218 
220  const unsigned int nc(collectionTagsEvent_.size());
221  LogTrace("TriggerSummaryProducerAOD") << "Number of unique collections requested " << nc;
222  const InputTagSet::const_iterator cb(collectionTagsEvent_.begin());
223  const InputTagSet::const_iterator ce(collectionTagsEvent_.end());
224  for ( InputTagSet::const_iterator ci=cb; ci!=ce; ++ci) {
225  LogTrace("TriggerSummaryProducerAOD") << distance(cb,ci) << " " << ci->encode();
226  }
227  const unsigned int nf(filterTagsEvent_.size());
228  LogTrace("TriggerSummaryProducerAOD") << "Number of unique filters requested " << nf;
229  const InputTagSet::const_iterator fb(filterTagsEvent_.begin());
230  const InputTagSet::const_iterator fe(filterTagsEvent_.end());
231  for ( InputTagSet::const_iterator fi=fb; fi!=fe; ++fi) {
232  LogTrace("TriggerSummaryProducerAOD") << distance(fb,fi) << " " << fi->encode();
233  }
234 
235  }
236 
242  toc_.clear();
243  tags_.clear();
244  keys_.clear();
245  offset_.clear();
246  fillTriggerObjectCollections< RecoEcalCandidateCollection>(iEvent, getRecoEcalCandidateCollection_);
247  fillTriggerObjectCollections< ElectronCollection>(iEvent, getElectronCollection_);
248  fillTriggerObjectCollections< RecoChargedCandidateCollection>(iEvent, getRecoChargedCandidateCollection_);
249  fillTriggerObjectCollections< CaloJetCollection>(iEvent, getCaloJetCollection_);
250  fillTriggerObjectCollections< CompositeCandidateCollection>(iEvent, getCompositeCandidateCollection_);
251  fillTriggerObjectCollections< METCollection>(iEvent, getMETCollection_);
252  fillTriggerObjectCollections< CaloMETCollection>(iEvent, getCaloMETCollection_);
253  fillTriggerObjectCollections<IsolatedPixelTrackCandidateCollection>(iEvent, getIsolatedPixelTrackCandidateCollection_);
255  fillTriggerObjectCollections< L1EmParticleCollection>(iEvent, getL1EmParticleCollection_);
256  fillTriggerObjectCollections< L1MuonParticleCollection>(iEvent, getL1MuonParticleCollection_);
257  fillTriggerObjectCollections< L1JetParticleCollection>(iEvent, getL1JetParticleCollection_);
258  fillTriggerObjectCollections< L1EtMissParticleCollection>(iEvent, getL1EtMissParticleCollection_);
259  fillTriggerObjectCollections< L1HFRingsCollection>(iEvent, getL1HFRingsCollection_);
261  fillTriggerObjectCollections< PFJetCollection>(iEvent, getPFJetCollection_);
262  fillTriggerObjectCollections< PFTauCollection>(iEvent, getPFTauCollection_);
264  const unsigned int nk(tags_.size());
265  LogDebug("TriggerSummaryProducerAOD") << "Number of collections found: " << nk;
266  const unsigned int no(toc_.size());
267  LogDebug("TriggerSummaryProducerAOD") << "Number of physics objects found: " << no;
268 
271  auto_ptr<TriggerEvent> product(new TriggerEvent(pn_,nk,no,nf));
272 
274  product->addCollections(tags_,keys_);
275  product->addObjects(toc_);
276 
278  for (unsigned int ifob=0; ifob!=nfob; ++ifob) {
279  if (maskFilters_[ifob]) {
280  const string& label (fobs[ifob].provenance()->moduleLabel());
281  const string& instance (fobs[ifob].provenance()->productInstanceName());
282  const string& process (fobs[ifob].provenance()->processName());
283  const edm::InputTag filterTag(label,instance,process);
284  ids_.clear();
285  keys_.clear();
286  fillFilterObjectMembers(iEvent,filterTag,fobs[ifob]->photonIds() ,fobs[ifob]->photonRefs());
287  fillFilterObjectMembers(iEvent,filterTag,fobs[ifob]->electronIds() ,fobs[ifob]->electronRefs());
288  fillFilterObjectMembers(iEvent,filterTag,fobs[ifob]->muonIds() ,fobs[ifob]->muonRefs());
289  fillFilterObjectMembers(iEvent,filterTag,fobs[ifob]->jetIds() ,fobs[ifob]->jetRefs());
290  fillFilterObjectMembers(iEvent,filterTag,fobs[ifob]->compositeIds(),fobs[ifob]->compositeRefs());
291  fillFilterObjectMembers(iEvent,filterTag,fobs[ifob]->basemetIds() ,fobs[ifob]->basemetRefs());
292  fillFilterObjectMembers(iEvent,filterTag,fobs[ifob]->calometIds() ,fobs[ifob]->calometRefs());
293  fillFilterObjectMembers(iEvent,filterTag,fobs[ifob]->pixtrackIds() ,fobs[ifob]->pixtrackRefs());
294  fillFilterObjectMembers(iEvent,filterTag,fobs[ifob]->l1emIds() ,fobs[ifob]->l1emRefs());
295  fillFilterObjectMembers(iEvent,filterTag,fobs[ifob]->l1muonIds() ,fobs[ifob]->l1muonRefs());
296  fillFilterObjectMembers(iEvent,filterTag,fobs[ifob]->l1jetIds() ,fobs[ifob]->l1jetRefs());
297  fillFilterObjectMembers(iEvent,filterTag,fobs[ifob]->l1etmissIds() ,fobs[ifob]->l1etmissRefs());
298  fillFilterObjectMembers(iEvent,filterTag,fobs[ifob]->l1hfringsIds(),fobs[ifob]->l1hfringsRefs());
299  fillFilterObjectMembers(iEvent,filterTag,fobs[ifob]->pfjetIds() ,fobs[ifob]->pfjetRefs());
300  fillFilterObjectMembers(iEvent,filterTag,fobs[ifob]->pftauIds() ,fobs[ifob]->pftauRefs());
301  product->addFilter(filterTag,ids_,keys_);
302  }
303  }
304 
305  OrphanHandle<TriggerEvent> ref = iEvent.put(product);
306  LogTrace("TriggerSummaryProducerAOD") << "Number of physics objects packed: " << ref->sizeObjects();
307  LogTrace("TriggerSummaryProducerAOD") << "Number of filter objects packed: " << ref->sizeFilters();
308 
309 }
#define LogDebug(id)
bool isDebugEnabled()
edm::GetterOfProducts< l1extra::L1JetParticleCollection > getL1JetParticleCollection_
edm::GetterOfProducts< reco::IsolatedPixelTrackCandidateCollection > getIsolatedPixelTrackCandidateCollection_
edm::GetterOfProducts< reco::RecoEcalCandidateCollection > getRecoEcalCandidateCollection_
edm::GetterOfProducts< l1extra::L1MuonParticleCollection > getL1MuonParticleCollection_
The single EDProduct to be saved for each event (AOD case)
Definition: TriggerEvent.h:27
trigger::TriggerObjectCollection toc_
trigger object collection
edm::GetterOfProducts< reco::PFTauCollection > getPFTauCollection_
static PFTauRenderPlugin instance
std::vector< bool > maskFilters_
packing decision
edm::GetterOfProducts< reco::METCollection > getMETCollection_
edm::GetterOfProducts< reco::CaloJetCollection > getCaloJetCollection_
edm::GetterOfProducts< l1extra::L1EtMissParticleCollection > getL1EtMissParticleCollection_
std::vector< std::string > tags_
edm::GetterOfProducts< reco::PFJetCollection > getPFJetCollection_
int iEvent
Definition: GenABIO.cc:243
edm::GetterOfProducts< reco::RecoChargedCandidateCollection > getRecoChargedCandidateCollection_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:94
edm::GetterOfProducts< l1extra::L1HFRingsCollection > getL1HFRingsCollection_
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)
edm::GetterOfProducts< reco::CaloMETCollection > getCaloMETCollection_
edm::GetterOfProducts< reco::ElectronCollection > getElectronCollection_
InputTagSet collectionTagsEvent_
list of L3 collection tags
void fillHandles(edm::Event const &event, std::vector< edm::Handle< T > > &handles) const
edm::GetterOfProducts< reco::CompositeCandidateCollection > getCompositeCandidateCollection_
edm::GetterOfProducts< trigger::TriggerFilterObjectWithRefs > getTriggerFilterObjectWithRefs_
std::string pn_
process name
InputTagSet filterTagsEvent_
list of L3 filter tags
tuple process
Definition: LaserDQM_cfg.py:3
edm::GetterOfProducts< l1extra::L1EmParticleCollection > getL1EmParticleCollection_

Member Data Documentation

InputTagSet TriggerSummaryProducerAOD::collectionTagsEvent_
private

list of L3 collection tags

Definition at line 121 of file TriggerSummaryProducerAOD.h.

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

InputTagSet TriggerSummaryProducerAOD::collectionTagsGlobal_
private

Definition at line 122 of file TriggerSummaryProducerAOD.h.

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

InputTagSet TriggerSummaryProducerAOD::filterTagsEvent_
private

list of L3 filter tags

Definition at line 117 of file TriggerSummaryProducerAOD.h.

Referenced by produce(), and TriggerSummaryProducerAOD().

InputTagSet TriggerSummaryProducerAOD::filterTagsGlobal_
private

Definition at line 118 of file TriggerSummaryProducerAOD.h.

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

edm::GetterOfProducts<reco::CaloJetCollection> TriggerSummaryProducerAOD::getCaloJetCollection_
private

Definition at line 142 of file TriggerSummaryProducerAOD.h.

Referenced by produce(), and TriggerSummaryProducerAOD().

edm::GetterOfProducts<reco::CaloMETCollection> TriggerSummaryProducerAOD::getCaloMETCollection_
private

Definition at line 145 of file TriggerSummaryProducerAOD.h.

Referenced by produce(), and TriggerSummaryProducerAOD().

edm::GetterOfProducts<reco::CompositeCandidateCollection> TriggerSummaryProducerAOD::getCompositeCandidateCollection_
private

Definition at line 143 of file TriggerSummaryProducerAOD.h.

Referenced by produce(), and TriggerSummaryProducerAOD().

edm::GetterOfProducts<reco::ElectronCollection> TriggerSummaryProducerAOD::getElectronCollection_
private

Definition at line 140 of file TriggerSummaryProducerAOD.h.

Referenced by produce(), and TriggerSummaryProducerAOD().

edm::GetterOfProducts<reco::IsolatedPixelTrackCandidateCollection> TriggerSummaryProducerAOD::getIsolatedPixelTrackCandidateCollection_
private

Definition at line 146 of file TriggerSummaryProducerAOD.h.

Referenced by produce(), and TriggerSummaryProducerAOD().

edm::GetterOfProducts<l1extra::L1EmParticleCollection> TriggerSummaryProducerAOD::getL1EmParticleCollection_
private

Definition at line 147 of file TriggerSummaryProducerAOD.h.

Referenced by produce(), and TriggerSummaryProducerAOD().

edm::GetterOfProducts<l1extra::L1EtMissParticleCollection> TriggerSummaryProducerAOD::getL1EtMissParticleCollection_
private

Definition at line 150 of file TriggerSummaryProducerAOD.h.

Referenced by produce(), and TriggerSummaryProducerAOD().

edm::GetterOfProducts<l1extra::L1HFRingsCollection> TriggerSummaryProducerAOD::getL1HFRingsCollection_
private

Definition at line 151 of file TriggerSummaryProducerAOD.h.

Referenced by produce(), and TriggerSummaryProducerAOD().

edm::GetterOfProducts<l1extra::L1JetParticleCollection> TriggerSummaryProducerAOD::getL1JetParticleCollection_
private

Definition at line 149 of file TriggerSummaryProducerAOD.h.

Referenced by produce(), and TriggerSummaryProducerAOD().

edm::GetterOfProducts<l1extra::L1MuonParticleCollection> TriggerSummaryProducerAOD::getL1MuonParticleCollection_
private

Definition at line 148 of file TriggerSummaryProducerAOD.h.

Referenced by produce(), and TriggerSummaryProducerAOD().

edm::GetterOfProducts<reco::METCollection> TriggerSummaryProducerAOD::getMETCollection_
private

Definition at line 144 of file TriggerSummaryProducerAOD.h.

Referenced by produce(), and TriggerSummaryProducerAOD().

edm::GetterOfProducts<reco::PFJetCollection> TriggerSummaryProducerAOD::getPFJetCollection_
private

Definition at line 152 of file TriggerSummaryProducerAOD.h.

Referenced by produce(), and TriggerSummaryProducerAOD().

edm::GetterOfProducts<reco::PFTauCollection> TriggerSummaryProducerAOD::getPFTauCollection_
private

Definition at line 153 of file TriggerSummaryProducerAOD.h.

Referenced by produce(), and TriggerSummaryProducerAOD().

edm::GetterOfProducts<reco::RecoChargedCandidateCollection> TriggerSummaryProducerAOD::getRecoChargedCandidateCollection_
private

Definition at line 141 of file TriggerSummaryProducerAOD.h.

Referenced by produce(), and TriggerSummaryProducerAOD().

edm::GetterOfProducts<reco::RecoEcalCandidateCollection> TriggerSummaryProducerAOD::getRecoEcalCandidateCollection_
private

Definition at line 139 of file TriggerSummaryProducerAOD.h.

Referenced by produce(), and TriggerSummaryProducerAOD().

edm::GetterOfProducts<trigger::TriggerFilterObjectWithRefs> TriggerSummaryProducerAOD::getTriggerFilterObjectWithRefs_
private

Definition at line 138 of file TriggerSummaryProducerAOD.h.

Referenced by produce(), and TriggerSummaryProducerAOD().

trigger::Vids TriggerSummaryProducerAOD::ids_
private

ids

Definition at line 133 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 136 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 128 of file TriggerSummaryProducerAOD.h.

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

std::string TriggerSummaryProducerAOD::pn_
private

process name

Definition at line 94 of file TriggerSummaryProducerAOD.h.

Referenced by produce(), and TriggerSummaryProducerAOD().

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

Definition at line 126 of file TriggerSummaryProducerAOD.h.

Referenced by fillTriggerObjectCollections(), and produce().

trigger::TriggerObjectCollection TriggerSummaryProducerAOD::toc_
private

trigger object collection

Definition at line 125 of file TriggerSummaryProducerAOD.h.

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