test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ClusterShapeAlgo.cc
Go to the documentation of this file.
1 #include <iostream>
2 
10 
15 
16 #include "CLHEP/Geometry/Transform3D.h"
17 #include "CLHEP/Units/GlobalSystemOfUnits.h"
18 
20  parameterSet_(par) {}
21 
23  const EcalRecHitCollection *hits,
26 {
27  Calculate_TopEnergy(passedCluster,hits);
28  Calculate_2ndEnergy(passedCluster,hits);
29  Create_Map(hits,topology);
39  Calculate_Covariances(passedCluster,hits,geometry);
40  Calculate_BarrelBasketEnergyFraction(passedCluster,hits, Eta, geometry);
41  Calculate_BarrelBasketEnergyFraction(passedCluster,hits, Phi, geometry);
42  Calculate_EnergyDepTopology (passedCluster,hits,geometry,true) ;
43  Calculate_lat(passedCluster);
44  Calculate_ComplexZernikeMoments(passedCluster);
45 
51 }
52 
54 {
55  double eMax=0;
56  DetId eMaxId(0);
57 
58  const std::vector< std::pair<DetId, float> >& clusterDetIds = passedCluster.hitsAndFractions();
59 
60  EcalRecHit testEcalRecHit;
61 
62  for(auto const& posCurrent : clusterDetIds)
63  {
64  if ((posCurrent.first != DetId(0)) && (hits->find(posCurrent.first) != hits->end()))
65  {
66  EcalRecHitCollection::const_iterator itt = hits->find(posCurrent.first);
67  testEcalRecHit = *itt;
68 
69  if(testEcalRecHit.energy() * posCurrent.second > eMax)
70  {
71  eMax = testEcalRecHit.energy() * posCurrent.second;
72  eMaxId = testEcalRecHit.id();
73  }
74  }
75  }
76 
77  eMax_ = eMax;
78  eMaxId_ = eMaxId;
79 }
80 
82 {
83  double e2nd=0;
84  DetId e2ndId(0);
85 
86  const std::vector< std::pair<DetId, float> >& clusterDetIds = passedCluster.hitsAndFractions();
87 
88  EcalRecHit testEcalRecHit;
89 
90  for(auto const& posCurrent : clusterDetIds)
91  {
92  if (( posCurrent.first != DetId(0)) && (hits->find( posCurrent.first ) != hits->end()))
93  {
94  EcalRecHitCollection::const_iterator itt = hits->find( posCurrent.first );
95  testEcalRecHit = *itt;
96 
97  if(testEcalRecHit.energy() * posCurrent.second > e2nd && testEcalRecHit.id() != eMaxId_)
98  {
99  e2nd = testEcalRecHit.energy() * posCurrent.second;
100  e2ndId = testEcalRecHit.id();
101  }
102  }
103  }
104 
105  e2nd_ = e2nd;
106  e2ndId_ = e2ndId;
107 }
108 
110 {
111  EcalRecHit tempEcalRecHit;
113 
114  for(int x = 0; x < 5; x++)
115  for(int y = 0; y < 5; y++)
116  {
117  posCurrent.home();
118  posCurrent.offsetBy(-2+x,-2+y);
119 
120  if((*posCurrent != DetId(0)) && (hits->find(*posCurrent) != hits->end()))
121  {
122  EcalRecHitCollection::const_iterator itt = hits->find(*posCurrent);
123  tempEcalRecHit = *itt;
124  energyMap_[y][x] = std::make_pair(tempEcalRecHit.id(),tempEcalRecHit.energy());
125  }
126  else
127  energyMap_[y][x] = std::make_pair(DetId(0), 0);
128  }
129 }
130 
132 {
133  double e2x2Max = 0;
134  double e2x2Test = 0;
135 
136  int deltaX=0, deltaY=0;
137 
138  for(int corner = 0; corner < 4; corner++)
139  {
140  switch(corner)
141  {
142  case 0: deltaX = -1; deltaY = -1; break;
143  case 1: deltaX = -1; deltaY = 1; break;
144  case 2: deltaX = 1; deltaY = -1; break;
145  case 3: deltaX = 1; deltaY = 1; break;
146  }
147 
148  e2x2Test = energyMap_[2][2].second;
149  e2x2Test += energyMap_[2+deltaY][2].second;
150  e2x2Test += energyMap_[2][2+deltaX].second;
151  e2x2Test += energyMap_[2+deltaY][2+deltaX].second;
152 
153  if(e2x2Test > e2x2Max)
154  {
155  e2x2Max = e2x2Test;
156  e2x2_Diagonal_X_ = 2+deltaX;
157  e2x2_Diagonal_Y_ = 2+deltaY;
158  }
159  }
160 
161  e2x2_ = e2x2Max;
162 
163 }
164 
166 {
167  double e3x2 = 0.0;
168  double e3x2Ratio = 0.0, e3x2RatioNumerator = 0.0, e3x2RatioDenominator = 0.0;
169 
170  int e2ndX = 2, e2ndY = 2;
171  int deltaY = 0, deltaX = 0;
172 
173  double nextEnergy = -999;
174  int nextEneryDirection = -1;
175 
176  for(int cardinalDirection = 0; cardinalDirection < 4; cardinalDirection++)
177  {
178  switch(cardinalDirection)
179  {
180  case 0: deltaX = -1; deltaY = 0; break;
181  case 1: deltaX = 1; deltaY = 0; break;
182  case 2: deltaX = 0; deltaY = -1; break;
183  case 3: deltaX = 0; deltaY = 1; break;
184  }
185 
186  if(energyMap_[2+deltaY][2+deltaX].second >= nextEnergy)
187  {
188  nextEnergy = energyMap_[2+deltaY][2+deltaX].second;
189  nextEneryDirection = cardinalDirection;
190 
191  e2ndX = 2+deltaX;
192  e2ndY = 2+deltaY;
193  }
194  }
195 
196  switch(nextEneryDirection)
197  {
198  case 0: ;
199  case 1: deltaX = 0; deltaY = 1; break;
200  case 2: ;
201  case 3: deltaX = 1; deltaY = 0; break;
202  }
203 
204  for(int sign = -1; sign <= 1; sign++)
205  e3x2 += (energyMap_[2+deltaY*sign][2+deltaX*sign].second + energyMap_[e2ndY+deltaY*sign][e2ndX+deltaX*sign].second);
206 
207  e3x2RatioNumerator = energyMap_[e2ndY+deltaY][e2ndX+deltaX].second + energyMap_[e2ndY-deltaY][e2ndX-deltaX].second;
208  e3x2RatioDenominator = 0.5 + energyMap_[2+deltaY][2+deltaX].second + energyMap_[2-deltaY][2-deltaX].second;
209  e3x2Ratio = e3x2RatioNumerator / e3x2RatioDenominator;
210 
211  e3x2_ = e3x2;
212  e3x2Ratio_ = e3x2Ratio;
213 }
214 
216 {
217  double e3x3=0;
218 
219  for(int i = 1; i <= 3; i++)
220  for(int j = 1; j <= 3; j++)
221  e3x3 += energyMap_[j][i].second;
222 
223  e3x3_ = e3x3;
224 
225 }
226 
228 {
229  double e4x4=0;
230 
231  int startX=-1, startY=-1;
232 
233  switch(e2x2_Diagonal_X_)
234  {
235  case 1: startX = 0; break;
236  case 3: startX = 1; break;
237  }
238 
239  switch(e2x2_Diagonal_Y_)
240  {
241  case 1: startY = 0; break;
242  case 3: startY = 1; break;
243  }
244 
245  for(int i = startX; i <= startX+3; i++)
246  for(int j = startY; j <= startY+3; j++)
247  e4x4 += energyMap_[j][i].second;
248 
249  e4x4_ = e4x4;
250 }
251 
253 {
254  double e5x5=0;
255 
256  for(int i = 0; i <= 4; i++)
257  for(int j = 0; j <= 4; j++)
258  e5x5 += energyMap_[j][i].second;
259 
260  e5x5_ = e5x5;
261 
262 }
263 
265 {
266 double e2x5R=0.0;
267  for(int i = 0; i <= 4; i++){
268  for(int j = 0; j <= 4; j++){
269  if(j>2){e2x5R +=energyMap_[i][j].second;}
270  }
271  }
272  e2x5Right_=e2x5R;
273 }
274 
276 {
277 double e2x5L=0.0;
278  for(int i = 0; i <= 4; i++){
279  for(int j = 0; j <= 4; j++){
280  if(j<2){e2x5L +=energyMap_[i][j].second;}
281  }
282  }
283  e2x5Left_=e2x5L;
284 }
285 
287 {
288 double e2x5B=0.0;
289  for(int i = 0; i <= 4; i++){
290  for(int j = 0; j <= 4; j++){
291 
292  if(i>2){e2x5B +=energyMap_[i][j].second;}
293  }
294  }
295  e2x5Bottom_=e2x5B;
296 }
297 
299 {
300 double e2x5T=0.0;
301  for(int i = 0; i <= 4; i++){
302  for(int j = 0; j <= 4; j++){
303 
304  if(i<2){e2x5T +=energyMap_[i][j].second;}
305  }
306  }
307  e2x5Top_=e2x5T;
308 }
309 
312 {
313  if (e5x5_ > 0.)
314  {
315  double w0_ = parameterSet_.getParameter<double>("W0");
316 
317 
318  // first find energy-weighted mean position - doing it when filling the energy map might save time
319  math::XYZVector meanPosition(0.0, 0.0, 0.0);
320  for (int i = 0; i < 5; ++i)
321  {
322  for (int j = 0; j < 5; ++j)
323  {
324  DetId id = energyMap_[i][j].first;
325  if (id != DetId(0))
326  {
327  GlobalPoint positionGP = geometry->getGeometry(id)->getPosition();
328  math::XYZVector position(positionGP.x(),positionGP.y(),positionGP.z());
329  meanPosition = meanPosition + energyMap_[i][j].second * position;
330  }
331  }
332  }
333 
334  meanPosition /= e5x5_;
335 
336  // now we can calculate the covariances
337  double numeratorEtaEta = 0;
338  double numeratorEtaPhi = 0;
339  double numeratorPhiPhi = 0;
340  double denominator = 0;
341 
342  for (int i = 0; i < 5; ++i)
343  {
344  for (int j = 0; j < 5; ++j)
345  {
346  DetId id = energyMap_[i][j].first;
347  if (id != DetId(0))
348  {
349  GlobalPoint position = geometry->getGeometry(id)->getPosition();
350 
351  double dPhi = position.phi() - meanPosition.phi();
352  if (dPhi > + Geom::pi()) { dPhi = Geom::twoPi() - dPhi; }
353  if (dPhi < - Geom::pi()) { dPhi = Geom::twoPi() + dPhi; }
354 
355  double dEta = position.eta() - meanPosition.eta();
356  double w = 0.;
357  if ( energyMap_[i][j].second > 0.)
358  w = std::max(0.0, w0_ + log( energyMap_[i][j].second / e5x5_));
359 
360  denominator += w;
361  numeratorEtaEta += w * dEta * dEta;
362  numeratorEtaPhi += w * dEta * dPhi;
363  numeratorPhiPhi += w * dPhi * dPhi;
364  }
365  }
366  }
367 
368  covEtaEta_ = numeratorEtaEta / denominator;
369  covEtaPhi_ = numeratorEtaPhi / denominator;
370  covPhiPhi_ = numeratorPhiPhi / denominator;
371  }
372  else
373  {
374  // Warn the user if there was no energy in the cells and return zeroes.
375  // std::cout << "\ClusterShapeAlgo::Calculate_Covariances: no energy in supplied cells.\n";
376  covEtaEta_ = 0;
377  covEtaPhi_ = 0;
378  covPhiPhi_ = 0;
379  }
380 }
381 
383  const EcalRecHitCollection *hits,
384  const int EtaPhi,
386 {
387  if( (hits!=nullptr) && ( ((*hits)[0]).id().subdetId() != EcalBarrel ) ) {
388  //std::cout << "No basket correction for endacap!" << std::endl;
389  return;
390  }
391 
392  std::map<int,double> indexedBasketEnergy;
393  const std::vector< std::pair<DetId, float> >& clusterDetIds = passedCluster.hitsAndFractions();
394  const EcalBarrelGeometry* subDetGeometry = (const EcalBarrelGeometry*) geometry;
395 
396  for(auto const& posCurrent : clusterDetIds)
397  {
398  int basketIndex = 999;
399 
400  if(EtaPhi == Eta) {
401  int unsignedIEta = abs(EBDetId( posCurrent.first ).ieta());
402  std::vector<int> etaBasketSize = subDetGeometry->getEtaBaskets();
403 
404  for(unsigned int i = 0; i < etaBasketSize.size(); i++) {
405  unsignedIEta -= etaBasketSize[i];
406  if(unsignedIEta - 1 < 0)
407  {
408  basketIndex = i;
409  break;
410  }
411  }
412  basketIndex = (basketIndex+1)*(EBDetId( posCurrent.first ).ieta() > 0 ? 1 : -1);
413 
414  } else if(EtaPhi == Phi) {
415  int halfNumBasketInPhi = (EBDetId::MAX_IPHI - EBDetId::MIN_IPHI + 1)/subDetGeometry->getBasketSizeInPhi()/2;
416 
417  basketIndex = (EBDetId( posCurrent.first ).iphi() - 1)/subDetGeometry->getBasketSizeInPhi()
418  - (EBDetId( (clusterDetIds[0]).first ).iphi() - 1)/subDetGeometry->getBasketSizeInPhi();
419 
420  if(basketIndex >= halfNumBasketInPhi) basketIndex -= 2*halfNumBasketInPhi;
421  else if(basketIndex < -1*halfNumBasketInPhi) basketIndex += 2*halfNumBasketInPhi;
422 
423  } else throw(std::runtime_error("\n\nOh No! Calculate_BarrelBasketEnergyFraction called on invalid index.\n\n"));
424 
425  indexedBasketEnergy[basketIndex] += (hits->find( posCurrent.first ))->energy();
426  }
427 
428  std::vector<double> energyFraction;
429  for(std::map<int,double>::iterator posCurrent = indexedBasketEnergy.begin(); posCurrent != indexedBasketEnergy.end(); posCurrent++)
430  {
431  energyFraction.push_back(indexedBasketEnergy[posCurrent->first]/passedCluster.energy());
432  }
433 
434  switch(EtaPhi)
435  {
436  case Eta: energyBasketFractionEta_ = energyFraction; break;
437  case Phi: energyBasketFractionPhi_ = energyFraction; break;
438  }
439 
440 }
441 
443 
444  double r,redmoment=0;
445  double phiRedmoment = 0 ;
446  double etaRedmoment = 0 ;
447  int n,n1,n2,tmp;
448  int clusterSize=energyDistribution_.size();
449  if (clusterSize<3) {
450  etaLat_ = 0.0 ;
451  lat_ = 0.0;
452  return;
453  }
454 
455  n1=0; n2=1;
456  if (energyDistribution_[1].deposited_energy >
457  energyDistribution_[0].deposited_energy)
458  {
459  tmp=n2; n2=n1; n1=tmp;
460  }
461  for (int i=2; i<clusterSize; i++) {
462  n=i;
463  if (energyDistribution_[i].deposited_energy >
464  energyDistribution_[n1].deposited_energy)
465  {
466  tmp = n2;
467  n2 = n1; n1 = i; n=tmp;
468  } else {
469  if (energyDistribution_[i].deposited_energy >
470  energyDistribution_[n2].deposited_energy)
471  {
472  tmp=n2; n2=i; n=tmp;
473  }
474  }
475 
476  r = energyDistribution_[n].r;
477  redmoment += r*r* energyDistribution_[n].deposited_energy;
478  double rphi = r * cos (energyDistribution_[n].phi) ;
479  phiRedmoment += rphi * rphi * energyDistribution_[n].deposited_energy;
480  double reta = r * sin (energyDistribution_[n].phi) ;
481  etaRedmoment += reta * reta * energyDistribution_[n].deposited_energy;
482  }
483  double e1 = energyDistribution_[n1].deposited_energy;
484  double e2 = energyDistribution_[n2].deposited_energy;
485 
486  lat_ = redmoment/(redmoment+2.19*2.19*(e1+e2));
487  phiLat_ = phiRedmoment/(phiRedmoment+2.19*2.19*(e1+e2));
488  etaLat_ = etaRedmoment/(etaRedmoment+2.19*2.19*(e1+e2));
489 }
490 
492  // Calculate only the moments which go into the default cluster shape
493  // (moments with m>=2 are the only sensitive to azimuthal shape)
494  A20_ = absZernikeMoment(passedCluster,2,0);
495  A42_ = absZernikeMoment(passedCluster,4,2);
496 }
497 
499  int n, int m, double R0) {
500  // 1. Check if n,m are correctly
501  if ((m>n) || ((n-m)%2 != 0) || (n<0) || (m<0)) return -1;
502 
503  // 2. Check if n,R0 are within validity Range :
504  // n>20 or R0<2.19cm just makes no sense !
505  if ((n>20) || (R0<=2.19)) return -1;
506  if (n<=5) return fast_AbsZernikeMoment(passedCluster,n,m,R0);
507  else return calc_AbsZernikeMoment(passedCluster,n,m,R0);
508 }
509 
510 double ClusterShapeAlgo::f00(double r) { return 1; }
511 
512 double ClusterShapeAlgo::f11(double r) { return r; }
513 
514 double ClusterShapeAlgo::f20(double r) { return 2.0*r*r-1.0; }
515 
516 double ClusterShapeAlgo::f22(double r) { return r*r; }
517 
518 double ClusterShapeAlgo::f31(double r) { return 3.0*r*r*r - 2.0*r; }
519 
520 double ClusterShapeAlgo::f33(double r) { return r*r*r; }
521 
522 double ClusterShapeAlgo::f40(double r) { return 6.0*r*r*r*r-6.0*r*r+1.0; }
523 
524 double ClusterShapeAlgo::f42(double r) { return 4.0*r*r*r*r-3.0*r*r; }
525 
526 double ClusterShapeAlgo::f44(double r) { return r*r*r*r; }
527 
528 double ClusterShapeAlgo::f51(double r) { return 10.0*pow(r,5)-12.0*pow(r,3)+3.0*r; }
529 
530 double ClusterShapeAlgo::f53(double r) { return 5.0*pow(r,5) - 4.0*pow(r,3); }
531 
532 double ClusterShapeAlgo::f55(double r) { return pow(r,5); }
533 
535  int n, int m, double R0) {
536  double r,ph,e,Re=0,Im=0,result;
537  double TotalEnergy = passedCluster.energy();
538  int index = (n/2)*(n/2)+(n/2)+m;
539  int clusterSize=energyDistribution_.size();
540  if(clusterSize<3) return 0.0;
541 
542  for (int i=0; i<clusterSize; i++)
543  {
544  r = energyDistribution_[i].r / R0;
545  if (r<1) {
546  fcn_.clear();
548  ph = (energyDistribution_[i]).phi;
549  e = energyDistribution_[i].deposited_energy;
550  Re = Re + e/TotalEnergy * fcn_[index] * cos( (double) m * ph);
551  Im = Im - e/TotalEnergy * fcn_[index] * sin( (double) m * ph);
552  }
553  }
554  result = sqrt(Re*Re+Im*Im);
555 
556  return result;
557 }
558 
560  int n, int m, double R0) {
561  double r,ph,e,Re=0,Im=0,f_nm,result;
562  double TotalEnergy = passedCluster.energy();
563  std::vector< std::pair<DetId, float> > clusterDetIds = passedCluster.hitsAndFractions();
564  int clusterSize=energyDistribution_.size();
565  if(clusterSize<3) return 0.0;
566 
567  for (int i=0; i<clusterSize; i++)
568  {
569  r = energyDistribution_[i].r / R0;
570  if (r<1) {
571  ph = (energyDistribution_[i]).phi;
572  e = energyDistribution_[i].deposited_energy;
573  f_nm=0;
574  for (int s=0; s<=(n-m)/2; s++) {
575  if (s%2==0)
576  {
577  f_nm = f_nm + factorial(n-s)*pow(r,(double) (n-2*s))/(factorial(s)*factorial((n+m)/2-s)*factorial((n-m)/2-s));
578  }else {
579  f_nm = f_nm - factorial(n-s)*pow(r,(double) (n-2*s))/(factorial(s)*factorial((n+m)/2-s)*factorial((n-m)/2-s));
580  }
581  }
582  Re = Re + e/TotalEnergy * f_nm * cos( (double) m*ph);
583  Im = Im - e/TotalEnergy * f_nm * sin( (double) m*ph);
584  }
585  }
586  result = sqrt(Re*Re+Im*Im);
587 
588  return result;
589 }
590 
592  const EcalRecHitCollection *hits,
594  bool logW) {
595  // resets the energy distribution
596  energyDistribution_.clear();
597 
598  // init a map of the energy deposition centered on the
599  // cluster centroid. This is for momenta calculation only.
600  CLHEP::Hep3Vector clVect(passedCluster.position().x(),
601  passedCluster.position().y(),
602  passedCluster.position().z());
603  CLHEP::Hep3Vector clDir(clVect);
604  clDir*=1.0/clDir.mag();
605  // in the transverse plane, axis perpendicular to clusterDir
606  CLHEP::Hep3Vector theta_axis(clDir.y(),-clDir.x(),0.0);
607  theta_axis *= 1.0/theta_axis.mag();
608  CLHEP::Hep3Vector phi_axis = theta_axis.cross(clDir);
609 
610  const std::vector< std::pair<DetId, float> >& clusterDetIds = passedCluster.hitsAndFractions();
611 
613  EcalRecHit testEcalRecHit;
614  // loop over crystals
615  for(auto const& posCurrent : clusterDetIds) {
616  EcalRecHitCollection::const_iterator itt = hits->find( posCurrent.first );
617  testEcalRecHit=*itt;
618 
619  if(( posCurrent.first != DetId(0)) && (hits->find( posCurrent.first ) != hits->end())) {
620  clEdep.deposited_energy = testEcalRecHit.energy();
621 
622  // if logarithmic weight is requested, apply cut on minimum energy of the recHit
623  if(logW) {
624  double w0_ = parameterSet_.getParameter<double>("W0");
625 
626  if ( clEdep.deposited_energy == 0 ) {
627  LogDebug("ClusterShapeAlgo") << "Crystal has zero energy; skipping... ";
628  continue;
629  }
630  double weight = std::max(0.0, w0_ + log(fabs(clEdep.deposited_energy)/passedCluster.energy()) );
631  if(weight==0) {
632  LogDebug("ClusterShapeAlgo") << "Crystal has insufficient energy: E = "
633  << clEdep.deposited_energy << " GeV; skipping... ";
634  continue;
635  }
636  else LogDebug("ClusterShapeAlgo") << "===> got crystal. Energy = " << clEdep.deposited_energy << " GeV. ";
637  }
638  DetId id_ = posCurrent.first;
639  const CaloCellGeometry *this_cell = geometry->getGeometry(id_);
640  GlobalPoint cellPos = this_cell->getPosition();
641  CLHEP::Hep3Vector gblPos (cellPos.x(),cellPos.y(),cellPos.z()); //surface position?
642  // Evaluate the distance from the cluster centroid
643  CLHEP::Hep3Vector diff = gblPos - clVect;
644  // Important: for the moment calculation, only the "lateral distance" is important
645  // "lateral distance" r_i = distance of the digi position from the axis Origin-Cluster Center
646  // ---> subtract the projection on clDir
647  CLHEP::Hep3Vector DigiVect = diff - diff.dot(clDir)*clDir;
648  clEdep.r = DigiVect.mag();
649  LogDebug("ClusterShapeAlgo") << "E = " << clEdep.deposited_energy
650  << "\tdiff = " << diff.mag()
651  << "\tr = " << clEdep.r;
652  clEdep.phi = DigiVect.angle(theta_axis);
653  if(DigiVect.dot(phi_axis)<0) clEdep.phi = 2*M_PI - clEdep.phi;
654  energyDistribution_.push_back(clEdep);
655  }
656  }
657 }
658 
660  fcn_.push_back(f00(rho));
661  fcn_.push_back(f11(rho));
662  fcn_.push_back(f20(rho));
663  fcn_.push_back(f31(rho));
664  fcn_.push_back(f22(rho));
665  fcn_.push_back(f33(rho));
666  fcn_.push_back(f40(rho));
667  fcn_.push_back(f51(rho));
668  fcn_.push_back(f42(rho));
669  fcn_.push_back(f53(rho));
670  fcn_.push_back(f44(rho));
671  fcn_.push_back(f55(rho));
672 }
673 
674 double ClusterShapeAlgo::factorial(int n) const {
675  double res=1.0;
676  for(int i=2; i<=n; i++) res*=(double) i;
677  return res;
678 }
#define LogDebug(id)
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
static const int MIN_IPHI
Definition: EBDetId.h:142
double f20(double r)
void Create_Map(const EcalRecHitCollection *hits, const CaloSubdetectorTopology *topology)
const double w
Definition: UKUtility.cc:23
double fast_AbsZernikeMoment(const reco::BasicCluster &passedCluster, int n, int m, double R0)
std::vector< double > fcn_
CaloTopology const * topology(0)
std::vector< EcalClusterEnergyDeposition > energyDistribution_
edm::ParameterSet parameterSet_
double f00(double r)
double f44(double r)
double sign(double x)
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
void Calculate_BarrelBasketEnergyFraction(const reco::BasicCluster &passedCluster, const EcalRecHitCollection *hits, const int EtaPhi, const CaloSubdetectorGeometry *geometry)
std::vector< EcalRecHit >::const_iterator const_iterator
T y() const
Definition: PV3DBase.h:63
double calc_AbsZernikeMoment(const reco::BasicCluster &passedCluster, int n, int m, double R0)
std::pair< DetId, double > energyMap_[5][5]
double factorial(int n) const
double f31(double r)
double absZernikeMoment(const reco::BasicCluster &passedCluster, int n, int m, double R0=6.6)
double f55(double r)
list diff
Definition: mps_update.py:85
virtual const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
tuple result
Definition: mps_fire.py:83
int iphi() const
get the crystal iphi
Definition: EBDetId.h:53
U second(std::pair< T, U > const &p)
T offsetBy(int deltaX, int deltaY) const
Free movement of arbitray steps.
Definition: CaloNavigator.h:80
reco::ClusterShape Calculate(const reco::BasicCluster &passedCluster, const EcalRecHitCollection *hits, const CaloSubdetectorGeometry *geometry, const CaloSubdetectorTopology *topology)
list denominator
Definition: cuy.py:484
void Calculate_Covariances(const reco::BasicCluster &passedCluster, const EcalRecHitCollection *hits, const CaloSubdetectorGeometry *geometry)
double f42(double r)
double dPhi(double phi1, double phi2)
Definition: JetUtil.h:30
T sqrt(T t)
Definition: SSEVec.h:18
T phi() const
Definition: Phi.h:41
T z() const
Definition: PV3DBase.h:64
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
void Calculate_EnergyDepTopology(const reco::BasicCluster &passedCluster, const EcalRecHitCollection *hits, const CaloSubdetectorGeometry *geometry, bool logW=true)
double f40(double r)
double f33(double r)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int j
Definition: DBlmapReader.cc:9
float energy() const
Definition: EcalRecHit.h:68
void Calculate_TopEnergy(const reco::BasicCluster &passedCluster, const EcalRecHitCollection *hits)
int ieta() const
get the crystal ieta
Definition: EBDetId.h:51
#define M_PI
const_iterator end() const
void Calculate_Polynomials(double rho)
double f11(double r)
Float e1
Definition: deltaR.h:20
void home() const
move the navigator back to the starting point
Definition: DetId.h:18
double f51(double r)
static const int MAX_IPHI
Definition: EBDetId.h:144
DetId id() const
get the id
Definition: EcalRecHit.h:76
std::vector< double > energyBasketFractionPhi_
void Calculate_ComplexZernikeMoments(const reco::BasicCluster &passedCluster)
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:30
const std::vector< int > & getEtaBaskets() const
int getBasketSizeInPhi() const
double f22(double r)
Float e2
Definition: deltaR.h:21
T eta() const
Definition: PV3DBase.h:76
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
void Calculate_lat(const reco::BasicCluster &passedCluster)
ESHandle< TrackerGeometry > geometry
iterator find(key_type k)
double pi()
Definition: Pi.h:31
static int position[264][3]
Definition: ReadPGInfo.cc:509
double twoPi()
Definition: Pi.h:32
std::vector< double > energyBasketFractionEta_
const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
T x() const
Definition: PV3DBase.h:62
double f53(double r)
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
void Calculate_2ndEnergy(const reco::BasicCluster &passedCluster, const EcalRecHitCollection *hits)