53 pn_(ps.getParameter<std::
string>(
"processName")),
54 filterTagsEvent_(pn_!=
"*"),
55 filterTagsGlobal_(pn_!=
"*"),
56 collectionTagsEvent_(pn_!=
"*"),
57 collectionTagsGlobal_(pn_!=
"*"),
70 edm::LogError(
"TriggerSummaryProducerAOD") <<
"HLT Error: TriggerNamesService not available!";
79 LogDebug(
"TriggerSummaryProducerAOD") <<
"Using process name: '" <<
pn_ <<
"'";
84 produces<trigger::TriggerEvent>();
137 const char token(
':');
142 if (i1==string::npos) {
146 instance=label.substr(i1+1);
149 if (i2==string::npos) {
152 process=instance.substr(i2+1);
165 using namespace reco;
166 using namespace l1extra;
167 using namespace trigger;
169 std::vector<edm::Handle<trigger::TriggerFilterObjectWithRefs> > fobs;
172 const unsigned int nfob(fobs.size());
173 LogTrace(
"TriggerSummaryProducerAOD") <<
"Number of filter objects found: " << nfob;
175 string tagLabel,tagInstance,tagProcess;
187 for (
unsigned int ifob=0; ifob!=nfob; ++ifob) {
189 const vector<string>& collectionTags_(fobs[ifob]->getCollectionTagsAsStrings());
190 const unsigned int ncol(collectionTags_.size());
194 const string&
label (fobs[ifob].provenance()->moduleLabel());
195 const string&
instance (fobs[ifob].provenance()->productInstanceName());
196 const string&
process (fobs[ifob].provenance()->processName());
198 for (
unsigned int icol=0; icol!=ncol; ++icol) {
200 tokenizeTag(collectionTags_[icol],tagLabel,tagInstance,tagProcess);
207 LogError(
"TriggerSummaryProducerAOD")
208 <<
"Mismatch in number of filter tags: "
221 LogTrace(
"TriggerSummaryProducerAOD") <<
"Number of unique collections requested " << nc;
224 for ( InputTagSet::const_iterator ci=cb; ci!=ce; ++ci) {
225 LogTrace(
"TriggerSummaryProducerAOD") << distance(cb,ci) <<
" " << ci->encode();
228 LogTrace(
"TriggerSummaryProducerAOD") <<
"Number of unique filters requested " << nf;
231 for ( InputTagSet::const_iterator fi=
fb; fi!=fe; ++fi) {
232 LogTrace(
"TriggerSummaryProducerAOD") << distance(
fb,fi) <<
" " << fi->encode();
264 const unsigned int nk(
tags_.size());
265 LogDebug(
"TriggerSummaryProducerAOD") <<
"Number of collections found: " << nk;
266 const unsigned int no(
toc_.size());
267 LogDebug(
"TriggerSummaryProducerAOD") <<
"Number of physics objects found: " << no;
275 product->addObjects(
toc_);
278 for (
unsigned int ifob=0; ifob!=nfob; ++ifob) {
280 const string&
label (fobs[ifob].provenance()->moduleLabel());
281 const string&
instance (fobs[ifob].provenance()->productInstanceName());
282 const string&
process (fobs[ifob].provenance()->processName());
301 product->addFilter(filterTag,
ids_,
keys_);
306 LogTrace(
"TriggerSummaryProducerAOD") <<
"Number of physics objects packed: " << ref->sizeObjects();
307 LogTrace(
"TriggerSummaryProducerAOD") <<
"Number of filter objects packed: " << ref->sizeFilters();
311 template <
typename C>
320 using namespace reco;
321 using namespace l1extra;
322 using namespace trigger;
324 vector<Handle<C> > collections;
326 const unsigned int nc(collections.size());
328 for (
unsigned int ic=0; ic!=nc; ++ic) {
329 const Provenance& provenance(*(collections[ic].provenance()));
333 const InputTag collectionTag(label,instance,process);
336 const ProductID pid(collections[ic].provenance()->productID());
338 LogError(
"TriggerSummaryProducerAOD") <<
"Duplicate pid!";
341 const unsigned int n(collections[ic]->
size());
342 for (
unsigned int i=0;
i!=
n; ++
i) {
345 tags_.push_back(collectionTag.encode());
352 template <
typename T>
355 using namespace trigger;
363 using namespace l1extra;
364 using namespace trigger;
367 object.hfEtSum(L1HFRings::kRing1PosEta),
368 object.hfEtSum(L1HFRings::kRing1NegEta),
369 object.hfEtSum(L1HFRings::kRing2PosEta),
370 object.hfEtSum(L1HFRings::kRing2NegEta) ) );
372 object.hfBitCount(L1HFRings::kRing1PosEta),
373 object.hfBitCount(L1HFRings::kRing1NegEta),
374 object.hfBitCount(L1HFRings::kRing2PosEta),
375 object.hfBitCount(L1HFRings::kRing2NegEta) ) );
382 using namespace l1extra;
383 using namespace trigger;
386 if (
object.
type()==L1EtMissParticle::kMET) {
388 }
else if (
object.
type()==L1EtMissParticle::kMHT) {
399 using namespace reco;
400 using namespace trigger;
412 using namespace reco;
413 using namespace trigger;
423 template <
typename C>
432 using namespace reco;
433 using namespace l1extra;
434 using namespace trigger;
436 if (ids.size()!=refs.size()) {
437 LogError(
"TriggerSummaryProducerAOD") <<
"Vector length is different: "
438 << ids.size() <<
" " << refs.size();
441 const unsigned int n(
min(ids.size(),refs.size()));
442 for (
unsigned int i=0;
i!=
n; ++
i) {
448 LogError(
"TriggerSummaryProducerAOD")
450 <<
" FilterTag/Key: " << tag.
encode()
452 <<
" CollectionTag/Key: "
454 <<
"/" << refs[
i].key()
455 <<
" CollectionType: " <<
typeid(
C).
name();
464 template <
typename C>
475 using namespace trigger;
478 keys_.push_back(offset+2*ref.
key()+1);
480 keys_.push_back(offset+2*ref.
key()+0);
489 using namespace trigger;
492 keys_.push_back(offset+2*ref.
key()+1);
494 keys_.push_back(offset+2*ref.
key()+0);
503 using namespace trigger;
506 keys_.push_back(offset+4*ref.
key()+1);
508 keys_.push_back(offset+4*ref.
key()+2);
510 keys_.push_back(offset+4*ref.
key()+3);
512 keys_.push_back(offset+4*ref.
key()+0);
521 using namespace trigger;
524 keys_.push_back(offset+4*ref.
key()+1);
526 keys_.push_back(offset+4*ref.
key()+2);
528 keys_.push_back(offset+4*ref.
key()+3);
530 keys_.push_back(offset+4*ref.
key()+0);
541 using namespace trigger;
544 LogVerbatim(
"TriggerSummaryProducerAOD") <<
"TriggerSummaryProducerAOD::endJob - accumulated tags:" << endl;
548 LogVerbatim(
"TriggerSummaryProducerAOD") <<
" Overall number of Collections/Filters: "
549 << nc <<
"/" << nf << endl;
551 LogVerbatim(
"TriggerSummaryProducerAOD") <<
" The collections: " << nc << endl;
554 for ( InputTagSet::const_iterator ci=cb; ci!=ce; ++ci) {
555 LogVerbatim(
"TriggerSummaryProducerAOD") <<
" " << distance(cb,ci) <<
" " << ci->encode() << endl;
558 LogVerbatim(
"TriggerSummaryProducerAOD") <<
" The filters:" << nf << endl;
561 for ( InputTagSet::const_iterator fi=
fb; fi!=fe; ++fi) {
562 LogVerbatim(
"TriggerSummaryProducerAOD") <<
" " << distance(
fb,fi) <<
" " << fi->encode() << endl;
565 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
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)
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.
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_