Changeset 6150 for trunk


Ignore:
Timestamp:
01/31/05 16:04:49 (20 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r6141 r6150  
    2020
    2121                                                 -*-*- END OF LINE -*-*-
     22
     23 2005/01/31 Markus Gaug
     24 
     25  * mjobs/MJob.[h,cc]
     26  * mjobs/MJCalibrateSignal.[h,cc]
     27  * mjobs/MJCalibration.[h,cc]
     28    - move file type enum to base class
     29
     30  * mjobs/MJCalibrateSignal.[h,cc]
     31    - allow also for direct setting of an MRunIter (not used in callisto).
     32
    2233
    2334 2005/01/31 Abelardo Moralejo
  • trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc

    r6084 r6150  
    4444
    4545#include "MDirIter.h"
     46#include "MRunIter.h"
    4647#include "MParList.h"
    4748#include "MTaskList.h"
     
    116117//
    117118MJCalibrateSignal::MJCalibrateSignal(const char *name, const char *title)
    118   : fDataFlag(0), fIsInterlaced(kTRUE), fIsRelTimesUpdate(kFALSE), fIsHiLoCalibration(kFALSE)
     119  : fRuns(0), fIsInterlaced(kTRUE), fIsRelTimesUpdate(kFALSE), fIsHiLoCalibration(kFALSE)
    119120{
    120121    fName  = name  ? name  : "MJCalibrateSignal";
     
    213214    if (!fSequence.IsValid())
    214215    {
    215         *fLog << err << "ERROR - Sequence invalid!" << endl;
    216         return kFALSE;
     216        if (!fRuns)
     217        {
     218          *fLog << err << "ERROR - Sequence invalid and no runs chosen!" << endl;
     219          return kFALSE;
     220        }
     221
     222        if (fRuns->GetNumRuns() != fRuns->GetNumEntries())
     223        {
     224            *fLog << err << "Number of files found doesn't match number of runs... abort."
     225                << fRuns->GetNumRuns() << " vs. " << fRuns->GetNumEntries() << endl;
     226            return kFALSE;
     227        }
     228        *fLog << "Calibrate data from ";
     229        *fLog << "Runs " << fRuns->GetRunsAsString() << endl;
     230        *fLog << endl;
    217231    }
    218232
     
    339353    plist.AddToList(&tlist);
    340354
    341     /*
    342     TString name = iter.Next();
    343     Byte_t filetype = MRawFileRead::IsFileValid(name);
    344     if (!filetype)
    345         filetype = MReadMarsFile::IsFileValid(name)+1;
    346     if (filetype<1||filetype>3)
    347     {
    348         gLog << err << "ERROR - FileType #" << (int)filetype << " of first file " << name << " unknown..." << endl;
    349         return kFALSE;
    350     } */
    351 
    352355    MReadReports readreal;
    353356    readreal.AddTree("Events", "MTime.", kTRUE);
     
    362365    MRawFileRead rawread(NULL);
    363366    if (IsRawData())
    364         rawread.AddFiles(iter);
     367        rawread.AddFiles(fSequence.IsValid() ? iter : *fRuns);
    365368    else
    366         readreal.AddFiles(iter);
     369        readreal.AddFiles(fSequence.IsValid() ? iter : *fRuns);
    367370
    368371    MPointingPosInterpolate pextr;
  • trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.h

    r6047 r6150  
    88class TEnv;
    99class TList;
    10 
     10class MRunIter;
    1111class MTask;
    1212class MParList;
     
    2121private:
    2222
    23     enum DataType_t {
    24       kIsRawData,
    25       kIsRootData,
    26       kIsMC
    27     };
     23    MRunIter *fRuns;                    // Data files
    2824
    29     Byte_t fDataFlag;                   // Bit-field to store the data type
    3025    Bool_t fIsInterlaced;               // Distinguish interlaced from other calibration
    3126    Bool_t fIsRelTimesUpdate;           // Choose to update relative times from interlaced
     
    4035                           MExtractor* &ext1, MExtractor* &ext2, TString &geom) const;
    4136
    42     Bool_t IsRawData()  const { return TESTBIT(fDataFlag,kIsRawData);  }
    43     Bool_t IsRootData() const { return TESTBIT(fDataFlag,kIsRootData); }
    44     Bool_t IsMC()       const { return TESTBIT(fDataFlag,kIsMC);       }
    45 
    46     void   SetRawData ( const Bool_t b=kTRUE )  { b ? SETBIT(fDataFlag,kIsRawData)  : CLRBIT(fDataFlag,kIsRawData);  }
    47     void   SetRootData( const Bool_t b=kTRUE )  { b ? SETBIT(fDataFlag,kIsRootData) : CLRBIT(fDataFlag,kIsRootData); }
    48     void   SetMC      ( const Bool_t b=kTRUE )  { b ? SETBIT(fDataFlag,kIsMC)       : CLRBIT(fDataFlag,kIsMC);       }
    49 
    5037public:
    5138    MJCalibrateSignal(const char *name=NULL, const char *title=NULL);
     
    5744    void SetHiLoCalibration( const Bool_t b=kTRUE )  { fIsHiLoCalibration = b; }
    5845
     46    void SetInput          ( MRunIter *iter       )  { fRuns = iter; }
     47
    5948    ClassDef(MJCalibrateSignal, 0) // Tool to create a pedestal file (MPedestalCam)
    6049};
  • trunk/MagicSoft/Mars/mjobs/MJCalibration.cc

    r6137 r6150  
    14281428    SetGeometry(GetEnv("Geometry", fGeometry));
    14291429
     1430    SetRootData();
     1431
     1432    if (HasEnv("MC"))
     1433    {
     1434      fDataFlag = 0;
     1435      SetMC();
     1436    }
     1437
     1438    if (HasEnv("RawData") || IsDataCheck())
     1439    {
     1440      fDataFlag = 0;
     1441      SetRawData();
     1442    }
     1443
    14301444    fReferenceFile = GetEnv("ReferenceFile",fReferenceFile.Data());
    14311445
     
    16281642    if (fSequence.IsValid())
    16291643    {
    1630         const Int_t n0 = fSequence.SetupCalRuns(iter, fPathData, "C", IsDataCheck());
     1644        const Int_t n0 = fSequence.SetupCalRuns(iter, fPathData, "C", IsRawData());
    16311645        const Int_t n1 = fSequence.GetNumCalRuns();
    16321646        if (n0==0)
     
    16881702    MRawFileRead rawread(NULL);
    16891703
    1690     if (IsDataCheck())
     1704    if (IsRawData())
    16911705    {
    16921706        rawread.AddFiles(fSequence.IsValid() ? iter : *fRuns);
     
    18521866    if (!evtloop.Eventloop())
    18531867    {
     1868      //        DisplayResult(plist);
     1869      //        WriteResult(plist);
    18541870        *fLog << err << GetDescriptor() << ": Failed." << endl;
    18551871        return kFALSE;
  • trunk/MagicSoft/Mars/mjobs/MJob.cc

    r6078 r6150  
    5252// Default constructor.
    5353//
    54 // Sets fRuns to 0, fExtractor to NULL, fDataCheck to kFALSE
    55 //
    56 MJob::MJob(const char *name, const char *title) : fEnv(0), fOverwrite(kFALSE), fMaxEvents(0)
     54// Sets fDataFlag to 0
     55//
     56MJob::MJob(const char *name, const char *title) : fEnv(0), fDataFlag(0), fOverwrite(kFALSE), fMaxEvents(0)
     57 
    5758{
    5859    fName  = name  ? name  : "MJob";
  • trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeDigitalFilterPeakSearch.cc

    r6149 r6150  
    7979const Byte_t MExtractTimeAndChargeDigitalFilterPeakSearch::fgHiGainFirst             =  0;
    8080const Byte_t MExtractTimeAndChargeDigitalFilterPeakSearch::fgHiGainLast              = 20;
    81 const Byte_t MExtractTimeAndChargeDigitalFilterPeakSearch::fgLoGainFirst             =  3;
     81const Byte_t MExtractTimeAndChargeDigitalFilterPeakSearch::fgLoGainFirst             =  1;
    8282const Byte_t MExtractTimeAndChargeDigitalFilterPeakSearch::fgLoGainLast              = 14;
    83 const Byte_t MExtractTimeAndChargeDigitalFilterPeakSearch::fgOffsetLeftFromPeak      =  2;
     83const Byte_t MExtractTimeAndChargeDigitalFilterPeakSearch::fgOffsetLeftFromPeak      =  1;
    8484const Byte_t MExtractTimeAndChargeDigitalFilterPeakSearch::fgOffsetRightFromPeak     =  3;
    8585const Byte_t MExtractTimeAndChargeDigitalFilterPeakSearch::fgPeakSearchWindowSize    =  2;
Note: See TracChangeset for help on using the changeset viewer.