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