1 #include "AliHBTClusterMap.h"
3 //_________________________________________________
4 ///////////////////////////////////////////////////
6 // class AliHBTClusterMap
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 "AliHBTParticle.h"
22 const Int_t AliHBTClusterMap::fNPadRows = 159;
24 AliHBTClusterMap::AliHBTClusterMap():
30 /***********************************************************************/
31 AliHBTClusterMap::AliHBTClusterMap(AliESDtrack* track):
35 track->Print();//to shut up compiler warning
38 /***********************************************************************/
40 AliHBTClusterMap::AliHBTClusterMap(AliTPCtrack* track):
45 //Does not work since indeces in the claster index array
46 //in the TPC track does not correspond to the padraw segmatation
47 if (AliHBTParticle::GetDebug() > 9)
48 Info("AliHBTClusterMap",
49 "#####################################################################");
52 Error("AliHBTClusterMap","Pointer to TPC track is NULL");
57 for ( ; i < track->GetNumberOfClusters(); i++)
59 Int_t idx = track->GetClusterIndex(i);
60 Int_t sect = (idx&0xff000000)>>24;
61 Int_t row = (idx&0x00ff0000)>>16;
62 if (sect > 18) row +=63; //if it is outer sector, add number of inner sectors
63 if (AliHBTParticle::GetDebug() > 9)
64 Info("AliHBTClusterMap","Cl.idx is %d, sect %d, row %d",idx,sect,row);
66 fPadRawMap.SetBitNumber(row,kTRUE);
68 //Fill the gap between previous row and this row with 0 bits
71 prevrow = row;//if previous bit was not assigned yet == this is the first one
74 { //we don't know the order (inner to outer or reverse)
75 //just to be save in case it is going change
87 for (Int_t j = n+1; j < m; j++)
89 fPadRawMap.SetBitNumber(j,kFALSE);
94 if (AliHBTParticle::GetDebug() > 2)
99 /***********************************************************************/
101 void AliHBTClusterMap::Print() const
105 for ( Int_t i = 0; i < fNPadRows; i++)
107 if ( fPadRawMap.TestBitNumber(i) )
116 Info("AliHBTClusterMap","BitMap is\n %s",msg.Data());
120 /***********************************************************************/
122 Float_t AliHBTClusterMap::GetOverlapFactor(const AliHBTClusterMap& clmap) const
124 //Returns quality factor FQ = Sum(An)/Sum(clusters)
125 // | -1; if both tracks have a cluster on padrow n
126 //An = < 0; if neither track has a cluster on padrow n
127 // | 1; if only one trackhas a cluster on padrow n
128 // Returned value ranges between
129 // -0.5 (low probability that these tracks are a split track)
131 // 1.0 (high probability that these tracks are a split track)
137 for ( Int_t i = 0; i < fNPadRows; i++)
139 Bool_t x = HasClAtPadRow(i);
140 Bool_t y = clmap.HasClAtPadRow(i);
142 if (x) msg1+="1";else msg1+="0";
143 if (y) msg2+="1";else msg2+="0";
145 if (x && y)//both have clasters
153 if (x || y)//only one have cluters
162 Float_t retval = 0.0;
163 if (nh > 0) retval = ((Float_t)an)/((Float_t)nh);
164 else Warning("GetOverlapFactor","Number of counted cluters is 0.");
166 if (AliHBTParticle::GetDebug() > 2)
168 Info("GetOverlapFactor","Splitting Quality Factor is %f. SumAn = %d, SumClusters %d",retval,an,nh);
172 Info("AliHBTClusterMap","BitMap is\n %s\n",msg1.Data());
174 Info("AliHBTClusterMap","BitMap is\n %s\n\n\n\n",msg2.Data());
179 Info("AliHBTClusterMap","BitMap is\n %s\n",msg1.Data());
181 Info("AliHBTClusterMap","BitMap is\n %s\n\n\n\n",msg2.Data());