Changeset 1540 for trunk/MagicSoft/Mars/manalysis/MPedestalCam.cc
- Timestamp:
- 10/15/02 17:02:46 (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/manalysis/MPedestalCam.cc
r1155 r1540 31 31 ///////////////////////////////////////////////////////////////////////////// 32 32 #include "MPedestalCam.h" 33 #include "MPedestalPix.h" 34 35 #include <TClonesArray.h> 33 36 34 37 #include "MLog.h" 38 #include "MLogManip.h" 39 40 #include "MGeomCam.h" 41 35 42 36 43 ClassImp(MPedestalCam); … … 62 69 // -------------------------------------------------------------------------- 63 70 // 71 // Set the size of the camera 72 // 73 inline void MPedestalCam::InitSize(const UInt_t i) 74 { 75 fArray->ExpandCreate(i); 76 } 77 78 // -------------------------------------------------------------------------- 79 // 80 // Get the size of the MPedestalCam 81 // 82 inline Int_t MPedestalCam::GetSize() const 83 { 84 return fArray->GetEntries(); 85 } 86 87 // -------------------------------------------------------------------------- 88 // 89 // Get i-th pixel (pixel number) 90 // 91 inline MPedestalPix &MPedestalCam::operator[](Int_t i) 92 { 93 return *(MPedestalPix*)fArray->UncheckedAt(i); 94 } 95 96 // -------------------------------------------------------------------------- 97 // 98 // Get i-th pixel (pixel number) 99 // 100 inline MPedestalPix &MPedestalCam::operator[](Int_t i) const 101 { 102 return *(MPedestalPix*)fArray->UncheckedAt(i); 103 } 104 105 // -------------------------------------------------------------------------- 106 // 64 107 // Check if position i is inside bounds 65 108 // … … 69 112 } 70 113 114 void MPedestalCam::Clear(Option_t *o) 115 { 116 fArray->ForEach(TObject, Clear)(); 117 } 71 118 119 void MPedestalCam::Print(Option_t *o="") const 120 { 121 *fLog << all << GetDescriptor() << ":" << endl; 122 int id = 0; 123 124 TIter Next(fArray); 125 MPedestalPix *pix; 126 while ((pix=(MPedestalPix*)Next())) 127 { 128 id++; 129 130 if (!pix->IsValid()) 131 continue; 132 133 *fLog << id-1 << ": "; 134 *fLog << pix->GetMean() << " " << pix->GetSigma() << " "; 135 *fLog << pix->GetMeanRms() << " " << pix->GetSigmaRms() << endl; 136 } 137 } 138 139 Float_t MPedestalCam::GetMeanMin(const MGeomCam *geom) const 140 { 141 if (fArray->GetEntries() <= 0) 142 return 50.; 143 144 Float_t minval = (*this)[0].GetMean(); 145 146 for (Int_t i=1; i<fArray->GetEntries(); i++) 147 { 148 const MPedestalPix &pix = (*this)[i]; 149 150 Float_t testval = pix.GetMean(); 151 152 if (geom) 153 testval *= geom->GetPixRatio(i); 154 155 if (testval < minval) 156 minval = testval; 157 } 158 return minval; 159 } 160 161 Float_t MPedestalCam::GetMeanMax(const MGeomCam *geom) const 162 { 163 if (fArray->GetEntries() <= 0) 164 return 50.; 165 166 Float_t maxval = (*this)[0].GetMean(); 167 168 for (Int_t i=1; i<fArray->GetEntries(); i++) 169 { 170 const MPedestalPix &pix = (*this)[i]; 171 172 Float_t testval = pix.GetMean(); 173 174 if (geom) 175 testval *= geom->GetPixRatio(i); 176 177 if (testval > maxval) 178 maxval = testval; 179 } 180 return maxval; 181 }
Note:
See TracChangeset
for help on using the changeset viewer.