Changeset 6302 for trunk/MagicSoft


Ignore:
Timestamp:
02/09/05 10:04:53 (20 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r6296 r6302  
    2121                                                 -*-*- END OF LINE -*-*-
    2222
     23 2005/02/09 Markus Gaug
     24
     25   * mjobs/MJPedestal.[h,cc]
     26   * mjobs/badpixels_0_559.rc
     27     - allow exclusion of bad pixels from the beginning (default is
     28       Pixel 0 and 559).
     29
     30
    2331 2005/02/08 Markus Gaug
    2432 
     
    2634   * mcalib/MCalibrationChargeCalc.cc
    2735     - replaced GetNumExecutions()==0 condition by GetNumExecution() < 1
     36
    2837
    2938 2005/02/08 Thomas Bretz
  • trunk/MagicSoft/Mars/mjobs/MJPedestal.cc

    r6281 r6302  
    4545#include <TPad.h>
    4646#include <TEnv.h>
     47#include <TH2F.h>
    4748
    4849// mars core
     
    8586#include "MPedCalcFromLoGain.h"
    8687
     88#include <fstream>
     89
    8790ClassImp(MJPedestal);
    8891
     
    9093
    9194const TString  MJPedestal::fgReferenceFile = "mjobs/pedestalref.rc";
     95const TString  MJPedestal::fgBadPixelsFile = "mjobs/badpixels_0_559.rc";
    9296// --------------------------------------------------------------------------
    9397//
     
    111115    SetPathIn("");
    112116    SetReferenceFile();
     117    SetBadPixelsFile();
    113118
    114119    //
     
    149154const char* MJPedestal::GetOutputFileName() const
    150155{
    151     if (fSequence.IsValid())
    152         return Form("pedest%08d.root", fSequence.GetSequence());
    153 
    154     if (!fRuns)
    155         return "";
    156 
    157     return Form("%s-F0.root", (const char*)fRuns->GetRunsAsFileName());
     156
     157  if (fSequence.IsValid())
     158    return Form("pedest%08d.root", fSequence.GetSequence());
     159 
     160  if (!fRuns)
     161    return "";
     162 
     163  return Form("%s-F0.root", (const char*)fRuns->GetRunsAsFileName());
    158164}
    159165
     
    815821    SetExtractor((MExtractor*)tenv.GetTask());
    816822
    817     fReferenceFile = GetEnv("ReferenceFile", fReferenceFile.Data());
     823    fBadPixelsFile = GetEnv("BadPixelsFile",fBadPixelsFile.Data());
     824    fReferenceFile = GetEnv("ReferenceFile",fReferenceFile.Data());
    818825    ReadReferenceFile();
    819826
     
    934941    plist.AddToList(&fBadPixels);
    935942   
     943    //
     944    // Read bad pixels from outside
     945    //
     946    if (!fBadPixelsFile.IsNull())
     947      {
     948        *fLog << err << "Excluding: " << fBadPixelsFile << endl;
     949        ifstream f(fBadPixelsFile.Data());
     950        fBadPixels.AsciiRead((istream&)f); 
     951        f.close();
     952      }
     953
    936954    MGeomApply geomapl;
    937955    MBadPixelsMerge merge(&fBadPixels);
     
    943961    pedlogain.SetPedestalUpdate(kFALSE);
    944962
    945     MHPedestalCam hpedcam;
    946     hpedcam.SetRenorm(kTRUE);
     963    fPedestalHist.SetRenorm(kTRUE);
    947964   
    948     MFillH fillped(&hpedcam, "MExtractedSignalCam", "FillPedestalCam");
     965    MFillH fillped(&fPedestalHist, "MExtractedSignalCam", "FillPedestalCam");
    949966    fillped.SetBit(MFillH::kDoNotDisplay);
    950967
     
    967984    sel.SetNumSelectEvts(0);
    968985
    969     if (fExtractionType!=kFundamental)
     986    if (fExtractionType!=kFundamental && fExtractType!=kUseHists)
    970987      {
    971988        fExtractor->SetFilter(&sel);
     
    10021019        }
    10031020
     1021        fExtractor->SetPedestals(&fPedestalCamIn);
     1022        plist.AddToList(&fPedestalHist);
    10041023        tlist.AddToList(fExtractor);
    10051024        tlist.AddToList(&fillped);
  • trunk/MagicSoft/Mars/mjobs/MJPedestal.h

    r6281 r6302  
    22#define MARS_MJPedestal
    33
     4#ifndef MARS_MJob
     5#include "MJob.h"
     6#endif
    47#ifndef MARS_MJCalib
    58#include "MJCalib.h"
     
    710#ifndef MARS_MPedestalCam
    811#include "MPedestalCam.h"
     12#endif
     13#ifndef MARS_MHPedestalCam
     14#include "MHPedestalCam.h"
    915#endif
    1016#ifndef MARS_MBadPixelsCam
     
    2026class MEvtLoop;
    2127
    22 class MJPedestal : public MJCalib
     28class MJPedestal : public MJob, public MJCalib
    2329{
    2430private:
    2531
    2632    static const TString  fgReferenceFile;   //! default for fReferenceFile ("pedestalref.rc")
     33    static const TString  fgBadPixelsFile;   //! default for fBadPixelsFile ("badpixels_0_559.rc")
    2734
    2835    Axis_t fPedestalMin;                     //! Minimum Axis value for pedestal datacheck display
     
    4350    Float_t fRefPedRmsGalacticOuter;         //! Ref. line ped. RMS for galactic source - outer pixels
    4451
    45     TString     fReferenceFile;              // File name containing the reference values
    46 
     52    TString fReferenceFile;                  // File name containing the reference values
     53    TString fBadPixelsFile;                  // File name containing the bad pixels excluded beforehand
     54   
    4755    MExtractor *fExtractor;                  // Signal extractor, used to find the nr. of used FADC slices
    4856
     
    5058    MPedestalCam  fPedestalCamOut;           // Created pedestal results
    5159    MBadPixelsCam fBadPixels;                // Bad Pixels
    52 
     60    MHPedestalCam fPedestalHist;             // Histogramming pedestal Camera
     61   
    5362    enum Display_t { kDisplayNone, kDisplayNormal, kDisplayDataCheck }; // Possible Display types
    5463    Display_t fDisplayType;                  // Chosen Display type
     
    7685
    7786    Bool_t CheckEnvLocal();
    78     void ReadReferenceFile();
    7987
    8088    const char*  GetOutputFileName() const;
     
    8997    const char*  GetOutputFile() const;
    9098
     99    MHPedestalCam &GetPedestalHist()   { return fPedestalHist;  }
     100   
    91101    const Bool_t IsUseData() const { return fExtractType == kUseData; }
    92102
     
    108118    void SetExtractionWithExtractor()     { fExtractionType=kWithExtractor;     /*fPedestalCamOut.SetName("MPedestalExtractor");*/     }
    109119
    110     void SetReferenceFile( const TString ref=fgReferenceFile) { fReferenceFile = ref; } // Only usefull to overwrite CheckEnvLocal-default
     120    void SetReferenceFile( const TString ref=fgReferenceFile ) { fReferenceFile = ref; }
     121    void SetBadPixelsFile( const TString ref=fgBadPixelsFile ) { fBadPixelsFile = ref; }
    111122
    112123    MExtractor *GetExtractor() const { return fExtractor; }
Note: See TracChangeset for help on using the changeset viewer.