1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 ///////////////////////////////////////////////////////////////////////////
20 // class AliClusterMap
21 // class that describes cluster occupation at TPC
22 // Each padraw has a corresponding bit in fPadRawMap
23 // more info: http://aliweb.cern.ch/people/skowron/analyzer/index.html
24 // Piotr.Skowronski@cern.ch
26 ///////////////////////////////////////////////////////////////////////////
30 #include "AliClusterMap.h"
31 #include "AliESDtrack.h"
33 #include "AliTPCtrack.h"
35 const Int_t AliClusterMap::fgkNPadRows = 159;
37 ClassImp(AliClusterMap)
39 AliClusterMap::AliClusterMap():
40 fPadRawMap(fgkNPadRows)
45 /***********************************************************************/
46 AliClusterMap::AliClusterMap(AliESDtrack* track):
47 fPadRawMap( (track)?track->GetTPCClusterMap():fgkNPadRows )
51 StdoutToAliDebug(3,Print());
54 /***********************************************************************/
56 AliClusterMap::AliClusterMap(AliTPCtrack* track):
57 fPadRawMap(fgkNPadRows)
61 AliDebug(10,"#####################################################################");
64 Error("AliClusterMap","Pointer to TPC track is NULL");
69 for ( ; i < track->GetNumberOfClusters(); i++)
71 Int_t idx = track->GetClusterIndex(i);
72 Int_t sect = (idx&0xff000000)>>24;
73 Int_t row = (idx&0x00ff0000)>>16;
74 if (sect > 18) row +=63; //if it is outer sector, add number of inner sectors
75 AliDebug(9,Form("Cl.idx is %d, sect %d, row %d",idx,sect,row));
77 fPadRawMap.SetBitNumber(row,kTRUE);
79 //Fill the gap between previous row and this row with 0 bits
82 prevrow = row;//if previous bit was not assigned yet == this is the first one
85 { //we don't know the order (inner to outer or reverse)
86 //just to be save in case it is going to change
98 for (Int_t j = n+1; j < m; j++)
100 fPadRawMap.SetBitNumber(j,kFALSE);
106 StdoutToAliDebug(3,Print());
109 /***********************************************************************/
111 void AliClusterMap::Print() const
115 for ( Int_t i = 0; i < fgkNPadRows; i++)
117 if ( fPadRawMap.TestBitNumber(i) )
126 Info("AliClusterMap","BitMap is\n %s",msg.Data());
130 /***********************************************************************/
132 Float_t AliClusterMap::GetOverlapFactor(const AliClusterMap& clmap) const
134 //Returns quality factor FQ = Sum(An)/Sum(clusters)
135 // | -1; if both tracks have a cluster on padrow n
136 //An = < 0; if neither track has a cluster on padrow n
137 // | 1; if only one trackhas a cluster on padrow n
138 // Returned value ranges between
139 // -0.5 (low probability that these tracks are a split track)
141 // 1.0 (high probability that these tracks are a split track)
145 for ( Int_t i = 0; i < fgkNPadRows; i++)
147 Bool_t x = HasClAtPadRow(i);
148 Bool_t y = clmap.HasClAtPadRow(i);
150 if (x && y)//both have clasters
158 if (x || y)//only one have cluters
167 Float_t retval = 0.0;
168 if (nh > 0) retval = ((Float_t)an)/((Float_t)nh);
169 else Warning("GetOverlapFactor","Number of counted cluters is 0.");