Changeset 1802 for trunk/MagicSoft/Cosy/caos/Ring.cc
- Timestamp:
- 03/02/03 16:55:47 (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Cosy/caos/Ring.cc
r1798 r1802 20 20 if (h1==0) 21 21 { 22 23 22 cout << "h1==0" <<endl; 23 return kFALSE; 24 24 } 25 25 } … … 38 38 } 39 39 40 Float_t w1 = leds(i).GetX() - leds(j).GetX();41 Float_t w2 = leds(j).GetX() - leds(k).GetX();40 const Float_t w1 = leds(i).GetX() - leds(j).GetX(); 41 const Float_t w2 = leds(j).GetX() - leds(k).GetX(); 42 42 43 Float_t m1 = -w1/h1;44 Float_t m2 = -w2/h2;43 const Float_t m1 = -w1/h1; 44 const Float_t m2 = -w2/h2; 45 45 46 46 if (m2-m1==0) 47 47 { 48 cout << " m2-m1==0" << endl;48 cout << "All three points in a row! (m2-m1==0)" << endl; 49 49 return kFALSE; 50 50 } … … 66 66 fR = 0; 67 67 68 fDx=0; 69 fDy=0; 70 fDr=0; 71 72 if (n<1) 73 return; 74 68 75 for (int i=0; i<n; i++) 69 76 { 70 const Ring &ring = *(Ring*)((Rings&)rings)[i];77 const Ring &ring = rings(i); 71 78 72 79 fX += ring.GetX(); … … 79 86 fR /= n; 80 87 88 if (n<2) 89 return; 90 81 91 // 82 92 // deviation of x- and y coordinate and radius 83 93 // 84 Float_t sumx=0;85 Float_t sumy=0;86 Float_t sumr=0;87 88 94 for (int i=0; i<n; i++) 89 95 { 90 const Ring &ring = *(Ring*)((Rings&)rings)[i];96 const Ring &ring = rings(i); 91 97 92 sumx += sqr(ring.GetX()-fX);93 sumy += sqr(ring.GetY()-fY);94 sumr += sqr(ring.GetR()-fR);98 fDx += sqr(ring.GetX()-fX); 99 fDy += sqr(ring.GetY()-fY); 100 fDr += sqr(ring.GetR()-fR); 95 101 } 96 102 97 fDx=sqrt(sumx)/(n-1); 98 fDy=sqrt(sumy)/(n-1); 99 fDr=sqrt(sumr)/(n-1); 100 103 fDx=sqrt(fDx)/(n-1); 104 fDy=sqrt(fDy)/(n-1); 105 fDr=sqrt(fDr)/(n-1); 101 106 } 102 107 108 void Ring::Print(Option_t *o=NULL) const 109 { 110 cout << "Ring: "; 111 cout << "x=" << fX << "+-" << fDx << ", "; 112 cout << "y=" << fY << "+-" << fDy << ", "; 113 cout << "r=" << fR << "+-" << fDr << ", "; 114 cout << "phi=" << fPhi << "+-" << fDphi << endl; 115 } 116
Note:
See TracChangeset
for help on using the changeset viewer.