Changeset 5387 for trunk/MagicSoft/Mars/mjobs
- Timestamp:
- 11/11/04 13:52:49 (20 years ago)
- Location:
- trunk/MagicSoft/Mars/mjobs
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc
r5381 r5387 336 336 pedlo.SetPedestalUpdate(kTRUE); 337 337 // FIXME: How to get the fixed value 15 automatically? 338 pedlo.SetExtractWindow(15, (Int_t)static_cast<MExtractor*>(extractor1)->GetNumHiGainSamples()); 338 const Float_t win = static_cast<MExtractor*>(extractor1)->GetNumHiGainSamples(); 339 pedlo.SetExtractWindow(15, (UShort_t)TMath::Nint(win)); 339 340 340 341 MMcPedestalCopy pcopy; -
trunk/MagicSoft/Mars/mjobs/MJPedestal.cc
r5381 r5387 165 165 } 166 166 167 MExtractor *MJPedestal::ReadCalibration() const 168 { 169 const TString fname = Form("%s/calib%06d.root", fPathIn.Data(), fSequence.GetSequence()); 170 171 *fLog << inf << "Reading from file: " << fname << endl; 172 173 TFile file(fname, "READ"); 174 if (!file.IsOpen()) 175 { 176 *fLog << err << dbginf << "ERROR - Could not open file " << fname << endl; 177 return NULL; 178 } 179 180 TObject *o = file.Get("ExtractSignal"); 181 if (o && !o->InheritsFrom(MExtractor::Class())) 182 { 183 *fLog << err << dbginf << "ERROR - ExtractSignal read from " << fname << " doesn't inherit from MExtractor!" << endl; 184 return NULL; 185 } 186 return o ? (MExtractor*)o->Clone() : NULL; 187 } 188 167 189 //--------------------------------------------------------------------------------- 168 190 // … … 664 686 MPedCalcFromLoGain pedlogain; 665 687 688 if (!fPathIn.IsNull()) 689 { 690 fExtractor = ReadCalibration(); 691 if (!fExtractor) 692 return kFALSE; 693 694 *fLog << all; 695 *fLog << underline << "Signal Extractor found in calibration file" << endl; 696 fExtractor->Print(); 697 *fLog << endl; 698 } 699 666 700 MTaskEnv taskenv("ExtractPedestal"); 667 701 switch (fExtractType) … … 671 705 if (!fExtractor) 672 706 break; 673 pedlogain.SetExtractWindow(15, (Int_t)fExtractor->GetNumHiGainSamples());707 pedlogain.SetExtractWindow(15, (Int_t)TMath::Nint(fExtractor->GetNumHiGainSamples())); 674 708 break; 675 709 … … 678 712 break; 679 713 taskenv.SetDefault(&pedcalc); 680 pedcalc.SetWindowSize((Int_t) fExtractor->GetNumHiGainSamples());714 pedcalc.SetWindowSize((Int_t)TMath::Nint(fExtractor->GetNumHiGainSamples())); 681 715 pedcalc.SetRange(fExtractor->GetHiGainFirst(), fExtractor->GetHiGainLast()); 682 716 break; … … 699 733 } 700 734 735 if (!fPathIn.IsNull()) 736 { 737 delete fExtractor; 738 fExtractor = 0; 739 } 740 701 741 tlist.AddToList(&geomapl); 702 742 tlist.AddToList(&merge); -
trunk/MagicSoft/Mars/mjobs/MJPedestal.h
r5361 r5387 58 58 Extract_t fExtractType; // Chosen extractor type 59 59 60 MExtractor *ReadCalibration() const; 60 61 Bool_t ReadPedestalCam(); 61 62 Bool_t WriteResult(); … … 67 68 void FixDataCheckHist(TH1D *hist) const; 68 69 69 Bool_t IsNoStorage () const { return TESTBIT(fStorage,kNoStorage);}70 Bool_t IsNoStorage() const { return TESTBIT(fStorage, kNoStorage); } 70 71 71 72 Bool_t CheckEnvLocal(); … … 78 79 const MBadPixelsCam &GetBadPixels() const { return fBadPixels; } 79 80 80 const char* GetOutputFile() const;81 const Bool_t IsDataCheck () const{ return fDataCheck; }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; }81 const char* GetOutputFile() const; 82 const Bool_t IsDataCheck() const { return fDataCheck; } 83 const Bool_t IsUseData() const { return fExtractType == kUseData; } 84 const Bool_t IsUseExtractor() const { return fExtractType == kUseExtractor; } 85 const Bool_t IsUsePedRun() const { return fExtractType == kUsePedRun; } 85 86 86 87 Bool_t Process (); 87 88 Bool_t ProcessFile(); 88 89 89 void SetBadPixels ( const MBadPixelsCam &bad) { bad.Copy(fBadPixels); } 90 void SetExtractor ( MExtractor* ext ) { fExtractor = ext; } 91 void SetInput ( MRunIter *iter ) { fRuns = iter; } 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; 96 b ? SetDataCheckDisplay() : SetNormalDisplay(); } 97 void SetDataCheckDisplay() { fDisplayType = kDataCheckDisplay; } 98 void SetNormalDisplay () { fDisplayType = kNormalDisplay; } 90 void SetBadPixels(const MBadPixelsCam &bad) { bad.Copy(fBadPixels); } 91 void SetExtractor(MExtractor* ext) { fExtractor = ext; } 92 void SetInput(MRunIter *iter) { fRuns = iter; } 93 void SetUseData() { fExtractType = kUseData; } 94 void SetUseExtractor() { fExtractType = kUseExtractor; } 95 void SetUsePedRun() { fExtractType = kUsePedRun; } 96 void SetDataCheck(const Bool_t b=kTRUE) { fDataCheck = b; b ? SetDataCheckDisplay() : SetNormalDisplay(); } 97 void SetDataCheckDisplay() { fDisplayType = kDataCheckDisplay; } 98 void SetNormalDisplay() { fDisplayType = kNormalDisplay; } 99 99 100 void SetPedContainerName(const char *name) 100 void SetPedContainerName(const char *name) { fPedestalCam.SetName(name); } 101 101 102 102 // Storage 103 void SetNoStorage ( const Bool_t b ) { b ? SETBIT(fStorage,kNoStorage) : CLRBIT(fStorage,kNoStorage); }104 void SetNormalStorage() { CLRBIT(fStorage,kNoStorage); }103 void SetNoStorage(const Bool_t b) { b ? SETBIT(fStorage, kNoStorage) : CLRBIT(fStorage,kNoStorage); } 104 void SetNormalStorage() { CLRBIT(fStorage, kNoStorage); } 105 105 106 106 ClassDef(MJPedestal, 0) // Tool to create a pedestal file (MPedestalCam)
Note:
See TracChangeset
for help on using the changeset viewer.