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