1 /**************************************************************************
2 * Copyright(c) 2000-2004, 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 **************************************************************************/
15 #include <Riostream.h>
17 #include "AliITSRawClusterSPD.h"
19 ////////////////////////////////////////////////////
20 // Cluster classes for set:ITS //
21 // Raw Clusters for SPD //
23 ////////////////////////////////////////////////////
25 ClassImp(AliITSRawClusterSPD)
27 //______________________________________________________________________
28 AliITSRawClusterSPD::AliITSRawClusterSPD():
42 // Default constructor
43 fTracks[0]=fTracks[1]=fTracks[2]=-3;
46 //______________________________________________________________________
47 AliITSRawClusterSPD::AliITSRawClusterSPD(Float_t clz,Float_t clx,
48 Float_t Charge,Int_t ClusterSizeZ,
49 Int_t ClusterSizeX,Int_t xstart,
51 Float_t zstart,Float_t zstop,
52 Int_t zend,Int_t module):
68 //______________________________________________________________________
69 void AliITSRawClusterSPD::Add(AliITSRawClusterSPD* clJ) {
70 // Recolculate the new center of gravity coordinate and cluster sizes
71 // in both directions after grouping of clusters
73 if(this->fZStop < clJ->ZStop()) this->fZStop = clJ->ZStop();
74 this->fZ = this->fZ + clJ->Z();
75 this->fX = (this->fX + clJ->X())/2.;
76 this->fQ = this->fQ + clJ->Q();
77 this->fXStart = clJ->XStart(); // for a comparison with the next
78 this->fXStop = clJ->XStop(); // z column
79 if(this->fZend < clJ->Zend()) this->fZend = clJ->Zend();
80 this->fNClX = this->fXStop - this->fXStart + 1;
85 //______________________________________________________________________
86 Bool_t AliITSRawClusterSPD::Brother(AliITSRawClusterSPD* cluster,
87 Float_t dz,Float_t dx) const {
88 // fXStart, fXstop and fZend information is used now instead of dz and dx
89 // to check an absent (or a present) of the gap between two pixels in
90 // both x and z directions. The increasing order of fZend is used.
91 Bool_t brother = kFALSE;
92 Bool_t test2 = kFALSE;
93 Bool_t test3 = kFALSE;
95 dx = dz = 0; // to remove unused variable warning.
96 // Diagonal clusters are included:
97 if(fXStop >= (cluster->XStart() -1) &&
98 fXStart <= (cluster->XStop()+1)) test2 = kTRUE;
100 // Diagonal clusters are excluded:
101 // if(fXStop >= cluster->XStart() &&
102 // fXStart <= cluster->XStop()) test2 = kTRUE;
103 if(cluster->Zend() == (fZend + 1)) test3 = kTRUE;
105 // cout<<"test 2,3 0k, brother = true "<<endl;
106 return brother = kTRUE;
110 //______________________________________________________________________
111 void AliITSRawClusterSPD::PrintInfo() const{
114 cout << ", Z: " << fZ << ", X: " << fX << ", Charge: " << fQ<<endl;
115 cout << " Z cluster size: " << fNClZ <<", X cluster size "<< fNClX <<endl;
116 cout <<" XStart, XStop,Zend, Module ="<<fXStart<<","
117 <<fXStop<<","<<fZend << "," << fModule<<endl;
120 //______________________________________________________________________
121 void AliITSRawClusterSPD::SetTracks(Int_t track0, Int_t track1, Int_t track2) {
122 // set tracks in cluster (no more than three ones)