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(){
29 // Default constructor
32 fNClZ=fNClX=fXStart=fXStop=fZend=fNTracks=0;
33 fTracks[0]=fTracks[1]=fTracks[2]=-3,fModule=0;
36 //______________________________________________________________________
37 AliITSRawClusterSPD::AliITSRawClusterSPD(Float_t clz,Float_t clx,
38 Float_t Charge,Int_t ClusterSizeZ,
39 Int_t ClusterSizeX,Int_t xstart,
41 Float_t zstart,Float_t zstop,
42 Int_t zend,Int_t module) {
57 //______________________________________________________________________
58 void AliITSRawClusterSPD::Add(AliITSRawClusterSPD* clJ) {
59 // Recolculate the new center of gravity coordinate and cluster sizes
60 // in both directions after grouping of clusters
62 if(this->fZStop < clJ->ZStop()) this->fZStop = clJ->ZStop();
63 this->fZ = this->fZ + clJ->Z();
64 this->fX = (this->fX + clJ->X())/2.;
65 this->fQ = this->fQ + clJ->Q();
66 this->fXStart = clJ->XStart(); // for a comparison with the next
67 this->fXStop = clJ->XStop(); // z column
68 if(this->fZend < clJ->Zend()) this->fZend = clJ->Zend();
69 this->fNClX = this->fXStop - this->fXStart + 1;
74 //______________________________________________________________________
75 Bool_t AliITSRawClusterSPD::Brother(AliITSRawClusterSPD* cluster,
76 Float_t dz,Float_t dx) const {
77 // fXStart, fXstop and fZend information is used now instead of dz and dx
78 // to check an absent (or a present) of the gap between two pixels in
79 // both x and z directions. The increasing order of fZend is used.
80 Bool_t brother = kFALSE;
81 Bool_t test2 = kFALSE;
82 Bool_t test3 = kFALSE;
84 dx = dz = 0; // to remove unused variable warning.
85 // Diagonal clusters are included:
86 if(fXStop >= (cluster->XStart() -1) &&
87 fXStart <= (cluster->XStop()+1)) test2 = kTRUE;
89 // Diagonal clusters are excluded:
90 // if(fXStop >= cluster->XStart() &&
91 // fXStart <= cluster->XStop()) test2 = kTRUE;
92 if(cluster->Zend() == (fZend + 1)) test3 = kTRUE;
94 // cout<<"test 2,3 0k, brother = true "<<endl;
95 return brother = kTRUE;
99 //______________________________________________________________________
100 void AliITSRawClusterSPD::PrintInfo() const{
103 cout << ", Z: " << fZ << ", X: " << fX << ", Charge: " << fQ<<endl;
104 cout << " Z cluster size: " << fNClZ <<", X cluster size "<< fNClX <<endl;
105 cout <<" XStart, XStop,Zend, Module ="<<fXStart<<","
106 <<fXStop<<","<<fZend << "," << fModule<<endl;
109 //______________________________________________________________________
110 void AliITSRawClusterSPD::SetTracks(Int_t track0, Int_t track1, Int_t track2) {
111 // set tracks in cluster (no more than three ones)