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