CMS 3D CMS Logo

EcalCompactTrigPrimProducer.cc
Go to the documentation of this file.
1 
14 
16 public:
19  void produce(edm::Event& evt, const edm::EventSetup& es) override;
20 
21 private:
23 
24  /*
25  * output collections
26  */
28 };
29 
32 
34  : outCollection_(ps.getParameter<std::string>("outColl")) {
35  inCollectionToken_ = consumes<EcalTrigPrimDigiCollection>((ps.getParameter<edm::InputTag>("inColl")));
36  produces<EcalTrigPrimCompactColl>(outCollection_);
37 }
38 
40  auto outColl = std::make_unique<EcalTrigPrimCompactColl>();
42  event.getByToken(inCollectionToken_, hTPDigis);
43 
44  const EcalTrigPrimDigiCollection* trigPrims = hTPDigis.product();
45 
46  for (EcalTrigPrimDigiCollection::const_iterator trigPrim = trigPrims->begin(); trigPrim != trigPrims->end();
47  ++trigPrim) {
48  outColl->setValue(
49  trigPrim->id().ieta(), trigPrim->id().iphi(), trigPrim->sample(trigPrim->sampleOfInterest()).raw());
50  }
51  event.put(std::move(outColl), outCollection_);
52 }
void produce(edm::Event &evt, const edm::EventSetup &es) override
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::EDGetTokenT< EcalTrigPrimDigiCollection > inCollectionToken_
std::vector< T >::const_iterator const_iterator
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
const_iterator begin() const
const_iterator end() const
def move(src, dest)
Definition: eostools.py:511
Definition: event.py:1
EcalCompactTrigPrimProducer(const edm::ParameterSet &ps)