Changeset 5387 for trunk/MagicSoft/Mars
- Timestamp:
- 11/11/04 13:52:49 (20 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r5386 r5387 33 33 34 34 35 35 36 2004/11/11: Thomas Bretz 36 37 37 38 * callisto.cc: 38 39 - fixed a typo in the screen output 40 - added setting of input path to second call to MJPedestal 41 to get the extraction window from the calibration file 39 42 40 43 * mastro/MAstroCamera.cc: … … 76 79 - simplified a complicated if-else-construction towards a 77 80 correct setting of ranges also for the calibration of the signal. 81 - added reading of extraction window from calibration file 82 (ReadCalibration) 83 - made sure that in the case of an extractor from a calibration file 84 the extraction window for pedestals is correctly set 85 86 * mbase/MEvtLoop.cc: 87 - updated a comment 88 89 * msignal/MExtractor.cc: 90 - added printing hi-gain samples 91 78 92 79 93 … … 87 101 on the text messages. At high energies the underestimation of Q 88 102 could be as large as a 20%. 103 104 89 105 90 106 2004/11/10: Markus Gaug -
trunk/MagicSoft/Mars/callisto.cc
r5378 r5387 343 343 job1.SetEnvDebug(kDebugEnv); 344 344 job1.SetDisplay(d);; 345 //job1.SetPathIn(kInpathY); // not yet needed345 job1.SetPathIn(kInpathY); 346 346 //job1.SetPathOut(kOutpathY); // not yet needed 347 347 job1.SetPathData(kInpathD); -
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) -
trunk/MagicSoft/Mars/mpedestal/MPedCalcFromLoGain.cc
r5381 r5387 325 325 Int_t MPedCalcFromLoGain::PreProcess(MParList *pList) 326 326 { 327 328 327 Clear(); 329 328 … … 441 440 442 441 // 2. Scale the variance to the number of slices: 443 var /= (Float_t)(fExtractWinSize);442 var /= fExtractWinSize; 444 443 445 444 // 3. Calculate the RMS from the Variance: … … 648 647 *fLog << GetDescriptor() << ":" << endl; 649 648 *fLog << "Parameters used for pedestal calculation from " << fNamePedestalCam << ":"<<endl; 650 *fLog << "CheckWindow from slice " << fCheckWinFirst << " to " << fCheckWinLast<< endl;651 *fLog << "ExtractWindow from slice " << fExtractWinFirst << " to " << fExtractWinLast << endl;649 *fLog << "CheckWindow from slice " << fCheckWinFirst << " to " << fCheckWinLast << " included." << endl; 650 *fLog << "ExtractWindow from slice " << fExtractWinFirst << " to " << fExtractWinLast << " included." << endl; 652 651 *fLog << "Max allowed signal variation: " << fMaxSignalVar << endl; 653 652 *fLog << "Pedestal Update is " << (fPedestalUpdate?"on":"off") << endl; -
trunk/MagicSoft/Mars/msignal/MExtractor.cc
r5381 r5387 416 416 *fLog << " Hi Gain Range: " << (int)fHiGainFirst << " " << (int)fHiGainLast << endl; 417 417 *fLog << " Lo Gain Range: " << (int)fLoGainFirst << " " << (int)fLoGainLast << endl; 418 *fLog << " Num Samples Hi: " << fNumHiGainSamples << endl; 419 *fLog << " Num Samples Lo: " << fNumHiGainSamples << endl; 418 420 *fLog << " Saturation Lim: " << (int)fSaturationLimit << endl; 419 421 }
Note:
See TracChangeset
for help on using the changeset viewer.