52 pn_(ps.getParameter<std::
string>(
"processName")),
53 filterTagsEvent_(pn_!=
"*"),
54 filterTagsGlobal_(pn_!=
"*"),
55 collectionTagsEvent_(pn_!=
"*"),
56 collectionTagsGlobal_(pn_!=
"*"),
69 edm::LogError(
"TriggerSummaryProducerAOD") <<
"HLT Error: TriggerNamesService not available!";
78 LogDebug(
"TriggerSummaryProducerAOD") <<
"Using process name: '" <<
pn_ <<
"'";
83 produces<trigger::TriggerEvent>();
136 const char token(
':');
141 if (i1==string::npos) {
145 instance=label.substr(i1+1);
148 if (i2==string::npos) {
151 process=instance.substr(i2+1);
161 descriptions.
add(
"triggerSummaryProducerAOD", desc);
170 using namespace reco;
171 using namespace l1extra;
172 using namespace trigger;
174 std::vector<edm::Handle<trigger::TriggerFilterObjectWithRefs> > fobs;
177 const unsigned int nfob(fobs.size());
178 LogTrace(
"TriggerSummaryProducerAOD") <<
"Number of filter objects found: " << nfob;
180 string tagLabel,tagInstance,tagProcess;
192 for (
unsigned int ifob=0; ifob!=nfob; ++ifob) {
194 const vector<string>& collectionTags_(fobs[ifob]->getCollectionTagsAsStrings());
195 const unsigned int ncol(collectionTags_.size());
199 const string&
label (fobs[ifob].provenance()->moduleLabel());
200 const string&
instance (fobs[ifob].provenance()->productInstanceName());
201 const string&
process (fobs[ifob].provenance()->processName());
203 for (
unsigned int icol=0; icol!=ncol; ++icol) {
205 tokenizeTag(collectionTags_[icol],tagLabel,tagInstance,tagProcess);
212 LogError(
"TriggerSummaryProducerAOD")
213 <<
"Mismatch in number of filter tags: "
226 LogTrace(
"TriggerSummaryProducerAOD") <<
"Number of unique collections requested " << nc;
229 for ( InputTagSet::const_iterator ci=cb; ci!=ce; ++ci) {
230 LogTrace(
"TriggerSummaryProducerAOD") << distance(cb,ci) <<
" " << ci->encode();
233 LogTrace(
"TriggerSummaryProducerAOD") <<
"Number of unique filters requested " << nf;
236 for ( InputTagSet::const_iterator fi=
fb; fi!=fe; ++fi) {
237 LogTrace(
"TriggerSummaryProducerAOD") << distance(
fb,fi) <<
" " << fi->encode();
269 const unsigned int nk(
tags_.size());
270 LogDebug(
"TriggerSummaryProducerAOD") <<
"Number of collections found: " << nk;
271 const unsigned int no(
toc_.size());
272 LogDebug(
"TriggerSummaryProducerAOD") <<
"Number of physics objects found: " << no;
280 product->addObjects(
toc_);
283 for (
unsigned int ifob=0; ifob!=nfob; ++ifob) {
285 const string&
label (fobs[ifob].provenance()->moduleLabel());
286 const string&
instance (fobs[ifob].provenance()->productInstanceName());
287 const string&
process (fobs[ifob].provenance()->processName());
306 product->addFilter(filterTag,
ids_,
keys_);
311 LogTrace(
"TriggerSummaryProducerAOD") <<
"Number of physics objects packed: " << ref->sizeObjects();
312 LogTrace(
"TriggerSummaryProducerAOD") <<
"Number of filter objects packed: " << ref->sizeFilters();
316 template <
typename C>
325 using namespace reco;
326 using namespace l1extra;
327 using namespace trigger;
329 vector<Handle<C> > collections;
331 const unsigned int nc(collections.size());
333 for (
unsigned int ic=0; ic!=nc; ++ic) {
334 const Provenance& provenance(*(collections[ic].provenance()));
338 const InputTag collectionTag(label,instance,process);
341 const ProductID pid(collections[ic].provenance()->productID());
343 LogError(
"TriggerSummaryProducerAOD") <<
"Duplicate pid!";
346 const unsigned int n(collections[ic]->
size());
347 for (
unsigned int i=0;
i!=
n; ++
i) {
350 tags_.push_back(collectionTag.encode());
357 template <
typename T>
360 using namespace trigger;
368 using namespace l1extra;
369 using namespace trigger;
372 object.hfEtSum(L1HFRings::kRing1PosEta),
373 object.hfEtSum(L1HFRings::kRing1NegEta),
374 object.hfEtSum(L1HFRings::kRing2PosEta),
375 object.hfEtSum(L1HFRings::kRing2NegEta) ) );
377 object.hfBitCount(L1HFRings::kRing1PosEta),
378 object.hfBitCount(L1HFRings::kRing1NegEta),
379 object.hfBitCount(L1HFRings::kRing2PosEta),
380 object.hfBitCount(L1HFRings::kRing2NegEta) ) );
387 using namespace l1extra;
388 using namespace trigger;
391 if (
object.
type()==L1EtMissParticle::kMET) {
393 }
else if (
object.
type()==L1EtMissParticle::kMHT) {
404 using namespace reco;
405 using namespace trigger;
417 using namespace reco;
418 using namespace trigger;
428 template <
typename C>
437 using namespace reco;
438 using namespace l1extra;
439 using namespace trigger;
441 if (ids.size()!=refs.size()) {
442 LogError(
"TriggerSummaryProducerAOD") <<
"Vector length is different: "
443 << ids.size() <<
" " << refs.size();
446 const unsigned int n(
min(ids.size(),refs.size()));
447 for (
unsigned int i=0;
i!=
n; ++
i) {
453 LogError(
"TriggerSummaryProducerAOD")
455 <<
" FilterTag/Key: " << tag.
encode()
457 <<
" CollectionTag/Key: "
459 <<
"/" << refs[
i].key()
460 <<
" CollectionType: " <<
typeid(
C).
name();
469 template <
typename C>
480 using namespace trigger;
483 keys_.push_back(offset+2*ref.
key()+1);
485 keys_.push_back(offset+2*ref.
key()+0);
494 using namespace trigger;
497 keys_.push_back(offset+2*ref.
key()+1);
499 keys_.push_back(offset+2*ref.
key()+0);
508 using namespace trigger;
511 keys_.push_back(offset+4*ref.
key()+1);
513 keys_.push_back(offset+4*ref.
key()+2);
515 keys_.push_back(offset+4*ref.
key()+3);
517 keys_.push_back(offset+4*ref.
key()+0);
526 using namespace trigger;
529 keys_.push_back(offset+4*ref.
key()+1);
531 keys_.push_back(offset+4*ref.
key()+2);
533 keys_.push_back(offset+4*ref.
key()+3);
535 keys_.push_back(offset+4*ref.
key()+0);
546 using namespace trigger;
549 LogVerbatim(
"TriggerSummaryProducerAOD") <<
"TriggerSummaryProducerAOD::endJob - accumulated tags:" << endl;
553 LogVerbatim(
"TriggerSummaryProducerAOD") <<
" Overall number of Collections/Filters: "
554 << nc <<
"/" << nf << endl;
556 LogVerbatim(
"TriggerSummaryProducerAOD") <<
" The collections: " << nc << endl;
559 for ( InputTagSet::const_iterator ci=cb; ci!=ce; ++ci) {
560 LogVerbatim(
"TriggerSummaryProducerAOD") <<
" " << distance(cb,ci) <<
" " << ci->encode() << endl;
563 LogVerbatim(
"TriggerSummaryProducerAOD") <<
" The filters:" << nf << endl;
566 for ( InputTagSet::const_iterator fi=
fb; fi!=fe; ++fi) {
567 LogVerbatim(
"TriggerSummaryProducerAOD") <<
" " << distance(
fb,fi) <<
" " << fi->encode() << endl;
570 LogVerbatim(
"TriggerSummaryProducerAOD") <<
"TriggerSummaryProducerAOD::endJob." << endl;
void callWhenNewProductsRegistered(std::function< void(BranchDescription const &)> const &func)
edm::GetterOfProducts< l1extra::L1JetParticleCollection > getL1JetParticleCollection_
edm::GetterOfProducts< reco::IsolatedPixelTrackCandidateCollection > getIsolatedPixelTrackCandidateCollection_
virtual void produce(edm::Event &, const edm::EventSetup &)
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_
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_
TriggerSummaryProducerAOD(const edm::ParameterSet &)
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
unsigned int offset(bool)
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 > > &)
key_type key() const
Accessor for product key.
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
InputTagSet collectionTagsGlobal_
void fillTriggerObjectCollections(const edm::Event &, edm::GetterOfProducts< C > &)
InputTagSet filterTagsEvent_
list of L3 filter tags
std::string const & productInstanceName() const
Provenance getProvenance(BranchID const &theID) const
tuple size
Write out results.
edm::GetterOfProducts< l1extra::L1EmParticleCollection > getL1EmParticleCollection_
InputTagSet filterTagsGlobal_