Changeset 5361 for trunk/MagicSoft
- Timestamp:
- 11/09/04 18:43:11 (20 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r5358 r5361 1 1 2 2 Please do not write behind the end of line tag so that it is possible 3 3 to send a Changelog file to a line printer directly. Thanks. … … 22 22 23 23 2004/11/08: Markus Gaug 24 25 * mjobs/MJPedestal.[h,cc] 26 - implemented the possibility to use the extractor to calculate the 27 pedestals. Now, there are three possibilities: 28 29 1) SetUseData(): will use MPedCalcFromLoGain together with a data 30 file (and possibly a signal extractor to 31 determine the ranges) 32 2) SetUsePedRun(): will use MPedCalcPedRun together with a 33 pedestal run (and possibly a signal extractor 34 to determine the ranges) 35 3) SetUseExtractor(): Will use the extractor itself and checks 36 that the flag IsNoiseCalculation() is set. 37 38 * msignal/MExtractor.[h,cc] 39 - introduced flag "fNoiseCalculation" to be used by the 40 deriving classes to calculate the noise from a fixed window in 41 time. 24 42 25 43 * mpedestal/MPedCalcFromLoGain.[h,cc] -
trunk/MagicSoft/Mars/mjobs/MJPedestal.cc
r5342 r5361 93 93 // - fExtractor to NULL, 94 94 // - fDataCheck to kFALSE, 95 // - f UseData to kFALSE95 // - fExtractType to kUsePedRun 96 96 // - fStorage to Normal Storage 97 97 // 98 98 MJPedestal::MJPedestal(const char *name, const char *title) 99 99 : fRuns(0), fExtractor(NULL), fDisplayType(kNormalDisplay), 100 fDataCheck(kFALSE) , fUseData(kFALSE)100 fDataCheck(kFALSE) 101 101 { 102 102 fName = name ? name : "MJPedestal"; … … 104 104 105 105 SetNormalStorage(); 106 SetUsePedRun(); 106 107 } 107 108 … … 502 503 Bool_t MJPedestal::CheckEnvLocal() 503 504 { 504 SetDataCheck(GetEnv("DataCheck", fDataCheck)); 505 if (HasEnv("DataCheckDisplay")) 506 fDisplayType = GetEnv("DataCheckDisplay", kFALSE) ? kDataCheckDisplay : kNormalDisplay; 507 SetUseData(GetEnv("UseData", fUseData)); 508 SetNoStorage(GetEnv("DisableOutput", IsNoStorage())); 509 510 return kTRUE; 505 506 SetDataCheck(GetEnv("DataCheck", fDataCheck)); 507 508 if (HasEnv("DataCheckDisplay")) 509 fDisplayType = GetEnv("DataCheckDisplay", kFALSE) ? kDataCheckDisplay : kNormalDisplay; 510 511 if (HasEnv("UseData")) 512 fExtractType = GetEnv("UseData",kFALSE) ? kUseData : kUsePedRun; 513 514 if (HasEnv("UseExtractor")) 515 if (GetEnv("UseExtractor",kFALSE)) 516 fExtractType = kUseExtractor; 517 518 SetNoStorage ( GetEnv("DisableOutput", IsNoStorage() )); 519 520 return kTRUE; 511 521 } 512 522 … … 590 600 // -------------------------------------------------------------------------------- 591 601 592 const TString type = fUseData? "data" : "pedestal";602 const TString type = IsUseData() ? "data" : "pedestal"; 593 603 594 604 *fLog << inf; … … 617 627 if (fSequence.IsValid()) 618 628 { 619 const Int_t n0 = fUseData? fSequence.SetupDatRuns(iter, fPathData, "D", fDataCheck) : fSequence.SetupPedRuns(iter, fPathData, "P", fDataCheck);620 const Int_t n1 = fUseData? fSequence.GetNumDatRuns() : fSequence.GetNumPedRuns();629 const Int_t n0 = IsUseData() ? fSequence.SetupDatRuns(iter, fPathData, "D", fDataCheck) : fSequence.SetupPedRuns(iter, fPathData, "P", fDataCheck); 630 const Int_t n1 = IsUseData() ? fSequence.GetNumDatRuns() : fSequence.GetNumPedRuns(); 621 631 if (n0==0) 622 632 { … … 654 664 MPedCalcPedRun pedcalc; 655 665 MPedCalcFromLoGain pedlogain; 656 pedlogain.SetPedestalUpdate(kFALSE);657 666 658 667 MTaskEnv taskenv("ExtractPedestal"); 659 668 if (IsUseData()) 660 669 taskenv.SetDefault(&pedlogain); 670 else if (IsUseExtractor()) 671 taskenv.SetDefault(fExtractor); 661 672 else 662 673 taskenv.SetDefault(&pedcalc); … … 666 677 if (IsUseData()) 667 678 pedlogain.SetExtractWindow(15,(Int_t)fExtractor->GetNumHiGainSamples()); 668 else 679 else if (IsUsePedRun()) 669 680 { 670 681 pedcalc.SetWindowSize((Int_t)fExtractor->GetNumHiGainSamples()); 671 682 pedcalc.SetRange(fExtractor->GetHiGainFirst(), fExtractor->GetHiGainLast()); 672 683 } 673 } 684 else if (IsUseExtractor()) 685 if (!fExtractor->IsNoiseCalculation()) 686 { 687 *fLog << err << GetDescriptor() 688 << "Extraction Type kUseExtractor is chosen, but the extractor has no flag kNoiseCalculation set! " << endl; 689 return kFALSE; 690 } 691 } 692 else if (IsUseExtractor()) 693 { 694 *fLog << err << GetDescriptor() 695 << "Extraction Type kUseExtractor is chosen, but no extractor has been handed over" << endl; 696 return kFALSE; 697 } 698 674 699 /* 675 700 else -
trunk/MagicSoft/Mars/mjobs/MJPedestal.h
r5233 r5361 41 41 static const Float_t fgRefPedRmsGalacticOuter; //! Ref. line ped. RMS for galactic source - outer pixels 42 42 43 MRunIter *fRuns; // Used pedestal runs44 MExtractor *fExtractor; // Signal extractor, used to find the nr. of used FADC slices43 MRunIter *fRuns; // Used pedestal runs 44 MExtractor *fExtractor; // Signal extractor, used to find the nr. of used FADC slices 45 45 46 MPedestalCam fPedestalCam; // Created pedestal results47 MBadPixelsCam fBadPixels; // Bad Pixels46 MPedestalCam fPedestalCam; // Created pedestal results 47 MBadPixelsCam fBadPixels; // Bad Pixels 48 48 49 enum Display_t {kDataCheckDisplay, kNormalDisplay}; // Possible Display types 49 enum Display_t {kDataCheckDisplay, kNormalDisplay}; // Possible Display types 50 Display_t fDisplayType; // Chosen Display type 51 52 enum Storage_t { kNoStorage }; // Possible flags for the storage of results 53 Byte_t fStorage; // Bit-field for chosen storage type 54 55 Bool_t fDataCheck; // Flag if the data check is run on raw data 50 56 51 Display_t fDisplayType; // Chosen Display type 52 53 enum Storage_t { kNoStorage }; // Possible flags for the storage of results 54 55 Byte_t fStorage; // Bit-field for chosen storage type 56 57 Bool_t fDataCheck; // Flag if the data check is run on raw data 58 Bool_t fUseData; // Use data-runs from sequence instead of pedestal runs 57 enum Extract_t {kUseData, kUsePedRun, kUseExtractor}; // Possible flags for the extraction of the pedestal 58 Extract_t fExtractType; // Chosen extractor type 59 59 60 60 Bool_t ReadPedestalCam(); … … 80 80 const char* GetOutputFile() const; 81 81 const Bool_t IsDataCheck () const { return fDataCheck; } 82 const Bool_t IsUseData () const { return fUseData; } 82 const Bool_t IsUseData () const { return fExtractType == kUseData; } 83 const Bool_t IsUseExtractor () const { return fExtractType == kUseExtractor; } 84 const Bool_t IsUsePedRun () const { return fExtractType == kUsePedRun; } 83 85 84 86 Bool_t Process (); … … 88 90 void SetExtractor ( MExtractor* ext ) { fExtractor = ext; } 89 91 void SetInput ( MRunIter *iter ) { fRuns = iter; } 90 void SetUseData ( const Bool_t b=kTRUE ) { fUseData = b; } 91 void SetDataCheck ( const Bool_t b=kTRUE ) { fDataCheck = b; 92 void SetUseData () { fExtractType = kUseData; } 93 void SetUseExtractor() { fExtractType = kUseExtractor; } 94 void SetUsePedRun () { fExtractType = kUsePedRun; } 95 void SetDataCheck ( const Bool_t b=kTRUE ) { fDataCheck = b; 92 96 b ? SetDataCheckDisplay() : SetNormalDisplay(); } 93 97 void SetDataCheckDisplay() { fDisplayType = kDataCheckDisplay; } -
trunk/MagicSoft/Mars/msignal/MExtractor.h
r5360 r5361 57 57 TString fNamePedestalCam; // Name of the 'MPedestalCam' container 58 58 59 Bool_t IsNoiseCalculation() { return fNoiseCalculation; }60 61 59 virtual void FindSignalHiGain(Byte_t *firstused, Byte_t *lowgain, Float_t &sum, Byte_t &sat) const { } 62 60 virtual void FindSignalLoGain(Byte_t *firstused, Float_t &sum, Byte_t &sat) const { } … … 78 76 Float_t GetNumLoGainSamples() const { return fNumLoGainSamples; } 79 77 78 Bool_t IsNoiseCalculation() { return fNoiseCalculation; } 79 80 80 virtual void SetRange ( Byte_t hifirst=0, Byte_t hilast=0, Byte_t lofirst=0, Byte_t lolast=0 ); 81 81
Note:
See TracChangeset
for help on using the changeset viewer.