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";
514 return EcalClusterTools::matrixEnergy( cluster,
getEcalRecHitCollection(cluster),
topology_,
id, ixMin, ixMax, iyMin, iyMax, flagsexcl, severitiesexcl, sevLv );
524 DetId id = cluster.seed();
531 return (*theSeedHit).time();
539 std::vector<std::pair<DetId, float> > clusterComponents = (cluster).hitsAndFractions() ;
546 float weightedTsum = 0;
547 float sumOfWeights = 0;
549 for (std::vector<std::pair<DetId, float> >::const_iterator detitr = clusterComponents.begin(); detitr != clusterComponents.end(); detitr++ )
556 float lasercalib = 1.;
557 lasercalib =
laser->getLaserCorrection( detitr->first, ev.
time());
562 icalconst = (*icalit);
565 edm::LogError(
"EcalClusterLazyTools") <<
"No intercalib const found for xtal " << (detitr->first).rawId() <<
"bailing out";
570 if ( (detitr ->
first).subdetId() ==
EcalBarrel ) adcToGeV = float(
agc->getEBValue());
571 else if ( (detitr ->
first).subdetId() ==
EcalEndcap ) adcToGeV =
float(
agc->getEEValue());
573 if (icalconst>0 && lasercalib>0 && adcToGeV>0) adc= (*oneHit).energy()/(icalconst*lasercalib*adcToGeV);
576 if( (detitr ->
first).subdetId() ==
EcalBarrel && adc< (1.1*20) )
continue;
577 if( (detitr ->
first).subdetId() ==
EcalEndcap && adc< (2.2*20) )
continue;
580 if(! (*oneHit).isTimeErrorValid())
continue;
582 float timeError = (*oneHit).timeError();
585 if (timeError>0.6) timeError =
sqrt( timeError*timeError - 0.6*0.6 + 0.15*0.15);
586 else timeError =
sqrt( timeError*timeError + 0.15*0.15);
589 weightedTsum += (*oneHit).time() / (timeError*timeError);
590 sumOfWeights += 1. / (timeError*timeError);
595 if ( sumOfWeights ==0 )
return -999;
596 else return ( weightedTsum / sumOfWeights);
620 if (!(fabs(cluster.
eta()) > 1.6 && fabs(cluster.
eta()) < 3.))
return 0.;
628 float phoESShapeIXIX =
getESShape(phoESHitsIXIX);
629 float phoESShapeIYIY =
getESShape(phoESHitsIYIY);
631 return sqrt(phoESShapeIXIX*phoESShapeIXIX + phoESShapeIYIY*phoESShapeIYIY);
637 if (!(fabs(cluster.
eta()) > 1.6 && fabs(cluster.
eta()) < 3.))
return 0.;
644 float phoESShapeIXIX =
getESShape(phoESHitsIXIX);
646 return phoESShapeIXIX;
652 if (!(fabs(cluster.
eta()) > 1.6 && fabs(cluster.
eta()) < 3.))
return 0.;
659 float phoESShapeIYIY =
getESShape(phoESHitsIYIY);
661 return phoESShapeIYIY;
667 std::vector<float> esHits;
677 std::map<DetId, EcalRecHit>::iterator it;
686 if (plane==1 && strip !=
ESDetId(0)) strip = theESNav.
north();
687 if (plane==2 && strip !=
ESDetId(0)) strip = theESNav.
east();
688 }
else if (row == -1) {
689 if (plane==1 && strip !=
ESDetId(0)) strip = theESNav.
south();
690 if (plane==2 && strip !=
ESDetId(0)) strip = theESNav.
west();
695 for (
int i=0;
i<31; ++
i) esHits.push_back(0);
697 it = rechits_map.find(strip);
698 if (it->second.energy() > 1.0e-10 && it != rechits_map.end()) esHits.push_back(it->second.energy());
699 else esHits.push_back(0);
705 for (
int i=0;
i<15; ++
i) {
706 next = theESNav.
east();
708 it = rechits_map.find(next);
709 if (it->second.energy() > 1.0e-10 && it != rechits_map.end()) esHits.push_back(it->second.energy());
710 else esHits.push_back(0);
713 for (
int j=
i;
j<15;
j++) esHits.push_back(0);
722 for (
int i=0;
i<15; ++
i) {
723 next = theESNav.
west();
725 it = rechits_map.find(next);
726 if (it->second.energy() > 1.0e-10 && it != rechits_map.end()) esHits.push_back(it->second.energy());
727 else esHits.push_back(0);
730 for (
int j=
i;
j<15;
j++) esHits.push_back(0);
740 for (
int i=0;
i<15; ++
i) {
741 next = theESNav.
north();
743 it = rechits_map.find(next);
744 if (it->second.energy() > 1.0e-10 && it != rechits_map.end()) esHits.push_back(it->second.energy());
745 else esHits.push_back(0);
748 for (
int j=
i;
j<15;
j++) esHits.push_back(0);
757 for (
int i=0;
i<15; ++
i) {
758 next = theESNav.
south();
760 it = rechits_map.find(next);
761 if (it->second.energy() > 1.0e-10 && it != rechits_map.end()) esHits.push_back(it->second.energy());
762 else esHits.push_back(0);
765 for (
int j=
i;
j<15;
j++) esHits.push_back(0);
782 for (
int idx=0; idx<nBIN; idx++) {
786 for(
int ibin=0; ibin<((nBIN+1)/2); ibin++) {
788 esRH[(nBIN-1)/2] = ESHits0[ibin];
790 esRH[(nBIN-1)/2+ibin] = ESHits0[ibin];
791 esRH[(nBIN-1)/2-ibin] = ESHits0[ibin+15];
796 double EffWidthSigmaISIS = 0.;
797 double totalEnergyISIS = 0.;
798 double EffStatsISIS = 0.;
799 for (
int id_X=0; id_X<21; id_X++) {
800 totalEnergyISIS += esRH[id_X];
801 EffStatsISIS += esRH[id_X]*(id_X-10)*(id_X-10);
803 EffWidthSigmaISIS = (totalEnergyISIS>0.) ?
sqrt(fabs(EffStatsISIS / totalEnergyISIS)) : 0.;
805 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
void setHome(const T &startingPoint)
set the starting position
void home() const
move the navigator back to the starting point
virtual T west() const
move the navigator west
std::vector< EcalRecHit >::const_iterator const_iterator
virtual T north() const
move the navigator north
double z() const
z coordinate of cluster centroid
double eta() const
pseudorapidity of cluster centroid
virtual T east() const
move the navigator east
double x() const
x coordinate of cluster centroid
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
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
virtual T south() const
move the navigator south
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