141 for (it = pESRecHits->begin(); it != pESRecHits->end(); ++it) {
143 if (it->recoFlag()==1 || it->recoFlag()==14 || (it->recoFlag()<=10 && it->recoFlag()>=5))
continue;
178 if ( cluster.size() == 0 ) {
179 throw cms::Exception(
"InvalidCluster") <<
"The cluster has no crystals!";
181 DetId id = (cluster.hitsAndFractions()[0]).
first;
188 throw cms::Exception(
"InvalidSubdetector") <<
"The subdetId() " <<
id.subdetId() <<
" does not correspond to EcalBarrel neither EcalEndcap";
200 DetId id = cluster.seed();
207 return (*theSeedHit).time();
215 std::vector<std::pair<DetId, float> > clusterComponents = (cluster).hitsAndFractions() ;
222 float weightedTsum = 0;
223 float sumOfWeights = 0;
225 for (std::vector<std::pair<DetId, float> >::const_iterator detitr = clusterComponents.begin(); detitr != clusterComponents.end(); detitr++ )
232 float lasercalib = 1.;
233 lasercalib =
laser->getLaserCorrection( detitr->first, ev.
time());
238 icalconst = (*icalit);
241 edm::LogError(
"EcalClusterLazyTools") <<
"No intercalib const found for xtal " << (detitr->first).rawId() <<
"bailing out";
246 if ( (detitr ->
first).subdetId() ==
EcalBarrel ) adcToGeV = float(
agc->getEBValue());
247 else if ( (detitr ->
first).subdetId() ==
EcalEndcap ) adcToGeV =
float(
agc->getEEValue());
249 if (icalconst>0 && lasercalib>0 && adcToGeV>0) adc= (*oneHit).energy()/(icalconst*lasercalib*adcToGeV);
252 if( (detitr ->
first).subdetId() ==
EcalBarrel && adc< (1.1*20) )
continue;
253 if( (detitr ->
first).subdetId() ==
EcalEndcap && adc< (2.2*20) )
continue;
256 if(! (*oneHit).isTimeErrorValid())
continue;
258 float timeError = (*oneHit).timeError();
261 if (timeError>0.6) timeError =
sqrt( timeError*timeError - 0.6*0.6 + 0.15*0.15);
262 else timeError =
sqrt( timeError*timeError + 0.15*0.15);
265 weightedTsum += (*oneHit).time() / (timeError*timeError);
266 sumOfWeights += 1. / (timeError*timeError);
271 if ( sumOfWeights ==0 )
return -999;
272 else return ( weightedTsum / sumOfWeights);
296 if (!(fabs(cluster.
eta()) > 1.6 && fabs(cluster.
eta()) < 3.))
return 0.;
300 if (geometryES) topology_p =
new EcalPreshowerTopology(
geometry_);
304 float phoESShapeIXIX =
getESShape(phoESHitsIXIX);
305 float phoESShapeIYIY =
getESShape(phoESHitsIYIY);
307 return sqrt(phoESShapeIXIX*phoESShapeIXIX + phoESShapeIYIY*phoESShapeIYIY);
313 if (!(fabs(cluster.
eta()) > 1.6 && fabs(cluster.
eta()) < 3.))
return 0.;
317 if (geometryES) topology_p =
new EcalPreshowerTopology(
geometry_);
320 float phoESShapeIXIX =
getESShape(phoESHitsIXIX);
322 return phoESShapeIXIX;
328 if (!(fabs(cluster.
eta()) > 1.6 && fabs(cluster.
eta()) < 3.))
return 0.;
332 if (geometryES) topology_p =
new EcalPreshowerTopology(
geometry_);
335 float phoESShapeIYIY =
getESShape(phoESHitsIYIY);
337 return phoESShapeIYIY;
343 std::map<DetId, EcalRecHit> rechits_map = _rechits_map;
344 std::vector<float> esHits;
354 std::map<DetId, EcalRecHit>::iterator it;
360 theESNav.setHome(strip);
363 if (plane==1 && strip !=
ESDetId(0)) strip = theESNav.north();
364 if (plane==2 && strip !=
ESDetId(0)) strip = theESNav.east();
365 }
else if (row == -1) {
366 if (plane==1 && strip !=
ESDetId(0)) strip = theESNav.south();
367 if (plane==2 && strip !=
ESDetId(0)) strip = theESNav.west();
372 for (
int i=0;
i<31; ++
i) esHits.push_back(0);
374 it = rechits_map.find(strip);
375 if (it->second.energy() > 1.0e-10 && it != rechits_map.end()) esHits.push_back(it->second.energy());
376 else esHits.push_back(0);
382 for (
int i=0;
i<15; ++
i) {
383 next = theESNav.east();
385 it = rechits_map.find(next);
386 if (it->second.energy() > 1.0e-10 && it != rechits_map.end()) esHits.push_back(it->second.energy());
387 else esHits.push_back(0);
390 for (
int j=
i;
j<15;
j++) esHits.push_back(0);
397 theESNav.setHome(strip);
399 for (
int i=0;
i<15; ++
i) {
400 next = theESNav.west();
402 it = rechits_map.find(next);
403 if (it->second.energy() > 1.0e-10 && it != rechits_map.end()) esHits.push_back(it->second.energy());
404 else esHits.push_back(0);
407 for (
int j=
i;
j<15;
j++) esHits.push_back(0);
417 for (
int i=0;
i<15; ++
i) {
418 next = theESNav.north();
420 it = rechits_map.find(next);
421 if (it->second.energy() > 1.0e-10 && it != rechits_map.end()) esHits.push_back(it->second.energy());
422 else esHits.push_back(0);
425 for (
int j=
i;
j<15;
j++) esHits.push_back(0);
432 theESNav.setHome(strip);
434 for (
int i=0;
i<15; ++
i) {
435 next = theESNav.south();
437 it = rechits_map.find(next);
438 if (it->second.energy() > 1.0e-10 && it != rechits_map.end()) esHits.push_back(it->second.energy());
439 else esHits.push_back(0);
442 for (
int j=
i;
j<15;
j++) esHits.push_back(0);
463 for(
int ibin=0; ibin<((nBIN+1)/2); ibin++) {
465 esRH[(nBIN-1)/2] = ESHits0[ibin];
467 esRH[(nBIN-1)/2+ibin] = ESHits0[ibin];
468 esRH[(nBIN-1)/2-ibin] = ESHits0[ibin+15];
473 double EffWidthSigmaISIS = 0.;
474 double totalEnergyISIS = 0.;
475 double EffStatsISIS = 0.;
476 for (
int id_X=0; id_X<21; id_X++) {
477 totalEnergyISIS += esRH[id_X];
478 EffStatsISIS += esRH[id_X]*(id_X-10)*(id_X-10);
480 EffWidthSigmaISIS = (totalEnergyISIS>0.) ?
sqrt(fabs(EffStatsISIS / totalEnergyISIS)) : 0.;
482 return EffWidthSigmaISIS;
int adc(sample_type sample)
get the ADC sample (12 bits)
const double Z[kNumberCalorimeter]
CaloNavigator< ESDetId > EcalPreshowerNavigator
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
std::vector< EcalRecHit >::const_iterator const_iterator
double z() const
z coordinate of cluster centroid
double eta() const
pseudorapidity of cluster centroid
double x() const
x coordinate of cluster centroid
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
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
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