42 float MinTimeHits[361];
44 float MaxTimeHits[361];
47 for(
int i = 0 ;
i < 361 ;
i++ )
51 MinTimeHits[
i] = 9999.;
52 MaxTimeHits[
i] = -9999.;
70 cell = TheSubGeometry->getGeometry(
id);
76 int iPhi = EcalID.iphi();
81 SumE[iPhi] +=
hit->energy();
84 float time =
hit->time();
85 MinTimeHits[iPhi] = time < MinTimeHits[iPhi] ? time : MinTimeHits[iPhi];
86 MaxTimeHits[iPhi] = time > MaxTimeHits[iPhi] ? time : MaxTimeHits[iPhi];
92 for(
int iPhi = 1 ; iPhi < 361; iPhi++ )
97 PhiWedge wedge(SumE[iPhi], iPhi, NumHits[iPhi], MinTimeHits[iPhi], MaxTimeHits[iPhi]);
102 std::vector<const EcalRecHit*> Hits;
110 int Hit_iPhi = EcalID.iphi();
112 if( Hit_iPhi != iPhi )
continue;
113 Hits.push_back( &(*
hit) );
116 std::sort( Hits.begin() , Hits.end(),
CompareTime);
117 float MinusToPlus = 0.;
118 float PlusToMinus = 0.;
119 for(
unsigned int i = 0 ;
i < Hits.size() ;
i++ )
123 int ieta_i = EcalID_i.
ieta();
124 for(
unsigned int j = (
i+1) ;
j < Hits.size() ;
j++ )
128 int ieta_j = EcalID_j.
ieta();
129 if( ieta_i > ieta_j ) PlusToMinus +=
TMath::Abs(ieta_j - ieta_i );
130 else MinusToPlus +=
TMath::Abs(ieta_j -ieta_i) ;
134 float PlusZOriginConfidence = (PlusToMinus+MinusToPlus) ? PlusToMinus / (PlusToMinus+MinusToPlus) : -1.;
135 wedge.SetPlusZOriginConfidence(PlusZOriginConfidence);
140 std::vector<float> vShowerShapes_Roundness;
141 std::vector<float> vShowerShapes_Angle ;
142 if(TheSuperClusters.
isValid()){
143 for(reco::SuperClusterCollection::const_iterator cluster = TheSuperClusters->begin() ; cluster != TheSuperClusters->end() ; cluster++ )
145 if(
abs(cluster->eta()) <= 1.48 )
147 vector<float> shapes = EcalClusterTools::roundnessBarrelSuperClusters( *cluster, (*TheEBRecHits.
product()));
148 float roundness = shapes[0];
149 float angle = shapes[1];
155 bool BelongsToPhoton =
false;
158 for(reco::PhotonCollection::const_iterator iPhoton = ThePhotons->begin() ; iPhoton != ThePhotons->end() ; iPhoton++ )
161 if ( TheClusterRef == iPhoton->superCluster() )
163 BelongsToPhoton =
true;
170 if( BelongsToPhoton )
175 vShowerShapes_Roundness.push_back(shapes[0]);
176 vShowerShapes_Angle.push_back(shapes[1]);
180 vShowerShapes_Roundness.push_back(-1.);
181 vShowerShapes_Angle.push_back(-1.);
187 TheRoundnessFiller.
insert( TheSuperClusters, vShowerShapes_Roundness.begin(), vShowerShapes_Roundness.end() );
188 TheRoundnessFiller.fill();
191 TheAngleFiller.
insert( TheSuperClusters, vShowerShapes_Angle.begin() , vShowerShapes_Angle.end() );
192 TheAngleFiller.fill();
211 std::vector<HaloClusterCandidateECAL> haloclustercands_EB;
214 std::vector<HaloClusterCandidateECAL> haloclustercands_EE;
220 return TheEcalHaloData;
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
edm::ValueMap< float > & GetShowerShapesRoundness()
const std::vector< PhiWedge > & GetPhiWedges() const
edm::RefVector< reco::SuperClusterCollection > & GetSuperClusters()
edm::ValueMap< float > & GetShowerShapesAngle()
void insert(const H &h, I begin, I end)
std::vector< EcalRecHit >::const_iterator const_iterator
uint32_t rawId() const
get the raw id
void setHaloClusterCandidatesEE(const std::vector< HaloClusterCandidateECAL > &x)
Abs< T >::type abs(const T &t)
void setHaloClusterCandidatesEB(const std::vector< HaloClusterCandidateECAL > &x)
std::vector< reco::HaloClusterCandidateECAL > GetHaloClusterCandidateEB(edm::Handle< EcalRecHitCollection > &ecalrechitcoll, edm::Handle< HBHERecHitCollection > &hbherechitcoll, float et_thresh_seedrh)
int ieta() const
get the crystal ieta
std::vector< reco::HaloClusterCandidateECAL > GetHaloClusterCandidateEE(edm::Handle< EcalRecHitCollection > &ecalrechitcoll, edm::Handle< HBHERecHitCollection > &hbherechitcoll, float et_thresh_seedrh)
T const * product() const
float EBRecHitEnergyThreshold
T const * product() const
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
bool CompareTime(const EcalRecHit *x, const EcalRecHit *y)
T angle(T x1, T y1, T z1, T x2, T y2, T z2)