Changeset 5715 for trunk/MagicSoft/Mars/mpedestal
- Timestamp:
- 01/07/05 12:58:11 (20 years ago)
- Location:
- trunk/MagicSoft/Mars/mpedestal
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mpedestal/MExtractPedestal.cc
r5570 r5715 189 189 // 190 190 MExtractPedestal::MExtractPedestal(const char *name, const char *title) 191 : f Geom(NULL), fPedestalsIn(NULL), fPedestalsOut(NULL), fExtractor(NULL),192 fExtract WinFirst(0), fExtractWinSize(0)191 : fRandomCalculation(kTRUE), fGeom(NULL), fPedestalsIn(NULL), fPedestalsOut(NULL), 192 fExtractor(NULL), fExtractWinFirst(0), fExtractWinSize(0) 193 193 { 194 194 fName = name ? name : "MExtractPedestal"; … … 204 204 SetNamePedestalCamIn(); 205 205 SetNamePedestalCamOut(); 206 SetNumEventsDump(); 207 SetNumAreasDump(); 208 SetNumSectorsDump(); 206 SetNumDump(); 209 207 210 208 Clear(); … … 361 359 Print(); 362 360 361 // FIMXE: MUST call fExtractor->PreProcess()??? 363 362 return kTRUE; 363 } 364 365 Int_t MExtractPedestal::Process() 366 { 367 if (fExtractor) 368 fExtractor->SetNoiseCalculation(fRandomCalculation); 369 370 const Int_t rc = Calc(); 371 372 if (fExtractor) 373 fExtractor->SetNoiseCalculation(kFALSE); 374 375 return rc; 364 376 } 365 377 … … 447 459 // NumEventsDump: 500 448 460 // PedestalUpdate: yes 461 // RandomCalculation: yes 449 462 // 450 463 Int_t MExtractPedestal::ReadEnv(const TEnv &env, TString prefix, Bool_t print) … … 477 490 { 478 491 SetPedestalUpdate(GetEnvValue(env, prefix, "PedestalUpdate", fPedestalUpdate)); 492 rc = kTRUE; 493 } 494 495 // find resource for random calculation 496 if (IsEnvDefined(env, prefix, "RandomCalculation", print)) 497 { 498 SetRandomCalculation(GetEnvValue(env, prefix, "RandomCalculation", fRandomCalculation)); 479 499 rc = kTRUE; 480 500 } … … 640 660 } 641 661 if (fExtractor) 642 *fLog << "Extractor used: " << fExtractor->ClassName() << endl; 662 { 663 *fLog << "Extractor used: " << fExtractor->ClassName() << " ("; 664 *fLog << (fRandomCalculation?"":"non-") << "random)" << endl; 665 } 643 666 *fLog << "ExtractWindow from slice " << fExtractWinFirst << " to " << fExtractWinLast << " incl." << endl; 644 667 } -
trunk/MagicSoft/Mars/mpedestal/MExtractPedestal.h
r5570 r5715 26 26 static const TString fgNamePedestalCam; //! "MPedestalCam" 27 27 28 TString fNamePedestalCamIn; // name of the incoming 'MPedestalCam' container 29 TString fNamePedestalCamOut; // name of the outgoing 'MPedestalCam' container 30 31 Bool_t fRandomCalculation; // Is pedestalextraction by extractor random? 32 28 33 protected: 29 34 … … 39 44 UShort_t fExtractWinSize; // Number of slices to calculate the pedestal from 40 45 UShort_t fExtractWinLast; // Last FADC slice to extract pedestal from 41 42 TString fNamePedestalCamIn; // name of the incoming 'MPedestalCam' container43 TString fNamePedestalCamOut; // name of the outgoing 'MPedestalCam' container44 46 45 47 UInt_t fNumEventsDump; // Number of event after which MPedestalCam gets updated … … 66 68 MArrayI fSectorValid; // number of valid pixels within sector idx 67 69 70 // MTask virtual functions 68 71 Int_t PreProcess(MParList *pList); 72 Int_t Process(); 69 73 Int_t PostProcess(); 70 74 Bool_t ReInit(MParList *pList); 71 75 Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print); 72 76 73 virtual void ResetArrays(); 77 // Interface to be overwritten by a new class 78 virtual void ResetArrays(); 79 virtual Int_t Calc() = 0; 74 80 81 // Helper functions 75 82 void CalcPixResults (const UInt_t nevts, const UInt_t pixid); 76 83 void CalcAreaResults (const UInt_t nevts, const UInt_t napix, const UInt_t aidx); … … 85 92 Bool_t SetExtractWindow(UShort_t first, UShort_t size); 86 93 87 void SetNumEventsDump (UInt_t dumpevents=500) { fNumEventsDump = dumpevents; } 88 void SetNumAreasDump (UInt_t dumpevents=500) { fNumAreasDump = dumpevents; } 89 void SetNumSectorsDump (UInt_t dumpevents=500) { fNumSectorsDump = dumpevents; } 94 void SetNumEventsDump(UInt_t dumpevents=500) { fNumEventsDump = dumpevents; } 95 void SetNumAreasDump(UInt_t dumpevents=500) { fNumAreasDump = dumpevents; } 96 void SetNumSectorsDump(UInt_t dumpevents=500) { fNumSectorsDump = dumpevents; } 97 void SetNumDump(UInt_t n=500) { fNumEventsDump=n; fNumAreasDump=n; fNumSectorsDump=n; } 90 98 void SetPedestalUpdate (Bool_t pedupdate=kTRUE) { fPedestalUpdate = pedupdate; } 91 99 … … 97 105 98 106 void SetExtractor(MExtractTimeAndCharge *e) { fExtractor = e; } 107 void SetRandomCalculation(Bool_t b=kTRUE) { fRandomCalculation = b; } 99 108 100 109 ClassDef(MExtractPedestal, 0) // Base class for pedestal extractors -
trunk/MagicSoft/Mars/mpedestal/MPedCalcFromLoGain.cc
r5570 r5715 280 280 // calculate the overall mean and rms in the PostProcess() 281 281 // 282 Int_t MPedCalcFromLoGain:: Process()282 Int_t MPedCalcFromLoGain::Calc() 283 283 { 284 284 // This is the workaround to put hi- and lo-gains together … … 422 422 423 423 Float_t dummy; 424 fExtractor->SetNoiseCalculation(kTRUE);425 424 fExtractor->FindTimeAndChargeHiGain(logain,logain,sum,dummy,dummy,dummy,sat,ped,logainabflag); 426 fExtractor->SetNoiseCalculation(kFALSE);427 425 } 428 426 … … 500 498 MExtractPedestal::Print(o); 501 499 502 *fLog << "CheckWindow from slice " << fCheckWinFirst << " to " << fCheckWinLast << " incl." << endl; 503 *fLog << "Max. allowed signal variation: " << fMaxSignalVar << endl; 504 *fLog << endl; 505 } 500 *fLog << "Max.allowed signal variation: " << fMaxSignalVar << endl; 501 *fLog << "CheckWindow from slice " << fCheckWinFirst << " to " << fCheckWinLast << " incl." << endl; 502 } -
trunk/MagicSoft/Mars/mpedestal/MPedCalcFromLoGain.h
r5558 r5715 35 35 MArrayB fSlices; //! workaround to put hi- and lo-gain slices together 36 36 37 Bool_t fRandomCalculation; 38 37 39 Bool_t ReInit(MParList *pList); 38 Int_t Process();40 Int_t Calc(); 39 41 Int_t PostProcess(); 40 42 … … 49 51 50 52 public: 51 52 53 MPedCalcFromLoGain(const char *name=NULL, const char *title=NULL); 53 54 … … 56 57 // Setters 57 58 Bool_t SetCheckRange(UShort_t checkfirst=fgCheckWinFirst, UShort_t checklast=fgCheckWinLast); 58 void SetMaxSignalVar(UShort_t maxvar=40) 59 void SetMaxSignalVar(UShort_t maxvar=40) { fMaxSignalVar = maxvar; } 59 60 60 61 // Getters -
trunk/MagicSoft/Mars/mpedestal/MPedCalcPedRun.cc
r5570 r5715 251 251 // calculate the overall mean and rms in the PostProcess() 252 252 // 253 Int_t MPedCalcPedRun:: Process()253 Int_t MPedCalcPedRun::Calc() 254 254 { 255 255 if (!IsPedBitSet()) … … 316 316 317 317 Float_t dummy; 318 fExtractor->SetNoiseCalculation(kTRUE);319 318 fExtractor->FindTimeAndChargeHiGain(first,logain,sum,dummy,dummy,dummy,sat,ped,abflag); 320 fExtractor->SetNoiseCalculation(kFALSE);321 319 } 322 320 … … 433 431 void MPedCalcPedRun::Print(Option_t *o) const 434 432 { 435 *fLog << GetDescriptor() << ":" << endl; 436 *fLog << "Name of input MPedestalCam: " << (fPedestalsIn?fPedestalsIn->GetName():fNamePedestalCamIn.Data()) << " (" << fPedestalsIn << ")" << endl; 437 *fLog << "Name of output MPedestalCam: " << (fPedestalsOut?fPedestalsOut->GetName():fNamePedestalCamOut.Data()) << " (" << fPedestalsOut << ")" << endl; 438 *fLog << "ExtractWindow from slice " << fExtractWinFirst << " to " << fExtractWinLast << " incl." << endl; 439 *fLog << "Number overlap lo-gain slices: " << fOverlap << endl; 440 *fLog << "First ped run out of sequence: " << (fIsFirstPedRun?"yes":"no") << endl; 441 *fLog << "Number of used events so far: " << fUsedEvents << endl; 442 443 if (fExtractor) 444 *fLog << "Extractor used: " << fExtractor->ClassName() << endl; 445 446 *fLog << endl; 447 } 433 MExtractPedestal::Print(o); 434 435 *fLog << "ExtractWindow from slice " << fExtractWinFirst << " to " << fExtractWinLast << " incl." << endl; 436 *fLog << "Num overlap lo-gain slices: " << fOverlap << endl; 437 *fLog << "First pedrun out of sequence: " << (fIsFirstPedRun?"yes":"no") << endl; 438 *fLog << "Number of used events so far: " << fUsedEvents << endl; 439 } -
trunk/MagicSoft/Mars/mpedestal/MPedCalcPedRun.h
r5558 r5715 25 25 Bool_t ReInit(MParList *pList); 26 26 Int_t PreProcess(MParList *pList); 27 Int_t Process();27 Int_t Calc(); 28 28 Int_t PostProcess(); 29 29
Note:
See TracChangeset
for help on using the changeset viewer.