Changeset 5387 for trunk/MagicSoft/Mars


Ignore:
Timestamp:
11/11/04 13:52:49 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r5386 r5387  
    3333
    3434
     35
    3536 2004/11/11: Thomas Bretz
    3637
    3738   * callisto.cc:
    3839     - 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
    3942
    4043   * mastro/MAstroCamera.cc:
     
    7679     - simplified a complicated if-else-construction towards a
    7780       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
    7892
    7993
     
    87101       on the text messages. At high energies the underestimation of Q
    88102       could be as large as a 20%.
     103
     104
    89105
    90106 2004/11/10: Markus Gaug
  • trunk/MagicSoft/Mars/callisto.cc

    r5378 r5387  
    343343        job1.SetEnvDebug(kDebugEnv);
    344344        job1.SetDisplay(d);;
    345         //job1.SetPathIn(kInpathY);     // not yet needed
     345        job1.SetPathIn(kInpathY);
    346346        //job1.SetPathOut(kOutpathY);   // not yet needed
    347347        job1.SetPathData(kInpathD);
  • trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc

    r5381 r5387  
    336336    pedlo.SetPedestalUpdate(kTRUE);
    337337    // 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));
    339340
    340341    MMcPedestalCopy        pcopy;
  • trunk/MagicSoft/Mars/mjobs/MJPedestal.cc

    r5381 r5387  
    165165}
    166166
     167MExtractor *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
    167189//---------------------------------------------------------------------------------
    168190//
     
    664686    MPedCalcFromLoGain pedlogain;
    665687
     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
    666700    MTaskEnv taskenv("ExtractPedestal");
    667701    switch (fExtractType)
     
    671705        if (!fExtractor)
    672706            break;
    673         pedlogain.SetExtractWindow(15,(Int_t)fExtractor->GetNumHiGainSamples());
     707        pedlogain.SetExtractWindow(15, (Int_t)TMath::Nint(fExtractor->GetNumHiGainSamples()));
    674708        break;
    675709
     
    678712            break;
    679713        taskenv.SetDefault(&pedcalc);
    680         pedcalc.SetWindowSize((Int_t)fExtractor->GetNumHiGainSamples());
     714        pedcalc.SetWindowSize((Int_t)TMath::Nint(fExtractor->GetNumHiGainSamples()));
    681715        pedcalc.SetRange(fExtractor->GetHiGainFirst(), fExtractor->GetHiGainLast());
    682716        break;
     
    699733    }
    700734
     735    if (!fPathIn.IsNull())
     736    {
     737        delete fExtractor;
     738        fExtractor = 0;
     739    }
     740
    701741    tlist.AddToList(&geomapl);
    702742    tlist.AddToList(&merge);
  • trunk/MagicSoft/Mars/mjobs/MJPedestal.h

    r5361 r5387  
    5858  Extract_t fExtractType;                              // Chosen extractor type
    5959 
     60  MExtractor *ReadCalibration() const;
    6061  Bool_t ReadPedestalCam();
    6162  Bool_t WriteResult();
     
    6768  void   FixDataCheckHist(TH1D *hist) const;
    6869 
    69   Bool_t IsNoStorage    () const { return TESTBIT(fStorage,kNoStorage);    }
     70  Bool_t IsNoStorage() const { return TESTBIT(fStorage, kNoStorage); }
    7071 
    7172  Bool_t CheckEnvLocal();
     
    7879  const MBadPixelsCam &GetBadPixels() const { return fBadPixels;   }
    7980 
    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;   }
    8586 
    8687  Bool_t Process    ();
    8788  Bool_t ProcessFile();
    8889 
    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;    }
    9999 
    100   void SetPedContainerName(const char *name)    { fPedestalCam.SetName(name); }
     100  void SetPedContainerName(const char *name)  { fPedestalCam.SetName(name); }
    101101 
    102102  // 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); }
    105105 
    106106  ClassDef(MJPedestal, 0) // Tool to create a pedestal file (MPedestalCam)
  • trunk/MagicSoft/Mars/mpedestal/MPedCalcFromLoGain.cc

    r5381 r5387  
    325325Int_t MPedCalcFromLoGain::PreProcess(MParList *pList)
    326326{
    327 
    328327    Clear();
    329328
     
    441440
    442441  // 2. Scale the variance to the number of slices:
    443   var /= (Float_t)(fExtractWinSize);
     442  var /= fExtractWinSize;
    444443 
    445444  // 3. Calculate the RMS from the Variance:
     
    648647    *fLog << GetDescriptor() << ":" << endl;
    649648    *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;
    652651    *fLog << "Max allowed signal variation: " << fMaxSignalVar << endl;
    653652    *fLog << "Pedestal Update is " << (fPedestalUpdate?"on":"off") << endl;
  • trunk/MagicSoft/Mars/msignal/MExtractor.cc

    r5381 r5387  
    416416    *fLog << " Hi Gain Range:  " << (int)fHiGainFirst << " " << (int)fHiGainLast << endl;
    417417    *fLog << " Lo Gain Range:  " << (int)fLoGainFirst << " " << (int)fLoGainLast << endl;
     418    *fLog << " Num Samples Hi: " << fNumHiGainSamples << endl;
     419    *fLog << " Num Samples Lo: " << fNumHiGainSamples << endl;
    418420    *fLog << " Saturation Lim: " << (int)fSaturationLimit << endl;
    419421}
Note: See TracChangeset for help on using the changeset viewer.