28 #include "CLHEP/GenericFunctions/Erf.hh"
65 edm::LogInfo(
"CaloRecHitsProducer") <<
"Uniform noise simulation selected in the barrel";
68 if(highNoiseParameters_.size()==4)
69 EBHotFraction_ = 0.5-0.5*myErf(highNoiseParameters_[3]/highNoiseParameters_[2]/
sqrt(2.));
70 if(highNoiseParameters_.size()==3)
72 edm::LogInfo(
"CaloRecHitsProducer")<<
" The gaussian model for high noise fluctuation cells after ZS is selected (best model), hot fraction " <<
EBHotFraction_ << std::endl;
77 double c1=CalibParameters.
getParameter<
double>(
"EBs25notContainment");
92 for(
unsigned ic=0;ic<
size;++ic)
104 for(
unsigned itt=0;itt<
size;++itt)
113 for(
unsigned itt=0;itt<
size;++itt)
138 for(
unsigned ihit=0;ihit<nhit;++ihit)
202 for (cficalo=colcalo->begin(); cficalo!=cficaloend;cficalo++)
219 float energy=(cficalo->energy()==0.) ? 0.000001 : cficalo->energy() ;
250 for(
unsigned itt=0;itt<
nTT;++itt)
257 unsigned nneighbors=neighbors.size();
260 for(
unsigned in=0;
in<nneighbors;++
in)
267 theFiredTTs_.push_back(neighbors[in]);
291 unsigned nxtals=xtals.size();
292 unsigned counter =0 ;
294 for(
unsigned ic=0;ic<nxtals;++ic)
296 unsigned hashedindex=xtals[ic];
338 while(icell < ncells)
428 unsigned size=vec.size();
429 for(
unsigned ic=0; ic<
size; ++ic)
463 for(
unsigned iTT=0;iTT<nTTs;++iTT)
470 if(ietamin==0) ietamin=-1;
472 if(ietamax==0) ietamax=1;
475 for(
int ieta=ietamin;ieta<=ietamax;)
477 int iz=(ieta>0)? 1 : -1;
478 for(
int iphi=iphimin;iphi<=iphimax;)
481 if(riphi<1) riphi+=72;
482 else if(riphi>72) riphi-=72;
485 if(ieta!=ietaPivot||riphi!=iphiPivot)
513 const std::vector<float>& ICMC = jcal->
barrelItems();
524 const std::vector<float> & IC = ical->
barrelItems();
527 unsigned nic = IC.size();
528 for (
unsigned ic=0; ic <nic ; ++ic ) {
530 float factor = IC[ic]/ICMC[ic];
535 rms+=(factor-1.)*(factor-1.);
549 rms=
sqrt(rms-mean*mean);
550 meanIC = 1.+ meanIC/ncells;
554 edm::LogInfo(
"CaloRecHitsProducer") <<
"Found " << ncells <<
" cells in the barrel calibration map. RMS is " << rms << std::endl;
596 unsigned size=tts.size();
598 for(
unsigned itt=0;itt<size&&!
result;++itt)
int adc(sample_type sample)
get the ADC sample (12 bits)
T getParameter(std::string const &) const
bool isHighInterest(int tthi)
T getUntrackedParameter(std::string const &, T const &) const
int hashedIndex() const
get a compact index for arrays
const GaussianTail * myGaussianTailGenerator_
const RandomEngine * random_
const std::vector< float > * ICMC_
std::vector< int > theFiredCells_
const Items & barrelItems() const
~EcalBarrelRecHitsMaker()
Sin< T >::type sin(const T &t)
int hashedIndex() const
get a compact index for arrays [TODO: NEEDS WORK]
void push_back(T const &t)
void loadEcalBarrelRecHits(edm::Event &iEvent, EBRecHitCollection &ecalHits, EBDigiCollection &ecaldigis)
bool noisifyTriggerTower(unsigned tthi)
std::vector< float > sinTheta_
const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
double gaussShoot(double mean=0.0, double sigma=1.0) const
EcalTrigTowerDetId towerOf(const DetId &id) const
Get the tower id for this det id (or null if not known)
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)
virtual const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
std::vector< float > theCalorimeterHits_
Geom::Theta< T > theta() const
std::vector< float > noisesigma_
void loadPCaloHits(const edm::Event &iEvent)
void geVtoGainAdc(float e, unsigned &gain, unsigned &adc) const
int hashedIndex(int ieta, int iphi)
MVATrainerComputer * calib
const T & max(const T &a, const T &b)
void noisifyTriggerTowers()
unsigned int poissonShoot(double mean) const
std::vector< uint32_t > barrelRawId_
std::vector< double > highNoiseParameters_
std::vector< unsigned > theFiredTTs_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
void reserve(size_t isize)
const EcalTrigTowerConstituentsMap * eTTmap_
std::vector< float > TTTEnergy_
static EBDetId unhashIndex(int hi)
get a DetId from a compact index for arrays
T const * product() const
EcalBarrelRecHitsMaker(edm::ParameterSet const &p, const RandomEngine *)
T const * product() const
double flatShoot(double xmin=0.0, double xmax=1.0) const
void push_back(id_type iid, data_type const *idata)
std::vector< std::vector< int > > crystalsinTT_
std::vector< std::vector< int > > neighboringTTs_
std::vector< float > theCalibConstants_
std::vector< int > theTTofHighInterest_
void reserve(size_type n)
std::vector< int > applyZSCells_
int ietaAbs() const
get the absolute value of the crystal ieta
tuple size
Write out results.
void init(const edm::EventSetup &es, bool dodigis, bool doMiscalib)
std::vector< EcalTrigTowerDetId > theTTDetIds_
std::vector< bool > treatedTTs_
std::vector< int > TTHighInterest_