1 #include "AliClusterMap.h"
3 //_________________________________________________
4 ///////////////////////////////////////////////////
8 // class that describes cluster occupation at TPC
9 // Each padraw has a corresponding bit in fPadRawMap
12 // more info: http://aliweb.cern.ch/people/skowron/analyzer/index.html
13 // Piotr.Skowronski@cern.ch
15 ///////////////////////////////////////////////////////////////////////////
18 #include "AliESDtrack.h"
19 #include "AliTPCtrack.h"
20 #include "AliVAODParticle.h"
22 const Int_t AliClusterMap::fNPadRows = 159;
24 AliClusterMap::AliClusterMap():
30 /***********************************************************************/
31 AliClusterMap::AliClusterMap(AliESDtrack* track):
32 fPadRawMap( (track)?track->GetTPCClusterMap():fNPadRows )
36 if (AliVAODParticle::GetDebug() > 2)
38 Info("AliClusterMap(AliESDtrack*)","");
42 /***********************************************************************/
44 AliClusterMap::AliClusterMap(AliTPCtrack* track):
49 //Does not work since indeces in the claster index array
50 //in the TPC track does not correspond to the padraw segmatation
51 if (AliVAODParticle::GetDebug() > 9)
53 "#####################################################################");
56 Error("AliClusterMap","Pointer to TPC track is NULL");
61 for ( ; i < track->GetNumberOfClusters(); i++)
63 Int_t idx = track->GetClusterIndex(i);
64 Int_t sect = (idx&0xff000000)>>24;
65 Int_t row = (idx&0x00ff0000)>>16;
66 if (sect > 18) row +=63; //if it is outer sector, add number of inner sectors
67 if (AliVAODParticle::GetDebug() > 9)
68 Info("AliClusterMap","Cl.idx is %d, sect %d, row %d",idx,sect,row);
70 fPadRawMap.SetBitNumber(row,kTRUE);
72 //Fill the gap between previous row and this row with 0 bits
75 prevrow = row;//if previous bit was not assigned yet == this is the first one
78 { //we don't know the order (inner to outer or reverse)
79 //just to be save in case it is going to change
91 for (Int_t j = n+1; j < m; j++)
93 fPadRawMap.SetBitNumber(j,kFALSE);
99 if (AliVAODParticle::GetDebug() > 2)
101 Info("AliClusterMap(AliTPCtrack*)","");
105 /***********************************************************************/
107 void AliClusterMap::Print() const
111 for ( Int_t i = 0; i < fNPadRows; i++)
113 if ( fPadRawMap.TestBitNumber(i) )
122 Info("AliClusterMap","BitMap is\n %s",msg.Data());
126 /***********************************************************************/
128 Float_t AliClusterMap::GetOverlapFactor(const AliClusterMap& clmap) const
130 //Returns quality factor FQ = Sum(An)/Sum(clusters)
131 // | -1; if both tracks have a cluster on padrow n
132 //An = < 0; if neither track has a cluster on padrow n
133 // | 1; if only one trackhas a cluster on padrow n
134 // Returned value ranges between
135 // -0.5 (low probability that these tracks are a split track)
137 // 1.0 (high probability that these tracks are a split track)
143 for ( Int_t i = 0; i < fNPadRows; i++)
145 Bool_t x = HasClAtPadRow(i);
146 Bool_t y = clmap.HasClAtPadRow(i);
148 if (x) msg1+="1";else msg1+="0";
149 if (y) msg2+="1";else msg2+="0";
151 if (x && y)//both have clasters
159 if (x || y)//only one have cluters
168 Float_t retval = 0.0;
169 if (nh > 0) retval = ((Float_t)an)/((Float_t)nh);
170 else Warning("GetOverlapFactor","Number of counted cluters is 0.");
172 if (AliVAODParticle::GetDebug() > 2)
174 Info("GetOverlapFactor","Splitting Quality Factor is %f. SumAn = %d, SumClusters %d",retval,an,nh);
178 Info("AliClusterMap","BitMap is\n %s\n",msg1.Data());
180 Info("AliClusterMap","BitMap is\n %s\n\n\n\n",msg2.Data());
185 Info("AliClusterMap","BitMap is\n %s\n",msg1.Data());
187 Info("AliClusterMap","BitMap is\n %s\n\n\n\n",msg2.Data());