Changeset 760


Ignore:
Timestamp:
04/23/01 14:16:02 (24 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mbase/MReadTree.cc

    r757 r760  
    5555
    5656// --------------------------------------------------------------------------
     57//
     58//  Default constructor. It creates an TChain instance which represents the
     59//  the Tree you want to read and adds the given file (if you gave one).
     60//  More files can be added using MReadTree::AddFile.
     61//  Also an empty veto list is created. This list is used if you want to
     62//  veto (disable or "don't enable") a branch in the tree.
     63//
    5764MReadTree::MReadTree(const char *tname, const char *fname,
    5865                     const char *name, const char *title)
     
    7279
    7380// --------------------------------------------------------------------------
     81//
     82// Destructor. It deletes the TChain and veto list object
     83//
    7484MReadTree::~MReadTree()
    7585{
     
    7989
    8090// --------------------------------------------------------------------------
     91//
     92//  If you want to read the given tree over several files you must add
     93//  the files here before PreProcess is called. Be carfull: This does
     94//  only work if the trees in the files containing the same branches yet.
     95//
    8196/*Int_t*/ void MReadTree::AddFile(const char *fname)
    8297{
     
    92107// --------------------------------------------------------------------------
    93108//
    94 // open file and check if file is really open
     109//  The PreProcess loops (till now) over the branches in the given tree.
     110//  It checks if the corresponding containers (containers with the same
     111//  name than the branch name) are existing in the Parameter Container List.
     112//  If not, a container of objec type 'branch-name' is created (everything
     113//  after the last semicolon in the branch name is stripped). Only
     114//  branches which don't have a veto (see VetoBranch) are enabled If the
     115//  object isn't found in the root dictionary (a list of classes known by the
     116//  root environment) the branch is skipped and an error message is printed
     117//  out.
    95118//
    96119Bool_t MReadTree::PreProcess (MParList *pList)
     
    167190
    168191// --------------------------------------------------------------------------
     192//
     193//  The Process-function reads one event from the tree (this contains all
     194//  enabled branches) and increases the position in the file by one event.
     195//  (Remark: The position can also be set by some member functions
     196//  If the end of the file is reached the Eventloop is stopped.
    169197Bool_t MReadTree::Process()
    170198{
     
    178206    // get entry
    179207    //
    180     fChain->GetEntry(fNumEntry );
    181 
    182     fNumEntry ++ ;
    183 
    184     return kTRUE;
    185 }
    186 
    187 // --------------------------------------------------------------------------
    188 //
    189 // Close File
    190 //
    191 Bool_t MReadTree::PostProcess()
    192 {
    193     //fFile->Close();
     208    fChain->GetEntry(fNumEntry);
     209
     210    fNumEntry++;
    194211
    195212    return kTRUE;
  • trunk/MagicSoft/Mars/mbase/MReadTree.h

    r757 r760  
    2929    Bool_t PreProcess(MParList *pList);
    3030    Bool_t Process();
    31     Bool_t PostProcess();
    3231
    3332    void AddFile(const char *fname);
  • trunk/MagicSoft/Mars/mraw/MRawCrateArray.cc

    r749 r760  
    4242ClassImp(MRawCrateArray)
    4343
     44// --------------------------------------------------------------------------
     45//
     46//  Default Constructor. It creates the TClonesArray which is used to store
     47//  the crate data.
     48//
    4449MRawCrateArray::MRawCrateArray(const char *name, const char *title)
    4550{
     
    5459}
    5560
     61// --------------------------------------------------------------------------
     62//
     63//  Destructor. Deletes the TClones Array which stores the crate information
     64//
    5665MRawCrateArray::~MRawCrateArray()
    5766{
     67    //  FIXME: Is the contained data deleted, too?
    5868    delete fArray;
    5969}
    6070
     71// --------------------------------------------------------------------------
     72//
     73// clear the entries in the TClonesArray
     74//
    6175void MRawCrateArray::Clear(Option_t *opt)
    6276{
    63     //
    64     // clear the entries in the TClonesArray
    65     //
    6677    fArray->Clear();
    6778}
    6879
    69 void MRawCrateArray::Print(Option_t *opt)
    70 {
    71     *fLog << "MRawCrateArray::Print()" << endl;
    72 }
    73 
     80// --------------------------------------------------------------------------
     81//
     82// Return a pointer the i-th entry in the array
     83//
    7484MRawCrateData *MRawCrateArray::GetEntry(Int_t i)
    7585{
    76     //
    77     // Return a pointer the i-th entry in the array
    78     //
    7986    return (MRawCrateData*)fArray->AddrAt(i);
    8087}
    8188
     89// --------------------------------------------------------------------------
     90//
     91// Return the i-th entry in the array
     92//
    8293MRawCrateData* &MRawCrateArray::operator[](Int_t i)
    8394{
    84     //
    85     // Return the i-th entry in the array
    86     //
    8795    return (MRawCrateData*&)(*fArray)[i];
    8896}
    8997
     98// --------------------------------------------------------------------------
     99//
     100// return a pointer to the pointer of the array
     101// (actually not used. You may need it if you want to write
     102//  the TClonesArray directly)
     103//
    90104TClonesArray **MRawCrateArray::GetArray()
    91105{
    92     //
    93     // return a pointer to the pointer of the array
    94     // (actually not used. You may need it if you want to write
    95     //  the TClonesArray directly)
    96     //
    97106    return &fArray;
    98107}
Note: See TracChangeset for help on using the changeset viewer.