]>
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)); | |
166 | fId=chamber; | |
167 | ||
a9e2aefa | 168 | } |
e889a146 | 169 | //------------------------------------------------------------------ |
1373d50f | 170 | void AliMUONSegmentationTrigger::Draw(const char * /*opt*/) {} |
a9e2aefa | 171 | //------------------------------------------------------------------ |
172 | Int_t AliMUONSegmentationTrigger::ModuleNumber(Int_t imodule){ | |
173 | // returns module number (from 0 to 126) corresponding to module imodule | |
174 | Int_t imod=0; | |
0c19630f | 175 | for (Int_t i=0; i<AliMUONTriggerConstants::Nmodule(); i++) { |
176 | if (AliMUONTriggerConstants::ModuleId(i)==imodule) { | |
a9e2aefa | 177 | imod=i; |
178 | break; | |
179 | } | |
180 | } | |
181 | return imod; | |
182 | } | |
e889a146 | 183 | //------------------------------------------------------------------ |
184 | void AliMUONSegmentationTrigger::SetHit(Float_t xhit, Float_t yhit, Float_t /*zhit*/) | |
185 | { | |
186 | SetHit(xhit, yhit); | |
187 | } | |
a9e2aefa | 188 | //------------------------------------------------------------------ |
189 | Float_t AliMUONSegmentationTrigger::StripSizeX(Int_t imodule){ | |
190 | // Returns x-strip size for given module imodule | |
191 | ||
192 | Int_t absimodule=TMath::Abs(imodule); | |
193 | Int_t moduleNum=ModuleNumber(imodule); | |
0c19630f | 194 | if (absimodule==51) { |
a9e2aefa | 195 | return 0; |
196 | } else { | |
0c19630f | 197 | return TMath::Abs((fYcmax[moduleNum]-fYcmin[moduleNum])/ |
198 | AliMUONTriggerConstants::NstripX(moduleNum)); | |
199 | } | |
a9e2aefa | 200 | } |
201 | ||
202 | //------------------------------------------------------------------ | |
203 | Float_t AliMUONSegmentationTrigger::StripSizeY(Int_t imodule){ | |
204 | // Returns y-strip size for given module imodule | |
205 | ||
206 | Int_t absimodule=TMath::Abs(imodule); | |
207 | Int_t moduleNum=ModuleNumber(imodule); | |
0c19630f | 208 | if (absimodule==51) { |
a9e2aefa | 209 | return 0; |
210 | } else { | |
0c19630f | 211 | return TMath::Abs((AliMUONTriggerConstants::XcMax(moduleNum) - |
212 | AliMUONTriggerConstants::XcMin(moduleNum)) / | |
213 | AliMUONTriggerConstants::NstripY(moduleNum)); | |
a9e2aefa | 214 | } |
215 | } | |
216 | ||
217 | //------------------------------------------------------------------ | |
218 | void AliMUONSegmentationTrigger::SetHit(Float_t xhit, Float_t yhit) | |
219 | { | |
220 | // Sets virtual hit position, needed for evaluating pad response | |
221 | // outside the tracking program | |
222 | ||
ecfa008b | 223 | fXhit=xhit; |
224 | fYhit=yhit; | |
a9e2aefa | 225 | } |
0c19630f | 226 | |
227 | ||
228 | ||
229 | ||
230 | ||
231 | ||
232 | ||
233 | ||
234 |