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