Bug fix for the case of more than 30 timebins
[u/mrichter/AliRoot.git] / TRD / AliTRDdigitsManager.h
CommitLineData
8230f242 1#ifndef ALITRDDIGITSMANAGER_H
2#define ALITRDDIGITSMANAGER_H
6f1e466d 3
4/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
6
ca21baaa 7/* $Id$ */
6f1e466d 8
9/////////////////////////////////////////////////////////////
10// Manages the TRD digits //
11/////////////////////////////////////////////////////////////
12
793ff80c 13#include <TObject.h>
6f1e466d 14
2ab0c725 15class TFile;
abaf1f1d 16class TTree;
b65e5048 17class TBranch;
793ff80c 18class AliTRDdigit;
ca21baaa 19class AliTRDSignalIndex;
b65e5048 20class AliTRDarrayADC;
21class AliTRDarraySignal;
22class AliTRDarrayDictionary;
966f6939 23class AliTRDdigitsParam;
6f1e466d 24
25class AliTRDdigitsManager : public TObject {
26
27 public:
28
dd56b762 29 enum { kNDict = 3 };
30
3d0c7d6d 31 AliTRDdigitsManager(Bool_t rawRec = kFALSE); //if true digitsmanager uses only one entry in the TObjectArrays
dd9a6ee3 32 AliTRDdigitsManager(const AliTRDdigitsManager &m);
8230f242 33 virtual ~AliTRDdigitsManager();
dd9a6ee3 34 AliTRDdigitsManager &operator=(const AliTRDdigitsManager &m);
6f1e466d 35
625f5260 36 virtual void Copy(TObject &m) const;
37
abaf1f1d 38 virtual void CreateArrays();
17eee78a 39 virtual void ResetArrays();
486c2339 40 virtual void ResetArrays(Int_t det);
625f5260 41 virtual Bool_t BuildIndexes(Int_t det);
88cb7938 42
77ad13f4 43 virtual Bool_t MakeBranch(TTree * const tree);
44 virtual Bool_t ReadDigits(TTree * consttree);
6f1e466d 45 virtual Bool_t WriteDigits();
46
625f5260 47 virtual void SetEvent(Int_t evt) { fEvent = evt; };
48 virtual void SetSDigits(Int_t v = 1) { fHasSDigits = v; };
49 virtual void SetUseDictionaries(Bool_t kval) { fUseDictionaries = kval; };
6f1e466d 50
625f5260 51 virtual Bool_t UsesDictionaries() const { return fUseDictionaries; };
52 virtual Bool_t HasSDigits() const { return fHasSDigits; };
53 static Int_t NDict() { return fgkNDict; };
793ff80c 54
b65e5048 55 virtual TObjArray *GetDigits() const { return fDigits; };
56 virtual TObjArray *GetDictionary(Int_t i) const { return fDict[i]; };
57
58 AliTRDdigit *GetDigit(Int_t row, Int_t col, Int_t time, Int_t det) const;
59 Int_t GetTrack(Int_t track, Int_t row, Int_t col, Int_t time, Int_t det) const;
60
61 AliTRDarrayADC *GetDigits(Int_t det) const;
62 AliTRDarraySignal *GetSDigits(Int_t det) const;
63 AliTRDarrayDictionary *GetDictionary(Int_t det, Int_t i) const;
966f6939 64 AliTRDdigitsParam *GetDigitsParam() const { return fDigitsParam; };
b65e5048 65 AliTRDSignalIndex *GetIndexes(Int_t det);
77ad13f4 66 TObjArray *GetIndexes() const { return fSignalIndexes; };
b65e5048 67
68 void RemoveDigits(Int_t det);
69 void RemoveDictionaries(Int_t det);
486c2339 70 void RemoveIndexes(Int_t det);
b65e5048 71 void ClearIndexes(Int_t det);
72
77ad13f4 73 Int_t GetTrack(Int_t track, AliTRDdigit * const digit) const;
b65e5048 74 Short_t GetDigitAmp(Int_t row, Int_t col, Int_t time, Int_t det) const;
75 UChar_t GetPadStatus(Int_t row, Int_t col, Int_t time, Int_t det) const;
76
966f6939 77 Bool_t LoadArrayDigits();
78 Bool_t LoadArrayDict();
79 Bool_t LoadDigitsParam();
80 Bool_t StoreArrayDigits();
81 Bool_t StoreArrayDict();
82 Bool_t StoreDigitsParam();
83
6f1e466d 84 protected:
b65e5048 85
793ff80c 86 static const Int_t fgkNDict; // Number of track dictionary arrays
abaf1f1d 87 Int_t fEvent; // Event number
abaf1f1d 88 TTree *fTree; //! Tree for the digits arrays
b65e5048 89 TObjArray *fDigits; // Digits data array
90 TObjArray *fDict[kNDict]; // Track dictionary data array
625f5260 91 Bool_t fHasSDigits; // Switch for the summable digits
ca21baaa 92 TObjArray *fSignalIndexes; // Provides access to the active pads and tbins
001be664 93 Bool_t fUseDictionaries; // Use dictionaries or not (case of real data)
486c2339 94 Int_t fDets; // No of Detectors
3d0c7d6d 95 Bool_t fRawRec; // Reconstruct from raw files? If its kTRUE then the TObjArrays have only one entry.
966f6939 96 AliTRDdigitsParam *fDigitsParam; // Parameters of the digits
625f5260 97
966f6939 98 ClassDef(AliTRDdigitsManager,8) // Manages the TRD digits
6f1e466d 99
100};
6f1e466d 101#endif