59 pn_(ps.getParameter<std::
string>(
"processName")),
60 filterTagsEvent_(pn_!=
"*"),
61 filterTagsStream_(pn_!=
"*"),
62 collectionTagsEvent_(pn_!=
"*"),
63 collectionTagsStream_(pn_!=
"*"),
76 edm::LogError(
"TriggerSummaryProducerAOD") <<
"HLT Error: TriggerNamesService not available!";
85 LogDebug(
"TriggerSummaryProducerAOD") <<
"Using process name: '" <<
pn_ <<
"'";
90 produces<trigger::TriggerEvent>();
155 const char token(
':');
160 if (i1==string::npos) {
164 instance=label.substr(i1+1);
167 if (i2==string::npos) {
170 process=instance.substr(i2+1);
180 descriptions.
add(
"triggerSummaryProducerAOD", desc);
189 using namespace reco;
190 using namespace l1extra;
191 using namespace trigger;
194 std::vector<edm::Handle<trigger::TriggerFilterObjectWithRefs> > fobs;
197 const unsigned int nfob(fobs.size());
198 LogTrace(
"TriggerSummaryProducerAOD") <<
"Number of filter objects found: " << nfob;
200 string tagLabel,tagInstance,tagProcess;
212 for (
unsigned int ifob=0; ifob!=nfob; ++ifob) {
214 const vector<string>& collectionTags_(fobs[ifob]->getCollectionTagsAsStrings());
215 const unsigned int ncol(collectionTags_.size());
219 const string&
label (fobs[ifob].provenance()->moduleLabel());
220 const string&
instance (fobs[ifob].provenance()->productInstanceName());
223 for (
unsigned int icol=0; icol!=ncol; ++icol) {
225 tokenizeTag(collectionTags_[icol],tagLabel,tagInstance,tagProcess);
232 LogError(
"TriggerSummaryProducerAOD")
233 <<
"Mismatch in number of filter tags: "
246 LogTrace(
"TriggerSummaryProducerAOD") <<
"Number of unique collections requested " << nc;
249 for ( InputTagSet::const_iterator ci=cb; ci!=ce; ++ci) {
250 LogTrace(
"TriggerSummaryProducerAOD") <<
distance(cb,ci) <<
" " << ci->encode();
253 LogTrace(
"TriggerSummaryProducerAOD") <<
"Number of unique filters requested " << nf;
256 for ( InputTagSet::const_iterator fi=
fb; fi!=fe; ++fi) {
295 const unsigned int nk(
tags_.size());
296 LogDebug(
"TriggerSummaryProducerAOD") <<
"Number of collections found: " << nk;
297 const unsigned int no(
toc_.size());
298 LogDebug(
"TriggerSummaryProducerAOD") <<
"Number of physics objects found: " << no;
306 product->addObjects(
toc_);
309 for (
unsigned int ifob=0; ifob!=nfob; ++ifob) {
311 const string&
label (fobs[ifob].provenance()->moduleLabel());
312 const string&
instance (fobs[ifob].provenance()->productInstanceName());
338 product->addFilter(filterTag,
ids_,
keys_);
343 LogTrace(
"TriggerSummaryProducerAOD") <<
"Number of physics objects packed: " << ref->sizeObjects();
344 LogTrace(
"TriggerSummaryProducerAOD") <<
"Number of filter objects packed: " << ref->sizeFilters();
348 template <
typename C>
357 using namespace reco;
358 using namespace l1extra;
359 using namespace trigger;
362 vector<Handle<C> > collections;
364 const unsigned int nc(collections.size());
366 for (
unsigned int ic=0; ic!=nc; ++ic) {
367 const Provenance& provenance(*(collections[ic].provenance()));
371 const InputTag collectionTag(label,instance,process);
374 const ProductID pid(collections[ic].provenance()->productID());
376 LogError(
"TriggerSummaryProducerAOD") <<
"Duplicate pid!";
379 const unsigned int n(collections[ic]->
size());
380 for (
unsigned int i=0;
i!=
n; ++
i) {
383 tags_.push_back(collectionTag.encode());
390 template <
typename T>
393 using namespace trigger;
401 using namespace l1extra;
402 using namespace trigger;
405 object.hfEtSum(L1HFRings::kRing1PosEta),
406 object.hfEtSum(L1HFRings::kRing1NegEta),
407 object.hfEtSum(L1HFRings::kRing2PosEta),
408 object.hfEtSum(L1HFRings::kRing2NegEta) ) );
410 object.hfBitCount(L1HFRings::kRing1PosEta),
411 object.hfBitCount(L1HFRings::kRing1NegEta),
412 object.hfBitCount(L1HFRings::kRing2PosEta),
413 object.hfBitCount(L1HFRings::kRing2NegEta) ) );
420 using namespace l1extra;
421 using namespace trigger;
424 if (
object.
type()==L1EtMissParticle::kMET) {
426 }
else if (
object.
type()==L1EtMissParticle::kMHT) {
437 using namespace reco;
438 using namespace trigger;
450 using namespace reco;
451 using namespace trigger;
463 using namespace reco;
464 using namespace trigger;
474 template <
typename C>
483 using namespace reco;
484 using namespace l1extra;
485 using namespace trigger;
487 if (ids.size()!=refs.size()) {
488 LogError(
"TriggerSummaryProducerAOD") <<
"Vector length is different: "
489 << ids.size() <<
" " << refs.size();
492 const unsigned int n(
min(ids.size(),refs.size()));
493 for (
unsigned int i=0;
i!=
n; ++
i) {
496 LogError(
"TriggerSummaryProducerAOD")
497 <<
"Iinvalid pid: " << pid
498 <<
" FilterTag / Key: " << tag.
encode()
499 <<
" / " <<
i <<
"of" << n
500 <<
" CollectionTag / Key: "
501 <<
" <Unrecoverable>"
502 <<
" / " << refs[
i].key()
503 <<
" CollectionType: " <<
typeid(
C).
name();
508 LogError(
"TriggerSummaryProducerAOD")
509 <<
"Uunknown pid: " << pid
510 <<
" FilterTag / Key: " << tag.
encode()
511 <<
" / " <<
i <<
"of" << n
512 <<
" CollectionTag / Key: "
513 <<
InputTag(label,instance,process).encode()
514 <<
" / " << refs[
i].key()
515 <<
" CollectionType: " <<
typeid(
C).
name();
524 template <
typename C>
535 using namespace trigger;
538 keys_.push_back(offset+2*ref.
key()+1);
540 keys_.push_back(offset+2*ref.
key()+0);
549 using namespace trigger;
552 keys_.push_back(offset+2*ref.
key()+1);
554 keys_.push_back(offset+2*ref.
key()+0);
563 using namespace trigger;
566 keys_.push_back(offset+4*ref.
key()+1);
568 keys_.push_back(offset+4*ref.
key()+2);
570 keys_.push_back(offset+4*ref.
key()+3);
572 keys_.push_back(offset+4*ref.
key()+0);
581 using namespace trigger;
584 keys_.push_back(offset+4*ref.
key()+1);
586 keys_.push_back(offset+4*ref.
key()+2);
588 keys_.push_back(offset+4*ref.
key()+3);
590 keys_.push_back(offset+4*ref.
key()+0);
599 using namespace trigger;
602 keys_.push_back(offset+4*ref.
key()+1);
604 keys_.push_back(offset+4*ref.
key()+2);
606 keys_.push_back(offset+4*ref.
key()+3);
608 keys_.push_back(offset+4*ref.
key()+0);
625 using namespace trigger;
628 LogVerbatim(
"TriggerSummaryProducerAOD") <<
"TriggerSummaryProducerAOD::globalEndJob - accumulated tags:" << endl;
636 const unsigned int nc(collectionTags.size());
637 const unsigned int nf(filterTags.size());
638 LogVerbatim(
"TriggerSummaryProducerAOD") <<
" Overall number of Collections/Filters: "
639 << nc <<
"/" << nf << endl;
641 LogVerbatim(
"TriggerSummaryProducerAOD") <<
" The collections: " << nc << endl;
642 const InputTagSet::const_iterator cb(collectionTags.begin());
643 const InputTagSet::const_iterator ce(collectionTags.end());
644 for ( InputTagSet::const_iterator ci=cb; ci!=ce; ++ci) {
645 LogVerbatim(
"TriggerSummaryProducerAOD") <<
" " <<
distance(cb,ci) <<
" " << ci->encode() << endl;
648 LogVerbatim(
"TriggerSummaryProducerAOD") <<
" The filters:" << nf << endl;
649 const InputTagSet::const_iterator
fb(filterTags.begin());
650 const InputTagSet::const_iterator fe(filterTags.end());
651 for ( InputTagSet::const_iterator fi=
fb; fi!=fe; ++fi) {
655 LogVerbatim(
"TriggerSummaryProducerAOD") <<
"TriggerSummaryProducerAOD::endJob." << endl;
virtual void produce(edm::Event &, const edm::EventSetup &) override
void callWhenNewProductsRegistered(std::function< void(BranchDescription const &)> const &func)
edm::GetterOfProducts< l1t::TauBxCollection > getL1TTauParticleCollection_
edm::GetterOfProducts< l1extra::L1JetParticleCollection > getL1JetParticleCollection_
edm::GetterOfProducts< reco::IsolatedPixelTrackCandidateCollection > getIsolatedPixelTrackCandidateCollection_
edm::GetterOfProducts< reco::RecoEcalCandidateCollection > getRecoEcalCandidateCollection_
std::string const & getProcessName() const
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
edm::GetterOfProducts< l1extra::L1MuonParticleCollection > getL1MuonParticleCollection_
The single EDProduct to be saved for each event (AOD case)
trigger::TriggerObjectCollection toc_
trigger object collection
edm::GetterOfProducts< reco::PFTauCollection > getPFTauCollection_
~TriggerSummaryProducerAOD()
static PFTauRenderPlugin instance
std::vector< bool > maskFilters_
packing decision
edm::GetterOfProducts< reco::METCollection > getMETCollection_
edm::GetterOfProducts< l1t::JetBxCollection > getL1TJetParticleCollection_
std::set< edm::InputTag, OrderInputTag > InputTagSet
edm::GetterOfProducts< reco::CaloJetCollection > getCaloJetCollection_
void fillFilterObjectMember(const int &, const int &, const edm::Ref< C > &)
edm::GetterOfProducts< l1extra::L1EtMissParticleCollection > getL1EtMissParticleCollection_
key_type key() const
Accessor for product key.
std::vector< std::string > tags_
std::string const & processName() const
edm::GetterOfProducts< reco::PFJetCollection > getPFJetCollection_
Single trigger physics object (e.g., an isolated muon)
edm::GetterOfProducts< reco::RecoChargedCandidateCollection > getRecoChargedCandidateCollection_
InputTagSet collectionTagsStream_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
edm::GetterOfProducts< l1extra::L1HFRingsCollection > getL1HFRingsCollection_
void fillTriggerObject(const T &)
std::map< edm::ProductID, unsigned int > offset_
global map for indices into toc_: offset per input L3 collection
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void fillFilterObjectMembers(const edm::Event &, const edm::InputTag &tag, const trigger::Vids &, const std::vector< edm::Ref< C > > &)
edm::GetterOfProducts< l1t::MuonBxCollection > getL1TMuonParticleCollection_
InputTagSet filterTagsStream_
virtual void endStream() override
void add(std::string const &label, ParameterSetDescription const &psetDescription)
std::string const & moduleLabel() const
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
edm::GetterOfProducts< reco::PFMETCollection > getPFMETCollection_
void fillTriggerObjectCollections(const edm::Event &, edm::GetterOfProducts< C > &)
InputTagSet filterTagsEvent_
list of L3 filter tags
TriggerSummaryProducerAOD(const edm::ParameterSet &, const GlobalInputTags *)
static void globalEndJob(const GlobalInputTags *)
std::string const & productInstanceName() const
Provenance getProvenance(BranchID const &theID) const
edm::GetterOfProducts< l1t::EtSumBxCollection > getL1TEtSumParticleCollection_
tuple size
Write out results.
edm::GetterOfProducts< l1extra::L1EmParticleCollection > getL1EmParticleCollection_
edm::GetterOfProducts< l1t::EGammaBxCollection > getL1TEGammaParticleCollection_