CMS 3D CMS Logo

Classes | Public Member Functions | Private Types | Private Attributes

TriggerSummaryProducerAOD Class Reference

#include <TriggerSummaryProducerAOD.h>

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

List of all members.

Classes

struct  OrderInputTag
 InputTag ordering class. More...

Public Member Functions

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

Private Types

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

Private Attributes

InputTagSet collectionTagsEvent_
 list of L3 collection tags
InputTagSet collectionTagsGlobal_
InputTagSet filterTagsEvent_
 list of L3 filter tags
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
trigger::Keys keys_
 keys
std::vector< bool > maskFilters_
 packing decision
std::map< edm::ProductID,
unsigned int > 
offset_
 global map for indices into toc_: offset per input L3 collection
std::string pn_
 process name
std::vector< std::string > tags_
trigger::TriggerObjectCollection toc_
 trigger object collection

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_, getRecoChargedCandidateCollection_, getRecoEcalCandidateCollection_, getTriggerFilterObjectWithRefs_, edm::Service< T >::isAvailable(), LogDebug, and pn_.

                                                                              : 
  pn_(ps.getParameter<std::string>("processName")),
  filterTagsEvent_(pn_!="*"),
  filterTagsGlobal_(pn_!="*"),
  collectionTagsEvent_(pn_!="*"),
  collectionTagsGlobal_(pn_!="*"),
  toc_(),
  tags_(),
  offset_(),
  keys_(),
  ids_(),
  maskFilters_()
{
  if (pn_=="@") {
    edm::Service<edm::service::TriggerNamesService> tns;
    if (tns.isAvailable()) {
      pn_ = tns->getProcessName();
    } else {
      edm::LogError("TriggerSummaryProducerAOD") << "HLT Error: TriggerNamesService not available!";
      pn_="*";
    }

    filterTagsEvent_     =InputTagSet(pn_!="*");
    filterTagsGlobal_    =InputTagSet(pn_!="*");
    collectionTagsEvent_ =InputTagSet(pn_!="*");
    collectionTagsGlobal_=InputTagSet(pn_!="*");
  }
  LogDebug("TriggerSummaryProducerAOD") << "Using process name: '" << pn_ <<"'";

  filterTagsGlobal_.clear();
  collectionTagsGlobal_.clear();

  produces<trigger::TriggerEvent>();

  getTriggerFilterObjectWithRefs_ = edm::GetterOfProducts<trigger::TriggerFilterObjectWithRefs>(edm::ProcessMatch(pn_), this);
  getRecoEcalCandidateCollection_ = edm::GetterOfProducts<reco::RecoEcalCandidateCollection>(edm::ProcessMatch(pn_), this);
  getElectronCollection_ = edm::GetterOfProducts<reco::ElectronCollection>(edm::ProcessMatch(pn_), this);
  getRecoChargedCandidateCollection_ = edm::GetterOfProducts<reco::RecoChargedCandidateCollection>(edm::ProcessMatch(pn_), this);
  getCaloJetCollection_ = edm::GetterOfProducts<reco::CaloJetCollection>(edm::ProcessMatch(pn_), this);
  getCompositeCandidateCollection_ = edm::GetterOfProducts<reco::CompositeCandidateCollection>(edm::ProcessMatch(pn_), this);
  getMETCollection_ = edm::GetterOfProducts<reco::METCollection>(edm::ProcessMatch(pn_), this);
  getCaloMETCollection_ = edm::GetterOfProducts<reco::CaloMETCollection>(edm::ProcessMatch(pn_), this);
  getIsolatedPixelTrackCandidateCollection_ = edm::GetterOfProducts<reco::IsolatedPixelTrackCandidateCollection>(edm::ProcessMatch(pn_), this);
  getL1EmParticleCollection_ = edm::GetterOfProducts<l1extra::L1EmParticleCollection>(edm::ProcessMatch(pn_), this);
  getL1MuonParticleCollection_ = edm::GetterOfProducts<l1extra::L1MuonParticleCollection>(edm::ProcessMatch(pn_), this);
  getL1JetParticleCollection_ = edm::GetterOfProducts<l1extra::L1JetParticleCollection>(edm::ProcessMatch(pn_), this);
  getL1EtMissParticleCollection_ = edm::GetterOfProducts<l1extra::L1EtMissParticleCollection>(edm::ProcessMatch(pn_), this);
  getL1HFRingsCollection_ = edm::GetterOfProducts<l1extra::L1HFRingsCollection>(edm::ProcessMatch(pn_), this);
  getPFJetCollection_ = edm::GetterOfProducts<reco::PFJetCollection>(edm::ProcessMatch(pn_), this);
  getPFTauCollection_ = edm::GetterOfProducts<reco::PFTauCollection>(edm::ProcessMatch(pn_), this);

  callWhenNewProductsRegistered([this](edm::BranchDescription const& bd){
    getTriggerFilterObjectWithRefs_(bd);
    getRecoEcalCandidateCollection_(bd);
    getElectronCollection_(bd);
    getRecoChargedCandidateCollection_(bd);
    getCaloJetCollection_(bd);
    getCompositeCandidateCollection_(bd);
    getMETCollection_(bd);
    getCaloMETCollection_(bd);
    getIsolatedPixelTrackCandidateCollection_(bd);
    getL1EmParticleCollection_(bd);
    getL1MuonParticleCollection_(bd);
    getL1JetParticleCollection_(bd);
    getL1EtMissParticleCollection_(bd);
    getL1HFRingsCollection_(bd);
    getPFJetCollection_(bd);
    getPFTauCollection_(bd);
  });
}
TriggerSummaryProducerAOD::~TriggerSummaryProducerAOD ( )

Definition at line 123 of file TriggerSummaryProducerAOD.cc.

{
}

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_.

                                       {

  using namespace std;
  using namespace edm;
  using namespace trigger;

  LogVerbatim("TriggerSummaryProducerAOD") << endl;
  LogVerbatim("TriggerSummaryProducerAOD") << "TriggerSummaryProducerAOD::endJob - accumulated tags:" << endl;

  const unsigned int nc(collectionTagsGlobal_.size());
  const unsigned int nf(filterTagsGlobal_.size());
  LogVerbatim("TriggerSummaryProducerAOD") << " Overall number of Collections/Filters: "
                  << nc << "/" << nf << endl;

  LogVerbatim("TriggerSummaryProducerAOD") << " The collections: " << nc << endl;
  const InputTagSet::const_iterator cb(collectionTagsGlobal_.begin());
  const InputTagSet::const_iterator ce(collectionTagsGlobal_.end());
  for ( InputTagSet::const_iterator ci=cb; ci!=ce; ++ci) {
    LogVerbatim("TriggerSummaryProducerAOD") << "  " << distance(cb,ci) << " " << ci->encode() << endl;
  }

  LogVerbatim("TriggerSummaryProducerAOD") << " The filters:" << nf << endl;
  const InputTagSet::const_iterator fb(filterTagsGlobal_.begin());
  const InputTagSet::const_iterator fe(filterTagsGlobal_.end());
  for ( InputTagSet::const_iterator fi=fb; fi!=fe; ++fi) {
    LogVerbatim("TriggerSummaryProducerAOD") << "  " << distance(fb,fi) << " " << fi->encode() << endl;
  }

  LogVerbatim("TriggerSummaryProducerAOD") << "TriggerSummaryProducerAOD::endJob." << endl;
  LogVerbatim("TriggerSummaryProducerAOD") << endl;

  return;

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

                                                                                                              {

  keys_.push_back(offset+ref.key());
  ids_.push_back(id);

  return;
}
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.

                                                                                                                                       {

  using namespace trigger;

  if (id==TriggerL1HfBitCounts) {
    keys_.push_back(offset+2*ref.key()+1);
  } else { // if (ids[i]==TriggerL1HfRingEtSums) {
    keys_.push_back(offset+2*ref.key()+0);
  }
  ids_.push_back(id);

  return;
}
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.

                                                                                                                                              {

  using namespace trigger;

  if ( (id==TriggerL1ETT) || (id==TriggerL1HTT) ) {
    keys_.push_back(offset+2*ref.key()+1);
  } else {
    keys_.push_back(offset+2*ref.key()+0);
  }
  ids_.push_back(id);

  return;
}
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.

                                                                                                                                  {

  using namespace trigger;

  if ( (id==TriggerTHT) || (id==TriggerTET) ) {
    keys_.push_back(offset+4*ref.key()+1);
  } else if ( (id==TriggerMETSig) || (id==TriggerMHTSig) ) {
    keys_.push_back(offset+4*ref.key()+2);
  } else if ( (id==TriggerELongit) || (id==TriggerHLongit) ) {
    keys_.push_back(offset+4*ref.key()+3);
  } else {
    keys_.push_back(offset+4*ref.key()+0);
  }
  ids_.push_back(id);

  return;
}
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.

                                                                                                                              {

  using namespace trigger;

  if ( (id==TriggerTHT) || (id==TriggerTET) ) {
    keys_.push_back(offset+4*ref.key()+1);
  } else if ( (id==TriggerMETSig) || (id==TriggerMHTSig) ) {
    keys_.push_back(offset+4*ref.key()+2);
  } else if ( (id==TriggerELongit) || (id==TriggerHLongit) ) {
    keys_.push_back(offset+4*ref.key()+3);
  } else {
    keys_.push_back(offset+4*ref.key()+0);
  }
  ids_.push_back(id);

  return;
}
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 dt_dqm_sourceclient_common_cff::reco.

Referenced by produce().

                                                                                                                                                                 {


  using namespace std;
  using namespace edm;
  using namespace reco;
  using namespace l1extra;
  using namespace trigger;

  if (ids.size()!=refs.size()) {
    LogError("TriggerSummaryProducerAOD") << "Vector length is different: "
                                          << ids.size() << " " << refs.size();
  }

  const unsigned int n(min(ids.size(),refs.size()));
  for (unsigned int i=0; i!=n; ++i) {
    const ProductID pid(refs[i].id());
    if (offset_.find(pid)==offset_.end()) {
      const string&    label(iEvent.getProvenance(pid).moduleLabel());
      const string& instance(iEvent.getProvenance(pid).productInstanceName());
      const string&  process(iEvent.getProvenance(pid).processName());
      LogError("TriggerSummaryProducerAOD")
        << "Uunknown pid:"
        << " FilterTag/Key: " << tag.encode()
        << "/" << i
        << " CollectionTag/Key: "
        << InputTag(label,instance,process).encode()
        << "/" << refs[i].key()
        << " CollectionType: " << typeid(C).name();
    } else {
      fillFilterObjectMember(offset_[pid],ids[i],refs[i]);
    }
  }
  return;

}
void TriggerSummaryProducerAOD::fillTriggerObject ( const reco::MET object)

Definition at line 410 of file TriggerSummaryProducerAOD.cc.

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

                                                                       {

  using namespace reco;
  using namespace trigger;

  toc_.push_back( TriggerObject(object) );
  toc_.push_back(TriggerObject(TriggerTHT    ,object.sumEt()         ,0.0,0.0,0.0));
  toc_.push_back(TriggerObject(TriggerMHTSig ,object.mEtSig()        ,0.0,0.0,0.0));
  toc_.push_back(TriggerObject(TriggerHLongit,object.e_longitudinal(),0.0,0.0,0.0));

  return;
}
void TriggerSummaryProducerAOD::fillTriggerObject ( const reco::CaloMET object)

Definition at line 397 of file TriggerSummaryProducerAOD.cc.

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

                                                                           {

  using namespace reco;
  using namespace trigger;

  toc_.push_back( TriggerObject(object) );
  toc_.push_back(TriggerObject(TriggerTET    ,object.sumEt()         ,0.0,0.0,0.0));
  toc_.push_back(TriggerObject(TriggerMETSig ,object.mEtSig()        ,0.0,0.0,0.0));
  toc_.push_back(TriggerObject(TriggerELongit,object.e_longitudinal(),0.0,0.0,0.0));

  return;
}
template<typename T >
void TriggerSummaryProducerAOD::fillTriggerObject ( const T object)

Definition at line 353 of file TriggerSummaryProducerAOD.cc.

References toc_.

Referenced by fillTriggerObjectCollections().

                                                                 {

  using namespace trigger;
  toc_.push_back( TriggerObject(object) );

  return;
}
void TriggerSummaryProducerAOD::fillTriggerObject ( const l1extra::L1EtMissParticle object)

Definition at line 380 of file TriggerSummaryProducerAOD.cc.

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

                                                                                       {

  using namespace l1extra;
  using namespace trigger;

  toc_.push_back( TriggerObject(object) );
  if (object.type()==L1EtMissParticle::kMET) {
    toc_.push_back(TriggerObject(TriggerL1ETT,object.etTotal(),0.0,0.0,0.0));
  } else if (object.type()==L1EtMissParticle::kMHT) {
    toc_.push_back(TriggerObject(TriggerL1HTT,object.etTotal(),0.0,0.0,0.0));
  } else {
    toc_.push_back(TriggerObject(0,           object.etTotal(),0.0,0.0,0.0));
  }

  return;
}
void TriggerSummaryProducerAOD::fillTriggerObject ( const l1extra::L1HFRings object)

Definition at line 361 of file TriggerSummaryProducerAOD.cc.

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

                                                                                {

  using namespace l1extra;
  using namespace trigger;

  toc_.push_back(TriggerObject(TriggerL1HfRingEtSums,
       object.hfEtSum(L1HFRings::kRing1PosEta),
       object.hfEtSum(L1HFRings::kRing1NegEta),
       object.hfEtSum(L1HFRings::kRing2PosEta),
       object.hfEtSum(L1HFRings::kRing2NegEta) ) );
  toc_.push_back(TriggerObject(TriggerL1HfBitCounts,
       object.hfBitCount(L1HFRings::kRing1PosEta),
       object.hfBitCount(L1HFRings::kRing1NegEta),
       object.hfBitCount(L1HFRings::kRing2PosEta),
       object.hfBitCount(L1HFRings::kRing2NegEta) ) );

  return;
}
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(), dt_dqm_sourceclient_common_cff::reco, findQualityFiles::size, tags_, and toc_.

                                                                                                                   {


  using namespace std;
  using namespace edm;
  using namespace reco;
  using namespace l1extra;
  using namespace trigger;

  vector<Handle<C> > collections;
  getter.fillHandles(iEvent, collections);
  const unsigned int nc(collections.size());

  for (unsigned int ic=0; ic!=nc; ++ic) {
    const Provenance& provenance(*(collections[ic].provenance()));
    const string& label    (provenance.moduleLabel());
    const string& instance (provenance.productInstanceName());
    const string& process  (provenance.processName());
    const InputTag collectionTag(label,instance,process);

    if (collectionTagsEvent_.find(collectionTag)!=collectionTagsEvent_.end()) {
      const ProductID pid(collections[ic].provenance()->productID());
      if (offset_.find(pid)!=offset_.end()) {
        LogError("TriggerSummaryProducerAOD") << "Duplicate pid!";
      }
      offset_[pid]=toc_.size();
      const unsigned int n(collections[ic]->size());
      for (unsigned int i=0; i!=n; ++i) {
        fillTriggerObject( (*collections[ic])[i] );
      }
      tags_.push_back(collectionTag.encode());
      keys_.push_back(toc_.size());
    }

  } 
}
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(), dt_dqm_sourceclient_common_cff::reco, tags_, and toc_.

{
   using namespace std;
   using namespace edm;
   using namespace reco;
   using namespace l1extra;
   using namespace trigger;

   std::vector<edm::Handle<trigger::TriggerFilterObjectWithRefs> > fobs;
   getTriggerFilterObjectWithRefs_.fillHandles(iEvent, fobs);

   const unsigned int nfob(fobs.size());
   LogTrace("TriggerSummaryProducerAOD") << "Number of filter  objects found: " << nfob;

   string tagLabel,tagInstance,tagProcess;

   maskFilters_.clear();
   maskFilters_.resize(nfob);
   filterTagsEvent_.clear();
   collectionTagsEvent_.clear();
   unsigned int nf(0);
   for (unsigned int ifob=0; ifob!=nfob; ++ifob) {
     maskFilters_[ifob]=false;
     const vector<string>& collectionTags_(fobs[ifob]->getCollectionTagsAsStrings());
     const unsigned int ncol(collectionTags_.size());
     if (ncol>0) {
       nf++;
       maskFilters_[ifob]=true;
       const string& label    (fobs[ifob].provenance()->moduleLabel());
       const string& instance (fobs[ifob].provenance()->productInstanceName());
       const string& process  (fobs[ifob].provenance()->processName());
       filterTagsEvent_.insert(InputTag(label,instance,process));
       for (unsigned int icol=0; icol!=ncol; ++icol) {
         // overwrite process name (usually not set)
         tokenizeTag(collectionTags_[icol],tagLabel,tagInstance,tagProcess);
         collectionTagsEvent_.insert(InputTag(tagLabel,tagInstance,pn_));
       }
     }
   }
   if (filterTagsEvent_.size()!=nf) {
     LogError("TriggerSummaryProducerAOD")
       << "Mismatch in number of filter tags: "
       << filterTagsEvent_.size() << "!=" << nf ;
   }

   collectionTagsGlobal_.insert(collectionTagsEvent_.begin(),collectionTagsEvent_.end());
   filterTagsGlobal_.insert(filterTagsEvent_.begin(),filterTagsEvent_.end());

   if (isDebugEnabled()) {

     const unsigned int nc(collectionTagsEvent_.size());
     LogTrace("TriggerSummaryProducerAOD") << "Number of unique collections requested " << nc;
     const InputTagSet::const_iterator cb(collectionTagsEvent_.begin());
     const InputTagSet::const_iterator ce(collectionTagsEvent_.end());
     for ( InputTagSet::const_iterator ci=cb; ci!=ce; ++ci) {
       LogTrace("TriggerSummaryProducerAOD") << distance(cb,ci) << " " << ci->encode();
     }
     const unsigned int nf(filterTagsEvent_.size());
     LogTrace("TriggerSummaryProducerAOD") << "Number of unique filters requested " << nf;
     const InputTagSet::const_iterator fb(filterTagsEvent_.begin());
     const InputTagSet::const_iterator fe(filterTagsEvent_.end());
     for ( InputTagSet::const_iterator fi=fb; fi!=fe; ++fi) {
       LogTrace("TriggerSummaryProducerAOD") << distance(fb,fi) << " " << fi->encode();
     }

   }

   toc_.clear();
   tags_.clear();
   keys_.clear();
   offset_.clear();
   fillTriggerObjectCollections<          RecoEcalCandidateCollection>(iEvent, getRecoEcalCandidateCollection_);
   fillTriggerObjectCollections<                   ElectronCollection>(iEvent, getElectronCollection_);
   fillTriggerObjectCollections<       RecoChargedCandidateCollection>(iEvent, getRecoChargedCandidateCollection_);
   fillTriggerObjectCollections<                    CaloJetCollection>(iEvent, getCaloJetCollection_);
   fillTriggerObjectCollections<         CompositeCandidateCollection>(iEvent, getCompositeCandidateCollection_);
   fillTriggerObjectCollections<                        METCollection>(iEvent, getMETCollection_);
   fillTriggerObjectCollections<                    CaloMETCollection>(iEvent, getCaloMETCollection_);
   fillTriggerObjectCollections<IsolatedPixelTrackCandidateCollection>(iEvent, getIsolatedPixelTrackCandidateCollection_);
   fillTriggerObjectCollections<               L1EmParticleCollection>(iEvent, getL1EmParticleCollection_);
   fillTriggerObjectCollections<             L1MuonParticleCollection>(iEvent, getL1MuonParticleCollection_);
   fillTriggerObjectCollections<              L1JetParticleCollection>(iEvent, getL1JetParticleCollection_);
   fillTriggerObjectCollections<           L1EtMissParticleCollection>(iEvent, getL1EtMissParticleCollection_);
   fillTriggerObjectCollections<                  L1HFRingsCollection>(iEvent, getL1HFRingsCollection_);
   fillTriggerObjectCollections<                      PFJetCollection>(iEvent, getPFJetCollection_);
   fillTriggerObjectCollections<                      PFTauCollection>(iEvent, getPFTauCollection_);
   const unsigned int nk(tags_.size());
   LogDebug("TriggerSummaryProducerAOD") << "Number of collections found: " << nk;
   const unsigned int no(toc_.size());
   LogDebug("TriggerSummaryProducerAOD") << "Number of physics objects found: " << no;

   auto_ptr<TriggerEvent> product(new TriggerEvent(pn_,nk,no,nf));

   product->addCollections(tags_,keys_);
   product->addObjects(toc_);

   for (unsigned int ifob=0; ifob!=nfob; ++ifob) {
     if (maskFilters_[ifob]) {
       const string& label    (fobs[ifob].provenance()->moduleLabel());
       const string& instance (fobs[ifob].provenance()->productInstanceName());
       const string& process  (fobs[ifob].provenance()->processName());
       const edm::InputTag filterTag(label,instance,process);
       ids_.clear();
       keys_.clear();
       fillFilterObjectMembers(iEvent,filterTag,fobs[ifob]->photonIds()   ,fobs[ifob]->photonRefs());
       fillFilterObjectMembers(iEvent,filterTag,fobs[ifob]->electronIds() ,fobs[ifob]->electronRefs());
       fillFilterObjectMembers(iEvent,filterTag,fobs[ifob]->muonIds()     ,fobs[ifob]->muonRefs());
       fillFilterObjectMembers(iEvent,filterTag,fobs[ifob]->jetIds()      ,fobs[ifob]->jetRefs());
       fillFilterObjectMembers(iEvent,filterTag,fobs[ifob]->compositeIds(),fobs[ifob]->compositeRefs());
       fillFilterObjectMembers(iEvent,filterTag,fobs[ifob]->basemetIds()  ,fobs[ifob]->basemetRefs());
       fillFilterObjectMembers(iEvent,filterTag,fobs[ifob]->calometIds()  ,fobs[ifob]->calometRefs());
       fillFilterObjectMembers(iEvent,filterTag,fobs[ifob]->pixtrackIds() ,fobs[ifob]->pixtrackRefs());
       fillFilterObjectMembers(iEvent,filterTag,fobs[ifob]->l1emIds()     ,fobs[ifob]->l1emRefs());
       fillFilterObjectMembers(iEvent,filterTag,fobs[ifob]->l1muonIds()   ,fobs[ifob]->l1muonRefs());
       fillFilterObjectMembers(iEvent,filterTag,fobs[ifob]->l1jetIds()    ,fobs[ifob]->l1jetRefs());
       fillFilterObjectMembers(iEvent,filterTag,fobs[ifob]->l1etmissIds() ,fobs[ifob]->l1etmissRefs());
       fillFilterObjectMembers(iEvent,filterTag,fobs[ifob]->l1hfringsIds(),fobs[ifob]->l1hfringsRefs());
       fillFilterObjectMembers(iEvent,filterTag,fobs[ifob]->pfjetIds()    ,fobs[ifob]->pfjetRefs());
       fillFilterObjectMembers(iEvent,filterTag,fobs[ifob]->pftauIds()    ,fobs[ifob]->pftauRefs());
       product->addFilter(filterTag,ids_,keys_);
     }
   }

   OrphanHandle<TriggerEvent> ref = iEvent.put(product);
   LogTrace("TriggerSummaryProducerAOD") << "Number of physics objects packed: " << ref->sizeObjects();
   LogTrace("TriggerSummaryProducerAOD") << "Number of filter  objects packed: " << ref->sizeFilters();

}

Member Data Documentation

list of L3 collection tags

Definition at line 121 of file TriggerSummaryProducerAOD.h.

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

Definition at line 122 of file TriggerSummaryProducerAOD.h.

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

list of L3 filter tags

Definition at line 117 of file TriggerSummaryProducerAOD.h.

Referenced by produce(), and TriggerSummaryProducerAOD().

Definition at line 118 of file TriggerSummaryProducerAOD.h.

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

Definition at line 142 of file TriggerSummaryProducerAOD.h.

Referenced by produce(), and TriggerSummaryProducerAOD().

Definition at line 145 of file TriggerSummaryProducerAOD.h.

Referenced by produce(), and TriggerSummaryProducerAOD().

Definition at line 143 of file TriggerSummaryProducerAOD.h.

Referenced by produce(), and TriggerSummaryProducerAOD().

Definition at line 140 of file TriggerSummaryProducerAOD.h.

Referenced by produce(), and TriggerSummaryProducerAOD().

Definition at line 146 of file TriggerSummaryProducerAOD.h.

Referenced by produce(), and TriggerSummaryProducerAOD().

Definition at line 147 of file TriggerSummaryProducerAOD.h.

Referenced by produce(), and TriggerSummaryProducerAOD().

Definition at line 150 of file TriggerSummaryProducerAOD.h.

Referenced by produce(), and TriggerSummaryProducerAOD().

Definition at line 151 of file TriggerSummaryProducerAOD.h.

Referenced by produce(), and TriggerSummaryProducerAOD().

Definition at line 149 of file TriggerSummaryProducerAOD.h.

Referenced by produce(), and TriggerSummaryProducerAOD().

Definition at line 148 of file TriggerSummaryProducerAOD.h.

Referenced by produce(), and TriggerSummaryProducerAOD().

Definition at line 144 of file TriggerSummaryProducerAOD.h.

Referenced by produce(), and TriggerSummaryProducerAOD().

Definition at line 152 of file TriggerSummaryProducerAOD.h.

Referenced by produce(), and TriggerSummaryProducerAOD().

Definition at line 153 of file TriggerSummaryProducerAOD.h.

Referenced by produce(), and TriggerSummaryProducerAOD().

Definition at line 141 of file TriggerSummaryProducerAOD.h.

Referenced by produce(), and TriggerSummaryProducerAOD().

Definition at line 139 of file TriggerSummaryProducerAOD.h.

Referenced by produce(), and TriggerSummaryProducerAOD().

Definition at line 138 of file TriggerSummaryProducerAOD.h.

Referenced by produce(), and TriggerSummaryProducerAOD().

ids

Definition at line 133 of file TriggerSummaryProducerAOD.h.

Referenced by fillFilterObjectMember(), and produce().

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 object collection

Definition at line 125 of file TriggerSummaryProducerAOD.h.

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