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 //_________________________________________________
19 ///////////////////////////////////////////////////
21 // class AliClusterMap
23 // class that describes cluster occupation at TPC
24 // Each padraw has a corresponding bit in fPadRawMap
27 // more info: http://aliweb.cern.ch/people/skowron/analyzer/index.html
28 // Piotr.Skowronski@cern.ch
30 ///////////////////////////////////////////////////////////////////////////
34 #include "AliClusterMap.h"
35 #include "AliESDtrack.h"
37 #include "AliTPCtrack.h"
38 #include "AliVAODParticle.h"
40 const Int_t AliClusterMap::fNPadRows = 159;
42 ClassImp(AliClusterMap)
44 AliClusterMap::AliClusterMap():
50 /***********************************************************************/
51 AliClusterMap::AliClusterMap(AliESDtrack* track):
52 fPadRawMap( (track)?track->GetTPCClusterMap():fNPadRows )
56 StdoutToAliDebug(3,Print());
59 /***********************************************************************/
61 AliClusterMap::AliClusterMap(AliTPCtrack* track):
66 AliDebug(10,"#####################################################################");
69 Error("AliClusterMap","Pointer to TPC track is NULL");
74 for ( ; i < track->GetNumberOfClusters(); i++)
76 Int_t idx = track->GetClusterIndex(i);
77 Int_t sect = (idx&0xff000000)>>24;
78 Int_t row = (idx&0x00ff0000)>>16;
79 if (sect > 18) row +=63; //if it is outer sector, add number of inner sectors
80 AliDebug(9,Form("Cl.idx is %d, sect %d, row %d",idx,sect,row));
82 fPadRawMap.SetBitNumber(row,kTRUE);
84 //Fill the gap between previous row and this row with 0 bits
87 prevrow = row;//if previous bit was not assigned yet == this is the first one
90 { //we don't know the order (inner to outer or reverse)
91 //just to be save in case it is going to change
103 for (Int_t j = n+1; j < m; j++)
105 fPadRawMap.SetBitNumber(j,kFALSE);
111 StdoutToAliDebug(3,Print());
114 /***********************************************************************/
116 void AliClusterMap::Print() const
120 for ( Int_t i = 0; i < fNPadRows; i++)
122 if ( fPadRawMap.TestBitNumber(i) )
131 Info("AliClusterMap","BitMap is\n %s",msg.Data());
135 /***********************************************************************/
137 Float_t AliClusterMap::GetOverlapFactor(const AliClusterMap& clmap) const
139 //Returns quality factor FQ = Sum(An)/Sum(clusters)
140 // | -1; if both tracks have a cluster on padrow n
141 //An = < 0; if neither track has a cluster on padrow n
142 // | 1; if only one trackhas a cluster on padrow n
143 // Returned value ranges between
144 // -0.5 (low probability that these tracks are a split track)
146 // 1.0 (high probability that these tracks are a split track)
150 for ( Int_t i = 0; i < fNPadRows; i++)
152 Bool_t x = HasClAtPadRow(i);
153 Bool_t y = clmap.HasClAtPadRow(i);
155 if (x && y)//both have clasters
163 if (x || y)//only one have cluters
172 Float_t retval = 0.0;
173 if (nh > 0) retval = ((Float_t)an)/((Float_t)nh);
174 else Warning("GetOverlapFactor","Number of counted cluters is 0.");