CMS 3D CMS Logo

PATTriggerObjectStandAloneUnpacker.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: PatAlgos
4 // Class: pat::PATTriggerObjectStandAloneUnpacker
5 //
6 //
21 
24 
25 namespace pat {
26 
28  public:
31 
32  private:
33  void produce(edm::StreamID, edm::Event& iEvent, const edm::EventSetup& iSetup) const override;
34 
39  };
40 
41 } // namespace pat
42 
43 using namespace pat;
44 
46  : patTriggerObjectsStandAloneToken_(consumes<TriggerObjectStandAloneCollection>(
47  iConfig.getParameter<edm::InputTag>("patTriggerObjectsStandAlone"))),
48  triggerResultsToken_(consumes<edm::TriggerResults>(iConfig.getParameter<edm::InputTag>("triggerResults"))),
49  unpackFilterLabels_(iConfig.getParameter<bool>("unpackFilterLabels")) {
50  produces<TriggerObjectStandAloneCollection>();
51 }
52 
55  const edm::EventSetup& iSetup) const {
60 
61  auto patTriggerObjectsStandAloneUnpacked = std::make_unique<TriggerObjectStandAloneCollection>();
62 
63  for (size_t iTrigObj = 0; iTrigObj < patTriggerObjectsStandAlone->size(); ++iTrigObj) {
64  TriggerObjectStandAlone patTriggerObjectStandAloneUnpacked(patTriggerObjectsStandAlone->at(iTrigObj));
65  const edm::TriggerNames& names = iEvent.triggerNames(*triggerResults);
66  patTriggerObjectStandAloneUnpacked.unpackPathNames(names);
68  patTriggerObjectStandAloneUnpacked.unpackFilterLabels(iEvent, *triggerResults);
69  patTriggerObjectsStandAloneUnpacked->push_back(patTriggerObjectStandAloneUnpacked);
70  }
71 
72  iEvent.put(std::move(patTriggerObjectsStandAloneUnpacked));
73 }
74 
std::vector< TriggerObjectStandAlone > TriggerObjectStandAloneCollection
Collection of TriggerObjectStandAlone.
const std::string names[nVars_]
Definition: HeavyIon.h:7
int iEvent
Definition: GenABIO.cc:224
void produce(edm::StreamID, edm::Event &iEvent, const edm::EventSetup &iSetup) const override
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
static std::string const triggerResults
Definition: EdmProvDump.cc:47
PATTriggerObjectStandAloneUnpacker(const edm::ParameterSet &iConfig)
const edm::EDGetTokenT< edm::TriggerResults > triggerResultsToken_
Unpacks a pat::TriggerObjectStandAloneCollection with packed path names.
const edm::EDGetTokenT< TriggerObjectStandAloneCollection > patTriggerObjectsStandAloneToken_
HLT enums.
def move(src, dest)
Definition: eostools.py:511
Analysis-level trigger object class (stand-alone)
const edm::EDGetTokenT< std::vector< std::string > > filterLabelsToken_