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 **************************************************************************/
18 #include <Riostream.h>
21 #include "AliITSRawCluster.h"
23 ClassImp(AliITSRawCluster)
24 ClassImp(AliITSRawClusterSDD)
26 //______________________________________________________________________
27 AliITSRawClusterSDD::AliITSRawClusterSDD(Int_t wing,
28 Float_t Anode,Float_t Time,
29 Float_t Charge,Float_t PeakAmplitude,
31 Float_t Asigma,Float_t Tsigma,
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){
44 fPeakAmplitude = PeakAmplitude;
45 fPeakPosition = PeakPosition;
55 fMultiplicity = Samples;
59 for(Int_t i=0;i<fWing; i++) sign *= (-1);
60 fX = DriftPath*sign/10000.;
61 fZ = AnodeOffset/10000.;
63 //______________________________________________________________________
64 AliITSRawClusterSDD::AliITSRawClusterSDD(const AliITSRawClusterSDD & source):
65 AliITSRawCluster(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;
131 Bool_t test2 = kFALSE;
132 Bool_t test3 = kFALSE;
133 Bool_t test4 = kFALSE;
134 Bool_t test5 = kFALSE;
136 if(fWing != cluster->W()) return brother;
138 if(fTstopf >= cluster->Tstart() &&
139 fTstartf <= cluster->Tstop()) test2 = kTRUE;
140 if(cluster->Astop() == (fAstop+1)) test3 = kTRUE;
142 if(TMath::Abs(fTime-cluster->T()) < dtime) test4 = kTRUE;
143 if(TMath::Abs(fAnode-cluster->A()) < danode) test5 = kTRUE;
145 if((test2 && test3) || (test4 && test5) ) {
146 return brother = kTRUE;
151 //______________________________________________________________________
152 void AliITSRawClusterSDD::PrintInfo() {
155 cout << ", Anode " << fAnode << ", Time: " << fTime << ", Charge: " << fQ;
156 cout << ", Samples: " << fMultiplicity;
157 cout << ", X: " << fX << ", Z: " << fZ << "tstart " << fTstart
158 << "tstop "<< fTstop <<endl;
160 //======================================================================
161 ClassImp(AliITSRawClusterSPD)
162 //______________________________________________________________________
163 AliITSRawClusterSPD::AliITSRawClusterSPD(Float_t clz,Float_t clx,
164 Float_t Charge,Int_t ClusterSizeZ,
165 Int_t ClusterSizeX,Int_t xstart,
167 Float_t zstart,Float_t zstop,
168 Int_t zend,Int_t module) {
174 fNClZ = ClusterSizeZ;
175 fNClX = ClusterSizeX;
183 //______________________________________________________________________
184 void AliITSRawClusterSPD::Add(AliITSRawClusterSPD* clJ) {
185 // Recolculate the new center of gravity coordinate and cluster sizes
186 // in both directions after grouping of clusters
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
194 if(this->fZend < clJ->Zend()) this->fZend = clJ->Zend();
195 this->fNClX = this->fXStop - this->fXStart + 1;
200 //______________________________________________________________________
201 Bool_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;
210 dx = dz = 0; // to remove unused variable warning.
211 // Diagonal clusters are included:
212 if(fXStop >= (cluster->XStart() -1) &&
213 fXStart <= (cluster->XStop()+1)) test2 = kTRUE;
215 // Diagonal clusters are excluded:
216 // if(fXStop >= cluster->XStart() &&
217 // fXStart <= cluster->XStop()) test2 = kTRUE;
218 if(cluster->Zend() == (fZend + 1)) test3 = kTRUE;
220 // cout<<"test 2,3 0k, brother = true "<<endl;
221 return brother = kTRUE;
225 //______________________________________________________________________
226 void AliITSRawClusterSPD::PrintInfo(){
229 cout << ", Z: " << fZ << ", X: " << fX << ", Charge: " << fQ<<endl;
230 cout << " Z cluster size: " << fNClZ <<", X cluster size "<< fNClX <<endl;
231 cout <<" XStart, XStop,Zend, Module ="<<fXStart<<","
232 <<fXStop<<","<<fZend << "," << fModule<<endl;
234 //======================================================================
235 ClassImp(AliITSRawClusterSSD)
236 //______________________________________________________________________
237 AliITSRawClusterSSD::AliITSRawClusterSSD(Float_t Prob,Int_t Sp,Int_t Sn) {
240 Prob = 0.0; // added to remove unused variable warning.
241 //fProbability = Prob;