@@ -51,7 +51,7 @@ class PreMixingSiPixelWorker : public PreMixingWorker {
5151 edm::InputTag pixeldigi_collectionSig_; // secondary name given to collection of SiPixel digis
5252 edm::InputTag pixeldigi_collectionPile_; // secondary name given to collection of SiPixel digis
5353 edm::InputTag pixeldigi_extraInfo_; // secondary name given to collection of SiPixel digis
54- edm::InputTag pixeldigi_extraInfoLite_; // secondary name given to collection of SiPixel digis
54+ edm::InputTag pixeldigi_extraInfoLite_; // secondary name given to collection of SiPixel digis
5555 std::string PixelDigiCollectionDM_; // secondary name to be given to new SiPixel digis
5656
5757 edm::EDGetTokenT<edm::DetSetVector<PixelDigi>> PixelDigiToken_; // Token to retrieve information
@@ -80,7 +80,7 @@ class PreMixingSiPixelWorker : public PreMixingWorker {
8080
8181 SiGlobalIndex SiHitStorage_;
8282 SiPixelExtraInfo SiHitExtraStorage_;
83- SiPixelExtraInfoLite SiHitExtraLiteStorage_; // Lite version
83+ SiPixelExtraInfoLite SiHitExtraLiteStorage_; // Lite version
8484
8585 bool firstInitializeEvent_ = true ;
8686 bool firstFinalizeEvent_ = true ;
@@ -106,14 +106,15 @@ PreMixingSiPixelWorker::PreMixingSiPixelWorker(const edm::ParameterSet& ps,
106106 usePixelExtraLiteFormat_ = ps.getParameter <bool >(" usePixelExtraLiteFormat" );
107107 LogDebug (" PreMixingSiPixelWorker" ) << " applyLateReweighting_ in PreMixingSiPixelWorker " << applyLateReweighting_;
108108
109-
110- LogDebug (" PreMixingSiPixelWorker" ) << " applyLateReweighting_ in PreMixingSiPixelWorker " << applyLateReweighting_ ;
111- LogDebug ( " PreMixingSiPixelWorker " ) << " usePixelExtraLiteFormat_ in PreMixingSiPixelWorker " << usePixelExtraLiteFormat_ ;
109+ LogDebug ( " PreMixingSiPixelWorker " ) << " applyLateReweighting_ in PreMixingSiPixelWorker " << applyLateReweighting_;
110+ LogDebug (" PreMixingSiPixelWorker" ) << " usePixelExtraLiteFormat_ in PreMixingSiPixelWorker "
111+ << usePixelExtraLiteFormat_;
112112
113113 PixelDigiToken_ = iC.consumes <edm::DetSetVector<PixelDigi>>(pixeldigi_collectionSig_);
114114 PixelDigiPToken_ = iC.consumes <edm::DetSetVector<PixelDigi>>(pixeldigi_collectionPile_);
115115 PixelDigiPExtraToken_ = iC.consumes <edm::DetSetVector<PixelSimHitExtraInfo>>(pixeldigi_extraInfo_);
116- PixelDigiPExtraLiteToken_ = iC.consumes <edm::DetSetVector<PixelSimHitExtraInfoLite>>(pixeldigi_extraInfoLite_); // Lite version
116+ PixelDigiPExtraLiteToken_ =
117+ iC.consumes <edm::DetSetVector<PixelSimHitExtraInfoLite>>(pixeldigi_extraInfoLite_); // Lite version
117118
118119 producesCollector.produces <edm::DetSetVector<PixelDigi>>(PixelDigiCollectionDM_);
119120 producesCollector.produces <PixelFEDChannelCollection>(PixelDigiCollectionDM_);
@@ -177,8 +178,8 @@ void PreMixingSiPixelWorker::addPileups(PileUpEventPrincipal const& pep, edm::Ev
177178 // added for the Late CR
178179 edm::Handle<edm::DetSetVector<PixelSimHitExtraInfo>> pixelAddInfo;
179180 pep.getByLabel (pixeldigi_extraInfo_, pixelAddInfo);
180- edm::Handle<edm::DetSetVector<PixelSimHitExtraInfoLite>> pixelAddInfoLite; // Lite version
181- pep.getByLabel (pixeldigi_extraInfoLite_, pixelAddInfoLite); // Lite version
181+ edm::Handle<edm::DetSetVector<PixelSimHitExtraInfoLite>> pixelAddInfoLite; // Lite version
182+ pep.getByLabel (pixeldigi_extraInfoLite_, pixelAddInfoLite); // Lite version
182183 const TrackerTopology* tTopo = &es.getData (tTopoToken_);
183184 auto const & pDD = es.getData (pDDToken_);
184185 edm::Service<edm::RandomNumberGenerator> rng;
@@ -190,51 +191,51 @@ void PreMixingSiPixelWorker::addPileups(PileUpEventPrincipal const& pep, edm::Ev
190191 bool loadExtraInformation = false ;
191192
192193 if (!usePixelExtraLiteFormat_) {
193- if (pixelAddInfo.isValid () && applyLateReweighting_) {
194- // access the extra information
195- loadExtraInformation = true ;
196- // Iterate on detector units
197- edm::DetSetVector<PixelSimHitExtraInfo>::const_iterator detIdIter;
198- for (detIdIter = pixelAddInfo->begin (); detIdIter != pixelAddInfo->end (); detIdIter++) {
199- uint32_t detid = detIdIter->id ; // = rawid
200- OneExtraInfoMap LocalExtraMap;
201- edm::DetSet<PixelSimHitExtraInfo>::const_iterator di;
202- for (di = detIdIter->data .begin (); di != detIdIter->data .end (); di++) {
203- LocalExtraMap.insert (OneExtraInfoMap::value_type ((di->hitIndex ()), *di));
204- }
205- SiHitExtraStorage_.insert (SiPixelExtraInfo::value_type (detid, LocalExtraMap));
206- } // end loop on detIdIter
207- } // end if applyLateReweighting_
208- else if (!pixelAddInfo.isValid () && applyLateReweighting_) {
209- edm::LogError (" PreMixingSiPixelWorker" ) << " Problem in accessing the Extra Pixel SimHit Collection !!!! " ;
210- edm::LogError (" PreMixingSiPixelWorker" ) << " The Late Charge Reweighting can not be applied " ;
211- throw cms::Exception (" PreMixingSiPixelWorker" )
212- << " Problem in accessing the Extra Pixel SimHit Collection for Late Charge Reweighting \n " ;
213- }
214- }
215- else { // Lite version
216- if (pixelAddInfoLite. isValid () && applyLateReweighting_) {
217- // access the extra information
218- loadExtraInformation = true ;
219- // Iterate on detector units
220- edm::DetSetVector<PixelSimHitExtraInfoLite>::const_iterator detIdIter;
221- for (detIdIter = pixelAddInfoLite-> begin (); detIdIter != pixelAddInfoLite-> end (); detIdIter++) {
222- uint32_t detid = detIdIter-> id ; // = rawid
223- OneExtraInfoLiteMap LocalExtraMap ;
224- edm::DetSet<PixelSimHitExtraInfoLite>::const_iterator di;
225- for (di = detIdIter-> data . begin (); di != detIdIter-> data . end (); di++) {
226- LocalExtraMap. insert ( OneExtraInfoLiteMap::value_type ((di-> hitIndex ()), *di));
227- }
228- SiHitExtraLiteStorage_. insert ( SiPixelExtraInfoLite::value_type (detid, LocalExtraMap));
229- } // end loop on detIdIter
230- } // end if applyLateReweighting_
231- else if (!pixelAddInfoLite. isValid () && applyLateReweighting_) {
232- edm::LogError ( " PreMixingSiPixelWorker " ) << " Problem in accessing the Extra Pixel SimHit Lite Collection !!!! " ;
233- edm::LogError (" PreMixingSiPixelWorker" ) << " The Late Charge Reweighting can not be applied " ;
234- throw cms::Exception (" PreMixingSiPixelWorker" )
235- << " Problem in accessing the Extra Pixel SimHit Lite Collection for Late Charge Reweighting \n " ;
236- }
237- } // end if !usePixelExtraLiteFormat_
194+ if (pixelAddInfo.isValid () && applyLateReweighting_) {
195+ // access the extra information
196+ loadExtraInformation = true ;
197+ // Iterate on detector units
198+ edm::DetSetVector<PixelSimHitExtraInfo>::const_iterator detIdIter;
199+ for (detIdIter = pixelAddInfo->begin (); detIdIter != pixelAddInfo->end (); detIdIter++) {
200+ uint32_t detid = detIdIter->id ; // = rawid
201+ OneExtraInfoMap LocalExtraMap;
202+ edm::DetSet<PixelSimHitExtraInfo>::const_iterator di;
203+ for (di = detIdIter->data .begin (); di != detIdIter->data .end (); di++) {
204+ LocalExtraMap.insert (OneExtraInfoMap::value_type ((di->hitIndex ()), *di));
205+ }
206+ SiHitExtraStorage_.insert (SiPixelExtraInfo::value_type (detid, LocalExtraMap));
207+ } // end loop on detIdIter
208+ } // end if applyLateReweighting_
209+ else if (!pixelAddInfo.isValid () && applyLateReweighting_) {
210+ edm::LogError (" PreMixingSiPixelWorker" ) << " Problem in accessing the Extra Pixel SimHit Collection !!!! " ;
211+ edm::LogError (" PreMixingSiPixelWorker" ) << " The Late Charge Reweighting can not be applied " ;
212+ throw cms::Exception (" PreMixingSiPixelWorker" )
213+ << " Problem in accessing the Extra Pixel SimHit Collection for Late Charge Reweighting \n " ;
214+ }
215+ } else { // Lite version
216+ if (pixelAddInfoLite. isValid () && applyLateReweighting_) {
217+ // access the extra information
218+ loadExtraInformation = true ;
219+ // Iterate on detector units
220+ edm::DetSetVector<PixelSimHitExtraInfoLite>::const_iterator detIdIter;
221+ for (detIdIter = pixelAddInfoLite-> begin (); detIdIter != pixelAddInfoLite-> end (); detIdIter++) {
222+ uint32_t detid = detIdIter-> id ; // = rawid
223+ OneExtraInfoLiteMap LocalExtraMap;
224+ edm::DetSet<PixelSimHitExtraInfoLite>::const_iterator di ;
225+ for (di = detIdIter-> data . begin (); di != detIdIter-> data . end (); di++) {
226+ LocalExtraMap. insert ( OneExtraInfoLiteMap::value_type ((di-> hitIndex ()), *di));
227+ }
228+ SiHitExtraLiteStorage_. insert ( SiPixelExtraInfoLite::value_type (detid, LocalExtraMap));
229+ } // end loop on detIdIter
230+ } // end if applyLateReweighting_
231+ else if (!pixelAddInfoLite. isValid () && applyLateReweighting_) {
232+ edm::LogError ( " PreMixingSiPixelWorker " )
233+ << " Problem in accessing the Extra Pixel SimHit Lite Collection !!!! " ;
234+ edm::LogError (" PreMixingSiPixelWorker" ) << " The Late Charge Reweighting can not be applied " ;
235+ throw cms::Exception (" PreMixingSiPixelWorker" )
236+ << " Problem in accessing the Extra Pixel SimHit Lite Collection for Late Charge Reweighting \n " ;
237+ }
238+ } // end if !usePixelExtraLiteFormat_
238239
239240 // loop on all detsets (detectorIDs) inside the input collection
240241 edm::DetSetVector<PixelDigi>::const_iterator DSViter = input.begin ();
@@ -259,48 +260,46 @@ void PreMixingSiPixelWorker::addPileups(PileUpEventPrincipal const& pep, edm::Ev
259260 TempDigis.push_back (*icopy);
260261 }
261262 if (loadExtraInformation) {
262- // apply the Late Charge Reweighthing on Pile-up digi
263- if (!usePixelExtraLiteFormat_) {
264- SiPixelExtraInfo::const_iterator jtest;
265- jtest = SiHitExtraStorage_.find (detID);
266- OneExtraInfoMap LocalSimHitExtraMap = jtest->second ;
267- std::vector<PixelSimHitExtraInfo> TempSimExtra;
268- for (auto & iLocal : LocalSimHitExtraMap) {
269- TempSimExtra.push_back (iLocal.second );
270- }
263+ // apply the Late Charge Reweighthing on Pile-up digi
264+ if (!usePixelExtraLiteFormat_) {
265+ SiPixelExtraInfo::const_iterator jtest;
266+ jtest = SiHitExtraStorage_.find (detID);
267+ OneExtraInfoMap LocalSimHitExtraMap = jtest->second ;
268+ std::vector<PixelSimHitExtraInfo> TempSimExtra;
269+ for (auto & iLocal : LocalSimHitExtraMap) {
270+ TempSimExtra.push_back (iLocal.second );
271+ }
271272
272- for (const auto & iu : pDD.detUnits ()) {
273- if (iu->type ().isTrackerPixel ()) {
274- uint32_t detIDinLoop = iu->geographicalId ().rawId ();
275- if (detIDinLoop == detID) {
276- digitizer_.lateSignalReweight (
277- dynamic_cast <const PixelGeomDetUnit*>(iu), TempDigis, TempSimExtra, tTopo, engine);
278- break ;
273+ for (const auto & iu : pDD.detUnits ()) {
274+ if (iu->type ().isTrackerPixel ()) {
275+ uint32_t detIDinLoop = iu->geographicalId ().rawId ();
276+ if (detIDinLoop == detID) {
277+ digitizer_.lateSignalReweight (
278+ dynamic_cast <const PixelGeomDetUnit*>(iu), TempDigis, TempSimExtra, tTopo, engine);
279+ break ;
280+ }
279281 }
280282 }
281- }
282- }
283- else { // Lite version
284- SiPixelExtraInfoLite::const_iterator jtest;
285- jtest = SiHitExtraLiteStorage_.find (detID);
286- OneExtraInfoLiteMap LocalSimHitExtraMap = jtest->second ;
287- std::vector<PixelSimHitExtraInfoLite> TempSimExtra;
288- for (auto & iLocal : LocalSimHitExtraMap) {
289- TempSimExtra.push_back (iLocal.second );
290- }
283+ } else { // Lite version
284+ SiPixelExtraInfoLite::const_iterator jtest;
285+ jtest = SiHitExtraLiteStorage_.find (detID);
286+ OneExtraInfoLiteMap LocalSimHitExtraMap = jtest->second ;
287+ std::vector<PixelSimHitExtraInfoLite> TempSimExtra;
288+ for (auto & iLocal : LocalSimHitExtraMap) {
289+ TempSimExtra.push_back (iLocal.second );
290+ }
291291
292- for (const auto & iu : pDD.detUnits ()) {
293- if (iu->type ().isTrackerPixel ()) {
294- uint32_t detIDinLoop = iu->geographicalId ().rawId ();
295- if (detIDinLoop == detID) {
296- digitizer_.lateSignalReweight (
297- dynamic_cast <const PixelGeomDetUnit*>(iu), TempDigis, TempSimExtra, tTopo, engine);
298- break ;
292+ for (const auto & iu : pDD.detUnits ()) {
293+ if (iu->type ().isTrackerPixel ()) {
294+ uint32_t detIDinLoop = iu->geographicalId ().rawId ();
295+ if (detIDinLoop == detID) {
296+ digitizer_.lateSignalReweight (
297+ dynamic_cast <const PixelGeomDetUnit*>(iu), TempDigis, TempSimExtra, tTopo, engine);
298+ break ;
299+ }
299300 }
300301 }
301- }
302- } // end if !usePixelExtraLiteFormat_
303-
302+ } // end if !usePixelExtraLiteFormat_
304303 }
305304
306305 if (itest != SiHitStorage_.end ()) { // this detID already has hits, add to existing map
0 commit comments