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(){
29 // default constructor
33 fAnode=fTime=fPeakAmplitude=0;
36 fTstart=fTstop=fTstartf=fTstopf=0;
40 //______________________________________________________________________
41 AliITSRawClusterSDD::AliITSRawClusterSDD(Int_t wing,
42 Float_t Anode,Float_t Time,
43 Float_t Charge,Float_t PeakAmplitude,
45 Float_t Asigma,Float_t Tsigma,
48 Int_t Samples,Int_t Tstart,
49 Int_t Tstop,Int_t Tstartf,
50 Int_t Tstopf,Int_t Anodes,
51 Int_t Astart, Int_t Astop){
58 fPeakAmplitude = PeakAmplitude;
59 fPeakPosition = PeakPosition;
69 fMultiplicity = Samples;
73 for(Int_t i=0;i<fWing; i++) sign *= (-1);
74 fX = DriftPath*sign/10000.;
75 fZ = AnodeOffset/10000.;
77 //______________________________________________________________________
78 AliITSRawClusterSDD::AliITSRawClusterSDD(const AliITSRawClusterSDD & source):
79 AliITSRawCluster(source){
83 fAnode = source.fAnode;
86 fPeakAmplitude = source.fPeakAmplitude;
87 fPeakPosition = source.fPeakPosition;
88 fAsigma = source.fAsigma;
89 fTsigma = source.fTsigma;
90 fNanodes = source.fNanodes;
91 fTstart = source.fTstart;
92 fTstop = source.fTstop;
93 fTstartf = source.fTstartf;
94 fTstopf = source.fTstopf;
95 fAstart = source.fAstart;
96 fAstop = source.fAstop;
98 fMultiplicity = source.fMultiplicity;
99 fSumAmplitude = source.fSumAmplitude;
103 //______________________________________________________________________
104 void AliITSRawClusterSDD::Add(AliITSRawClusterSDD* clJ) {
107 fAnode = (fAnode*fQ + clJ->A()*clJ->Q())/(fQ+clJ->Q());
108 fTime = ( fTime*fQ + clJ->T()*clJ->Q())/(fQ+clJ->Q());
109 fX = ( fX*fQ + clJ->X()*clJ->Q())/(fQ+clJ->Q());
110 fZ = ( fZ*fQ + clJ->Z()*clJ->Q())/(fQ+clJ->Q());
112 if(fSumAmplitude == 0) fSumAmplitude += fPeakAmplitude;
114 fAnode = (fAnode*fSumAmplitude+clJ->A()*clJ->PeakAmpl())/
115 (fSumAmplitude+clJ->PeakAmpl());
116 fTime = (fTime*fSumAmplitude +clJ->T()*clJ->PeakAmpl())/
117 (fSumAmplitude+clJ->PeakAmpl());
118 fX = (fX*fSumAmplitude +clJ->X()*clJ->PeakAmpl())/
119 (fSumAmplitude+clJ->PeakAmpl());
120 fZ = (fZ*fSumAmplitude +clJ->Z()*clJ->PeakAmpl())/
121 (fSumAmplitude+clJ->PeakAmpl());
123 fSumAmplitude += clJ->PeakAmpl();
125 fTstart = clJ->Tstart();
126 fTstop = clJ->Tstop();
127 if(fTstartf > clJ->Tstartf()) fTstartf = clJ->Tstartf();
128 if( fTstopf < clJ->Tstopf() ) fTstopf = clJ->Tstopf();
129 if( fAstop < clJ->Astop() ) fAstop = clJ->Astop();
131 fMultiplicity += (Int_t) (clJ->Samples());
133 if(clJ->PeakAmpl() > fPeakAmplitude) {
134 fPeakAmplitude = clJ->PeakAmpl();
135 fPeakPosition = clJ->PeakPos();
140 //______________________________________________________________________
141 Bool_t AliITSRawClusterSDD::Brother(AliITSRawClusterSDD* cluster,
142 Float_t danode,Float_t dtime) {
143 // compare this with "cluster"
144 Bool_t brother = kFALSE;
145 Bool_t test2 = kFALSE;
146 Bool_t test3 = kFALSE;
147 Bool_t test4 = kFALSE;
148 Bool_t test5 = kFALSE;
150 if(fWing != cluster->W()) return brother;
152 if(fTstopf >= cluster->Tstart() &&
153 fTstartf <= cluster->Tstop()) test2 = kTRUE;
154 if(cluster->Astop() == (fAstop+1)) test3 = kTRUE;
156 if(TMath::Abs(fTime-cluster->T()) < dtime) test4 = kTRUE;
157 if(TMath::Abs(fAnode-cluster->A()) < danode) test5 = kTRUE;
159 if((test2 && test3) || (test4 && test5) ) {
160 return brother = kTRUE;
165 //______________________________________________________________________
166 void AliITSRawClusterSDD::PrintInfo() const {
169 cout << ", Anode " << fAnode << ", Time: " << fTime << ", Charge: " << fQ;
170 cout << ", Samples: " << fMultiplicity;
171 cout << ", X: " << fX << ", Z: " << fZ << "tstart " << fTstart
172 << "tstop "<< fTstop <<endl;