Changeset 6906


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

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r6905 r6906  
    2121
    2222                                                 -*-*- END OF LINE -*-*-
     23
     24 2005/04/04 Thomas Bretz
     25
     26   * callisto.cc, sinope.cc, mjobs/MDataSet.[h,cc], mjobs/MJCalibTest.cc,
     27     mjobs/MJCalibrateSignal.cc, mjobs/MJCalibration.cc,
     28     mjobs/MSequence.[h,cc]
     29     - changed setup procedure for paths to allow using standard
     30       paths everywhere
     31     - fixed to use new correct datacenter standard paths
     32
     33   * mhflux/MHAlpha.cc:
     34     - display correct error (excess/significance)
     35
     36   * mjobs/MJCalibrateSignal.cc, mjobs/MJPedestal.cc:
     37     - removed MPointingPosCalc from Tasklist
     38
     39   * mjobs/MJStar.cc:
     40    - added MPointingPosCalc to tasklist for "Events" in case of MC
     41
     42
    2343
    2444 2005/04/01 Thomas Bretz
  • trunk/MagicSoft/Mars/NEWS

    r6905 r6906  
    2727   - switched on bad pixel detection for a pedestal level
    2828     which is more than 5 times the variance
     29
     30   - Fixed default paths to be correct for the new data center
     31
     32   - Fixed handling of drive data. The pointing position in now
     33     copied to MPointingPos inside star for real and MC events
    2934
    3035
  • trunk/MagicSoft/Mars/callisto.cc

    r6888 r6906  
    124124
    125125    MDirIter Next1, Next2, Next3;
    126     seq.SetupPedRuns(Next1, kInpathD, "P", raw);
    127     seq.SetupCalRuns(Next2, kInpathD, "C", raw);
    128     seq.SetupDatRuns(Next3, kInpathD, "D", raw);
     126    seq.SetupPedRuns(Next1, kInpathD, raw);
     127    seq.SetupCalRuns(Next2, kInpathD, raw);
     128    seq.SetupDatRuns(Next3, kInpathD, raw);
    129129
    130130    gLog << all;
  • trunk/MagicSoft/Mars/mhflux/MHAlpha.cc

    r6905 r6906  
    197197        if (fit.FitEnergy(fHAlpha, fOffData, i))
    198198        {
     199            fHEnergy.SetBinContent(i, fit.GetEventsExcess());
    199200            if (fit.GetSignificance()>1)
    200             {
    201                 fHEnergy.SetBinContent(i, fit.GetEventsExcess());
    202201                fHEnergy.SetBinError(i, fit.GetEventsExcess()/fit.GetSignificance());
    203             }
     202            else
     203                fHEnergy.SetBinError(i, fit.GetEventsExcess());
    204204        }
    205205    }
     
    219219        if (fit.FitTheta(fHAlpha, fOffData, i))
    220220        {
     221            fHTheta.SetBinContent(i, fit.GetEventsExcess());
    221222            if (fit.GetSignificance()>1)
    222             {
    223                 fHTheta.SetBinContent(i, fit.GetEventsExcess());
    224223                fHTheta.SetBinError(i, fit.GetEventsExcess()/fit.GetSignificance());
    225             }
     224            else
     225                fHTheta.SetBinError(i, fit.GetEventsExcess());
    226226        }
    227227    }
     
    431431    //
    432432    fHTime.SetBinContent(n+1, fit.GetEventsExcess());
    433     fHTime.SetBinError(n+1, fit.GetEventsExcess()/fit.GetSignificance());
     433    if (fit.GetSignificance()>1)
     434        fHTime.SetBinError(n+1, fit.GetEventsExcess()/fit.GetSignificance());
     435    else
     436        fHTime.SetBinError(n+1, fit.GetEventsExcess());
    434437
    435438    *fLog << all << *fTimeEffOn << ": " << fit.GetEventsExcess() << endl;
  • 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
  • trunk/MagicSoft/Mars/sinope.cc

    r6888 r6906  
    239239
    240240    MDirIter Next;
    241     seq.SetupAllRuns(Next, kInpathD, "[PCD]", kTRUE);
     241    seq.SetupAllRuns(Next, kInpathD, kTRUE);
    242242
    243243    gLog << all;
     
    349349
    350350    if (kOutpath.IsNull())
    351         kOutpath = seq.GetStandardPath(kTRUE);
     351    {
     352        kOutpath = seq.GetStandardPath();
     353        kOutpath += "rawfiles/";
     354    }
    352355    if (!kOutpath.EndsWith("/"))
    353356        kOutpath += "/";
     
    392395
    393396    MDirIter iter;
    394     seq.SetupAllRuns(iter, 0, "[DPC]", kTRUE);
     397    seq.SetupAllRuns(iter, 0, kTRUE);
    395398
    396399    MRawFileRead read;
Note: See TracChangeset for help on using the changeset viewer.