- Timestamp:
- 08/17/04 23:38:13 (20 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r4669 r4670 60 60 function of MCalibrationCam 61 61 62 * mcalib/MCalibrationChargeCalc.cc 63 - some changes to the output 64 - call to MCalibrationChargeBlindCam->IsValid() removed 65 62 66 * mbadpixels/MBadPixelsCam.cc 63 67 - included kDeviatingNumPhots in GetPixelContent() … … 68 72 - found that the MFillH for the MHCalibrationChargeBlindCam had 69 73 been replaced to MHCalibrationChargeBlindPix -> redone 74 - adapted InitBlindPixel() to new classes initializing the right 75 MCalibrationChargeBlindCam's 70 76 71 77 * mcalib/MCalibrationTestPix.[h,cc] -
trunk/MagicSoft/Mars/mcalib/MCalibrationCam.cc
r4271 r4670 147 147 { 148 148 149 fPixels->ForEach(TObject, Clear)(); 150 151 // 152 // another ForEach does not compile, thus have to do the loop ourselves: 153 // 154 for (Int_t i=0;i<GetAverageAreas();i++) 155 { 156 fAverageAreas[i].Clear(); 157 fAverageBadAreas[i].Clear(); 158 } 159 160 // 161 // another ForEach does not compile, thus have to do the loop ourselves: 162 // 163 for (Int_t i=0;i<GetAverageSectors();i++) 164 { 165 fAverageSectors[i].Clear(); 166 fAverageBadSectors[i].Clear(); 167 } 149 { fPixels ->ForEach(TObject, Clear)(); } 150 { fAverageAreas ->ForEach(TObject, Clear)(); } 151 { fAverageSectors->ForEach(TObject, Clear)(); } 168 152 169 153 return; … … 366 350 } 367 351 352 // -------------------------------------------------------------------------- 353 // 368 354 // Returns the current size of the TClonesArray fPixels 369 355 // independently if the MCalibrationPix is filled with values or not. 356 // 370 357 const Int_t MCalibrationCam::GetSize() const 371 358 { -
trunk/MagicSoft/Mars/mcalib/MCalibrationChargeBlindPix.cc
r4244 r4670 33 33 // 34 34 // Currently, the following numbers are implemented: 35 // - gkBlindPixelArea: 100 mm^235 // - fArea: 100 mm^2 36 36 // - Average QE of Blind Pixel: 37 // gkBlindPixelQEGreen: 0.15438 // gkBlindPixelQEBlue : 0.22639 // gkBlindPixelQEUV : 0.24740 // gkBlindPixelQECT1 : 0.24737 // fQEGreen: 0.154 38 // fQEBlue : 0.226 39 // fQEUV : 0.247 40 // fQECT1 : 0.247 41 41 // - Average QE Error of Blind Pixel: 42 // gkBlindPixelQEGreenErr: 0.015;43 // gkBlindPixelQEBlueErr : 0.02;44 // gkBlindPixelQEUVErr : 0.02;45 // gkBlindPixelQECT1Err : 0.02;42 // fQEGreenErr: 0.015; 43 // fQEBlueErr : 0.02; 44 // fQEUVErr : 0.02; 45 // fQECT1Err : 0.02; 46 46 // - Attenuation factor Blind Pixel: 47 // gkBlindPixelAttGreen : 1.97;48 // gkBlindPixelAttBlue : 1.96;49 // gkBlindPixelAttUV : 1.95;50 // gkBlindPixelAttCT1 : 1.95;47 // fAttGreen : 1.97; 48 // fAttBlue : 1.96; 49 // fAttUV : 1.95; 50 // fAttCT1 : 1.95; 51 51 // 52 52 // … … 63 63 64 64 using namespace std; 65 const Float_t MCalibrationChargeBlindPix::gkBlindPixelArea = 100; 66 const Float_t MCalibrationChargeBlindPix::gkBlindPixelAttGreen = 1.97; 67 const Float_t MCalibrationChargeBlindPix::gkBlindPixelAttBlue = 1.96; 68 const Float_t MCalibrationChargeBlindPix::gkBlindPixelAttUV = 1.95; 69 const Float_t MCalibrationChargeBlindPix::gkBlindPixelAttCT1 = 1.95; 70 const Float_t MCalibrationChargeBlindPix::gkBlindPixelQEUnCoatedGreen = 0.154; 71 const Float_t MCalibrationChargeBlindPix::gkBlindPixelQEUnCoatedBlue = 0.226; 72 const Float_t MCalibrationChargeBlindPix::gkBlindPixelQEUnCoatedUV = 0.247; 73 const Float_t MCalibrationChargeBlindPix::gkBlindPixelQEUnCoatedCT1 = 0.247; 74 const Float_t MCalibrationChargeBlindPix::gkBlindPixelQEUnCoatedGreenErr = 0.005; 75 const Float_t MCalibrationChargeBlindPix::gkBlindPixelQEUnCoatedBlueErr = 0.007; 76 const Float_t MCalibrationChargeBlindPix::gkBlindPixelQEUnCoatedUVErr = 0.01; 77 const Float_t MCalibrationChargeBlindPix::gkBlindPixelQEUnCoatedCT1Err = 0.01; 78 const Float_t MCalibrationChargeBlindPix::gkBlindPixelQECoatedGreen = 0.192; 79 const Float_t MCalibrationChargeBlindPix::gkBlindPixelQECoatedBlue = 0.27; 80 const Float_t MCalibrationChargeBlindPix::gkBlindPixelQECoatedUV = 0.285; 81 const Float_t MCalibrationChargeBlindPix::gkBlindPixelQECoatedCT1 = 0.285; 82 const Float_t MCalibrationChargeBlindPix::gkBlindPixelQECoatedGreenErr = 0.007; 83 const Float_t MCalibrationChargeBlindPix::gkBlindPixelQECoatedBlueErr = 0.01; 84 const Float_t MCalibrationChargeBlindPix::gkBlindPixelQECoatedUVErr = 0.012; 85 const Float_t MCalibrationChargeBlindPix::gkBlindPixelQECoatedCT1Err = 0.012; 86 const Float_t MCalibrationChargeBlindPix::gkBlindPixelCollectionEff = 0.95; 87 const Float_t MCalibrationChargeBlindPix::gkBlindPixelCollectionEffErr = 0.02; 65 const Float_t MCalibrationChargeBlindPix::fgArea = 100; 66 const Float_t MCalibrationChargeBlindPix::fgAttGreen = 1.97; 67 const Float_t MCalibrationChargeBlindPix::fgAttBlue = 1.96; 68 const Float_t MCalibrationChargeBlindPix::fgAttUV = 1.95; 69 const Float_t MCalibrationChargeBlindPix::fgAttCT1 = 1.95; 70 const Float_t MCalibrationChargeBlindPix::fgAttErr = 0.01; 71 const Float_t MCalibrationChargeBlindPix::fgQEGreen = 0.154; 72 const Float_t MCalibrationChargeBlindPix::fgQEBlue = 0.226; 73 const Float_t MCalibrationChargeBlindPix::fgQEUV = 0.247; 74 const Float_t MCalibrationChargeBlindPix::fgQECT1 = 0.247; 75 const Float_t MCalibrationChargeBlindPix::fgQEErrGreen = 0.005; 76 const Float_t MCalibrationChargeBlindPix::fgQEErrBlue = 0.007; 77 const Float_t MCalibrationChargeBlindPix::fgQEErrUV = 0.01; 78 const Float_t MCalibrationChargeBlindPix::fgQEErrCT1 = 0.01; 79 const Float_t MCalibrationChargeBlindPix::fgCollEffGreen = 0.99; 80 const Float_t MCalibrationChargeBlindPix::fgCollEffBlue = 0.93; 81 const Float_t MCalibrationChargeBlindPix::fgCollEffUV = 0.90; 82 const Float_t MCalibrationChargeBlindPix::fgCollEffCT1 = 0.90; 83 const Float_t MCalibrationChargeBlindPix::fgCollEffErr = 0.05; 88 84 // -------------------------------------------------------------------------- 89 85 // … … 92 88 // Calls: 93 89 // - Clear() 94 // - SetCoated() 90 // 91 // For backward-compatibility reasons, quantum eff., coll. eff. and att. 92 // are intialized from the static members. This should, however, be 93 // overwritten by a class deriving from MCalibrationChargeBlindCam. 95 94 // 96 95 MCalibrationChargeBlindPix::MCalibrationChargeBlindPix(const char *name, const char *title) … … 100 99 fTitle = title ? title : "Container of the fit results of the blind pixel"; 101 100 102 SetCoated();103 101 Clear(); 102 103 fArea = fgArea; 104 105 fAtt .Set( MCalibrationCam::gkNumPulserColors ); 106 fAttErr .Set( MCalibrationCam::gkNumPulserColors ); 107 fQE .Set( MCalibrationCam::gkNumPulserColors ); 108 fQEErr .Set( MCalibrationCam::gkNumPulserColors ); 109 fCollEff .Set( MCalibrationCam::gkNumPulserColors ); 110 fCollEffErr.Set( MCalibrationCam::gkNumPulserColors ); 111 112 SetAtt ( fgAttGreen, MCalibrationCam::kGREEN ); 113 SetAtt ( fgAttBlue, MCalibrationCam::kBLUE ); 114 SetAtt ( fgAttUV , MCalibrationCam::kUV ); 115 SetAtt ( fgAttCT1 , MCalibrationCam::kCT1 ); 116 117 SetAttErr ( fgAttErr , MCalibrationCam::kGREEN ); 118 SetAttErr ( fgAttErr , MCalibrationCam::kBLUE ); 119 SetAttErr ( fgAttErr , MCalibrationCam::kUV ); 120 SetAttErr ( fgAttErr , MCalibrationCam::kCT1 ); 121 122 SetQE ( fgQEGreen, MCalibrationCam::kGREEN ); 123 SetQE ( fgQEBlue, MCalibrationCam::kBLUE ); 124 SetQE ( fgQEUV , MCalibrationCam::kUV ); 125 SetQE ( fgQECT1 , MCalibrationCam::kCT1 ); 126 127 SetQEErr ( fgQEErrGreen, MCalibrationCam::kGREEN ); 128 SetQEErr ( fgQEErrBlue, MCalibrationCam::kBLUE ); 129 SetQEErr ( fgQEErrUV , MCalibrationCam::kUV ); 130 SetQEErr ( fgQEErrCT1 , MCalibrationCam::kCT1 ); 131 132 SetCollEff ( fgCollEffGreen, MCalibrationCam::kGREEN ); 133 SetCollEff ( fgCollEffBlue, MCalibrationCam::kBLUE ); 134 SetCollEff ( fgCollEffUV , MCalibrationCam::kUV ); 135 SetCollEff ( fgCollEffCT1 , MCalibrationCam::kCT1 ); 136 137 SetCollEffErr ( fgCollEffErr, MCalibrationCam::kGREEN ); 138 SetCollEffErr ( fgCollEffErr, MCalibrationCam::kBLUE ); 139 SetCollEffErr ( fgCollEffErr, MCalibrationCam::kUV ); 140 SetCollEffErr ( fgCollEffErr, MCalibrationCam::kCT1 ); 141 104 142 } 105 143 … … 141 179 SetColor(MCalibrationCam::kNONE); 142 180 143 MCalibration ChargePix::Clear();181 MCalibrationPix::Clear(); 144 182 } 145 183 … … 149 187 } 150 188 151 // --------------------------------------------------------------------------152 //153 // Set the Coated Bit from outside154 //155 void MCalibrationChargeBlindPix::SetCoated( const Bool_t b)156 {157 b ? SETBIT(fFlags,kCoated) : CLRBIT(fFlags,kCoated);158 }159 189 160 190 // -------------------------------------------------------------------------- … … 199 229 // Return square root of fFluxInsidePlexiglassVar 200 230 // 201 Float_t MCalibrationChargeBlindPix::GetFluxInsidePlexiglassErr() const231 const Float_t MCalibrationChargeBlindPix::GetFluxInsidePlexiglassErr() const 202 232 { 203 233 if (fFluxInsidePlexiglassVar < 0.) … … 213 243 // Return fFluxInsidePlexiglassVar / fFluxInsidePlexiglass^2 214 244 // 215 Float_t MCalibrationChargeBlindPix::GetFluxInsidePlexiglassRelVar() const245 const Float_t MCalibrationChargeBlindPix::GetFluxInsidePlexiglassRelVar() const 216 246 { 217 247 if (fFluxInsidePlexiglassVar < 0.) … … 229 259 // Return square root of fLambdaVar 230 260 // 231 Float_t MCalibrationChargeBlindPix::GetLambdaErr() const261 const Float_t MCalibrationChargeBlindPix::GetLambdaErr() const 232 262 { 233 263 if (fLambdaVar < 0.) … … 243 273 // Return fLambdaVar / (fLambda * fLambda ) 244 274 // 245 Float_tMCalibrationChargeBlindPix::GetLambdaRelVar() const275 const Float_t MCalibrationChargeBlindPix::GetLambdaRelVar() const 246 276 { 247 277 if (fLambdaVar < 0.) … … 256 286 // -------------------------------------------------------------------------- 257 287 // 258 // Return -1 if gkBlindPixelQEGreenErr is smaller than 0. 259 // Return -1 if gkBlindPixelQEGreen is 0. 260 // Return gkBlindPixelQEGreenErr^2 / (gkBlindPixelQEGreen^2 ) 261 // 262 const Float_t MCalibrationChargeBlindPix::GetBlindPixelQEGreen() const 263 { 264 265 if (IsCoated()) 266 { 267 if (gkBlindPixelQECoatedGreen < 0.) 268 return -1.; 269 270 return gkBlindPixelQECoatedGreen; 271 } 272 else 273 { 274 if (gkBlindPixelQEUnCoatedGreen < 0.) 275 return -1.; 276 277 return gkBlindPixelQEUnCoatedGreen; 278 } 279 280 } 281 282 // -------------------------------------------------------------------------- 283 // 284 // Return -1 if gkBlindPixelQEBlueErr is smaller than 0. 285 // Return -1 if gkBlindPixelQEBlue is 0. 286 // Return gkBlindPixelQEBlueErr^2 / gkBlindPixelQEBlue^2 287 // 288 const Float_t MCalibrationChargeBlindPix::GetBlindPixelQEBlue() const 289 { 290 if (IsCoated()) 291 { 292 if (gkBlindPixelQECoatedBlue < 0.) 293 return -1.; 294 295 return gkBlindPixelQECoatedBlue; 296 } 297 else 298 { 299 if (gkBlindPixelQEUnCoatedBlue < 0.) 300 return -1.; 301 302 return gkBlindPixelQEUnCoatedBlue; 303 } 304 } 305 306 // -------------------------------------------------------------------------- 307 // 308 // Return -1 if gkBlindPixelQEUVErr is smaller than 0. 309 // Return -1 if gkBlindPixelQEUV is 0. 310 // Return gkBlindPixelQEUVErr ^2 / gkBlindPixelQEUV^2 311 // 312 const Float_t MCalibrationChargeBlindPix::GetBlindPixelQEUV() const 313 { 314 315 if (IsCoated()) 316 { 317 if (gkBlindPixelQECoatedUV < 0.) 318 return -1.; 319 320 return gkBlindPixelQECoatedUV; 321 } 322 else 323 { 324 if (gkBlindPixelQEUnCoatedUV < 0.) 325 return -1.; 326 327 328 return gkBlindPixelQEUnCoatedUV; 329 } 330 } 331 332 // -------------------------------------------------------------------------- 333 // 334 // Return -1 if gkBlindPixelQECT1Err is smaller than 0. 335 // Return -1 if gkBlindPixelQECT1 is 0. 336 // Return gkBlindPixelQECT1Err ^2 / gkBlindPixelQECT1^2 337 // 338 const Float_t MCalibrationChargeBlindPix::GetBlindPixelQECT1() const 339 { 340 341 if (IsCoated()) 342 { 343 if (gkBlindPixelQECoatedCT1 < 0.) 344 return -1.; 345 346 return gkBlindPixelQECoatedCT1; 347 } 348 else 349 { 350 if (gkBlindPixelQEUnCoatedCT1 < 0.) 351 return -1.; 352 353 return gkBlindPixelQEUnCoatedCT1; 354 } 355 } 356 357 // -------------------------------------------------------------------------- 358 // 359 // Return -1 if gkBlindPixelQEGreenErr is smaller than 0. 360 // Return -1 if gkBlindPixelQEGreen is 0. 361 // Return gkBlindPixelQEGreenErr^2 / (gkBlindPixelQEGreen^2 ) 362 // 363 const Float_t MCalibrationChargeBlindPix::GetBlindPixelQEGreenRelVar() const 364 { 365 366 if (IsCoated()) 367 { 368 if (gkBlindPixelQECoatedGreenErr < 0.) 369 return -1.; 370 371 if (gkBlindPixelQECoatedGreen == 0.) 372 return -1.; 373 374 return gkBlindPixelQECoatedGreenErr * gkBlindPixelQECoatedGreenErr 375 / gkBlindPixelQECoatedGreen / gkBlindPixelQECoatedGreen ; 376 } 377 else 378 { 379 if (gkBlindPixelQEUnCoatedGreenErr < 0.) 380 return -1.; 381 382 if (gkBlindPixelQEUnCoatedGreen == 0.) 383 return -1.; 384 385 return gkBlindPixelQEUnCoatedGreenErr * gkBlindPixelQEUnCoatedGreenErr 386 / gkBlindPixelQEUnCoatedGreen / gkBlindPixelQEUnCoatedGreen ; 387 } 388 389 } 390 391 // -------------------------------------------------------------------------- 392 // 393 // Return -1 if gkBlindPixelQEBlueErr is smaller than 0. 394 // Return -1 if gkBlindPixelQEBlue is 0. 395 // Return gkBlindPixelQEBlueErr^2 / gkBlindPixelQEBlue^2 396 // 397 const Float_t MCalibrationChargeBlindPix::GetBlindPixelQEBlueRelVar() const 398 { 399 if (IsCoated()) 400 { 401 if (gkBlindPixelQECoatedBlueErr < 0.) 402 return -1.; 403 404 if (gkBlindPixelQECoatedBlue == 0.) 405 return -1.; 406 407 return gkBlindPixelQECoatedBlueErr * gkBlindPixelQECoatedBlueErr 408 / gkBlindPixelQECoatedBlue / gkBlindPixelQECoatedBlue ; 409 } 410 else 411 { 412 if (gkBlindPixelQEUnCoatedBlueErr < 0.) 413 return -1.; 414 415 if (gkBlindPixelQEUnCoatedBlue == 0.) 416 return -1.; 417 418 return gkBlindPixelQEUnCoatedBlueErr * gkBlindPixelQEUnCoatedBlueErr 419 / gkBlindPixelQEUnCoatedBlue / gkBlindPixelQEUnCoatedBlue ; 420 } 421 } 422 423 // -------------------------------------------------------------------------- 424 // 425 // Return -1 if gkBlindPixelQEUVErr is smaller than 0. 426 // Return -1 if gkBlindPixelQEUV is 0. 427 // Return gkBlindPixelQEUVErr ^2 / gkBlindPixelQEUV^2 428 // 429 const Float_t MCalibrationChargeBlindPix::GetBlindPixelQEUVRelVar() const 430 { 431 432 if (IsCoated()) 433 { 434 if (gkBlindPixelQECoatedUVErr < 0.) 435 return -1.; 436 437 if (gkBlindPixelQECoatedUV == 0.) 438 return -1.; 439 440 return gkBlindPixelQECoatedUVErr * gkBlindPixelQECoatedUVErr 441 / gkBlindPixelQECoatedUV / gkBlindPixelQECoatedUV ; 442 } 443 else 444 { 445 if (gkBlindPixelQEUnCoatedUVErr < 0.) 446 return -1.; 447 448 if (gkBlindPixelQEUnCoatedUV == 0.) 449 return -1.; 450 451 return gkBlindPixelQEUnCoatedUVErr * gkBlindPixelQEUnCoatedUVErr 452 / gkBlindPixelQEUnCoatedUV / gkBlindPixelQEUnCoatedUV ; 453 } 454 } 455 456 // -------------------------------------------------------------------------- 457 // 458 // Return -1 if gkBlindPixelQECT1Err is smaller than 0. 459 // Return -1 if gkBlindPixelQECT1 is 0. 460 // Return gkBlindPixelQECT1Err ^2 / gkBlindPixelQECT1^2 461 // 462 const Float_t MCalibrationChargeBlindPix::GetBlindPixelQECT1RelVar() const 463 { 464 465 if (IsCoated()) 466 { 467 if (gkBlindPixelQECoatedCT1Err < 0.) 468 return -1.; 469 470 if (gkBlindPixelQECoatedCT1 == 0.) 471 return -1.; 472 473 return gkBlindPixelQECoatedCT1Err * gkBlindPixelQECoatedCT1Err 474 / gkBlindPixelQECoatedCT1 / gkBlindPixelQECoatedCT1 ; 475 } 476 else 477 { 478 if (gkBlindPixelQEUnCoatedCT1Err < 0.) 479 return -1.; 480 481 if (gkBlindPixelQEUnCoatedCT1 == 0.) 482 return -1.; 483 484 return gkBlindPixelQEUnCoatedCT1Err * gkBlindPixelQEUnCoatedCT1Err 485 / gkBlindPixelQEUnCoatedCT1 / gkBlindPixelQEUnCoatedCT1 ; 486 } 487 } 488 489 // -------------------------------------------------------------------------- 490 // 491 // Return gkBlindPixelCollectionEffErr^2 / (gkBlindPixelCollectionEff^2 ) 492 // 493 const Float_t MCalibrationChargeBlindPix::GetBlindPixelCollectionEffRelVar() const 494 { 495 496 return gkBlindPixelCollectionEffErr * gkBlindPixelCollectionEffErr 497 / gkBlindPixelCollectionEff / gkBlindPixelCollectionEff ; 288 // Return TMath::Power(10,fAtt[fColor]) 289 // 290 const Float_t MCalibrationChargeBlindPix::GetAtt() const 291 { 292 return TMath::Power(10,fAtt[fColor]); 293 } 294 295 // -------------------------------------------------------------------------- 296 // 297 // Return -1 if fAttErr[fColor] is smaller than 0. 298 // Error of TMath::Power(10,fAtt[fColor]) = TMath::Power(10,fAtt[fColor])*ln(10.)*fAttErr[fColor] 299 // Return fAttErr^2 / (fAtt^2 ) 300 // 301 const Float_t MCalibrationChargeBlindPix::GetAttRelVar() const 302 { 303 304 const Float_t err = fAttErr[fColor]; 305 306 if (err < 0.) 307 return -1.; 308 309 return err*err*2.3; 310 } 311 312 // -------------------------------------------------------------------------- 313 // 314 // Return fQE[fColor] 315 // 316 const Float_t MCalibrationChargeBlindPix::GetQE() const 317 { 318 return fQE[fColor]; 319 } 320 321 // -------------------------------------------------------------------------- 322 // 323 // Return -1 if fQEErr[fColor] is smaller than 0. 324 // Return fQEErr^2 / (fQE^2 ) 325 // 326 const Float_t MCalibrationChargeBlindPix::GetQERelVar() const 327 { 328 329 if (fQEErr[fColor] < 0.) 330 return -1.; 331 332 return fQEErr[fColor]* fQEErr[fColor] / GetQE() / GetQE(); 333 } 334 335 // -------------------------------------------------------------------------- 336 // 337 // Return fCollEff[fColor] 338 // 339 const Float_t MCalibrationChargeBlindPix::GetCollEff() const 340 { 341 return fCollEff[fColor]; 342 } 343 344 // -------------------------------------------------------------------------- 345 // 346 // Return -1 if fCollEffErr[fColor] is smaller than 0. 347 // Return fCollEffErr^2 / (fCollEff^2 ) 348 // 349 const Float_t MCalibrationChargeBlindPix::GetCollEffRelVar() const 350 { 351 352 if (fCollEffErr[fColor] < 0.) 353 return -1.; 354 355 return fCollEffErr[fColor]* fCollEffErr[fColor] / GetCollEff() / GetCollEff(); 498 356 } 499 357 … … 502 360 // Test bit kChargeFitValid 503 361 // 504 Bool_t MCalibrationChargeBlindPix::IsChargeFitValid() const362 const Bool_t MCalibrationChargeBlindPix::IsChargeFitValid() const 505 363 { 506 364 return TESTBIT(fFlags,kChargeFitValid); … … 509 367 // -------------------------------------------------------------------------- 510 368 // 511 // Test bit kCoated512 //513 Bool_t MCalibrationChargeBlindPix::IsCoated() const514 {515 return TESTBIT(fFlags,kCoated);516 }517 518 // --------------------------------------------------------------------------519 //520 369 // Test bit kOscillating 521 370 // 522 Bool_t MCalibrationChargeBlindPix::IsOscillating() const371 const Bool_t MCalibrationChargeBlindPix::IsOscillating() const 523 372 { 524 373 return TESTBIT(fFlags,kOscillating); … … 529 378 // Test bit kPedestalFitValid 530 379 // 531 Bool_t MCalibrationChargeBlindPix::IsPedestalFitOK() const380 const Bool_t MCalibrationChargeBlindPix::IsPedestalFitOK() const 532 381 { 533 382 return TESTBIT(fFlags,kPedestalFitOK); … … 538 387 // Test bit kSinglePheFitValid 539 388 // 540 Bool_t MCalibrationChargeBlindPix::IsSinglePheFitOK() const389 const Bool_t MCalibrationChargeBlindPix::IsSinglePheFitOK() const 541 390 { 542 391 return TESTBIT(fFlags,kSinglePheFitOK); … … 547 396 // Test bit kFluxInsidePlexiglassAvailable 548 397 // 549 Bool_t MCalibrationChargeBlindPix::IsFluxInsidePlexiglassAvailable() const398 const Bool_t MCalibrationChargeBlindPix::IsFluxInsidePlexiglassAvailable() const 550 399 { 551 400 return TESTBIT(fFlags,kFluxInsidePlexiglassAvailable); … … 559 408 // Calculate fFluxInsidePlexiglass with the formula: 560 409 // - fFluxInsidePlexiglass = fLambda 561 // / Get BlindPixelCollectionEff()562 // / Get BlindPixelQE()563 // * 10**gkBlindPixelAtt[color]564 // / gkBlindPixelArea410 // / GetCollEff() 411 // / GetQE() 412 // * GetAtt() 413 // / fArea 565 414 // - fFluxInsidePlexiglassVar = sqrt( fLambdaVar / ( fLambda * fLambda ) 566 // + GetBlindPixelQERelVar() 567 // + GetBlindPixelCollectionEffRelVar() 415 // + GetQERelVar() 416 // + GetCollEffRelVar() 417 // + GetAttRelVar() 568 418 // ) * fFluxInsidePlexiglass * * fFluxInsidePlexiglass 569 419 // … … 584 434 // The blind pixel has exactly 100 mm^2 area (with negligible error), 585 435 // 586 switch (fColor) 587 { 588 case MCalibrationCam::kGREEN: 589 fFluxInsidePlexiglass = fLambda / GetBlindPixelQEGreen() * TMath::Power(10,gkBlindPixelAttGreen); 590 // attenuation has negligible error 591 fFluxInsidePlexiglassVar = GetLambdaRelVar() + GetBlindPixelQEGreenRelVar(); 592 break; 593 case MCalibrationCam::kBLUE: 594 fFluxInsidePlexiglass = fLambda / GetBlindPixelQEBlue() * TMath::Power(10,gkBlindPixelAttBlue); 595 // attenuation has negligible error 596 fFluxInsidePlexiglassVar = GetLambdaRelVar() + GetBlindPixelQEBlueRelVar(); 597 break; 598 case MCalibrationCam::kUV: 599 fFluxInsidePlexiglass = fLambda / GetBlindPixelQEUV() * TMath::Power(10,gkBlindPixelAttUV); 600 // attenuation has negligible error 601 fFluxInsidePlexiglassVar = GetLambdaRelVar() + GetBlindPixelQEUVRelVar(); 602 break; 603 case MCalibrationCam::kCT1: 604 default: 605 fFluxInsidePlexiglass = fLambda / GetBlindPixelQECT1() * TMath::Power(10,gkBlindPixelAttCT1); 606 // attenuation has negligible error 607 fFluxInsidePlexiglassVar = GetLambdaRelVar() + GetBlindPixelQECT1RelVar(); 608 break; 609 } 610 611 fFluxInsidePlexiglass /= gkBlindPixelArea; 612 fFluxInsidePlexiglass /= gkBlindPixelCollectionEff; 436 fFluxInsidePlexiglass = fLambda / GetQE() * GetAtt() / GetCollEff() / fArea; 437 438 if (fFluxInsidePlexiglass < 0.) 439 return kFALSE; 440 441 fFluxInsidePlexiglassVar = GetLambdaRelVar() + GetQERelVar() + GetAttRelVar() + GetCollEffRelVar(); 442 613 443 // 614 444 // Finish calculation of errors -> convert from relative variance to absolute variance 615 445 // 616 fFluxInsidePlexiglassVar += GetBlindPixelCollectionEffRelVar();617 446 fFluxInsidePlexiglassVar *= fFluxInsidePlexiglass * fFluxInsidePlexiglass; 618 619 if (fFluxInsidePlexiglass < 0.)620 return kFALSE;621 447 622 448 if (fFluxInsidePlexiglassVar < 0.) … … 633 459 } 634 460 635 636 637 638 639 640 641 642 643 461 void MCalibrationChargeBlindPix::Print(Option_t *opt) const 462 { 463 464 *fLog << all << GetDescriptor() 465 << Form("%s%3i","BlindPixel: ",GetPixId()) 466 << Form("%s%4.2f%s%4.2f"," Lambda: ",GetLambda(),"+-",GetLambdaErr()) 467 << Form("%s%4.2f%s%4.2f"," Mu0: ",GetMu0(),"+-",GetMu0Err()) 468 << Form("%s%4.2f%s%4.2f"," Mu1: ",GetMu1(),"+-",GetMu1Err()) 469 << Form("%s%4.2f%s%4.2f"," Sigma0: ",GetSigma0(),"+-",GetSigma0Err()) 470 << Form("%s%4.2f%s%4.2f"," Sigma1: ",GetSigma1(),"+-",GetSigma1Err()) 471 << endl; 472 *fLog << all 473 << " Pedestal Fit OK? :" << IsPedestalFitOK() 474 << Form("%s%4.2f%s%4.2f"," Lambda (Check): " ,GetLambdaCheck(),"+-",GetLambdaCheckErr()) 475 << endl; 476 *fLog << all 477 << " Flux available? :" << IsFluxInsidePlexiglassAvailable() 478 << Form("%s%4.2f%s%4.2f"," Flux: " ,GetFluxInsidePlexiglass(),"+-",GetFluxInsidePlexiglassErr()) 479 << endl; 480 } 481 482 483 484 485 486 487 488 489 -
trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc
r4659 r4670 600 600 } 601 601 602 if (fBlindCam)603 if (!fBlindCam->IsValid())604 {605 *fLog << warn << GetDescriptor()606 << ": MCalibrationChargeBlindCam is declared not valid... no Blind Pixel method! " << endl;607 fBlindCam = NULL;608 }609 610 602 *fLog << endl; 611 603 // … … 839 831 *fLog << warn << GetDescriptor() 840 832 << Form(": Fitted Charge: %5.2f is smaller than %2.1f",cal.GetMean(),fChargeLimit) 841 << Form(" 833 << Form(" Pedestal RMS: %5.2f in %s%4i",cal.GetPedRms(),what,cal.GetPixId()) << endl; 842 834 bad.SetUncalibrated( MBadPixelsPix::kChargeIsPedestal); 843 835 } … … 1178 1170 } 1179 1171 1180 *fLog << inf << "Average total number phes in area idx " << aidx << ": " 1172 *fLog << inf << GetDescriptor() 1173 << "Average total number phes in area idx " << aidx << ": " 1181 1174 << Form("%7.2f%s%6.2f",areaphes[aidx]," +- ",TMath::Sqrt(areaweights[aidx])) << endl; 1182 1175 … … 1220 1213 } 1221 1214 1222 *fLog << inf << "Average number phes per area in sector " << sector << ": " 1215 *fLog << inf << GetDescriptor() 1216 << "Average number phes per area in sector " << sector << ": " 1223 1217 << Form("%5.2f+-%4.2f [phe/mm^2]",sectorphes[sector],TMath::Sqrt(sectorweights[sector])) 1224 1218 << endl; … … 1524 1518 } 1525 1519 1526 *fLog << inf << endl;1527 1520 *fLog << inf << GetDescriptor() << ": Mean F-Factor " 1528 1521 << "with area index #" << i << ": " 1529 << Form("%4.2f+-%4.2f",mean,sigma) << "fadc/ph" <<endl;1522 << Form("%4.2f+-%4.2f",mean,sigma) << endl; 1530 1523 1531 1524 lowlim [i] = 1.1; -
trunk/MagicSoft/Mars/mjobs/MJCalibration.cc
r4668 r4670 119 119 #include "MCalibrationChargeBlindPix.h" 120 120 #include "MCalibrationChargeBlindCam.h" 121 #include "MCalibrationChargeBlindPix.h" 121 #include "MCalibrationChargeBlindCamOneOldStyle.h" 122 #include "MCalibrationChargeBlindCamTwoNewStyle.h" 122 123 #include "MCalibrationChargeCalc.h" 123 124 … … 1439 1440 if (run < gkSecondBlindPixelInstallation) 1440 1441 { 1441 blindext.SetModified(kFALSE); 1442 1443 MCalibrationChargeBlindCamOneOldStyle blindresults; 1444 blindresults.Copy(fCalibrationBlindCam); 1445 1442 1446 blindext.SetExtractionType(MExtractBlindPixel::kIntegral); 1443 1447 blindext.SetExtractionType(MExtractBlindPixel::kFilter); … … 1446 1450 blindcam.SetFitFunc( MHCalibrationChargeBlindPix::kEPoisson5 ); 1447 1451 } 1448 else 1449 { 1450 blindext.SetModified(kTRUE); 1452 else if (run < gkThirdBlindPixelInstallation) 1453 { 1454 1455 MCalibrationChargeBlindCamTwoNewStyle blindresults; 1456 blindresults.Copy(fCalibrationBlindCam); 1457 1458 blindext.SetNumBlindPixels(blindresults.GetNumBlindPixels()); 1459 for (UInt_t i=0;i<blindresults.GetNumBlindPixels();i++) 1460 blindext.SetBlindPixelIdx(blindresults[i].GetPixId(),i); 1461 1451 1462 blindext.SetExtractionType(MExtractBlindPixel::kAmplitude); 1452 1463 blindext.SetExtractionType(MExtractBlindPixel::kFilter); … … 1454 1465 blindext.SetNSBFilterLimit(38); 1455 1466 1456 if (run < gkThirdBlindPixelInstallation) 1457 blindext.SetNumBlindPixels(2); 1458 else 1459 blindext.SetNumBlindPixels(3); 1460 } 1467 } 1468 else 1469 { 1470 *fLog << err << "Third blind pixel installation not yet completed, check your run number!!! " << endl; 1471 } 1472 1461 1473 } 1462 1474 … … 1568 1580 MExtractPINDiode pinext; 1569 1581 MExtractBlindPixel blindext; 1582 1570 1583 InitBlindPixel(blindext, blindcam); 1584 1571 1585 MExtractSlidingWindow extract2; 1572 1586 MExtractTimeFastSpline timespline;
Note:
See TracChangeset
for help on using the changeset viewer.