1 /**************************************************************************
2 * Copyright(c) 2000-2004, 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 **************************************************************************/
15 #include <Riostream.h>
18 #include "AliITSRawClusterSDD.h"
20 ////////////////////////////////////////////////////
21 // Cluster classes for set:ITS //
22 // Raw Clusters for SDD //
24 ////////////////////////////////////////////////////
26 ClassImp(AliITSRawClusterSDD)
27 //______________________________________________________________________
28 AliITSRawClusterSDD::AliITSRawClusterSDD():
48 // default constructor
52 //______________________________________________________________________
53 AliITSRawClusterSDD::AliITSRawClusterSDD(Int_t wing,
54 Float_t Anode,Float_t Time,
55 Float_t Charge,Float_t PeakAmplitude,
57 Float_t Asigma,Float_t Tsigma,
60 Int_t Samples,Int_t Tstart,
61 Int_t Tstop,Int_t Tstartf,
62 Int_t Tstopf,Int_t Anodes,
63 Int_t Astart, Int_t Astop):
72 fPeakAmplitude(PeakAmplitude),
74 fPeakPosition(PeakPosition),
85 for(Int_t i=0;i<fWing; i++) sign *= (-1);
86 fX = DriftPath*sign/10000.;
87 fZ = AnodeOffset/10000.;
88 fMultiplicity = Samples;
90 //______________________________________________________________________
91 AliITSRawClusterSDD::AliITSRawClusterSDD(const AliITSRawClusterSDD & source):
92 AliITSRawCluster(source),
97 fAnode(source.fAnode),
99 fAsigma(source.fAsigma),
100 fTsigma(source.fTsigma),
101 fPeakAmplitude(source.fPeakAmplitude),
102 fSumAmplitude(source.fSumAmplitude),
103 fPeakPosition(source.fPeakPosition),
104 fNanodes(source.fNanodes),
105 fTstart(source.fTstart),
106 fTstop(source.fTstop),
107 fTstartf(source.fTstartf),
108 fTstopf(source.fTstopf),
109 fAstart(source.fAstart),
110 fAstop(source.fAstop){
113 fMultiplicity = source.fMultiplicity;
115 //______________________________________________________________________
116 void AliITSRawClusterSDD::Add(AliITSRawClusterSDD* clJ) {
119 fAnode = (fAnode*fQ + clJ->A()*clJ->Q())/(fQ+clJ->Q());
120 fTime = ( fTime*fQ + clJ->T()*clJ->Q())/(fQ+clJ->Q());
121 fX = ( fX*fQ + clJ->X()*clJ->Q())/(fQ+clJ->Q());
122 fZ = ( fZ*fQ + clJ->Z()*clJ->Q())/(fQ+clJ->Q());
124 if(fSumAmplitude == 0) fSumAmplitude += fPeakAmplitude;
126 fAnode = (fAnode*fSumAmplitude+clJ->A()*clJ->PeakAmpl())/
127 (fSumAmplitude+clJ->PeakAmpl());
128 fTime = (fTime*fSumAmplitude +clJ->T()*clJ->PeakAmpl())/
129 (fSumAmplitude+clJ->PeakAmpl());
130 fX = (fX*fSumAmplitude +clJ->X()*clJ->PeakAmpl())/
131 (fSumAmplitude+clJ->PeakAmpl());
132 fZ = (fZ*fSumAmplitude +clJ->Z()*clJ->PeakAmpl())/
133 (fSumAmplitude+clJ->PeakAmpl());
135 fSumAmplitude += clJ->PeakAmpl();
137 fTstart = clJ->Tstart();
138 fTstop = clJ->Tstop();
139 if(fTstartf > clJ->Tstartf()) fTstartf = clJ->Tstartf();
140 if( fTstopf < clJ->Tstopf() ) fTstopf = clJ->Tstopf();
141 if( fAstop < clJ->Astop() ) fAstop = clJ->Astop();
143 fMultiplicity += (Int_t) (clJ->Samples());
145 if(clJ->PeakAmpl() > fPeakAmplitude) {
146 fPeakAmplitude = clJ->PeakAmpl();
147 fPeakPosition = clJ->PeakPos();
152 //______________________________________________________________________
153 Bool_t AliITSRawClusterSDD::Brother(AliITSRawClusterSDD* cluster,
154 Float_t danode,Float_t dtime) {
155 // compare this with "cluster"
156 Bool_t brother = kFALSE;
157 Bool_t test2 = kFALSE;
158 Bool_t test3 = kFALSE;
159 Bool_t test4 = kFALSE;
160 Bool_t test5 = kFALSE;
162 if(fWing != cluster->W()) return brother;
164 if(fTstopf >= cluster->Tstart() &&
165 fTstartf <= cluster->Tstop()) test2 = kTRUE;
166 if(cluster->Astop() == (fAstop+1)) test3 = kTRUE;
168 if(TMath::Abs(fTime-cluster->T()) < dtime) test4 = kTRUE;
169 if(TMath::Abs(fAnode-cluster->A()) < danode) test5 = kTRUE;
171 if((test2 && test3) || (test4 && test5) ) {
172 return brother = kTRUE;
177 //______________________________________________________________________
178 void AliITSRawClusterSDD::PrintInfo() const {
181 cout << ", Anode " << fAnode << ", Time: " << fTime << ", Charge: " << fQ;
182 cout << ", Samples: " << fMultiplicity;
183 cout << ", X: " << fX << ", Z: " << fZ << "tstart " << fTstart
184 << "tstop "<< fTstop <<endl;