17 #include "CLHEP/GenericFunctions/Erf.hh"
22 myGaussianTailGenerator_(
nullptr)
63 std::map<uint32_t,std::pair<float,bool> >::const_iterator
65 std::map<uint32_t,std::pair<float,bool> >::const_iterator
71 if(it->second.second)
continue;
103 edm::LogInfo(
"CaloRecHitsProducer") <<
"Total number of cells in Preshower " <<
ncells_ << std::endl;
116 if(geom==0)
return 0;
118 for (std::vector<DetId>::const_iterator
i=ids.begin();
i!=ids.end();
i++)
135 edm::LogWarning(
"CaloRecHitsProducer") <<
"All Preshower cells on ! " << std::endl;
147 unsigned cellindex=0;
148 uint32_t cellnumber=0;
149 std::map<uint32_t,std::pair<float,bool> >::const_iterator itcheck;
153 cellindex = (unsigned)(random->
flatShoot()*ncells);
154 cellnumber = thecells[cellindex];
155 itcheck=theMap.find(cellnumber);
156 if(itcheck==theMap.end())
160 theMap.insert(std::pair<uint32_t,std::pair<float,bool> >
161 (cellnumber,noisehit));
180 std::pair<float,bool>
hit(energy,
false);
184 myHits.insert(myHits.end(),std::pair<uint32_t,std::pair<float,bool> >(id,hit));
188 std::map<uint32_t,std::pair<float,bool> >::iterator itcheck=myHits.find(
id);
189 if(itcheck==myHits.end())
192 std::pair<float,bool>
hit(energy,
false);
193 myHits.insert(std::pair<uint32_t,std::pair<float,bool> >(
id,hit));
197 itcheck->second.first +=
energy;
T getParameter(std::string const &) const
std::vector< uint32_t > escells_
double preshowerHotFraction_
std::map< uint32_t, std::pair< float, bool > > ecalsRecHits_
double flatShoot(double xmin=0.0, double xmax=1.0) const
void push_back(T const &t)
void loadEcalPreshowerRecHits(edm::Event &iEvent, ESRecHitCollection &esRecHits, RandomEngineAndDistribution const *)
virtual const std::vector< DetId > & getValidDetIds(DetId::Detector det=DetId::Detector(0), int subdet=0) const
Get a list of valid detector ids (for the given subdetector)
double shoot(RandomEngineAndDistribution const *) const
unsigned createVectorsOfCells(const edm::EventSetup &es)
~EcalPreshowerRecHitsMaker()
const GaussianTail * myGaussianTailGenerator_
void loadPCaloHits(const edm::Event &iEvent, RandomEngineAndDistribution const *)
void noisifySubdet(std::map< uint32_t, std::pair< float, bool > > &theMap, const std::vector< uint32_t > &thecells, unsigned ncells, RandomEngineAndDistribution const *)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
void Fill(uint32_t id, float energy, std::map< uint32_t, std::pair< float, bool > > &myHits, RandomEngineAndDistribution const *, bool signal=true)
T const * product() const
void noisify(RandomEngineAndDistribution const *)
void init(const edm::EventSetup &es)
double gaussShoot(double mean=0.0, double sigma=1.0) const
unsigned int poissonShoot(double mean) const
EcalPreshowerRecHitsMaker(edm::ParameterSet const &p)