Project
Loading...
Searching...
No Matches
GeometryTGeo.cxx
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
13#include <TGeoManager.h>
15
17
18namespace o2
19{
20namespace trk
21{
22std::unique_ptr<o2::trk::GeometryTGeo> GeometryTGeo::sInstance;
23
24// Names
25std::string GeometryTGeo::sVolumeName = "TRKV";
26std::string GeometryTGeo::sLayerName = "TRKLayer";
27std::string GeometryTGeo::sPetalName = "PETALCASE";
28std::string GeometryTGeo::sPetalDiskName = "DISK";
29std::string GeometryTGeo::sPetalLayerName = "LAYER";
30std::string GeometryTGeo::sStaveName = "TRKStave";
31std::string GeometryTGeo::sChipName = "TRKChip";
32std::string GeometryTGeo::sSensorName = "TRKSensor";
33std::string GeometryTGeo::sWrapperVolumeName = "TRKUWrapVol";
34
36{
37 if (!mOwner) {
38 mOwner = true;
39 sInstance.release();
40 }
41}
42GeometryTGeo::GeometryTGeo(bool build, int loadTrans) : DetMatrixCache(detectors::DetID::TRK)
43{
44 if (sInstance) {
45 LOGP(fatal, "Invalid use of public constructor: o2::trk::GeometryTGeo instance exists");
46 }
47 mLayerToWrapper.fill(-1);
48 if (build) {
49 Build(loadTrans);
50 }
51}
52
53//__________________________________________________________________________
54void GeometryTGeo::Build(int loadTrans)
55{
60
61 if (isBuilt()) {
62 LOGP(warning, "Already built");
63 return; // already initialized
64 }
65
66 if (gGeoManager == nullptr) {
67 LOGP(fatal, "Geometry is not loaded");
68 }
69
75
85
86 for (int i = 0; i < mNumberOfLayersMLOT; i++) {
87 std::cout << "Layer MLOT: " << i << std::endl;
90 }
91
92 int numberOfChipsTotal = 0;
93
95 for (int i = 0; i < mNumberOfPetalsVD; i++) {
97 numberOfChipsTotal += mNumberOfChipsPerPetalVD[i];
98 mLastChipIndex[i] = numberOfChipsTotal - 1;
99 mLastChipIndexVD[i] = numberOfChipsTotal - 1;
100 }
101
103 for (int i = 0; i < mNumberOfLayersMLOT; i++) {
104 mNumberOfChipsPerLayerMLOT[i] = extractNumberOfStavesMLOT(i) * extractNumberOfHalfStavesMLOT(i); // for the moment, considering 1 half stave = 1 chip. TODO: add the final segmentation in chips
105 numberOfChipsTotal += mNumberOfChipsPerLayerMLOT[i];
106 mLastChipIndex[i + mNumberOfPetalsVD] = numberOfChipsTotal - 1;
107 mLastChipIndexMLOT[i] = numberOfChipsTotal - 1;
108 }
109
110 setSize(numberOfChipsTotal);
111 fillMatrixCache(loadTrans);
112}
113
114//__________________________________________________________________________
116{
117 if (index <= mLastChipIndexVD[mLastChipIndexVD.size() - 1]) {
118 return 0;
119 } else if (index > mLastChipIndexVD[mLastChipIndexVD.size() - 1]) {
120 return 1;
121 }
122 return -1;
123}
124
125//__________________________________________________________________________
127{
128 int petalcase = 0;
129
130 int subDetID = getSubDetID(index);
131 if (subDetID == 1) {
132 return -1;
133 }
134
135 else if (index <= mLastChipIndexVD[mNumberOfPetalsVD - 1]) {
136 while (index > mLastChipIndexVD[petalcase]) {
137 petalcase++;
138 }
139 }
140 return petalcase;
141}
142
143//__________________________________________________________________________
145{
146 int subDetID = getSubDetID(index);
147 int petalcase = getPetalCase(index);
148 int lay = 0;
149
150 if (subDetID == 0) {
152 return -1;
153 }
154 return index % mNumberOfChipsPerPetalVD[petalcase];
155 } else if (subDetID == 1) {
156 while (index > mLastChipIndex[lay]) {
157 lay++;
158 }
159 return lay - mNumberOfPetalsVD;
160 }
161 return -1;
162}
163//__________________________________________________________________________
165{
166 int subDetID = getSubDetID(index);
167 int lay = getLayer(index);
168 int petalcase = getPetalCase(index);
169
170 if (subDetID == 0) {
171 return -1;
172 } else if (subDetID == 1) {
173 int lay = getLayer(index);
174 index -= getFirstChipIndex(lay, petalcase, subDetID); // get the index of the sensing element in the layer
175 return index / mNumberOfHalfStaves[lay];
176 }
177 return -1;
178}
179
180//__________________________________________________________________________
182{
183 int subDetID = getSubDetID(index);
184 int lay = getLayer(index);
185 int petalcase = getPetalCase(index);
186 int stave = getStave(index);
187
188 if (subDetID == 0) {
189 return -1;
190 } else if (subDetID == 1) {
191 int lay = getLayer(index);
192 index -= getFirstChipIndex(lay, petalcase, subDetID); // get the index of the sensing element in the layer
193 return index % 2;
194 }
195 return -1;
196}
197
198//__________________________________________________________________________
200{
201 int subDetID = getSubDetID(index);
202 int petalcase = getPetalCase(index);
203
204 if (subDetID == 0) {
206 return -1;
207 }
208 return (index % mNumberOfChipsPerPetalVD[petalcase]) - mNumberOfLayersVD;
209 }
210
211 return -1;
212}
213
214//__________________________________________________________________________
215int GeometryTGeo::getChipIndex(int subDetID, int petalcase, int disk, int lay, int stave, int halfstave) const
216{
217 if (subDetID == 0) { // VD
218 if (lay == -1) { // disk
219 return getFirstChipIndex(lay, petalcase, subDetID) + mNumberOfLayersVD + disk;
220 } else { // layer
221 return getFirstChipIndex(lay, petalcase, subDetID) + lay;
222 }
223 } else if (subDetID == 1) { // MLOT
224 if (mNumberOfHalfStaves[lay] == 2) { // staggered geometry
225 return getFirstChipIndex(lay, petalcase, subDetID) + stave * mNumberOfHalfStaves[lay] + halfstave;
226 } else if (mNumberOfHalfStaves[lay] == 1) { // turbo geometry
227 return getFirstChipIndex(lay, petalcase, subDetID) + stave;
228 }
229 }
230 return -1; // not found
231}
232
233//__________________________________________________________________________
234int GeometryTGeo::getChipIndex(int subDetID, int volume, int lay, int stave, int halfstave) const
235{
236 if (subDetID == 0) { // VD
237 return volume;
238
239 } else if (subDetID == 1) { // MLOT
240 if (mNumberOfHalfStaves[lay] == 2) { // staggered geometry
241 return getFirstChipIndex(lay, -1, subDetID) + stave * mNumberOfHalfStaves[lay] + halfstave;
242 } else if (mNumberOfHalfStaves[lay] == 1) { // turbo geometry
243 return getFirstChipIndex(lay, -1, subDetID) + stave;
244 }
245 }
246 return -1; // not found
247}
248
249//__________________________________________________________________________
250bool GeometryTGeo::getChipID(int index, int& subDetID, int& petalcase, int& disk, int& lay, int& stave, int& halfstave) const
251{
252 subDetID = getSubDetID(index);
253 petalcase = getPetalCase(index);
254 disk = getDisk(index);
255 lay = getLayer(index);
256 stave = getStave(index);
257 halfstave = getHalfStave(index);
258
259 return kTRUE;
260}
261
262//__________________________________________________________________________
264{
265
266 int subDetID, petalcase, disk, layer, stave, halfstave;
267 getChipID(index, subDetID, petalcase, disk, layer, stave, halfstave);
268
269 // PrintChipID(index, subDetID, petalcase, disk, layer, stave, halfstave);
270
271 // TString path = "/cave_1/barrel_1/TRKV_2/TRKLayer0_1/TRKStave0_1/TRKChip0_1/TRKSensor0_1/"; /// dummy path, to be used for tests
272 TString path = Form("/cave_1/barrel_1/%s_2/", GeometryTGeo::getTRKVolPattern());
273
274 if (subDetID == 0) { // VD
275 if (disk >= 0) {
276 path += Form("%s%d_%s%d_1/", getTRKPetalPattern(), petalcase, getTRKPetalDiskPattern(), disk); // PETALCASEx_DISKy_1
277 path += Form("%s%d_%s%d_%s%d_1/", getTRKPetalPattern(), petalcase, getTRKPetalDiskPattern(), disk, getTRKChipPattern(), disk); // PETALCASEx_DISKy_TRKChipy_1
278 path += Form("%s%d_%s%d_%s%d_1/", getTRKPetalPattern(), petalcase, getTRKPetalDiskPattern(), disk, getTRKSensorPattern(), disk); // PETALCASEx_DISKy_TRKSensory_1
279 } else if (layer >= 0) {
280 path += Form("%s%d_%s%d_1/", getTRKPetalPattern(), petalcase, getTRKPetalLayerPattern(), layer); // PETALCASEx_LAYERy_1
281 path += Form("%s%d_%s%d_%s%d_1/", getTRKPetalPattern(), petalcase, getTRKPetalLayerPattern(), layer, getTRKStavePattern(), layer); // PETALCASEx_LAYERy_TRKStavey_1
282 path += Form("%s%d_%s%d_%s%d_1/", getTRKPetalPattern(), petalcase, getTRKPetalLayerPattern(), layer, getTRKChipPattern(), layer); // PETALCASEx_LAYERy_TRKChipy_1
283 path += Form("%s%d_%s%d_%s%d_1/", getTRKPetalPattern(), petalcase, getTRKPetalLayerPattern(), layer, getTRKSensorPattern(), layer); // PETALCASEx_LAYERy_TRKSensory_1
284 }
285 } else if (subDetID == 1) { // MLOT
286 path += Form("%s%d_1/", getTRKLayerPattern(), layer); // TRKLayerx_1
287 path += Form("%s%d_%d/", getTRKStavePattern(), layer, stave); // TRKStavex_y
288 if (mNumberOfHalfStaves[layer] == 2) { // staggered geometry
289 path += Form("%s%d_%d/", getTRKChipPattern(), layer, halfstave); // TRKChipx_0/1
290 } else if (mNumberOfHalfStaves[layer] == 1) { // turbo geometry
291 path += Form("%s%d_1/", getTRKChipPattern(), layer); // TRKChipx_1
292 }
293 path += Form("%s%d_1/", getTRKSensorPattern(), layer); // TRKSensorx_1
294 }
295 return path;
296}
297
298//__________________________________________________________________________
300{
301 // extract matrix transforming from the PHYSICAL sensor frame to global one
302 // Note, the if the effective sensitive layer thickness is smaller than the
303 // total physical sensor tickness, this matrix is biased and connot be used
304 // directly for transformation from sensor frame to global one.
305 // Therefore we need to add a shift
306
307 auto path = getMatrixPath(index);
308
309 static TGeoHMatrix matTmp;
310 gGeoManager->PushPath(); // Preserve the modeler state.
311
312 if (!gGeoManager->cd(path.Data())) {
313 gGeoManager->PopPath();
314 LOG(error) << "Error in cd-ing to " << path.Data();
315 return nullptr;
316 } // end if !gGeoManager
317
318 matTmp = *gGeoManager->GetCurrentMatrix(); // matrix may change after cd
319
320 // RSS
321 // matTmp.Print();
322 // Restore the modeler state.
323 gGeoManager->PopPath();
324
325 static int chipInGlo{0};
326
328 // account for the difference between physical sensitive layer (where charge collection is simulated) and effective sensor thicknesses
329 // in the VD case this will be accounted by specialized functions during the clusterization (following what it is done for ITS3)
330 // this can be done once the right sensor thickness is in place in the geometry
331 // double delta = 0.;
332 // if (getSubDetID(index) == 1){ /// ML/OT
333 // delta = Segmentation::SensorLayerThicknessVD - Segmentation::SiliconTickness;
334 // static TGeoTranslation tra(0., 0.5 * delta, 0.);
335 // matTmp *= tra;
336 // }
337 // std::cout<<"-----"<<std::endl;
338 // matTmp.Print();
339
340 return &matTmp;
341}
342
343//__________________________________________________________________________
345{
346 if (mSize < 1) {
347 LOG(warning) << "The method Build was not called yet";
348 Build(mask);
349 return;
350 }
351
352 // build matrices
353 if ((mask & o2::math_utils::bit2Mask(o2::math_utils::TransformType::L2G)) && !getCacheL2G().isFilled()) {
354 // Matrices for Local (Sensor!!! rather than the full chip) to Global frame transformation
355 LOGP(info, "Loading {} L2G matrices from TGeo; there are {} matrices", getName(), mSize);
356 auto& cacheL2G = getCacheL2G();
357 cacheL2G.setSize(mSize);
358
359 for (int i = 0; i < mSize; i++) {
360 TGeoHMatrix* hm = extractMatrixSensor(i);
361 cacheL2G.setMatrix(Mat3D(*hm), i);
362 }
363 }
364
365 // TODO: build matrices for the cases T2L, T2G and T2GRot when needed
366}
367
368//__________________________________________________________________________
369
370const char* GeometryTGeo::composeSymNameLayer(int d, int lr)
371{
372 return Form("%s/%s%d", composeSymNameTRK(d), getTRKLayerPattern(), lr);
373}
374
375const char* GeometryTGeo::composeSymNameStave(int d, int lr)
376{
377 return Form("%s/%s%d", composeSymNameLayer(d, lr), getTRKStavePattern(), lr);
378}
379
380const char* GeometryTGeo::composeSymNameChip(int d, int lr)
381{
382 return Form("%s/%s%d", composeSymNameStave(d, lr), getTRKChipPattern(), lr);
383}
384
385const char* GeometryTGeo::composeSymNameSensor(int d, int lr)
386{
387 return Form("%s/%s%d", composeSymNameChip(d, lr), getTRKSensorPattern(), lr);
388}
389
390//__________________________________________________________________________
391int GeometryTGeo::extractVolumeCopy(const char* name, const char* prefix) const
392{
393 TString nms = name;
394 if (!nms.BeginsWith(prefix)) {
395 return -1;
396 }
397 nms.Remove(0, strlen(prefix));
398 if (!isdigit(nms.Data()[0])) {
399 return -1;
400 }
401 return nms.Atoi();
402}
403
404//__________________________________________________________________________
406{
407 int numberOfLayers = 0;
408 TGeoVolume* trkV = gGeoManager->GetVolume(getTRKVolPattern());
409 if (trkV == nullptr) {
410 LOG(fatal) << getName() << " volume " << getTRKVolPattern() << " is not in the geometry";
411 }
412
413 // Loop on all TRKV nodes, count Layer volumes by checking names
414 // Build on the fly layer - wrapper correspondence
415 TObjArray* nodes = trkV->GetNodes();
416 // nodes->Print();
417 int nNodes = nodes->GetEntriesFast();
418 for (int j = 0; j < nNodes; j++) {
419 int lrID = -1;
420 auto nd = dynamic_cast<TGeoNode*>(nodes->At(j));
421 const char* name = nd->GetName();
422 if (strstr(name, getTRKLayerPattern()) != nullptr) {
423 numberOfLayers++;
425 LOG(fatal) << "Failed to extract layer ID from the " << name;
426 }
427 mLayerToWrapper[lrID] = -1; // not wrapped
428 } else if (strstr(name, getTRKWrapVolPattern()) != nullptr) { // this is a wrapper volume, may cointain layers
429 int wrID = -1;
431 LOG(fatal) << "Failed to extract wrapper ID from the " << name;
432 }
433 TObjArray* nodesW = nd->GetNodes();
434 int nNodesW = nodesW->GetEntriesFast();
435
436 for (int jw = 0; jw < nNodesW; jw++) {
437 auto ndW = dynamic_cast<TGeoNode*>(nodesW->At(jw))->GetName();
438 if (strstr(ndW, getTRKLayerPattern()) != nullptr) {
439 if ((lrID = extractVolumeCopy(ndW, GeometryTGeo::getTRKLayerPattern())) < 0) {
440 LOGP(fatal, "Failed to extract layer ID from wrapper volume '{}' from one of its nodes '{}'", name, ndW);
441 }
442 numberOfLayers++;
443 mLayerToWrapper[lrID] = wrID;
444 }
445 }
446 }
447 }
448 return numberOfLayers;
449}
450
451//__________________________________________________________________________
453{
454 // The number of active parts returned here is 36 = 4 petals * (3 layers + 6 disks)
455 int numberOfParts = 0;
456
457 TGeoVolume* vdV = gGeoManager->GetVolume(getTRKVolPattern());
458 if (vdV == nullptr) {
459 LOG(fatal) << getName() << " volume " << getTRKVolPattern() << " is not in the geometry";
460 }
461
462 // Loop on all TRKV nodes, count Layer volumes by checking names
463 TObjArray* nodes = vdV->GetNodes();
464 int nNodes = nodes->GetEntriesFast();
465 for (int j = 0; j < nNodes; j++) {
466 int lrID = -1;
467 auto nd = dynamic_cast<TGeoNode*>(nodes->At(j));
468 const char* name = nd->GetName();
469
470 if (strstr(name, getTRKPetalPattern()) != nullptr && (strstr(name, getTRKPetalLayerPattern()) != nullptr || strstr(name, getTRKPetalDiskPattern()) != nullptr)) {
471 numberOfParts++;
473 LOG(fatal) << "Failed to extract layer ID from the " << name;
474 }
475 }
476 }
477 return numberOfParts;
478}
479
480//__________________________________________________________________________
482{
483 // The number of disks returned here is 6
484 int numberOfDisks = 0;
485
486 TGeoVolume* vdV = gGeoManager->GetVolume(getTRKVolPattern());
487 if (vdV == nullptr) {
488 LOG(fatal) << getName() << " volume " << getTRKVolPattern() << " is not in the geometry";
489 }
490
491 // Loop on all TRKV nodes, count Layer volumes by checking names
492 TObjArray* nodes = vdV->GetNodes();
493 int nNodes = nodes->GetEntriesFast();
494 for (int j = 0; j < nNodes; j++) {
495 int lrID = -1;
496 auto nd = dynamic_cast<TGeoNode*>(nodes->At(j));
497 const char* name = nd->GetName();
498
499 if (strstr(name, Form("%s%s", getTRKPetalPattern(), "0")) != nullptr && (strstr(name, getTRKPetalDiskPattern()) != nullptr)) {
500 numberOfDisks++;
502 LOG(fatal) << "Failed to extract layer ID from the " << name;
503 }
504 }
505 }
506 return numberOfDisks;
507}
508
509//__________________________________________________________________________
511{
512 // The number of petals returned here is 4 = number of petals
513 int numberOfChips = 0;
514
515 TGeoVolume* vdV = gGeoManager->GetVolume(getTRKVolPattern());
516 if (vdV == nullptr) {
517 LOG(fatal) << getName() << " volume " << getTRKVolPattern() << " is not in the geometry";
518 }
519
520 // Loop on all TRKV nodes, count Layer volumes by checking names
521 TObjArray* nodes = vdV->GetNodes();
522 int nNodes = nodes->GetEntriesFast();
523 for (int j = 0; j < nNodes; j++) {
524 int lrID = -1;
525 auto nd = dynamic_cast<TGeoNode*>(nodes->At(j));
526 const char* name = nd->GetName();
527
528 if (strstr(name, getTRKPetalPattern()) != nullptr && (strstr(name, Form("%s%s", getTRKPetalLayerPattern(), "0")) != nullptr)) {
529 numberOfChips++;
531 LOG(fatal) << "Failed to extract layer ID from the " << name;
532 }
533 }
534 }
535 return numberOfChips;
536}
537
538//__________________________________________________________________________
540{
541 // The number of layers returned here is 3
542 int numberOfLayers = 0;
543
544 TGeoVolume* vdV = gGeoManager->GetVolume(getTRKVolPattern());
545 if (vdV == nullptr) {
546 LOG(fatal) << getName() << " volume " << getTRKVolPattern() << " is not in the geometry";
547 }
548
549 // Loop on all TRKV nodes, count Layer volumes by checking names
550 TObjArray* nodes = vdV->GetNodes();
551 int nNodes = nodes->GetEntriesFast();
552 for (int j = 0; j < nNodes; j++) {
553 int lrID = -1;
554 auto nd = dynamic_cast<TGeoNode*>(nodes->At(j));
555 const char* name = nd->GetName();
556
557 if (strstr(name, Form("%s%s", getTRKPetalPattern(), "0")) != nullptr && strstr(name, getTRKPetalLayerPattern()) != nullptr) {
558 numberOfLayers++;
560 LOG(fatal) << "Failed to extract layer ID from the " << name;
561 }
562 }
563 }
564 return numberOfLayers;
565}
566
567//__________________________________________________________________________
569{
570 // The number of chips per petal returned here is 9 for each layer = number of layers + number of quarters of disks per petal
571 int numberOfChips = 0;
572
573 TGeoVolume* vdV = gGeoManager->GetVolume(getTRKVolPattern());
574 if (vdV == nullptr) {
575 LOG(fatal) << getName() << " volume " << getTRKVolPattern() << " is not in the geometry";
576 }
577
578 // Loop on all TRKV nodes, count Layer volumes by checking names
579 TObjArray* nodes = vdV->GetNodes();
580 int nNodes = nodes->GetEntriesFast();
581 for (int j = 0; j < nNodes; j++) {
582 int lrID = -1;
583 auto nd = dynamic_cast<TGeoNode*>(nodes->At(j));
584 const char* name = nd->GetName();
585
586 if (strstr(name, Form("%s%s", getTRKPetalPattern(), "0")) != nullptr && (strstr(name, getTRKPetalLayerPattern()) != nullptr || strstr(name, getTRKPetalDiskPattern()) != nullptr)) {
587 numberOfChips++;
589 LOG(fatal) << "Failed to extract layer ID from the " << name;
590 }
591 }
592 }
593 return numberOfChips;
594}
595
596//__________________________________________________________________________
598{
599 int numberOfStaves = 0;
600
601 std::string layName = Form("%s%d", getTRKLayerPattern(), lay);
602 TGeoVolume* layV = gGeoManager->GetVolume(layName.c_str());
603
604 if (layV == nullptr) {
605 LOG(fatal) << getName() << " volume " << getTRKLayerPattern() << " is not in the geometry";
606 }
607
608 // Loop on all layV nodes, count Layer volumes by checking names
609 TObjArray* nodes = layV->GetNodes();
610 // std::cout << "Printing nodes for layer " << lay << std::endl;
611 // nodes->Print();
612 int nNodes = nodes->GetEntriesFast();
613
614 for (int j = 0; j < nNodes; j++) {
615 int lrID = -1;
616 auto nd = dynamic_cast<TGeoNode*>(nodes->At(j));
617 const char* name = nd->GetName();
618 if (strstr(name, getTRKStavePattern()) != nullptr) {
619 numberOfStaves++;
620 }
621 }
622 return numberOfStaves;
623}
624
625//__________________________________________________________________________
627{
628 int numberOfHalfStaves = 0;
629
630 std::string staveName = Form("%s%d", getTRKStavePattern(), lay);
631 TGeoVolume* staveV = gGeoManager->GetVolume(staveName.c_str());
632
633 if (staveV == nullptr) {
634 LOG(fatal) << getName() << " volume " << getTRKStavePattern() << " is not in the geometry";
635 }
636
637 // Loop on all layV nodes, count Layer volumes by checking names
638 TObjArray* nodes = staveV->GetNodes();
639 // std::cout << "Printing nodes for layer " << lay << std::endl;
640 // nodes->Print();
641 int nNodes = nodes->GetEntriesFast();
642
643 for (int j = 0; j < nNodes; j++) {
644 auto nd = dynamic_cast<TGeoNode*>(nodes->At(j));
645 const char* name = nd->GetName();
646 if (strstr(name, getTRKChipPattern()) != nullptr) {
647 numberOfHalfStaves++;
648 }
649 }
650 return numberOfHalfStaves;
651}
652
653//__________________________________________________________________________
654void GeometryTGeo::PrintChipID(int index, int subDetID, int petalcase, int disk, int lay, int stave, int halfstave) const
655{
656 std::cout << "\nindex = " << index << std::endl;
657 std::cout << "subDetID = " << subDetID << std::endl;
658 std::cout << "petalcase = " << petalcase << std::endl;
659 std::cout << "layer = " << lay << std::endl;
660 std::cout << "disk = " << disk << std::endl;
661 std::cout << "first chip index = " << getFirstChipIndex(lay, petalcase, subDetID) << std::endl;
662 std::cout << "stave = " << stave << std::endl;
663 std::cout << "halfstave = " << halfstave << std::endl;
664}
665
666//__________________________________________________________________________
667void GeometryTGeo::Print(Option_t*) const
668{
669 if (!isBuilt()) {
670 LOGF(info, "Geometry not built yet!");
671 return;
672 }
673 std::cout << "Detector ID: " << sInstance.get()->getDetID() << std::endl;
674
675 LOGF(info, "Summary of GeometryTGeo: %s", getName());
676 LOGF(info, "Number of layers ML + OL: %d", mNumberOfLayersMLOT);
677 LOGF(info, "Number of active parts VD: %d", mNumberOfActivePartsVD);
678 LOGF(info, "Number of layers VD: %d", mNumberOfLayersVD);
679 LOGF(info, "Number of petals VD: %d", mNumberOfPetalsVD);
680 LOGF(info, "Number of disks VD: %d", mNumberOfDisksVD);
681 LOGF(info, "Number of chips per petal VD: ");
682 for (int i = 0; i < mNumberOfPetalsVD; i++) {
683 LOGF(info, "%d", mNumberOfChipsPerPetalVD[i]);
684 }
685 LOGF(info, "Number of staves and half staves per layer MLOT: ");
686 for (int i = 0; i < mNumberOfLayersMLOT; i++) {
687 std::string mlot = "";
688 mlot = (i < 4) ? "ML" : "OT";
689 LOGF(info, "Layer: %d, %s, %d staves, %d half staves per stave", i, mlot.c_str(), mNumberOfStaves[i], mNumberOfHalfStaves[i]);
690 }
691 LOGF(info, "Total number of chips: %d", getNumberOfChips());
692
693 std::cout << "mLastChipIndex = [";
694 for (int i = 0; i < mLastChipIndex.size(); i++) {
695 std::cout << mLastChipIndex[i];
696 if (i < mLastChipIndex.size() - 1) {
697 std::cout << ", ";
698 }
699 }
700 std::cout << "]" << std::endl;
701 std::cout << "mLastChipIndexVD = [";
702 for (int i = 0; i < mLastChipIndexVD.size(); i++) {
703 std::cout << mLastChipIndexVD[i];
704 if (i < mLastChipIndexVD.size() - 1) {
705 std::cout << ", ";
706 }
707 }
708 std::cout << "]" << std::endl;
709}
710
711} // namespace trk
712} // namespace o2
int32_t i
uint32_t j
Definition RawData.h:0
Definition of the SegmentationChipclass.
Static class with identifiers, bitmasks and names for ALICE detectors.
Definition DetID.h:58
const char * getName() const
int mSize
prebooked number of sensors
const MatrixCache< Mat3D > & getCacheL2G() const
static const char * getTRKPetalDiskPattern()
static const char * composeSymNameLayer(int d, int layer)
static const char * getTRKStavePattern()
int getPetalCase(int index) const
static const char * getTRKChipPattern()
std::vector< int > mNumberOfChipsPerLayerVD
number of chips per layer VD ( = number of petals)
static std::string sVolumeName
int getSubDetID(int index) const
std::array< char, MAXLAYERS > mLayerToWrapper
Layer to wrapper correspondence.
static std::string sPetalLayerName
static const char * getTRKSensorPattern()
static std::string sStaveName
std::vector< int > mNumberOfHalfStaves
Number Of Staves in each stave of the layer in ML/OT.
int extractNumberOfChipsPerPetalVD() const
int extractNumberOfHalfStavesMLOT(int lay) const
static const char * getTRKPetalLayerPattern()
int getChipIndex(int subDetID, int petalcase, int disk, int lay, int stave, int halfstave) const
int extractNumberOfLayersMLOT()
Determines the number of active parts in the Geometry.
std::vector< int > mNumbersOfChipPerDiskVD
numbersOfChipPerDiskVD
std::vector< int > mNumberOfStaves
Number Of Staves per layer in ML/OT.
Int_t mNumberOfPetalsVD
number of Petals = chip in each VD layer
std::vector< int > mLastChipIndexVD
max ID of the detctor in the layer for the VD
static std::string sPetalName
int extractNumberOfStavesMLOT(int lay) const
static const char * composeSymNameChip(int d, int lr)
static std::string sPetalDiskName
void Print(Option_t *opt="") const
void PrintChipID(int index, int subDetID, int petalcase, int disk, int lay, int stave, int halfstave) const
int getLayer(int index) const
static const char * getTRKWrapVolPattern()
TString getMatrixPath(int index) const
int getNumberOfChips() const
static const char * getTRKLayerPattern()
int getFirstChipIndex(int lay, int petalcase, int subDetID) const
o2::math_utils::Transform3D Mat3D
static std::string sWrapperVolumeName
Wrapper volume name.
int extractNumberOfLayersVD() const
std::vector< int > mNumberOfChipsPerPetalVD
numbersOfChipPerPetalVD
std::vector< int > mLastChipIndex
max ID of the detctor in the petal(VD) or layer(MLOT)
static std::string sChipName
static std::string sSensorName
bool getChipID(int index, int &subDetID, int &petalcase, int &disk, int &lay, int &stave, int &halfstave) const
std::vector< int > mLastChipIndexMLOT
max ID of the detctor in the layer for the MLOT
void fillMatrixCache(int mask)
static std::string sLayerName
int extractNumberOfActivePartsVD() const
static const char * composeSymNameSensor(int d, int layer)
int extractNumberOfDisksVD() const
static const char * getTRKPetalPattern()
Int_t mNumberOfActivePartsVD
number of layers
std::vector< int > mNumberOfChipsPerLayerMLOT
number of chips per layer MLOT ( = 1 for the moment)
Int_t mNumberOfDisksVD
number of Disks = 6
Int_t mNumberOfLayersMLOT
number of layers
int getStave(int index) const
static const char * getTRKVolPattern()
static const char * composeSymNameStave(int d, int layer)
int getDisk(int index) const
static const char * composeSymNameTRK(int d)
int extractNumberOfPetalsVD() const
int extractVolumeCopy(const char *name, const char *prefix) const
Extract number following the prefix in the name string.
void Build(int loadTrans)
Int_t mNumberOfLayersVD
number of layers
int getHalfStave(int index) const
GeometryTGeo(bool build=false, int loadTrans=0)
TGeoHMatrix * extractMatrixSensor(int index) const
GLuint index
Definition glcorearb.h:781
GLuint const GLchar * name
Definition glcorearb.h:781
GLsizei const GLchar *const * path
Definition glcorearb.h:3591
GLenum GLuint GLint GLint layer
Definition glcorearb.h:1310
GLint GLuint mask
Definition glcorearb.h:291
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
static constexpr int L2G
Definition Cartesian.h:54
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"