16 #include "CLHEP/Random/RandFlat.h"
34 for(
auto & each_inner : each_outter.second) {
35 if(each_inner.second !=
nullptr)
36 delete each_inner.second;
43 TH1* localHist = (TH1*)
hist->Clone();
44 localHist->SetDirectory(0);
46 if(m_energy_eta_hists1D.find(
energy) != m_energy_eta_hists1D.end()){
47 (m_energy_eta_hists1D.find(
energy)->second).insert(std::make_pair(
etaMin, localHist));
50 std::map< int, TH1*> inner;
51 inner.insert(std::make_pair(
etaMin, localHist));
52 m_energy_eta_hists1D.insert(std::make_pair(
energy, inner));
60 float randomHist = 0.;
62 if( m_energy_eta_hists1D.find(inputParameters.at(0)) == m_energy_eta_hists1D.end()) {
67 const std::map< int, TH1*>& etaMin_hists = m_energy_eta_hists1D.at(inputParameters.at(0));
69 if( etaMin_hists.find(inputParameters.at(1)) == etaMin_hists.end()) {
75 TH1*
hist = etaMin_hists.at(inputParameters.at(1));
78 double randomShoot = CLHEP::RandFlat::shoot(rndmEngine);
82 for(
int iBin = 0; iBin <
hist->GetNbinsX(); iBin ++){
84 if(
hist->GetBinContent(iBin) > randomShoot){
90 randomHist = CLHEP::RandFlat::shoot(rndmEngine,
hist->GetBinLowEdge(iBinSelect) ,
hist->GetBinLowEdge(iBinSelect+1));