Ignore:
Timestamp:
04/04/05 10:11:18 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mjobs
Files:
9 edited

Legend:

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

    r6891 r6906  
    120120        gSystem->ExpandPathName(dir);
    121121
     122        // Set default sequence file and dir name
    122123        if (name.IsNull())
    123         {
    124             // Replace with correct default name
    125             name = Form("/data2/wuerzburg/sequences/sequence%08d.txt", num[i]);
    126         }
    127         /*
     124            name = Form("/magic/sequences/%04d/sequence%08d.txt", num[i]/1000, num[i]);
    128125        if (dir.IsNull())
    129         {
    130             // Replace with default dir
    131         }
    132         */
     126            name = Form("/magic/data/star/%04d/%08d", num[i]/1000, num[i]);
    133127
    134128        if (gSystem->AccessPathName(name, kFileExists))
     
    140134        list.Add(new TNamed(name, dir));
    141135    }
     136
     137    // For the synchronization we must make sure, that all sequences are
     138    // in the correct order...
     139    list.Sort();
    142140}
    143141
     
    236234}
    237235
    238 Bool_t MDataSet::AddSequencesToList(const TList &list, MRead &read, char *id, Bool_t raw)
     236Bool_t MDataSet::AddSequencesToList(const TList &list, MRead &read)
    239237{
    240238    MDirIter files;
     
    252250
    253251        const TString dir(o->GetTitle());
    254         seq.SetupDatRuns(files, dir.IsNull() ? 0 : dir.Data(), id, raw);
     252        seq.SetupDatRuns(files, MSequence::kImages, dir.IsNull() ? 0 : dir.Data());
    255253    }
    256254
     
    264262}
    265263
    266 Bool_t MDataSet::AddFiles(MRead &read, char *id, Bool_t raw) const
    267 {
    268     const Bool_t rc1 = AddFilesOff(read, id, raw);
    269     const Bool_t rc2 = AddFilesOn(read, id, raw);
     264Bool_t MDataSet::AddFiles(MRead &read) const
     265{
     266    const Bool_t rc1 = AddFilesOff(read);
     267    const Bool_t rc2 = AddFilesOn(read);
    270268    return rc1 && rc2;
    271269}
    272270
    273 Bool_t MDataSet::AddFilesOn(MRead &read, char *id, Bool_t raw) const
    274 {
    275     return AddSequencesToList(fSequencesOn, read, id, raw);
    276 }
    277 
    278 Bool_t MDataSet::AddFilesOff(MRead &read, char *id, Bool_t raw) const
    279 {
    280     return AddSequencesToList(fSequencesOff, read, id, raw);
     271Bool_t MDataSet::AddFilesOn(MRead &read) const
     272{
     273    return AddSequencesToList(fSequencesOn, read);
     274}
     275
     276Bool_t MDataSet::AddFilesOff(MRead &read) const
     277{
     278    return AddSequencesToList(fSequencesOff, read);
    281279}
    282280
  • trunk/MagicSoft/Mars/mjobs/MDataSet.h

    r6891 r6906  
    5454
    5555    // Setter
    56     static Bool_t AddSequencesToList(const TList &list, MRead &read, char *id="I", Bool_t raw=kFALSE);
     56    static Bool_t AddSequencesToList(const TList &list, MRead &read);
    5757
    58     Bool_t AddFiles(MRead &read,    char *id="I", Bool_t raw=kFALSE) const;
    59     Bool_t AddFilesOn(MRead &read,  char *id="I", Bool_t raw=kFALSE) const;
    60     Bool_t AddFilesOff(MRead &read, char *id="I", Bool_t raw=kFALSE) const;
     58    Bool_t AddFiles(MRead &read) const;
     59    Bool_t AddFilesOn(MRead &read) const;
     60    Bool_t AddFilesOff(MRead &read) const;
    6161
    6262    // TObject
  • trunk/MagicSoft/Mars/mjobs/MJCalibTest.cc

    r6874 r6906  
    317317  if (fSequence.IsValid())
    318318    {
    319       const Int_t n0 = fSequence.SetupCalRuns(iter, fPathData, "C", IsUseRawData());
     319      const Int_t n0 = fSequence.SetupCalRuns(iter, fPathData, IsUseRawData());
    320320      const Int_t n1 = fSequence.GetNumCalRuns();
    321321      if (n0==0)
  • trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc

    r6874 r6906  
    317317    if (fSequence.IsValid())
    318318      {
    319         const Int_t n0 = fSequence.SetupDatRuns(iter, fPathData, "D", IsUseRawData());
     319        const Int_t n0 = fSequence.SetupDatRuns(iter, fPathData, IsUseRawData());
    320320        const Int_t n1 = fSequence.GetNumDatRuns();
    321321        if (n0==0)
     
    671671    write.AddContainer("MRawEvtHeader",             "Events");
    672672    //write.AddContainer("MArrivalTime",              "Events",     kFALSE);
    673     write.AddContainer("MPointingPos",              "Events",     kFALSE);
     673    //write.AddContainer("MPointingPos",              "Events",     kFALSE);
    674674    // Slow-Control: Current-tree
    675675    write.AddContainer("MTimeCurrents",             "Currents",   kFALSE);
     
    770770
    771771    // Setup List for Drive-tree
    772     MPointingPosCalc pcalc;
     772    //MPointingPosCalc pcalc;
    773773
    774774    // Now setup main tasklist
     
    782782    tlist.AddToList(&tlist2, IsUseRootData() ? "Events" : "All");
    783783
    784     if (IsUseMC())
    785       tlist.AddToList(&pcalc, "Drive");
     784    //if (IsUseMC())
     785    //  tlist.AddToList(&pcalc, "Drive");
    786786
    787787    tlist.AddToList(&write);
  • trunk/MagicSoft/Mars/mjobs/MJCalibration.cc

    r6887 r6906  
    17621762    if (fSequence.IsValid())
    17631763    {
    1764         const Int_t n0 = fSequence.SetupCalRuns(iter, fPathData, "C", IsUseRawData());
     1764        const Int_t n0 = fSequence.SetupCalRuns(iter, fPathData, IsUseRawData());
    17651765        const Int_t n1 = fSequence.GetNumCalRuns();
    17661766        if (n0==0)
  • trunk/MagicSoft/Mars/mjobs/MJPedestal.cc

    r6874 r6906  
    963963    {
    964964        const Int_t n0 = IsUseData()
    965           ? fSequence.SetupDatRuns(iter, fPathData, "D", IsUseRawData())
    966           : fSequence.SetupPedRuns(iter, fPathData, "P", IsUseRawData());
     965          ? fSequence.SetupDatRuns(iter, fPathData, IsUseRawData())
     966          : fSequence.SetupPedRuns(iter, fPathData, IsUseRawData());
    967967        const Int_t n1 = IsUseData()
    968968          ? fSequence.GetNumDatRuns()
  • trunk/MagicSoft/Mars/mjobs/MJStar.cc

    r6877 r6906  
    332332
    333333    MPointingPosCalc pcalc;
    334     //MSrcPosFromModel srcpos;
    335 
    336     MTaskList tlist3("Drive");
    337     tlist3.AddToList(&pcalc);
    338     //tlist3.AddToList(&srcpos);
    339334
    340335    tlist.AddToList(ismc ? (MTask*)&readmc : (MTask*)&readreal);
    341     tlist.AddToList(&tlist3, "Drive");
     336    tlist.AddToList(&pcalc,  ismc ? "Events" : "Drive");
    342337    tlist.AddToList(&tlist2, "Events");
    343338    tlist.AddToList(&write);
  • trunk/MagicSoft/Mars/mjobs/MSequence.cc

    r6858 r6906  
    172172    }
    173173}
    174 
    175 const TString MSequence::GetStandardPath(Bool_t raw) const
    176 {
    177     TString d("/magic/data/");
    178     d += raw ? "rawfiles/" : "merpp/";
    179     return d;
    180 }
    181 
     174/*
    182175UInt_t MSequence::SetupRuns(MDirIter &iter, const TArrayI &arr, const char *path, char *id, Bool_t raw) const
    183176{
     
    187180    if (d.IsNull())
    188181    {
    189         d = GetStandardPath(raw);
     182        d = GetStandardPath();
     183        d += raw ? "rawfiles/" : "merpp/";
    190184        d += fNight.GetStringFmt("%Y/%m/%d");
    191185    }
     
    206200        n += Form(fmt, arr[i], id);
    207201        n += raw ? ".raw" : ".root";
     202
     203        // Add Path/File to TIter
     204        iter.AddDirectory(d, n, 0);
     205    }
     206
     207    return iter.GetNumEntries();
     208}
     209*/
     210UInt_t MSequence::SetupRuns(MDirIter &iter, const TArrayI &arr, FileType_t type, const char *path) const
     211{
     212    TString d(path);
     213
     214    // Setup path
     215    if (d.IsNull())
     216    {
     217        d = GetStandardPath();
     218        switch (type)
     219        {
     220        case kRawDat:
     221        case kRawPed:
     222        case kRawCal:
     223        case kRawAll:
     224            d += "rawfiles/";
     225            break;
     226        case kRootDat:
     227        case kRootPed:
     228        case kRootCal:
     229        case kRootAll:
     230            d += "merpp/";
     231            break;
     232        case kCalibrated:
     233            d += "callisto/";
     234            break;
     235        case kImages:
     236            d += "star/";
     237            break;
     238        }
     239        d += fNight.GetStringFmt("%Y/%m/%d");
     240    }
     241    else
     242        gSystem->ExpandPathName(d);
     243
     244    for (int i=0; i<arr.GetSize(); i++)
     245    {
     246        // R. DeLosReyes and T. Bretz
     247        // Changes to read the DAQ numbering format. Changes takes place
     248        // between runs 35487 and 00035488 (2004_08_30)
     249        const char *fmt = arr[i]>35487 ? "%08d_%s_*_E" : "%05d_%s_*_E";
     250
     251        TString n;
     252        char *id="_";
     253        switch (type)
     254        {
     255        case kRawDat:
     256        case kRootDat:
     257            id = "D";
     258            break;
     259        case kRawPed:
     260        case kRootPed:
     261            id = "P";
     262            break;
     263        case kRawCal:
     264        case kRootCal:
     265            id = "C";
     266            break;
     267        case kRawAll:
     268        case kRootAll:
     269            id = "[PCD]";
     270            break;
     271        case kCalibrated:
     272            id = "Y";
     273            break;
     274        case kImages:
     275            id = "I";
     276            break;
     277        }
     278
     279        // Create file name
     280        n =  fNight.GetStringFmt("%Y%m%d_");
     281        n += Form(fmt, arr[i], id);
     282
     283        switch (type)
     284        {
     285        case kRawDat:
     286        case kRawPed:
     287        case kRawCal:
     288        case kRawAll:
     289            n += ".raw";
     290            break;
     291        default:
     292            n += ".root";
     293        }
    208294
    209295        // Add Path/File to TIter
     
    369455// Using raw=kTRUE you get correspodning raw-files setup.
    370456// Return the number of files added.
    371 //
    372 UInt_t MSequence::SetupPedRuns(MDirIter &iter, const char *path, char *id, Bool_t raw) const
    373 {
    374     return SetupRuns(iter, fPedRuns, path, id, raw);
     457UInt_t MSequence::SetupPedRuns(MDirIter &iter, const char *path, Bool_t raw) const
     458{
     459    return SetupRuns(iter, fPedRuns, raw?kRawPed:kRootPed, path);
    375460}
    376461
     
    383468// Return the number of files added.
    384469//
    385 UInt_t MSequence::SetupDatRuns(MDirIter &iter, const char *path, char *id, Bool_t raw) const
    386 {
    387     return SetupRuns(iter, fDatRuns, path, id, raw);
     470UInt_t MSequence::SetupDatRuns(MDirIter &iter, const char *path, Bool_t raw) const
     471{
     472    return SetupRuns(iter, fDatRuns, raw?kRawPed:kRootPed, path);
    388473}
    389474
     
    396481// Return the number of files added.
    397482//
    398 UInt_t MSequence::SetupAllRuns(MDirIter &iter, const char *path, char *id, Bool_t raw) const
    399 {
    400     return SetupRuns(iter, fRuns, path, id, raw);
     483UInt_t MSequence::SetupAllRuns(MDirIter &iter, const char *path, Bool_t raw) const
     484{
     485    return SetupRuns(iter, fRuns, raw?kRawAll:kRootAll, path);
    401486}
    402487
     
    409494// Return the number of files added.
    410495//
    411 UInt_t MSequence::SetupCalRuns(MDirIter &iter, const char *path, char *id, Bool_t raw) const
    412 {
    413     return SetupRuns(iter, fCalRuns, path, id, raw);
     496UInt_t MSequence::SetupCalRuns(MDirIter &iter, const char *path, Bool_t raw) const
     497{
     498    return SetupRuns(iter, fCalRuns, raw?kRawCal:kRootCal, path);
     499}
     500
     501// --------------------------------------------------------------------------
     502//
     503// Add all data runs from the sequence to MDirIter.
     504// If path==0 the standard path of the data-center is assumed.
     505// If you have the runs locally use path="."
     506// Using raw=kTRUE you get correspodning raw-files setup.
     507// Return the number of files added.
     508//
     509UInt_t MSequence::SetupDatRuns(MDirIter &iter, FileType_t type, const char *path) const
     510{
     511    return SetupRuns(iter, fDatRuns, type, path);
    414512}
    415513
  • trunk/MagicSoft/Mars/mjobs/MSequence.h

    r6846 r6906  
    2020public:
    2121    enum LightCondition_t { kNA, kNoMoon, kTwilight, kMoon };
     22    enum FileType_t {
     23        kRawDat, kRawPed, kRawCal, kRawAll,
     24        kRootDat, kRootPed, kRootCal, kRootAll,
     25        kCalibrated, kImages
     26    };
    2227private:
    2328    UInt_t fSequence;
     
    5156    const char *GetFileName(UInt_t num);
    5257
    53     UInt_t SetupRuns(MDirIter &iter, const TArrayI &arr, const char *path, char *id, Bool_t raw=kFALSE) const;
     58    //UInt_t SetupRuns(MDirIter &iter, const TArrayI &arr, const char *path, char *id, Bool_t raw=kFALSE) const;
     59    UInt_t SetupRuns(MDirIter &iter, const TArrayI &arr, FileType_t type, const char *path=0) const;
    5460    UInt_t AddRuns(UInt_t first, UInt_t last, TArrayI *runs);
    5561
     
    7278    Bool_t IsValid() const { return fSequence!=(UInt_t)-1; }
    7379
    74     UInt_t SetupPedRuns(MDirIter &iter, const char *path=0, char *id="P", Bool_t raw=kFALSE) const;
    75     UInt_t SetupDatRuns(MDirIter &iter, const char *path=0, char *id="D", Bool_t raw=kFALSE) const;
    76     UInt_t SetupAllRuns(MDirIter &iter, const char *path=0, char *id="?", Bool_t raw=kFALSE) const;
    77     UInt_t SetupCalRuns(MDirIter &iter, const char *path=0, char *id="C", Bool_t raw=kFALSE) const;
    78 
     80    UInt_t SetupPedRuns(MDirIter &iter, const char *path=0, Bool_t raw=kFALSE) const;
     81    UInt_t SetupDatRuns(MDirIter &iter, const char *path=0, Bool_t raw=kFALSE) const;
     82    UInt_t SetupAllRuns(MDirIter &iter, const char *path=0, Bool_t raw=kFALSE) const;
     83    UInt_t SetupCalRuns(MDirIter &iter, const char *path=0, Bool_t raw=kFALSE) const;
     84    UInt_t SetupDatRuns(MDirIter &iter, FileType_t type, const char *path=0) const;
     85 /*
     86    UInt_t SetupPedRuns(MDirIter &iter, FileType_t type, const char *path=0);
     87    UInt_t SetupDatRuns(MDirIter &iter, FileType_t type, const char *path=0);
     88    UInt_t SetupAllRuns(MDirIter &iter, FileType_t type, const char *path=0);
     89    UInt_t SetupCalRuns(MDirIter &iter, FileType_t type, const char *path=0);
     90   */
    7991    // Getter
    8092    UInt_t GetNumAllRuns() const { return fRuns.GetSize(); }
     
    100112    const TString &GetSource() const { return fSource; }
    101113
    102     const TString GetStandardPath(Bool_t raw) const;
     114    const TString GetStandardPath() const { return "/magic/data/"; }
    103115
    104116    // Setter
Note: See TracChangeset for help on using the changeset viewer.