Changeset 4444 for trunk/MagicSoft
- Timestamp:
- 08/03/04 16:39:27 (20 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r4443 r4444 19 19 20 20 -*-*- END OF LINE -*-*- 21 2004/08/03: Hendrik Bartko 22 23 * manalysis/MCameraData.[h,cc] 24 - Added new function CalcCleaningLevel2 to take into account that 25 the pedestal RMS does not scale with the inverse square root of 26 the pixel area for the calculation of the cleaning levels. 27 - Added new function CalcCleaningLevelDemocratic. If calculates 28 the cleaning levels for the democratic image cleaning directly 29 from the average values of MPedPhotCam instead of using 30 MSigmabar. 31 32 21 33 22 34 2004/08/03: Thomas Bretz -
trunk/MagicSoft/Mars/manalysis/MCameraData.cc
r2781 r4444 17 17 ! 18 18 ! Author(s): Thomas Bretz, 10/2003 <mailto:tbretz@astro.uni-wuerzburg.de> 19 ! Hendrik Bartko, 08/2004 <mailto:hbartko@mppmu.mpg.de> 19 20 ! 20 21 ! Copyright: MAGIC Software Development, 2000-2003 … … 34 35 35 36 #include "MGeomCam.h" 37 #include "MGeomPix.h" 36 38 37 39 #include "MLog.h" … … 57 59 } 58 60 61 /* 59 62 // -------------------------------------------------------------------------- 60 63 // 61 64 // This is not yet implemented like it should. 62 65 // 63 /* 66 64 67 void MCameraData::Draw(Option_t* option) 65 68 { … … 76 79 } 77 80 */ 81 82 83 // -------------------------------------------------------------------------- 84 // 85 // Function to calculate the cleaning level for all pixels in a given event 86 // as the ratio between the measured photons and the pedestal rms. 87 // In order to do the image cleaning on average in the same photon flux 88 // (reconstructed photons per pixel area) for the inner and outer pixels, 89 // a correction factor is applied to the outer pixels (see TDAS 02-14). 90 // The correction factor assumes the ideal case that the pedestal rms 91 // scales with the inverse square root of the pixel area. 92 // 78 93 79 94 void MCameraData::CalcCleaningLevel(const MCerPhotEvt &evt, const MPedPhotCam &cam, … … 113 128 } 114 129 130 // -------------------------------------------------------------------------- 131 // 132 // Function to calculate the cleaning level for all pixels in a given event 133 // as the ratio between the measured photons and the pedestal rms. 134 // In order to do the image cleaning on average in the same photon flux 135 // (reconstructed photons per pixel area) for the inner and outer pixels, 136 // a correction factor is applied to the outer pixels (see TDAS 02-14). 137 // The correction factor takes the actual average pedestal RMS of the 138 // inner and outer pixels into account. 139 // 140 141 void MCameraData::CalcCleaningLevel2(const MCerPhotEvt &evt, const MPedPhotCam &cam, 142 const MGeomCam &geom) 143 { 144 const Int_t n = geom.GetNumPixels(); 145 146 fData.Set(n); 147 fData.Reset(); 148 149 fValidity.Set(n); 150 fValidity.Reset(); 151 152 const Int_t entries = evt.GetNumPixels(); 153 154 const Float_t meannoise[2] = {cam.GetArea(0).GetRms(), cam.GetArea(1).GetRms()} ; // mean noise for the inner and the outer pixels 155 156 // 157 // check the number of all pixels against the noise level and 158 // set them to 'unused' state if necessary 159 // 160 for (Int_t i=0; i<entries; i++) 161 { 162 const MCerPhotPix &pix = evt[i]; 163 164 const Int_t idx = pix.GetPixId(); 165 const Float_t noise = cam[idx].GetRms(); 166 167 if (noise<=0) // fData[idx]=0, fValidity[idx]=0 168 continue; 169 170 // 171 // We calculate a correction factor which accounts for the 172 // fact that pixels have different size (see TDAS 02-14). 173 // We also take into account that the RMS does not scale 174 // with the square root of the pixel area. 175 // 176 177 const UInt_t aidx = geom[idx].GetAidx(); 178 179 180 if (meannoise[0] > 0 && meannoise[1] > 0) 181 { 182 fData[idx] = pix.GetNumPhotons() * geom.GetPixRatio(idx) * meannoise[aidx] / meannoise[0] / noise; 183 184 } 185 else fData[idx] = pix.GetNumPhotons() * geom.GetPixRatioSqrt(idx) / noise; 186 187 fValidity[idx] = 1; 188 } 189 } 190 191 115 192 void MCameraData::CalcCleaningLevel(const MCerPhotEvt &evt, const MSigmabar &sgb, 116 193 const MGeomCam &geom) … … 154 231 } 155 232 233 234 // -------------------------------------------------------------------------- 235 // 236 // Function to calculate the cleaning level for all pixels in a given event 237 // as the ratio between the reconstructed number of photons per area of an 238 // inner pixel and the average pedestal RMS of the inner pixels (democratic 239 // image cleaning, see TDAS 02-14). 240 241 242 void MCameraData::CalcCleaningLevelDemocratic(const MCerPhotEvt &evt, const MPedPhotCam &cam, 243 const MGeomCam &geom) 244 { 245 const Int_t n = geom.GetNumPixels(); 246 247 fData.Set(n); 248 fData.Reset(); 249 250 fValidity.Set(n); 251 fValidity.Reset(); 252 253 const Int_t entries = evt.GetNumPixels(); 254 255 const Float_t meannoise[2] = {cam.GetArea(0).GetRms(), cam.GetArea(1).GetRms()} ; // mean noise for the inner and the outer pixels 256 257 258 // 259 // check the number of all pixels against the noise level and 260 // set them to 'unused' state if necessary 261 // 262 for (Int_t i=0; i<entries; i++) 263 { 264 const MCerPhotPix &pix = evt[i]; 265 266 const Int_t idx = pix.GetPixId(); 267 const Float_t noise = cam[idx].GetRms(); 268 269 if (noise<=0) 270 continue; 271 272 // 273 // We calculate a correction factor which accounts for the 274 // fact that pixels have different size (see TDAS 02-14). 275 // 276 277 278 if (meannoise[0]>0) // fData[idx]=0, fValidity[idx]=0 279 { 280 fData[idx] = pix.GetNumPhotons() * geom.GetPixRatio(idx) / meannoise[0]; 281 fValidity[idx] = 1; 282 } 283 else 284 fValidity[idx] = 0; 285 } 286 287 } 288 289 290 156 291 // -------------------------------------------------------------------------- 157 292 // -
trunk/MagicSoft/Mars/manalysis/MCameraData.h
r2958 r4444 38 38 void CalcCleaningLevel(const MCerPhotEvt &evt, Double_t noise, 39 39 const MGeomCam &geom); 40 41 void CalcCleaningLevel2(const MCerPhotEvt &evt, const MPedPhotCam &fCam, 42 const MGeomCam &geom); 43 44 void CalcCleaningLevelDemocratic(const MCerPhotEvt &evt, const MPedPhotCam &cam, 45 const MGeomCam &geom); 46 40 47 /* 41 48 void Calc(const MCerPhotEvt &evt, const MGeomCam &geom)
Note:
See TracChangeset
for help on using the changeset viewer.