]>
Commit | Line | Data |
---|---|---|
fb4e90e0 | 1 | #ifndef ALIITSPLIST_H |
2 | #define ALIITSPLIST_H | |
2134176d | 3 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * |
4 | * See cxx source for full Copyright notice */ | |
88cb7938 | 5 | |
590d15ee | 6 | //*********************************************************************** |
7 | // | |
8 | // It consist of a TClonesArray of | |
9 | // AliITSpListItem objects | |
10 | // This array can be accessed via 2 indexed | |
11 | // it is used at digitization level by | |
12 | // all the 3 ITS subdetectors | |
13 | // | |
14 | // *********************************************************************** | |
f45f6658 | 15 | #include "TArrayI.h" |
9881a682 | 16 | #include "TClonesArray.h" |
2134176d | 17 | #include "AliITSMap.h" |
fb4e90e0 | 18 | #include "AliITSpListItem.h" |
2134176d | 19 | |
20 | class AliITSpList: public AliITSMap { | |
2134176d | 21 | |
22 | public: | |
23 | // Default Constructor | |
24 | AliITSpList(); | |
25 | // Standard Constructor | |
26 | AliITSpList(Int_t imax,Int_t jmax); | |
27 | // Class destrutor | |
28 | virtual ~AliITSpList(); | |
fb4e90e0 | 29 | // Copy constructor |
30 | AliITSpList(const AliITSpList &source); | |
31 | // = Operator | |
2134176d | 32 | virtual AliITSpList& operator=(const AliITSpList &source); |
33 | // Returns the max mape index values | |
fb4e90e0 | 34 | void GetMaxMapIndex(Int_t &ni,Int_t &nj) const {ni=fNi;nj=fNj;return;} |
2134176d | 35 | // returns the max index value. |
fb4e90e0 | 36 | Int_t GetMaxIndex() const {return fNi*fNj;} |
9ce4d38b | 37 | // returns the largest non-zero entry kept in the array fa. |
9881a682 | 38 | Int_t GetEntries() const {return fEntries;} |
2134176d | 39 | // returns the max number of track/hit entries per cell. |
9881a682 | 40 | Int_t GetNEntries() const {return AliITSpListItem::GetMaxKept();} |
41 | // for a given TClonesArray index it returns the corresponding map index | |
fb4e90e0 | 42 | void GetMapIndex(Int_t index,Int_t &i,Int_t &j) const { |
2134176d | 43 | i = index/fNj;j = index - fNj*i; |
c7d528c6 | 44 | if(i<0||i>=fNi || j<0||j>=fNj){i=-1;j=-1; return;} |
2134176d | 45 | } |
46 | // Returns the signal+noise for a give map coordinate | |
590d15ee | 47 | Double_t GetSignal(Int_t index) { |
9ce4d38b | 48 | if(GetpListItem(index)==0) return 0.0; |
49 | return GetpListItem(index)->GetSumSignal(); | |
50 | } | |
51 | // Returns the signal+noise for a give map coordinate | |
590d15ee | 52 | virtual Double_t GetSignal(Int_t i,Int_t j) const { |
2134176d | 53 | if(GetpListItem(i,j)==0) return 0.0; |
54 | return GetpListItem(i,j)->GetSumSignal(); | |
55 | } | |
56 | // Returns the signal only for a give map coordinate | |
590d15ee | 57 | Double_t GetSignalOnly(Int_t i,Int_t j)const { |
2134176d | 58 | if(GetpListItem(i,j)==0) return 0.0; |
59 | return GetpListItem(i,j)->GetSignal(); | |
60 | } | |
61 | // Returns the noise for a give map coordinate | |
590d15ee | 62 | Double_t GetNoise(Int_t i,Int_t j) const { |
2134176d | 63 | if(GetpListItem(i,j)==0) return 0.0; |
64 | return GetpListItem(i,j)->GetNoise(); | |
65 | } | |
66 | // returns the track number which generated the signal at a given map | |
67 | // coordinate. If there is no signal or only noise, then -2 is returned. | |
68 | // k is the track rank number. | |
590d15ee | 69 | Double_t GetTSignal(Int_t i,Int_t j,Int_t k) const { |
2134176d | 70 | if(GetpListItem(i,j)==0) return 0.0; |
71 | return GetpListItem(i,j)->GetSignal(k); | |
72 | } | |
73 | // returns the track number which generated the signal at a given map | |
74 | // coordinate. If there is no signal or only noise, then -2 is returned. | |
75 | // k is the track rank number. | |
590d15ee | 76 | Int_t GetTrack(Int_t i,Int_t j,Int_t k) const { |
2134176d | 77 | if(GetpListItem(i,j)==0) return -2; |
78 | return GetpListItem(i,j)->GetTrack(k); | |
79 | } | |
80 | // returns the hit number which generated the signal at a given map | |
81 | // coordinate. If there is no signal or only noise, then -2 is returned. | |
82 | // k is the hit rank number. | |
590d15ee | 83 | Int_t GetHit(Int_t i,Int_t j,Int_t k) const { |
2134176d | 84 | if(GetpListItem(i,j)==0) return -2; |
85 | return GetpListItem(i,j)->GetHit(k); | |
86 | } | |
87 | // returns the number of Signal values | |
590d15ee | 88 | Int_t GetNSignals(Int_t i,Int_t j) const { |
2134176d | 89 | if(GetpListItem(i,j)==0) return 0; |
90 | return GetpListItem(i,j)->GetNsignals(); | |
91 | } | |
c7d528c6 | 92 | // Adds the contents of pl to the list with track number off set given by |
93 | // fileIndex. | |
94 | virtual void AddItemTo(Int_t fileIndex, AliITSpListItem *pl); | |
2134176d | 95 | // Adds a Signal value to the map. Creating and expanding arrays as needed. |
96 | void AddSignal(Int_t i,Int_t j,Int_t trk,Int_t ht,Int_t mod,Double_t sig); | |
97 | // Adds a Noise value to the map. Creating and expanding arrays as needed. | |
98 | void AddNoise(Int_t i,Int_t j,Int_t mod,Double_t noise); | |
9881a682 | 99 | // Delete all AliITSpListItems and zero the TClonesArray |
fb4e90e0 | 100 | virtual void ClearMap(); |
9881a682 | 101 | // Delete a particular AliITSpListItem in the TClonesArray. |
fb4e90e0 | 102 | virtual void DeleteHit(Int_t i,Int_t j); |
9881a682 | 103 | // returns hit index in TClonesArray |
fb4e90e0 | 104 | virtual Int_t GetHitIndex(Int_t i,Int_t j) const {return GetIndex(i,j);} |
2134176d | 105 | // returns "hit" AliITSpListItem as a TObject. |
590d15ee | 106 | TObject * GetHit(Int_t i,Int_t j) const {return (TObject*)GetpListItem(i,j);} |
2134176d | 107 | // tests hit status. |
fb4e90e0 | 108 | virtual FlagType TestHit(Int_t i,Int_t j){if(GetpListItem(i,j)==0) return kEmpty; |
2134176d | 109 | else if(GetSignal(i,j)<=0) return kUnused; else return kUsed;} |
9881a682 | 110 | // Returns the pointer to the TClonesArray of pList Items |
111 | TClonesArray * GetpListItems(){return fa;} | |
112 | // returns the pList Item stored in the TClonesArray | |
9ce4d38b | 113 | AliITSpListItem* GetpListItem(Int_t index){ |
114 | if(fa!=0)return (AliITSpListItem*) (fa->At(index)); | |
115 | else return 0;} | |
116 | // returns the pList Item stored in the TObject array | |
fb4e90e0 | 117 | AliITSpListItem* GetpListItem(Int_t i,Int_t j) const { |
2134176d | 118 | if(fa!=0)return (AliITSpListItem*) (fa->At(GetIndex(i,j))); |
9ce4d38b | 119 | else return 0;} |
2134176d | 120 | |
121 | // Fill pList from digits. Not functional yet | |
fb4e90e0 | 122 | virtual void FillMap(){NotImplemented("FillMap");} |
f45f6658 | 123 | virtual void FillMap2() {NotImplemented("FillMap2");} |
2134176d | 124 | // Sets threshold for significance. Not of relavance in this case. |
fb4e90e0 | 125 | virtual void SetThreshold(Int_t /* i */){NotImplemented("SetThreshold");} |
f45f6658 | 126 | virtual void SetThresholdArr(TArrayI /*thr*/) {NotImplemented("SetThresholdArr");} |
2134176d | 127 | // Sets a single hit. Not of relavance in this case. |
fb4e90e0 | 128 | virtual void SetHit(Int_t /* i */,Int_t /* j */,Int_t /* k */){NotImplemented("SetHit");} |
2134176d | 129 | // Flags a hit. Not of relavence in this case. |
fb4e90e0 | 130 | virtual void FlagHit(Int_t /* i */,Int_t /* j */){NotImplemented("FlagHit");} |
131 | virtual void GetCell(Int_t index,Int_t &i,Int_t &j) const; | |
2134176d | 132 | |
133 | private: | |
fb4e90e0 | 134 | |
135 | // private methods | |
136 | Int_t GetIndex(Int_t i,Int_t j) const; | |
137 | void NotImplemented(const char *method) const {if(gDebug>0) | |
138 | Warning(method,"This method is not implemented for this class");} | |
139 | // data members | |
2134176d | 140 | Int_t fNi,fNj; // The max index in i,j. |
9881a682 | 141 | TClonesArray *fa; // array of pList items |
142 | Int_t fEntries; // keepts track of the number of non-zero entries. | |
2134176d | 143 | |
36f26a56 | 144 | ClassDef(AliITSpList,4) // list of signals and track numbers |
2134176d | 145 | }; |
2134176d | 146 | #endif |