diff --git a/SimTracker/SiPixelDigitizer/plugins/PreMixingSiPixelWorker.cc b/SimTracker/SiPixelDigitizer/plugins/PreMixingSiPixelWorker.cc index 74ffda9991291..98732d6d04003 100644 --- a/SimTracker/SiPixelDigitizer/plugins/PreMixingSiPixelWorker.cc +++ b/SimTracker/SiPixelDigitizer/plugins/PreMixingSiPixelWorker.cc @@ -281,8 +281,8 @@ void PreMixingSiPixelWorker::put(edm::Event& e, iSetup.get().get(tTopoHand); const TrackerTopology* tTopo = tTopoHand.product(); - if(digitizer_.killBadFEDChannels()){ - std::unique_ptr PixelFEDChannelCollection_ = digitizer_.chooseScenario(ps,engine); + if (digitizer_.killBadFEDChannels()) { + std::unique_ptr PixelFEDChannelCollection_ = digitizer_.chooseScenario(ps, engine); if (PixelFEDChannelCollection_ == nullptr) { throw cms::Exception("NullPointerError") << "PixelFEDChannelCollection not set in chooseScenario function.\n"; } diff --git a/SimTracker/SiPixelDigitizer/plugins/SiPixelDigitizerAlgorithm.cc b/SimTracker/SiPixelDigitizer/plugins/SiPixelDigitizerAlgorithm.cc index a6e49d40f521a..1aebd88f8dba6 100644 --- a/SimTracker/SiPixelDigitizer/plugins/SiPixelDigitizerAlgorithm.cc +++ b/SimTracker/SiPixelDigitizer/plugins/SiPixelDigitizerAlgorithm.cc @@ -895,16 +895,15 @@ void SiPixelDigitizerAlgorithm::calculateInstlumiFactor(const std::vector SiPixelDigitizerAlgorithm::chooseScenario(const std::vector& ps ,CLHEP::HepRandomEngine* engine) -{ +std::unique_ptr SiPixelDigitizerAlgorithm::chooseScenario( + const std::vector& ps, CLHEP::HepRandomEngine* engine) { std::unique_ptr PixelFEDChannelCollection_ = nullptr; pixelEfficiencies_.PixelFEDChannelCollection_ = nullptr; std::vector bunchCrossing; std::vector TrueInteractionList; - for (unsigned int i = 0; i < ps.size(); i++){ + for (unsigned int i = 0; i < ps.size(); i++) { bunchCrossing.push_back(ps[i].getBunchCrossing()); TrueInteractionList.push_back(ps[i].getTrueNumInteractions()); } @@ -920,7 +919,7 @@ std::unique_ptr SiPixelDigitizerAlgorithm::chooseScen } pui++; } - + if (pu0 != bunchCrossing.end()) { unsigned int PUBin = TrueInteractionList.at(p); // case delta PU=1, fix me const auto& theProbabilitiesPerScenario = scenarioProbabilityHandle->getProbabilities(PUBin); @@ -937,13 +936,12 @@ std::unique_ptr SiPixelDigitizerAlgorithm::chooseScen PixelFEDChannelCollection_ = std::make_unique(quality_map->at(scenario)); pixelEfficiencies_.PixelFEDChannelCollection_ = - std::make_unique(quality_map->at(scenario)); + std::make_unique(quality_map->at(scenario)); } return PixelFEDChannelCollection_; } - std::unique_ptr SiPixelDigitizerAlgorithm::chooseScenario(PileupMixingContent* puInfo, CLHEP::HepRandomEngine* engine) { //Determine scenario to use for the current event based on pileup information diff --git a/SimTracker/SiPixelDigitizer/plugins/SiPixelDigitizerAlgorithm.h b/SimTracker/SiPixelDigitizer/plugins/SiPixelDigitizerAlgorithm.h index 81d3a92a36ea1..f7b83e526cf49 100644 --- a/SimTracker/SiPixelDigitizer/plugins/SiPixelDigitizerAlgorithm.h +++ b/SimTracker/SiPixelDigitizer/plugins/SiPixelDigitizerAlgorithm.h @@ -78,12 +78,13 @@ class SiPixelDigitizerAlgorithm { void calculateInstlumiFactor(PileupMixingContent* puInfo); void init_DynIneffDB(const edm::EventSetup&, const unsigned int&); std::unique_ptr chooseScenario(PileupMixingContent* puInfo, CLHEP::HepRandomEngine*); - + // for premixing void calculateInstlumiFactor(const std::vector& ps, int bunchSpacing); // TODO: try to remove the duplication of logic... void setSimAccumulator(const std::map >& signalMap); - std::unique_ptr chooseScenario(const std::vector& ps ,CLHEP::HepRandomEngine* engine); + std::unique_ptr chooseScenario(const std::vector& ps, + CLHEP::HepRandomEngine* engine); bool killBadFEDChannels() const; typedef std::unordered_map PixelFEDChannelCollectionMap;