Ignore:
Timestamp:
06/20/01 10:41:23 (24 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mraw
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mraw/MRawFileWrite.cc

    r763 r852  
    5353// Default constructor. It opens the output file (root-file)
    5454//
    55 MRawFileWrite::MRawFileWrite(const char *fname, Option_t *opt,
    56                              const char *ftitle, Int_t comp,
     55MRawFileWrite::MRawFileWrite(const char *fname,
     56                             const Option_t *opt,
     57                             const char *ftitle,
     58                             const Int_t comp,
    5759                             const char *name, const char *title)
    5860{
     
    6062    *fTitle = title ? title : "Write task to write DAQ root files";
    6163
    62     // FIXME: move file open to preproc!
    63 
    6464    //
    6565    // Open a rootfile
    6666    //
    6767    fOut = new TFile(fname, opt, ftitle, comp);
    68 
    69     //
    70     // test whether file is now open or not
    71     //
    72     if (!fOut->IsOpen())
    73     {
    74         *fLog << "MRawFileWrite::MRawFileWrite: ERROR: Cannot open file '";
    75         *fLog << fname << "'" << endl;
    76     }
    77 }
     68}
     69
     70MRawFileWrite::~MRawFileWrite()
     71{
     72    //
     73    // delete instance, this laso does a fOut->Close()
     74    //
     75    delete fOut;
     76}
     77
    7878
    7979// --------------------------------------------------------------------------
     
    9494{
    9595    //
     96    // test whether file is now open or not
     97    //
     98    if (!fOut->IsOpen())
     99    {
     100        *fLog << dbginf << "Cannot open file '" << fOut->GetName() << "'" << endl;
     101        return kFALSE;
     102    }
     103
     104    //
    96105    // remember the pointer to the parameter list fur further usage
    97106    //
     
    105114    if (!fRawEvtHeader)
    106115    {
    107         *fLog << "MRawFileWrite::PreProcess - ERROR: MRawEvtHeader not found... aborting." << endl;
     116        *fLog << dbginf << "MRawEvtHeader not found... aborting." << endl;
    108117        return kFALSE;
    109118    }
     
    112121    if (!fRawEvtData)
    113122    {
    114         *fLog << "MRawFileWrite::PreProcess - ERROR: MRawEvtData not found... aborting." << endl;
     123        *fLog << dbginf << "MRawEvtData not found... aborting." << endl;
    115124        return kFALSE;
    116125    }
     
    119128    if (!fRawCrateArray)
    120129    {
    121         *fLog << "MRawFileWrite::PreProcess - ERROR: MRawCrateArray not found... aborting." << endl;
     130        *fLog << dbginf << "MRawCrateArray not found... aborting." << endl;
    122131        return kFALSE;
    123132    }
     
    126135    if (!fRawEvtTime)
    127136    {
    128         *fLog << "MRawFileWrite::PreProcess - WARNING: MRawEvtTime not found... aborting." << endl;
     137        *fLog << dbginf << "MRawEvtTime not found... aborting." << endl;
    129138        return kFALSE;
    130139    }
     
    133142    if (!fRawRunHeader)
    134143    {
    135         *fLog << "MRawFileWrite::PreProcess - ERROR: MRawRunHeader not found... aborting." << endl;
     144        *fLog << dbginf << "MRawRunHeader not found... aborting." << endl;
    136145        return kFALSE;
    137146    }
     
    222231    fOut->Write();
    223232
    224     //
    225     // close root file
    226     //
    227     fOut->Close();
    228 
    229     //
    230     // delete instance
    231     //
    232     delete fOut;
    233 
    234233    return kTRUE;
    235234}
  • trunk/MagicSoft/Mars/mraw/MRawFileWrite.h

    r698 r852  
    3535public:
    3636    MRawFileWrite(const char *fname,
    37                   Option_t *opt="UPDATE",
     37                  const Option_t *opt="UPDATE",
    3838                  const char *ftitle="Unnamed",
    39                   Int_t comp=9,
     39                  const Int_t comp=9,
    4040                  const char *name=NULL, const char *title=NULL);
     41    ~MRawFileWrite();
    4142
    4243    Bool_t PreProcess(MParList *pList);
Note: See TracChangeset for help on using the changeset viewer.