90 for (it = pESRecHits->begin(); it != pESRecHits->end(); ++it) {
92 std::vector<int> badf = {
93 EcalRecHit::ESFlags::kESDead,
94 EcalRecHit::ESFlags::kESTwoGoodRatios,
95 EcalRecHit::ESFlags::kESBadRatioFor12,
96 EcalRecHit::ESFlags::kESBadRatioFor23Upper,
97 EcalRecHit::ESFlags::kESBadRatioFor23Lower,
98 EcalRecHit::ESFlags::kESTS1Largest,
99 EcalRecHit::ESFlags::kESTS3Largest,
100 EcalRecHit::ESFlags::kESTS3Negative,
101 EcalRecHit::ESFlags::kESTS13Sigmas,
104 if (it->checkFlags(badf))
continue;
139 if ( cluster.size() == 0 ) {
140 throw cms::Exception(
"InvalidCluster") <<
"The cluster has no crystals!";
142 DetId id = (cluster.hitsAndFractions()[0]).
first;
149 throw cms::Exception(
"InvalidSubdetector") <<
"The subdetId() " <<
id.subdetId() <<
" does not correspond to EcalBarrel neither EcalEndcap";
161 DetId id = cluster.seed();
168 return (*theSeedHit).time();
176 std::vector<std::pair<DetId, float> > clusterComponents = (cluster).hitsAndFractions() ;
183 float weightedTsum = 0;
184 float sumOfWeights = 0;
186 for (std::vector<std::pair<DetId, float> >::const_iterator detitr = clusterComponents.begin(); detitr != clusterComponents.end(); detitr++ )
193 float lasercalib = 1.;
194 lasercalib =
laser->getLaserCorrection( detitr->first, ev.
time());
199 icalconst = (*icalit);
202 edm::LogError(
"EcalClusterLazyTools") <<
"No intercalib const found for xtal " << (detitr->first).rawId() <<
"bailing out";
207 if ( (detitr ->
first).subdetId() ==
EcalBarrel ) adcToGeV = float(
agc->getEBValue());
208 else if ( (detitr ->
first).subdetId() ==
EcalEndcap ) adcToGeV =
float(
agc->getEEValue());
210 if (icalconst>0 && lasercalib>0 && adcToGeV>0) adc= (*oneHit).energy()/(icalconst*lasercalib*adcToGeV);
213 if( (detitr ->
first).subdetId() ==
EcalBarrel && adc< (1.1*20) )
continue;
214 if( (detitr ->
first).subdetId() ==
EcalEndcap && adc< (2.2*20) )
continue;
217 if(! (*oneHit).isTimeErrorValid())
continue;
219 float timeError = (*oneHit).timeError();
222 if (timeError>0.6) timeError =
sqrt( timeError*timeError - 0.6*0.6 + 0.15*0.15);
223 else timeError =
sqrt( timeError*timeError + 0.15*0.15);
226 weightedTsum += (*oneHit).time() / (timeError*timeError);
227 sumOfWeights += 1. / (timeError*timeError);
232 if ( sumOfWeights ==0 )
return -999;
233 else return ( weightedTsum / sumOfWeights);
257 if (!(fabs(cluster.
eta()) > 1.6 && fabs(cluster.
eta()) < 3.))
return 0.;
265 float phoESShapeIXIX =
getESShape(phoESHitsIXIX);
266 float phoESShapeIYIY =
getESShape(phoESHitsIYIY);
268 return sqrt(phoESShapeIXIX*phoESShapeIXIX + phoESShapeIYIY*phoESShapeIYIY);
274 if (!(fabs(cluster.
eta()) > 1.6 && fabs(cluster.
eta()) < 3.))
return 0.;
281 float phoESShapeIXIX =
getESShape(phoESHitsIXIX);
283 return phoESShapeIXIX;
289 if (!(fabs(cluster.
eta()) > 1.6 && fabs(cluster.
eta()) < 3.))
return 0.;
296 float phoESShapeIYIY =
getESShape(phoESHitsIYIY);
298 return phoESShapeIYIY;
304 std::map<DetId, EcalRecHit> rechits_map = _rechits_map;
305 std::vector<float> esHits;
315 std::map<DetId, EcalRecHit>::iterator it;
324 if (plane==1 && strip !=
ESDetId(0)) strip = theESNav.
north();
325 if (plane==2 && strip !=
ESDetId(0)) strip = theESNav.
east();
326 }
else if (row == -1) {
327 if (plane==1 && strip !=
ESDetId(0)) strip = theESNav.
south();
328 if (plane==2 && strip !=
ESDetId(0)) strip = theESNav.
west();
333 for (
int i=0;
i<31; ++
i) esHits.push_back(0);
335 it = rechits_map.find(strip);
336 if (it != rechits_map.end() && it->second.energy() > 1.0e-10) esHits.push_back(it->second.energy());
337 else esHits.push_back(0);
343 for (
int i=0;
i<15; ++
i) {
344 next = theESNav.
east();
346 it = rechits_map.find(next);
347 if (it != rechits_map.end() && it->second.energy() > 1.0e-10) esHits.push_back(it->second.energy());
348 else esHits.push_back(0);
351 for (
int j=
i;
j<15;
j++) esHits.push_back(0);
360 for (
int i=0;
i<15; ++
i) {
361 next = theESNav.
west();
363 it = rechits_map.find(next);
364 if (it != rechits_map.end() && it->second.energy() > 1.0e-10) esHits.push_back(it->second.energy());
365 else esHits.push_back(0);
368 for (
int j=
i;
j<15;
j++) esHits.push_back(0);
378 for (
int i=0;
i<15; ++
i) {
379 next = theESNav.
north();
381 it = rechits_map.find(next);
382 if (it != rechits_map.end() && it->second.energy() > 1.0e-10) esHits.push_back(it->second.energy());
383 else esHits.push_back(0);
386 for (
int j=
i;
j<15;
j++) esHits.push_back(0);
395 for (
int i=0;
i<15; ++
i) {
396 next = theESNav.
south();
398 it = rechits_map.find(next);
399 if (it != rechits_map.end() && it->second.energy() > 1.0e-10) esHits.push_back(it->second.energy());
400 else esHits.push_back(0);
403 for (
int j=
i;
j<15;
j++) esHits.push_back(0);
424 for(
int ibin=0; ibin<((nBIN+1)/2); ibin++) {
426 esRH[(nBIN-1)/2] = ESHits0[ibin];
428 esRH[(nBIN-1)/2+ibin] = ESHits0[ibin];
429 esRH[(nBIN-1)/2-ibin] = ESHits0[ibin+15];
434 double EffWidthSigmaISIS = 0.;
435 double totalEnergyISIS = 0.;
436 double EffStatsISIS = 0.;
437 for (
int id_X=0; id_X<21; id_X++) {
438 totalEnergyISIS += esRH[id_X];
439 EffStatsISIS += esRH[id_X]*(id_X-10)*(id_X-10);
441 EffWidthSigmaISIS = (totalEnergyISIS>0.) ?
sqrt(fabs(EffStatsISIS / totalEnergyISIS)) : 0.;
443 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
T const * product() const
tuple idx
DEBUGGING if hasattr(process,"trackMonIterativeTracking2012"): print "trackMonIterativeTracking2012 D...
std::vector< Item >::const_iterator const_iterator
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