Ignore:
Timestamp:
10/29/01 11:15:53 (23 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/manalysis
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/manalysis/MCT1ReadAscii.cc

    r959 r1003  
    4343#include <fstream.h>
    4444
    45 #include <TArrayC.h>
     45#include <TList.h>
    4646
    4747#include "MLog.h"
     
    6565    : fIn(NULL)
    6666{
    67     *fName  = name  ? name  : "MCT1ReadAscii";
    68     *fTitle = title ? title : "Task to loop over events in CT1 ascii file";
     67    fName  = name  ? name  : "MCT1ReadAscii";
     68    fTitle = title ? title : "Task to loop over events in CT1 ascii file";
    6969
    7070    //
    7171    // remember file name for opening the file in the preprocessor
    7272    //
    73     fFileNames = new TArrayC;
     73    fFileNames = new TList;
     74    fFileNames->SetOwner();
     75
    7476    if (fname)
    7577        AddFile(fname);
     
    9395void MCT1ReadAscii::AddFile(const char *txt)
    9496{
    95     const int sz  = fFileNames->GetSize();
    96     const int tsz = strlen(txt)+1;
    97 
    98     fFileNames->Set(sz+tsz);
    99 
    100     memcpy(fFileNames->GetArray()+sz, txt, tsz);
     97    TNamed *name = new TNamed(txt, "");
     98    fFileNames->AddLast(name);
    10199}
    102100
     
    114112    fIn = NULL;
    115113
    116     const int arrsz = fFileNames->GetSize();
    117 
    118     if (arrsz<1)
     114    //
     115    // Check for the existance of a next file to read
     116    //
     117    TNamed *file = (TNamed*)fFileNames->First();
     118    if (!file)
    119119        return kFALSE;
    120120
     
    122122    // open the file which is the first one in the chain
    123123    //
    124     const char *name = fFileNames->GetArray();
     124    const char *name = file->GetName();
    125125
    126126    fIn = new ifstream(name);
    127     if (!(*fIn))
    128     {
     127
     128    const Bool_t noexist = !(*fIn);
     129
     130    if (noexist)
    129131        *fLog << dbginf << "Cannot open file '" << name << "'" << endl;
    130         return kFALSE;
    131     }
    132 
    133     //
    134     // remove the first entry from the chain
    135     //
    136     *fLog << "Open file: '" << name << "'" << endl;
    137 
    138     //
    139     // create the new char array containing the filenames to process
    140     //
    141     const int sz  = strlen(name)+1;
    142 
    143     char *dummy = new char[arrsz-sz];
    144     memcpy(dummy, name+sz, arrsz-sz);
    145 
    146     //
    147     // dummy will be deleted by the destructor of fFileNames
    148     //
    149     fFileNames->Adopt(arrsz-sz, dummy);
    150 
    151     return kTRUE;
    152 
     132    else
     133        *fLog << "Open file: '" << name << "'" << endl;
     134
     135    //
     136    // Remove this file from the list of pending files
     137    //
     138    fFileNames->Remove(file);
     139
     140    return !noexist;
    153141}
    154142
  • trunk/MagicSoft/Mars/manalysis/MCerPhotCalc.cc

    r857 r1003  
    5858MCerPhotCalc::MCerPhotCalc(const char *name, const char *title)
    5959{
    60     *fName  = name  ? name  : "MCerPhotCalc";
    61     *fTitle = title ? title : "Task to calculate Cerenkov photons from raw data";
     60    fName  = name  ? name  : "MCerPhotCalc";
     61    fTitle = title ? title : "Task to calculate Cerenkov photons from raw data";
    6262}
    6363
  • trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.cc

    r991 r1003  
    4545{
    4646
    47   *fName  = name  ? name  : "MCerPhotEvt";
    48   *fTitle = title ? title : "(Number of Photon)-Event Information";
     47  fName  = name  ? name  : "MCerPhotEvt";
     48  fTitle = title ? title : "(Number of Photon)-Event Information";
    4949 
    5050  fPixels = new TClonesArray ("MCerPhotPix", 577) ;
  • trunk/MagicSoft/Mars/manalysis/MHillas.cc

    r991 r1003  
    6060MHillas::MHillas(const char *name, const char *title) : fEllipse(NULL)
    6161{
    62     *fName  = name  ? name  : "MHillas";
    63     *fTitle = title ? title : "Storage container for Hillas parameter of one event";
     62    fName  = name  ? name  : "MHillas";
     63    fTitle = title ? title : "Storage container for Hillas parameter of one event";
    6464
    6565    Reset();
  • trunk/MagicSoft/Mars/manalysis/MHillasCalc.cc

    r857 r1003  
    5656MHillasCalc::MHillasCalc(const char *name, const char *title)
    5757{
    58     *fName  = name  ? name  : "MHillasCalc";
    59     *fTitle = title ? title : "Task to calculate Hillas parameters";
     58    fName  = name  ? name  : "MHillasCalc";
     59    fTitle = title ? title : "Task to calculate Hillas parameters";
    6060}
    6161
  • trunk/MagicSoft/Mars/manalysis/MImgCleanStd.cc

    r977 r1003  
    6666    : fCleanLvl1(lvl1), fCleanLvl2(lvl2)
    6767{
    68     *fName  = name  ? name  : "MImgCleanStd";
    69     *fTitle = title ? title : "Task which does a standard image cleaning";
     68    fName  = name  ? name  : "MImgCleanStd";
     69    fTitle = title ? title : "Task which does a standard image cleaning";
    7070
    7171    *fLog << "Cleaning initialized. Using noise level " << lvl1 << " and " << lvl2 << endl;
  • trunk/MagicSoft/Mars/manalysis/MMcPedestalCopy.cc

    r993 r1003  
    4949MMcPedestalCopy::MMcPedestalCopy(const char *name, const char *title)
    5050{
    51     *fName  = name  ? name  : "MMcPedestalCopy";
    52     *fTitle = title ? title : "Task to copy monte carlo pedestals into MPedestal Container";
     51    fName  = name  ? name  : "MMcPedestalCopy";
     52    fTitle = title ? title : "Task to copy monte carlo pedestals into MPedestal Container";
    5353}
    5454
  • trunk/MagicSoft/Mars/manalysis/MPedCalcPedRun.cc

    r857 r1003  
    5353MPedCalcPedRun::MPedCalcPedRun(const char *name, const char *title)
    5454{
    55     *fName  = name  ? name  : "MPedCalcPedRun";
    56     *fTitle = title ? title : "Task to calculate pedestals from pedestal runs raw data";
     55    fName  = name  ? name  : "MPedCalcPedRun";
     56    fTitle = title ? title : "Task to calculate pedestals from pedestal runs raw data";
    5757}
    5858
  • trunk/MagicSoft/Mars/manalysis/MPedestalCam.cc

    r857 r1003  
    4242MPedestalCam::MPedestalCam(const char *name, const char *title)
    4343{
    44     *fName  = name  ? name  : "MPedestalCam";
    45     *fTitle = title ? title : "Storage container for all Pedestal Information in the camera";
     44    fName  = name  ? name  : "MPedestalCam";
     45    fTitle = title ? title : "Storage container for all Pedestal Information in the camera";
    4646
    4747    fArray = new TClonesArray("MPedestalPix", 577);
Note: See TracChangeset for help on using the changeset viewer.