17 #include "CLHEP/GenericFunctions/Erf.hh"
24 myGaussianTailGenerator_(0)
64 std::map<uint32_t,std::pair<float,bool> >::const_iterator
66 std::map<uint32_t,std::pair<float,bool> >::const_iterator
72 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;
146 unsigned cellindex=0;
147 uint32_t cellnumber=0;
148 std::map<uint32_t,std::pair<float,bool> >::const_iterator itcheck;
153 cellnumber = thecells[cellindex];
154 itcheck=theMap.find(cellnumber);
155 if(itcheck==theMap.end())
159 theMap.insert(std::pair<uint32_t,std::pair<float,bool> >
160 (cellnumber,noisehit));
178 std::pair<float,bool>
hit(energy,
false);
182 myHits.insert(myHits.end(),std::pair<uint32_t,std::pair<float,bool> >(
id,hit));
186 std::map<uint32_t,std::pair<float,bool> >::iterator itcheck=myHits.find(
id);
187 if(itcheck==myHits.end())
190 std::pair<float,bool>
hit(energy,
false);
191 myHits.insert(std::pair<uint32_t,std::pair<float,bool> >(
id,hit));
195 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_
void push_back(T const &t)
const RandomEngine * random_
void noisifySubdet(std::map< uint32_t, std::pair< float, bool > > &theMap, const std::vector< uint32_t > &thecells, unsigned ncells)
double gaussShoot(double mean=0.0, double sigma=1.0) 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)
unsigned createVectorsOfCells(const edm::EventSetup &es)
EcalPreshowerRecHitsMaker(edm::ParameterSet const &p, const RandomEngine *random)
~EcalPreshowerRecHitsMaker()
const GaussianTail * myGaussianTailGenerator_
void Fill(uint32_t id, float energy, std::map< uint32_t, std::pair< float, bool > > &myHits, bool signal=true)
unsigned int poissonShoot(double mean) const
void loadPCaloHits(const edm::Event &iEvent)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
T const * product() const
double flatShoot(double xmin=0.0, double xmax=1.0) const
void loadEcalPreshowerRecHits(edm::Event &iEvent, ESRecHitCollection &esRecHits)
void init(const edm::EventSetup &es)