Ignore:
Timestamp:
08/20/04 11:25:36 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mraw
Files:
4 edited

Legend:

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

    r4577 r4694  
    109109    fFileNames->SetOwner();
    110110
    111     if(fname!=NULL)
    112       AddFile(fname);
     111    if (fname!=NULL)
     112        AddFile(fname);
    113113}
    114114
     
    230230// Return file name of current file.
    231231//
    232 const TString MRawFileRead::GetFileName() const
     232TString MRawFileRead::GetFileName() const
    233233{
    234234    const TObject *file = fFileNames->At(fNumFile-1);
  • trunk/MagicSoft/Mars/mraw/MRawFileRead.h

    r4601 r4694  
    3434    void SetInterleave(UInt_t i) { fInterleave = i; }
    3535
    36     const TString GetFileName() const;
     36    TString GetFileName() const;
    3737
    3838    Int_t  AddFile(const char *fname, Int_t entries=-1);
  • trunk/MagicSoft/Mars/mraw/MRawFileWrite.cc

    r4370 r4694  
    6565                             const char *ftitle,
    6666                             const Int_t comp,
    67                              const char *name, const char *title)
     67                             const char *name, const char *title) : fSplit(kFALSE)
    6868{
    6969    fName  = name  ? name  : "MRawFileWrite";
     
    8282MRawFileWrite::~MRawFileWrite()
    8383{
     84    if (fOut != fTData->GetCurrentFile())
     85    {
     86        *fLog << warn << endl;
     87        *fLog << "WARNING - MWriteRootFile:   Root's  TTree/TFile   has  opened   a  new  file" << endl;
     88        *fLog << "  automatically.  You can change this behaviour using TTree::SetMaxTreeSize." << endl;
     89        *fLog << "  You won't be able to read splitted  files  correctly with MReadMarsFile if" << endl;
     90        *fLog << "  they have more than one entry in 'RunHeaders' or you try to read more than" << endl;
     91        *fLog << "  one of such sequences at once." << endl;
     92        *fLog << endl;
     93    }
     94
     95    //
     96    // For more information see TTree:ChangeFile()
     97    //
     98    fOut = fTData->GetCurrentFile();
     99
    84100    //
    85101    // delete instance, this also does a fOut->Close()
     
    125141
    126142    //
    127     // remember the pointer to the parameter list fur further usage
    128     //
    129     pParList = pList;
    130 
    131     //
    132143    //  check if MEvtHeader exists in the Parameter list already.
    133144    //  if not create one and add them to the list
     
    180191    // create data trees for the three types of data
    181192    //
    182     fTData        = new TTree("Events",      "Normal Triggered Events");
    183     fTPedestal    = new TTree("Pedestals",   "Pedestal Triggered Events");
    184     fTCalibration = new TTree("Calibration", "Calibration Triggered Events");
     193    fTData        =          new TTree("Events",      "Normal Triggered Events");
     194    fTPedestal    = fSplit ? new TTree("Pedestals",   "Pedestal Triggered Events")    : fTData;
     195    fTCalibration = fSplit ? new TTree("Calibration", "Calibration Triggered Events") : fTData;
    185196
    186197    //
     
    207218    // FIXME: Can we calculate a good buffer size out of the event size?
    208219    //        using splitlevel=0 sppeds up writing by a factor of 5-10%
    209     fTData       ->Branch("MTime.",          "MTime",          &fTime,          32000);
     220    fTData->Branch("MTime.",          "MTime",          &fTime,          32000);
     221    fTData->Branch("MRawEvtHeader.",  "MRawEvtHeader",  &fRawEvtHeader,  32000);
     222    fTData->Branch("MRawEvtData.",    "MRawEvtData",    &fRawEvtData,    320000);
     223    fTData->Branch("MRawCrateArray.", "MRawCrateArray", &fRawCrateArray, 32000);
     224    if (!fSplit)
     225        return kTRUE;
     226
    210227    fTPedestal   ->Branch("MTime.",          "MTime",          &fTime,          32000);
    211228    fTCalibration->Branch("MTime.",          "MTime",          &fTime,          32000);
    212     fTData       ->Branch("MRawEvtHeader.",  "MRawEvtHeader",  &fRawEvtHeader,  32000);
    213229    fTPedestal   ->Branch("MRawEvtHeader.",  "MRawEvtHeader",  &fRawEvtHeader,  32000);
    214230    fTCalibration->Branch("MRawEvtHeader.",  "MRawEvtHeader",  &fRawEvtHeader,  32000);
    215     fTData       ->Branch("MRawEvtData.",    "MRawEvtData",    &fRawEvtData,    320000);
    216231    fTPedestal   ->Branch("MRawEvtData.",    "MRawEvtData",    &fRawEvtData,    320000);
    217232    fTCalibration->Branch("MRawEvtData.",    "MRawEvtData",    &fRawEvtData,    320000);
    218     //fTree->Branch("MRawCrateArray",  fRawCrateArray->GetArray(),      32000, 1);
    219     fTData       ->Branch("MRawCrateArray.", "MRawCrateArray", &fRawCrateArray, 32000);
    220233    fTPedestal   ->Branch("MRawCrateArray.", "MRawCrateArray", &fRawCrateArray, 32000);
    221234    fTCalibration->Branch("MRawCrateArray.", "MRawCrateArray", &fRawCrateArray, 32000);
  • trunk/MagicSoft/Mars/mraw/MRawFileWrite.h

    r4370 r4694  
    1919{
    2020private:
    21     MParList *pParList;
    22 
    2321    MTime          *fTime;
    2422    MRawRunHeader  *fRawRunHeader;
     
    3533    TFile *fOut;                    //!
    3634
     35    Bool_t fSplit;
     36
    3737    Int_t  PreProcess(MParList *pList);
    3838    Bool_t ReInit(MParList *pList);
     
    4747    ~MRawFileWrite();
    4848
     49    void EnableSplit(Bool_t b=kTRUE) { fSplit=b; }
     50
    4951    ClassDef(MRawFileWrite, 0)  // Task to write the raw data containers to a root file
    5052};
Note: See TracChangeset for help on using the changeset viewer.