]>
Commit | Line | Data |
---|---|---|
41b19549 | 1 | /************************************************************************** |
2 | * Copyright(c) 2000-2004, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
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> | |
16 | ||
17 | #include "AliITSRawClusterSPD.h" | |
18 | ||
19 | //////////////////////////////////////////////////// | |
20 | // Cluster classes for set:ITS // | |
21 | // Raw Clusters for SPD // | |
22 | // // | |
23 | //////////////////////////////////////////////////// | |
24 | ||
25 | ClassImp(AliITSRawClusterSPD) | |
26 | ||
27 | //______________________________________________________________________ | |
28 | AliITSRawClusterSPD::AliITSRawClusterSPD(){ | |
29 | // Default constructor | |
30 | fX=fZ=fQ=0.0; | |
31 | fZStart=fZStop=0.0; | |
32 | fNClZ=fNClX=fXStart=fXStop=fZend=fNTracks=0; | |
33 | fTracks[0]=fTracks[1]=fTracks[2]=-3,fModule=0; | |
34 | } | |
35 | ||
36 | //______________________________________________________________________ | |
37 | AliITSRawClusterSPD::AliITSRawClusterSPD(Float_t clz,Float_t clx, | |
38 | Float_t Charge,Int_t ClusterSizeZ, | |
39 | Int_t ClusterSizeX,Int_t xstart, | |
40 | Int_t xstop, | |
41 | Float_t zstart,Float_t zstop, | |
42 | Int_t zend,Int_t module) { | |
43 | // constructor | |
44 | ||
45 | fZ = clz; | |
46 | fX = clx; | |
47 | fQ = Charge; | |
48 | fNClZ = ClusterSizeZ; | |
49 | fNClX = ClusterSizeX; | |
50 | fXStart = xstart; | |
51 | fXStop = xstop; | |
52 | fZStart = zstart; | |
53 | fZStop = zstop; | |
54 | fZend = zend; | |
55 | fModule = module; | |
56 | } | |
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 | |
61 | ||
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; | |
70 | (this->fNClZ)++; | |
71 | ||
72 | return; | |
73 | } | |
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; | |
83 | ||
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; | |
88 | ||
89 | // Diagonal clusters are excluded: | |
90 | // if(fXStop >= cluster->XStart() && | |
91 | // fXStart <= cluster->XStop()) test2 = kTRUE; | |
92 | if(cluster->Zend() == (fZend + 1)) test3 = kTRUE; | |
93 | if(test2 && test3) { | |
94 | // cout<<"test 2,3 0k, brother = true "<<endl; | |
95 | return brother = kTRUE; | |
96 | } // end if | |
97 | return brother; | |
98 | } | |
99 | //______________________________________________________________________ | |
100 | void AliITSRawClusterSPD::PrintInfo() const{ | |
101 | ||
102 | ||
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; | |
107 | } | |
108 | ||
109 | //______________________________________________________________________ | |
110 | void AliITSRawClusterSPD::SetTracks(Int_t track0, Int_t track1, Int_t track2) { | |
111 | // set tracks in cluster (no more than three ones) | |
112 | fTracks[0]=track0; | |
113 | fTracks[1]=track1; | |
114 | fTracks[2]=track2; | |
115 | } |