1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
16 ////////////////////////////////////////////////////////////
17 // Factory for muon chambers, segmentations and response //
18 ////////////////////////////////////////////////////////////
22 // --------------------------
23 // Class AliMUONSegFactory
24 // --------------------------
25 // New factory for building segmentations at all levels
26 // Authors: Ivana Hrivnacova, IPN Orsay
28 #include "AliMUONSegFactory.h"
29 #include "AliMUONConstants.h"
30 #include "AliMUONGeometryStore.h"
31 #include "AliMUONGeometryTransformer.h"
32 #include "AliMUONGeometryModule.h"
33 #include "AliMUONSegmentation.h"
34 #include "AliMUONGeometrySegmentation.h"
35 #include "AliMUONSt12QuadrantSegmentation.h"
36 #include "AliMUONSt345SlatSegmentation.h"
37 #include "AliMUONSt345SlatSegmentationV2.h"
38 #include "AliMUONTriggerSegmentation.h"
39 #include "AliMUONTriggerSegmentationV2.h"
40 #include "AliMUONTriggerConstants.h"
42 #include "AliMpDEManager.h"
43 #include "AliMpDEIterator.h"
47 #include <Riostream.h>
49 #include <TObjString.h>
53 ClassImp(AliMUONSegFactory)
56 //______________________________________________________________________________
57 AliMUONSegFactory::AliMUONSegFactory(const AliMUONGeometryTransformer* geometry)
62 fkTransformer(geometry)
64 /// Standard constructor
68 //______________________________________________________________________________
69 AliMUONSegFactory::AliMUONSegFactory(const TString& volPathsFileName,
70 const TString& transformsFileName)
77 /// Standard constructor
80 AliMUONGeometryTransformer* transformer = new AliMUONGeometryTransformer(true);
81 transformer->ReadGeometryData(volPathsFileName, transformsFileName);
82 fkTransformer = transformer;
85 //______________________________________________________________________________
86 AliMUONSegFactory::AliMUONSegFactory()
93 /// Default constructor
96 //______________________________________________________________________________
98 AliMUONSegFactory::~AliMUONSegFactory()
102 //delete fSegmentation;
103 // The segmentation is supposed to be deleted in the client code
110 //______________________________________________________________________________
111 Bool_t AliMUONSegFactory::IsGeometryDefined(Int_t ichamber)
113 /// Return true, if det elements for the chamber with the given ichamber Id
114 /// are defined in geometry (the geometry builder for this chamber was activated)
116 if ( ! fkTransformer ||
117 ! fkTransformer->GetModuleTransformer(ichamber, false) )
124 //__________________________________________________________________________
125 AliMUONSegmentation* AliMUONSegFactory::Segmentation()
127 /// Return the segmentation container, create it if it does not yet exist
129 if ( ! fSegmentation )
130 fSegmentation = new AliMUONSegmentation(AliMUONConstants::NCh());
132 return fSegmentation;
139 //______________________________________________________________________________
141 AliMUONSegFactory::CreateMpSegmentation(Int_t detElemId, Int_t cath)
143 /// Create mapping segmentation for given detElemId and cath
144 /// using mapping manager
146 AliMpVSegmentation* mpSegmentation
147 = fMpSegFactory.CreateMpSegmentation(detElemId, cath);
149 Segmentation()->AddMpSegmentation(mpSegmentation);
151 return mpSegmentation;
154 //______________________________________________________________________________
155 AliMUONVGeometryDESegmentation*
156 AliMUONSegFactory::CreateDESegmentation(Int_t detElemId, Int_t cath)
158 /// Create DE segmentation, operating in local DE reference frame
160 // Check detElemId & cath
161 if ( ! AliMpDEManager::IsValid(detElemId, cath, true) ) return 0;
163 // Check if transformer is defined
164 if ( ! fkTransformer) {
165 AliErrorStream() << "Geometry transformer not defined" << endl;
169 // Only return it, if DE segmentation for this detElemId and cath
170 // was already defined
172 const AliMUONVGeometryDESegmentation* kdeSegmentation
173 = Segmentation()->GetDESegmentation(detElemId, cath, false);
174 if ( kdeSegmentation )
175 return const_cast<AliMUONVGeometryDESegmentation*>(kdeSegmentation);
177 // Get module, create it if it does not exist
179 Int_t moduleId = AliMUONGeometryStore::GetModuleId(detElemId);
180 AliMUONGeometrySegmentation* moduleSegmentation
181 = Segmentation()->GetModuleSegmentation(moduleId, cath, false);
182 if (! moduleSegmentation) {
184 = new AliMUONGeometrySegmentation(
185 fkTransformer->GetModuleTransformer(moduleId));
186 Segmentation()->AddModuleSegmentation(moduleId, cath, moduleSegmentation);
189 // Get DE segmentation for this DE type, create it if it does not exist
191 AliMUONVGeometryDESegmentation* deSegmentation = 0;
192 TString deName = AliMpDEManager::GetDEName(detElemId, cath);
193 TObject* objSegmentation = fDESegmentations.Get(deName);
194 if ( objSegmentation )
195 deSegmentation = (AliMUONVGeometryDESegmentation*)objSegmentation;
197 if ( !deSegmentation ) {
199 // Get/Create mapping segmentation via mapping manager
200 AliMpVSegmentation* mpSegmentation
201 = CreateMpSegmentation(detElemId, cath);
203 AliMpStationType stationType = AliMpDEManager::GetStationType(detElemId);
204 AliMpPlaneType planeType = AliMpDEManager::GetPlaneType(detElemId, cath);
206 switch (stationType) {
210 deSegmentation = new AliMUONSt12QuadrantSegmentation(
211 mpSegmentation, stationType, planeType);
212 //cout << " new AliMUONSt12QuadrantSegmentation "
213 // << StationTypeName(stationType) << " "
214 // << PlaneTypeName(planeType) << " "
215 // << deName << endl;
220 deSegmentation = new AliMUONSt345SlatSegmentationV2(
221 mpSegmentation, detElemId, planeType);
222 //cout << " new AliMUONSt345SlatSegmentationV2 "
223 // << StationTypeName(stationType) << " "
224 // << PlaneTypeName(planeType) << " "
225 // << deName << endl;
228 case kStationTrigger:
229 deSegmentation = new AliMUONTriggerSegmentationV2(
230 mpSegmentation, detElemId, planeType);
231 //cout << " new AliMUONTriggerSegmentationV2 "
232 // << StationTypeName(stationType) << " "
233 // << PlaneTypeName(planeType) << " "
234 // << deName << endl;
238 // Map new DE segmentation
239 fDESegmentations.Add(deName, deSegmentation);
240 Segmentation()->AddDESegmentation(deSegmentation);
243 // Add DE segmentation to module
245 moduleSegmentation->Add(detElemId, deName, deSegmentation);
247 return deSegmentation;
251 //______________________________________________________________________________
252 AliMUONGeometrySegmentation*
253 AliMUONSegFactory::CreateModuleSegmentation(Int_t moduleId, Int_t cath)
255 /// Create module segmentation, operating in global reference frame
256 /// Detection elements are defined via DE names map.
258 // Check cathod & module Id
259 if ( ! AliMpDEManager::IsValidCathod(cath, true) ||
260 ! AliMpDEManager::IsValidModuleId(moduleId, true) ) return 0;
263 for ( it.First(moduleId); ! it.IsDone(); it.Next() )
264 CreateDESegmentation(it.CurrentDE(), cath);
266 return Segmentation()->GetModuleSegmentation(moduleId, cath);
269 //______________________________________________________________________________
271 AliMUONSegFactory::CreateSegmentation(const TString& option)
273 /// Create segmentations on all levels and return their container.
276 if ( option != "default" &&
277 option != "FactoryV2" &&
278 option != "FactoryV3" &&
279 option != "FactoryV4" &&
282 AliErrorStream() << "Option " << option << " not defined." << endl;
286 if ( option == "FactoryV2" ) {
287 // Default segmentation version
288 for (Int_t moduleId = 0; moduleId<4; moduleId++)
289 for (Int_t cath = 0; cath < 2; cath++) {
290 if ( IsGeometryDefined(moduleId) )
291 CreateModuleSegmentation( moduleId, cath);
293 if ( IsGeometryDefined(4) ) BuildStation3();
294 if ( IsGeometryDefined(6) ) BuildStation4();
295 if ( IsGeometryDefined(8) ) BuildStation5();
296 if ( IsGeometryDefined(10)) BuildStation6();
299 if ( option == "FactoryV3" ) {
300 // New slat segmentation
301 for (Int_t moduleId = 0; moduleId<10; moduleId++)
302 for (Int_t cath = 0; cath < 2; cath++) {
303 if ( IsGeometryDefined(moduleId) )
304 CreateModuleSegmentation( moduleId, cath);
306 if ( IsGeometryDefined(10) ) BuildStation6();
309 if (option == "default" || option == "new" || option == "FactoryV4" ) {
311 for (Int_t moduleId = 0; moduleId<AliMUONConstants::NCh(); moduleId++)
312 for (Int_t cath = 0; cath < 2; cath++) {
313 if ( IsGeometryDefined(moduleId) )
314 CreateModuleSegmentation( moduleId, cath);
317 return Segmentation();
321 // Functions for building old segmentations (not based on mapping)
324 //__________________________________________________________________________
325 void AliMUONSegFactory::BuildStation3()
327 /// Configuration for Chamber TC5/6 (Station 3) ----------
329 AliMUONGeometrySegmentation* segmentation[2];
331 //Slats Segmentations
332 AliMUONSt345SlatSegmentation *slatsegB[4]; // Types of segmentation for St3
333 AliMUONSt345SlatSegmentation *slatsegNB[4];
336 Int_t ndiv[4] ={ 4, 4, 2, 1}; // densities zones
337 for(Int_t i=0; i<4; i++) {
338 slatsegB[i] = new AliMUONSt345SlatSegmentation(1);
339 Segmentation()->AddDESegmentation(slatsegB[i]);
340 slatsegB[i]->SetPadSize(10.,0.5);
341 slatsegB[i]->SetPadDivision(ndiv);
342 slatsegB[i]->SetId(1); // Id elt ????
343 slatsegB[i]->SetDAnod(AliMUONConstants::Pitch());
344 slatsegNB[i] = new AliMUONSt345SlatSegmentation(0);
345 Segmentation()->AddDESegmentation(slatsegNB[i]);
346 slatsegNB[i]->SetPadSize(1./1.4,10.); // Nbending
347 slatsegNB[i]->SetPadDivision(ndiv);
348 slatsegNB[i]->SetId(1);
349 slatsegNB[i]->SetDAnod(AliMUONConstants::Pitch());
352 // Type 112200 for 500, 501, 508, 509, 510, 517
353 // in Ch5 (similar for Ch6) for the futur official numbering
354 // Type 112200 for 503, 504, 505, 555, 554, 553
355 // in Ch5 (similar for Ch6) actual numbering in the code to be changed in jan05
356 Int_t n0[4] = { 0, 2, 2, 0 };
357 slatsegB[0]->SetPcbBoards(n0);
358 slatsegB[0]->Init(0);
359 slatsegNB[0]->SetPcbBoards(n0);
360 slatsegNB[0]->Init(0);
362 // Type 122200 for 502, 507, 511, 516 (similar in Ch6)
363 // for future official numbering of ALICE
364 // Type 122200 for 502, 506, 556, 552 (similiarin Ch6)
365 // for actual numbering in muon code to be changed in jan05
366 Int_t n1[4] = { 0, 1, 3, 0 };
367 slatsegB[1]->SetPcbBoards(n1);
368 slatsegB[1]->Init(0);
369 slatsegNB[1]->SetPcbBoards(n1);
370 slatsegNB[1]->Init(0);
372 // Type 222000 for 503, 506, 512, 515 (similar in Ch6)
373 // for future official numbering of ALICE
374 // Type 222000 for 501, 507, 557, 551 (similiarin Ch6)
375 // for actual numbering in muon code to be changed in jan05
376 Int_t n2[4] = { 0, 0, 3, 0 };
377 slatsegB[2]->SetPcbBoards(n2);
378 slatsegB[2]->Init(0);
379 slatsegNB[2]->SetPcbBoards(n2);
380 slatsegNB[2]->Init(0);
382 // Type 220000 for 504, 505, 513, 514 (similar in Ch6)
383 // for future official numbering of ALICE
384 // Type 220000 for 500, 508, 558, 550 (similiarin Ch6)
385 // for actual numbering in muon code to be changed in jan05
386 Int_t n3[4] = { 0, 0, 2, 0 };
387 slatsegB[3]->SetPcbBoards(n3);
388 slatsegB[3]->Init(0);
389 slatsegNB[3]->SetPcbBoards(n3);
390 slatsegNB[3]->Init(0);
392 for (Int_t chamber = 4; chamber < 6; chamber++) {
394 const AliMUONGeometryModuleTransformer* kModuleTransformer
395 = fkTransformer->GetModuleTransformer(chamber);
397 segmentation[0] = new AliMUONGeometrySegmentation(kModuleTransformer);
398 segmentation[1] = new AliMUONGeometrySegmentation(kModuleTransformer);
400 // id detection elt for chamber 1
401 Int_t id0 = (chamber+1)*100;
405 segmentation[0]->Add(id0+14, "Undefined", slatsegB[3]);
406 segmentation[0]->Add(id0+ 4, "Undefined", slatsegB[3]);
407 segmentation[0]->Add(id0+13, "Undefined", slatsegB[3]);
408 segmentation[0]->Add(id0+ 5, "Undefined", slatsegB[3]);
410 segmentation[0]->Add(id0+15, "Undefined", slatsegB[2]);
411 segmentation[0]->Add(id0+ 3, "Undefined", slatsegB[2]);
412 segmentation[0]->Add(id0+12, "Undefined", slatsegB[2]);
413 segmentation[0]->Add(id0+ 6, "Undefined", slatsegB[2]);
415 segmentation[0]->Add(id0+16, "Undefined", slatsegB[1]);
416 segmentation[0]->Add(id0+ 2, "Undefined", slatsegB[1]);
417 segmentation[0]->Add(id0+11, "Undefined", slatsegB[1]);
418 segmentation[0]->Add(id0+ 7, "Undefined", slatsegB[1]);
420 segmentation[0]->Add(id0+17, "Undefined", slatsegB[0]);
421 segmentation[0]->Add(id0, "Undefined", slatsegB[0]);
422 segmentation[0]->Add(id0+ 1, "Undefined", slatsegB[0]);
423 segmentation[0]->Add(id0+10, "Undefined", slatsegB[0]);
424 segmentation[0]->Add(id0+ 9, "Undefined", slatsegB[0]);
425 segmentation[0]->Add(id0+ 8, "Undefined", slatsegB[0]);
426 Segmentation()->AddModuleSegmentation(chamber, 0, segmentation[0]);
430 segmentation[1]->Add(id0+14, "Undefined", slatsegNB[3]);
431 segmentation[1]->Add(id0+ 4, "Undefined", slatsegNB[3]);
432 segmentation[1]->Add(id0+13, "Undefined", slatsegNB[3]);
433 segmentation[1]->Add(id0+ 5, "Undefined", slatsegNB[3]);
435 segmentation[1]->Add(id0+15, "Undefined", slatsegNB[2]);
436 segmentation[1]->Add(id0+ 3, "Undefined", slatsegNB[2]);
437 segmentation[1]->Add(id0+12, "Undefined", slatsegNB[2]);
438 segmentation[1]->Add(id0+ 6, "Undefined", slatsegNB[2]);
440 segmentation[1]->Add(id0+16, "Undefined", slatsegNB[1]);
441 segmentation[1]->Add(id0+ 2, "Undefined", slatsegNB[1]);
442 segmentation[1]->Add(id0+11, "Undefined", slatsegNB[1]);
443 segmentation[1]->Add(id0+ 7, "Undefined", slatsegNB[1]);
445 segmentation[1]->Add(id0+17, "Undefined", slatsegNB[0]);
446 segmentation[1]->Add(id0, "Undefined", slatsegNB[0]);
447 segmentation[1]->Add(id0+ 1, "Undefined", slatsegNB[0]);
448 segmentation[1]->Add(id0+10, "Undefined", slatsegNB[0]);
449 segmentation[1]->Add(id0+ 9, "Undefined", slatsegNB[0]);
450 segmentation[1]->Add(id0+ 8, "Undefined", slatsegNB[0]);
451 Segmentation()->AddModuleSegmentation(chamber, 1, segmentation[1]);
455 //__________________________________________________________________________
456 void AliMUONSegFactory::BuildStation4()
458 /// Configuration for Chamber TC7/8 (Station 4) ----------
460 AliMUONGeometrySegmentation* segmentation[2];
462 //Slats Segmentations
463 AliMUONSt345SlatSegmentation *slatsegB[7]; // Types of segmentation for St4
464 AliMUONSt345SlatSegmentation *slatsegNB[7];
467 Int_t ndiv[4] ={ 4, 4, 2, 1}; // densities zones
468 for(Int_t i = 0; i < 7; i++) {
469 slatsegB[i] = new AliMUONSt345SlatSegmentation(1);
470 Segmentation()->AddDESegmentation(slatsegB[i]);
471 slatsegB[i]->SetPadSize(10.,0.5);
472 slatsegB[i]->SetPadDivision(ndiv);
473 slatsegB[i]->SetId(1);
474 slatsegB[i]->SetDAnod(AliMUONConstants::Pitch());
475 slatsegNB[i] = new AliMUONSt345SlatSegmentation(0);
476 Segmentation()->AddDESegmentation(slatsegNB[i]);
477 slatsegNB[i]->SetPadSize(1./1.4,10.);
478 slatsegNB[i]->SetPadDivision(ndiv);
479 slatsegNB[i]->SetId(1);
480 slatsegNB[i]->SetDAnod(AliMUONConstants::Pitch());
483 Int_t n4[4] = { 0, 1, 2, 2 };
484 slatsegB[0]->SetPcbBoards(n4);
485 slatsegB[0]->Init(0); // 0 detection element id
486 slatsegNB[0]->SetPcbBoards(n4);
487 slatsegNB[0]->Init(0); // 0 detection element id
489 // Type 112233 for 701, 712, 714, 725 in Ch7 (similar for Ch8)
490 // for the futur official numbering
491 // Type 112233 for 705, 707, 755, 757 in Ch7 (similar for Ch8)
492 // actual numbering in the code to be changed in jan05
493 // Type 112233 for 901, 902, 911, 912, 914, 915, 924, 925 in Ch9
494 // (similar for Ch10) for the futur official numbering
495 // Type 112233 for 904, 905, 907, 908, 954, 955, 957, 958 in Ch9
496 // (similar for Ch10) actual numbering in the code to be changed in jan05
497 Int_t n5[4] = { 0, 2, 2, 2 };
498 slatsegB[1]->SetPcbBoards(n5);
499 slatsegB[1]->Init(0); // 0 detection element id
500 slatsegNB[1]->SetPcbBoards(n5);
501 slatsegNB[1]->Init(0); // 0 detection element id
503 // Type 112230 for 702, 711, 715, 724 in Ch7 (similar for Ch8)
504 // for the futur official numbering
505 // Type 112230 for 704, 708, 754, 758 in Ch7 (similar for Ch8)
506 // actual numbering in the code to be changed in jan05
507 Int_t n6[4] = { 0, 2, 2, 1 };
508 slatsegB[2]->SetPcbBoards(n6);
509 slatsegB[2]->Init(0); // 0 detection element id
510 slatsegNB[2]->SetPcbBoards(n6);
511 slatsegNB[2]->Init(0); // 0 detection element id
513 // Type 222330 for 703, 710, 716, 723 in Ch7 (similar for Ch8)
514 // for the futur official numbering
515 // Type 222330 for 703, 709, 753, 759 in Ch7 (similar for Ch8)
516 // actual numbering in the code to be changed in jan05
517 Int_t n7[4] = { 0, 0, 3, 2 };
518 slatsegB[3]->SetPcbBoards(n7);
519 slatsegB[3]->Init(0); // 0 detection element id
520 slatsegNB[3]->SetPcbBoards(n7);
521 slatsegNB[3]->Init(0); // 0 detection element id
523 // Type 223300 for 704, 709, 717, 722 in Ch7 (similar for Ch8)
524 // for the futur official numbering
525 // Type 223300 for 702, 710, 752, 760 in Ch7 (similar for Ch8)
526 // actual numbering in the code to be changed in jan05
527 Int_t n8[4] = { 0, 0, 2, 2 };
528 slatsegB[4]->SetPcbBoards(n8);
529 slatsegB[4]->Init(0); // 0 detection element id
530 slatsegNB[4]->SetPcbBoards(n8);
531 slatsegNB[4]->Init(0); // 0 detection element id
533 // Type 333000 for 705, 708, 718, 721 in Ch7 (similar for Ch8)
534 // for the futur official numbering
535 // Type 333000 for 701, 711, 751, 761 in Ch7 (similar for Ch8)
536 // actual numbering in the code to be changed in jan05
537 // Type 333000 for 906, 907, 919, 920 in Ch9 (similar for Ch10)
538 // for the futur official numbering
539 // Type 333000 for 900, 912, 950, 962 in Ch9 (similar for Ch10)
540 // actual numbering in the code to be changed in jan05
541 Int_t n9[4] = { 0, 0, 0, 3 };
542 slatsegB[5]->SetPcbBoards(n9);
543 slatsegB[5]->Init(0); // 0 detection element id
544 slatsegNB[5]->SetPcbBoards(n9);
545 slatsegNB[5]->Init(0); // 0 detection element id
547 // Type 330000 for 706, 707, 719, 720 in Ch7 (similar for Ch8)
548 // for the futur official numbering
549 // Type 330000 for 700, 712, 750, 762 in Ch7 (similar for Ch8)
550 // actual numbering in the code to be changed in jan05
551 Int_t n10[4] = { 0, 0, 0, 2 };
552 slatsegB[6]->SetPcbBoards(n10);
553 slatsegB[6]->Init(0); // 0 detection element id
554 slatsegNB[6]->SetPcbBoards(n10);
555 slatsegNB[6]->Init(0); // 0 detection element id
558 for (Int_t chamber = 6; chamber < 8; chamber++) {
560 const AliMUONGeometryModuleTransformer* kModuleTransformer
561 = fkTransformer->GetModuleTransformer(chamber);
563 segmentation[0] = new AliMUONGeometrySegmentation(kModuleTransformer);
564 segmentation[1] = new AliMUONGeometrySegmentation(kModuleTransformer);
566 // id detection elt for chamber 1
567 Int_t id0 = (chamber+1)*100;
569 //--------------------------------------------------------
570 // Configuration for Chamber TC6/7 (Station 4) ----------
574 segmentation[0]->Add(id0+13, "Undefined", slatsegB[0]);
575 segmentation[0]->Add(id0 , "Undefined", slatsegB[0]);
578 segmentation[0]->Add(id0+14, "Undefined", slatsegB[1]);
579 segmentation[0]->Add(id0+12, "Undefined", slatsegB[1]);
580 segmentation[0]->Add(id0+25, "Undefined", slatsegB[1]);
581 segmentation[0]->Add(id0+ 1, "Undefined", slatsegB[1]);
584 segmentation[0]->Add(id0+15, "Undefined", slatsegB[2]);
585 segmentation[0]->Add(id0+11, "Undefined", slatsegB[2]);
586 segmentation[0]->Add(id0+24, "Undefined", slatsegB[2]);
587 segmentation[0]->Add(id0+ 2, "Undefined", slatsegB[2]);
590 segmentation[0]->Add(id0+16, "Undefined", slatsegB[3]);
591 segmentation[0]->Add(id0+10, "Undefined", slatsegB[3]);
592 segmentation[0]->Add(id0+23, "Undefined", slatsegB[3]);
593 segmentation[0]->Add(id0+ 3, "Undefined", slatsegB[3]);
596 segmentation[0]->Add(id0+17, "Undefined", slatsegB[4]);
597 segmentation[0]->Add(id0+ 9, "Undefined", slatsegB[4]);
598 segmentation[0]->Add(id0+22, "Undefined", slatsegB[4]);
599 segmentation[0]->Add(id0+ 4, "Undefined", slatsegB[4]);
602 segmentation[0]->Add(id0+18, "Undefined", slatsegB[5]);
603 segmentation[0]->Add(id0+ 8, "Undefined", slatsegB[5]);
604 segmentation[0]->Add(id0+21, "Undefined", slatsegB[5]);
605 segmentation[0]->Add(id0+ 5, "Undefined", slatsegB[5]);
608 segmentation[0]->Add(id0+19, "Undefined", slatsegB[6]);
609 segmentation[0]->Add(id0+ 7, "Undefined", slatsegB[6]);
610 segmentation[0]->Add(id0+20, "Undefined", slatsegB[6]);
611 segmentation[0]->Add(id0+ 6, "Undefined", slatsegB[6]);
612 Segmentation()->AddModuleSegmentation(chamber, 0, segmentation[0]);
616 segmentation[1]->Add(id0+13, "Undefined", slatsegNB[0]);
617 segmentation[1]->Add(id0 , "Undefined", slatsegNB[0]);
620 segmentation[1]->Add(id0+14, "Undefined", slatsegNB[1]);
621 segmentation[1]->Add(id0+12, "Undefined", slatsegNB[1]);
622 segmentation[1]->Add(id0+25, "Undefined", slatsegNB[1]);
623 segmentation[1]->Add(id0+ 1, "Undefined", slatsegNB[1]);
626 segmentation[1]->Add(id0+15, "Undefined", slatsegNB[2]);
627 segmentation[1]->Add(id0+11, "Undefined", slatsegNB[2]);
628 segmentation[1]->Add(id0+24, "Undefined", slatsegNB[2]);
629 segmentation[1]->Add(id0+ 2, "Undefined", slatsegNB[2]);
632 segmentation[1]->Add(id0+16, "Undefined", slatsegNB[3]);
633 segmentation[1]->Add(id0+10, "Undefined", slatsegNB[3]);
634 segmentation[1]->Add(id0+23, "Undefined", slatsegNB[3]);
635 segmentation[1]->Add(id0+ 3, "Undefined", slatsegNB[3]);
638 segmentation[1]->Add(id0+17, "Undefined", slatsegNB[4]);
639 segmentation[1]->Add(id0+ 9, "Undefined", slatsegNB[4]);
640 segmentation[1]->Add(id0+22, "Undefined", slatsegNB[4]);
641 segmentation[1]->Add(id0+ 4, "Undefined", slatsegNB[4]);
644 segmentation[1]->Add(id0+18, "Undefined", slatsegNB[5]);
645 segmentation[1]->Add(id0+ 8, "Undefined", slatsegNB[5]);
646 segmentation[1]->Add(id0+21, "Undefined", slatsegNB[5]);
647 segmentation[1]->Add(id0+ 5, "Undefined", slatsegNB[5]);
650 segmentation[1]->Add(id0+19, "Undefined", slatsegNB[6]);
651 segmentation[1]->Add(id0+ 7, "Undefined", slatsegNB[6]);
652 segmentation[1]->Add(id0+20, "Undefined", slatsegNB[6]);
653 segmentation[1]->Add(id0+ 6, "Undefined", slatsegNB[6]);
654 Segmentation()->AddModuleSegmentation(chamber, 1, segmentation[1]);
658 //__________________________________________________________________________
659 void AliMUONSegFactory::BuildStation5()
661 /// Configuration for Chamber TC9/10 (Station 5) ---------
663 AliMUONGeometrySegmentation* segmentation[2];
665 //Slats Segmentations
666 AliMUONSt345SlatSegmentation *slatsegB[6]; // Types of segmentation for St5
667 AliMUONSt345SlatSegmentation *slatsegNB[6];
670 Int_t ndiv[4] ={ 4, 4, 2, 1}; // densities zones
671 for(Int_t i = 0; i < 6; i++) {
672 slatsegB[i] = new AliMUONSt345SlatSegmentation(1);
673 Segmentation()->AddDESegmentation(slatsegB[i]);
674 slatsegB[i]->SetPadSize(10.,0.5);
675 slatsegB[i]->SetPadDivision(ndiv);
676 slatsegB[i]->SetId(1);
677 slatsegB[i]->SetDAnod(AliMUONConstants::Pitch());
678 slatsegNB[i] = new AliMUONSt345SlatSegmentation(0);
679 Segmentation()->AddDESegmentation(slatsegNB[i]);
680 slatsegNB[i]->SetPadSize(1./1.4,10.);
681 slatsegNB[i]->SetPadDivision(ndiv);
682 slatsegNB[i]->SetId(1);
683 slatsegNB[i]->SetDAnod(AliMUONConstants::Pitch());
686 // Type 122330 for 900, 913 in Ch9 (similar for Ch10)
687 // for the futur official numbering
688 // Type 122330 for 906, 956 in Ch9 (similar for Ch10)
689 // actual numbering in the code to be changed in jan05
690 Int_t n4[4] = { 0, 1, 2, 2 };
691 slatsegB[0]->SetPcbBoards(n4);
692 slatsegB[0]->Init(0); // 0 detection element id
693 slatsegNB[0]->SetPcbBoards(n4);
694 slatsegNB[0]->Init(0); // 0 detection element id
696 // Type 112233 for 901, 902, 911, 912, 914, 915, 924, 925 in Ch9
697 // (similar for Ch10) for the futur official numbering
698 // Type 112233 for 904, 905, 907, 908, 954, 955, 957, 958 in Ch9
699 // (similar for Ch10) actual numbering in the code to be changed in jan05
700 Int_t n5[4] = { 0, 2, 2, 2 };
701 slatsegB[1]->SetPcbBoards(n5);
702 slatsegB[1]->Init(0); // 0 detection element id
703 slatsegNB[1]->SetPcbBoards(n5);
704 slatsegNB[1]->Init(0); // 0 detection element id
706 // Type 333000 for 906, 907, 919, 920 in Ch9 (similar for Ch10)
707 // for the futur official numbering
708 // Type 333000 for 900, 912, 950, 962 in Ch9 (similar for Ch10)
709 // actual numbering in the code to be changed in jan05
710 Int_t n9[4] = { 0, 0, 0, 3 };
711 slatsegB[2]->SetPcbBoards(n9);
712 slatsegB[2]->Init(0); // 0 detection element id
713 slatsegNB[2]->SetPcbBoards(n9);
714 slatsegNB[2]->Init(0); // 0 detection element id
716 // Type 222333 for 903, 910, 916, 923 in Ch9 (similar for Ch10)
717 // for the futur official numbering
718 // Type 222333 for 903, 909, 953, 959 in Ch9 (similar for Ch10)
719 // actual numbering in the code to be changed in jan05
720 Int_t n11[4] = { 0, 0, 3, 3 };
721 slatsegB[3]->SetPcbBoards(n11);
722 slatsegB[3]->Init(0); // 0 detection element id
723 slatsegNB[3]->SetPcbBoards(n11);
724 slatsegNB[3]->Init(0); // 0 detection element id
726 // Type 223330 for 904, 909, 917, 922 in Ch9 (similar for Ch10)
727 // for the futur official numbering
728 // Type 223330 for 902, 910, 952, 960 in Ch9 (similar for Ch10)
729 // actual numbering in the code to be changed in jan05
730 Int_t n12[4] = { 0, 0, 2, 3 };
731 slatsegB[4]->SetPcbBoards(n12);
732 slatsegB[4]->Init(0); // 0 detection element id
733 slatsegNB[4]->SetPcbBoards(n12);
734 slatsegNB[4]->Init(0); // 0 detection element id
736 // Type 333300 for 905, 908, 918, 921 in Ch9 (similar for Ch10)
737 // for the futur official numbering
738 // Type 333300 for 901, 911, 951, 961 in Ch9 (similar for Ch10)
739 // actual numbering in the code to be changed in jan05
740 Int_t n13[4] = { 0, 0, 0, 4 };
741 slatsegB[5]->SetPcbBoards(n13);
742 slatsegB[5]->Init(0); // 0 detection element id
743 slatsegNB[5]->SetPcbBoards(n13);
744 slatsegNB[5]->Init(0); // 0 detection element id
746 for (Int_t chamber = 8; chamber < 10; chamber++) {
748 const AliMUONGeometryModuleTransformer* kModuleTransformer
749 = fkTransformer->GetModuleTransformer(chamber);
751 segmentation[0] = new AliMUONGeometrySegmentation(kModuleTransformer);
752 segmentation[1] = new AliMUONGeometrySegmentation(kModuleTransformer);
754 // id detection elt for chamber 1
755 Int_t id0 = (chamber+1)*100;
757 //--------------------------------------------------------
758 // Configuration for Chamber TC8/9 (Station 5) ----------
762 segmentation[0]->Add(id0+13, "Undefined", slatsegB[0]);
763 segmentation[0]->Add(id0 , "Undefined", slatsegB[0]);
766 segmentation[0]->Add(id0+15, "Undefined", slatsegB[1]);
767 segmentation[0]->Add(id0+14, "Undefined", slatsegB[1]);
768 segmentation[0]->Add(id0+12, "Undefined", slatsegB[1]);
769 segmentation[0]->Add(id0+11, "Undefined", slatsegB[1]);
770 segmentation[0]->Add(id0+24, "Undefined", slatsegB[1]);
771 segmentation[0]->Add(id0+25, "Undefined", slatsegB[1]);
772 segmentation[0]->Add(id0+ 1, "Undefined", slatsegB[1]);
773 segmentation[0]->Add(id0+ 2, "Undefined", slatsegB[1]);
776 segmentation[0]->Add(id0+19, "Undefined", slatsegB[2]);
777 segmentation[0]->Add(id0+ 7, "Undefined", slatsegB[2]);
778 segmentation[0]->Add(id0+20, "Undefined", slatsegB[2]);
779 segmentation[0]->Add(id0+ 6, "Undefined", slatsegB[2]);
782 segmentation[0]->Add(id0+16, "Undefined", slatsegB[3]);
783 segmentation[0]->Add(id0+10, "Undefined", slatsegB[3]);
784 segmentation[0]->Add(id0+23, "Undefined", slatsegB[3]);
785 segmentation[0]->Add(id0+ 3, "Undefined", slatsegB[3]);
788 segmentation[0]->Add(id0+17, "Undefined", slatsegB[4]);
789 segmentation[0]->Add(id0+ 9, "Undefined", slatsegB[4]);
790 segmentation[0]->Add(id0+22, "Undefined", slatsegB[4]);
791 segmentation[0]->Add(id0+ 4, "Undefined", slatsegB[4]);
794 segmentation[0]->Add(id0+18, "Undefined", slatsegB[5]);
795 segmentation[0]->Add(id0+ 8, "Undefined", slatsegB[5]);
796 segmentation[0]->Add(id0+21, "Undefined", slatsegB[5]);
797 segmentation[0]->Add(id0+ 5, "Undefined", slatsegB[5]);
798 Segmentation()->AddModuleSegmentation(chamber, 0, segmentation[0]);
802 segmentation[1]->Add(id0+13, "Undefined", slatsegNB[0]);
803 segmentation[1]->Add(id0 , "Undefined", slatsegNB[0]);
806 segmentation[1]->Add(id0+15, "Undefined", slatsegNB[1]);
807 segmentation[1]->Add(id0+14, "Undefined", slatsegNB[1]);
808 segmentation[1]->Add(id0+12, "Undefined", slatsegNB[1]);
809 segmentation[1]->Add(id0+11, "Undefined", slatsegNB[1]);
810 segmentation[1]->Add(id0+24, "Undefined", slatsegNB[1]);
811 segmentation[1]->Add(id0+25, "Undefined", slatsegNB[1]);
812 segmentation[1]->Add(id0+ 1, "Undefined", slatsegNB[1]);
813 segmentation[1]->Add(id0+ 2, "Undefined", slatsegNB[1]);
816 segmentation[1]->Add(id0+19 , "Undefined", slatsegNB[2]);
817 segmentation[1]->Add(id0+ 7, "Undefined", slatsegNB[2]);
818 segmentation[1]->Add(id0+20, "Undefined", slatsegNB[2]);
819 segmentation[1]->Add(id0+ 6, "Undefined", slatsegNB[2]);
822 segmentation[1]->Add(id0+16, "Undefined", slatsegNB[3]);
823 segmentation[1]->Add(id0+10, "Undefined", slatsegNB[3]);
824 segmentation[1]->Add(id0+23, "Undefined", slatsegNB[3]);
825 segmentation[1]->Add(id0+ 3, "Undefined", slatsegNB[3]);
828 segmentation[1]->Add(id0+17, "Undefined", slatsegNB[4]);
829 segmentation[1]->Add(id0+ 9, "Undefined", slatsegNB[4]);
830 segmentation[1]->Add(id0+22, "Undefined", slatsegNB[4]);
831 segmentation[1]->Add(id0+ 4, "Undefined", slatsegNB[4]);
834 segmentation[1]->Add(id0+18, "Undefined", slatsegNB[5]);
835 segmentation[1]->Add(id0+ 8, "Undefined", slatsegNB[5]);
836 segmentation[1]->Add(id0+21, "Undefined", slatsegNB[5]);
837 segmentation[1]->Add(id0+ 5, "Undefined", slatsegNB[5]);
838 Segmentation()->AddModuleSegmentation(chamber, 1, segmentation[1]);
842 //__________________________________________________________________________
843 void AliMUONSegFactory::BuildStation6()
845 /// Configuration for Trigger stations
848 AliMUONGeometrySegmentation *chamberSeg[2];
850 for (Int_t chamber = 10; chamber < 14; chamber++) {
852 //Trigger Segmentation
853 AliMUONTriggerSegmentation *trigSegX[9];
854 AliMUONTriggerSegmentation *trigSegY[9];
855 for(Int_t i=0; i<9; i++) {
856 trigSegX[i] = new AliMUONTriggerSegmentation(1);
857 trigSegY[i] = new AliMUONTriggerSegmentation(0);
858 Segmentation()->AddDESegmentation(trigSegX[i]);
859 Segmentation()->AddDESegmentation(trigSegY[i]);
860 trigSegX[i]->SetLineNumber(9-i);
861 trigSegY[i]->SetLineNumber(9-i);
864 //AliMUONChamber *iChamber, *iChamber1;
865 //iChamber1 = &fMUON->Chamber(10);
866 //iChamber = &fMUON->Chamber(chamber);
867 //Float_t zpos1= iChamber1->Z();
868 //Float_t zpos = iChamber->Z();
869 Float_t zpos1= AliMUONConstants::DefaultChamberZ(10);
870 Float_t zpos = AliMUONConstants::DefaultChamberZ(chamber);
871 Float_t zRatio = zpos / zpos1;
874 Float_t stripWidth[3]={0.,0.,0.}; // 1.0625 2.125 4.25
875 Float_t stripLength[4]={0.,0.,0.,0.}; // 17. 34. 51. 68.
876 for (Int_t i=0; i<3; i++)
877 stripWidth[i]=AliMUONTriggerConstants::StripWidth(i)*zRatio;
878 for (Int_t i=0; i<4; i++)
879 stripLength[i]=AliMUONTriggerConstants::StripLength(i)*zRatio;
880 Int_t nStrip[7]={0,0,0,0,0,0,0};
881 Float_t stripYsize[7]={0.,0.,0.,0.,0.,0.,0.};
882 Float_t stripXsize[7]={0.,0.,0.,0.,0.,0.,0.};
884 // chamber 8 0 cathode 0
885 for (Int_t i=0; i<7; i++) nStrip[i]=16;
886 for (Int_t i=0; i<7; i++) stripYsize[i]=stripWidth[2];
887 for (Int_t i=0; i<6; i++) stripXsize[i]=stripLength[1];
888 stripXsize[6]=stripLength[2];
889 trigSegX[8]->Init(0,nStrip,stripYsize,stripXsize,0.);
890 trigSegX[0]->Init(0,nStrip,stripYsize,stripXsize,0.);
892 // chamber 8 7 1 0 cathode 1
893 for (Int_t i=0; i<6; i++) nStrip[i]=8;
895 for (Int_t i=0; i<7; i++) stripYsize[i]=stripLength[3];
896 for (Int_t i=0; i<7; i++) stripXsize[i]=stripWidth[2];
897 trigSegY[8]->Init(0,nStrip,stripYsize,stripXsize,0.);
898 trigSegY[7]->Init(0,nStrip,stripYsize,stripXsize,0.);
899 trigSegY[1]->Init(0,nStrip,stripYsize,stripXsize,0.);
900 trigSegY[0]->Init(0,nStrip,stripYsize,stripXsize,0.);
902 // chamber 7 6 2 1 cathode 0
903 for (Int_t i=0; i<6; i++) nStrip[i]=32;
905 for (Int_t i=0; i<6; i++) stripYsize[i]=stripWidth[1];
906 stripYsize[6]=stripWidth[2];
907 for (Int_t i=0; i<6; i++) stripXsize[i]=stripLength[1];
908 stripXsize[6]=stripLength[2];
909 trigSegX[7]->Init(0,nStrip,stripYsize,stripXsize,0.);
910 trigSegX[6]->Init(0,nStrip,stripYsize,stripXsize,0.);
911 trigSegX[2]->Init(0,nStrip,stripYsize,stripXsize,0.);
912 trigSegX[1]->Init(0,nStrip,stripYsize,stripXsize,0.);
914 // chamber 6 2 cathode 1
915 for (Int_t i=0; i<5; i++) nStrip[i]=16;
916 for (Int_t i=5; i<6; i++) nStrip[i]=8;
918 for (Int_t i=0; i<7; i++) stripYsize[i]=stripLength[3];
919 for (Int_t i=0; i<5; i++) stripXsize[i]=stripWidth[1];
920 for (Int_t i=5; i<7; i++) stripXsize[i]=stripWidth[2];
921 trigSegY[6]->Init(0,nStrip,stripYsize,stripXsize,0.);
922 trigSegY[2]->Init(0,nStrip,stripYsize,stripXsize,0.);
924 // chamber 5 3 cathode 0
926 for (Int_t i=1; i<3; i++) nStrip[i]=64;
927 for (Int_t i=3; i<6; i++) nStrip[i]=32;
929 for (Int_t i=0; i<3; i++) stripYsize[i]=stripWidth[0];
930 for (Int_t i=3; i<6; i++) stripYsize[i]=stripWidth[1];
931 stripYsize[6]=stripWidth[2];
932 for (Int_t i=0; i<6; i++) stripXsize[i]=stripLength[1];
933 stripXsize[6]=stripLength[2];
934 trigSegX[5]->Init(0,nStrip,stripYsize,stripXsize,stripLength[0]);
935 trigSegX[3]->Init(0,nStrip,stripYsize,stripXsize,0.);
937 // chamber 5 3 cathode 1
938 for (Int_t i=0; i<5; i++) nStrip[i]=16;
939 for (Int_t i=5; i<6; i++) nStrip[5]=8;
941 stripYsize[0]=stripLength[2];
942 for (Int_t i=1; i<7; i++) stripYsize[i]=stripLength[3];
943 for (Int_t i=0; i<5; i++) stripXsize[i]=stripWidth[1];
944 for (Int_t i=5; i<7; i++) stripXsize[i]=stripWidth[2];
945 trigSegY[5]->Init(0,nStrip,stripYsize,stripXsize,stripLength[0]);
946 trigSegY[3]->Init(0,nStrip,stripYsize,stripXsize,0.);
948 // chamber 4 cathode 0
950 for (Int_t i=1; i<3; i++) nStrip[i]=64;
951 for (Int_t i=3; i<6; i++) nStrip[i]=32;
954 for (Int_t i=1; i<3; i++) stripYsize[i]=stripWidth[0];
955 for (Int_t i=3; i<6; i++) stripYsize[i]=stripWidth[1];
956 stripYsize[6]=stripWidth[2];
958 stripXsize[1]=stripLength[0];
959 for (Int_t i=2; i<6; i++) stripXsize[i]=stripLength[1];
960 stripXsize[6]=stripLength[2];
961 trigSegX[4]->Init(0,nStrip,stripYsize,stripXsize,0.);
963 // chamber 4 cathode 1
966 for (Int_t i=2; i<5; i++) nStrip[i]=16;
967 for (Int_t i=5; i<6; i++) nStrip[i]=8;
970 for (Int_t i=1; i<7; i++) stripYsize[i]=stripLength[3];
972 for (Int_t i=1; i<5; i++) stripXsize[i]=stripWidth[1];
973 for (Int_t i=5; i<7; i++) stripXsize[i]=stripWidth[2];
974 trigSegY[4]->Init(0,nStrip,stripYsize,stripXsize,0.);
976 const AliMUONGeometryModuleTransformer* kModuleTransformer
977 = fkTransformer->GetModuleTransformer(chamber);
979 chamberSeg[0] = new AliMUONGeometrySegmentation(kModuleTransformer);
980 chamberSeg[1] = new AliMUONGeometrySegmentation(kModuleTransformer);
982 Int_t icount=chamber-10; // chamber counter (0 1 2 3)
983 Int_t id0=(10+icount+1)*100;
986 // printf("in CreateTriggerSegmentation here 0 id0=%i \n",id0);
987 chamberSeg[0]->Add(id0+0, "Undefined", trigSegX[4]);
988 chamberSeg[0]->Add(id0+1, "Undefined", trigSegX[5]);
989 chamberSeg[0]->Add(id0+2, "Undefined", trigSegX[6]);
990 chamberSeg[0]->Add(id0+3, "Undefined", trigSegX[7]);
991 chamberSeg[0]->Add(id0+4, "Undefined", trigSegX[8]);
992 chamberSeg[0]->Add(id0+5, "Undefined", trigSegX[8]);
993 chamberSeg[0]->Add(id0+6, "Undefined", trigSegX[7]);
994 chamberSeg[0]->Add(id0+7, "Undefined", trigSegX[6]);
995 chamberSeg[0]->Add(id0+8, "Undefined", trigSegX[5]);
996 chamberSeg[0]->Add(id0+9, "Undefined", trigSegX[4]);
997 chamberSeg[0]->Add(id0+10, "Undefined", trigSegX[3]);
998 chamberSeg[0]->Add(id0+11, "Undefined", trigSegX[2]);
999 chamberSeg[0]->Add(id0+12, "Undefined", trigSegX[1]);
1000 chamberSeg[0]->Add(id0+13, "Undefined", trigSegX[0]);
1001 chamberSeg[0]->Add(id0+14, "Undefined", trigSegX[0]);
1002 chamberSeg[0]->Add(id0+15, "Undefined", trigSegX[1]);
1003 chamberSeg[0]->Add(id0+16, "Undefined", trigSegX[2]);
1004 chamberSeg[0]->Add(id0+17, "Undefined", trigSegX[3]);
1006 chamberSeg[1]->Add(id0+0, "Undefined", trigSegY[4]);
1007 chamberSeg[1]->Add(id0+1, "Undefined", trigSegY[5]);
1008 chamberSeg[1]->Add(id0+2, "Undefined", trigSegY[6]);
1009 chamberSeg[1]->Add(id0+3, "Undefined", trigSegY[7]);
1010 chamberSeg[1]->Add(id0+4, "Undefined", trigSegY[8]);
1011 chamberSeg[1]->Add(id0+5, "Undefined", trigSegY[8]);
1012 chamberSeg[1]->Add(id0+6, "Undefined", trigSegY[7]);
1013 chamberSeg[1]->Add(id0+7, "Undefined", trigSegY[6]);
1014 chamberSeg[1]->Add(id0+8, "Undefined", trigSegY[5]);
1015 chamberSeg[1]->Add(id0+9, "Undefined", trigSegY[4]);
1016 chamberSeg[1]->Add(id0+10, "Undefined", trigSegY[3]);
1017 chamberSeg[1]->Add(id0+11, "Undefined", trigSegY[2]);
1018 chamberSeg[1]->Add(id0+12, "Undefined", trigSegY[1]);
1019 chamberSeg[1]->Add(id0+13, "Undefined", trigSegY[0]);
1020 chamberSeg[1]->Add(id0+14, "Undefined", trigSegY[0]);
1021 chamberSeg[1]->Add(id0+15, "Undefined", trigSegY[1]);
1022 chamberSeg[1]->Add(id0+16, "Undefined", trigSegY[2]);
1023 chamberSeg[1]->Add(id0+17, "Undefined", trigSegY[3]);
1025 Segmentation()->AddModuleSegmentation(chamber, 0, chamberSeg[0]);
1026 Segmentation()->AddModuleSegmentation(chamber, 1, chamberSeg[1]);
1028 // printf("in CreateTriggerSegmentation here 1\n");
1030 AliWarning(Form("Segmentation for chamber %d is not yet defined",chamber));