]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDdigitsManager.h
Make some calculations optional for HLT
[u/mrichter/AliRoot.git] / TRD / AliTRDdigitsManager.h
index 5ecff21381f0aa0f67a0ff44ece5006fedd7a16b..d649a1e74ce210421d86eee078fc7a3f25573bf7 100644 (file)
@@ -4,7 +4,7 @@
 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
  * See cxx source for full Copyright notice                               */
 
-/* $Id: AliTRDdigitsManager.h,v */
+/* $Id$ */
 
 /////////////////////////////////////////////////////////////
 //  Manages the TRD digits                                 //
 
 class TFile;
 class TTree;
-
-class AliTRDsegmentArray;
-class AliTRDdataArrayI;
+class TBranch;  
 class AliTRDdigit;
+class AliTRDSignalIndex;
+class AliTRDarrayADC;  
+class AliTRDarraySignal; 
+class AliTRDarrayDictionary;
 
 class AliTRDdigitsManager : public TObject {
 
@@ -25,59 +27,73 @@ class AliTRDdigitsManager : public TObject {
 
   enum { kNDict = 3 };
 
-  AliTRDdigitsManager();
+  AliTRDdigitsManager(Bool_t rawRec = kFALSE);  //if true digitsmanager uses only one entry in the TObjectArrays
   AliTRDdigitsManager(const AliTRDdigitsManager &m);
   virtual ~AliTRDdigitsManager();
   AliTRDdigitsManager &operator=(const AliTRDdigitsManager &m);
 
+  virtual void                Copy(TObject &m) const;
+
   virtual void                CreateArrays();
   virtual void                ResetArrays();
-  virtual void                Copy(TObject &m);
-  virtual Bool_t              Open(const Char_t *file);
-  virtual Bool_t              MakeBranch(const Char_t *file = 0);
-  virtual Bool_t              MakeBranch(TTree *tree, const Char_t *file = 0);
-          void                MakeTreeAndBranches(TFile *treeFile, Int_t iEvent);
-  virtual Bool_t              ReadDigits(TTree *tree = 0);
-  virtual Bool_t              WriteDigits();
-
-  virtual void                SetRaw();
-  virtual void                SetEvent(Int_t evt)          { fEvent   = evt; };
-  virtual void                SetDebug(Int_t v = 1)        { fDebug   = v;   };
-  virtual void                SetSDigits(Int_t v = 1)      { fSDigits = v;   };
+  virtual void                ResetArrays(Int_t det);
+  virtual Bool_t              BuildIndexes(Int_t det);
 
-  virtual Bool_t              IsRaw() const                { return fIsRaw;         };
-  static  Int_t               NDict()                      { return fgkNDict;       }; 
-
-  virtual AliTRDsegmentArray *GetDigits() const            { return fDigits;        };
-  virtual AliTRDsegmentArray *GetDictionary(Int_t i) const { return fDictionary[i]; };
-
-          AliTRDdigit        *GetDigit(Int_t row, Int_t col, Int_t time, Int_t det) const;
-          Int_t               GetTrack(Int_t track, Int_t row, Int_t col
-                                     , Int_t time, Int_t det) const;
-
-          AliTRDdataArrayI   *GetDigits(Int_t det) const;
-          AliTRDdataArrayI   *GetDictionary(Int_t det, Int_t i) const;
-          Int_t               GetTrack(Int_t track, AliTRDdigit *Digit) const;
-          Short_t             GetDigitAmp(Int_t row, Int_t col, Int_t time, Int_t det) const;
+  virtual Bool_t              MakeBranch(TTree *tree);
+  virtual Bool_t              ReadDigits(TTree *tree);
+  virtual Bool_t              WriteDigits();
 
+  virtual void                SetEvent(Int_t evt)             { fEvent           = evt;  };
+  virtual void                SetSDigits(Int_t v = 1)         { fHasSDigits      = v;    };
+  virtual void                SetUseDictionaries(Bool_t kval) { fUseDictionaries = kval; };
+
+  virtual Bool_t              UsesDictionaries() const        { return fUseDictionaries; };
+  virtual Bool_t              HasSDigits() const              { return fHasSDigits;      };
+  static  Int_t               NDict()                         { return fgkNDict;         }; 
+
+  virtual TObjArray          *GetDigits() const               { return fDigits;          };  
+  virtual TObjArray          *GetDictionary(Int_t i) const    { return fDict[i];         }; 
+
+  AliTRDdigit                *GetDigit(Int_t row, Int_t col, Int_t time, Int_t det) const;
+  Int_t                       GetTrack(Int_t track, Int_t row, Int_t col, Int_t time, Int_t det) const;
+  
+  AliTRDarrayADC             *GetDigits(Int_t det)  const;
+  AliTRDarraySignal          *GetSDigits(Int_t det) const;    
+  AliTRDarrayDictionary      *GetDictionary(Int_t det, Int_t i) const;  
+  
+  AliTRDSignalIndex          *GetIndexes(Int_t det);
+  TObjArray                  *GetIndexes()                    { return fSignalIndexes;   };
+
+  void                        RemoveDigits(Int_t det);
+  void                        RemoveDictionaries(Int_t det);
+  void                        RemoveIndexes(Int_t det);
+  void                        ClearIndexes(Int_t det);
+  
+  Int_t                       GetTrack(Int_t track, AliTRDdigit *digit) const;
+  Short_t                     GetDigitAmp(Int_t row, Int_t col, Int_t time, Int_t det) const;
+  UChar_t                     GetPadStatus(Int_t row, Int_t col, Int_t time, Int_t det) const;
+
+  Bool_t                      LoadArray(TObjArray *object, const Char_t *branchname, TTree *tree=0);  
+  Bool_t                      LoadArrayDict(TObjArray *object, const Char_t *branchname, TTree *tree=0);  
+  Bool_t                      StoreArray(TObjArray *array1, const Char_t *branchname, TTree *tree=0); 
+  Bool_t                      StoreArrayDict(TObjArray *array3, const Char_t *branchname, TTree *tree=0); 
+  
  protected:
-
+  
   static const Int_t  fgkNDict;            //  Number of track dictionary arrays
-
   Int_t               fEvent;              //  Event number
-
-  TFile              *fFile;               //! File containing the TRD digits tree
   TTree              *fTree;               //! Tree for the digits arrays
-
-  AliTRDsegmentArray *fDigits;             //! Digits data array
-  AliTRDsegmentArray *fDictionary[kNDict]; //! Track dictionary data array
-
-  Bool_t              fIsRaw;              //  Flag indicating raw digits
-  Bool_t              fSDigits;            //  Switch for the summable digits
-  Int_t               fDebug;              //  Debug flag
-
-  ClassDef(AliTRDdigitsManager,4)          //  Manages the TRD digits
+  TObjArray          *fDigits;             //  Digits data array               
+  TObjArray          *fDict[kNDict];       //  Track dictionary data array   
+  Bool_t              fHasSDigits;         //  Switch for the summable digits
+  TObjArray          *fSignalIndexes;      //  Provides access to the active pads and tbins
+  Bool_t              fUseDictionaries;    //  Use dictionaries or not (case of real data)
+  TTree              *fTreeD;              //  Tree with detector objects
+  TBranch            *fBranch;             //  Branchaddress
+  Int_t               fDets;               //  No of Detectors
+  Bool_t              fRawRec;             //  Reconstruct from raw files? If its kTRUE then the TObjArrays have only one entry.
+
+  ClassDef(AliTRDdigitsManager,7)          //  Manages the TRD digits
 
 };
-
 #endif