]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDsegmentArrayBase.h
Gsbool and GetMCGeomType added
[u/mrichter/AliRoot.git] / TRD / AliTRDsegmentArrayBase.h
index cd6ceae1ebb152869a8f40b6f694960bdd70c729..f842b0c17dc8c64707a2cc19515c5ce9386f36f0 100644 (file)
@@ -1,20 +1,15 @@
-#ifndef ALISEGARRAYBASE_H
-#define ALISEGARRAYBASE_H
+#ifndef ALITRDSEGMENTARRAYBASE_H
+#define ALITRDSEGMENTARRAYBASE_H
 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
  * See cxx source for full Copyright notice                               */
 
 /* $Id: AliTRDsegmentArrayBase.h,v */
 
 ////////////////////////////////////////////////
-//  Manager class generaol Alice segment 
-//  segment is for example one pad row in TPC //
+//  Manager class for a general Alice segment // 
 ////////////////////////////////////////////////
 
-#include "TNamed.h"
-#include "TError.h"
-#include "TObjArray.h"
-
-//#include "AliTRDsegmentID.h"
+#include <TNamed.h>
 
 class TTree;
 class TBranch;
@@ -22,58 +17,48 @@ class AliTRDarrayI;
 class AliTRDsegmentID;
 class TObjArray;
  
-class AliTRDsegmentArrayBase: public TNamed{
-public:
+class AliTRDsegmentArrayBase: public TNamed {
+
+ public:
+
   AliTRDsegmentArrayBase();
-  AliTRDsegmentArrayBase(Text_t *classname, Int_t n);  //
-  Bool_t  SetClass(Text_t *classname);  //set class of stored object
-  ~AliTRDsegmentArrayBase();
-  inline const AliTRDsegmentID * At(Int_t i); //return pointer to segment with index i 
-  inline const AliTRDsegmentID * operator[](Int_t i); //return pointer to segment with index i
+  AliTRDsegmentArrayBase(Text_t *classname, Int_t n); 
+  AliTRDsegmentArrayBase(const AliTRDsegmentArrayBase &a);
+  virtual ~AliTRDsegmentArrayBase();
+  AliTRDsegmentArrayBase &operator=(const AliTRDsegmentArrayBase &a);
+  const AliTRDsegmentID *At(Int_t i) const; 
+  const AliTRDsegmentID *operator[](Int_t i); 
 
-  Bool_t AddSegment(AliTRDsegmentID *segment); // add segment to array
-  AliTRDsegmentID * AddSegment(Int_t index);   //create objet and set index
-  Bool_t   MakeArray(Int_t n);       //make array of pointers to Segments
-  void ClearSegment(Int_t index); //remove segment from active   
-  virtual AliTRDsegmentID * NewSegment(); //dynamicaly create new segment 
-  //input output functions
-  TTree * GetTree(){return fTree;}      //return pointer to connected tree
-  
-  virtual void MakeTree();              //Make tree with the name
-  virtual Bool_t ConnectTree(const char * treeName); //connect tree from current directory 
-  virtual AliTRDsegmentID * LoadSegment(Int_t index);//load segment with index to the memory
-  virtual AliTRDsegmentID * LoadEntry(Int_t index); //load segment entry from position index in tree
-  virtual void StoreSegment(Int_t index);//write segmen persistent  
-  Bool_t  MakeDictionary(Int_t size);//create index table for tree
-  TClass * GetClass() {return fClass;}
-public:
-  TObjArray  * fSegment;  //!pointer to array of pointers to segment
-  AliTRDarrayI    * fTreeIndex; //!pointers(index) table in tree
-  Int_t      fNSegment;   
-  TTree    * fTree;   //!tree with segment objects
-  TBranch  * fBranch; //!total branch 
-private: 
-  TClass  *   fClass;    //!class type of included objects 
-  ClassDef(AliTRDsegmentArrayBase,1) 
-};
+          Bool_t           AddSegment(AliTRDsegmentID *segment);
+          AliTRDsegmentID *AddSegment(Int_t index);  
+          void             ClearSegment(Int_t index); 
+  virtual void             Copy(TObject &a);
+  virtual Bool_t           ConnectTree(const char *treeName);
+          Bool_t           MakeArray(Int_t n);    
+  virtual AliTRDsegmentID *NewSegment(); 
+  virtual void             MakeTree(char *file = 0);           
+  virtual AliTRDsegmentID *LoadSegment(Int_t index);
+  virtual AliTRDsegmentID *LoadEntry(Int_t index); 
+  virtual void             StoreSegment(Int_t index);
+          Bool_t           MakeDictionary(Int_t size);
 
+          Bool_t           SetClass(Text_t *classname);
+          TClass          *GetClass() const { return fClass; };
+          TTree           *GetTree() const  { return fTree;  };   
+
+ protected:
 
+  TObjArray    *fSegment;            //! Pointer to an array of pointers to a segment
+  AliTRDarrayI *fTreeIndex;          //! Pointers(index) table
+  Int_t         fNSegment;           //  Number of segments 
+  TTree        *fTree;               //! Tree with segment objects
+  TBranch      *fBranch;             //! Branchaddress
+  TClass       *fClass;              //! Class type of included objects 
 
-const AliTRDsegmentID*  AliTRDsegmentArrayBase::operator[](Int_t i)
-{
-  //
-  //return segment with given index
-  //
-  if ( (i<0) || (i>=fNSegment)) return 0; 
-  return (AliTRDsegmentID *)fSegment->At(i);
-}
-const AliTRDsegmentID*  AliTRDsegmentArrayBase::At(Int_t i)
-{
-  //
-  //return segment with given index
-  //
-  if ( (i<0) || (i>=fNSegment)) return 0; 
-  return (AliTRDsegmentID *)((*fSegment)[i]);
-}
+  ClassDef(AliTRDsegmentArrayBase,1) // TRD detextor segment array base class
+
+};
 
-#endif //ALISEGARRAY_H
+#endif