]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDdigitsManager.h
Iron replaced by stainless steel.
[u/mrichter/AliRoot.git] / TRD / AliTRDdigitsManager.h
index 98aedb193bfcc464f3a0fe4abd129331f72fc9b9..d47697356673e5bcd673b84caa9eee51ec70341d 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef TRDdigitsManager_H
-#define TRDdigitsManager_H
+#ifndef ALITRDDIGITSMANAGER_H
+#define ALITRDDIGITSMANAGER_H
 
 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
  * See cxx source for full Copyright notice                               */
 //  Manages the TRD digits                                 //
 /////////////////////////////////////////////////////////////
 
-#include "TObject.h"
+#include <TObject.h>
 
-#include "AliTRDsegmentArray.h"
-#include "AliTRDdataArrayI.h"
-#include "AliTRDdigit.h"
+class TFile;
+class TTree;
 
-const Int_t  kNDict = 3;
+class AliTRDsegmentArray;
+class AliTRDdataArrayI;
+class AliTRDdigit;
 
 class AliTRDdigitsManager : public TObject {
 
  public:
 
+  enum { kNDict = 3 };
+
   AliTRDdigitsManager();
-  ~AliTRDdigitsManager();
+  AliTRDdigitsManager(const AliTRDdigitsManager &m);
+  virtual ~AliTRDdigitsManager();
+  AliTRDdigitsManager &operator=(const AliTRDdigitsManager &m);
+
+  virtual void                CreateArrays();
+  virtual void                ResetArrays();
+  virtual void                Copy(TObject &m) const;
 
-  virtual Bool_t              MakeBranch();
-  virtual Bool_t              ReadDigits();
+  virtual Bool_t              MakeBranch(TTree *tree);
+          
+  virtual Bool_t              ReadDigits(TTree *tree);
   virtual Bool_t              WriteDigits();
 
   virtual void                SetRaw();
+  virtual void                SetEvent(Int_t evt)          { fEvent   = evt; };
+  virtual void                SetSDigits(Int_t v = 1)      { fSDigits = v;   };
+
+  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]; };
 
-  virtual Bool_t              IsRaw()                { return fIsRaw;         };
-  virtual AliTRDsegmentArray *GetDigits()            { return fDigits;        };
-  virtual AliTRDsegmentArray *GetDictionary(Int_t i) { 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;
 
-  inline  AliTRDdataArrayI   *GetDigits(Int_t det);
-  inline  AliTRDdataArrayI   *GetDictionary(Int_t det, Int_t i);
-  inline  AliTRDdigit        *GetDigit(Int_t row, Int_t col, Int_t time, Int_t det);
-  inline  Int_t               GetTrack(Int_t track, Int_t row, Int_t col, Int_t time, Int_t det);
-  inline  Int_t               GetTrack(Int_t track, AliTRDdigit *Digit);
+          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;
 
  protected:
 
-  AliTRDsegmentArray *fDigits;             //! Digits data Array
+  static const Int_t  fgkNDict;            //  Number of track dictionary arrays
+
+  Int_t               fEvent;              //  Event number
+
+  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
 
-  ClassDef(AliTRDdigitsManager,1)          //  Manages the TRD digits
+  ClassDef(AliTRDdigitsManager,5)          //  Manages the TRD digits
 
 };
 
-//_____________________________________________________________________________
-inline AliTRDdataArrayI *AliTRDdigitsManager::GetDigits(Int_t det) 
-{
-  //
-  // Returns the digits array for one detector
-  //
-
-  return (AliTRDdataArrayI *) fDigits->At(det);
-
-}
-
-
-//_____________________________________________________________________________
-inline AliTRDdataArrayI *AliTRDdigitsManager::GetDictionary(Int_t det, Int_t i) 
-{
-  //
-  // Returns the dictionary for one detector
-  //
-
-  return (AliTRDdataArrayI *) fDictionary[i]->At(det);
-
-}
-
-//_____________________________________________________________________________
-inline AliTRDdigit *AliTRDdigitsManager::GetDigit(Int_t row, Int_t col
-                                                , Int_t time, Int_t det)
-{
-  // 
-  // Creates a single digit object 
-  //
-
-  Int_t digits[5];
-
-  digits[0] = det;
-  digits[1] = row;
-  digits[2] = col;
-  digits[3] = time;
-  digits[4] = GetDigits(det)->GetData(row,col,time);
-  
-  return (new AliTRDdigit(fIsRaw,digits));
-
-}
-
-//_____________________________________________________________________________
-inline Int_t AliTRDdigitsManager::GetTrack(Int_t track
-                                         , Int_t row, Int_t col, Int_t time
-                                         , Int_t det)
-{
-  // 
-  // Returns the MC-track numbers from the dictionary.
-  //
-
-  if ((track < 0) || (track >= kNDict)) {
-    TObject::Error("GetTracks"
-                  ,"track %d out of bounds (size: %d, this: 0x%08x)"
-                  ,track,kNDict,this);
-    return -1;
-  }
-
-  // Array contains index+1 to allow data compression
-  return (GetDictionary(det,track)->GetData(row,col,time) - 1);
-
-}
-
-//_____________________________________________________________________________
-inline Int_t AliTRDdigitsManager::GetTrack(Int_t track, AliTRDdigit *Digit)
-{
-  // 
-  // Returns the MC-track numbers from the dictionary for a given digit
-  //
-
-  Int_t row  = Digit->GetRow();
-  Int_t col  = Digit->GetCol();
-  Int_t time = Digit->GetTime();
-  Int_t det  = Digit->GetDetector();
-
-  return GetTrack(track,row,col,time,det);
-
-}
-
 #endif