Ignore:
Timestamp:
04/07/05 11:32:22 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mjobs
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mjobs/MJCalib.cc

    r6777 r6913  
    5454                     fRuns(NULL)
    5555{
     56  SetUseBlindPixel(kFALSE);
     57  SetUsePINDiode(kFALSE);
     58 
    5659  SetCheckedPixId();
    5760}
  • trunk/MagicSoft/Mars/mjobs/MJCalib.h

    r6777 r6913  
    3232    Byte_t fStorage;                    // Bit-field for chosen storage type
    3333
     34    enum  Device_t                                       // Possible devices for calibration
     35    {
     36        kUseBlindPixel,
     37        kUsePINDiode
     38    };
     39
     40    Byte_t fDevices;                                     // Bit-field for used devices for calibration
     41
    3442protected:
    3543
     
    5866    Bool_t IsUseMC()       const { return fDataFlag==kIsUseMC;       }
    5967
     68    Bool_t IsUseBlindPixel() const { return TESTBIT(fDevices,kUseBlindPixel); }
     69    Bool_t IsUsePINDiode  () const { return TESTBIT(fDevices,kUsePINDiode);   }
     70
    6071    void SetUseRawData () { fDataFlag=kIsUseRawData;  }
    6172    void SetUseRootData() { fDataFlag=kIsUseRootData; }
     
    7283    void SetPixelCheck     ( const Bool_t b=kTRUE )  { fIsPixelCheck        = b; }
    7384    void SetPulsePosCheck  ( const Bool_t b=kTRUE )  { fIsPulsePosCheck     = b; }
    74  
     85
     86    void SetUseBlindPixel(const Bool_t b=kTRUE) { b ? SETBIT(fDevices,kUseBlindPixel) : CLRBIT(fDevices,kUseBlindPixel); }
     87    void SetUsePINDiode(const Bool_t b=kTRUE)   { b ? SETBIT(fDevices,kUsePINDiode) : CLRBIT(fDevices,kUsePINDiode); }
     88
    7589    ClassDef(MJCalib, 0) // Base class for calibration jobs
    7690};
  • trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc

    r6907 r6913  
    9292#include "MTriggerPatternDecode.h"
    9393#include "MFTriggerPattern.h"
     94#include "MFTriggerLvl1.h"
    9495#include "MGeomApply.h"
    9596//#include "MMcPedestalCopy.h"
     
    179180}
    180181
    181 Bool_t MJCalibrateSignal::ReadCalibration(TObjArray &l, MBadPixelsCam &cam, MExtractor* &ext1, MExtractor* &ext2, TString &geom) const
     182Bool_t MJCalibrateSignal::ReadCalibration(TObjArray &l, MBadPixelsCam &cam, MExtractor* &ext2, MExtractor* &ext3, TString &geom) const
    182183{
    183184
     
    193194    }
    194195
    195     if (!ext1)
    196     {
    197         TObject *o = file.Get("ExtractSignal");
    198         if (o && !o->InheritsFrom(MExtractor::Class()))
    199         {
    200             *fLog << err << dbginf << "ERROR - ExtractSignal read from " << fname << " doesn't inherit from MExtractor!" << endl;
    201             return kFALSE;
    202         }
    203         ext1 = o ? (MExtractor*)o->Clone() : NULL;
    204     }
    205 
    206     TObject *o = file.Get("ExtractTime");
     196    TObject *o = file.Get("ExtractSignal");
     197    if (o && !o->InheritsFrom(MExtractor::Class()))
     198    {
     199        *fLog << err << dbginf << "ERROR - ExtractSignal read from " << fname << " doesn't inherit from MExtractor!" << endl;
     200        return kFALSE;
     201    }
     202    ext3 = o ? (MExtractor*)o->Clone() : NULL;
     203
     204    o = file.Get("ExtractTime");
    207205    if (o && !o->InheritsFrom(MExtractor::Class()))
    208206    {
     
    211209    }
    212210    ext2 = o ? (MExtractor*)o->Clone() : NULL;
    213     if (!ext1 && !ext2)
     211    if (!ext3 && !ext2)
    214212    {
    215213        *fLog << err << dbginf << "ERROR - Neither ExtractSignal nor ExrtractTime found in " << fname << "!" << endl;
     
    385383    calibcont.Add(&tmcam);
    386384
    387     if (!ReadCalibration(calibcont, badpix, extractor1, extractor2, geom))
     385    if (!ReadCalibration(calibcont, badpix, extractor2, extractor3, geom))
    388386        return kFALSE;
    389387
     
    394392        *fLog << inf << "No Camera geometry found using default <MGeomCamMagic>" << endl;
    395393
     394    if (extractor3)
     395    {
     396        *fLog << underline << "Signal Extractor found in calibration file" << endl;
     397        extractor3->Print();
     398        *fLog << endl;
     399    }
     400    else
     401        *fLog << inf << "No Signal Extractor: ExtractSignal in file." << endl;
     402
     403
    396404    if (extractor1)
    397405    {
    398       *fLog << underline << "Signal Extractor found in calibration file" << endl;
     406      *fLog << underline << "Modified Signal Extractor set by user." << endl;
    399407      extractor1->Print();
    400408      *fLog << endl;
    401       extractor3 = (MExtractor*)extractor1->Clone();
    402409    }
    403410    else
    404       *fLog << inf << "No Signal Extractor: ExtractSignal in file." << endl;
     411    {
     412        *fLog << inf << "No modified Signal Extractor set by user... using ExtractSignal." << endl;
     413        extractor1 = extractor3 ? (MExtractor*)extractor3->Clone() : 0;
     414    }
    405415
    406416    if (extractor2)
     
    455465   
    456466    // Skips empty MC events (Not necessary, but faster!)
    457     MContinue contmc("MRawEvtData.GetNumPixels<0.5", "ContEmptyMC");
     467    MFTriggerLvl1 trigmc;
     468    MContinue contmc(&trigmc, "ContTrigMC");
     469    contmc.SetInverted();
    458470
    459471    MPointingPosInterpolate pextr;
     
    718730        pacalc.SetFilter(&fcalib);
    719731        filcam.SetFilter(&fcalib);
    720         filtme.SetFilter(&fcalib);
    721         filbnd.SetFilter(&fcalib);
    722         filpin.SetFilter(&fcalib);
     732        filtme.SetFilter(&fcalib);
     733        if (IsUseBlindPixel())
     734            filbnd.SetFilter(&fcalib);
     735        if (IsUsePINDiode())
     736            filpin.SetFilter(&fcalib);
    723737        chcalc.SetFilter(&fcalib);
    724738        recalc.SetFilter(&fcalib);
     
    775789    tlist.AddToList(read);
    776790    if (IsUseMC())
     791    {
    777792        tlist.AddToList(&writemc);
    778     tlist.AddToList(&contmc);
     793        tlist.AddToList(&contmc);
     794    }
    779795
    780796    if (IsUseRootData())
  • trunk/MagicSoft/Mars/mjobs/MJCalibration.cc

    r6906 r6913  
    198198  fName  = name  ? name  : "MJCalibration";
    199199  fTitle = title ? title : "Tool to create the calibration constants for one calibration run";
    200  
    201   SetUseBlindPixel(kFALSE);
    202   SetUsePINDiode(kFALSE);
    203200 
    204201  SetHiLoCalibration();
     
    21052102}
    21062103
    2107 
    2108 // --------------------------------------------------------------------------
    2109 //
    2110 // Set the useage of the Blind Pixel device
    2111 //
    2112 void MJCalibration::SetUseBlindPixel(const Bool_t b)
    2113 {
    2114   b ? SETBIT(fDevices,kUseBlindPixel) : CLRBIT(fDevices,kUseBlindPixel);
    2115 }
    2116 
    2117 // --------------------------------------------------------------------------
    2118 //
    2119 // Set the useage of the PIN Diode device
    2120 //
    2121 void MJCalibration::SetUsePINDiode(const Bool_t b)
    2122 {
    2123   b ? SETBIT(fDevices,kUsePINDiode) : CLRBIT(fDevices,kUsePINDiode);
    2124 }
    2125 
    21262104/*
    21272105Bool_t MJCalibration::WriteEventloop(MEvtLoop &evtloop) const
  • trunk/MagicSoft/Mars/mjobs/MJCalibration.h

    r6771 r6913  
    125125  Display_t fDisplayType;                              // Chosen Display type
    126126 
    127   enum  Device_t                                       // Possible devices for calibration
    128     {
    129       kUseBlindPixel,
    130       kUsePINDiode
    131     };
    132  
    133   Byte_t fDevices;                                     // Bit-field for used devices for calibration
    134 
    135127  enum { kRelTimes, kDebug, kIntensity };  // Possible flags
    136128
     
    139131  TString fGeometry;                                   // Class name geometry
    140132 
    141   Bool_t IsUseBlindPixel() const { return TESTBIT(fDevices,kUseBlindPixel); }
    142   Bool_t IsUsePINDiode  () const { return TESTBIT(fDevices,kUsePINDiode);   }
    143 
    144133  Bool_t IsRelTimes     () const { return TESTBIT(fFlags,kRelTimes);       }
    145134  Bool_t IsDebug        () const { return TESTBIT(fFlags,kDebug);          }
     
    205194  void SetIntensity         ( const Bool_t b=kTRUE ) { b ? SETBIT(fFlags,kIntensity) : CLRBIT(fFlags,kIntensity); }
    206195 
    207   // Devices
    208   void SetUseBlindPixel(const Bool_t b=kTRUE);
    209   void SetUsePINDiode(const Bool_t b=kTRUE);
    210 
    211196  // Files
    212197  void SetReferenceFile( const TString ref=fgReferenceFile ) { fReferenceFile = ref; }
Note: See TracChangeset for help on using the changeset viewer.