]>
Commit | Line | Data |
---|---|---|
8ff54bb6 | 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 | ||
16 | /* $Id$ */ | |
17 | ||
3d1463c8 | 18 | //----------------------------------------------------------------------------- |
8ff54bb6 | 19 | /// \class AliMUONTriggerCircuit |
20 | /// Contains as data members the Y positions of the X declusturized strips and | |
21 | /// the X positions of the (doubled or not) Y strips. | |
22 | /// This is used to associate the global positions to the fired strips of the | |
23 | /// local trigger output (see AliMUONTrackReconstructor::MakeTriggerTrack) | |
78649106 | 24 | /// |
25 | /// \author Philippe Crochet (LPCCFd) | |
3d1463c8 | 26 | //----------------------------------------------------------------------------- |
8ff54bb6 | 27 | |
28 | #include "AliMUONTriggerCircuit.h" | |
afeb2b33 | 29 | #include "AliMUONConstants.h" |
da142235 | 30 | #include "AliMUONGeometryTransformer.h" |
8ff54bb6 | 31 | |
8ff54bb6 | 32 | #include "AliMpTrigger.h" |
33 | #include "AliMpSlat.h" | |
34 | #include "AliMpPCB.h" | |
35 | #include "AliMpSegmentation.h" | |
36 | #include "AliMpVSegmentation.h" | |
866c3232 | 37 | #include "AliMpCathodType.h" |
7103ac2d | 38 | #include "AliMpDDLStore.h" |
39 | #include "AliMpLocalBoard.h" | |
40 | #include "AliMpConstants.h" | |
da142235 | 41 | #include "AliMpPad.h" |
168e9c4d | 42 | #include "AliMpEncodePair.h" |
8ff54bb6 | 43 | |
44 | #include "AliRun.h" | |
45 | #include "AliLog.h" | |
46 | ||
47 | #include <TMath.h> | |
9de45220 | 48 | #include <Riostream.h> |
8ff54bb6 | 49 | |
50 | /// \cond CLASSIMP | |
51 | ClassImp(AliMUONTriggerCircuit) | |
52 | /// \endcond | |
53 | ||
54 | //---------------------------------------------------------------------- | |
7103ac2d | 55 | AliMUONTriggerCircuit::AliMUONTriggerCircuit(const AliMUONGeometryTransformer* transformer) |
56 | : TObject(), | |
da142235 | 57 | fkTransformer(transformer), |
58 | fkCurrentSeg(0x0), | |
7103ac2d | 59 | fCurrentDetElem(0x0), |
60 | fCurrentLocalBoard(0x0) | |
8ff54bb6 | 61 | { |
62 | /// Constructor | |
63 | ||
7103ac2d | 64 | for (Int_t i = 1; i < AliMpConstants::NofLocalBoards()+1; ++i) { |
65 | fXpos11[i].Set(16); | |
66 | fYpos11[i].Set(31); | |
67 | fYpos21[i].Set(63); | |
bdfb6eef | 68 | fZpos11[i].Set(31); |
69 | fZpos21[i].Set(63); | |
70 | fXwidth11[i].Set(16); | |
71 | fYwidth11[i].Set(31); | |
72 | fYwidth21[i].Set(63); | |
7103ac2d | 73 | } |
74 | ||
75 | for (Int_t i = 1; i < AliMpConstants::NofLocalBoards()+1; ++i) { // board begins at 1 | |
76 | ||
77 | AliMpLocalBoard* localBoard = AliMpDDLStore::Instance()->GetLocalBoard(i); | |
78 | ||
79 | if (!localBoard) | |
80 | { | |
81 | AliError(Form("Did not get localboard %d",i)); | |
82 | continue; | |
83 | } | |
84 | ||
85 | LoadXPos(localBoard); | |
86 | LoadYPos(localBoard); | |
87 | ||
88 | } | |
89 | ||
8ff54bb6 | 90 | } |
91 | ||
92 | //---------------------------------------------------------------------- | |
93 | AliMUONTriggerCircuit::~AliMUONTriggerCircuit() | |
94 | { | |
95 | /// Destructor | |
7103ac2d | 96 | for (Int_t i = 1; i < AliMpConstants::NofLocalBoards()+1; ++i) { |
97 | fXpos11[i].Reset(); | |
98 | fYpos11[i].Reset(); | |
99 | fYpos21[i].Reset(); | |
bdfb6eef | 100 | fZpos11[i].Reset(); |
101 | fZpos21[i].Reset(); | |
102 | fXwidth11[i].Reset(); | |
103 | fYwidth11[i].Reset(); | |
104 | fYwidth21[i].Reset(); | |
7103ac2d | 105 | } |
106 | ||
8ff54bb6 | 107 | } |
108 | ||
109 | //---------------------------------------------------------------------- | |
110 | AliMUONTriggerCircuit::AliMUONTriggerCircuit(const AliMUONTriggerCircuit& circuit) | |
7103ac2d | 111 | : TObject(circuit), |
da142235 | 112 | fkTransformer(circuit.fkTransformer), // do not copy, just pointed to |
113 | fkCurrentSeg(circuit.fkCurrentSeg), | |
7103ac2d | 114 | fCurrentDetElem(circuit.fCurrentDetElem), |
115 | fCurrentLocalBoard(circuit.fCurrentLocalBoard) | |
8ff54bb6 | 116 | { |
117 | /// Copy constructor | |
118 | ||
7103ac2d | 119 | for (Int_t i = 1; i < AliMpConstants::NofLocalBoards()+1; ++i) { |
120 | fXpos11[i] = circuit.fXpos11[i]; | |
121 | fYpos11[i] = circuit.fYpos11[i]; | |
122 | fYpos21[i] = circuit.fYpos21[i]; | |
bdfb6eef | 123 | fZpos11[i] = circuit.fZpos11[i]; |
124 | fZpos21[i] = circuit.fZpos21[i]; | |
125 | fXwidth11[i] = circuit.fXwidth11[i]; | |
126 | fYwidth11[i] = circuit.fYwidth11[i]; | |
127 | fYwidth21[i] = circuit.fYwidth21[i]; | |
7103ac2d | 128 | } |
8ff54bb6 | 129 | |
130 | } | |
131 | //---------------------------------------------------------------------- | |
132 | AliMUONTriggerCircuit& AliMUONTriggerCircuit::operator=(const AliMUONTriggerCircuit& circuit) | |
133 | { | |
134 | /// Assignment operator | |
135 | ||
136 | if (this == &circuit) return *this; | |
137 | ||
da142235 | 138 | fkTransformer = circuit.fkTransformer; |
139 | fkCurrentSeg = circuit.fkCurrentSeg; | |
7103ac2d | 140 | fCurrentDetElem = circuit.fCurrentDetElem; |
141 | fCurrentLocalBoard = circuit.fCurrentLocalBoard; | |
8ff54bb6 | 142 | |
7103ac2d | 143 | for (Int_t i = 1; i < AliMpConstants::NofLocalBoards()+1; ++i) { |
8ff54bb6 | 144 | fXpos11[i] = circuit.fXpos11[i]; |
8ff54bb6 | 145 | fYpos11[i] = circuit.fYpos11[i]; |
8ff54bb6 | 146 | fYpos21[i] = circuit.fYpos21[i]; |
bdfb6eef | 147 | fZpos11[i] = circuit.fZpos11[i]; |
148 | fZpos21[i] = circuit.fZpos21[i]; | |
149 | fXwidth11[i] = circuit.fXwidth11[i]; | |
150 | fYwidth11[i] = circuit.fYwidth11[i]; | |
151 | fYwidth21[i] = circuit.fYwidth21[i]; | |
7103ac2d | 152 | } |
8ff54bb6 | 153 | |
154 | return *this; | |
155 | ||
8ff54bb6 | 156 | } |
157 | ||
158 | //--------------------------------------------------------------------- | |
da142235 | 159 | void AliMUONTriggerCircuit::LoadYPos(AliMpLocalBoard* const localBoard) |
8ff54bb6 | 160 | { |
161 | /// fill fYpos11 and fYpos21 -> y position of X declusterized strips | |
162 | ||
7103ac2d | 163 | fCurrentLocalBoard = localBoard->GetId(); |
8ff54bb6 | 164 | Int_t ichamber = 0; |
165 | Int_t icathode = 0; | |
7103ac2d | 166 | |
167 | Int_t zeroDown = localBoard->GetSwitch(AliMpLocalBoard::kZeroDown); | |
168 | Int_t zeroUp = localBoard->GetSwitch(AliMpLocalBoard::kZeroUp); | |
169 | ||
168e9c4d | 170 | Int_t iline = AliMp::PairFirst(localBoard->GetPosition()); |
171 | Int_t icol = AliMp::PairSecond(localBoard->GetPosition()); | |
7103ac2d | 172 | if ( iline == 5 ) --icol; |
173 | ||
8ff54bb6 | 174 | //--- first plane |
175 | ichamber = 10; | |
7103ac2d | 176 | fCurrentDetElem = AliMpDDLStore::Instance()->GetDEfromLocalBoard(fCurrentLocalBoard, ichamber); |
8ff54bb6 | 177 | |
da142235 | 178 | fkCurrentSeg = AliMpSegmentation::Instance() |
7103ac2d | 179 | ->GetMpSegmentation(fCurrentDetElem, AliMp::GetCathodType(icathode)); |
180 | ||
181 | Int_t iFirstStrip = FirstStrip(localBoard); | |
182 | Int_t iLastStrip = iFirstStrip + 16; | |
8ff54bb6 | 183 | Int_t iStripCircuit = 0; |
7103ac2d | 184 | |
185 | FillXstrips(icol, iFirstStrip, iLastStrip, | |
bdfb6eef | 186 | iStripCircuit, kTRUE); |
8ff54bb6 | 187 | |
188 | //--- second plane | |
189 | ichamber = 12; | |
7103ac2d | 190 | fCurrentDetElem = AliMpDDLStore::Instance()->GetDEfromLocalBoard(fCurrentLocalBoard, ichamber); |
191 | ||
da142235 | 192 | fkCurrentSeg = AliMpSegmentation::Instance() |
7103ac2d | 193 | ->GetMpSegmentation(fCurrentDetElem, AliMp::GetCathodType(icathode)); |
8ff54bb6 | 194 | |
195 | // second plane middle part | |
7103ac2d | 196 | Int_t iFirstStripMiddle = FirstStrip(localBoard); |
197 | Int_t iLastStripMiddle = iFirstStrip + 16; | |
198 | iStripCircuit = 8; | |
199 | ||
200 | FillXstrips(icol, iFirstStripMiddle, iLastStripMiddle, | |
bdfb6eef | 201 | iStripCircuit, kFALSE); |
8ff54bb6 | 202 | |
203 | // second plane upper part | |
204 | if (zeroUp == 0) { // something up | |
205 | Int_t iFirstStripUp; | |
206 | Int_t iLastStripUp; | |
7103ac2d | 207 | Int_t icolUp = icol; |
208 | ||
8ff54bb6 | 209 | // check if we need to move to another detElemId |
168e9c4d | 210 | AliMpPad pad = fkCurrentSeg->PadByIndices(icol-1,iLastStripMiddle+1,kFALSE); |
7103ac2d | 211 | |
8ff54bb6 | 212 | if (pad.IsValid()) { // upper strips within same detElemId |
213 | iFirstStripUp = iLastStripMiddle; | |
7103ac2d | 214 | iLastStripUp = iFirstStripUp + 8; |
215 | ||
8ff54bb6 | 216 | } else { // upper strips in another detElemId |
7103ac2d | 217 | fCurrentDetElem = AliMpDDLStore::Instance()-> |
218 | GetNextDEfromLocalBoard(fCurrentLocalBoard, ichamber); | |
219 | ||
da142235 | 220 | fkCurrentSeg = AliMpSegmentation::Instance() |
7103ac2d | 221 | ->GetMpSegmentation(fCurrentDetElem, AliMp::GetCathodType(icathode)); |
8ff54bb6 | 222 | |
223 | iFirstStripUp = 0; | |
7103ac2d | 224 | iLastStripUp = iFirstStripUp + 8; |
8ff54bb6 | 225 | if (iline == 4) icolUp = icol - 1; // special case |
226 | if (iline == 5) icolUp = icol + 1; // special case | |
227 | } | |
228 | ||
7103ac2d | 229 | iStripCircuit = 24; |
230 | FillXstrips(icolUp, iFirstStripUp, iLastStripUp, | |
bdfb6eef | 231 | iStripCircuit, kFALSE); |
8ff54bb6 | 232 | |
233 | // fill strip between middle and upper part | |
7103ac2d | 234 | fYpos21[fCurrentLocalBoard][47] = (fYpos21[fCurrentLocalBoard][46] + |
235 | fYpos21[fCurrentLocalBoard][48])/2.; | |
bdfb6eef | 236 | fZpos21[fCurrentLocalBoard][47] = (fZpos21[fCurrentLocalBoard][46] + |
237 | fZpos21[fCurrentLocalBoard][48])/2.; | |
238 | fYwidth21[fCurrentLocalBoard][47] = (fYwidth21[fCurrentLocalBoard][46] + | |
239 | fYwidth21[fCurrentLocalBoard][48])/2.; | |
8ff54bb6 | 240 | } // end of something up |
241 | ||
242 | // restore current detElemId & segmentation | |
7103ac2d | 243 | fCurrentDetElem = AliMpDDLStore::Instance()->GetDEfromLocalBoard(fCurrentLocalBoard, ichamber); |
da142235 | 244 | fkCurrentSeg = AliMpSegmentation::Instance() |
7103ac2d | 245 | ->GetMpSegmentation(fCurrentDetElem, AliMp::GetCathodType(icathode)); |
8ff54bb6 | 246 | |
247 | // second plane lower part | |
248 | if (zeroDown == 0) { // something down | |
249 | Int_t iFirstStripDo; | |
250 | Int_t iLastStripDo; | |
7103ac2d | 251 | Int_t icolDo = icol; |
8ff54bb6 | 252 | |
253 | // check if we need to move to another detElemId | |
168e9c4d | 254 | AliMpPad pad = fkCurrentSeg->PadByIndices(icol-1,iFirstStripMiddle-1,kFALSE); |
8ff54bb6 | 255 | if (pad.IsValid()) { // lower strips within same detElemId |
256 | iFirstStripDo = iFirstStripMiddle - 8; | |
7103ac2d | 257 | iLastStripDo = iFirstStripDo + 8; |
258 | ||
8ff54bb6 | 259 | } else { // lower strips in another detElemId |
7103ac2d | 260 | fCurrentDetElem = AliMpDDLStore::Instance() |
261 | ->GetPreviousDEfromLocalBoard(fCurrentLocalBoard, ichamber); | |
262 | ||
da142235 | 263 | fkCurrentSeg = AliMpSegmentation::Instance() |
7103ac2d | 264 | ->GetMpSegmentation(fCurrentDetElem, AliMp::GetCathodType(icathode)); |
8ff54bb6 | 265 | |
266 | // get iFirstStrip in this module | |
da142235 | 267 | const AliMpTrigger* t = AliMpSegmentation::Instance()->GetTrigger(fkCurrentSeg); |
8ff54bb6 | 268 | const AliMpSlat* slat = t->GetLayer(0); |
7103ac2d | 269 | |
8ff54bb6 | 270 | if (iline == 5) icolDo = icol + 1; // special case |
7103ac2d | 271 | if (iline == 6) icolDo = icol - 1; // special case |
272 | ||
8ff54bb6 | 273 | const AliMpPCB* pcb = slat->GetPCB(icolDo-1); |
274 | iFirstStripDo = (pcb->Iymax() + 1) - 8; | |
275 | iLastStripDo = iFirstStripDo + 8; | |
276 | } | |
277 | ||
7103ac2d | 278 | iStripCircuit = 0; |
279 | FillXstrips(icolDo, iFirstStripDo, iLastStripDo, | |
bdfb6eef | 280 | iStripCircuit, kFALSE); |
8ff54bb6 | 281 | |
282 | // fill strip between middle and upper part | |
7103ac2d | 283 | fYpos21[fCurrentLocalBoard][15] = (fYpos21[fCurrentLocalBoard][14] + |
284 | fYpos21[fCurrentLocalBoard][16])/2.; | |
bdfb6eef | 285 | fZpos21[fCurrentLocalBoard][15] = (fZpos21[fCurrentLocalBoard][14] + |
286 | fZpos21[fCurrentLocalBoard][16])/2.; | |
287 | fYwidth21[fCurrentLocalBoard][15] = (fYwidth21[fCurrentLocalBoard][14] + | |
288 | fYwidth21[fCurrentLocalBoard][16])/2.; | |
8ff54bb6 | 289 | } // end of something down |
290 | ||
291 | } | |
292 | ||
293 | //---------------------------------------------------------------------- | |
7103ac2d | 294 | void AliMUONTriggerCircuit::FillXstrips(const Int_t icol, |
295 | const Int_t iFirstStrip, const Int_t iLastStrip, | |
bdfb6eef | 296 | Int_t liStripCircuit, const Bool_t is11) |
7103ac2d | 297 | { |
298 | /// fill | |
bdfb6eef | 299 | TArrayF& ypos = (is11) ? fYpos11[fCurrentLocalBoard] : fYpos21[fCurrentLocalBoard]; |
300 | TArrayF& zpos = (is11) ? fZpos11[fCurrentLocalBoard] : fZpos21[fCurrentLocalBoard]; | |
301 | TArrayF& ywidth = (is11) ? fYwidth11[fCurrentLocalBoard] : fYwidth21[fCurrentLocalBoard]; | |
302 | ||
303 | Double_t xyGlobal[3] = {0.}; | |
7103ac2d | 304 | for (Int_t istrip = iFirstStrip; istrip < iLastStrip; ++istrip) { |
305 | ||
168e9c4d | 306 | AliMpPad pad = fkCurrentSeg->PadByIndices(icol-1,istrip,kTRUE); |
7103ac2d | 307 | if ( !pad.IsValid() ) { |
308 | StdoutToAliError(cout << "Pad not found in seg " << endl; | |
da142235 | 309 | fkCurrentSeg->Print(); |
7103ac2d | 310 | cout << " ix,iy=" << icol-1 << "," << istrip << endl; |
311 | ); | |
312 | } | |
6e97fbb8 | 313 | Float_t yDim = pad.GetDimensionY(); // half size! |
7103ac2d | 314 | |
315 | XYGlobal(pad,xyGlobal); | |
316 | ||
317 | ypos[2*liStripCircuit] = xyGlobal[1]; | |
bdfb6eef | 318 | zpos[2*liStripCircuit] = xyGlobal[2]; |
319 | ywidth[2*liStripCircuit] = 2. * yDim; | |
320 | if (istrip != (iLastStrip - 1)) { | |
321 | ypos[2*liStripCircuit+1] = xyGlobal[1] + yDim; | |
322 | zpos[2*liStripCircuit+1] = xyGlobal[2]; | |
323 | ywidth[2*liStripCircuit+1] = 2. * yDim; | |
324 | } | |
7103ac2d | 325 | liStripCircuit++; |
326 | } | |
327 | } | |
328 | ||
329 | ||
330 | //---------------------------------------------------------------------- | |
da142235 | 331 | void AliMUONTriggerCircuit::LoadXPos(AliMpLocalBoard* const localBoard) |
8ff54bb6 | 332 | { |
333 | /// fill fXpos11 -> x position of Y strips for the first plane only | |
334 | /// fXpos11 contains the x position of Y strip for the current circuit | |
335 | /// taking into account whether or nor not part(s) of the circuit | |
336 | /// (middle, up or down) has(have) 16 strips (handdled by means of switchs) | |
7103ac2d | 337 | |
338 | fCurrentLocalBoard = localBoard->GetId(); | |
339 | ||
8ff54bb6 | 340 | Int_t ichamber = 10; |
341 | Int_t icathode = 1; | |
342 | ||
7103ac2d | 343 | Int_t x2u = localBoard->GetSwitch(AliMpLocalBoard::kX2u); |
344 | Int_t x2m = localBoard->GetSwitch(AliMpLocalBoard::kX2m); | |
345 | Int_t x2d = localBoard->GetSwitch(AliMpLocalBoard::kX2d); | |
346 | Int_t zeroAllYLSB = localBoard->GetSwitch(AliMpLocalBoard::kZeroAllYLSB); | |
347 | ||
348 | Int_t iStripCircuit = 0; | |
349 | Int_t iFirstStrip = 0; | |
350 | Int_t iLastStrip = 0; | |
351 | Bool_t doubling = kFALSE; | |
8ff54bb6 | 352 | |
168e9c4d | 353 | Int_t iline = AliMp::PairFirst(localBoard->GetPosition()); |
354 | Int_t icol = AliMp::PairSecond(localBoard->GetPosition()); | |
7103ac2d | 355 | if ( iline == 5 ) --icol; |
8ff54bb6 | 356 | |
7103ac2d | 357 | fCurrentDetElem = AliMpDDLStore::Instance()->GetDEfromLocalBoard(fCurrentLocalBoard, ichamber); |
358 | ||
da142235 | 359 | fkCurrentSeg = AliMpSegmentation::Instance() |
7103ac2d | 360 | ->GetMpSegmentation(fCurrentDetElem, AliMp::GetCathodType(icathode)); |
8ff54bb6 | 361 | |
362 | // check if one needs a strip doubling or not | |
7103ac2d | 363 | if ( (x2u || x2m || x2d ) && x2m ) doubling = kTRUE; |
364 | ||
0d528e1f | 365 | |
8ff54bb6 | 366 | // check if one starts at strip = 0 or 8 (boards 26-29 and 143-146) |
7103ac2d | 367 | if (zeroAllYLSB) iStripCircuit = 8; |
8ff54bb6 | 368 | |
369 | // get iFirstStrip in this module | |
da142235 | 370 | const AliMpTrigger* t = AliMpSegmentation::Instance()->GetTrigger(fkCurrentSeg); |
8ff54bb6 | 371 | const AliMpSlat* slat = t->GetLayer(0); |
372 | ||
373 | const AliMpPCB* pcb = slat->GetPCB(icol-1); | |
374 | iFirstStrip = pcb->Ixmin(); | |
375 | ||
7103ac2d | 376 | |
0d528e1f | 377 | if (doubling || zeroAllYLSB == 1) iLastStrip = iFirstStrip + 8; |
8ff54bb6 | 378 | else iLastStrip = iFirstStrip + 16; |
379 | ||
7103ac2d | 380 | FillYstrips(iFirstStrip, iLastStrip, iStripCircuit, doubling); |
8ff54bb6 | 381 | } |
382 | ||
383 | //---------------------------------------------------------------------- | |
7103ac2d | 384 | void AliMUONTriggerCircuit::FillYstrips(const Int_t iFirstStrip, const Int_t iLastStrip, |
385 | Int_t liStripCircuit, | |
386 | const Bool_t doubling) | |
8ff54bb6 | 387 | { |
388 | /// fill | |
bdfb6eef | 389 | Double_t xyGlobal[3] = {0.}; |
7103ac2d | 390 | |
391 | for (Int_t istrip = iFirstStrip; istrip < iLastStrip; ++istrip) { | |
0d528e1f | 392 | |
168e9c4d | 393 | AliMpPad pad = fkCurrentSeg->PadByIndices(istrip,0,kTRUE); |
0d528e1f | 394 | |
8ff54bb6 | 395 | if ( !pad.IsValid() ) |
396 | { | |
397 | StdoutToAliError(cout << "Pad not found in seg " << endl; | |
da142235 | 398 | fkCurrentSeg->Print(); |
8ff54bb6 | 399 | cout << " ix,iy=" << istrip << "," << 0 << endl; |
400 | ); | |
401 | } | |
6e97fbb8 | 402 | Float_t xDim = pad.GetDimensionX(); // half size! |
8ff54bb6 | 403 | |
7103ac2d | 404 | XYGlobal(pad,xyGlobal); |
8ff54bb6 | 405 | |
7103ac2d | 406 | if (!doubling) { |
407 | fXpos11[fCurrentLocalBoard].AddAt(xyGlobal[0], liStripCircuit); | |
bdfb6eef | 408 | fXwidth11[fCurrentLocalBoard].AddAt(2. * xDim, liStripCircuit); |
7103ac2d | 409 | } else if (doubling) { |
410 | ||
411 | fXpos11[fCurrentLocalBoard].AddAt(TMath::Sign(1.,xyGlobal[0]) * | |
412 | (TMath::Abs(xyGlobal[0]) - xDim/2.), 2*liStripCircuit); | |
bdfb6eef | 413 | fXwidth11[fCurrentLocalBoard].AddAt(2. * xDim, 2*liStripCircuit); |
7103ac2d | 414 | |
415 | fXpos11[fCurrentLocalBoard].AddAt(TMath::Sign(1.,xyGlobal[0]) * | |
416 | (TMath::Abs(fXpos11[fCurrentLocalBoard][2*liStripCircuit]) + xDim), | |
417 | 2*liStripCircuit + 1); | |
bdfb6eef | 418 | fXwidth11[fCurrentLocalBoard].AddAt(2. * xDim, 2*liStripCircuit + 1); |
7103ac2d | 419 | } |
420 | ||
8ff54bb6 | 421 | liStripCircuit++; |
422 | } | |
423 | } | |
424 | ||
425 | //---------------------------------------------------------------------- | |
7103ac2d | 426 | void AliMUONTriggerCircuit::XYGlobal(const AliMpPad& pad, |
427 | Double_t* xyGlobal) | |
8ff54bb6 | 428 | { |
7103ac2d | 429 | /// returns pad x & y positions and x & y pad dimensions in global coordinates |
430 | /// note: no need for transformation for pad dimensions | |
8ff54bb6 | 431 | |
7103ac2d | 432 | // get the pad position and dimensions |
6e97fbb8 | 433 | Double_t xl1 = pad.GetPositionX(); |
434 | Double_t yl1 = pad.GetPositionY(); | |
7103ac2d | 435 | |
436 | // positions from local to global | |
da142235 | 437 | fkTransformer->Local2Global(fCurrentDetElem, xl1, yl1, 0, |
bdfb6eef | 438 | xyGlobal[0], xyGlobal[1], xyGlobal[2]); |
8ff54bb6 | 439 | } |
7103ac2d | 440 | |
8ff54bb6 | 441 | |
442 | //---------------------------------------------------------------------- | |
7103ac2d | 443 | //--- methods which return member data related info |
444 | //---------------------------------------------------------------------- | |
bdfb6eef | 445 | //---------------------------------------------------------------------- |
446 | Float_t AliMUONTriggerCircuit::GetX11Pos(Int_t localBoardId, Int_t istrip) const | |
447 | { | |
448 | /// returns X position of Y strip istrip in MC11 | |
449 | return fXpos11[localBoardId][istrip]; | |
450 | } | |
7103ac2d | 451 | Float_t AliMUONTriggerCircuit::GetY11Pos(Int_t localBoardId, Int_t istrip) const |
8ff54bb6 | 452 | { |
7103ac2d | 453 | /// returns Y position of X strip istrip in MC11 |
454 | return fYpos11[localBoardId][istrip]; | |
8ff54bb6 | 455 | } |
8ff54bb6 | 456 | //---------------------------------------------------------------------- |
7103ac2d | 457 | Float_t AliMUONTriggerCircuit::GetY21Pos(Int_t localBoardId, Int_t istrip) const |
8ff54bb6 | 458 | { |
7103ac2d | 459 | /// returns Y position of X strip istrip in MC21 |
460 | return fYpos21[localBoardId][istrip]; | |
8ff54bb6 | 461 | } |
8ff54bb6 | 462 | //---------------------------------------------------------------------- |
bdfb6eef | 463 | Float_t AliMUONTriggerCircuit::GetZ11Pos(Int_t localBoardId, Int_t istrip) const |
8ff54bb6 | 464 | { |
bdfb6eef | 465 | /// returns Z position of X strip istrip in MC11 |
466 | return fZpos11[localBoardId][istrip]; | |
467 | } | |
468 | //---------------------------------------------------------------------- | |
469 | Float_t AliMUONTriggerCircuit::GetZ21Pos(Int_t localBoardId, Int_t istrip) const | |
470 | { | |
471 | /// returns Z position of X strip istrip in MC21 | |
472 | return fZpos21[localBoardId][istrip]; | |
473 | } | |
474 | Float_t AliMUONTriggerCircuit::GetX11Width(Int_t localBoardId, Int_t istrip) const | |
475 | { | |
476 | /// returns width of Y strip istrip in MC11 | |
477 | return fXwidth11[localBoardId][istrip]; | |
478 | } | |
479 | Float_t AliMUONTriggerCircuit::GetY11Width(Int_t localBoardId, Int_t istrip) const | |
480 | { | |
481 | /// returns width of X strip istrip in MC11 | |
482 | return fYwidth11[localBoardId][istrip]; | |
483 | } | |
484 | //---------------------------------------------------------------------- | |
485 | Float_t AliMUONTriggerCircuit::GetY21Width(Int_t localBoardId, Int_t istrip) const | |
486 | { | |
487 | /// returns width of X strip istrip in MC21 | |
488 | return fYwidth21[localBoardId][istrip]; | |
8ff54bb6 | 489 | } |
490 | ||
491 | //---------------------------------------------------------------------- | |
7103ac2d | 492 | Int_t AliMUONTriggerCircuit::FirstStrip(AliMpLocalBoard* localBoard) |
8ff54bb6 | 493 | { |
494 | /// returns the first strip from mapping for board boardName | |
495 | /// take care of special case for boards RC1L6B12 & LC1L6B12 | |
496 | Int_t iFirstStrip = -1; | |
7103ac2d | 497 | Int_t boardNumber = atoi(localBoard->GetName()+6); |
498 | ||
168e9c4d | 499 | Int_t iline = AliMp::PairFirst(localBoard->GetPosition()); |
500 | Int_t icol = AliMp::PairSecond(localBoard->GetPosition()); | |
7103ac2d | 501 | if ( iline == 5 ) --icol; |
502 | ||
8ff54bb6 | 503 | switch (boardNumber) |
504 | { | |
505 | case 12: | |
506 | iFirstStrip = 0; | |
507 | break; | |
508 | case 34: | |
509 | iFirstStrip = 16; | |
510 | break; | |
511 | case 56: | |
512 | iFirstStrip = 32; | |
513 | break; | |
514 | case 78: | |
515 | iFirstStrip = 48; | |
516 | break; | |
517 | } | |
7103ac2d | 518 | if (icol == 1 && iline == 6) iFirstStrip += 16; // special case |
8ff54bb6 | 519 | return iFirstStrip; |
520 | } | |
521 | ||
afeb2b33 | 522 | //---------------------------------------------------------------------- |
523 | Float_t AliMUONTriggerCircuit::PtCal(Int_t localBoardId, Int_t istripX, Int_t idev, Int_t istripY) const{ | |
524 | /// returns calculated pt for circuit/istripX/idev/istripY according | |
525 | /// to the formula of the TRD. Note : idev (input) is in [0+30] | |
526 | ||
527 | // Int_t jdev = idev - 15; // jdev in [-15+15] | |
528 | Int_t istripX2=istripX+idev+1; // find istripX2 using istripX and idev | |
529 | ||
530 | Float_t yPosX1=fYpos11[localBoardId][istripX]; | |
531 | Float_t yPosX2=fYpos21[localBoardId][istripX2]; | |
532 | Float_t xPosY1=fXpos11[localBoardId][istripY]; | |
533 | ||
534 | // Z distance between IP and center of dipole | |
535 | Float_t zf= TMath::Abs(0.5 *(AliMUONConstants::CoilZ() + AliMUONConstants::YokeZ())); | |
536 | Float_t z1=AliMUONConstants::DefaultChamberZ(10); | |
537 | Float_t z2=AliMUONConstants::DefaultChamberZ(12); | |
538 | Float_t thetaDev=(1./zf)*(yPosX1*z2-yPosX2*z1)/(z2-z1); | |
539 | Float_t xf=xPosY1*zf/z1; | |
540 | Float_t yf=yPosX2-((yPosX2-yPosX1)*(z2-zf))/(z2-z1); | |
541 | return (3.*0.3/TMath::Abs(thetaDev)) * TMath::Sqrt(xf*xf+yf*yf)/zf; | |
542 | } |