Changeset 852 for trunk


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

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r851 r852  
    11                                                                  -*-*- END -*-*-
     2
     3 2001/06/20: Thomas Bretz
     4 
     5   * macros/merpp.C:
     6     - fixed type in comment
     7     
     8   * manalysis/MHillas.cc:
     9     - fixed 'FIXME' comment
     10   
     11   * mbase/MWriteFile.[h,cc]:
     12     - added
     13 
     14   * mbase/MWriteRootFile.[h,cc]:
     15     - added
     16   
     17   * mbase/BaseLinkDef.h:
     18     - Added MWriteFile
     19     - Added MWriteRootFile
     20   
     21   * mbase/MEvtLoop.cc:
     22     - fixed the counting in the eventloop
     23     
     24   * mbase/MWriteAsciiFile.[h,cc]:
     25     - changed class that it is based on MWriteFile now
     26   
     27   * mbase/Makefile:
     28     - added MWriteFile
     29     - added MWriteRootFile
     30   
     31   * mhist/MFillHFadc.[h,cc]:
     32     - added set for HasChanged (new PostProcess)
     33   
     34   * mhist/MFillHHillas.cc:
     35     - added set for HasChanged (new PostProcess)
     36   
     37   * mhist/MFillHStarMap.cc:
     38     - added set for HasChanged (new PostProcess)
     39
     40   * mhist/MHHillas.cc:
     41     - Set kCanDelete to make sure, that the histograms are deleted
     42       together with the canvas
     43     
     44   * mraw/MRawFileWrite.[h,cc]:
     45     - changed the handling of opening, closing and checking file
     46
     47
    248
    349 2001/06/13: Thomas Bretz
     
    3985   * mraw/MRawEvtData.cc:
    4086     - Set kCanDelete in Draw function
    41    
    4287
    4388
  • trunk/MagicSoft/Mars/macros/merpp.C

    r776 r852  
    3030    //
    3131    // REMARK: Don't change the order of the two instantiations.
    32     //         I don't have an idea why, but here it crashes to
     32    //         I don't have an idea why, but here it crashes the
    3333    //         Interpreter.
    3434    //         (Using root 2.25/03, with Cint 5.14.50 on OSF1)
  • trunk/MagicSoft/Mars/manalysis/MHillas.cc

    r842 r852  
    5858
    5959    Reset();
    60     // FIXME: Initialization of values missing
     60    // FIXME: (intelligent) initialization of values missing
    6161}
    6262
  • trunk/MagicSoft/Mars/manalysis/MHillasCalc.cc

    r765 r852  
    6060// (Hillas) container or create one.
    6161//
    62 Bool_t MHillasCalc::PreProcess( MParList *pList )
     62Bool_t MHillasCalc::PreProcess(MParList *pList)
    6363{
    6464    fCerPhotEvt = (MCerPhotEvt*)pList->FindObject("MCerPhotEvt");
  • trunk/MagicSoft/Mars/mbase/BaseLinkDef.h

    r843 r852  
    2929
    3030#pragma link C++ class MReadTree;
     31#pragma link C++ class MWriteFile;
    3132#pragma link C++ class MWriteAsciiFile;
     33#pragma link C++ class MWriteRootFile;
    3234
    3335#pragma link C++ class MArray;
  • trunk/MagicSoft/Mars/mbase/MEvtLoop.cc

    r843 r852  
    160160    //
    161161    if (maxcnt<0)
    162         while (fTaskList->Process() && ++dummy);
     162        // process first and increment if sucessfull
     163        while (fTaskList->Process()) dummy++;
    163164    else
    164         while (fTaskList->Process() && dummy--);
     165        // check for number and break if unsuccessfull
     166        while (dummy-- && fTaskList->Process());
    165167
    166168    //
  • trunk/MagicSoft/Mars/mbase/MParList.cc

    r847 r852  
    102102Bool_t MParList::AddToList(MParContainer *obj, MParContainer *where)
    103103{
     104    //
     105    //  check if the object (you want to add) exists
     106    //
     107
     108    if (!obj) return kTRUE;
     109
     110    *fLog << "Adding " << obj->GetName() << " to " << GetName() << "... " << flush;
    104111  //
    105   //  check if the object (you want to add) exists
    106   //
    107 
    108   if (!obj) return kTRUE;
    109 
    110   *fLog << "Adding " << obj->GetName() << " to " << GetName() << "... " << flush;
    111   //
    112   //  check if it is in the list yet
    113   //
    114   if (fContainer.FindObject(obj))
    115   {
    116       *fLog << dbginf << "Container already added" << endl;
    117       return kTRUE;
    118   }
    119 
    120   //
    121   //  check if you want to add the new parameter container somewhere
     112    //  check if it is in the list yet
     113    //
     114    if (fContainer.FindObject(obj))
     115    {
     116        *fLog << dbginf << "Container already added" << endl;
     117        return kTRUE;
     118    }
     119
     120    //
     121    //  check if you want to add the new parameter container somewhere
    122122  //  special (in that case you specify "where")
    123   // 
    124   if (where)
    125   {
    126       if (!fContainer.FindObject(where))
    127       {
    128           *fLog << dbginf << "Cannot find parameter container after which the new one should be added!" << endl;
    129           return kFALSE;
    130       }
    131   }
    132 
    133   fContainer.Add(obj);
    134   *fLog << "Done." << endl;
    135 
    136   return kTRUE;
     123    //
     124    if (where)
     125    {
     126        if (!fContainer.FindObject(where))
     127        {
     128            *fLog << dbginf << "Cannot find parameter container after which the new one should be added!" << endl;
     129            return kFALSE;
     130        }
     131    }
     132
     133    fContainer.Add(obj);
     134    *fLog << "Done." << endl;
     135
     136    return kTRUE;
    137137}
    138138
  • trunk/MagicSoft/Mars/mbase/MWriteAsciiFile.cc

    r850 r852  
    6464    fNameFile      = filename;
    6565    fNameContainer = contname;
     66
     67    fOut = new ofstream(fNameFile);
    6668}
    6769
     
    8082    fNameFile      = filename;
    8183    fNameContainer = cont->GetName();
     84
     85    fOut = new ofstream(fNameFile);
    8286}
    8387
     
    8993MWriteAsciiFile::~MWriteAsciiFile()
    9094{
    91     if (fOut)
    92         delete fOut;
     95    delete fOut;
    9396}
    9497
    9598// --------------------------------------------------------------------------
    9699//
    97 // Tries to open the given output file. And tries to get a pointer to the
    98 // instance of the container which should be written.
    99 // If the container has already the HasChanged flag it is immediatly written
    100 // to the output file.
     100// Check if our container is ready for writing. If so write it.
    101101//
    102 Bool_t MWriteAsciiFile::PreProcess (MParList *pList)
     102void MWriteAsciiFile::CheckAndWrite() const
     103{
     104    if (fContainer->HasChanged())
     105        fContainer->AsciiWrite(*fOut);
     106}
     107
     108// --------------------------------------------------------------------------
     109//
     110// Return open state of the file
     111//
     112Bool_t MWriteAsciiFile::IsFileOpen() const
     113{
     114    return (bool)(*fOut);
     115}
     116
     117// --------------------------------------------------------------------------
     118//
     119// If the container is yet unknown and the name of it is known only, try
     120// to get the container from the parameter list.
     121//
     122Bool_t MWriteAsciiFile::GetContainer(MParList *pList)
    103123{
    104124    //
    105125    // Try to find the container which should be stored.
    106126    //
    107     if (!fContainer)
    108     {
    109         fContainer = (MParContainer*)pList->FindObject(fNameContainer);
    110         if (!fContainer)
    111         {
    112             *fLog << dbginf << "Cannot find parameter container '" << fContainer << "'." << endl;
    113             return kFALSE;
    114         }
    115     }
     127    if (fContainer)
     128        return kTRUE;
    116129
    117     //
    118     // Try to open the output file
    119     //
    120     fOut = new ofstream(fNameFile);
     130    fContainer = (MParContainer*)pList->FindObject(fNameContainer);
     131    if (fContainer)
     132        return kTRUE;
    121133
    122     if (!(*fOut))
    123     {
    124         *fLog << dbginf << "Cannot open Ascii file '" << fNameFile << "' for writing." << endl;
    125         return kFALSE;
    126     }
    127 
    128     *fLog << "Ascii file '" << fNameFile << "' opened for writing." << endl;
    129 
    130     //
    131     // write the container if it is already in changed state
    132     //
    133     if (fContainer->HasChanged())
    134         fContainer->AsciiWrite(*fOut);
    135 
    136     return kTRUE;
     134    *fLog << dbginf << "Cannot find parameter container '" << fContainer << "'." << endl;
     135    return kFALSE;
    137136}
    138 
    139 // --------------------------------------------------------------------------
    140 //
    141 // Checks if the HasChanged flag of the output container is set. If it is set
    142 // the container is instructed to write itself to the ascii file.
    143 // (By calling its memberfunction AsciiWrite. You find the Prototype in
    144 // MParContainer)
    145 //
    146 Bool_t MWriteAsciiFile::Process()
    147 {
    148     if (fContainer->HasChanged())
    149         fContainer->AsciiWrite(*fOut);
    150 
    151     return kTRUE;
    152 }
    153 
    154 // --------------------------------------------------------------------------
    155 //
    156 // If the output container has the HasChanged flag set, it is written to the
    157 // output file (eg. this could be some calculated result)
    158 // If the output file object exists, delete it. (The file is closed
    159 // automatically in the corresponding destructor)
    160 //
    161 Bool_t MWriteAsciiFile::PostProcess()
    162 {
    163     //
    164     // check if the container changed state is set
    165     //
    166     if (fContainer->HasChanged())
    167         fContainer->AsciiWrite(*fOut);
    168 
    169     //
    170     // delete (close) file
    171     //
    172     delete fOut;
    173     fOut = NULL;
    174 
    175     return kTRUE;
    176 }
    177 
  • trunk/MagicSoft/Mars/mbase/MWriteAsciiFile.h

    r850 r852  
    22#define MWRITEASCIIFILE_H
    33
    4 #ifndef MTASK_H
    5 #include "MTask.h"
     4#ifndef MWRITEFILE_H
     5#include "MWriteFile.h"
    66#endif
    77
    8 class MWriteAsciiFile : public MTask
     8class MWriteAsciiFile : public MWriteFile //MTask
    99{
    1010private:
     
    1616    MParContainer *fContainer;
    1717
     18    virtual void   CheckAndWrite() const;
     19    virtual Bool_t IsFileOpen() const;
     20    virtual Bool_t GetContainer(MParList *pList);
     21    virtual const char *GetFileName() const { return fNameFile; }
     22
     23
    1824public:
    1925    MWriteAsciiFile(const char *filename, const char *contname,
     
    2329    ~MWriteAsciiFile();
    2430
    25     Bool_t PreProcess(MParList *pList);
    26     Bool_t Process();
    27     Bool_t PostProcess();
    28 
    2931    ClassDef(MWriteAsciiFile, 0)        // Class to write one container to an ascii file
    3032};
  • trunk/MagicSoft/Mars/mbase/Makefile

    r846 r852  
    3838           MEvtLoop.cc \
    3939           MReadTree.cc \
     40           MWriteFile.cc \
    4041           MWriteAsciiFile.cc \
     42           MWriteRootFile.cc \
    4143           MArray.cc \
    4244           MArrayB.cc \
  • trunk/MagicSoft/Mars/mhist/MFillHFadc.cc

    r765 r852  
    108108
    109109    return kTRUE;
     110}
    110111
     112Bool_t MFillHFadc::PostProcess()
     113{
     114    fHistos->SetHasChanged();
     115    return kTRUE;
    111116}
  • trunk/MagicSoft/Mars/mhist/MFillHFadc.h

    r712 r852  
    1414class MRawEvtData;
    1515
    16 class MFillHFadc : public MTask {
    17  private:
    18   MRawEvtData *fRawEvtData; // The raw event data from which the spektrum is created
    19   MHFadcCam   *fHistos ;    // The histogram container into which holds the spektrum
     16class MFillHFadc : public MTask
     17{
     18private:
     19    MRawEvtData *fRawEvtData; // The raw event data from which the spektrum is created
     20    MHFadcCam   *fHistos ;    // The histogram container into which holds the spektrum
    2021
    21  public:   
    22   MFillHFadc (const char *name=NULL, const char *title=NULL);
     22public:
     23    MFillHFadc (const char *name=NULL, const char *title=NULL);
    2324
    24   Bool_t PreProcess(MParList *pList);
    25   Bool_t Process() ;
    26  
    27   ClassDef(MFillHFadc, 0)  // Task to fill the fadc data into histograms
     25    Bool_t PreProcess(MParList *pList);
     26    Bool_t Process();
     27    Bool_t PostProcess();
    2828
     29    ClassDef(MFillHFadc, 0)  // Task to fill the fadc data into histograms
    2930};
    3031   
  • trunk/MagicSoft/Mars/mhist/MFillHHillas.cc

    r765 r852  
    7272    return kTRUE;
    7373}
     74
     75Bool_t MFillHHillas::PostProcess()
     76{
     77    fHistos->SetHasChanged();
     78    return kTRUE;
     79}
  • trunk/MagicSoft/Mars/mhist/MFillHHillas.h

    r712 r852  
    2323
    2424  Bool_t PreProcess(MParList *pList);
    25   Bool_t Process() ;
     25  Bool_t Process();
     26  Bool_t PostProcess();
    2627 
    2728  ClassDef(MFillHHillas, 0) // Task to fill the Hillas parameters into histograms
  • trunk/MagicSoft/Mars/mhist/MFillHStarMap.cc

    r765 r852  
    7373    return kTRUE;
    7474}
     75
     76Bool_t MFillHStarMap::PostProcess()
     77{
     78    fHistos->SetHasChanged();
     79
     80    return kTRUE;
     81}
  • trunk/MagicSoft/Mars/mhist/MFillHStarMap.h

    r712 r852  
    2323
    2424  Bool_t PreProcess(MParList *pList);
    25   Bool_t Process() ;
     25  Bool_t Process();
     26  Bool_t PostProcess();
    2627 
    2728  ClassDef(MFillHStarMap, 0) // Task to fill a 2-dim histogram by the Hillas parameters
  • trunk/MagicSoft/Mars/mhist/MHHillas.cc

    r713 r852  
    7474
    7575    c->cd(1);
     76    fAlpha->SetBit(kCanDelete);
    7677    fAlpha->Draw();
    7778    c->cd(2);
     79    fLength->SetBit(kCanDelete);
    7880    fLength->Draw();
    7981    c->cd(3);
     82    fDist->SetBit(kCanDelete);
    8083    fDist->Draw();
    8184    c->cd(4);
     85    fWidth->SetBit(kCanDelete);
    8286    fWidth->Draw();
    8387
  • trunk/MagicSoft/Mars/mmontecarlo/MCollArea.cc

    r749 r852  
    1717!
    1818!   Author(s): Harald Kornmayer 1/2001 (harald@mppmu.mpg.de)
    19 !   Author(s): Thomas Bretz  12/2000 (tbretz@uni-sw.gwdg.de)
     19!             Thomas Bretz  12/2000 (tbretz@uni-sw.gwdg.de)
    2020!
    2121!   Copyright: MAGIC Software Development, 2000-2001
     
    3535MCollArea::MCollArea(const char *name, const char *title)
    3636{
    37   //
    38   //   default constructor
    39   //
     37    //
     38    //   default constructor
     39    //
    4040
    41   //   initialize the histogram for the distribution r vs E
    42   //
    43   //   we set the energy range from 1 Gev to 10000 GeV (in log 5 orders
    44   //   of magnitude) and for each order we take 10 subdivision --> 50 xbins
    45   //
    46   //   we set the radius range from 0 m to 500 m with 10 m bin --> 50 ybins
     41    //   initialize the histogram for the distribution r vs E
     42    //
     43    //   we set the energy range from 1 Gev to 10000 GeV (in log 5 orders
     44    //   of magnitude) and for each order we take 10 subdivision --> 50 xbins
     45    //
     46    //   we set the radius range from 0 m to 500 m with 10 m bin --> 50 ybins
    4747
    4848 
    49   *fName  = name  ? name  : "MCollArea";
    50   *fTitle = title ? title : "Data to Calculate Coll-Area";
    51  
    52  
    53   fHistAll = new TH2D("collAreaAll", "all showers - Radius vs log(E) distribution",
    54                       50, 0., 5.,
    55                       50, 0., 500. ) ;
    56  
    57   fHistSel = new TH2D("collAreaSel", "selected showers - Radius vs log(E) distribution",
    58                       50, 0., 5.,
    59                       50, 0., 500. ) ;
     49    *fName  = name  ? name  : "MCollArea";
     50    *fTitle = title ? title : "Data to Calculate Coll-Area";
    6051
    61   fHistCol = new TH1D("collArea", "Collection Area",
    62                       50, 0., 5.) ;
    63  
    64 }
     52
     53    fHistAll = new TH2D("collAreaAll", "all showers - Radius vs log(E) distribution",
     54                        50, 0., 5.,
     55                        50, 0., 500. ) ;
     56
     57    fHistSel = new TH2D("collAreaSel", "selected showers - Radius vs log(E) distribution",
     58                        50, 0., 5.,
     59                        50, 0., 500. ) ;
     60
     61    fHistCol = new TH1D("collArea", "Collection Area",
     62                        50, 0., 5.) ;
     63
     64}
    6565
    6666MCollArea::~MCollArea()
    67 { 
    68   delete fHistAll ;
    69   delete fHistSel ;
    70   delete fHistCol ;
    71 } 
     67{
     68    delete fHistAll ;
     69    delete fHistSel ;
     70    delete fHistCol ;
     71}
    7272
    7373void MCollArea::FillAll(Float_t log10E, Float_t radius)
    74 { 
    75   fHistAll->Fill(log10E, radius ) ;
    76 } 
     74{
     75    fHistAll->Fill(log10E, radius ) ;
     76}
    7777
    7878void MCollArea::FillSel(Float_t log10E, Float_t radius)
    79 { 
    80   fHistSel->Fill(log10E, radius ) ;
    81 } 
     79{
     80    fHistSel->Fill(log10E, radius ) ;
     81}
    8282
    83 void MCollArea::DrawAll() 
    84 { 
    85   fHistAll->Draw() ;
    86 } 
     83void MCollArea::DrawAll()
     84{
     85    fHistAll->Draw() ;
     86}
    8787
    88 void MCollArea::DrawSel() 
    89 { 
    90   fHistSel->Draw() ;
    91 } 
     88void MCollArea::DrawSel()
     89{
     90    fHistSel->Draw() ;
     91}
    9292
    93 void MCollArea::Draw(Option_t* option) 
    94 { 
    95   fHistCol->Draw(option) ;
    96 } 
     93void MCollArea::Draw(Option_t* option)
     94{
     95    fHistCol->Draw(option) ;
     96}
    9797
    9898void MCollArea::CalcEfficiency()
    99 { 
     99{
    100100    // Description!
    101101
     
    114114            const Float_t Nall = fHistAll->GetCellContent(ix, iy);
    115115
    116             if ( Nall <= 0 ) {
    117                 // cout << ix << " " << iy << endl ;
     116            if (Nall <= 0)
    118117                continue;
    119             }
    120118
    121119            const Double_t eff = N / Nall ;
    122120            const Double_t err = sqrt(Nall + Nall*N - N*N - N) / (Nall*Nall);
    123             /*
    124              cout << ix << " " << iy
    125              << " N " << N
    126              << " Nall " << Nall
    127              << " effi  " << eff
    128              << " error " << err
    129              << endl ;
    130              */
     121
    131122            fHistSel->SetCellContent(ix, iy, eff);
    132123            fHistSel->SetCellError(ix, iy, err);
  • trunk/MagicSoft/Mars/mmontecarlo/MCollAreaTrigger.cc

    r749 r852  
    1717!
    1818!   Author(s): Harald Kornmayer 1/2001 (harald@mppmu.mpg.de)
    19 !   Author(s): Thomas Bretz  12/2000 (tbretz@uni-sw.gwdg.de)
     19!             Thomas Bretz  12/2000 (tbretz@uni-sw.gwdg.de)
    2020!
    2121!   Copyright: MAGIC Software Development, 2000-2001
     
    2626#include "MCollAreaTrigger.h"
    2727
     28#include "MParList.h"
     29
    2830#include "MLog.h"
    2931#include "MLogManip.h"
    30 #include "MParList.h"
    3132
    32 #include "MCollArea.h"
    33 #include "MMcEvt.hxx"
     33#include "MMcEvt.hxx"
    3434#include "MMcTrig.hxx"
     35
     36#include "MHMcCollectionArea.h"
    3537
    3638ClassImp(MCollAreaTrigger)
     
    3840MCollAreaTrigger::MCollAreaTrigger (const char *name, const char *title)
    3941{
    40   *fName  = name  ? name  : "MCollAreaTrigger";
    41   *fTitle = title ? title : "Task to calc the collection area ";
     42    *fName  = name  ? name  : "MCollAreaTrigger";
     43    *fTitle = title ? title : "Task to calc the collection area ";
    4244}
    43 
    4445
    4546Bool_t MCollAreaTrigger::PreProcess (MParList *pList)
    4647{
    47   // connect the raw data with this task
    48  
    49   fMcEvt  = (MMcEvt*)pList->FindObject("MMcEvt") ;
    50   if (!fMcEvt) {
    51     *fLog << dbginf << "MMcEvt not found... exit." << endl;
    52     return kFALSE;
    53   }
     48    // connect the raw data with this task
    5449
    55   fMcTrig = (MMcTrig*)pList->FindObject("MMcTrig") ;
    56   if (!fMcTrig) {
    57     *fLog << dbginf << "MMcTrig not found... exit." << endl;
    58     return kFALSE;
    59   }
     50    fMcEvt = (MMcEvt*)pList->FindObject("MMcEvt");
     51    if (!fMcEvt)
     52    {
     53        *fLog << dbginf << "MMcEvt not found... exit." << endl;
     54        return kFALSE;
     55    }
    6056
    61   fCollArea = (MCollArea*)pList->FindCreateObj("MCollArea") ;
    62   if (!fCollArea)
    63     return kFALSE;
     57    fMcTrig = (MMcTrig*)pList->FindObject("MMcTrig");
     58    if (!fMcTrig)
     59    {
     60        *fLog << dbginf << "MMcTrig not found... exit." << endl;
     61        return kFALSE;
     62    }
    6463
    65   return kTRUE ;
     64    fCollArea = (MHMcCollectionArea*)pList->FindCreateObj("MHMcCollectionArea");
     65    if (!fCollArea)
     66        return kFALSE;
    6667
    67 }
    68 
     68    return kTRUE;
     69}
    6970
    7071Bool_t MCollAreaTrigger::Process ()
     
    7576    fCollArea->FillAll(energy, impact);
    7677
    77 
    7878    if (fMcTrig->GetFirstLevel() <= 0)
    7979        return kTRUE;
     
    8181    fCollArea->FillSel(energy, impact);
    8282
    83     return kTRUE ;
     83    return kTRUE;
    8484}
    8585
    8686Bool_t MCollAreaTrigger::PostProcess ()
    8787{
    88   //
    89   //   do the calculation of the effectiv area
    90   //
     88    //
     89    //   do the calculation of the effectiv area
     90    //
     91    fCollArea->CalcEfficiency();
    9192
    92   fCollArea->CalcEfficiency() ;
    93 
    94   return kTRUE ;
     93    return kTRUE;
    9594}
  • trunk/MagicSoft/Mars/mmontecarlo/MCollAreaTrigger.h

    r698 r852  
    1 #ifndef MCOLLAREATRIGGER_H
    2 #define MCOLLAREATRIGGER_H
     1#ifndef MMCCOLLECTIONAREACALC_H
     2#define MMCCOLLECTIONAREACALC_H
    33
    44#ifndef MTASK_H
     
    77
    88class MParList;
    9 class MMcEvt ;
    10 class MMcTrig ;
    11 class MCollArea;
     9class MMcEvt;
     10class MMcTrig;
     11class MHMcCollectionArea;
    1212
    13 class MCollAreaTrigger : public MTask {
    14  private:
    15   MMcEvt          *fMcEvt    ; //!
    16   MMcTrig         *fMcTrig   ; //!
    17   MCollArea       *fCollArea ; //!
     13class MMcCollectionAreaCalc : public MTask
     14{
     15private:
     16    MMcEvt  *fMcEvt;
     17    MMcTrig *fMcTrig;
    1818
    19  public:   
    20   MCollAreaTrigger (const char *name=NULL, const char *title=NULL);
     19    MHMcCollectionArea *fCollArea;
    2120
    22   Bool_t PreProcess(MParList *pList);
    23   Bool_t Process() ;
    24   Bool_t PostProcess() ;
    25  
    26   ClassDef(MCollAreaTrigger, 0) // Task to fill the collection area histograms
     21public:
     22    MMcCollectionAreaCalc(const char *name=NULL, const char *title=NULL);
    2723
     24    Bool_t PreProcess(MParList *pList);
     25    Bool_t Process() ;
     26    Bool_t PostProcess() ;
     27
     28    ClassDef(MMcCollectionAreaCalc, 0) // Task to calculate the collection area histogram
    2829};
    2930
  • 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.