Skip to content

Commit

Permalink
implement code-format suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
mmusich committed Sep 2, 2019
1 parent 1812da2 commit d1a7e77
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
4 changes: 2 additions & 2 deletions SimTracker/SiPixelDigitizer/plugins/PreMixingSiPixelWorker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,8 @@ void PreMixingSiPixelWorker::put(edm::Event& e,
iSetup.get<TrackerTopologyRcd>().get(tTopoHand);
const TrackerTopology* tTopo = tTopoHand.product();

if(digitizer_.killBadFEDChannels()){
std::unique_ptr<PixelFEDChannelCollection> PixelFEDChannelCollection_ = digitizer_.chooseScenario(ps,engine);
if (digitizer_.killBadFEDChannels()) {
std::unique_ptr<PixelFEDChannelCollection> PixelFEDChannelCollection_ = digitizer_.chooseScenario(ps, engine);
if (PixelFEDChannelCollection_ == nullptr) {
throw cms::Exception("NullPointerError") << "PixelFEDChannelCollection not set in chooseScenario function.\n";
}
Expand Down
12 changes: 5 additions & 7 deletions SimTracker/SiPixelDigitizer/plugins/SiPixelDigitizerAlgorithm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -895,16 +895,15 @@ void SiPixelDigitizerAlgorithm::calculateInstlumiFactor(const std::vector<Pileup

bool SiPixelDigitizerAlgorithm::killBadFEDChannels() const { return KillBadFEDChannels; }


std::unique_ptr<PixelFEDChannelCollection> SiPixelDigitizerAlgorithm::chooseScenario(const std::vector<PileupSummaryInfo>& ps ,CLHEP::HepRandomEngine* engine)
{
std::unique_ptr<PixelFEDChannelCollection> SiPixelDigitizerAlgorithm::chooseScenario(
const std::vector<PileupSummaryInfo>& ps, CLHEP::HepRandomEngine* engine) {
std::unique_ptr<PixelFEDChannelCollection> PixelFEDChannelCollection_ = nullptr;
pixelEfficiencies_.PixelFEDChannelCollection_ = nullptr;

std::vector<int> bunchCrossing;
std::vector<float> 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());
}
Expand All @@ -920,7 +919,7 @@ std::unique_ptr<PixelFEDChannelCollection> 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);
Expand All @@ -937,13 +936,12 @@ std::unique_ptr<PixelFEDChannelCollection> SiPixelDigitizerAlgorithm::chooseScen

PixelFEDChannelCollection_ = std::make_unique<PixelFEDChannelCollection>(quality_map->at(scenario));
pixelEfficiencies_.PixelFEDChannelCollection_ =
std::make_unique<PixelFEDChannelCollection>(quality_map->at(scenario));
std::make_unique<PixelFEDChannelCollection>(quality_map->at(scenario));
}

return PixelFEDChannelCollection_;
}


std::unique_ptr<PixelFEDChannelCollection> SiPixelDigitizerAlgorithm::chooseScenario(PileupMixingContent* puInfo,
CLHEP::HepRandomEngine* engine) {
//Determine scenario to use for the current event based on pileup information
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,13 @@ class SiPixelDigitizerAlgorithm {
void calculateInstlumiFactor(PileupMixingContent* puInfo);
void init_DynIneffDB(const edm::EventSetup&, const unsigned int&);
std::unique_ptr<PixelFEDChannelCollection> chooseScenario(PileupMixingContent* puInfo, CLHEP::HepRandomEngine*);

// for premixing
void calculateInstlumiFactor(const std::vector<PileupSummaryInfo>& ps,
int bunchSpacing); // TODO: try to remove the duplication of logic...
void setSimAccumulator(const std::map<uint32_t, std::map<int, int> >& signalMap);
std::unique_ptr<PixelFEDChannelCollection> chooseScenario(const std::vector<PileupSummaryInfo>& ps ,CLHEP::HepRandomEngine* engine);
std::unique_ptr<PixelFEDChannelCollection> chooseScenario(const std::vector<PileupSummaryInfo>& ps,
CLHEP::HepRandomEngine* engine);

bool killBadFEDChannels() const;
typedef std::unordered_map<std::string, PixelFEDChannelCollection> PixelFEDChannelCollectionMap;
Expand Down

0 comments on commit d1a7e77

Please sign in to comment.