74 for (it = pESRecHits->begin(); it != pESRecHits->end(); ++it) {
76 std::vector<int> badf = {
77 EcalRecHit::ESFlags::kESDead,
78 EcalRecHit::ESFlags::kESTwoGoodRatios,
79 EcalRecHit::ESFlags::kESBadRatioFor12,
80 EcalRecHit::ESFlags::kESBadRatioFor23Upper,
81 EcalRecHit::ESFlags::kESBadRatioFor23Lower,
82 EcalRecHit::ESFlags::kESTS1Largest,
83 EcalRecHit::ESFlags::kESTS3Largest,
84 EcalRecHit::ESFlags::kESTS3Negative,
85 EcalRecHit::ESFlags::kESTS13Sigmas,
88 if (it->checkFlags(badf))
continue;
123 if ( cluster.size() == 0 ) {
124 throw cms::Exception(
"InvalidCluster") <<
"The cluster has no crystals!";
126 DetId id = (cluster.hitsAndFractions()[0]).
first;
133 throw cms::Exception(
"InvalidSubdetector") <<
"The subdetId() " <<
id.subdetId() <<
" does not correspond to EcalBarrel neither EcalEndcap";
145 DetId id = cluster.seed();
152 return (*theSeedHit).time();
160 std::vector<std::pair<DetId, float> > clusterComponents = (cluster).hitsAndFractions() ;
167 float weightedTsum = 0;
168 float sumOfWeights = 0;
170 for (std::vector<std::pair<DetId, float> >::const_iterator detitr = clusterComponents.begin(); detitr != clusterComponents.end(); detitr++ )
177 float lasercalib = 1.;
178 lasercalib =
laser->getLaserCorrection( detitr->first, ev.
time());
183 icalconst = (*icalit);
186 edm::LogError(
"EcalClusterLazyTools") <<
"No intercalib const found for xtal " << (detitr->first).rawId() <<
"bailing out";
191 if ( (detitr ->
first).subdetId() ==
EcalBarrel ) adcToGeV = float(
agc->getEBValue());
192 else if ( (detitr ->
first).subdetId() ==
EcalEndcap ) adcToGeV =
float(
agc->getEEValue());
194 if (icalconst>0 && lasercalib>0 && adcToGeV>0) adc= (*oneHit).energy()/(icalconst*lasercalib*adcToGeV);
197 if( (detitr ->
first).subdetId() ==
EcalBarrel && adc< (1.1*20) )
continue;
198 if( (detitr ->
first).subdetId() ==
EcalEndcap && adc< (2.2*20) )
continue;
201 if(! (*oneHit).isTimeErrorValid())
continue;
203 float timeError = (*oneHit).timeError();
206 if (timeError>0.6) timeError =
sqrt( timeError*timeError - 0.6*0.6 + 0.15*0.15);
207 else timeError =
sqrt( timeError*timeError + 0.15*0.15);
210 weightedTsum += (*oneHit).time() / (timeError*timeError);
211 sumOfWeights += 1. / (timeError*timeError);
216 if ( sumOfWeights ==0 )
return -999;
217 else return ( weightedTsum / sumOfWeights);
241 if (!(fabs(cluster.
eta()) > 1.6 && fabs(cluster.
eta()) < 3.))
return 0.;
249 float phoESShapeIXIX =
getESShape(phoESHitsIXIX);
250 float phoESShapeIYIY =
getESShape(phoESHitsIYIY);
252 return sqrt(phoESShapeIXIX*phoESShapeIXIX + phoESShapeIYIY*phoESShapeIYIY);
258 if (!(fabs(cluster.
eta()) > 1.6 && fabs(cluster.
eta()) < 3.))
return 0.;
265 float phoESShapeIXIX =
getESShape(phoESHitsIXIX);
267 return phoESShapeIXIX;
273 if (!(fabs(cluster.
eta()) > 1.6 && fabs(cluster.
eta()) < 3.))
return 0.;
280 float phoESShapeIYIY =
getESShape(phoESHitsIYIY);
282 return phoESShapeIYIY;
288 std::map<DetId, EcalRecHit> rechits_map = _rechits_map;
289 std::vector<float> esHits;
299 std::map<DetId, EcalRecHit>::iterator it;
308 if (plane==1 && strip !=
ESDetId(0)) strip = theESNav.
north();
309 if (plane==2 && strip !=
ESDetId(0)) strip = theESNav.
east();
310 }
else if (row == -1) {
311 if (plane==1 && strip !=
ESDetId(0)) strip = theESNav.
south();
312 if (plane==2 && strip !=
ESDetId(0)) strip = theESNav.
west();
317 for (
int i=0;
i<31; ++
i) esHits.push_back(0);
319 it = rechits_map.find(strip);
320 if (it->second.energy() > 1.0e-10 && it != rechits_map.end()) esHits.push_back(it->second.energy());
321 else esHits.push_back(0);
327 for (
int i=0;
i<15; ++
i) {
328 next = theESNav.
east();
330 it = rechits_map.find(next);
331 if (it->second.energy() > 1.0e-10 && it != rechits_map.end()) esHits.push_back(it->second.energy());
332 else esHits.push_back(0);
335 for (
int j=
i;
j<15;
j++) esHits.push_back(0);
344 for (
int i=0;
i<15; ++
i) {
345 next = theESNav.
west();
347 it = rechits_map.find(next);
348 if (it->second.energy() > 1.0e-10 && it != rechits_map.end()) esHits.push_back(it->second.energy());
349 else esHits.push_back(0);
352 for (
int j=
i;
j<15;
j++) esHits.push_back(0);
362 for (
int i=0;
i<15; ++
i) {
363 next = theESNav.
north();
365 it = rechits_map.find(next);
366 if (it->second.energy() > 1.0e-10 && it != rechits_map.end()) esHits.push_back(it->second.energy());
367 else esHits.push_back(0);
370 for (
int j=
i;
j<15;
j++) esHits.push_back(0);
379 for (
int i=0;
i<15; ++
i) {
380 next = theESNav.
south();
382 it = rechits_map.find(next);
383 if (it->second.energy() > 1.0e-10 && it != rechits_map.end()) esHits.push_back(it->second.energy());
384 else esHits.push_back(0);
387 for (
int j=
i;
j<15;
j++) esHits.push_back(0);
408 for(
int ibin=0; ibin<((nBIN+1)/2); ibin++) {
410 esRH[(nBIN-1)/2] = ESHits0[ibin];
412 esRH[(nBIN-1)/2+ibin] = ESHits0[ibin];
413 esRH[(nBIN-1)/2-ibin] = ESHits0[ibin+15];
418 double EffWidthSigmaISIS = 0.;
419 double totalEnergyISIS = 0.;
420 double EffStatsISIS = 0.;
421 for (
int id_X=0; id_X<21; id_X++) {
422 totalEnergyISIS += esRH[id_X];
423 EffStatsISIS += esRH[id_X]*(id_X-10)*(id_X-10);
425 EffWidthSigmaISIS = (totalEnergyISIS>0.) ?
sqrt(fabs(EffStatsISIS / totalEnergyISIS)) : 0.;
427 return EffWidthSigmaISIS;
int adc(sample_type sample)
get the ADC sample (12 bits)
const double Z[kNumberCalorimeter]
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< EcalRecHit >::const_iterator const_iterator
double z() const
z coordinate of cluster centroid
double eta() const
pseudorapidity of cluster centroid
void setHome(const T &startingPoint)
set the starting position
T west() const
move the navigator west
double x() const
x coordinate of cluster centroid
T south() const
move the navigator south
T east() const
move the navigator east
void home() const
move the navigator back to the starting point
tuple idx
DEBUGGING if hasattr(process,"trackMonIterativeTracking2012"): print "trackMonIterativeTracking2012 D...
std::vector< Item >::const_iterator const_iterator
T const * product() const
T const * product() const
ESHandle< TrackerGeometry > geometry
iterator find(key_type k)
const_iterator find(uint32_t rawId) const
T north() const
move the navigator north
const_iterator end() const
const CaloClusterPtr & seed() const
seed BasicCluster
double y() const
y coordinate of cluster centroid
edm::Timestamp time() const
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
float EcalIntercalibConstant