Changeset 4672 for trunk/MagicSoft/Mars/mcalib
- Timestamp:
- 08/18/04 00:12:13 (20 years ago)
- Location:
- trunk/MagicSoft/Mars/mcalib
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mcalib/MCalibrationChargeBlindPix.cc
r4671 r4672 452 452 453 453 *fLog << inf << GetDescriptor() 454 << ": Photon flux [ph/mm^2] inside Plexiglass: "454 << ": Blind Pixel Nr. " << fPixId << ": Photon flux [ph/mm^2] inside Plexiglass: " 455 455 << Form("%5.3f%s%5.3f",fFluxInsidePlexiglass," +- ",GetFluxInsidePlexiglassErr()) << endl; 456 456 -
trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc
r4670 r4672 49 49 // - FinalizeBadPixels() 50 50 // - FinalizeBlindPixel() 51 // - FinalizeBlindCam() 51 52 // - FinalizePINDiode() 52 53 // - FinalizeFFactorQECam() … … 563 564 // 564 565 // Call FinalizeBlindPixel() 566 // Call FinalizeBlindCam() 565 567 // Call FinalizePINDiode() 566 568 // … … 684 686 // Finalize Blind Pixel 685 687 // 686 if (FinalizeBlindPixel()) 687 fQECam->SetBlindPixelMethodValid(kTRUE); 688 else 689 fQECam->SetBlindPixelMethodValid(kFALSE); 688 if (fBlindPixel) 689 if (FinalizeBlindPixel()) 690 fQECam->SetBlindPixelMethodValid(kTRUE); 691 else 692 fQECam->SetBlindPixelMethodValid(kFALSE); 693 else 694 if (FinalizeBlindCam()) 695 fQECam->SetBlindPixelMethodValid(kTRUE); 696 else 697 fQECam->SetBlindPixelMethodValid(kFALSE); 690 698 691 699 // … … 1171 1179 1172 1180 *fLog << inf << GetDescriptor() 1173 << " Average total number phes in area idx " << aidx << ": "1181 << ": Average total number phes in area idx " << aidx << ": " 1174 1182 << Form("%7.2f%s%6.2f",areaphes[aidx]," +- ",TMath::Sqrt(areaweights[aidx])) << endl; 1175 1183 … … 1214 1222 1215 1223 *fLog << inf << GetDescriptor() 1216 << " Average number phes per area in sector " << sector << ": "1224 << ": Average number phes per area in sector " << sector << ": " 1217 1225 << Form("%5.2f+-%4.2f [phe/mm^2]",sectorphes[sector],TMath::Sqrt(sectorweights[sector])) 1218 1226 << endl; … … 1274 1282 } 1275 1283 1284 return kTRUE; 1285 } 1286 1287 // ------------------------------------------------------------------------ 1288 // 1289 // Returns kFALSE if pointer to MCalibrationChargeBlindCam is NULL 1290 // 1291 // The check returns kFALSE if: 1292 // 1293 // 1) fLambda and fLambdaCheck are separated relatively to each other by more than fLambdaCheckLimit 1294 // 2) BlindPixel has an fLambdaErr greater than fLambdaErrLimit 1295 // 1296 // Calls: 1297 // - MCalibrationChargeBlindPix::CalcFluxInsidePlexiglass() 1298 // 1299 Bool_t MCalibrationChargeCalc::FinalizeBlindCam() 1300 { 1301 1302 if (!fBlindCam) 1303 return kFALSE; 1304 1305 Float_t flux = 0.; 1306 Float_t fluxvar = 0.; 1307 Int_t nvalid = 0; 1308 1309 for (UInt_t i=0; i<fBlindCam->GetNumBlindPixels(); i++) 1310 { 1311 1312 MCalibrationChargeBlindPix &blindpix = (*fBlindCam)[i]; 1313 1314 if (!blindpix.IsValid()) 1315 continue; 1316 1317 const Float_t lambda = blindpix.GetLambda(); 1318 const Float_t lambdaerr = blindpix.GetLambdaErr(); 1319 const Float_t lambdacheck = blindpix.GetLambdaCheck(); 1320 1321 if (2.*(lambdacheck-lambda)/(lambdacheck+lambda) > fLambdaCheckLimit) 1322 { 1323 *fLog << warn << GetDescriptor() 1324 << Form("%s%4.2f%s%4.2f%s%4.2f%s%2i",": Lambda: ",lambda," and Lambda-Check: ", 1325 lambdacheck," differ by more than ",fLambdaCheckLimit," in the Blind Pixel Nr.",i) 1326 << endl; 1327 blindpix.SetValid(kFALSE); 1328 continue; 1329 } 1330 1331 if (lambdaerr > fLambdaErrLimit) 1332 { 1333 *fLog << warn << GetDescriptor() 1334 << Form("%s%4.2f%s%4.2f%s%2i",": Error of Fitted Lambda: ",lambdaerr," is greater than ", 1335 fLambdaErrLimit," in Blind Pixel Nr.",i) << endl; 1336 blindpix.SetValid(kFALSE); 1337 continue; 1338 } 1339 1340 if (!blindpix.CalcFluxInsidePlexiglass()) 1341 { 1342 *fLog << warn << "Could not calculate the flux of photons from Blind Pixel Nr." << i << endl; 1343 blindpix.SetValid(kFALSE); 1344 continue; 1345 } 1346 1347 nvalid++; 1348 const Float_t weight = 1./ blindpix.GetFluxInsidePlexiglassErr() / blindpix.GetFluxInsidePlexiglassErr(); 1349 flux += weight * blindpix.GetFluxInsidePlexiglass(); 1350 fluxvar += weight; 1351 } 1352 1353 if (!nvalid) 1354 return kFALSE; 1355 1356 flux /= fluxvar; 1357 fluxvar /= 1./fluxvar; 1358 1359 const Float_t photons = flux * (*fGeom)[0].GetA() / fQECam->GetPlexiglassQE(); 1360 fCam->SetNumPhotonsBlindPixelMethod(photons); 1361 1362 const Float_t photrelvar = fluxvar / flux / flux + fQECam->GetPlexiglassQERelVar(); 1363 if (photrelvar > 0.) 1364 fCam->SetNumPhotonsBlindPixelMethodErr(TMath::Sqrt( photrelvar * photons * photons)); 1365 1276 1366 return kTRUE; 1277 1367 } -
trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.h
r4609 r4672 98 98 Bool_t FinalizePINDiode (); 99 99 Bool_t FinalizeBlindPixel (); 100 Bool_t FinalizeBlindCam (); 100 101 Bool_t FinalizeFFactorMethod (); 101 102 void FinalizeBadPixels ();
Note:
See TracChangeset
for help on using the changeset viewer.