Changeset 5715
- Timestamp:
- 01/07/05 12:58:11 (20 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mbase/MLog.h
r4722 r5715 190 190 void WriteEnv(TEnv &env, TString prefix="", Bool_t print=kFALSE) const; 191 191 192 voidSeparator(TString str="", int outlvl=0)192 MLog &Separator(TString str="", int outlvl=0) 193 193 { 194 194 if (!str.IsNull()) … … 207 207 (*this) << str << std::endl; 208 208 fOutputLevel = save; 209 210 return *this; 209 211 } 210 212 -
trunk/MagicSoft/Mars/mbase/MPrint.cc
r3142 r5715 65 65 { 66 66 Init(0, 0); 67 SetBit(kSep erator);67 SetBit(kSeparator); 68 68 } 69 69 … … 118 118 // The pointer is already given by the user. 119 119 // 120 if (fObject || TestBit(kSep erator))120 if (fObject || TestBit(kSeparator)) 121 121 return kTRUE; 122 122 … … 149 149 Int_t MPrint::Process() 150 150 { 151 if (TestBit(kSep erator))152 gLog << endl << setfill('-') << setw(72) << "-" << endl<< endl;151 if (TestBit(kSeparator)) 152 gLog.Separator() << endl; 153 153 else 154 154 fObject->Print(fOption); -
trunk/MagicSoft/Mars/mbase/MPrint.h
r2580 r5715 15 15 TString fOption; // Print option 16 16 17 enum { kSkip = BIT(14), kSep erator = BIT(15) };17 enum { kSkip = BIT(14), kSeparator = BIT(15) }; 18 18 19 19 void Init(const char *name, const char *title); -
trunk/MagicSoft/Mars/mfileio/MReadTree.cc
r5692 r5715 287 287 // via AddNotify. 288 288 // 289 // For unknown reasons root stores the SetAutoDelete-Flag in 290 // a branch having a custom streamer (eg. MRawEvtData). 291 // It is not allowed that a container which is in the parameter 292 // list gets a new address. Therefor we reset all the autodel flags. 293 // 294 // MAKE SURE THAT ALL YOPUR CUSTOM STREAMERS TAKE CARE OF ALL MEMORY 295 // 289 296 Bool_t MReadTree::Notify() 290 297 { … … 299 306 *fLog << GetNumEntry()-1 << ")" << endl; 300 307 308 // 309 // For unknown reasons root stores the SetAutoDelete-Flag in 310 // a branch having a custom streamer (eg. MRawEvtData). 311 // It is not allowed that a container which is in the parameter 312 // list gets a new address. Therefor we reset all the autodel flags. 313 // 314 // MAKE SURE THAT ALL YOPUR CUSTOM STREAMERS TAKE CARE OF ALL MEMORY 315 // 316 TIter NextB(fTree->GetListOfBranches()); 317 TBranch *b=0; 318 while ((b=(TBranch*)NextB())) 319 if (b->IsAutoDelete()) 320 { 321 *fLog << warn << "Branch " << b->GetName() << "->IsAutoDelete() set... resetting." << endl; 322 b->SetAutoDelete(kFALSE); 323 } 324 301 325 if (!fNotify) 302 326 return kTRUE; 303 327 304 TIter Next (fNotify);328 TIter NextN(fNotify); 305 329 TObject *o=NULL; 306 while ((o=Next ()))330 while ((o=NextN())) 307 331 if (!o->Notify()) 308 332 { -
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.