Changeset 5381 for trunk/MagicSoft
- Timestamp:
- 11/11/04 10:32:21 (20 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r5380 r5381 59 59 - automatically get correct range for pedestal extraction 60 60 (MPedCalcFromLoGain) from Signal Extractor 61 62 * mjobs/MJPedestal.cc: 63 - simplified a complicated if-else-construction towards a 64 correct setting of ranges also for the calibration of the signal. 61 65 62 66 -
trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc
r5324 r5381 332 332 apply.SetGeometry(geom); 333 333 MBadPixelsMerge merge(&badpix); 334 334 335 MPedCalcFromLoGain pedlo; 336 pedlo.SetPedestalUpdate(kTRUE); 337 // FIXME: How to get the fixed value 15 automatically? 338 pedlo.SetExtractWindow(15, (Int_t)static_cast<MExtractor*>(extractor1)->GetNumHiGainSamples()); 339 335 340 MMcPedestalCopy pcopy; 336 341 MTaskEnv taskenv1("ExtractSignal"); -
trunk/MagicSoft/Mars/mjobs/MJPedestal.cc
r5361 r5381 503 503 Bool_t MJPedestal::CheckEnvLocal() 504 504 { 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; 505 SetDataCheck(GetEnv("DataCheck", fDataCheck)); 506 507 if (HasEnv("DataCheckDisplay")) 508 fDisplayType = GetEnv("DataCheckDisplay", kFALSE) ? kDataCheckDisplay : kNormalDisplay; 509 510 if (HasEnv("UseData")) 511 fExtractType = GetEnv("UseData",kFALSE) ? kUseData : kUsePedRun; 512 513 if (HasEnv("UseExtractor")) 514 if (GetEnv("UseExtractor",kFALSE)) 515 fExtractType = kUseExtractor; 516 517 SetNoStorage(GetEnv("DisableOutput", IsNoStorage())); 518 519 return kTRUE; 521 520 } 522 521 … … 666 665 667 666 MTaskEnv taskenv("ExtractPedestal"); 668 if (IsUseData()) 669 taskenv.SetDefault(&pedlogain); 670 else if (IsUseExtractor()) 671 taskenv.SetDefault(fExtractor); 672 else 673 taskenv.SetDefault(&pedcalc); 674 675 if (fExtractor) 676 { 677 if (IsUseData()) 678 pedlogain.SetExtractWindow(15,(Int_t)fExtractor->GetNumHiGainSamples()); 679 else if (IsUsePedRun()) 667 switch (fExtractType) 668 { 669 case kUseData: 670 taskenv.SetDefault(&pedlogain); 671 if (!fExtractor) 672 break; 673 pedlogain.SetExtractWindow(15,(Int_t)fExtractor->GetNumHiGainSamples()); 674 break; 675 676 case kUsePedRun: 677 if (!fExtractor) 678 break; 679 taskenv.SetDefault(&pedcalc); 680 pedcalc.SetWindowSize((Int_t)fExtractor->GetNumHiGainSamples()); 681 pedcalc.SetRange(fExtractor->GetHiGainFirst(), fExtractor->GetHiGainLast()); 682 break; 683 684 case kUseExtractor: 685 if (!fExtractor) 680 686 { 681 pedcalc.SetWindowSize((Int_t)fExtractor->GetNumHiGainSamples()); 682 pedcalc.SetRange(fExtractor->GetHiGainFirst(), fExtractor->GetHiGainLast()); 687 *fLog << err << GetDescriptor(); 688 *fLog << "Extraction Type kUseExtractor is chosen, but no extractor has been handed over" << endl; 689 return kFALSE; 683 690 } 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 699 /* 700 else 701 { 691 taskenv.SetDefault(fExtractor); 692 if (fExtractor->IsNoiseCalculation()) 693 break; 694 702 695 *fLog << warn << GetDescriptor(); 703 *fLog << ": No extractor has been chosen, take default number of FADC samples " << endl; 704 } 705 */ 696 *fLog <<"Extraction type is kUseExtractor, but extractor has kNoiseCalculation not set... set." << endl; 697 fExtractor->SetNoiseCalculation(); 698 return kFALSE; 699 } 706 700 707 701 tlist.AddToList(&geomapl); -
trunk/MagicSoft/Mars/mpedestal/MPedCalcFromLoGain.cc
r5378 r5381 576 576 // 577 577 // The following resources are available: 578 // FirstCheckWindowSlice: 0 579 // LastCheckWindowSlice: 29 580 // ExtractWindowFirst: 15 581 // ExtractWindowSize: 6 582 // NumEventsDump: 578 // FirstCheckWindowSlice: 0 579 // LastCheckWindowSlice: 29 580 // ExtractWindowFirst: 15 581 // ExtractWindowSize: 6 582 // NumEventsDump: 500 583 // MaxSignalVar: 40 584 // PedestalUpdate: yes 583 585 // 584 586 Int_t MPedCalcFromLoGain::ReadEnv(const TEnv &env, TString prefix, Bool_t print) 585 587 { 586 if (MExtractor::ReadEnv(env, prefix, print)==kERROR)587 return kERROR;588 589 588 Bool_t rc=kFALSE; 590 589 … … 653 652 *fLog << "Max allowed signal variation: " << fMaxSignalVar << endl; 654 653 *fLog << "Pedestal Update is " << (fPedestalUpdate?"on":"off") << endl; 655 MExtractor::Print(o); 656 } 654 } -
trunk/MagicSoft/Mars/mpedestal/MPedCalcFromLoGain.h
r5378 r5381 2 2 #define MARS_MPedCalcFromLoGain 3 3 4 #ifndef MARS_M Extractor5 #include "M Extractor.h"4 #ifndef MARS_MTask 5 #include "MTask.h" 6 6 #endif 7 7 … … 15 15 16 16 class MGeomCam; 17 class MBadPixelsCam; 17 class MPedestalCam; 18 class MRawEvtData; 18 19 class MRawEvtPixelIter; 20 class MRawRunHeader; 19 21 20 class MPedCalcFromLoGain : public M Extractor22 class MPedCalcFromLoGain : public MTask 21 23 { 22 24 static const UShort_t fgCheckWinFirst; // First FADC slice to check for signal (currently set to: 0) … … 26 28 static const UShort_t fgMaxSignalVar; // The maximum difference between the highest and lowest slice 27 29 28 MGeomCam *fGeom; // Camera geometry 30 MGeomCam *fGeom; //! Camera geometry 31 MPedestalCam *fPedestals; //! Pedestals of all pixels in the camera 32 MRawEvtData *fRawEvt; //! Raw event data (time slices) 33 MRawRunHeader *fRunHeader; //! RunHeader information 29 34 30 UInt_t fNumEventsDump; 35 UInt_t fNumEventsDump; // Number of event after which MPedestalCam gets updated 31 36 32 37 UShort_t fMaxSignalVar; 33 38 UShort_t fCheckWinFirst; 34 39 UShort_t fCheckWinLast; 35 UShort_t fExtractWinSize; 40 UShort_t fExtractWinSize; // Number of slices to calculate the pedestal from 36 41 UShort_t fExtractWinFirst; 37 42 UShort_t fExtractWinLast; -
trunk/MagicSoft/Mars/msignal/MExtractor.cc
r5368 r5381 403 403 } 404 404 405 // Be carefull: Returning kERROR is not forseen in derived classes 405 406 return rc; 406 407 } -
trunk/MagicSoft/Mars/msignal/MExtractor.h
r5362 r5381 78 78 Bool_t IsNoiseCalculation () const { return fNoiseCalculation; } 79 79 80 virtual void SetRange ( Byte_t hifirst=0, Byte_t hilast=0, Byte_t lofirst=0, Byte_t lolast=0);80 virtual void SetRange(Byte_t hifirst=0, Byte_t hilast=0, Byte_t lofirst=0, Byte_t lolast=0); 81 81 82 void SetOffsetLoGain ( const Float_t f=fgOffsetLoGain){ fOffsetLoGain = f; }83 void SetSaturationLimit ( Byte_t lim=fgSaturationLimit ) { fSaturationLimit = lim;}84 void SetNamePedestalCam (const char *name=fgNamePedestalCam.Data()) { fNamePedestalCam = name; }85 void SetNoiseCalculation( const Bool_t b=kFALSE ) { fNoiseCalculation = b;}82 void SetOffsetLoGain(const Float_t f=fgOffsetLoGain) { fOffsetLoGain = f; } 83 void SetSaturationLimit(Byte_t lim=fgSaturationLimit) { fSaturationLimit = lim; } 84 void SetNamePedestalCam(const char *name=fgNamePedestalCam.Data()) { fNamePedestalCam = name; } 85 void SetNoiseCalculation(const Bool_t b=kTRUE) { fNoiseCalculation = b; } 86 86 87 87 void Print(Option_t *o="") const;
Note:
See TracChangeset
for help on using the changeset viewer.