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