Ignore:
Timestamp:
06/03/02 15:43:45 (22 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mbase
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mbase/MReadMarsFile.cc

    r1337 r1342  
    4141#include "MParList.h"
    4242#include "MTaskList.h"
     43
     44#include "MRawRunHeader.h"
     45
     46#include "MMcRunHeader.hxx"
    4347
    4448ClassImp(MReadMarsFile);
     
    109113{
    110114    Int_t runtype = -1;
    111 /*
    112     const MRawRunHeader *runheader = (MRawRunHeader*)fParList->FindObject("MRawRunHeader");
    113     if (runheader)
    114         runtype = runheader->GetRunType();
    115 */
     115
     116    const MRawRunHeader *rawheader = (MRawRunHeader*)fParList->FindObject("MRawRunHeader");
     117    if (rawheader)
     118        runtype = rawheader->GetRunType();
     119
    116120    //
    117121    // Try to read the new run headers. If reading the new run header
     
    120124    const Int_t idx = GetFileIndex();
    121125    fRun->SetEventNum(idx<0?0:idx); // Assumption: One Entry per File!
    122     if (fRun->Process())
     126    if (!fRun->Process())
    123127    {
    124         *fLog << inf << "MReadMarsFile: Switching to #" << GetFileIndex();
    125         *fLog << " '" << GetFileName() << "' (before event #";
    126         *fLog << GetEventNum()-1 << ")" << endl;
    127 /*
    128         if (runheader)
    129             if (runtype != runheader->GetRunType())
    130                 *fLog << warn << "Warning - You are mixing files with different run types!" << endl;
    131 */
    132         if (fTaskList->ReInit())
    133             return kTRUE;
     128        *fLog << err << "ERROR - Cannot read new runheaders #" << idx;
     129        *fLog << " after reading event #" << GetEventNum() << endl;
     130        return kFALSE;
     131    }
    134132
    135         //MReadTree::Notify();
     133    *fLog << inf << "MReadMarsFile: Switching to #" << GetFileIndex();
     134    *fLog << " '" << GetFileName() << "' (before event #";
     135    *fLog << GetEventNum()-1 << ")" << endl;
    136136
    137         *fLog << err << "ERROR - ReInit of '" << fTaskList->GetName() << "' failed." << endl;
     137    if (rawheader)
     138    {
     139        if (runtype != rawheader->GetRunType())
     140            *fLog << warn << "Warning - You are mixing files with different run types!" << endl;
    138141    }
    139     else
    140         *fLog << err << "ERROR - Cannot read new runheaders after reading event #" << GetEventNum() << endl;
    141142
     143    const MMcRunHeader *mcheader = (MMcRunHeader*)fParList->FindObject("MMcRunHeader");
     144    if (mcheader)
     145    {
     146        if (mcheader->GetReflVersion()<=40 && mcheader->GetTelesTheta()>15)
     147        {
     148            *fLog << warn << "Warning - You may use Monte Carlo data produced with a version" << endl;
     149            *fLog << "of the reflector program < 0.4 and a zenith angle > 15," << endl;
     150            *fLog << "in this case you may get less photons than you would expect." << endl;
     151        }
     152    }
     153
     154    MTaskList *tlist = (MTaskList*)fParList->FindObject("MTaskList");
     155    if (!tlist)
     156    {
     157        *fLog << err << dbginf << "ERROR - Task List not found in Parameter List." << endl;
     158        return kFALSE;
     159    }
     160
     161    if (tlist->ReInit())
     162        return kTRUE;
     163
     164    //MReadTree::Notify();
     165
     166    *fLog << err << "ERROR - ReInit of '" << tlist->GetName() << "' failed." << endl;
    142167    return kFALSE;
    143168}
     
    151176{
    152177    fParList  = pList;
    153     fTaskList = (MTaskList*)pList->FindObject("MTaskList");
    154178
    155179    if (!fRun->PreProcess(pList))
  • trunk/MagicSoft/Mars/mbase/MReadMarsFile.h

    r1337 r1342  
    1414    MReadTree *fRun;
    1515    MParList  *fParList;  //! Parlist for reinitialization
    16     MTaskList *fTaskList; //! Tasklist for reinitialization
    1716
    1817    Bool_t Notify();
Note: See TracChangeset for help on using the changeset viewer.