Changeset 4390 for trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc
- Timestamp:
- 07/15/04 13:57:55 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note:
See TracChangeset
for help on using the changeset viewer.