Changeset 7438 for trunk/MagicSoft/Mars/mgui
- Timestamp:
- 12/01/05 16:43:46 (19 years ago)
- Location:
- trunk/MagicSoft/Mars/mgui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mgui/MCamEvent.cc
r7349 r7438 62 62 Double_t MCamEvent::GetCameraMean(const MGeomCam &cam, Int_t type) const 63 63 { 64 return GetCameraStat(cam, type)[0]; 65 /* 64 66 Int_t num = 0; 65 67 Double_t mean = 0; … … 74 76 } 75 77 return num == 0 ? 0 : mean/num; 78 */ 76 79 } 80 81 // -------------------------------------------------------------------------- 82 // 83 // Return the rms of all corresponding GetPixelContent 84 // 85 Double_t MCamEvent::GetCameraRMS(const MGeomCam &cam, Int_t type) const 86 { 87 return GetCameraStat(cam, type)[1]; 88 /* 89 Int_t num = 0; 90 Double_t sum = 0; 91 Double_t sq = 0; 92 93 for (unsigned int i=0; i<cam.GetNumPixels(); i++) 94 { 95 Double_t val; 96 if (!GetPixelContent(val, i, cam, type)) 97 continue; 98 99 sum += val; 100 sq += val; 101 num ++; 102 } 103 104 if (num==0) 105 return 0; 106 107 sum /= num; 108 sq /= num; 109 110 return TMath::Sqrt(sq-sum*sum); 111 */ 112 } 113 114 // -------------------------------------------------------------------------- 115 // 116 // Return the rms of all corresponding GetPixelContent 117 // 118 TArrayD MCamEvent::GetCameraStat(const MGeomCam &cam, Int_t type) const 119 { 120 Int_t num = 0; 121 Double_t sum = 0; 122 Double_t sq = 0; 123 124 for (unsigned int i=0; i<cam.GetNumPixels(); i++) 125 { 126 Double_t val; 127 if (!GetPixelContent(val, i, cam, type)) 128 continue; 129 130 sum += val; 131 sq += val; 132 num ++; 133 } 134 135 if (num==0) 136 return 0; 137 138 sum /= num; 139 sq /= num; 140 141 TArrayD stat(2); 142 stat[0] = sum; 143 stat[1] = TMath::Sqrt(sq-sum*sum); 144 return stat; 145 } -
trunk/MagicSoft/Mars/mgui/MCamEvent.h
r7349 r7438 2 2 #define MARS_MCamEvent 3 3 4 #ifndef ROOT_T ROOT5 #include <T ROOT.h>4 #ifndef ROOT_TArrayD 5 #include <TArrayD.h> 6 6 #endif 7 7 … … 18 18 19 19 virtual Double_t GetCameraMean(const MGeomCam &cam, Int_t type=0) const; 20 virtual Double_t GetCameraRMS(const MGeomCam &cam, Int_t type=0) const; 21 virtual TArrayD GetCameraStat(const MGeomCam &cam, Int_t type=0) const; 20 22 21 23 ClassDef(MCamEvent, 0) // A camera event
Note:
See TracChangeset
for help on using the changeset viewer.