1 #ifndef TRDdigitsManager_H
2 #define TRDdigitsManager_H
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
7 /* $Id: AliTRDdigitsManager.h,v */
9 /////////////////////////////////////////////////////////////
10 // Manages the TRD digits //
11 /////////////////////////////////////////////////////////////
15 #include "AliTRDsegmentArray.h"
16 #include "AliTRDdataArrayI.h"
17 #include "AliTRDdigit.h"
19 const Int_t kNDict = 3;
21 class AliTRDdigitsManager : public TObject {
25 AliTRDdigitsManager();
26 ~AliTRDdigitsManager();
28 virtual Bool_t MakeBranch();
29 virtual Bool_t ReadDigits();
30 virtual Bool_t WriteDigits();
32 virtual void SetRaw();
34 virtual Bool_t IsRaw() { return fIsRaw; };
35 virtual AliTRDsegmentArray *GetDigits() { return fDigits; };
36 virtual AliTRDsegmentArray *GetDictionary(Int_t i) { return fDictionary[i]; };
38 inline AliTRDdataArrayI *GetDigits(Int_t det);
39 inline AliTRDdataArrayI *GetDictionary(Int_t det, Int_t i);
40 inline AliTRDdigit *GetDigit(Int_t row, Int_t col, Int_t time, Int_t det);
41 inline Int_t GetTrack(Int_t track, Int_t row, Int_t col, Int_t time, Int_t det);
42 inline Int_t GetTrack(Int_t track, AliTRDdigit *Digit);
46 AliTRDsegmentArray *fDigits; //! Digits data Array
47 AliTRDsegmentArray *fDictionary[kNDict]; //! Track dictionary data array
49 Bool_t fIsRaw; // Flag indicating raw digits
51 ClassDef(AliTRDdigitsManager,1) // Manages the TRD digits
55 //_____________________________________________________________________________
56 inline AliTRDdataArrayI *AliTRDdigitsManager::GetDigits(Int_t det)
59 // Returns the digits array for one detector
62 return (AliTRDdataArrayI *) fDigits->At(det);
67 //_____________________________________________________________________________
68 inline AliTRDdataArrayI *AliTRDdigitsManager::GetDictionary(Int_t det, Int_t i)
71 // Returns the dictionary for one detector
74 return (AliTRDdataArrayI *) fDictionary[i]->At(det);
78 //_____________________________________________________________________________
79 inline AliTRDdigit *AliTRDdigitsManager::GetDigit(Int_t row, Int_t col
80 , Int_t time, Int_t det)
83 // Creates a single digit object
92 digits[4] = GetDigits(det)->GetData(row,col,time);
94 return (new AliTRDdigit(fIsRaw,digits));
98 //_____________________________________________________________________________
99 inline Int_t AliTRDdigitsManager::GetTrack(Int_t track
100 , Int_t row, Int_t col, Int_t time
104 // Returns the MC-track numbers from the dictionary.
107 if ((track < 0) || (track >= kNDict)) {
108 TObject::Error("GetTracks"
109 ,"track %d out of bounds (size: %d, this: 0x%08x)"
114 // Array contains index+1 to allow data compression
115 return (GetDictionary(det,track)->GetData(row,col,time) - 1);
119 //_____________________________________________________________________________
120 inline Int_t AliTRDdigitsManager::GetTrack(Int_t track, AliTRDdigit *Digit)
123 // Returns the MC-track numbers from the dictionary for a given digit
126 Int_t row = Digit->GetRow();
127 Int_t col = Digit->GetCol();
128 Int_t time = Digit->GetTime();
129 Int_t det = Digit->GetDetector();
131 return GetTrack(track,row,col,time,det);