]>
Commit | Line | Data |
---|---|---|
a9e2aefa | 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 | ||
88cb7938 | 16 | /* $Id$ */ |
a9e2aefa | 17 | |
30178c30 | 18 | #include <TMath.h> |
19 | //#include <TRandom.h> | |
20 | //#include <TArc.h> | |
21 | //#include <Riostream.h> | |
22 | ||
a9e2aefa | 23 | #include "AliMUONSegmentationTrigger.h" |
0c19630f | 24 | #include "AliMUONTriggerConstants.h" |
d81db581 | 25 | #include "AliRun.h" |
26 | #include "AliMUON.h" | |
a9e2aefa | 27 | #include "AliMUONChamber.h" |
5fd73042 | 28 | |
a9e2aefa | 29 | ClassImp(AliMUONSegmentationTrigger) |
30 | ||
30178c30 | 31 | //------------------------------------------------------------------ |
32 | AliMUONSegmentationTrigger::AliMUONSegmentationTrigger() | |
33 | : AliMUONSegmentationV0() | |
34 | { | |
35 | // Constructor | |
36 | ||
37 | fChamber=0; | |
38 | } | |
39 | ||
0c19630f | 40 | //------------------------------------------------------------------ |
d81db581 | 41 | void AliMUONSegmentationTrigger::Init(Int_t chamber) |
a9e2aefa | 42 | { |
43 | // initialize Module geometry | |
d81db581 | 44 | AliMUON *pMUON = (AliMUON *) gAlice->GetModule("MUON"); |
45 | AliMUONChamber* iChamber=&(pMUON->Chamber(chamber)); | |
46 | ||
ef077202 | 47 | if(pMUON->GetDebug()>1) printf("%s: Initialize Trigger Chamber Module Geometry\n",ClassName()); |
9e1a0ddb | 48 | |
d81db581 | 49 | Float_t zPos=iChamber->Z(); |
deea6fd8 | 50 | Float_t z1Pos=-1603.5; |
a9e2aefa | 51 | fZscale = zPos/z1Pos; |
52 | ||
a9e2aefa | 53 | Float_t y1Cmin[126]; |
54 | Float_t y1Cmax[126]; | |
55 | ||
56 | Float_t dz=7.2; | |
deea6fd8 | 57 | // Float_t z1PosPlus=z1Pos+dz/2.; |
58 | // Float_t z1PosMinus=z1Pos-dz/2.; | |
59 | Float_t z1PosPlus=z1Pos-dz/2.; | |
60 | Float_t z1PosMinus=z1Pos+dz/2.; | |
a9e2aefa | 61 | |
62 | Float_t z1pm=z1PosPlus/z1PosMinus; | |
63 | Float_t z1mp=z1PosMinus/z1PosPlus; | |
64 | ||
ef077202 | 65 | if(pMUON->GetDebug()>1) printf("%s: fZscale = %f \n",ClassName(),fZscale); |
0c19630f | 66 | |
67 | // calculate yCmin and fYcmax | |
68 | Int_t i; | |
69 | for (i=62; i>=0; i--) { | |
70 | Int_t j=ModuleNumber(-AliMUONTriggerConstants::ModuleId(i)); // i == right, j == left | |
71 | if (Int_t(AliMUONTriggerConstants::ModuleId(i)/10)==5) { // start with middle chamber | |
72 | if (AliMUONTriggerConstants::ModuleId(i)==51) { // special case (empty module) | |
73 | fYcmin[i]=fYcmax[i]=fYcmin[j]=fYcmax[j]=0.; | |
a9e2aefa | 74 | } else { |
75 | y1Cmin[i]=y1Cmin[j]=-34; | |
76 | y1Cmax[i]=y1Cmax[j]=34; | |
0c19630f | 77 | fYcmin[i]=fYcmin[j]=-34.; |
78 | ||
79 | fYcmax[i]=fYcmax[j]=34.; | |
a9e2aefa | 80 | } |
0c19630f | 81 | } else if (Int_t(AliMUONTriggerConstants::ModuleId(i)/10)==4) { // up |
82 | if (AliMUONTriggerConstants::ModuleId(i)!=41) { | |
a9e2aefa | 83 | y1Cmin[i]=y1Cmax[i+7]*z1pm; |
84 | y1Cmax[i]=y1Cmin[i]+68.; | |
0c19630f | 85 | fYcmin[i]=y1Cmin[i]; |
86 | fYcmax[i]=fYcmin[i]+68.; | |
a9e2aefa | 87 | |
88 | y1Cmin[j]=y1Cmax[j+7]*z1mp; | |
89 | y1Cmax[j]=y1Cmin[j]+68.; | |
0c19630f | 90 | fYcmin[j]=y1Cmin[j]; |
91 | fYcmax[j]=fYcmin[j]+68.; | |
a9e2aefa | 92 | } else { |
93 | y1Cmin[i]=y1Cmin[ModuleNumber(42)]+17; | |
94 | y1Cmax[i]=y1Cmin[i]+51.; | |
0c19630f | 95 | fYcmin[i]=y1Cmin[i]; |
96 | fYcmax[i]=fYcmin[i]+51.; | |
a9e2aefa | 97 | |
98 | y1Cmin[j]=y1Cmin[ModuleNumber(-42)]+17; | |
99 | y1Cmax[j]=y1Cmin[j]+51.; | |
0c19630f | 100 | fYcmin[j]=y1Cmin[j]; |
101 | fYcmax[j]=fYcmin[j]+51.; | |
a9e2aefa | 102 | } |
0c19630f | 103 | } else if (Int_t(AliMUONTriggerConstants::ModuleId(i)/10)==3) { |
a9e2aefa | 104 | y1Cmin[i]=y1Cmax[i+7]*z1mp; |
105 | y1Cmax[i]=y1Cmin[i]+68.; | |
0c19630f | 106 | fYcmin[i]=y1Cmin[i]; |
107 | fYcmax[i]=fYcmin[i]+68.; | |
a9e2aefa | 108 | |
109 | y1Cmin[j]=y1Cmax[j+7]*z1pm; | |
110 | y1Cmax[j]=y1Cmin[j]+68.; | |
0c19630f | 111 | fYcmin[j]=y1Cmin[j]; |
112 | fYcmax[j]=fYcmin[j]+68.; | |
113 | } else if (Int_t(AliMUONTriggerConstants::ModuleId(i)/10)==2) { | |
a9e2aefa | 114 | y1Cmin[i]=y1Cmax[i+7]*z1pm; |
115 | y1Cmax[i]=y1Cmin[i]+68.; | |
0c19630f | 116 | fYcmin[i]=y1Cmin[i]; |
117 | fYcmax[i]=fYcmin[i]+68.; | |
a9e2aefa | 118 | |
119 | y1Cmin[j]=y1Cmax[j+7]*z1mp; | |
120 | y1Cmax[j]=y1Cmin[j]+68.; | |
0c19630f | 121 | fYcmin[j]=y1Cmin[j]; |
122 | fYcmax[j]=fYcmin[j]+68.; | |
123 | } else if (Int_t(AliMUONTriggerConstants::ModuleId(i)/10)==1) { | |
a9e2aefa | 124 | y1Cmin[i]=y1Cmax[i+7]*z1mp; |
125 | y1Cmax[i]=y1Cmin[i]+68.; | |
0c19630f | 126 | fYcmin[i]=y1Cmin[i]; |
127 | fYcmax[i]=fYcmin[i]+68.; | |
a9e2aefa | 128 | |
129 | y1Cmin[j]=y1Cmax[j+7]*z1pm; | |
130 | y1Cmax[j]=y1Cmin[j]+68.; | |
0c19630f | 131 | fYcmin[j]=y1Cmin[j]; |
132 | fYcmax[j]=fYcmin[j]+68.; | |
a9e2aefa | 133 | } |
134 | } | |
135 | ||
0c19630f | 136 | for (i=0; i<63; i++) { // second loop (fill lower part) |
137 | Int_t j=ModuleNumber(-AliMUONTriggerConstants::ModuleId(i)); // i == right, j == left | |
138 | if (TMath::Abs(Int_t(AliMUONTriggerConstants::ModuleId(i)/10))==6) { | |
139 | fYcmin[i]=-fYcmax[i-14]; | |
140 | fYcmax[i]=-fYcmin[i-14]; | |
141 | fYcmin[j]=-fYcmax[j-14]; | |
142 | fYcmax[j]=-fYcmin[j-14]; | |
143 | } else if (TMath::Abs(Int_t(AliMUONTriggerConstants::ModuleId(i)/10))==7) { | |
144 | fYcmin[i]=-fYcmax[i-28]; | |
145 | fYcmax[i]=-fYcmin[i-28]; | |
146 | fYcmin[j]=-fYcmax[j-28]; | |
147 | fYcmax[j]=-fYcmin[j-28]; | |
148 | } else if (TMath::Abs(Int_t(AliMUONTriggerConstants::ModuleId(i)/10))==8) { | |
149 | fYcmin[i]=-fYcmax[i-42]; | |
150 | fYcmax[i]=-fYcmin[i-42]; | |
151 | fYcmin[j]=-fYcmax[j-42]; | |
152 | fYcmax[j]=-fYcmin[j-42]; | |
153 | } else if (TMath::Abs(Int_t(AliMUONTriggerConstants::ModuleId(i)/10))==9) { | |
154 | fYcmin[i]=-fYcmax[i-56]; | |
155 | fYcmax[i]=-fYcmin[i-56]; | |
156 | fYcmin[j]=-fYcmax[j-56]; | |
157 | fYcmax[j]=-fYcmin[j-56]; | |
a9e2aefa | 158 | } |
159 | } | |
160 | ||
a9e2aefa | 161 | fNpx=124; |
162 | fNpy=64; | |
163 | ||
5fd73042 | 164 | // Set parent chamber number |
165 | fChamber=&(pMUON->Chamber(chamber)); | |
c9d10ab5 | 166 | fRmin=fChamber->RInner(); |
167 | fRmax=fChamber->ROuter(); | |
168 | fCorr=0; | |
169 | fZ=fChamber->Z(); | |
5fd73042 | 170 | fId=chamber; |
a9e2aefa | 171 | } |
e889a146 | 172 | //------------------------------------------------------------------ |
1373d50f | 173 | void AliMUONSegmentationTrigger::Draw(const char * /*opt*/) {} |
a9e2aefa | 174 | //------------------------------------------------------------------ |
175 | Int_t AliMUONSegmentationTrigger::ModuleNumber(Int_t imodule){ | |
176 | // returns module number (from 0 to 126) corresponding to module imodule | |
177 | Int_t imod=0; | |
0c19630f | 178 | for (Int_t i=0; i<AliMUONTriggerConstants::Nmodule(); i++) { |
179 | if (AliMUONTriggerConstants::ModuleId(i)==imodule) { | |
a9e2aefa | 180 | imod=i; |
181 | break; | |
182 | } | |
183 | } | |
184 | return imod; | |
185 | } | |
e889a146 | 186 | //------------------------------------------------------------------ |
187 | void AliMUONSegmentationTrigger::SetHit(Float_t xhit, Float_t yhit, Float_t /*zhit*/) | |
188 | { | |
189 | SetHit(xhit, yhit); | |
190 | } | |
a9e2aefa | 191 | //------------------------------------------------------------------ |
192 | Float_t AliMUONSegmentationTrigger::StripSizeX(Int_t imodule){ | |
193 | // Returns x-strip size for given module imodule | |
194 | ||
195 | Int_t absimodule=TMath::Abs(imodule); | |
196 | Int_t moduleNum=ModuleNumber(imodule); | |
0c19630f | 197 | if (absimodule==51) { |
a9e2aefa | 198 | return 0; |
199 | } else { | |
0c19630f | 200 | return TMath::Abs((fYcmax[moduleNum]-fYcmin[moduleNum])/ |
201 | AliMUONTriggerConstants::NstripX(moduleNum)); | |
202 | } | |
a9e2aefa | 203 | } |
204 | ||
205 | //------------------------------------------------------------------ | |
206 | Float_t AliMUONSegmentationTrigger::StripSizeY(Int_t imodule){ | |
207 | // Returns y-strip size for given module imodule | |
208 | ||
209 | Int_t absimodule=TMath::Abs(imodule); | |
210 | Int_t moduleNum=ModuleNumber(imodule); | |
0c19630f | 211 | if (absimodule==51) { |
a9e2aefa | 212 | return 0; |
213 | } else { | |
0c19630f | 214 | return TMath::Abs((AliMUONTriggerConstants::XcMax(moduleNum) - |
215 | AliMUONTriggerConstants::XcMin(moduleNum)) / | |
216 | AliMUONTriggerConstants::NstripY(moduleNum)); | |
a9e2aefa | 217 | } |
218 | } | |
219 | ||
220 | //------------------------------------------------------------------ | |
221 | void AliMUONSegmentationTrigger::SetHit(Float_t xhit, Float_t yhit) | |
222 | { | |
223 | // Sets virtual hit position, needed for evaluating pad response | |
224 | // outside the tracking program | |
225 | ||
ecfa008b | 226 | fXhit=xhit; |
227 | fYhit=yhit; | |
a9e2aefa | 228 | } |
0c19630f | 229 | |
230 | ||
231 | ||
232 | ||
233 | ||
234 | ||
235 | ||
236 | ||
237 |