1 /**************************************************************************
2 * Copyright(c) 1998-1999, 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 **************************************************************************/
22 #include "AliITSRawCluster.h"
24 ClassImp(AliITSRawCluster)
25 ClassImp(AliITSRawClusterSDD)
27 //______________________________________________________________________
28 AliITSRawClusterSDD::AliITSRawClusterSDD(Int_t wing,
29 Float_t Anode,Float_t Time,
30 Float_t Charge,Float_t PeakAmplitude,
32 Float_t Asigma,Float_t Tsigma,
35 Int_t Samples,Int_t Tstart,
36 Int_t Tstop,Int_t Tstartf,
37 Int_t Tstopf,Int_t Anodes,
38 Int_t Astart, Int_t Astop){
45 fPeakAmplitude = PeakAmplitude;
46 fPeakPosition = PeakPosition;
56 fMultiplicity = Samples;
60 for(Int_t i=0;i<fWing; i++) sign *= (-1);
61 fX = DriftPath*sign/10000.;
62 fZ = AnodeOffset/10000.;
64 //______________________________________________________________________
65 AliITSRawClusterSDD::AliITSRawClusterSDD( const AliITSRawClusterSDD & source){
69 fAnode = source.fAnode;
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;
84 fMultiplicity = source.fMultiplicity;
85 fSumAmplitude = source.fSumAmplitude;
89 //______________________________________________________________________
90 void AliITSRawClusterSDD::Add(AliITSRawClusterSDD* clJ) {
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());
98 if(fSumAmplitude == 0) fSumAmplitude += fPeakAmplitude;
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());
109 fSumAmplitude += clJ->PeakAmpl();
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();
117 fMultiplicity += (Int_t) (clJ->Samples());
119 if(clJ->PeakAmpl() > fPeakAmplitude) {
120 fPeakAmplitude = clJ->PeakAmpl();
121 fPeakPosition = clJ->PeakPos();
126 //______________________________________________________________________
127 Bool_t AliITSRawClusterSDD::Brother(AliITSRawClusterSDD* cluster,
128 Float_t danode,Float_t dtime) {
130 Bool_t brother = kFALSE;
132 Bool_t test2 = kFALSE;
133 Bool_t test3 = kFALSE;
134 Bool_t test4 = kFALSE;
135 Bool_t test5 = kFALSE;
137 if(fWing != cluster->W()) return brother;
139 if(fTstopf >= cluster->Tstart() &&
140 fTstartf <= cluster->Tstop()) test2 = kTRUE;
141 if(cluster->Astop() == (fAstop+1)) test3 = kTRUE;
143 if(TMath::Abs(fTime-cluster->T()) < dtime) test4 = kTRUE;
144 if(TMath::Abs(fAnode-cluster->A()) < danode) test5 = kTRUE;
146 if((test2 && test3) || (test4 && test5) ) {
147 return brother = kTRUE;
152 //______________________________________________________________________
153 void AliITSRawClusterSDD::PrintInfo() {
156 cout << ", Anode " << fAnode << ", Time: " << fTime << ", Charge: " << fQ;
157 cout << ", Samples: " << fMultiplicity;
158 cout << ", X: " << fX << ", Z: " << fZ << "tstart " << fTstart
159 << "tstop "<< fTstop <<endl;
161 //======================================================================
162 ClassImp(AliITSRawClusterSPD)
163 //______________________________________________________________________
164 AliITSRawClusterSPD::AliITSRawClusterSPD(Float_t clz,Float_t clx,
165 Float_t Charge,Int_t ClusterSizeZ,
166 Int_t ClusterSizeX,Int_t xstart,
167 Int_t xstop,Int_t xstartf,
169 Float_t zstart,Float_t zstop,
176 fNClZ = ClusterSizeZ;
177 fNClX = ClusterSizeX;
186 //______________________________________________________________________
187 void AliITSRawClusterSPD::Add(AliITSRawClusterSPD* clJ) {
188 // Recolculate the new center of gravity coordinate and cluster sizes
189 // in both directions after grouping of clusters
191 if(this->fZStop < clJ->ZStop()) this->fZStop = clJ->ZStop();
192 this->fZ = this->fZ + clJ->Z();
193 this->fX = (this->fX + clJ->X())/2.;
194 this->fQ = this->fQ + clJ->Q();
195 this->fXStart = clJ->XStart(); // for a comparison with the next
196 this->fXStop = clJ->XStop(); // z column
197 if(this->fXStartf > clJ->XStartf()) this->fXStartf = clJ->XStartf();
198 if(this->fXStopf < clJ->XStopf()) this->fXStopf = clJ->XStopf();
199 if(this->fZend < clJ->Zend()) this->fZend = clJ->Zend();
200 this->fNClX = this->fXStopf - this->fXStartf + 1;
205 //______________________________________________________________________
206 Bool_t AliITSRawClusterSPD::Brother(AliITSRawClusterSPD* cluster,
207 Float_t dz,Float_t dx) {
208 // fXStart, fXstop and fZend information is used now instead of dz and dx
209 // to check an absent (or a present) of the gap between two pixels in
210 // both x and z directions. The increasing order of fZend is used.
211 Bool_t brother = kFALSE;
212 Bool_t test2 = kFALSE;
213 Bool_t test3 = kFALSE;
215 // Diagonal clusters are included:
216 if(fXStop >= (cluster->XStart() -1) &&
217 fXStart <= (cluster->XStop()+1)) test2 = kTRUE;
219 // Diagonal clusters are excluded:
220 // if(fXStop >= cluster->XStart() &&
221 // fXStart <= cluster->XStop()) test2 = kTRUE;
222 if(cluster->Zend() == (fZend + 1)) test3 = kTRUE;
224 // cout<<"test 2,3 0k, brother = true "<<endl;
225 return brother = kTRUE;
229 //______________________________________________________________________
230 void AliITSRawClusterSPD::PrintInfo(){
233 cout << ", Z: " << fZ << ", X: " << fX << ", Charge: " << fQ<<endl;
234 cout << " Z cluster size: " << fNClZ <<", X cluster size "<< fNClX <<endl;
235 cout <<" XStart, XStop, XStartf,XStopf,Zend ="<<fXStart<<","
236 <<fXStop<<","<<fXStartf<<","<<fXStopf<<","<<fZend<<endl;
238 //======================================================================
239 ClassImp(AliITSRawClusterSSD)
240 //______________________________________________________________________
241 AliITSRawClusterSSD::AliITSRawClusterSSD(Float_t Prob,Int_t Sp,Int_t Sn) {
244 //fProbability = Prob;