]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSRawCluster.cxx
Fixed compiler warnings with regards to copy construtors and unused variabls
[u/mrichter/AliRoot.git] / ITS / AliITSRawCluster.cxx
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  
16 /* $Id$ */
17
18 #include <Riostream.h>
19 #include <TMath.h>
20  
21 #include "AliITSRawCluster.h"
22
23 ClassImp(AliITSRawCluster)
24 ClassImp(AliITSRawClusterSDD)
25
26 //______________________________________________________________________
27 AliITSRawClusterSDD::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.;
62 }
63 //______________________________________________________________________
64 AliITSRawClusterSDD::AliITSRawClusterSDD(const AliITSRawClusterSDD & source):
65     AliITSRawCluster(source){
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;
88 }
89 //______________________________________________________________________
90 void AliITSRawClusterSDD::Add(AliITSRawClusterSDD* clJ) {
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 //______________________________________________________________________
127 Bool_t AliITSRawClusterSDD::Brother(AliITSRawClusterSDD* cluster,
128                                     Float_t danode,Float_t dtime) {
129
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;
135   
136     if(fWing != cluster->W()) return brother;
137
138     if(fTstopf >= cluster->Tstart() &&
139        fTstartf <= cluster->Tstop()) test2 = kTRUE;
140     if(cluster->Astop() == (fAstop+1)) test3 = kTRUE;
141
142     if(TMath::Abs(fTime-cluster->T()) < dtime) test4 = kTRUE;
143     if(TMath::Abs(fAnode-cluster->A()) < danode) test5 = kTRUE;
144
145     if((test2 && test3) || (test4 && test5) ) {
146         return brother = kTRUE;
147     } // end if
148   
149     return brother;
150 }
151 //______________________________________________________________________
152 void AliITSRawClusterSDD::PrintInfo() {
153     // print
154
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 //======================================================================
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,
166                                          Int_t xstop,
167                                          Float_t zstart,Float_t zstop,
168                                          Int_t zend,Int_t module) {
169     // constructor
170
171     fZ       = clz;
172     fX       = clx;
173     fQ       = Charge;
174     fNClZ    = ClusterSizeZ;
175     fNClX    = ClusterSizeX;
176     fXStart  = xstart;
177     fXStop   = xstop;
178     fZStart  = zstart;
179     fZStop   = zstop;
180     fZend    = zend;
181     fModule  = module;
182 }
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
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
194     if(this->fZend < clJ->Zend())       this->fZend    = clJ->Zend();
195     this->fNClX   = this->fXStop - this->fXStart + 1; 
196     (this->fNClZ)++;
197
198     return;
199 }
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;
209
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;
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;
224 }
225 //______________________________________________________________________
226 void 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;
231     cout <<" XStart, XStop,Zend, Module ="<<fXStart<<","
232          <<fXStop<<","<<fZend << "," << fModule<<endl;
233 }
234 //======================================================================
235 ClassImp(AliITSRawClusterSSD)
236 //______________________________________________________________________
237 AliITSRawClusterSSD::AliITSRawClusterSSD(Float_t Prob,Int_t Sp,Int_t Sn) {  
238     // constructor
239
240     Prob = 0.0; // added to remove unused variable warning.
241     //fProbability   = Prob;
242     fMultiplicity  = Sp;
243     fMultiplicityN = Sn;
244 }