]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliITSRawCluster.cxx
Radiator to Pad goes static.
[u/mrichter/AliRoot.git] / ITS / AliITSRawCluster.cxx
CommitLineData
b48af428 1/**************************************************************************
2 * Copyright(c) 1998-1999, 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
88cb7938 16/* $Id$ */
4ae5bbc4 17
4ae5bbc4 18#include <Riostream.h>
b0f5e3fc 19#include <TMath.h>
20
21#include "AliITSRawCluster.h"
22
23ClassImp(AliITSRawCluster)
b0f5e3fc 24ClassImp(AliITSRawClusterSDD)
b48af428 25
26//______________________________________________________________________
27AliITSRawClusterSDD::AliITSRawClusterSDD(Int_t wing,
28 Float_t Anode,Float_t Time,
29 Float_t Charge,Float_t PeakAmplitude,
30 Int_t PeakPosition,
31 Float_t Asigma,Float_t Tsigma,
32 Float_t DriftPath,
33 Float_t AnodeOffset,
34 Int_t Samples,Int_t Tstart,
35 Int_t Tstop,Int_t Tstartf,
36 Int_t Tstopf,Int_t Anodes,
37 Int_t Astart, Int_t Astop){
38 // constructor
39
40 fWing = wing;
41 fAnode = Anode;
42 fTime = Time;
43 fQ = Charge;
44 fPeakAmplitude = PeakAmplitude;
45 fPeakPosition = PeakPosition;
46 fAsigma = Asigma;
47 fTsigma = Tsigma;
48 fNanodes = Anodes;
49 fTstart = Tstart;
50 fTstop = Tstop;
51 fTstartf = Tstartf;
52 fTstopf = Tstopf;
53 fAstart = Astart;
54 fAstop = Astop;
55 fMultiplicity = Samples;
56 fSumAmplitude = 0;
57
58 Int_t sign = 1;
59 for(Int_t i=0;i<fWing; i++) sign *= (-1);
60 fX = DriftPath*sign/10000.;
61 fZ = AnodeOffset/10000.;
b0f5e3fc 62}
b48af428 63//______________________________________________________________________
ac74f489 64AliITSRawClusterSDD::AliITSRawClusterSDD(const AliITSRawClusterSDD & source):
65 AliITSRawCluster(source){
b48af428 66 // copy constructor
67
68 fWing = source.fWing;
69 fAnode = source.fAnode;
70 fTime = source.fTime;
71 fQ = source.fQ;
72 fPeakAmplitude = source.fPeakAmplitude;
73 fPeakPosition = source.fPeakPosition;
74 fAsigma = source.fAsigma;
75 fTsigma = source.fTsigma;
76 fNanodes = source.fNanodes;
77 fTstart = source.fTstart;
78 fTstop = source.fTstop;
79 fTstartf = source.fTstartf;
80 fTstopf = source.fTstopf;
81 fAstart = source.fAstart;
82 fAstop = source.fAstop;
83
84 fMultiplicity = source.fMultiplicity;
85 fSumAmplitude = source.fSumAmplitude;
86 fX = source.fX;
87 fZ = source.fZ;
44d4400c 88}
b48af428 89//______________________________________________________________________
b0f5e3fc 90void AliITSRawClusterSDD::Add(AliITSRawClusterSDD* clJ) {
b48af428 91 // add
92
93 fAnode = (fAnode*fQ + clJ->A()*clJ->Q())/(fQ+clJ->Q());
94 fTime = ( fTime*fQ + clJ->T()*clJ->Q())/(fQ+clJ->Q());
95 fX = ( fX*fQ + clJ->X()*clJ->Q())/(fQ+clJ->Q());
96 fZ = ( fZ*fQ + clJ->Z()*clJ->Q())/(fQ+clJ->Q());
97 fQ += clJ->Q();
98 if(fSumAmplitude == 0) fSumAmplitude += fPeakAmplitude;
99 /*
100 fAnode = (fAnode*fSumAmplitude+clJ->A()*clJ->PeakAmpl())/
101 (fSumAmplitude+clJ->PeakAmpl());
102 fTime = (fTime*fSumAmplitude +clJ->T()*clJ->PeakAmpl())/
103 (fSumAmplitude+clJ->PeakAmpl());
104 fX = (fX*fSumAmplitude +clJ->X()*clJ->PeakAmpl())/
105 (fSumAmplitude+clJ->PeakAmpl());
106 fZ = (fZ*fSumAmplitude +clJ->Z()*clJ->PeakAmpl())/
107 (fSumAmplitude+clJ->PeakAmpl());
108 */
109 fSumAmplitude += clJ->PeakAmpl();
110
111 fTstart = clJ->Tstart();
112 fTstop = clJ->Tstop();
113 if(fTstartf > clJ->Tstartf()) fTstartf = clJ->Tstartf();
114 if( fTstopf < clJ->Tstopf() ) fTstopf = clJ->Tstopf();
115 if( fAstop < clJ->Astop() ) fAstop = clJ->Astop();
116
117 fMultiplicity += (Int_t) (clJ->Samples());
118 (fNanodes)++;
119 if(clJ->PeakAmpl() > fPeakAmplitude) {
120 fPeakAmplitude = clJ->PeakAmpl();
121 fPeakPosition = clJ->PeakPos();
122 } // end if
123
124 return;
125}
126//______________________________________________________________________
127Bool_t AliITSRawClusterSDD::Brother(AliITSRawClusterSDD* cluster,
128 Float_t danode,Float_t dtime) {
44d4400c 129
b48af428 130 Bool_t brother = kFALSE;
b48af428 131 Bool_t test2 = kFALSE;
132 Bool_t test3 = kFALSE;
133 Bool_t test4 = kFALSE;
134 Bool_t test5 = kFALSE;
44d4400c 135
b48af428 136 if(fWing != cluster->W()) return brother;
44d4400c 137
b48af428 138 if(fTstopf >= cluster->Tstart() &&
139 fTstartf <= cluster->Tstop()) test2 = kTRUE;
140 if(cluster->Astop() == (fAstop+1)) test3 = kTRUE;
44d4400c 141
b48af428 142 if(TMath::Abs(fTime-cluster->T()) < dtime) test4 = kTRUE;
143 if(TMath::Abs(fAnode-cluster->A()) < danode) test5 = kTRUE;
44d4400c 144
b48af428 145 if((test2 && test3) || (test4 && test5) ) {
146 return brother = kTRUE;
147 } // end if
44d4400c 148
b48af428 149 return brother;
b0f5e3fc 150}
b48af428 151//______________________________________________________________________
e8189707 152void AliITSRawClusterSDD::PrintInfo() {
b48af428 153 // print
b0f5e3fc 154
b48af428 155 cout << ", Anode " << fAnode << ", Time: " << fTime << ", Charge: " << fQ;
156 cout << ", Samples: " << fMultiplicity;
157 cout << ", X: " << fX << ", Z: " << fZ << "tstart " << fTstart
158 << "tstop "<< fTstop <<endl;
159}
160//======================================================================
b0f5e3fc 161ClassImp(AliITSRawClusterSPD)
b48af428 162//______________________________________________________________________
163AliITSRawClusterSPD::AliITSRawClusterSPD(Float_t clz,Float_t clx,
164 Float_t Charge,Int_t ClusterSizeZ,
165 Int_t ClusterSizeX,Int_t xstart,
9e1e0cd7 166 Int_t xstop,
b48af428 167 Float_t zstart,Float_t zstop,
9e1e0cd7 168 Int_t zend,Int_t module) {
b48af428 169 // constructor
170
171 fZ = clz;
172 fX = clx;
173 fQ = Charge;
174 fNClZ = ClusterSizeZ;
175 fNClX = ClusterSizeX;
176 fXStart = xstart;
177 fXStop = xstop;
b48af428 178 fZStart = zstart;
179 fZStop = zstop;
180 fZend = zend;
9e1e0cd7 181 fModule = module;
b0f5e3fc 182}
b48af428 183//______________________________________________________________________
b0f5e3fc 184void AliITSRawClusterSPD::Add(AliITSRawClusterSPD* clJ) {
b48af428 185 // Recolculate the new center of gravity coordinate and cluster sizes
186 // in both directions after grouping of clusters
187
188 if(this->fZStop < clJ->ZStop()) this->fZStop = clJ->ZStop();
189 this->fZ = this->fZ + clJ->Z();
190 this->fX = (this->fX + clJ->X())/2.;
191 this->fQ = this->fQ + clJ->Q();
192 this->fXStart = clJ->XStart(); // for a comparison with the next
193 this->fXStop = clJ->XStop(); // z column
b48af428 194 if(this->fZend < clJ->Zend()) this->fZend = clJ->Zend();
9e1e0cd7 195 this->fNClX = this->fXStop - this->fXStart + 1;
b48af428 196 (this->fNClZ)++;
197
198 return;
b0f5e3fc 199}
b48af428 200//______________________________________________________________________
201Bool_t AliITSRawClusterSPD::Brother(AliITSRawClusterSPD* cluster,
202 Float_t dz,Float_t dx) {
203 // fXStart, fXstop and fZend information is used now instead of dz and dx
204 // to check an absent (or a present) of the gap between two pixels in
205 // both x and z directions. The increasing order of fZend is used.
206 Bool_t brother = kFALSE;
207 Bool_t test2 = kFALSE;
208 Bool_t test3 = kFALSE;
209
ac74f489 210 dx = dz = 0; // to remove unused variable warning.
b48af428 211 // Diagonal clusters are included:
212 if(fXStop >= (cluster->XStart() -1) &&
213 fXStart <= (cluster->XStop()+1)) test2 = kTRUE;
214
215 // Diagonal clusters are excluded:
216 // if(fXStop >= cluster->XStart() &&
217 // fXStart <= cluster->XStop()) test2 = kTRUE;
218 if(cluster->Zend() == (fZend + 1)) test3 = kTRUE;
219 if(test2 && test3) {
220 // cout<<"test 2,3 0k, brother = true "<<endl;
221 return brother = kTRUE;
222 } // end if
223 return brother;
b0f5e3fc 224}
b48af428 225//______________________________________________________________________
226void AliITSRawClusterSPD::PrintInfo(){
227 // print
228
229 cout << ", Z: " << fZ << ", X: " << fX << ", Charge: " << fQ<<endl;
230 cout << " Z cluster size: " << fNClZ <<", X cluster size "<< fNClX <<endl;
9e1e0cd7 231 cout <<" XStart, XStop,Zend, Module ="<<fXStart<<","
232 <<fXStop<<","<<fZend << "," << fModule<<endl;
b48af428 233}
234//======================================================================
b0f5e3fc 235ClassImp(AliITSRawClusterSSD)
b48af428 236//______________________________________________________________________
237AliITSRawClusterSSD::AliITSRawClusterSSD(Float_t Prob,Int_t Sp,Int_t Sn) {
238 // constructor
239
ac74f489 240 Prob = 0.0; // added to remove unused variable warning.
b48af428 241 //fProbability = Prob;
242 fMultiplicity = Sp;
243 fMultiplicityN = Sn;
b0f5e3fc 244}