Changeset 1733 for trunk


Ignore:
Timestamp:
01/27/03 11:43:50 (22 years ago)
Author:
rwagner
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r1729 r1733  
    11
    22                                                         -*-*- END -*-*-
     3
     4 2003/01/27: Robert Wagner
     5
     6  * manalysis/MCT1ReadPreProc.cc
     7    - Added call of MTaskList::ReInit after processing of new
     8      run header
     9    - Filling of MC container complies to Oscar's changes of
     10      MMcEvt.[hxx,cxx] dated 2003/01/20
     11    - Added filling of run number in MRawRunHeader object while
     12      processing a new run header
    313
    414 2003/01/23: Robert Wagner
  • trunk/MagicSoft/Mars/mfileio/MCT1ReadPreProc.cc

    r1715 r1733  
    1818!   Author(s): Thomas Bretz 11/2002 <mailto:tbretz@astro.uni-wuerzburg.de>
    1919!
    20 !   Copyright: MAGIC Software Development, 2000-2002
     20!   Copyright: MAGIC Software Development, 2000-2003
    2121!
    2222!
     
    7474#include "MBlindPixels.h"
    7575
     76#include "MRawRunHeader.h"
     77#include "MTaskList.h"
     78
    7679#include "MMcEvt.hxx"
    7780#include "MMcTrig.hxx"
     
    8891                                 const char *title) : fIn(NULL), fEntries(0)
    8992{
    90     fName  = name  ? name  : "MRead";
    91     fTitle = title ? title : "Task to loop over events in CT1 ascii file";
     93    fName  = name  ? name  : "MCT1ReadPreProc";
     94    fTitle = title ? title : "Reads a CT1 preproc data file";
    9295
    9396    //
     
    168171
    169172    // int     irunnum;          // run number (from parameters file)
     173    *fLog << inf << "Run number" << outpars.irunnum;
     174   
     175    fRawRunHeader->SetRunNumber(outpars.irunnum);
     176    fRawRunHeader->SetReadyToSave();
     177
    170178    // enum    onoroff {NEITHER_ON_NOR_OFF, OFF_SOURCE, ON_SOURCE} eruntype; // runtype
    171179    *fLog << "Run:       #" << outpars.irunnum << "  (";
     
    370378
    371379    fIsMcFile = outpars.bmontecarlo==TRUE;
     380
    372381}
    373382
     
    376385// Read CT1 PreProc File Header:
    377386//
    378 Bool_t MCT1ReadPreProc::ReadRunHeader()
     387Int_t MCT1ReadPreProc::ReadRunHeader()
    379388{
    380389    char cheadertitle[iHEADERTITLELENGTH];
     
    402411    if (fpreprocversion<0.6)
    403412    {
    404         *fLog << err << "Sorry only files from PreProc V0.6 and newer are supported." << endl;
     413        *fLog << err << "Sorry, only files from PreProc V0.6 and newer are supported." << endl;
    405414        return kFALSE;
    406415    }
     
    423432
    424433    ProcessRunHeader(outpars);
     434
     435    //rwagner: ReInit whenever new run commences
     436    // rc==-1 means: ReInit didn't work out
     437    if (!fTaskList->ReInit(fParList)) return -1;
    425438
    426439    return kTRUE;
     
    530543    *fLog << inf << "-----------------------------------------------------------------------" << endl;
    531544
    532     if (!ReadRunHeader())
    533     {
    534         *fLog << warn << "Unable to read first run header... skipping file." << endl;
    535         return kFALSE;
    536     }
     545    switch (ReadRunHeader())
     546      {
     547      case kFALSE:
     548        *fLog << warn << "Unable to read first run header... skipping file." << endl;
     549        return kFALSE;
     550        break;
     551      case -1:
     552        *fLog << warn << "ReInit of Tasklist didn't succeed." << endl;
     553        return kFALSE;
     554        break;
     555      }
    537556
    538557    return kTRUE;
     
    644663Bool_t MCT1ReadPreProc::PreProcess(MParList *pList)
    645664{
     665
     666    fParList = pList;
     667
    646668    //
    647669    //  look for the MCerPhotEvt class in the plist
     
    699721    if (!fMcTrig)
    700722        return kFALSE;
     723
     724    //
     725    //  look for the raw run header class
     726    //
     727    fRawRunHeader = (MRawRunHeader*)pList->FindCreateObj("MRawRunHeader");
     728    if (!fRawRunHeader)
     729        return kFALSE;
     730
     731    //
     732    //  look for the task list
     733    //
     734    fTaskList = (MTaskList*)pList->FindCreateObj("MTaskList");
     735    if (!fTaskList)
     736        return kFALSE;
     737
    701738
    702739    fNumFilterEvts = 0;
     
    769806                 0, /* fFirTar */
    770807                 0, /* fzFirInt */
    771                  0, /* fThet*/
     808                 // 0, /* fThet*/
     809                 // rwagner: The following should be theta, right? Check with
     810                 // altitude fill some lines down...
     811                 0, // altitude (arcseconds)
    772812                 0, /* fPhii */
    773813                 0, /* fCorD */
     
    791831                 0, /* uiPco */
    792832                 0, /* uiPelS */
    793                  fIsMcFile ? event.fmcsize_phel : 0 /* uiPelC, Simulated SIZE */
     833                 fIsMcFile ? event.fmcsize_phel : 0, /* uiPelC, Simulated SIZE */
     834                 0, /* elec */
     835                 0, /* muon */
     836                 0  /* other */
    794837                 );
    795838
     
    827870
    828871        //
    829         // Try reading the footer. If it isn't succefull...
     872        // Try reading the footer. If this isn't successful...
    830873        // must be an event
    831874        //
     
    861904
    862905        *fLog << "-----------------------------------------------------------------------" << endl;
    863         if (!ReadRunHeader())
    864             return kTRUE;
     906
     907        switch (ReadRunHeader())
     908          {
     909          case kTRUE:
     910            return kTRUE;
     911            break;
     912          case -1:
     913            *fLog << warn << "ReInit of Tasklist didn't succeed." << endl;
     914            return kFALSE;
     915            break;
     916          }
    865917    }
    866918}
Note: See TracChangeset for help on using the changeset viewer.