]>
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 | //______________________________________________________________________ | |
a8d73343 | 28 | AliITSRawClusterSPD::AliITSRawClusterSPD(): |
29 | fX(0.0), | |
30 | fZ(0.0), | |
31 | fQ(0.0), | |
32 | fNClZ(0), | |
33 | fNClX(0), | |
34 | fXStart(0), | |
35 | fXStop(0), | |
36 | fZStart(0.0), | |
37 | fZStop(0.0), | |
38 | fZend(0), | |
39 | fNTracks(0), | |
40 | fModule(0) | |
41 | { | |
41b19549 | 42 | // Default constructor |
a8d73343 | 43 | fTracks[0]=fTracks[1]=fTracks[2]=-3; |
41b19549 | 44 | } |
45 | ||
46 | //______________________________________________________________________ | |
47 | AliITSRawClusterSPD::AliITSRawClusterSPD(Float_t clz,Float_t clx, | |
48 | Float_t Charge,Int_t ClusterSizeZ, | |
49 | Int_t ClusterSizeX,Int_t xstart, | |
50 | Int_t xstop, | |
51 | Float_t zstart,Float_t zstop, | |
a8d73343 | 52 | Int_t zend,Int_t module): |
53 | fX(clx), | |
54 | fZ(clz), | |
55 | fQ(Charge), | |
56 | fNClZ(ClusterSizeZ), | |
57 | fNClX(ClusterSizeX), | |
58 | fXStart(xstart), | |
59 | fXStop(xstop), | |
60 | fZStart(zstart), | |
61 | fZStop(zstop), | |
62 | fZend(zend), | |
63 | fNTracks(0), | |
64 | fModule(module) { | |
41b19549 | 65 | // constructor |
66 | ||
41b19549 | 67 | } |
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 | |
72 | ||
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; | |
81 | (this->fNClZ)++; | |
82 | ||
83 | return; | |
84 | } | |
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; | |
94 | ||
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; | |
99 | ||
100 | // Diagonal clusters are excluded: | |
101 | // if(fXStop >= cluster->XStart() && | |
102 | // fXStart <= cluster->XStop()) test2 = kTRUE; | |
103 | if(cluster->Zend() == (fZend + 1)) test3 = kTRUE; | |
104 | if(test2 && test3) { | |
105 | // cout<<"test 2,3 0k, brother = true "<<endl; | |
106 | return brother = kTRUE; | |
107 | } // end if | |
108 | return brother; | |
109 | } | |
110 | //______________________________________________________________________ | |
111 | void AliITSRawClusterSPD::PrintInfo() const{ | |
112 | ||
113 | ||
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; | |
118 | } | |
119 | ||
120 | //______________________________________________________________________ | |
121 | void AliITSRawClusterSPD::SetTracks(Int_t track0, Int_t track1, Int_t track2) { | |
122 | // set tracks in cluster (no more than three ones) | |
123 | fTracks[0]=track0; | |
124 | fTracks[1]=track1; | |
125 | fTracks[2]=track2; | |
126 | } |