]>
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 | **************************************************************************/ | |
cbc57deb | 15 | |
88cb7938 | 16 | /* $Id$ */ |
aac5be80 | 17 | |
d1525c79 | 18 | // ------------------ |
19 | // Class AliMUONTriggerCircuit | |
20 | // ------------------ | |
21 | // description of the global position of the trigger boards strip positions | |
22 | // based on the "old" segmentation (to be replaced soon) | |
23 | ||
24 | ||
30178c30 | 25 | #include <TMath.h> |
26 | ||
27 | #include "AliMUONTriggerCircuit.h" | |
a9e2aefa | 28 | #include "AliRun.h" |
29 | #include "AliMUON.h" | |
aac5be80 | 30 | #include "AliMUONTriggerConstants.h" |
331dcacd | 31 | #include "AliMUONGeometrySegmentation.h" |
b7ef3c96 | 32 | #include "AliMUONSegmentation.h" |
3f434b6f | 33 | #include "AliMUONConstants.h" |
8c343c7c | 34 | #include "AliLog.h" |
a9e2aefa | 35 | |
5398f946 | 36 | /// \cond CLASSIMP |
a9e2aefa | 37 | ClassImp(AliMUONTriggerCircuit) |
5398f946 | 38 | /// \endcond |
a9e2aefa | 39 | |
a9e2aefa | 40 | //---------------------------------------------------------------------- |
30178c30 | 41 | AliMUONTriggerCircuit::AliMUONTriggerCircuit() |
331dcacd | 42 | : TObject(), |
43 | fIdCircuit(0), | |
44 | fX2m(0), | |
45 | fX2ud(0) | |
a9e2aefa | 46 | { |
5398f946 | 47 | /// Constructor |
331dcacd | 48 | |
a9e2aefa | 49 | fOrMud[0]=fOrMud[1]=0; |
aac5be80 | 50 | Int_t i; |
51 | for (i=0; i<4; i++) { | |
a9e2aefa | 52 | for (Int_t j=0; j<32; j++) { |
53 | fXcode[i][j]=0; | |
54 | fYcode[i][j]=0; | |
55 | } | |
56 | } | |
aac5be80 | 57 | for (i=0; i<16; i++) { fXpos11[i]=0.; } |
58 | for (i=0; i<31; i++) { fYpos11[i]=0.; } | |
59 | for (i=0; i<63; i++) { fYpos21[i]=0.; } | |
a9e2aefa | 60 | } |
61 | ||
62 | //---------------------------------------------------------------------- | |
5398f946 | 63 | AliMUONTriggerCircuit::~AliMUONTriggerCircuit() |
a9e2aefa | 64 | { |
5398f946 | 65 | /// Destructor |
66 | } | |
a9e2aefa | 67 | |
68 | //---------------------------------------------------------------------- | |
69 | void AliMUONTriggerCircuit::Init(Int_t iCircuit) { | |
5398f946 | 70 | /// initialize circuit characteristics |
ecfa008b | 71 | fIdCircuit=AliMUONTriggerConstants::CircuitId(iCircuit); |
331dcacd | 72 | |
a9e2aefa | 73 | LoadX2(); |
74 | LoadXCode(); | |
75 | LoadYCode(); | |
331dcacd | 76 | |
002920d1 | 77 | LoadXPos2(); |
78 | LoadYPos2(); | |
79 | ||
a9e2aefa | 80 | } |
81 | ||
82 | //---------------------------------------------------------------------- | |
30178c30 | 83 | Int_t AliMUONTriggerCircuit::CircuitNumber(Int_t idCircuit) const { |
5398f946 | 84 | /// returns circuit number iCircuit (0-234) corresponding to circuit idCircuit |
a9e2aefa | 85 | Int_t iCircuit=0; |
86 | for (Int_t i=0; i<234; i++) { | |
aac5be80 | 87 | if (AliMUONTriggerConstants::CircuitId(i)==idCircuit) { |
a9e2aefa | 88 | iCircuit=i; |
89 | break; | |
90 | } | |
91 | } | |
92 | return iCircuit; | |
93 | } | |
94 | //---------------------------------------------------------------------- | |
30178c30 | 95 | Int_t AliMUONTriggerCircuit::ModuleNumber(Int_t idModule) const { |
5398f946 | 96 | /// returns module number imod (from 0 to 63) corresponding to module idmodule |
a9e2aefa | 97 | Int_t absidModule=TMath::Abs(idModule); |
98 | Int_t iModule=0; | |
99 | for (Int_t i=0; i<63; i++) { | |
aac5be80 | 100 | if (AliMUONTriggerConstants::ModuleId(i)==absidModule) { |
a9e2aefa | 101 | iModule=i; |
102 | break; | |
103 | } | |
104 | } | |
105 | return iModule; | |
106 | } | |
107 | ||
108 | //---------------------------------------------------------------------- | |
30178c30 | 109 | Int_t AliMUONTriggerCircuit::Module(Int_t idCircuit) const { |
5398f946 | 110 | /// returns ModuleId where Circuit idCircuit is sitting |
a9e2aefa | 111 | return Int_t(idCircuit/10); |
112 | } | |
113 | //---------------------------------------------------------------------- | |
30178c30 | 114 | Int_t AliMUONTriggerCircuit::Position(Int_t idCircuit) const { |
5398f946 | 115 | /// returns position of idCircuit in correcponding Module |
a9e2aefa | 116 | return TMath::Abs(idCircuit)-TMath::Abs(Module(idCircuit))*10; |
117 | } | |
118 | ||
119 | //---------------------------------------------------------------------- | |
120 | void AliMUONTriggerCircuit::LoadX2() { | |
5398f946 | 121 | /// initialize fX2m, fX2ud and fOrMud |
a9e2aefa | 122 | |
ecfa008b | 123 | Int_t idModule=Module(fIdCircuit); // corresponding module Id. |
aac5be80 | 124 | // and its number of X strips |
125 | Int_t nStrX=AliMUONTriggerConstants::NstripX(ModuleNumber(idModule)); | |
126 | // and its number of Y strips | |
127 | Int_t nStrY=AliMUONTriggerConstants::NstripY(ModuleNumber(idModule)); | |
ecfa008b | 128 | Int_t iPosCircuit=Position(fIdCircuit); // position of circuit in module |
a9e2aefa | 129 | |
130 | // first step : look at lower part | |
131 | if (iPosCircuit==1) { // need to scan lower module | |
132 | if(idModule<91&&TMath::Abs(idModule)!=41&&idModule>-91) { | |
133 | fOrMud[0]=1; | |
134 | Int_t idModuleD=(TMath::Abs(idModule)+10)*(TMath::Abs(idModule)/idModule); | |
aac5be80 | 135 | Int_t nStrD=AliMUONTriggerConstants::NstripY(ModuleNumber(idModuleD)); |
a9e2aefa | 136 | |
137 | if (nStrY!=nStrD | |
138 | &&TMath::Abs(idModule)!=42&&TMath::Abs(idModule)!=52) { | |
ecfa008b | 139 | if (nStrY==8) fX2m=1; |
140 | if (nStrD==8) fX2ud=1; | |
a9e2aefa | 141 | } |
142 | } | |
143 | ||
144 | } else { // lower strips within same module | |
145 | fOrMud[0]=0; | |
146 | } | |
147 | ||
148 | // second step : look at upper part | |
149 | if ((iPosCircuit==1&&nStrX==16)||(iPosCircuit==2&&nStrX==32)|| | |
150 | (iPosCircuit==3&&nStrX==48)||(iPosCircuit==4&&nStrX==64)) { | |
151 | if ((idModule>17||idModule<-17)&&TMath::Abs(idModule)!=61) { | |
152 | fOrMud[1]=1; | |
153 | Int_t idModuleU=(TMath::Abs(idModule)-10)*(TMath::Abs(idModule)/idModule); | |
aac5be80 | 154 | Int_t nStrU=AliMUONTriggerConstants::NstripY(ModuleNumber(idModuleU)); |
a9e2aefa | 155 | |
156 | if (nStrY!=nStrU | |
157 | &&TMath::Abs(idModule)!=62&&TMath::Abs(idModule)!=52) { | |
ecfa008b | 158 | if (nStrY==8) fX2m=1; |
159 | if (nStrU==8) fX2ud=1; | |
a9e2aefa | 160 | } |
161 | } | |
162 | ||
163 | } else { // upper strips within same module | |
164 | fOrMud[1]=0; | |
165 | } | |
166 | } | |
167 | ||
168 | //---------------------------------------------------------------------- | |
169 | void AliMUONTriggerCircuit::LoadXCode(){ | |
5398f946 | 170 | /// assign a Id. number to each X strip of current circuit |
171 | /// Id.=(corresponding module Id.)*100+(Id. strip of module) | |
a9e2aefa | 172 | |
173 | // first part : fill XMC11 XMC12 and strips 8 to 24 (middle) XMC21 XMC22 | |
174 | Int_t iStripCircMT1=0, iStripCircMT2=8; | |
ecfa008b | 175 | Int_t idModule=Module(fIdCircuit); // corresponding module Id. |
aac5be80 | 176 | // and its number of strips |
177 | Int_t nStrX=AliMUONTriggerConstants::NstripX(ModuleNumber(idModule)); | |
ecfa008b | 178 | Int_t iPosCircuit=Position(fIdCircuit); // position of circuit in module |
a9e2aefa | 179 | Int_t sign=TMath::Abs(idModule)/idModule; // left or right |
aac5be80 | 180 | Int_t istrip; |
a9e2aefa | 181 | |
aac5be80 | 182 | for (istrip=(iPosCircuit-1)*16; |
a9e2aefa | 183 | istrip<(iPosCircuit-1)*16+16; istrip++) { |
184 | ||
185 | fXcode[0][iStripCircMT1]=sign*(TMath::Abs(idModule)*100+istrip); | |
186 | fXcode[1][iStripCircMT1]=sign*(TMath::Abs(idModule)*100+istrip); | |
187 | fXcode[2][iStripCircMT2]=sign*(TMath::Abs(idModule)*100+istrip); | |
188 | fXcode[3][iStripCircMT2]=sign*(TMath::Abs(idModule)*100+istrip); | |
189 | iStripCircMT1++; | |
190 | iStripCircMT2++; | |
191 | } | |
192 | ||
193 | // second part | |
194 | // XMC21 XMC22 strips 0 to 7 and 24 to 31 | |
195 | Int_t idModuleD, idModuleU; | |
196 | Int_t nStrD, nStrU; | |
197 | ||
ecfa008b | 198 | idModule=Module(fIdCircuit); // corresponding module Id. |
aac5be80 | 199 | // number of X strips |
200 | nStrX=AliMUONTriggerConstants::NstripX(ModuleNumber(idModule)); | |
a9e2aefa | 201 | sign=TMath::Abs(idModule)/idModule; |
202 | ||
203 | // fill lower part (0 to 7) | |
204 | if (iPosCircuit==1) { // need to scan lower module | |
205 | if(idModule<91&&TMath::Abs(idModule)!=41&&idModule>-91) { // non-existing | |
206 | idModuleD=sign*(TMath::Abs(idModule)+10); // lower module Id | |
aac5be80 | 207 | // and its number of strips |
208 | nStrD=AliMUONTriggerConstants::NstripX(ModuleNumber(idModuleD)); | |
a9e2aefa | 209 | |
210 | iStripCircMT2=0; | |
aac5be80 | 211 | for (istrip=nStrD-8; istrip<nStrD; istrip++) { |
a9e2aefa | 212 | fXcode[2][iStripCircMT2]=sign*(TMath::Abs(idModuleD)*100+istrip); |
213 | fXcode[3][iStripCircMT2]=sign*(TMath::Abs(idModuleD)*100+istrip); | |
214 | iStripCircMT2++; | |
215 | } | |
216 | } | |
217 | ||
218 | } else { // lower strips within same module | |
219 | ||
220 | iStripCircMT2=0; | |
aac5be80 | 221 | for (istrip=(iPosCircuit-1)*16-8; |
a9e2aefa | 222 | istrip<(iPosCircuit-1)*16; istrip++) { |
223 | fXcode[2][iStripCircMT2]=sign*(TMath::Abs(idModule)*100+istrip); | |
224 | fXcode[3][iStripCircMT2]=sign*(TMath::Abs(idModule)*100+istrip); | |
225 | iStripCircMT2++; | |
226 | } | |
227 | } | |
228 | ||
229 | // fill upper part (24 to 31) | |
230 | if ((iPosCircuit==1&&nStrX==16)||(iPosCircuit==2&&nStrX==32)|| | |
231 | (iPosCircuit==3&&nStrX==48)||(iPosCircuit==4&&nStrX==64)) { | |
232 | if ((idModule>17||idModule<-17)&&TMath::Abs(idModule)!=61) { | |
233 | idModuleU=sign*(TMath::Abs(idModule)-10); // upper module Id | |
aac5be80 | 234 | // and its number of strips |
235 | nStrU=AliMUONTriggerConstants::NstripX(ModuleNumber(idModuleU)); | |
a9e2aefa | 236 | |
237 | iStripCircMT2=24; | |
aac5be80 | 238 | for (istrip=0; istrip<8; istrip++) { |
a9e2aefa | 239 | fXcode[2][iStripCircMT2]=sign*(TMath::Abs(idModuleU)*100+istrip); |
240 | fXcode[3][iStripCircMT2]=sign*(TMath::Abs(idModuleU)*100+istrip); | |
241 | iStripCircMT2++; | |
242 | } | |
243 | } | |
244 | ||
245 | } else if ((iPosCircuit==1&&nStrX>16)||(iPosCircuit==2&&nStrX>32)|| | |
246 | (iPosCircuit==3&&nStrX>48)) { // upper strips within same mod. | |
247 | ||
248 | iStripCircMT2=24; | |
aac5be80 | 249 | for (istrip=(iPosCircuit-1)*16+16; |
a9e2aefa | 250 | istrip<(iPosCircuit-1)*16+24; istrip++) { |
251 | fXcode[2][iStripCircMT2]=sign*(TMath::Abs(idModule)*100+istrip); | |
252 | fXcode[3][iStripCircMT2]=sign*(TMath::Abs(idModule)*100+istrip); | |
253 | iStripCircMT2++; | |
254 | } | |
255 | } | |
256 | } | |
257 | ||
258 | //---------------------------------------------------------------------- | |
259 | void AliMUONTriggerCircuit::LoadYCode(){ | |
5398f946 | 260 | /// assign a Id. number to each Y strip of current circuit |
261 | /// Id.=(corresponding module Id.)*100+(Id. strip of module) | |
262 | /// note : for Y plane fill only "central part" of circuit | |
263 | /// (upper and lower parts are filled in PreHandlingY of AliMUONTriggerDecision) | |
a9e2aefa | 264 | |
ecfa008b | 265 | Int_t idModule=Module(fIdCircuit); // corresponding module Id. |
aac5be80 | 266 | // and its number of Y strips |
267 | Int_t nStrY=AliMUONTriggerConstants::NstripY(ModuleNumber(idModule)); | |
a9e2aefa | 268 | Int_t sign=TMath::Abs(idModule)/idModule; // left or right |
269 | ||
270 | for (Int_t istrip=0; istrip<nStrY; istrip++) { | |
271 | fYcode[0][istrip]=sign*(TMath::Abs(idModule)*100+istrip); | |
272 | fYcode[1][istrip]=sign*(TMath::Abs(idModule)*100+istrip); | |
273 | fYcode[2][istrip]=sign*(TMath::Abs(idModule)*100+istrip); | |
274 | fYcode[3][istrip]=sign*(TMath::Abs(idModule)*100+istrip); | |
275 | } | |
276 | } | |
277 | ||
a9e2aefa | 278 | //---------------------------------------------------------------------- |
279 | Float_t AliMUONTriggerCircuit::PtCal(Int_t istripX, Int_t idev, Int_t istripY){ | |
5398f946 | 280 | /// returns calculated pt for circuit/istripX/idev/istripY according |
281 | /// to the formula of the TRD. Note : idev (input) is in [0+30] | |
a9e2aefa | 282 | |
283 | // Int_t jdev = idev - 15; // jdev in [-15+15] | |
284 | Int_t istripX2=istripX+idev+1; // find istripX2 using istripX and idev | |
285 | ||
286 | Float_t yPosX1=fYpos11[istripX]; | |
287 | Float_t yPosX2=fYpos21[istripX2]; | |
288 | Float_t xPosY1=fXpos11[istripY]; | |
289 | ||
3f434b6f | 290 | Float_t zf=975.; |
291 | Float_t z1=AliMUONConstants::DefaultChamberZ(10); | |
292 | Float_t z2=AliMUONConstants::DefaultChamberZ(12); | |
a9e2aefa | 293 | Float_t thetaDev=(1./zf)*(yPosX1*z2-yPosX2*z1)/(z2-z1); |
294 | Float_t xf=xPosY1*zf/z1; | |
295 | Float_t yf=yPosX2-((yPosX2-yPosX1)*(z2-zf))/(z2-z1); | |
296 | return (3.*0.3/TMath::Abs(thetaDev)) * TMath::Sqrt(xf*xf+yf*yf)/zf; | |
297 | } | |
331dcacd | 298 | //--------------------------------------------------------------------- |
299 | //----------------------- New Segmentation ---------------------------- | |
300 | //--------------------------------------------------------------------- | |
301 | ||
302 | //--------------------------------------------------------------------- | |
303 | void AliMUONTriggerCircuit::LoadYPos2(){ | |
5398f946 | 304 | /// fill fYpos11 and fYpos21 -> y position of X declusterized strips |
331dcacd | 305 | |
306 | Int_t chamber, cathode; | |
307 | Int_t code, idModule, idStrip, idSector; | |
308 | Float_t x, y, z, width; | |
309 | Int_t istrip, idDE; | |
310 | ||
311 | AliMUON *pMUON = (AliMUON*)gAlice->GetModule("MUON"); | |
331dcacd | 312 | AliMUONGeometrySegmentation* segmentation; |
3bf95daf | 313 | |
331dcacd | 314 | // first plane (11) |
315 | chamber=11; | |
316 | cathode=1; | |
b7ef3c96 | 317 | segmentation |
318 | = pMUON->GetSegmentation()->GetModuleSegmentation(chamber-1, cathode-1); | |
331dcacd | 319 | |
3bf95daf | 320 | if (!segmentation) { |
321 | AliWarning("Segmentation not defined."); | |
322 | return; | |
323 | } | |
324 | ||
331dcacd | 325 | for (istrip=0; istrip<16; istrip++) { |
326 | code=fXcode[0][istrip]; // decode current strip | |
327 | idModule=Int_t(code/100); // corresponding module Id. | |
328 | idDE = DetElemId(chamber, idModule); | |
329 | idStrip=TMath::Abs(code-idModule*100); // corresp. strip number in module | |
330 | idSector=segmentation->Sector(idDE, idModule, idStrip); // corresponding sector | |
331 | width=segmentation->Dpy(idDE, idSector); // corresponding strip width | |
332 | segmentation->GetPadC(idDE, idModule,idStrip,x,y,z); // get strip real position | |
333 | ||
334 | fYpos11[2*istrip]=y; | |
335 | if (istrip!=15) fYpos11[2*istrip+1]=y+width/2.; | |
336 | } | |
337 | ||
338 | // second plane (21) | |
339 | chamber=13; | |
340 | cathode=1; | |
b7ef3c96 | 341 | segmentation |
342 | = pMUON->GetSegmentation()->GetModuleSegmentation(chamber-1, cathode-1); | |
331dcacd | 343 | |
344 | for (istrip=0; istrip<32; istrip++) { | |
345 | code=fXcode[2][istrip]; // decode current strip | |
346 | idModule=Int_t(code/100); // corresponding module Id. | |
347 | idDE = DetElemId(chamber, idModule); | |
348 | if (idModule == 0) continue; | |
349 | idStrip=TMath::Abs(code-idModule*100); // corresp. strip number in module | |
350 | idSector=segmentation->Sector(idDE, idModule, idStrip); // corresponding sector | |
351 | width=segmentation->Dpy(idDE, idSector); // corresponding strip width | |
352 | segmentation->GetPadC(idDE, idModule,idStrip,x,y,z); // get strip real position | |
353 | ||
354 | // using idModule!=0 prevents to fill garbage in case of circuits | |
355 | // in the first and last rows | |
356 | if (idModule!=0) { | |
357 | fYpos21[2*istrip]=y; | |
358 | if (istrip!=31) fYpos21[2*istrip+1]=y+width/2.; | |
359 | } | |
360 | } | |
361 | } | |
362 | ||
363 | //---------------------------------------------------------------------- | |
364 | void AliMUONTriggerCircuit::LoadXPos2(){ | |
5398f946 | 365 | /// fill fXpos11 -> x position of Y strips for the first plane only |
366 | /// fXpos11 contains the x position of Y strip for the current circuit | |
367 | /// taking into account whether or nor not part(s) of the circuit | |
368 | /// (middle, up or down) has(have) 16 strips | |
331dcacd | 369 | |
370 | Float_t x, y, z; | |
371 | Int_t istrip, idDE; | |
372 | ||
373 | Int_t chamber=11; | |
374 | Int_t cathode=2; | |
375 | AliMUON *pMUON = (AliMUON*)gAlice->GetModule("MUON"); | |
331dcacd | 376 | AliMUONGeometrySegmentation* segmentation; |
b7ef3c96 | 377 | segmentation |
378 | = pMUON->GetSegmentation()->GetModuleSegmentation(chamber-1, cathode-1); | |
738ce30b | 379 | |
3bf95daf | 380 | if (!segmentation) { |
381 | AliWarning("Segmentation not defined."); | |
382 | return; | |
383 | } | |
384 | ||
331dcacd | 385 | Int_t idModule=Module(fIdCircuit); // corresponding module Id. |
386 | // number of Y strips | |
387 | idDE = DetElemId(chamber, idModule); | |
73d1b3cd | 388 | |
331dcacd | 389 | Int_t nStrY=AliMUONTriggerConstants::NstripY(ModuleNumber(idModule)); |
390 | Int_t idSector=segmentation->Sector(idDE, idModule,0); // corresp. sector | |
391 | Float_t width=segmentation->Dpx(idDE, idSector); // corresponding strip width | |
d1525c79 | 392 | |
331dcacd | 393 | // first case : up middle and down parts have all 8 or 16 strip |
394 | if ((nStrY==16)||(nStrY==8&&fX2m==0&&fX2ud==0)) { | |
395 | for (istrip=0; istrip<nStrY; istrip++) { | |
396 | segmentation->GetPadC(idDE, idModule,istrip,x,y,z); | |
738ce30b | 397 | AliDebug(1,Form("idDE %d idModule %d istrip %d x,y,z=%e,%e,%e\n", |
398 | idDE,idModule,istrip,x,y,z)); | |
331dcacd | 399 | fXpos11[istrip]=x; |
400 | } | |
401 | // second case : mixing 8 and 16 strips within same circuit | |
402 | } else { | |
403 | for (istrip=0; istrip<nStrY; istrip++) { | |
404 | if (nStrY!=8) { printf(" bug in LoadXpos \n");} | |
405 | segmentation->GetPadC(idDE, idModule, istrip, x, y, z); | |
406 | fXpos11[2*istrip]=x-width/4.; | |
407 | fXpos11[2*istrip+1]=fXpos11[2*istrip]+width/2.; | |
408 | } | |
409 | } | |
410 | } | |
a9e2aefa | 411 | |
412 | //---------------------------------------------------------------------- | |
413 | //--- methods which return member data related info | |
414 | //---------------------------------------------------------------------- | |
30178c30 | 415 | Int_t AliMUONTriggerCircuit::GetIdCircuit() const { |
5398f946 | 416 | /// returns circuit Id |
ecfa008b | 417 | return fIdCircuit; |
a9e2aefa | 418 | } |
419 | //---------------------------------------------------------------------- | |
30178c30 | 420 | Int_t AliMUONTriggerCircuit::GetIdModule() const { |
5398f946 | 421 | /// returns module Id |
ecfa008b | 422 | return Module(fIdCircuit); |
a9e2aefa | 423 | } |
424 | //---------------------------------------------------------------------- | |
30178c30 | 425 | Int_t AliMUONTriggerCircuit::GetNstripX() const { |
5398f946 | 426 | /// returns the number of X strips in the module where the circuit is sitting |
ecfa008b | 427 | return AliMUONTriggerConstants::NstripX(ModuleNumber(Module(fIdCircuit))); |
a9e2aefa | 428 | } |
429 | //---------------------------------------------------------------------- | |
30178c30 | 430 | Int_t AliMUONTriggerCircuit::GetNstripY() const { |
5398f946 | 431 | /// returns the number of Y strips in the module where the circuit is sitting |
ecfa008b | 432 | return AliMUONTriggerConstants::NstripY(ModuleNumber(Module(fIdCircuit))); |
a9e2aefa | 433 | } |
434 | //---------------------------------------------------------------------- | |
30178c30 | 435 | Int_t AliMUONTriggerCircuit::GetPosCircuit() const { |
5398f946 | 436 | /// returns the position of the circuit in its module |
ecfa008b | 437 | return Position(fIdCircuit); |
a9e2aefa | 438 | } |
439 | //---------------------------------------------------------------------- | |
30178c30 | 440 | Int_t AliMUONTriggerCircuit::GetIdCircuitD() const { |
5398f946 | 441 | /// returns the Id of the circuit down |
ecfa008b | 442 | Int_t idModule=Module(fIdCircuit); |
a9e2aefa | 443 | Int_t idModuleD=(TMath::Abs(idModule)+10)*(TMath::Abs(idModule)/idModule); |
444 | return (TMath::Abs(idModuleD)*10+1)*(TMath::Abs(idModule)/idModule); | |
445 | } | |
446 | //---------------------------------------------------------------------- | |
30178c30 | 447 | Int_t AliMUONTriggerCircuit::GetICircuitD() const { |
5398f946 | 448 | /// returns the number of the circuit down |
ecfa008b | 449 | Int_t idModule=Module(fIdCircuit); |
a9e2aefa | 450 | Int_t idModuleD=(TMath::Abs(idModule)+10)*(TMath::Abs(idModule)/idModule); |
451 | Int_t idCircuitD= | |
452 | (TMath::Abs(idModuleD)*10+1)*(TMath::Abs(idModule)/idModule); | |
453 | return CircuitNumber(idCircuitD); | |
454 | } | |
455 | //---------------------------------------------------------------------- | |
30178c30 | 456 | Int_t AliMUONTriggerCircuit::GetIdCircuitU() const { |
5398f946 | 457 | /// returns the Id of the circuit up |
ecfa008b | 458 | Int_t idModule=Module(fIdCircuit); |
a9e2aefa | 459 | Int_t idModuleU=(TMath::Abs(idModule)-10)*(TMath::Abs(idModule)/idModule); |
460 | return (TMath::Abs(idModuleU)*10+1)*(TMath::Abs(idModule)/idModule); | |
461 | } | |
462 | //---------------------------------------------------------------------- | |
30178c30 | 463 | Int_t AliMUONTriggerCircuit::GetICircuitU() const { |
5398f946 | 464 | /// returns the number of the circuit up |
ecfa008b | 465 | Int_t idModule=Module(fIdCircuit); |
a9e2aefa | 466 | Int_t idModuleU=(TMath::Abs(idModule)-10)*(TMath::Abs(idModule)/idModule); |
467 | Int_t idCircuitU= | |
468 | (TMath::Abs(idModuleU)*10+1)*(TMath::Abs(idModule)/idModule); | |
469 | return CircuitNumber(idCircuitU); | |
470 | } | |
471 | //---------------------------------------------------------------------- | |
30178c30 | 472 | Int_t AliMUONTriggerCircuit::GetX2m() const { |
5398f946 | 473 | /// returns fX2m |
ecfa008b | 474 | return fX2m; |
a9e2aefa | 475 | } |
476 | //---------------------------------------------------------------------- | |
30178c30 | 477 | Int_t AliMUONTriggerCircuit::GetX2ud() const { |
5398f946 | 478 | /// returns fX2ud |
ecfa008b | 479 | return fX2ud; |
a9e2aefa | 480 | } |
481 | //---------------------------------------------------------------------- | |
30178c30 | 482 | void AliMUONTriggerCircuit::GetOrMud(Int_t orMud[2]) const { |
5398f946 | 483 | /// returns fOrMud |
a9e2aefa | 484 | orMud[0]=fOrMud[0]; |
485 | orMud[1]=fOrMud[1]; | |
486 | } | |
487 | //---------------------------------------------------------------------- | |
30178c30 | 488 | Int_t AliMUONTriggerCircuit::GetXcode(Int_t chamber, Int_t istrip) const { |
5398f946 | 489 | /// returns X code of circuit/chamber/istrip (warning : chamber in [0,3]) |
a9e2aefa | 490 | return fXcode[chamber][istrip]; |
491 | } | |
492 | //---------------------------------------------------------------------- | |
30178c30 | 493 | Int_t AliMUONTriggerCircuit::GetYcode(Int_t chamber, Int_t istrip) const { |
5398f946 | 494 | /// returns Y code of circuit/chamber/istrip (warning : chamber in [0,3]) |
a9e2aefa | 495 | return fYcode[chamber][istrip]; |
496 | } | |
497 | //---------------------------------------------------------------------- | |
30178c30 | 498 | Float_t AliMUONTriggerCircuit::GetY11Pos(Int_t istrip) const { |
5398f946 | 499 | /// returns Y position of X strip istrip in MC11 |
a9e2aefa | 500 | return fYpos11[istrip]; |
501 | } | |
502 | //---------------------------------------------------------------------- | |
30178c30 | 503 | Float_t AliMUONTriggerCircuit::GetY21Pos(Int_t istrip) const { |
5398f946 | 504 | /// returns Y position of X strip istrip in MC21 |
a9e2aefa | 505 | return fYpos21[istrip]; |
506 | } | |
507 | //---------------------------------------------------------------------- | |
30178c30 | 508 | Float_t AliMUONTriggerCircuit::GetX11Pos(Int_t istrip) const { |
a9e2aefa | 509 | // returns X position of Y strip istrip in MC11 |
510 | return fXpos11[istrip]; | |
511 | } | |
512 | //---------------------------------------------------------------------- | |
513 | //--- end of methods which return member data related info | |
514 | //---------------------------------------------------------------------- | |
515 | ||
738ce30b | 516 | void dump(const char* what, const Float_t* array, Int_t size) |
517 | { | |
518 | cout << what << " " << endl; | |
519 | for ( Int_t i = 0; i < size; ++i ) | |
520 | { | |
521 | cout << array[i] << " , "; | |
522 | } | |
523 | cout << endl; | |
524 | } | |
525 | ||
526 | void dump(const char* what, const Int_t* array, Int_t size) | |
527 | { | |
528 | cout << what << " " << endl; | |
529 | for ( Int_t i = 0; i < size; ++i ) | |
530 | { | |
531 | cout << array[i] << " , "; | |
532 | } | |
533 | cout << endl; | |
534 | } | |
535 | ||
536 | //_____________________________________________________________________________ | |
537 | void | |
538 | AliMUONTriggerCircuit::Print(Option_t* ) const | |
539 | { | |
5398f946 | 540 | /// prints-out data member |
738ce30b | 541 | cout << "IdCircuit " << fIdCircuit << " X2m,X2ud=" << fX2m << "," |
542 | << fX2ud; | |
543 | for ( Int_t i = 0; i < 2; ++i ) | |
544 | { | |
545 | cout << " OrMud[" << i << "]=" << fOrMud[i]; | |
546 | } | |
547 | cout << endl; | |
548 | dump("Xpos11",fXpos11,16); | |
549 | dump("Ypos11",fYpos11,31); | |
550 | dump("Ypos21",fYpos21,63); | |
551 | for ( Int_t i = 0; i < 4; ++i ) | |
552 | { | |
553 | char s[80]; | |
554 | sprintf(s,"Xcode[%d]",i); | |
555 | dump(s,fXcode[i],32); | |
556 | sprintf(s,"Ycode[%d]",i); | |
557 | dump(s,fYcode[i],32); | |
558 | } | |
5398f946 | 559 | // Int_t fIdCircuit; // circuit Id number |
738ce30b | 560 | // Int_t fX2m; // internal info needed by TriggerDecision |
561 | // Int_t fX2ud; // internal info needed by TriggerDecision | |
562 | // Int_t fOrMud[2]; // internal info needed by TriggerDecision | |
563 | // Int_t fXcode[4][32]; // code of X strips | |
564 | // Int_t fYcode[4][32]; // code of Y strips | |
565 | // Float_t fXpos11[16]; // X position of Y strips in MC11 | |
566 | // Float_t fYpos11[31]; // Y position of X strips in MC11 | |
567 | // Float_t fYpos21[63]; // Y position of X strips in MC21 | |
568 | ||
569 | } | |
a9e2aefa | 570 | |
331dcacd | 571 | Int_t AliMUONTriggerCircuit::DetElemId(Int_t ichamber, Int_t idModule) |
572 | { | |
5398f946 | 573 | /// adpated to official numbering (09/20/05) |
574 | /// returns the detection element Id for given chamber and module | |
575 | /// ichamber (from 11 to 14), idModule (from -97 to 97) | |
65bcb249 | 576 | // |
577 | Int_t itmp=0; | |
578 | Int_t linenumber=Int_t(idModule/10); | |
579 | switch (linenumber) // (from 1 to 9, from top to bottom) | |
580 | { | |
581 | case 1: | |
582 | itmp = 4; | |
583 | break; | |
584 | case 2: | |
585 | itmp = 3; | |
586 | break; | |
587 | case 3: | |
588 | itmp = 2; | |
589 | break; | |
590 | case 4: | |
591 | itmp = 1; | |
592 | break; | |
593 | case 5: | |
594 | itmp = 0; | |
595 | break; | |
596 | case 6: | |
597 | itmp = 17; | |
598 | break; | |
599 | case 7: | |
600 | itmp = 16; | |
601 | break; | |
602 | case 8: | |
603 | itmp = 15; | |
604 | break; | |
605 | case 9: | |
606 | itmp = 14; | |
607 | break; | |
608 | // left | |
609 | case -1: | |
610 | itmp = 5; | |
611 | break; | |
612 | case -2: | |
613 | itmp = 6; | |
614 | break; | |
615 | case -3: | |
616 | itmp = 7; | |
617 | break; | |
618 | case -4: | |
619 | itmp = 8; | |
620 | break; | |
621 | case -5: | |
622 | itmp = 9; | |
623 | break; | |
624 | case -6: | |
625 | itmp = 10; | |
626 | break; | |
627 | case -7: | |
628 | itmp = 11; | |
629 | break; | |
630 | case -8: | |
631 | itmp = 12; | |
632 | break; | |
633 | case -9: | |
634 | itmp = 13; | |
635 | break; | |
636 | } | |
637 | return (ichamber*100)+itmp; | |
331dcacd | 638 | } |
a9e2aefa | 639 | |
640 | ||
641 | ||
642 |