53 pn_(ps.getParameter<std::
string>(
"processName")),
54 filterTagsEvent_(pn_!=
"*"),
55 filterTagsStream_(pn_!=
"*"),
56 collectionTagsEvent_(pn_!=
"*"),
57 collectionTagsStream_(pn_!=
"*"),
70 edm::LogError(
"TriggerSummaryProducerAOD") <<
"HLT Error: TriggerNamesService not available!";
79 LogDebug(
"TriggerSummaryProducerAOD") <<
"Using process name: '" <<
pn_ <<
"'";
84 produces<trigger::TriggerEvent>();
139 const char token(
':');
144 if (i1==string::npos) {
148 instance=label.substr(i1+1);
151 if (i2==string::npos) {
154 process=instance.substr(i2+1);
164 descriptions.
add(
"triggerSummaryProducerAOD", desc);
173 using namespace reco;
174 using namespace l1extra;
175 using namespace trigger;
177 std::vector<edm::Handle<trigger::TriggerFilterObjectWithRefs> > fobs;
180 const unsigned int nfob(fobs.size());
181 LogTrace(
"TriggerSummaryProducerAOD") <<
"Number of filter objects found: " << nfob;
183 string tagLabel,tagInstance,tagProcess;
195 for (
unsigned int ifob=0; ifob!=nfob; ++ifob) {
197 const vector<string>& collectionTags_(fobs[ifob]->getCollectionTagsAsStrings());
198 const unsigned int ncol(collectionTags_.size());
202 const string&
label (fobs[ifob].provenance()->moduleLabel());
203 const string&
instance (fobs[ifob].provenance()->productInstanceName());
206 for (
unsigned int icol=0; icol!=ncol; ++icol) {
208 tokenizeTag(collectionTags_[icol],tagLabel,tagInstance,tagProcess);
215 LogError(
"TriggerSummaryProducerAOD")
216 <<
"Mismatch in number of filter tags: "
229 LogTrace(
"TriggerSummaryProducerAOD") <<
"Number of unique collections requested " << nc;
232 for ( InputTagSet::const_iterator ci=cb; ci!=ce; ++ci) {
233 LogTrace(
"TriggerSummaryProducerAOD") <<
distance(cb,ci) <<
" " << ci->encode();
236 LogTrace(
"TriggerSummaryProducerAOD") <<
"Number of unique filters requested " << nf;
239 for ( InputTagSet::const_iterator fi=
fb; fi!=fe; ++fi) {
273 const unsigned int nk(
tags_.size());
274 LogDebug(
"TriggerSummaryProducerAOD") <<
"Number of collections found: " << nk;
275 const unsigned int no(
toc_.size());
276 LogDebug(
"TriggerSummaryProducerAOD") <<
"Number of physics objects found: " << no;
284 product->addObjects(
toc_);
287 for (
unsigned int ifob=0; ifob!=nfob; ++ifob) {
289 const string&
label (fobs[ifob].provenance()->moduleLabel());
290 const string&
instance (fobs[ifob].provenance()->productInstanceName());
311 product->addFilter(filterTag,
ids_,
keys_);
316 LogTrace(
"TriggerSummaryProducerAOD") <<
"Number of physics objects packed: " << ref->sizeObjects();
317 LogTrace(
"TriggerSummaryProducerAOD") <<
"Number of filter objects packed: " << ref->sizeFilters();
321 template <
typename C>
330 using namespace reco;
331 using namespace l1extra;
332 using namespace trigger;
334 vector<Handle<C> > collections;
336 const unsigned int nc(collections.size());
338 for (
unsigned int ic=0; ic!=nc; ++ic) {
339 const Provenance& provenance(*(collections[ic].provenance()));
343 const InputTag collectionTag(label,instance,process);
346 const ProductID pid(collections[ic].provenance()->productID());
348 LogError(
"TriggerSummaryProducerAOD") <<
"Duplicate pid!";
351 const unsigned int n(collections[ic]->
size());
352 for (
unsigned int i=0;
i!=
n; ++
i) {
355 tags_.push_back(collectionTag.encode());
362 template <
typename T>
365 using namespace trigger;
373 using namespace l1extra;
374 using namespace trigger;
377 object.hfEtSum(L1HFRings::kRing1PosEta),
378 object.hfEtSum(L1HFRings::kRing1NegEta),
379 object.hfEtSum(L1HFRings::kRing2PosEta),
380 object.hfEtSum(L1HFRings::kRing2NegEta) ) );
382 object.hfBitCount(L1HFRings::kRing1PosEta),
383 object.hfBitCount(L1HFRings::kRing1NegEta),
384 object.hfBitCount(L1HFRings::kRing2PosEta),
385 object.hfBitCount(L1HFRings::kRing2NegEta) ) );
392 using namespace l1extra;
393 using namespace trigger;
396 if (
object.
type()==L1EtMissParticle::kMET) {
398 }
else if (
object.
type()==L1EtMissParticle::kMHT) {
409 using namespace reco;
410 using namespace trigger;
422 using namespace reco;
423 using namespace trigger;
435 using namespace reco;
436 using namespace trigger;
446 template <
typename C>
455 using namespace reco;
456 using namespace l1extra;
457 using namespace trigger;
459 if (ids.size()!=refs.size()) {
460 LogError(
"TriggerSummaryProducerAOD") <<
"Vector length is different: "
461 << ids.size() <<
" " << refs.size();
464 const unsigned int n(
min(ids.size(),refs.size()));
465 for (
unsigned int i=0;
i!=
n; ++
i) {
468 LogError(
"TriggerSummaryProducerAOD")
469 <<
"Iinvalid pid: " << pid
470 <<
" FilterTag / Key: " << tag.
encode()
471 <<
" / " <<
i <<
"of" << n
472 <<
" CollectionTag / Key: "
473 <<
" <Unrecoverable>"
474 <<
" / " << refs[
i].key()
475 <<
" CollectionType: " <<
typeid(
C).
name();
480 LogError(
"TriggerSummaryProducerAOD")
481 <<
"Uunknown pid: " << pid
482 <<
" FilterTag / Key: " << tag.
encode()
483 <<
" / " <<
i <<
"of" << n
484 <<
" CollectionTag / Key: "
485 <<
InputTag(label,instance,process).encode()
486 <<
" / " << refs[
i].key()
487 <<
" CollectionType: " <<
typeid(
C).
name();
496 template <
typename C>
507 using namespace trigger;
510 keys_.push_back(offset+2*ref.
key()+1);
512 keys_.push_back(offset+2*ref.
key()+0);
521 using namespace trigger;
524 keys_.push_back(offset+2*ref.
key()+1);
526 keys_.push_back(offset+2*ref.
key()+0);
535 using namespace trigger;
538 keys_.push_back(offset+4*ref.
key()+1);
540 keys_.push_back(offset+4*ref.
key()+2);
542 keys_.push_back(offset+4*ref.
key()+3);
544 keys_.push_back(offset+4*ref.
key()+0);
553 using namespace trigger;
556 keys_.push_back(offset+4*ref.
key()+1);
558 keys_.push_back(offset+4*ref.
key()+2);
560 keys_.push_back(offset+4*ref.
key()+3);
562 keys_.push_back(offset+4*ref.
key()+0);
571 using namespace trigger;
574 keys_.push_back(offset+4*ref.
key()+1);
576 keys_.push_back(offset+4*ref.
key()+2);
578 keys_.push_back(offset+4*ref.
key()+3);
580 keys_.push_back(offset+4*ref.
key()+0);
597 using namespace trigger;
600 LogVerbatim(
"TriggerSummaryProducerAOD") <<
"TriggerSummaryProducerAOD::globalEndJob - accumulated tags:" << endl;
608 const unsigned int nc(collectionTags.size());
609 const unsigned int nf(filterTags.size());
610 LogVerbatim(
"TriggerSummaryProducerAOD") <<
" Overall number of Collections/Filters: "
611 << nc <<
"/" << nf << endl;
613 LogVerbatim(
"TriggerSummaryProducerAOD") <<
" The collections: " << nc << endl;
614 const InputTagSet::const_iterator cb(collectionTags.begin());
615 const InputTagSet::const_iterator ce(collectionTags.end());
616 for ( InputTagSet::const_iterator ci=cb; ci!=ce; ++ci) {
617 LogVerbatim(
"TriggerSummaryProducerAOD") <<
" " <<
distance(cb,ci) <<
" " << ci->encode() << endl;
620 LogVerbatim(
"TriggerSummaryProducerAOD") <<
" The filters:" << nf << endl;
621 const InputTagSet::const_iterator
fb(filterTags.begin());
622 const InputTagSet::const_iterator fe(filterTags.end());
623 for ( InputTagSet::const_iterator fi=
fb; fi!=fe; ++fi) {
627 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< 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_
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 > > &)
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
tuple size
Write out results.
edm::GetterOfProducts< l1extra::L1EmParticleCollection > getL1EmParticleCollection_