@@ -23,73 +23,73 @@ class EcalRecHitSoAToLegacy : public edm::global::EDProducer<> {
2323
2424private:
2525 const bool isPhase2_;
26- const edm::EDGetTokenT<InputProduct> recHitsPortableEB_ ;
27- const edm::EDGetTokenT<InputProduct> recHitsPortableEE_ ;
28- const edm::EDPutTokenT<EBRecHitCollection> recHitsCPUEBToken_ ;
29- const edm::EDPutTokenT<EERecHitCollection> recHitsCPUEEToken_ ;
26+ const edm::EDGetTokenT<InputProduct> inputTokenEB_ ;
27+ const edm::EDGetTokenT<InputProduct> inputTokenEE_ ;
28+ const edm::EDPutTokenT<EBRecHitCollection> outputTokenEB_ ;
29+ const edm::EDPutTokenT<EERecHitCollection> outputTokenEE_ ;
3030};
3131
3232void EcalRecHitSoAToLegacy::fillDescriptions (edm::ConfigurationDescriptions &confDesc) {
3333 edm::ParameterSetDescription desc;
3434
35- desc.add <edm::InputTag>(" recHitsPortableEB " , edm::InputTag (" ecalRecHitPortable" , " EcalRecHitsEB" ));
36- desc.add <std::string>(" recHitsLabelCPUEB " , " EcalRecHitsEB" );
35+ desc.add <edm::InputTag>(" inputCollectionEB " , edm::InputTag (" ecalRecHitPortable" , " EcalRecHitsEB" ));
36+ desc.add <std::string>(" outputLabelEB " , " EcalRecHitsEB" );
3737 desc.ifValue (edm::ParameterDescription<bool >(" isPhase2" , false , true ),
3838 false >> (edm::ParameterDescription<edm::InputTag>(
39- " recHitsPortableEE " , edm::InputTag (" ecalRecHitPortable" , " EcalRecHitsEE" ), true ) and
40- edm::ParameterDescription<std::string>(" recHitsLabelCPUEE " , " EcalRecHitsEE" , true )) or
39+ " inputCollectionEE " , edm::InputTag (" ecalRecHitPortable" , " EcalRecHitsEE" ), true ) and
40+ edm::ParameterDescription<std::string>(" outputLabelEE " , " EcalRecHitsEE" , true )) or
4141 true >> edm::EmptyGroupDescription ());
4242 confDesc.add (" ecalRecHitSoAToLegacy" , desc);
4343}
4444
4545EcalRecHitSoAToLegacy::EcalRecHitSoAToLegacy (edm::ParameterSet const &ps)
4646 : isPhase2_{ps.getParameter <bool >(" isPhase2" )},
47- recHitsPortableEB_ {consumes<InputProduct>(ps.getParameter <edm::InputTag>(" recHitsPortableEB " ))},
48- recHitsPortableEE_ {isPhase2_ ? edm::EDGetTokenT<InputProduct>{}
49- : consumes<InputProduct>(ps.getParameter <edm::InputTag>(" recHitsPortableEE " ))},
50- recHitsCPUEBToken_ {produces<EBRecHitCollection>(ps.getParameter <std::string>(" recHitsLabelCPUEB " ))},
51- recHitsCPUEEToken_ {isPhase2_ ? edm::EDPutTokenT<EERecHitCollection>{}
52- : produces<EERecHitCollection>(ps.getParameter <std::string>(" recHitsLabelCPUEE " ))} {}
47+ inputTokenEB_ {consumes<InputProduct>(ps.getParameter <edm::InputTag>(" inputCollectionEB " ))},
48+ inputTokenEE_ {isPhase2_ ? edm::EDGetTokenT<InputProduct>{}
49+ : consumes<InputProduct>(ps.getParameter <edm::InputTag>(" inputCollectionEE " ))},
50+ outputTokenEB_ {produces<EBRecHitCollection>(ps.getParameter <std::string>(" outputLabelEB " ))},
51+ outputTokenEE_ {isPhase2_ ? edm::EDPutTokenT<EERecHitCollection>{}
52+ : produces<EERecHitCollection>(ps.getParameter <std::string>(" outputLabelEE " ))} {}
5353
5454void EcalRecHitSoAToLegacy::produce (edm::StreamID sid, edm::Event &event, edm::EventSetup const &setup) const {
55- auto const &recHitsEBColl = event.get (recHitsPortableEB_ );
56- auto const &recHitsEBCollView = recHitsEBColl .const_view ();
57- auto recHitsCPUEB = std::make_unique<EBRecHitCollection>();
58- recHitsCPUEB ->reserve (recHitsEBCollView .size ());
55+ auto const &inputCollEB = event.get (inputTokenEB_ );
56+ auto const &inputCollEBView = inputCollEB .const_view ();
57+ auto outputCollEB = std::make_unique<EBRecHitCollection>();
58+ outputCollEB ->reserve (inputCollEBView .size ());
5959
60- for (uint32_t i = 0 ; i < recHitsEBCollView .size (); ++i) {
60+ for (uint32_t i = 0 ; i < inputCollEBView .size (); ++i) {
6161 // Save only if energy is >= 0 !
6262 // This is important because the channels that were supposed
6363 // to be excluded get "-1" as energy
64- if (recHitsEBCollView .energy ()[i] >= 0 .) {
65- recHitsCPUEB ->emplace_back (DetId{recHitsEBCollView .id ()[i]},
66- recHitsEBCollView .energy ()[i],
67- recHitsEBCollView .time ()[i],
68- recHitsEBCollView .extra ()[i],
69- recHitsEBCollView .flagBits ()[i]);
64+ if (inputCollEBView .energy ()[i] >= 0 .) {
65+ outputCollEB ->emplace_back (DetId{inputCollEBView .id ()[i]},
66+ inputCollEBView .energy ()[i],
67+ inputCollEBView .time ()[i],
68+ inputCollEBView .extra ()[i],
69+ inputCollEBView .flagBits ()[i]);
7070 }
7171 }
72- event.put (recHitsCPUEBToken_ , std::move (recHitsCPUEB ));
72+ event.put (outputTokenEB_ , std::move (outputCollEB ));
7373
7474 if (!isPhase2_) {
75- auto const &recHitsEEColl = event.get (recHitsPortableEE_ );
76- auto const &recHitsEECollView = recHitsEEColl .const_view ();
77- auto recHitsCPUEE = std::make_unique<EERecHitCollection>();
78- recHitsCPUEE ->reserve (recHitsEECollView .size ());
75+ auto const &inputCollEE = event.get (inputTokenEE_ );
76+ auto const &inputCollEEView = inputCollEE .const_view ();
77+ auto outputCollEE = std::make_unique<EERecHitCollection>();
78+ outputCollEE ->reserve (inputCollEEView .size ());
7979
80- for (uint32_t i = 0 ; i < recHitsEECollView .size (); ++i) {
80+ for (uint32_t i = 0 ; i < inputCollEEView .size (); ++i) {
8181 // Save only if energy is >= 0 !
8282 // This is important because the channels that were supposed
8383 // to be excluded get "-1" as energy
84- if (recHitsEECollView .energy ()[i] >= 0 .) {
85- recHitsCPUEE ->emplace_back (DetId{recHitsEECollView .id ()[i]},
86- recHitsEECollView .energy ()[i],
87- recHitsEECollView .time ()[i],
88- recHitsEECollView .extra ()[i],
89- recHitsEECollView .flagBits ()[i]);
84+ if (inputCollEEView .energy ()[i] >= 0 .) {
85+ outputCollEE ->emplace_back (DetId{inputCollEEView .id ()[i]},
86+ inputCollEEView .energy ()[i],
87+ inputCollEEView .time ()[i],
88+ inputCollEEView .extra ()[i],
89+ inputCollEEView .flagBits ()[i]);
9090 }
9191 }
92- event.put (recHitsCPUEEToken_ , std::move (recHitsCPUEE ));
92+ event.put (outputTokenEE_ , std::move (outputCollEE ));
9393 }
9494}
9595
0 commit comments