Ignore:
Timestamp:
06/28/07 20:49:30 (17 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mmain
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mmain/MEventDisplay.cc

    r8611 r8617  
    11/* ======================================================================== *\
    2 ! $Name: not supported by cvs2svn $:$Id: MEventDisplay.cc,v 1.60 2007-06-26 16:59:21 tbretz Exp $
     2! $Name: not supported by cvs2svn $:$Id: MEventDisplay.cc,v 1.61 2007-06-28 19:49:30 tbretz Exp $
    33! --------------------------------------------------------------------------
    44!
     
    9595// Container
    9696//
     97#include "MSequence.h"                 // MSequence
     98#include "MDirIter.h"                  // MDirIter
    9799#include "MHillas.h"                   // MHillas::Print(const MGeomCam&)
    98100#include "MHillasExt.h"                // MHillasExt::Print(const MGeomCam&)
     
    118120//  Constructor.
    119121//
    120 MEventDisplay::MEventDisplay(const char *fname) : MStatusDisplay(), fEvtLoop(0)
     122MEventDisplay::MEventDisplay(const char *fname, const char *path) : MStatusDisplay(), fEvtLoop(0)
    121123{
    122124    //
    123125    // Setup Task list for hillas calculation
    124126    //
    125     SetupTaskList("Events", fname);
     127    SetupTaskList("Events", fname, path);
    126128
    127129    //
     
    163165{
    164166    TFile f(fname, "READ");
     167    if (f.IsZombie())
     168        return 0; // Not a root file
     169
    165170    TTree *t = (TTree*)f.Get(tree);
    166171    if (!t)
     
    181186//  preprocess tasks and read in first event (process)
    182187//
    183 void MEventDisplay::SetupTaskList(const char *tname, const char *fname)
    184 {
    185 //    MCalibrationChargeCam *ccam=0;
    186 //    MPedPhotCam           *pcam=0;
    187 
     188void MEventDisplay::SetupTaskList(const char *tname, TString fname, const char *path)
     189{
    188190    MBadPixelsCam *badpix = new MBadPixelsCam;
    189191
    190     const Int_t type = GetFileType(tname, fname);
     192    Int_t type = GetFileType(tname, fname);
    191193    switch (type)
    192194    {
     
    195197    case -2: gLog << err << "File type unknown... abort." << endl; return;
    196198    case -1: gLog << err << "Tree " << tname << " not found... abort." << endl; return;
    197     }
     199    case  0: gLog << inf << "Assuming Sequence file." << endl; break;
     200    }
     201
     202    if (type==0 && !MSequence::InflatePath(fname))
     203        return;
     204
     205    // Check if file is a sequence...
     206    MSequence *seq = type==0 ? new MSequence(fname, path) : new MSequence;
     207    if (type==0)
     208        type = 1;
    198209
    199210    //
     
    209220    plist->AddToList(tlist);
    210221    plist->AddToList(badpix);
    211 
    212     MReadMarsFile *read = new MReadMarsFile(tname, fname);
     222    plist->AddToList(seq);
     223
     224    MReadMarsFile *read = new MReadMarsFile(tname);
    213225    read->DisableAutoScheme();
     226    if (seq->IsValid())
     227    {
     228        MDirIter iter;
     229        if (seq->SetupDatRuns(iter, MSequence::kCalibrated)<=0)
     230            return;
     231        read->AddFiles(iter);
     232    }
     233    else
     234        read->AddFile(fname);
    214235    tlist->AddToList(read);
    215236
  • trunk/MagicSoft/Mars/mmain/MEventDisplay.h

    r6569 r8617  
    3838
    3939    void UpdateDisplay();
    40     void SetupTaskList(const char *tname, const char *fname);
     40    void SetupTaskList(const char *tname, TString fname, const char *path);
    4141
    4242    void ReadFirstEvent();
     
    4848
    4949public:
    50     MEventDisplay(const char *fname);
     50    MEventDisplay(const char *fname, const char *path="");
    5151    ~MEventDisplay();
    5252
  • trunk/MagicSoft/Mars/mmain/Makefile

    r8611 r8617  
    2323           -I../mfileio -I../mimage -I../mhistmc -I../mgbase -I../mfbase  \
    2424           -I../mdata -I../msignal -I../mcalib -I../mbadpixels            \
    25            -I../mpointing -I../mpedestal -I../mmuon -I../mfilter
     25           -I../mpointing -I../mpedestal -I../mmuon -I../mfilter -I../mjobs
    2626
    2727SRCFILES = MBrowser.cc \
Note: See TracChangeset for help on using the changeset viewer.