4 #include "AliITSRawCluster.h"
6 ClassImp(AliITSRawCluster)
8 ClassImp(AliITSRawClusterSDD)
9 //--------------------------------------
10 AliITSRawClusterSDD::AliITSRawClusterSDD(Int_t wing, Float_t Anode,Float_t Time, Float_t Charge,
11 Float_t PeakAmplitude,Int_t PeakPosition, Float_t Asigma, Float_t Tsigma, Float_t DriftPath, Float_t AnodeOffset, Int_t Samples,
12 Int_t Tstart, Int_t Tstop, Int_t Tstartf, Int_t Tstopf, Int_t Anodes, Int_t Astart, Int_t Astop)
19 fPeakAmplitude = PeakAmplitude;
20 fPeakPosition = PeakPosition;
30 fMultiplicity = Samples;
33 for(Int_t i=0;i<fWing; i++) sign*=(-1);
34 fX = DriftPath*sign/10000.;
35 fZ = AnodeOffset/10000.;
37 AliITSRawClusterSDD::AliITSRawClusterSDD( const AliITSRawClusterSDD & source)
41 fAnode = source.fAnode;
44 fPeakAmplitude = source.fPeakAmplitude;
45 fPeakPosition = source.fPeakPosition;
46 fAsigma = source.fAsigma;
47 fTsigma = source.fTsigma;
48 fNanodes = source.fNanodes;
49 fTstart = source.fTstart;
50 fTstop = source.fTstop;
51 fTstartf = source.fTstartf;
52 fTstopf = source.fTstopf;
53 fAstart = source.fAstart;
54 fAstop = source.fAstop;
56 fMultiplicity = source.fMultiplicity;
57 fSumAmplitude = source.fSumAmplitude;
61 //----------------------------------------
62 void AliITSRawClusterSDD::Add(AliITSRawClusterSDD* clJ) {
64 fAnode = (fAnode*fQ + clJ->A()*clJ->Q())/(fQ+clJ->Q());
65 fTime = (fTime*fQ + clJ->T()*clJ->Q())/(fQ+clJ->Q());
66 fX = (fX*fQ + clJ->X()*clJ->Q())/(fQ+clJ->Q());
67 fZ = (fZ*fQ + clJ->Z()*clJ->Q())/(fQ+clJ->Q());
69 if(fSumAmplitude == 0) fSumAmplitude += fPeakAmplitude;
71 fAnode = (fAnode*fSumAmplitude+clJ->A()*clJ->PeakAmpl())/(fSumAmplitude+clJ->PeakAmpl());
72 fTime = (fTime*fSumAmplitude +clJ->T()*clJ->PeakAmpl())/(fSumAmplitude+clJ->PeakAmpl());
73 fX = (fX*fSumAmplitude +clJ->X()*clJ->PeakAmpl())/(fSumAmplitude+clJ->PeakAmpl());
74 fZ = (fZ*fSumAmplitude +clJ->Z()*clJ->PeakAmpl())/(fSumAmplitude+clJ->PeakAmpl());
76 fSumAmplitude += clJ->PeakAmpl();
78 fTstart = clJ->Tstart();
79 fTstop = clJ->Tstop();
80 if(fTstartf > clJ->Tstartf()) fTstartf = clJ->Tstartf();
81 if(fTstopf < clJ->Tstopf()) fTstopf = clJ->Tstopf();
82 if(fAstop < clJ->Astop()) fAstop = clJ->Astop();
84 fMultiplicity += (Int_t) (clJ->Samples());
86 if(clJ->PeakAmpl() > fPeakAmplitude) {
87 fPeakAmplitude = clJ->PeakAmpl();
88 fPeakPosition = clJ->PeakPos();
94 //--------------------------------------
95 Bool_t AliITSRawClusterSDD::Brother(AliITSRawClusterSDD* cluster,Float_t danode,Float_t dtime) {
97 Bool_t brother = kFALSE;
99 Bool_t test2 = kFALSE;
100 Bool_t test3 = kFALSE;
101 Bool_t test4 = kFALSE;
102 Bool_t test5 = kFALSE;
104 if(fWing != cluster->W()) return brother;
106 if(fTstopf >= cluster->Tstart() && fTstartf <= cluster->Tstop()) test2 = kTRUE;
107 if(cluster->Astop() == (fAstop+1)) test3 = kTRUE;
109 if(TMath::Abs(fTime-cluster->T()) < dtime) test4 = kTRUE;
110 if(TMath::Abs(fAnode-cluster->A()) < danode) test5 = kTRUE;
112 if((test2 && test3) || (test4 && test5) ) {
113 return brother = kTRUE;
119 //--------------------------------------
120 void AliITSRawClusterSDD::PrintInfo() {
122 cout << ", Anode " << fAnode << ", Time: " << fTime << ", Charge: " << fQ;
123 cout << ", Samples: " << fMultiplicity;
124 cout << ", X: " << fX << ", Z: " << fZ << "tstart " << fTstart << "tstop "<< fTstop <<endl;
126 //--------------------------------------
129 ClassImp(AliITSRawClusterSPD)
130 //--------------------------------------
132 AliITSRawClusterSPD::AliITSRawClusterSPD(Float_t clz,Float_t clx,Float_t Charge,Int_t ClusterSizeZ,Int_t ClusterSizeX,Int_t xstart,Int_t xstop,Int_t xstartf,Int_t xstopf,Float_t zstart,Float_t zstop,Int_t zend) {
138 fNClZ = ClusterSizeZ;
139 fNClX = ClusterSizeX;
149 //--------------------------------------
150 void AliITSRawClusterSPD::Add(AliITSRawClusterSPD* clJ) {
151 // Recolculate the new center of gravity coordinate and cluster sizes
152 // in both directions after grouping of clusters
154 if(this->fZStop < clJ->ZStop()) this->fZStop = clJ->ZStop();
156 this->fZ = this->fZ + clJ->Z();
157 this->fX = (this->fX + clJ->X())/2.;
158 this->fQ = this->fQ + clJ->Q();
160 this->fXStart = clJ->XStart(); // for a comparison with the next
161 this->fXStop = clJ->XStop(); // z column
163 if(this->fXStartf > clJ->XStartf()) this->fXStartf = clJ->XStartf();
164 if(this->fXStopf < clJ->XStopf()) this->fXStopf = clJ->XStopf();
165 if(this->fZend < clJ->Zend()) this->fZend = clJ->Zend();
166 this->fNClX = this->fXStopf - this->fXStartf + 1;
172 //--------------------------------------
173 Bool_t AliITSRawClusterSPD::Brother(AliITSRawClusterSPD* cluster,Float_t dz,Float_t dx) {
174 // fXStart, fXstop and fZend information is used now instead of dz and dx
175 // to check an absent (or a present) of the gap between two pixels in
176 // both x and z directions. The increasing order of fZend is used.
178 Bool_t brother = kFALSE;
179 Bool_t test2 = kFALSE;
180 Bool_t test3 = kFALSE;
182 // Diagonal clusters are included:
183 if(fXStop >= (cluster->XStart() -1) && fXStart <= (cluster->XStop()+1)) test2 = kTRUE;
185 // Diagonal clusters are excluded:
186 // if(fXStop >= cluster->XStart() && fXStart <= cluster->XStop()) test2 = kTRUE;
187 if(cluster->Zend() == (fZend + 1)) test3 = kTRUE;
189 // cout<<"test 2,3 0k, brother = true "<<endl;
190 return brother = kTRUE;
195 //--------------------------------------
196 void AliITSRawClusterSPD::PrintInfo()
199 cout << ", Z: " << fZ << ", X: " << fX << ", Charge: " << fQ<<endl;
200 cout << " Z cluster size: " << fNClZ <<", X cluster size "<< fNClX <<endl;
201 cout <<" XStart, XStop, XStartf,XStopf,Zend ="<<fXStart<<","<<fXStop<<","<<fXStartf<<","<<fXStopf<<","<<fZend<<endl;
206 ClassImp(AliITSRawClusterSSD)
207 //--------------------------------------
208 AliITSRawClusterSSD::AliITSRawClusterSSD(Float_t Prob,Int_t Sp,Int_t Sn) {
210 //fProbability = Prob;