61 pn_(ps.getParameter<std::string>(
"processName")),
62 selector_(edm::ProcessNameSelector(pn_)),
64 filterTagsEvent_(pn_!=
"*"),
65 filterTagsGlobal_(pn_!=
"*"),
66 collectionTagsEvent_(pn_!=
"*"),
67 collectionTagsGlobal_(pn_!=
"*"),
84 edm::LogError(
"TriggerSummaryProducerAOD") <<
"HLT Error: TriggerNamesService pointer = 0!";
88 edm::LogError(
"TriggerSummaryProducerAOD") <<
"HLT Error: TriggerNamesService not available!";
97 LogDebug(
"TriggerSummaryProducerAOD") <<
"Using process name: '" <<
pn_ <<
"'";
102 produces<trigger::TriggerEvent>();
120 const char token(
':');
125 if (i1==string::npos) {
129 instance=label.substr(i1+1);
132 if (i2==string::npos) {
135 process=instance.substr(i2+1);
148 using namespace reco;
149 using namespace l1extra;
150 using namespace trigger;
156 const unsigned int nfob(
fobs_.size());
157 LogTrace(
"TriggerSummaryProducerAOD") <<
"Number of filter objects found: " << nfob;
159 string tagLabel,tagInstance,tagProcess;
171 for (
unsigned int ifob=0; ifob!=nfob; ++ifob) {
173 const vector<string>& collectionTags_(
fobs_[ifob]->getCollectionTagsAsStrings());
174 const unsigned int ncol(collectionTags_.size());
178 const string&
label (
fobs_[ifob].provenance()->moduleLabel());
179 const string&
instance (
fobs_[ifob].provenance()->productInstanceName());
180 const string&
process (
fobs_[ifob].provenance()->processName());
182 for (
unsigned int icol=0; icol!=ncol; ++icol) {
184 tokenizeTag(collectionTags_[icol],tagLabel,tagInstance,tagProcess);
191 LogError(
"TriggerSummaryProducerAOD")
192 <<
"Mismatch in number of filter tags: "
205 LogTrace(
"TriggerSummaryProducerAOD") <<
"Number of unique collections requested " << nc;
208 for ( InputTagSet::const_iterator ci=cb; ci!=ce; ++ci) {
209 LogTrace(
"TriggerSummaryProducerAOD") << distance(cb,ci) <<
" " << ci->encode();
212 LogTrace(
"TriggerSummaryProducerAOD") <<
"Number of unique filters requested " << nf;
215 for ( InputTagSet::const_iterator fi=
fb; fi!=fe; ++fi) {
216 LogTrace(
"TriggerSummaryProducerAOD") << distance(
fb,fi) <<
" " << fi->encode();
230 fillTriggerObjectCollections< RecoEcalCandidateCollection>(
iEvent);
231 fillTriggerObjectCollections< ElectronCollection>(
iEvent);
232 fillTriggerObjectCollections< RecoChargedCandidateCollection>(
iEvent);
233 fillTriggerObjectCollections< CaloJetCollection>(
iEvent);
234 fillTriggerObjectCollections< CompositeCandidateCollection>(
iEvent);
235 fillTriggerObjectCollections< METCollection>(
iEvent);
236 fillTriggerObjectCollections< CaloMETCollection>(
iEvent);
237 fillTriggerObjectCollections<IsolatedPixelTrackCandidateCollection>(
iEvent);
239 fillTriggerObjectCollections< L1EmParticleCollection>(
iEvent);
240 fillTriggerObjectCollections< L1MuonParticleCollection>(
iEvent);
241 fillTriggerObjectCollections< L1JetParticleCollection>(
iEvent);
242 fillTriggerObjectCollections< L1EtMissParticleCollection>(
iEvent);
243 fillTriggerObjectCollections< L1HFRingsCollection>(
iEvent);
245 fillTriggerObjectCollections< PFJetCollection>(
iEvent);
246 fillTriggerObjectCollections< PFTauCollection>(
iEvent);
248 const unsigned int nk(
tags_.size());
249 LogDebug(
"TriggerSummaryProducerAOD") <<
"Number of collections found: " << nk;
250 const unsigned int no(
toc_.size());
251 LogDebug(
"TriggerSummaryProducerAOD") <<
"Number of physics objects found: " << no;
259 product->addObjects(
toc_);
262 for (
unsigned int ifob=0; ifob!=nfob; ++ifob) {
264 const string&
label (
fobs_[ifob].provenance()->moduleLabel());
265 const string&
instance (
fobs_[ifob].provenance()->productInstanceName());
266 const string&
process (
fobs_[ifob].provenance()->processName());
285 product->addFilter(filterTag,
ids_,
keys_);
290 LogTrace(
"TriggerSummaryProducerAOD") <<
"Number of physics objects packed: " << ref->sizeObjects();
291 LogTrace(
"TriggerSummaryProducerAOD") <<
"Number of filter objects packed: " << ref->sizeFilters();
295 template <
typename C>
304 using namespace reco;
305 using namespace l1extra;
306 using namespace trigger;
308 vector<Handle<C> > collections;
310 const unsigned int nc(collections.size());
312 for (
unsigned int ic=0; ic!=nc; ++ic) {
313 const Provenance& provenance(*(collections[ic].provenance()));
317 const InputTag collectionTag(label,instance,process);
320 const ProductID pid(collections[ic].provenance()->productID());
322 LogError(
"TriggerSummaryProducerAOD") <<
"Duplicate pid!";
325 const unsigned int n(collections[ic]->
size());
326 for (
unsigned int i=0;
i!=
n; ++
i) {
329 tags_.push_back(collectionTag.encode());
336 template <
typename T>
339 using namespace trigger;
347 using namespace l1extra;
348 using namespace trigger;
351 object.hfEtSum(L1HFRings::kRing1PosEta),
352 object.hfEtSum(L1HFRings::kRing1NegEta),
353 object.hfEtSum(L1HFRings::kRing2PosEta),
354 object.hfEtSum(L1HFRings::kRing2NegEta) ) );
356 object.hfBitCount(L1HFRings::kRing1PosEta),
357 object.hfBitCount(L1HFRings::kRing1NegEta),
358 object.hfBitCount(L1HFRings::kRing2PosEta),
359 object.hfBitCount(L1HFRings::kRing2NegEta) ) );
366 using namespace l1extra;
367 using namespace trigger;
370 if (
object.
type()==L1EtMissParticle::kMET) {
372 }
else if (
object.
type()==L1EtMissParticle::kMHT) {
383 using namespace reco;
384 using namespace trigger;
396 using namespace reco;
397 using namespace trigger;
407 template <
typename C>
416 using namespace reco;
417 using namespace l1extra;
418 using namespace trigger;
420 if (ids.size()!=refs.size()) {
421 LogError(
"TriggerSummaryProducerAOD") <<
"Vector length is different: "
422 << ids.size() <<
" " << refs.size();
425 const unsigned int n(
min(ids.size(),refs.size()));
426 for (
unsigned int i=0;
i!=
n; ++
i) {
432 LogError(
"TriggerSummaryProducerAOD")
434 <<
" FilterTag/Key: " << tag.
encode()
436 <<
" CollectionTag/Key: "
438 <<
"/" << refs[
i].key()
439 <<
" CollectionType: " <<
typeid(
C).
name();
448 template <
typename C>
459 using namespace trigger;
462 keys_.push_back(offset+2*ref.
key()+1);
464 keys_.push_back(offset+2*ref.
key()+0);
473 using namespace trigger;
476 keys_.push_back(offset+2*ref.
key()+1);
478 keys_.push_back(offset+2*ref.
key()+0);
487 using namespace trigger;
490 keys_.push_back(offset+4*ref.
key()+1);
492 keys_.push_back(offset+4*ref.
key()+2);
494 keys_.push_back(offset+4*ref.
key()+3);
496 keys_.push_back(offset+4*ref.
key()+0);
505 using namespace trigger;
508 keys_.push_back(offset+4*ref.
key()+1);
510 keys_.push_back(offset+4*ref.
key()+2);
512 keys_.push_back(offset+4*ref.
key()+3);
514 keys_.push_back(offset+4*ref.
key()+0);
525 using namespace trigger;
528 LogVerbatim(
"TriggerSummaryProducerAOD") <<
"TriggerSummaryProducerAOD::endJob - accumulated tags:" << endl;
532 LogVerbatim(
"TriggerSummaryProducerAOD") <<
" Overall number of Collections/Filters: "
533 << nc <<
"/" << nf << endl;
535 LogVerbatim(
"TriggerSummaryProducerAOD") <<
" The collections: " << nc << endl;
538 for ( InputTagSet::const_iterator ci=cb; ci!=ce; ++ci) {
539 LogVerbatim(
"TriggerSummaryProducerAOD") <<
" " << distance(cb,ci) <<
" " << ci->encode() << endl;
542 LogVerbatim(
"TriggerSummaryProducerAOD") <<
" The filters:" << nf << endl;
545 for ( InputTagSet::const_iterator fi=
fb; fi!=fe; ++fi) {
546 LogVerbatim(
"TriggerSummaryProducerAOD") <<
" " << distance(
fb,fi) <<
" " << fi->encode() << endl;
549 LogVerbatim(
"TriggerSummaryProducerAOD") <<
"TriggerSummaryProducerAOD::endJob." << endl;
virtual void produce(edm::Event &, const edm::EventSetup &)
std::string const & getProcessName() const
The single EDProduct to be saved for each event (AOD case)
trigger::TriggerObjectCollection toc_
trigger object collection
~TriggerSummaryProducerAOD()
static PFTauRenderPlugin instance
std::vector< bool > maskFilters_
packing decision
std::set< edm::InputTag, OrderInputTag > InputTagSet
edm::ProcessNameSelector selector_
selector for getMany methods
void fillFilterObjectMember(const int &, const int &, const edm::Ref< C > &)
edm::service::TriggerNamesService * tns_
the pointer to the current TriggerNamesService
void fillTriggerObjectCollections(const edm::Event &)
std::vector< std::string > tags_
std::string const & processName() const
Single trigger physics object (e.g., an isolated muon)
TriggerSummaryProducerAOD(const edm::ParameterSet &)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
void getMany(SelectorBase const &sel, std::vector< Handle< PROD > > &results) const
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 > > &)
std::vector< edm::Handle< trigger::TriggerFilterObjectWithRefs > > fobs_
handles to the filter objects
key_type key() const
Accessor for product key.
std::string const & moduleLabel() const
InputTagSet collectionTagsEvent_
list of L3 collection tags
std::string pn_
process name
InputTagSet collectionTagsGlobal_
InputTagSet filterTagsEvent_
list of L3 filter tags
std::string const & productInstanceName() const
Provenance getProvenance(BranchID const &theID) const
tuple size
Write out results.
InputTagSet filterTagsGlobal_