Changeset 5653 for trunk/MagicSoft/Mars/mcalib
- Timestamp:
- 12/21/04 11:26:01 (20 years ago)
- Location:
- trunk/MagicSoft/Mars/mcalib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mcalib/MCalibrationIntensityChargeCam.cc
r5652 r5653 196 196 const Float_t qerr = pix.GetConvertedMeanErr(); 197 197 // 198 const Float_t phe = apix.GetPheFFactorMethod(); 199 const Float_t err = apix.GetPheFFactorMethodErr(); 200 201 sig[cnt] = q; 202 sigerr[cnt] = qerr; 198 const Float_t phe = apix.GetPheFFactorMethod(); 199 const Float_t pheerr = apix.GetPheFFactorMethodErr(); 200 201 sig[cnt] = phe; 202 sigerr[cnt] = pheerr; 203 204 203 205 phepersig[cnt] = q > 0.00001 ? phe/q : -1.; 204 206 … … 207 209 if (q > 0.00001 && phe > 0.00001) 208 210 { 209 var = err *err / phe / phe + qerr*qerr/q/q;211 var = pheerr * pheerr / phe / phe + qerr*qerr/q/q; 210 212 if (var > 0.00001) 211 213 var = TMath::Sqrt(var)*phepersig[cnt]; … … 220 222 gr->SetTitle(Form("%s%3i","Pixel ",pixid)); 221 223 gr->GetXaxis()->SetTitle("<photo-electrons> [1]"); 222 gr->GetYaxis()->SetTitle("<photo-electrons> / Q [FADC cts^{-1}]"); 224 gr->GetYaxis()->SetTitle("<phes> / <Q> [FADC cts^{-1}]"); 225 return gr; 226 } 227 228 // ------------------------------------------------------------------- 229 // 230 // Returns a TGraphErrors with the mean effective number of photo-electrons divided by 231 // the mean charge of that pixel vs. the mean number of photo-electrons. 232 // 233 TGraphErrors *MCalibrationIntensityChargeCam::GetPhePerChargePerArea( const Int_t aidx, const MGeomCam &geom, const MCalibrationCam::PulserColor_t col) 234 { 235 236 Int_t size = CountNumEntries(col); 237 238 if (size == 0) 239 return NULL; 240 241 TArrayF phepersig(size); 242 TArrayF phepersigerr(size); 243 TArrayF sig(size); 244 TArrayF sigerr(size); 245 246 Int_t cnt = 0; 247 248 for (Int_t i=0;i<GetSize();i++) 249 { 250 // 251 // Get the calibration cam from the intensity cam 252 // 253 MCalibrationChargeCam *cam = (MCalibrationChargeCam*)GetCam(i); 254 255 if (col != MCalibrationCam::kNONE) 256 if (cam->GetPulserColor() != col) 257 continue; 258 // 259 // Get the calibration pix from the calibration cam 260 // 261 const MCalibrationChargePix &apix = (MCalibrationChargePix&)cam->GetAverageArea(aidx); 262 const Float_t phe = apix.GetPheFFactorMethod(); 263 const Float_t pherelvar = apix.GetPheFFactorMethodRelVar(); 264 const Float_t pheerr = apix.GetPheFFactorMethodErr(); 265 266 *fLog << "PHERELVAR: " << pherelvar << endl; 267 268 sig[cnt] = phe; 269 sigerr[cnt] = pheerr; 270 271 Double_t sig = 0.; 272 Double_t sig2 = 0.; 273 Int_t num = 0; 274 275 for (Int_t i=0; i<cam->GetSize(); i++) 276 { 277 const MCalibrationChargePix &pix = (MCalibrationChargePix&)(*cam)[i]; 278 // 279 // Don't use bad pixels 280 // 281 if (!pix.IsFFactorMethodValid()) 282 continue; 283 // 284 // 285 if (aidx != geom[i].GetAidx()) 286 continue; 287 288 sig += pix.GetConvertedMean(); 289 sig2 += pix.GetConvertedMean() * pix.GetConvertedMean(); 290 num++; 291 } 292 293 if (num > 1) 294 { 295 sig /= num; 296 297 Double_t var = (sig2 - sig*sig*num) / (num-1); 298 var /= sig*sig; 299 var += pherelvar; 300 301 phepersig[cnt] = phe/sig; 302 if (var > 0.) 303 phepersigerr[cnt] = TMath::Sqrt(var) * phepersig[cnt]; 304 else 305 phepersigerr[cnt] = 0.; 306 } 307 else 308 { 309 phepersig[cnt] = -1.; 310 phepersigerr[cnt] = 0.; 311 } 312 cnt++; 313 } 314 315 TGraphErrors *gr = new TGraphErrors(size, 316 sig.GetArray(),phepersig.GetArray(), 317 sigerr.GetArray(),phepersigerr.GetArray()); 318 gr->SetTitle(Form("%s%3i","Conv. Factors Area %d Average",aidx)); 319 gr->GetXaxis()->SetTitle("<photo-electrons> [1]"); 320 gr->GetYaxis()->SetTitle("<phes> / <Q> [FADC cts^{-1}]"); 223 321 return gr; 224 322 } … … 235 333 { 236 334 237 const Int_t size = GetSize();335 Int_t size = CountNumEntries(col); 238 336 239 337 TArrayF phe(size); … … 242 340 TArrayF sigerr(size); 243 341 244 for (Int_t i=0;i<size;i++) 342 Int_t cnt = 0; 343 344 for (Int_t i=0;i<GetSize();i++) 245 345 { 246 346 // … … 258 358 MCalibrationChargePix &pix = (MCalibrationChargePix&)(cam->GetAverageArea(aidx)); 259 359 260 phe[ i] = pix.GetPheFFactorMethod();261 pheerr[ i] = pix.GetPheFFactorMethodErr();360 phe[cnt] = pix.GetPheFFactorMethod(); 361 pheerr[cnt] = pix.GetPheFFactorMethodErr(); 262 362 // 263 363 // For the calculation of Q, we have to use the 264 364 // converted value! 265 365 // 266 sig [i] = pix.GetConvertedMean(); 267 sigerr[i] = pix.GetConvertedMeanErr(); 366 sig [cnt] = pix.GetConvertedMean(); 367 sigerr[cnt] = pix.GetConvertedMeanErr(); 368 369 cnt++; 268 370 } 269 371 -
trunk/MagicSoft/Mars/mcalib/MCalibrationIntensityChargeCam.h
r5652 r5653 49 49 TGraphErrors *GetPheVsCharge( const UInt_t pixid, const MCalibrationCam::PulserColor_t col=MCalibrationCam::kNONE); 50 50 TGraphErrors *GetPhePerCharge( const UInt_t pixid, const MGeomCam &geom, const MCalibrationCam::PulserColor_t col=MCalibrationCam::kNONE); 51 TGraphErrors *GetPhePerChargePerArea( const Int_t aidx, const MGeomCam &geom, const MCalibrationCam::PulserColor_t col=MCalibrationCam::kNONE); 51 52 TGraphErrors *GetPheVsChargePerArea( const Int_t aidx, const MCalibrationCam::PulserColor_t col=MCalibrationCam::kNONE); 52 53 TH2F *GetRazmikPlotResults( const Int_t aidx, const MGeomCam &geom );
Note:
See TracChangeset
for help on using the changeset viewer.