51 pn_(ps.getParameter<std::
string>(
"processName")),
52 filterTagsEvent_(pn_!=
"*"),
53 filterTagsStream_(pn_!=
"*"),
54 collectionTagsEvent_(pn_!=
"*"),
55 collectionTagsStream_(pn_!=
"*"),
68 edm::LogError(
"TriggerSummaryProducerAOD") <<
"HLT Error: TriggerNamesService not available!";
77 LogDebug(
"TriggerSummaryProducerAOD") <<
"Using process name: '" <<
pn_ <<
"'";
82 produces<trigger::TriggerEvent>();
135 const char token(
':');
140 if (i1==string::npos) {
144 instance=label.substr(i1+1);
147 if (i2==string::npos) {
150 process=instance.substr(i2+1);
160 descriptions.
add(
"triggerSummaryProducerAOD", desc);
169 using namespace reco;
170 using namespace l1extra;
171 using namespace trigger;
173 std::vector<edm::Handle<trigger::TriggerFilterObjectWithRefs> > fobs;
176 const unsigned int nfob(fobs.size());
177 LogTrace(
"TriggerSummaryProducerAOD") <<
"Number of filter objects found: " << nfob;
179 string tagLabel,tagInstance,tagProcess;
191 for (
unsigned int ifob=0; ifob!=nfob; ++ifob) {
193 const vector<string>& collectionTags_(fobs[ifob]->getCollectionTagsAsStrings());
194 const unsigned int ncol(collectionTags_.size());
198 const string&
label (fobs[ifob].provenance()->moduleLabel());
199 const string&
instance (fobs[ifob].provenance()->productInstanceName());
202 for (
unsigned int icol=0; icol!=ncol; ++icol) {
204 tokenizeTag(collectionTags_[icol],tagLabel,tagInstance,tagProcess);
211 LogError(
"TriggerSummaryProducerAOD")
212 <<
"Mismatch in number of filter tags: "
225 LogTrace(
"TriggerSummaryProducerAOD") <<
"Number of unique collections requested " << nc;
228 for ( InputTagSet::const_iterator ci=cb; ci!=ce; ++ci) {
229 LogTrace(
"TriggerSummaryProducerAOD") <<
distance(cb,ci) <<
" " << ci->encode();
232 LogTrace(
"TriggerSummaryProducerAOD") <<
"Number of unique filters requested " << nf;
235 for ( InputTagSet::const_iterator fi=
fb; fi!=fe; ++fi) {
268 const unsigned int nk(
tags_.size());
269 LogDebug(
"TriggerSummaryProducerAOD") <<
"Number of collections found: " << nk;
270 const unsigned int no(
toc_.size());
271 LogDebug(
"TriggerSummaryProducerAOD") <<
"Number of physics objects found: " << no;
279 product->addObjects(
toc_);
282 for (
unsigned int ifob=0; ifob!=nfob; ++ifob) {
284 const string&
label (fobs[ifob].provenance()->moduleLabel());
285 const string&
instance (fobs[ifob].provenance()->productInstanceName());
305 product->addFilter(filterTag,
ids_,
keys_);
310 LogTrace(
"TriggerSummaryProducerAOD") <<
"Number of physics objects packed: " << ref->sizeObjects();
311 LogTrace(
"TriggerSummaryProducerAOD") <<
"Number of filter objects packed: " << ref->sizeFilters();
315 template <
typename C>
324 using namespace reco;
325 using namespace l1extra;
326 using namespace trigger;
328 vector<Handle<C> > collections;
330 const unsigned int nc(collections.size());
332 for (
unsigned int ic=0; ic!=nc; ++ic) {
333 const Provenance& provenance(*(collections[ic].provenance()));
337 const InputTag collectionTag(label,instance,process);
340 const ProductID pid(collections[ic].provenance()->productID());
342 LogError(
"TriggerSummaryProducerAOD") <<
"Duplicate pid!";
345 const unsigned int n(collections[ic]->
size());
346 for (
unsigned int i=0;
i!=
n; ++
i) {
349 tags_.push_back(collectionTag.encode());
356 template <
typename T>
359 using namespace trigger;
367 using namespace l1extra;
368 using namespace trigger;
371 object.hfEtSum(L1HFRings::kRing1PosEta),
372 object.hfEtSum(L1HFRings::kRing1NegEta),
373 object.hfEtSum(L1HFRings::kRing2PosEta),
374 object.hfEtSum(L1HFRings::kRing2NegEta) ) );
376 object.hfBitCount(L1HFRings::kRing1PosEta),
377 object.hfBitCount(L1HFRings::kRing1NegEta),
378 object.hfBitCount(L1HFRings::kRing2PosEta),
379 object.hfBitCount(L1HFRings::kRing2NegEta) ) );
386 using namespace l1extra;
387 using namespace trigger;
390 if (
object.
type()==L1EtMissParticle::kMET) {
392 }
else if (
object.
type()==L1EtMissParticle::kMHT) {
403 using namespace reco;
404 using namespace trigger;
416 using namespace reco;
417 using namespace trigger;
427 template <
typename C>
436 using namespace reco;
437 using namespace l1extra;
438 using namespace trigger;
440 if (ids.size()!=refs.size()) {
441 LogError(
"TriggerSummaryProducerAOD") <<
"Vector length is different: "
442 << ids.size() <<
" " << refs.size();
445 const unsigned int n(
min(ids.size(),refs.size()));
446 for (
unsigned int i=0;
i!=
n; ++
i) {
449 LogError(
"TriggerSummaryProducerAOD")
450 <<
"Iinvalid pid: " << pid
451 <<
" FilterTag / Key: " << tag.
encode()
452 <<
" / " <<
i <<
"of" << n
453 <<
" CollectionTag / Key: "
454 <<
" <Unrecoverable>"
455 <<
" / " << refs[
i].key()
456 <<
" CollectionType: " <<
typeid(
C).
name();
461 LogError(
"TriggerSummaryProducerAOD")
462 <<
"Uunknown pid: " << pid
463 <<
" FilterTag / Key: " << tag.
encode()
464 <<
" / " <<
i <<
"of" << n
465 <<
" CollectionTag / Key: "
466 <<
InputTag(label,instance,process).encode()
467 <<
" / " << refs[
i].key()
468 <<
" CollectionType: " <<
typeid(
C).
name();
477 template <
typename C>
488 using namespace trigger;
491 keys_.push_back(offset+2*ref.
key()+1);
493 keys_.push_back(offset+2*ref.
key()+0);
502 using namespace trigger;
505 keys_.push_back(offset+2*ref.
key()+1);
507 keys_.push_back(offset+2*ref.
key()+0);
516 using namespace trigger;
519 keys_.push_back(offset+4*ref.
key()+1);
521 keys_.push_back(offset+4*ref.
key()+2);
523 keys_.push_back(offset+4*ref.
key()+3);
525 keys_.push_back(offset+4*ref.
key()+0);
534 using namespace trigger;
537 keys_.push_back(offset+4*ref.
key()+1);
539 keys_.push_back(offset+4*ref.
key()+2);
541 keys_.push_back(offset+4*ref.
key()+3);
543 keys_.push_back(offset+4*ref.
key()+0);
560 using namespace trigger;
563 LogVerbatim(
"TriggerSummaryProducerAOD") <<
"TriggerSummaryProducerAOD::globalEndJob - accumulated tags:" << endl;
571 const unsigned int nc(collectionTags.size());
572 const unsigned int nf(filterTags.size());
573 LogVerbatim(
"TriggerSummaryProducerAOD") <<
" Overall number of Collections/Filters: "
574 << nc <<
"/" << nf << endl;
576 LogVerbatim(
"TriggerSummaryProducerAOD") <<
" The collections: " << nc << endl;
577 const InputTagSet::const_iterator cb(collectionTags.begin());
578 const InputTagSet::const_iterator ce(collectionTags.end());
579 for ( InputTagSet::const_iterator ci=cb; ci!=ce; ++ci) {
580 LogVerbatim(
"TriggerSummaryProducerAOD") <<
" " <<
distance(cb,ci) <<
" " << ci->encode() << endl;
583 LogVerbatim(
"TriggerSummaryProducerAOD") <<
" The filters:" << nf << endl;
584 const InputTagSet::const_iterator
fb(filterTags.begin());
585 const InputTagSet::const_iterator fe(filterTags.end());
586 for ( InputTagSet::const_iterator fi=
fb; fi!=fe; ++fi) {
590 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
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_