]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/AliMUONTriggerCircuit.cxx
Revived the geometry that Alla did orginally. The code is in the classes
[u/mrichter/AliRoot.git] / MUON / AliMUONTriggerCircuit.cxx
CommitLineData
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"
a9e2aefa 25#include "AliMUONChamber.h"
3f434b6f 26#include "AliMUONConstants.h"
8c343c7c 27#include "AliLog.h"
a9e2aefa 28
29ClassImp(AliMUONTriggerCircuit)
30
a9e2aefa 31//----------------------------------------------------------------------
30178c30 32AliMUONTriggerCircuit::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 54AliMUONTriggerCircuit::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 63AliMUONTriggerCircuit &
64AliMUONTriggerCircuit::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//----------------------------------------------------------------------
76void 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 90Int_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 102Int_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 116Int_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 121Int_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//----------------------------------------------------------------------
127void 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//----------------------------------------------------------------------
176void 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//----------------------------------------------------------------------
266void 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//----------------------------------------------------------------------
286Float_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//---------------------------------------------------------------------
310void 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");
319 AliMUONChamber* iChamber;
320 AliMUONGeometrySegmentation* segmentation;
3bf95daf 321
331dcacd 322// first plane (11)
323 chamber=11;
324 cathode=1;
325 iChamber = &(pMUON->Chamber(chamber-1));
326 segmentation=iChamber->SegmentationModel2(cathode);
327
3bf95daf 328 if (!segmentation) {
329 AliWarning("Segmentation not defined.");
330 return;
331 }
332
331dcacd 333 for (istrip=0; istrip<16; istrip++) {
334 code=fXcode[0][istrip]; // decode current strip
335 idModule=Int_t(code/100); // corresponding module Id.
336 idDE = DetElemId(chamber, idModule);
337 idStrip=TMath::Abs(code-idModule*100); // corresp. strip number in module
338 idSector=segmentation->Sector(idDE, idModule, idStrip); // corresponding sector
339 width=segmentation->Dpy(idDE, idSector); // corresponding strip width
340 segmentation->GetPadC(idDE, idModule,idStrip,x,y,z); // get strip real position
341
342 fYpos11[2*istrip]=y;
343 if (istrip!=15) fYpos11[2*istrip+1]=y+width/2.;
344 }
345
346// second plane (21)
347 chamber=13;
348 cathode=1;
349 iChamber = &(pMUON->Chamber(chamber-1));
350 segmentation=iChamber->SegmentationModel2(cathode);
351
352 for (istrip=0; istrip<32; istrip++) {
353 code=fXcode[2][istrip]; // decode current strip
354 idModule=Int_t(code/100); // corresponding module Id.
355 idDE = DetElemId(chamber, idModule);
356 if (idModule == 0) continue;
357 idStrip=TMath::Abs(code-idModule*100); // corresp. strip number in module
358 idSector=segmentation->Sector(idDE, idModule, idStrip); // corresponding sector
359 width=segmentation->Dpy(idDE, idSector); // corresponding strip width
360 segmentation->GetPadC(idDE, idModule,idStrip,x,y,z); // get strip real position
361
362// using idModule!=0 prevents to fill garbage in case of circuits
363// in the first and last rows
364 if (idModule!=0) {
365 fYpos21[2*istrip]=y;
366 if (istrip!=31) fYpos21[2*istrip+1]=y+width/2.;
367 }
368 }
369}
370
371//----------------------------------------------------------------------
372void AliMUONTriggerCircuit::LoadXPos2(){
373// fill fXpos11 -> x position of Y strips for the first plane only
374// fXpos11 contains the x position of Y strip for the current circuit
375// taking into account whether or nor not part(s) of the circuit
376// (middle, up or down) has(have) 16 strips
377
378 Float_t x, y, z;
379 Int_t istrip, idDE;
380
381 Int_t chamber=11;
382 Int_t cathode=2;
383 AliMUON *pMUON = (AliMUON*)gAlice->GetModule("MUON");
384 AliMUONChamber* iChamber;
385 AliMUONGeometrySegmentation* segmentation;
386 iChamber = &(pMUON->Chamber(chamber-1));
387 segmentation=iChamber->SegmentationModel2(cathode);
738ce30b 388
3bf95daf 389 if (!segmentation) {
390 AliWarning("Segmentation not defined.");
391 return;
392 }
393
331dcacd 394 Int_t idModule=Module(fIdCircuit); // corresponding module Id.
395// number of Y strips
396 idDE = DetElemId(chamber, idModule);
73d1b3cd 397
331dcacd 398 Int_t nStrY=AliMUONTriggerConstants::NstripY(ModuleNumber(idModule));
399 Int_t idSector=segmentation->Sector(idDE, idModule,0); // corresp. sector
400 Float_t width=segmentation->Dpx(idDE, idSector); // corresponding strip width
401
402// first case : up middle and down parts have all 8 or 16 strip
403 if ((nStrY==16)||(nStrY==8&&fX2m==0&&fX2ud==0)) {
404 for (istrip=0; istrip<nStrY; istrip++) {
405 segmentation->GetPadC(idDE, idModule,istrip,x,y,z);
738ce30b 406 AliDebug(1,Form("idDE %d idModule %d istrip %d x,y,z=%e,%e,%e\n",
407 idDE,idModule,istrip,x,y,z));
331dcacd 408 fXpos11[istrip]=x;
409 }
410// second case : mixing 8 and 16 strips within same circuit
411 } else {
412 for (istrip=0; istrip<nStrY; istrip++) {
413 if (nStrY!=8) { printf(" bug in LoadXpos \n");}
414 segmentation->GetPadC(idDE, idModule, istrip, x, y, z);
415 fXpos11[2*istrip]=x-width/4.;
416 fXpos11[2*istrip+1]=fXpos11[2*istrip]+width/2.;
417 }
418 }
419}
a9e2aefa 420
421//----------------------------------------------------------------------
422//--- methods which return member data related info
423//----------------------------------------------------------------------
30178c30 424Int_t AliMUONTriggerCircuit::GetIdCircuit() const {
a9e2aefa 425// returns circuit Id
ecfa008b 426 return fIdCircuit;
a9e2aefa 427}
428//----------------------------------------------------------------------
30178c30 429Int_t AliMUONTriggerCircuit::GetIdModule() const {
a9e2aefa 430// returns module Id
ecfa008b 431 return Module(fIdCircuit);
a9e2aefa 432}
433//----------------------------------------------------------------------
30178c30 434Int_t AliMUONTriggerCircuit::GetNstripX() const {
a9e2aefa 435// returns the number of X strips in the module where the circuit is sitting
ecfa008b 436 return AliMUONTriggerConstants::NstripX(ModuleNumber(Module(fIdCircuit)));
a9e2aefa 437}
438//----------------------------------------------------------------------
30178c30 439Int_t AliMUONTriggerCircuit::GetNstripY() const {
a9e2aefa 440// returns the number of Y strips in the module where the circuit is sitting
ecfa008b 441 return AliMUONTriggerConstants::NstripY(ModuleNumber(Module(fIdCircuit)));
a9e2aefa 442}
443//----------------------------------------------------------------------
30178c30 444Int_t AliMUONTriggerCircuit::GetPosCircuit() const {
a9e2aefa 445// returns the position of the circuit in its module
ecfa008b 446 return Position(fIdCircuit);
a9e2aefa 447}
448//----------------------------------------------------------------------
30178c30 449Int_t AliMUONTriggerCircuit::GetIdCircuitD() const {
a9e2aefa 450// returns the Id of the circuit down
ecfa008b 451 Int_t idModule=Module(fIdCircuit);
a9e2aefa 452 Int_t idModuleD=(TMath::Abs(idModule)+10)*(TMath::Abs(idModule)/idModule);
453 return (TMath::Abs(idModuleD)*10+1)*(TMath::Abs(idModule)/idModule);
454}
455//----------------------------------------------------------------------
30178c30 456Int_t AliMUONTriggerCircuit::GetICircuitD() const {
a9e2aefa 457// returns the number of the circuit down
ecfa008b 458 Int_t idModule=Module(fIdCircuit);
a9e2aefa 459 Int_t idModuleD=(TMath::Abs(idModule)+10)*(TMath::Abs(idModule)/idModule);
460 Int_t idCircuitD=
461 (TMath::Abs(idModuleD)*10+1)*(TMath::Abs(idModule)/idModule);
462 return CircuitNumber(idCircuitD);
463}
464//----------------------------------------------------------------------
30178c30 465Int_t AliMUONTriggerCircuit::GetIdCircuitU() const {
a9e2aefa 466// returns the Id of the circuit up
ecfa008b 467 Int_t idModule=Module(fIdCircuit);
a9e2aefa 468 Int_t idModuleU=(TMath::Abs(idModule)-10)*(TMath::Abs(idModule)/idModule);
469 return (TMath::Abs(idModuleU)*10+1)*(TMath::Abs(idModule)/idModule);
470}
471//----------------------------------------------------------------------
30178c30 472Int_t AliMUONTriggerCircuit::GetICircuitU() const {
a9e2aefa 473// returns the number of the circuit up
ecfa008b 474 Int_t idModule=Module(fIdCircuit);
a9e2aefa 475 Int_t idModuleU=(TMath::Abs(idModule)-10)*(TMath::Abs(idModule)/idModule);
476 Int_t idCircuitU=
477 (TMath::Abs(idModuleU)*10+1)*(TMath::Abs(idModule)/idModule);
478 return CircuitNumber(idCircuitU);
479}
480//----------------------------------------------------------------------
30178c30 481Int_t AliMUONTriggerCircuit::GetX2m() const {
ecfa008b 482// returns fX2m
483 return fX2m;
a9e2aefa 484}
485//----------------------------------------------------------------------
30178c30 486Int_t AliMUONTriggerCircuit::GetX2ud() const {
ecfa008b 487// returns fX2ud
488 return fX2ud;
a9e2aefa 489}
490//----------------------------------------------------------------------
30178c30 491void AliMUONTriggerCircuit::GetOrMud(Int_t orMud[2]) const {
a9e2aefa 492// returns fOrMud
493 orMud[0]=fOrMud[0];
494 orMud[1]=fOrMud[1];
495}
496//----------------------------------------------------------------------
30178c30 497Int_t AliMUONTriggerCircuit::GetXcode(Int_t chamber, Int_t istrip) const {
a9e2aefa 498// returns X code of circuit/chamber/istrip (warning : chamber in [0,3])
499 return fXcode[chamber][istrip];
500}
501//----------------------------------------------------------------------
30178c30 502Int_t AliMUONTriggerCircuit::GetYcode(Int_t chamber, Int_t istrip) const {
a9e2aefa 503// returns Y code of circuit/chamber/istrip (warning : chamber in [0,3])
504 return fYcode[chamber][istrip];
505}
506//----------------------------------------------------------------------
30178c30 507Float_t AliMUONTriggerCircuit::GetY11Pos(Int_t istrip) const {
a9e2aefa 508// returns Y position of X strip istrip in MC11
509 return fYpos11[istrip];
510}
511//----------------------------------------------------------------------
30178c30 512Float_t AliMUONTriggerCircuit::GetY21Pos(Int_t istrip) const {
a9e2aefa 513// returns Y position of X strip istrip in MC21
514 return fYpos21[istrip];
515}
516//----------------------------------------------------------------------
30178c30 517Float_t AliMUONTriggerCircuit::GetX11Pos(Int_t istrip) const {
a9e2aefa 518// returns X position of Y strip istrip in MC11
519 return fXpos11[istrip];
520}
521//----------------------------------------------------------------------
522//--- end of methods which return member data related info
523//----------------------------------------------------------------------
524
738ce30b 525void dump(const char* what, const Float_t* array, Int_t size)
526{
527 cout << what << " " << endl;
528 for ( Int_t i = 0; i < size; ++i )
529 {
530 cout << array[i] << " , ";
531 }
532 cout << endl;
533}
534
535void dump(const char* what, const Int_t* array, Int_t size)
536{
537 cout << what << " " << endl;
538 for ( Int_t i = 0; i < size; ++i )
539 {
540 cout << array[i] << " , ";
541 }
542 cout << endl;
543}
544
545//_____________________________________________________________________________
546void
547AliMUONTriggerCircuit::Print(Option_t* ) const
548{
549 cout << "IdCircuit " << fIdCircuit << " X2m,X2ud=" << fX2m << ","
550 << fX2ud;
551 for ( Int_t i = 0; i < 2; ++i )
552 {
553 cout << " OrMud[" << i << "]=" << fOrMud[i];
554 }
555 cout << endl;
556 dump("Xpos11",fXpos11,16);
557 dump("Ypos11",fYpos11,31);
558 dump("Ypos21",fYpos21,63);
559 for ( Int_t i = 0; i < 4; ++i )
560 {
561 char s[80];
562 sprintf(s,"Xcode[%d]",i);
563 dump(s,fXcode[i],32);
564 sprintf(s,"Ycode[%d]",i);
565 dump(s,fYcode[i],32);
566 }
567 // Int_t fIdCircuit; // circuit Id number
568// Int_t fX2m; // internal info needed by TriggerDecision
569// Int_t fX2ud; // internal info needed by TriggerDecision
570// Int_t fOrMud[2]; // internal info needed by TriggerDecision
571// Int_t fXcode[4][32]; // code of X strips
572// Int_t fYcode[4][32]; // code of Y strips
573// Float_t fXpos11[16]; // X position of Y strips in MC11
574// Float_t fYpos11[31]; // Y position of X strips in MC11
575// Float_t fYpos21[63]; // Y position of X strips in MC21
576
577}
a9e2aefa 578
331dcacd 579Int_t AliMUONTriggerCircuit::DetElemId(Int_t ichamber, Int_t idModule)
580{
65bcb249 581// adpated to official numbering (09/20/05)
331dcacd 582// returns the detection element Id for given chamber and module
65bcb249 583// ichamber (from 11 to 14), idModule (from -97 to 97)
584//
585 Int_t itmp=0;
586 Int_t linenumber=Int_t(idModule/10);
587 switch (linenumber) // (from 1 to 9, from top to bottom)
588 {
589 case 1:
590 itmp = 4;
591 break;
592 case 2:
593 itmp = 3;
594 break;
595 case 3:
596 itmp = 2;
597 break;
598 case 4:
599 itmp = 1;
600 break;
601 case 5:
602 itmp = 0;
603 break;
604 case 6:
605 itmp = 17;
606 break;
607 case 7:
608 itmp = 16;
609 break;
610 case 8:
611 itmp = 15;
612 break;
613 case 9:
614 itmp = 14;
615 break;
616// left
617 case -1:
618 itmp = 5;
619 break;
620 case -2:
621 itmp = 6;
622 break;
623 case -3:
624 itmp = 7;
625 break;
626 case -4:
627 itmp = 8;
628 break;
629 case -5:
630 itmp = 9;
631 break;
632 case -6:
633 itmp = 10;
634 break;
635 case -7:
636 itmp = 11;
637 break;
638 case -8:
639 itmp = 12;
640 break;
641 case -9:
642 itmp = 13;
643 break;
644 }
645 return (ichamber*100)+itmp;
331dcacd 646}
a9e2aefa 647
648
649
650