Changeset 4390
- Timestamp:
- 07/15/04 13:57:55 (20 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r4389 r4390 26 26 - hard coded the reference lines for the DataCheck Display. Should be faster and 27 27 easier to read than the TArrayF's. 28 29 * mcalib/MCalibrationChargeCalc.[h,cc] 30 - removed obsolete pointer to MEvtTime 31 - fixed bug in calculation of RMS for FFactor of inner pixels in case that the 32 fit does not converge. 33 - introduced blind pixel and PIN Diode result flags for later output or 34 storage in DB. 28 35 29 36 -
trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc
r4360 r4390 236 236 // Default constructor. 237 237 // 238 // Sets all pointersto NULL238 // Sets the pointer to fQECam and fGeom to NULL 239 239 // 240 240 // Calls AddToBranchList for: … … 255 255 // - fOutputPath to "." 256 256 // - fOutputFile to "ChargeCalibStat.txt" 257 // 257 // - flag debug to kFALSE 258 // 258 259 // Calls: 259 260 // - Clear() 260 261 // 261 262 MCalibrationChargeCalc::MCalibrationChargeCalc(const char *name, const char *title) 262 : fBadPixels(NULL), fCam(NULL), fBlindPixel(NULL), fPINDiode(NULL), 263 fQECam(NULL), fGeom(NULL), fPedestals(NULL), fEvtTime(NULL) 263 : fQECam(NULL), fGeom(NULL) 264 264 { 265 265 … … 279 279 SetLambdaErrLimit (); 280 280 SetPheErrLimit (); 281 SetPulserColor ( MCalibrationCam::kNONE );282 281 SetOutputPath (); 283 282 SetOutputFile (); 284 SetDebug 283 SetDebug ( kFALSE ); 285 284 286 285 Clear(); … … 293 292 // - all variables to 0., 294 293 // - all flags to kFALSE 294 // - all pointers to NULL 295 // - the pulser colour to kNONE 296 // - fBlindPixelFlags to 0 297 // - fPINDiodeFlags to 0 295 298 // 296 299 void MCalibrationChargeCalc::Clear(const Option_t *o) … … 302 305 fSqrtLoGainSamples = 0.; 303 306 fNumInnerFFactorMethodUsed = 0; 304 SkipHiLoGainCalibration( kFALSE ); 307 308 fBadPixels = NULL; 309 fCam = NULL; 310 fBlindPixel = NULL; 311 fPINDiode = NULL; 312 fPedestals = NULL; 313 314 SetPulserColor ( MCalibrationCam::kNONE ); 315 316 fBlindPixelFlags.Set(0); 317 fPINDiodeFlags .Set(0); 318 fResultFlags .Set(0); 305 319 } 306 320 … … 316 330 // - MBadPixelsCam 317 331 // 318 // The following output containers are only searched, but not created. If they319 // cannot be found, the corresponding calibration part is only skipped.320 //321 // - MTime322 //323 332 Int_t MCalibrationChargeCalc::PreProcess(MParList *pList) 324 333 { … … 352 361 353 362 354 fEvtTime = (MTime*)pList->FindObject("MTime");355 356 363 // 357 364 // Check the pulser colour --> FIXME: this solution is only valid until the arrival of the DM's … … 953 960 954 961 const Float_t nphe = pix.GetPheFFactorMethod(); 955 const Float_t nvar = pix.GetPheFFactorMethod()*pix.GetPheFFactorMethod();956 962 const Int_t aidx = (*fGeom)[i].GetAidx(); 957 963 … … 960 966 961 967 areaphes [aidx] += nphe; 962 areavars [aidx] += n var;968 areavars [aidx] += nphe*nphe; 963 969 numareavalid[aidx] ++; 964 970 } … … 973 979 } 974 980 981 areavars[i] = (areavars[i] - areaphes[i]*areaphes[i]/numareavalid[i]) / (numareavalid[i]-1.); 975 982 areaphes[i] = areaphes[i] / numareavalid[i]; 976 areavars[i] = (areavars[i] - areaphes[i]*areaphes[i]/numareavalid[i]) / (numareavalid[i]-1.); 977 978 if (areavars[i] > 0.) 979 areavars[i] = TMath::Sqrt(areavars[i]); 980 else 983 984 if (areavars[i] < 0.) 981 985 { 982 986 *fLog << warn << GetDescriptor() << ": No pixels with valid variance of photo-electrons found " … … 1384 1388 1385 1389 avffactorphotons[aidx] += ffactor; 1386 avffactorphotvar[aidx] += pix.GetMeanFFactorFADC2PhotVar();1390 avffactorphotvar[aidx] += ffactor*ffactor; 1387 1391 numffactor[aidx]++; 1388 1392 } … … 1390 1394 for (UInt_t i=0; i<nareas; i++) 1391 1395 { 1392 avffactorphotons[i] /= numffactor[i]; 1393 avffactorphotvar[i] /= numffactor[i]; 1396 1397 if (numffactor[i] == 0) 1398 { 1399 *fLog << warn << GetDescriptor() << ": No pixels with valid total F-Factor found " 1400 << "in area index: " << i << endl; 1401 continue; 1402 } 1403 1404 avffactorphotvar[i] = (avffactorphotvar[i] - avffactorphotons[i]*avffactorphotons[i]/numffactor[i]) / (numffactor[i]-1.); 1405 avffactorphotons[i] = avffactorphotons[i] / numffactor[i]; 1406 1407 if (avffactorphotvar[i] < 0.) 1408 { 1409 *fLog << warn << GetDescriptor() << ": No pixels with valid variance of total F-Factor found " 1410 << "in area index: " << i << endl; 1411 continue; 1412 } 1394 1413 1395 1414 lowlim [i] = 1.1; // Lowest known F-Factor of a PMT -
trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.h
r4360 r4390 23 23 #endif 24 24 25 #ifndef ROOT_TArrayC 26 #include "TArrayC.h" 27 #endif 28 25 29 class MRawEvtData; 26 30 class MRawRunHeader; … … 43 47 private: 44 48 45 static const Float_t fgChargeLimit; 46 static const Float_t fgChargeErrLimit; 47 static const Float_t fgChargeRelErrLimit; 48 static const Float_t fgLambdaCheckLimit; 49 static const Float_t fgLambdaErrLimit; //! Default for fLabmdaErrLimit (now set to: 0.2)50 static const Float_t fgPheErrLimit; 51 static const Float_t fgFFactorErrLimit; //! Default for fFFactorErrLimit (now set to: 3.)49 static const Float_t fgChargeLimit; //! Default for fChargeLimit (now set to: 2.5) 50 static const Float_t fgChargeErrLimit; //! Default for fChargeErrLimit (now set to: 0.) 51 static const Float_t fgChargeRelErrLimit; //! Default for fChargeRelErrLimit (now set to: 1.) 52 static const Float_t fgLambdaCheckLimit; //! Default for fLambdaCheckLimit (now set to: 0.2) 53 static const Float_t fgLambdaErrLimit; //! Default for fLabmdaErrLimit (now set to: 0.5) 54 static const Float_t fgPheErrLimit; //! Default for fPheErrLimit (now set to: 4.) 55 static const Float_t fgFFactorErrLimit; //! Default for fFFactorErrLimit (now set to: 4.) 52 56 53 57 // Variables … … 55 59 Float_t fChargeErrLimit; // Limit acceptance charge error (in abs. numbers) 56 60 Float_t fChargeRelErrLimit; // Limit acceptance rel. error mean (in abs. numbers) 57 Byte_t fFlags; // Bit-field for the flags58 61 Float_t fLambdaCheckLimit; // Limit rel. diff. lambda and lambdacheck in Blind Pixel 59 62 Float_t fLambdaErrLimit; // Limit acceptance lambda error in Blind Pixel … … 66 69 MCalibrationCam::PulserColor_t fPulserColor; // Calibration LEDs colour 67 70 Int_t fNumInnerFFactorMethodUsed; // Number of inner pixels used for F-Factor Method calibration 71 72 Byte_t fFlags; // Bit-field for the general flags 73 TArrayC fResultFlags; // Bit-fields for the fitting results (one field per area index) 74 TArrayC fBlindPixelFlags; // Bit-fields for the blind pixel flags (one field per blind pixel) 75 TArrayC fPINDiodeFlags; // Bit-fields for the PIN Diode flags (one field per PIN Diode ) 68 76 69 77 TString fOutputPath; // Path to the output file … … 78 86 MGeomCam *fGeom; //! Camera geometry 79 87 MPedestalCam *fPedestals; //! Pedestals all pixels (calculated previously from ped.file) 80 MTime *fEvtTime; //! Time of the event81 88 82 89 // enums 83 enum { k HiLoGainCalibration, kDebug};90 enum { kDebug, kPheFitOK, kFFactorFitOK, kBlindPixelFitOK, kBlindPixelPedFitOK, kPINDiodeFitOK }; 84 91 85 92 // functions 86 93 const char* GetOutputFile(); 87 void FinalizePedestals ( const MPedestalPix&ped, MCalibrationChargePix &cal, const Int_t aidx );88 Bool_t FinalizeCharges ( MCalibrationChargePix &cal, MBadPixelsPix &bad);89 Bool_t FinalizePINDiode ();90 Bool_t FinalizeBlindPixel ();91 Bool_t FinalizeFFactorMethod ();92 void FinalizeBadPixels ();93 void FinalizeFFactorQECam ();94 void FinalizeBlindPixelQECam ();95 void FinalizePINDiodeQECam ();94 void FinalizePedestals ( const MPedestalPix &ped, MCalibrationChargePix &cal, const Int_t aidx ); 95 Bool_t FinalizeCharges ( MCalibrationChargePix &cal, MBadPixelsPix &bad ); 96 Bool_t FinalizePINDiode (); 97 Bool_t FinalizeBlindPixel (); 98 Bool_t FinalizeFFactorMethod (); 99 void FinalizeBadPixels (); 100 void FinalizeFFactorQECam (); 101 void FinalizeBlindPixelQECam (); 102 void FinalizePINDiodeQECam (); 96 103 void FinalizeUnsuitablePixels(); 97 104 98 105 void PrintUncalibrated( MBadPixelsPix::UncalibratedType_t typ, const char *text) const; 106 107 void SetPheFitOK ( const Int_t aidx, const Bool_t b=kTRUE ) { b ? SETBIT(fResultFlags[aidx], kPheFitOK) 108 : CLRBIT(fResultFlags[aidx], kPheFitOK); } 109 void SetFFactorFitOK ( const Int_t aidx, const Bool_t b=kTRUE ) { b ? SETBIT(fResultFlags[aidx], kFFactorFitOK) 110 : CLRBIT(fResultFlags[aidx], kFFactorFitOK); } 111 void SetBlindPixelFitOK ( const Int_t idx, const Bool_t b=kTRUE ) { b ? SETBIT(fBlindPixelFlags[idx], kBlindPixelFitOK) 112 : CLRBIT(fBlindPixelFlags[idx], kBlindPixelFitOK); } 113 void SetBlindPixelPedFitOK( const Int_t idx, const Bool_t b=kTRUE ) { b ? SETBIT(fBlindPixelFlags[idx], kBlindPixelPedFitOK) 114 : CLRBIT(fBlindPixelFlags[idx], kBlindPixelPedFitOK); } 115 void SetPINDiodeFitOK ( const Int_t idx, const Bool_t b=kTRUE ) { b ? SETBIT(fPINDiodeFlags[idx], kPINDiodeFitOK) 116 : CLRBIT(fPINDiodeFlags[idx], kPINDiodeFitOK); } 99 117 100 118 Int_t PreProcess (MParList *pList); … … 111 129 Bool_t IsDebug() const { return TESTBIT(fFlags,kDebug); } 112 130 113 void SetChargeLimit ( const Float_t f=fgChargeLimit ) { fChargeLimit = f; } 114 void SetChargeErrLimit ( const Float_t f=fgChargeErrLimit ) { fChargeErrLimit = f; } 115 void SetChargeRelErrLimit ( const Float_t f=fgChargeRelErrLimit ) { fChargeRelErrLimit = f; } 116 void SetFFactorErrLimit ( const Float_t f=fgFFactorErrLimit ) { fFFactorErrLimit = f; } 117 void SetLambdaErrLimit ( const Float_t f=fgLambdaErrLimit ) { fLambdaErrLimit = f; } 118 void SetLambdaCheckLimit ( const Float_t f=fgLambdaCheckLimit ) { fLambdaCheckLimit = f; } 131 void SetChargeLimit ( const Float_t f=fgChargeLimit ) { fChargeLimit = f; } 132 void SetChargeErrLimit ( const Float_t f=fgChargeErrLimit ) { fChargeErrLimit = f; } 133 void SetChargeRelErrLimit ( const Float_t f=fgChargeRelErrLimit ) { fChargeRelErrLimit = f; } 134 void SetDebug ( const Bool_t b=kTRUE ) { b ? SETBIT(fFlags, kDebug) 135 : CLRBIT(fFlags, kDebug); } 136 void SetFFactorErrLimit ( const Float_t f=fgFFactorErrLimit ) { fFFactorErrLimit = f; } 137 void SetLambdaErrLimit ( const Float_t f=fgLambdaErrLimit ) { fLambdaErrLimit = f; } 138 void SetLambdaCheckLimit ( const Float_t f=fgLambdaCheckLimit ) { fLambdaCheckLimit = f; } 119 139 void SetOutputPath ( TString path="." ); 120 140 void SetOutputFile ( TString file="ChargeCalibStat.txt" ); 121 void SetPheErrLimit ( const Float_t f=fgPheErrLimit ) { fPheErrLimit = f; }122 void SetPulserColor ( const MCalibrationCam::PulserColor_t col ) { fPulserColor = col; }141 void SetPheErrLimit ( const Float_t f=fgPheErrLimit ) { fPheErrLimit = f; } 142 void SetPulserColor ( const MCalibrationCam::PulserColor_t col ) { fPulserColor = col; } 123 143 124 void SkipHiLoGainCalibration ( const Bool_t b=kTRUE )125 { b ? CLRBIT(fFlags, kHiLoGainCalibration) : SETBIT(fFlags, kHiLoGainCalibration); }126 void SetDebug ( const Bool_t b=kTRUE )127 { b ? SETBIT(fFlags, kDebug ) : CLRBIT(fFlags, kDebug ); }128 144 129 145 ClassDef(MCalibrationChargeCalc, 1) // Task calculating Calibration Containers and Quantum Efficiencies
Note:
See TracChangeset
for help on using the changeset viewer.