]>
Commit | Line | Data |
---|---|---|
b0f5e3fc | 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 | ||
1ca7869b | 16 | #include <TF1.h> |
b0f5e3fc | 17 | #include <TMath.h> |
18 | ||
b0f5e3fc | 19 | #include "AliITSsegmentationSDD.h" |
20 | #include "AliITS.h" | |
314ba410 | 21 | #include "AliITSgeom.h" |
d953664a | 22 | #include "AliITSgeomSDD.h" |
b0f5e3fc | 23 | #include "AliRun.h" |
314ba410 | 24 | #include "AliITSresponse.h" |
b0f5e3fc | 25 | |
b0f5e3fc | 26 | ClassImp(AliITSsegmentationSDD) |
2a4239d3 | 27 | //---------------------------------------------------------------------- |
28 | AliITSsegmentationSDD::AliITSsegmentationSDD(AliITSgeom* geom, | |
29 | AliITSresponse *resp){ | |
b0f5e3fc | 30 | // constructor |
31 | fGeom=geom; | |
32 | fResponse=resp; | |
33 | fCorr=0; | |
34 | SetDetSize(); | |
e8189707 | 35 | SetPadSize(); |
36 | SetNPads(); | |
b0f5e3fc | 37 | |
38 | } | |
2a4239d3 | 39 | //______________________________________________________________________ |
b0f5e3fc | 40 | AliITSsegmentationSDD::AliITSsegmentationSDD(){ |
e8189707 | 41 | // standard constructor |
b0f5e3fc | 42 | fGeom=0; |
43 | fResponse=0; | |
44 | fCorr=0; | |
45 | SetDetSize(); | |
e8189707 | 46 | SetPadSize(); |
47 | SetNPads(); | |
b0f5e3fc | 48 | |
49 | } | |
2a4239d3 | 50 | //______________________________________________________________________ |
51 | AliITSsegmentationSDD& AliITSsegmentationSDD::operator=(AliITSsegmentationSDD | |
52 | &source){ | |
b0f5e3fc | 53 | // Operator = |
54 | if(this==&source) return *this; | |
55 | this->fNsamples = source.fNsamples; | |
56 | this->fNanodes = source.fNanodes; | |
57 | this->fPitch = source.fPitch; | |
58 | this->fTimeStep = source.fTimeStep; | |
59 | this->fDx = source.fDx; | |
60 | this->fDz = source.fDz; | |
61 | this->fDy = source.fDy; | |
62 | this->fCorr = new TF1(*(source.fCorr)); | |
63 | this->fGeom = source.fGeom; // Just copy the pointer | |
64 | this->fResponse = source.fResponse; //Just copy the pointer | |
65 | return *this; | |
66 | } | |
2a4239d3 | 67 | //______________________________________________________________________ |
b0f5e3fc | 68 | AliITSsegmentationSDD::AliITSsegmentationSDD(AliITSsegmentationSDD &source){ |
69 | // Copy constructor | |
70 | *this = source; | |
71 | } | |
2a4239d3 | 72 | //---------------------------------------------------------------------- |
b0f5e3fc | 73 | void AliITSsegmentationSDD::Init(){ |
74 | // Standard initilisation routine | |
75 | ||
e8189707 | 76 | if(!fGeom) { |
314ba410 | 77 | return; |
78 | //fGeom = ((AliITS*)gAlice->GetModule("ITS"))->GetITSgeom(); | |
e8189707 | 79 | } |
b0f5e3fc | 80 | AliITSgeomSDD *gsdd = (AliITSgeomSDD *) (fGeom->GetShape(3,1,1)); |
81 | ||
82 | const Float_t kconv=10000.; | |
83 | fDz = 2.*kconv*gsdd->GetDz(); | |
84 | fDx = kconv*gsdd->GetDx(); | |
85 | fDy = 2.*kconv*gsdd->GetDy(); | |
86 | } | |
87 | ||
2a4239d3 | 88 | //---------------------------------------------------------------------- |
b0f5e3fc | 89 | void AliITSsegmentationSDD:: |
314ba410 | 90 | Neighbours(Int_t iX, Int_t iZ, Int_t* Nlist, Int_t Xlist[8], Int_t Zlist[8]){ |
91 | // returns neighbours for use in Cluster Finder routines and the like | |
b0f5e3fc | 92 | |
e8189707 | 93 | if(iX >= fNanodes) printf("iX > fNanodes %d %d\n",iX,fNanodes); |
94 | if(iZ >= fNsamples) printf("iZ > fNsamples %d %d\n",iZ,fNsamples); | |
b0f5e3fc | 95 | *Nlist=4; |
96 | Xlist[0]=Xlist[1]=iX; | |
314ba410 | 97 | if(iX && (iX != fNanodes/2)) Xlist[2]=iX-1; |
b0f5e3fc | 98 | else Xlist[2]=iX; |
314ba410 | 99 | if ((iX !=fNanodes/2 -1) && (iX != fNanodes)) Xlist[3]=iX+1; |
b0f5e3fc | 100 | else Xlist[3]=iX; |
101 | if(iZ) Zlist[0]=iZ-1; | |
102 | else Zlist[0]=iZ; | |
103 | if (iZ < fNsamples) Zlist[1]=iZ+1; | |
104 | else Zlist[1]=iZ; | |
105 | Zlist[2]=Zlist[3]=iZ; | |
b0f5e3fc | 106 | } |
2a4239d3 | 107 | //---------------------------------------------------------------------- |
108 | void AliITSsegmentationSDD::GetPadIxz(Float_t x,Float_t z, | |
109 | Int_t &timebin,Int_t &anode){ | |
110 | // Returns cell coordinates (time sample,anode) for given real local | |
111 | // coordinates (x,z) | |
b0f5e3fc | 112 | |
113 | // expects x, z in cm | |
114 | ||
115 | const Float_t kconv=10000; // cm->um | |
116 | ||
117 | Float_t speed=fResponse->DriftSpeed(); | |
118 | Int_t na = fNanodes/2; | |
119 | Float_t driftpath=fDx-TMath::Abs(kconv*x); | |
120 | timebin=(Int_t)(driftpath/speed/fTimeStep); | |
e8189707 | 121 | anode=(Int_t)(kconv*z/fPitch) + na/2; |
b0f5e3fc | 122 | if (x > 0) anode += na; |
123 | ||
124 | timebin+=1; | |
125 | anode+=1; | |
126 | ||
127 | } | |
2a4239d3 | 128 | //---------------------------------------------------------------------- |
129 | void AliITSsegmentationSDD::GetPadCxz(Int_t timebin,Int_t anode, | |
130 | Float_t &x ,Float_t &z){ | |
b0f5e3fc | 131 | // Transform from cell to real local coordinates |
b0f5e3fc | 132 | // returns x, z in cm |
133 | ||
134 | const Float_t kconv=10000; // um->cm | |
135 | ||
136 | Float_t speed=fResponse->DriftSpeed(); | |
137 | Int_t na = fNanodes/2; | |
138 | Float_t driftpath=(timebin+1)*fTimeStep*speed; | |
139 | if (anode >= na) x=(fDx-driftpath)/kconv; | |
140 | else x = -(fDx-driftpath)/kconv; | |
141 | if (anode >= na) anode-=na; | |
142 | z=((anode+1)*fPitch-fDz/2)/kconv; | |
143 | ||
144 | } | |
2a4239d3 | 145 | //---------------------------------------------------------------------- |
e8189707 | 146 | void AliITSsegmentationSDD::GetPadTxz(Float_t &x,Float_t &z){ |
147 | // Get anode and time bucket as floats - numbering from 0 | |
148 | ||
149 | // expects x, z in cm | |
150 | ||
151 | const Float_t kconv=10000; // cm->um | |
152 | ||
2a4239d3 | 153 | Float_t x0=x; |
e8189707 | 154 | Float_t speed=fResponse->DriftSpeed(); |
2a4239d3 | 155 | Int_t na = fNanodes/2; |
e8189707 | 156 | Float_t driftpath=fDx-TMath::Abs(kconv*x); |
157 | x=driftpath/speed/fTimeStep; | |
2a4239d3 | 158 | z=kconv*z/fPitch + (float)na/2; |
159 | if (x0 < 0) x = -x; | |
e8189707 | 160 | |
161 | } | |
2a4239d3 | 162 | //---------------------------------------------------------------------- |
b0f5e3fc | 163 | void AliITSsegmentationSDD::GetLocal(Int_t module,Float_t *g ,Float_t *l){ |
164 | // returns local coordinates from global | |
165 | if(!fGeom) { | |
314ba410 | 166 | return; |
167 | //fGeom = ((AliITS*)gAlice->GetModule("ITS"))->GetITSgeom(); | |
b0f5e3fc | 168 | } |
169 | fGeom->GtoL(module,g,l); | |
170 | } | |
2a4239d3 | 171 | //---------------------------------------------------------------------- |
b0f5e3fc | 172 | void AliITSsegmentationSDD::GetGlobal(Int_t module,Float_t *l ,Float_t *g){ |
173 | // return global coordinates from local | |
174 | if(!fGeom) { | |
314ba410 | 175 | return; |
176 | //fGeom = ((AliITS*)gAlice->GetModule("ITS"))->GetITSgeom(); | |
b0f5e3fc | 177 | } |
178 | ||
179 | fGeom->LtoG(module,l,g); | |
180 | ||
181 | } | |
f5d698b9 | 182 | //---------------------------------------------------------------------- |
183 | void AliITSsegmentationSDD::Print(){ | |
184 | // Print SDD segmentation Parameters | |
185 | ||
186 | cout << "**************************************************" << endl; | |
187 | cout << " Silicon Drift Detector Segmentation Parameters " << endl; | |
188 | cout << "**************************************************" << endl; | |
189 | cout << "Number of Time Samples: " << fNsamples << endl; | |
190 | cout << "Number of Anodes: " << fNanodes << endl; | |
191 | cout << "Time Step (ns): " << fTimeStep << endl; | |
192 | cout << "Anode Pitch (um): " << fPitch << endl; | |
193 | cout << "Full Detector Width (x): " << fDx << endl; | |
194 | cout << "Half Detector Length (z): " << fDz << endl; | |
195 | cout << "Full Detector Thickness (y): " << fDy << endl; | |
196 | cout << "**************************************************" << endl; | |
197 | ||
198 | } |