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>
14// #include "TRKBase/SegmentationChip.h"
15
16// using Segmentation = o2::trk::SegmentationChip;
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, lay, stave, halfstave;
267 getChipID(index, subDetID, petalcase, disk, lay, stave, halfstave);
268
269 int indexRetrieved = getChipIndex(subDetID, petalcase, disk, lay, stave, halfstave);
270
271 PrintChipID(index, subDetID, petalcase, disk, lay, stave, halfstave, indexRetrieved);
272
273 // TString path = Form("/cave_1/barrel_1/%s_2/", GeometryTGeo::getTRKVolPattern());
274 TString path = "/cave_1/barrel_1/TRKV_2/TRKLayer0_1/TRKStave0_1/TRKChip0_1/TRKSensor0_1/";
275
276 // if (wrID >= 0) {
277 // path += Form("%s%d_1/", getITSWrapVolPattern(), wrID);
278 // }
279
280 // if (isVD) {
281 // path += Form("%s%d_1/", getTRKPetalPattern(), index);
282
283 // } else {
284 // path += Form("%s%d_1/", getTRKLayerPattern(), index);
285 // }
286
287 // if (!mIsLayerITS3[lay]) {
288 // path +=
289 // Form("%s%d_1/", getITSLayerPattern(), lay);
290 // if (mNumberOfHalfBarrels > 0) {
291 // path += Form("%s%d_%d/", getITSHalfBarrelPattern(), lay, hba);
292 // }
293 // path +=
294 // Form("%s%d_%d/", getITSStavePattern(), lay, stav);
295
296 // if (mNumberOfHalfStaves[lay] > 0) {
297 // path += Form("%s%d_%d/", getITSHalfStavePattern(), lay, sstav);
298 // }
299 // if (mNumberOfModules[lay] > 0) {
300 // path += Form("%s%d_%d/", getITSModulePattern(), lay, mod);
301 // }
302 // path += Form("%s%d_%d/%s%d_1", getITSChipPattern(), lay, chipInMod, getITSSensorPattern(), lay);
303 // } else {
304 // // hba = carbonform
305 // // stav = 0
306 // // sstav = segment
307 // // mod = rsu
308 // // chipInMod = tile
309 // // sensor = pixelarray
310 // path += Form("%s_0/", getITS3LayerPattern(lay));
311 // path += Form("%s_%d/", getITS3CarbonFormPattern(lay), hba);
312 // path += Form("%s_0/", getITS3ChipPattern(lay));
313 // path += Form("%s_%d/", getITS3SegmentPattern(lay), sstav);
314 // path += Form("%s_%d/", getITS3RSUPattern(lay), mod);
315 // path += Form("%s_%d/", getITS3TilePattern(lay), chipInMod);
316 // path += Form("%s_0", getITS3PixelArrayPattern(lay));
317 // }
318 return path;
319}
320
321//__________________________________________________________________________
323{
324 // extract matrix transforming from the PHYSICAL sensor frame to global one
325 // Note, the if the effective sensitive layer thickness is smaller than the
326 // total physical sensor tickness, this matrix is biased and connot be used
327 // directly for transformation from sensor frame to global one.
328 //
329 // Therefore we need to add a shift
330 auto path = getMatrixPath(index);
331
332 static TGeoHMatrix matTmp;
333 // gGeoManager->PushPath(); // Preserve the modeler state.
334
335 // if (!gGeoManager->cd(path.Data())) {
336 // gGeoManager->PopPath();
337 // LOG(error) << "Error in cd-ing to " << path.Data();
338 // return nullptr;
339 // } // end if !gGeoManager
340
341 matTmp = *gGeoManager->GetCurrentMatrix(); // matrix may change after cd
342
343 // RSS
344 // printf("%d/%d/%d %s\n", lay, stav, detInSta, path.Data());
345 // matTmp.Print();
346 // Restore the modeler state.
347 gGeoManager->PopPath();
348
349 static int chipInGlo{0};
350
351 // account for the difference between physical sensitive layer (where charge collection is simulated) and effective sensor thicknesses
352 // in the ITS3 case this accounted by specialized functions
353 // double delta = Segmentation::SensorLayerThickness;
354 // static TGeoTranslation tra(0., 0.5 * delta, 0.);
355 // #ifdef ENABLE_UPGRADES // only apply for non ITS3 OB layers
356 // if (!mIsLayerITS3[getLayer(index)]) {
357 // matTmp *= tra;
358 // }
359 // #else
360 // matTmp *= tra;
361 // #endif
362
363 return &matTmp;
364}
365
366//__________________________________________________________________________
368{
369 if (mSize < 1) {
370 LOG(warning) << "The method Build was not called yet";
371 Build(mask);
372 return;
373 }
374
375 // build matrices
376 if ((mask & o2::math_utils::bit2Mask(o2::math_utils::TransformType::L2G)) && !getCacheL2G().isFilled()) {
377 // Matrices for Local (Sensor!!! rather than the full chip) to Global frame transformation
378 LOGP(info, "Loading {} L2G matrices from TGeo; there are {} matrices", getName(), mSize);
379 auto& cacheL2G = getCacheL2G();
380 cacheL2G.setSize(mSize);
381
382 for (int i = 0; i < mSize; i++) {
383 TGeoHMatrix* hm = extractMatrixSensor(i);
384 cacheL2G.setMatrix(Mat3D(*hm), i);
385 }
386 }
387}
388
389//__________________________________________________________________________
390
391const char* GeometryTGeo::composeSymNameLayer(int d, int lr)
392{
393 return Form("%s/%s%d", composeSymNameTRK(d), getTRKLayerPattern(), lr);
394}
395
396const char* GeometryTGeo::composeSymNameStave(int d, int lr)
397{
398 return Form("%s/%s%d", composeSymNameLayer(d, lr), getTRKStavePattern(), lr);
399}
400
401const char* GeometryTGeo::composeSymNameChip(int d, int lr)
402{
403 return Form("%s/%s%d", composeSymNameStave(d, lr), getTRKChipPattern(), lr);
404}
405
406const char* GeometryTGeo::composeSymNameSensor(int d, int lr)
407{
408 return Form("%s/%s%d", composeSymNameChip(d, lr), getTRKSensorPattern(), lr);
409}
410
411//__________________________________________________________________________
412int GeometryTGeo::extractVolumeCopy(const char* name, const char* prefix) const
413{
414 TString nms = name;
415 if (!nms.BeginsWith(prefix)) {
416 return -1;
417 }
418 nms.Remove(0, strlen(prefix));
419 if (!isdigit(nms.Data()[0])) {
420 return -1;
421 }
422 return nms.Atoi();
423}
424
425//__________________________________________________________________________
427{
428 int numberOfLayers = 0;
429 TGeoVolume* trkV = gGeoManager->GetVolume(getTRKVolPattern());
430 if (trkV == nullptr) {
431 LOG(fatal) << getName() << " volume " << getTRKVolPattern() << " is not in the geometry";
432 }
433
434 // Loop on all TRKV nodes, count Layer volumes by checking names
435 // Build on the fly layer - wrapper correspondence
436 TObjArray* nodes = trkV->GetNodes();
437 // nodes->Print();
438 int nNodes = nodes->GetEntriesFast();
439 for (int j = 0; j < nNodes; j++) {
440 int lrID = -1;
441 auto nd = dynamic_cast<TGeoNode*>(nodes->At(j));
442 const char* name = nd->GetName();
443 if (strstr(name, getTRKLayerPattern()) != nullptr) {
444 numberOfLayers++;
446 LOG(fatal) << "Failed to extract layer ID from the " << name;
447 }
448 mLayerToWrapper[lrID] = -1; // not wrapped
449 } else if (strstr(name, getTRKWrapVolPattern()) != nullptr) { // this is a wrapper volume, may cointain layers
450 int wrID = -1;
452 LOG(fatal) << "Failed to extract wrapper ID from the " << name;
453 }
454 TObjArray* nodesW = nd->GetNodes();
455 int nNodesW = nodesW->GetEntriesFast();
456
457 for (int jw = 0; jw < nNodesW; jw++) {
458 auto ndW = dynamic_cast<TGeoNode*>(nodesW->At(jw))->GetName();
459 if (strstr(ndW, getTRKLayerPattern()) != nullptr) {
460 if ((lrID = extractVolumeCopy(ndW, GeometryTGeo::getTRKLayerPattern())) < 0) {
461 LOGP(fatal, "Failed to extract layer ID from wrapper volume '{}' from one of its nodes '{}'", name, ndW);
462 }
463 numberOfLayers++;
464 mLayerToWrapper[lrID] = wrID;
465 }
466 }
467 }
468 }
469 return numberOfLayers;
470}
471
472//__________________________________________________________________________
474{
475 // The number of active parts returned here is 36 = 4 petals * (3 layers + 6 disks)
476 int numberOfParts = 0;
477
478 TGeoVolume* vdV = gGeoManager->GetVolume(getTRKVolPattern());
479 if (vdV == nullptr) {
480 LOG(fatal) << getName() << " volume " << getTRKVolPattern() << " is not in the geometry";
481 }
482
483 // Loop on all TRKV nodes, count Layer volumes by checking names
484 TObjArray* nodes = vdV->GetNodes();
485 int nNodes = nodes->GetEntriesFast();
486 for (int j = 0; j < nNodes; j++) {
487 int lrID = -1;
488 auto nd = dynamic_cast<TGeoNode*>(nodes->At(j));
489 const char* name = nd->GetName();
490
491 if (strstr(name, getTRKPetalPattern()) != nullptr && (strstr(name, getTRKPetalLayerPattern()) != nullptr || strstr(name, getTRKPetalDiskPattern()) != nullptr)) {
492 numberOfParts++;
494 LOG(fatal) << "Failed to extract layer ID from the " << name;
495 }
496 }
497 }
498 return numberOfParts;
499}
500
501//__________________________________________________________________________
503{
504 // The number of disks returned here is 6
505 int numberOfDisks = 0;
506
507 TGeoVolume* vdV = gGeoManager->GetVolume(getTRKVolPattern());
508 if (vdV == nullptr) {
509 LOG(fatal) << getName() << " volume " << getTRKVolPattern() << " is not in the geometry";
510 }
511
512 // Loop on all TRKV nodes, count Layer volumes by checking names
513 TObjArray* nodes = vdV->GetNodes();
514 int nNodes = nodes->GetEntriesFast();
515 for (int j = 0; j < nNodes; j++) {
516 int lrID = -1;
517 auto nd = dynamic_cast<TGeoNode*>(nodes->At(j));
518 const char* name = nd->GetName();
519
520 if (strstr(name, Form("%s%s", getTRKPetalPattern(), "0")) != nullptr && (strstr(name, getTRKPetalDiskPattern()) != nullptr)) {
521 numberOfDisks++;
523 LOG(fatal) << "Failed to extract layer ID from the " << name;
524 }
525 }
526 }
527 return numberOfDisks;
528}
529
530//__________________________________________________________________________
532{
533 // The number of petals returned here is 4 = number of petals
534 int numberOfChips = 0;
535
536 TGeoVolume* vdV = gGeoManager->GetVolume(getTRKVolPattern());
537 if (vdV == nullptr) {
538 LOG(fatal) << getName() << " volume " << getTRKVolPattern() << " is not in the geometry";
539 }
540
541 // Loop on all TRKV nodes, count Layer volumes by checking names
542 TObjArray* nodes = vdV->GetNodes();
543 int nNodes = nodes->GetEntriesFast();
544 for (int j = 0; j < nNodes; j++) {
545 int lrID = -1;
546 auto nd = dynamic_cast<TGeoNode*>(nodes->At(j));
547 const char* name = nd->GetName();
548
549 if (strstr(name, getTRKPetalPattern()) != nullptr && (strstr(name, Form("%s%s", getTRKPetalLayerPattern(), "0")) != nullptr)) {
550 numberOfChips++;
552 LOG(fatal) << "Failed to extract layer ID from the " << name;
553 }
554 }
555 }
556 return numberOfChips;
557}
558
559//__________________________________________________________________________
561{
562 // The number of layers returned here is 3
563 int numberOfLayers = 0;
564
565 TGeoVolume* vdV = gGeoManager->GetVolume(getTRKVolPattern());
566 if (vdV == nullptr) {
567 LOG(fatal) << getName() << " volume " << getTRKVolPattern() << " is not in the geometry";
568 }
569
570 // Loop on all TRKV nodes, count Layer volumes by checking names
571 TObjArray* nodes = vdV->GetNodes();
572 int nNodes = nodes->GetEntriesFast();
573 for (int j = 0; j < nNodes; j++) {
574 int lrID = -1;
575 auto nd = dynamic_cast<TGeoNode*>(nodes->At(j));
576 const char* name = nd->GetName();
577
578 if (strstr(name, Form("%s%s", getTRKPetalPattern(), "0")) != nullptr && strstr(name, getTRKPetalLayerPattern()) != nullptr) {
579 numberOfLayers++;
581 LOG(fatal) << "Failed to extract layer ID from the " << name;
582 }
583 }
584 }
585 return numberOfLayers;
586}
587
588//__________________________________________________________________________
590{
591 // The number of chips per petal returned here is 9 for each layer = number of layers + number of quarters of disks per petal
592 int numberOfChips = 0;
593
594 TGeoVolume* vdV = gGeoManager->GetVolume(getTRKVolPattern());
595 if (vdV == nullptr) {
596 LOG(fatal) << getName() << " volume " << getTRKVolPattern() << " is not in the geometry";
597 }
598
599 // Loop on all TRKV nodes, count Layer volumes by checking names
600 TObjArray* nodes = vdV->GetNodes();
601 int nNodes = nodes->GetEntriesFast();
602 for (int j = 0; j < nNodes; j++) {
603 int lrID = -1;
604 auto nd = dynamic_cast<TGeoNode*>(nodes->At(j));
605 const char* name = nd->GetName();
606
607 if (strstr(name, Form("%s%s", getTRKPetalPattern(), "0")) != nullptr && (strstr(name, getTRKPetalLayerPattern()) != nullptr || strstr(name, getTRKPetalDiskPattern()) != nullptr)) {
608 numberOfChips++;
610 LOG(fatal) << "Failed to extract layer ID from the " << name;
611 }
612 }
613 }
614 return numberOfChips;
615}
616
617//__________________________________________________________________________
619{
620 int numberOfStaves = 0;
621
622 std::string layName = Form("%s%d", getTRKLayerPattern(), lay);
623 TGeoVolume* layV = gGeoManager->GetVolume(layName.c_str());
624
625 if (layV == nullptr) {
626 LOG(fatal) << getName() << " volume " << getTRKLayerPattern() << " is not in the geometry";
627 }
628
629 // Loop on all layV nodes, count Layer volumes by checking names
630 TObjArray* nodes = layV->GetNodes();
631 // std::cout << "Printing nodes for layer " << lay << std::endl;
632 // nodes->Print();
633 int nNodes = nodes->GetEntriesFast();
634
635 for (int j = 0; j < nNodes; j++) {
636 int lrID = -1;
637 auto nd = dynamic_cast<TGeoNode*>(nodes->At(j));
638 const char* name = nd->GetName();
639 if (strstr(name, getTRKStavePattern()) != nullptr) {
640 numberOfStaves++;
641 }
642 }
643 return numberOfStaves;
644}
645
646//__________________________________________________________________________
648{
649 int numberOfHalfStaves = 0;
650
651 std::string staveName = Form("%s%d", getTRKStavePattern(), lay);
652 TGeoVolume* staveV = gGeoManager->GetVolume(staveName.c_str());
653
654 if (staveV == nullptr) {
655 LOG(fatal) << getName() << " volume " << getTRKStavePattern() << " is not in the geometry";
656 }
657
658 // Loop on all layV nodes, count Layer volumes by checking names
659 TObjArray* nodes = staveV->GetNodes();
660 // std::cout << "Printing nodes for layer " << lay << std::endl;
661 // nodes->Print();
662 int nNodes = nodes->GetEntriesFast();
663
664 for (int j = 0; j < nNodes; j++) {
665 auto nd = dynamic_cast<TGeoNode*>(nodes->At(j));
666 const char* name = nd->GetName();
667 if (strstr(name, getTRKChipPattern()) != nullptr) {
668 numberOfHalfStaves++;
669 }
670 }
671 return numberOfHalfStaves;
672}
673
674//__________________________________________________________________________
675void GeometryTGeo::PrintChipID(int index, int subDetID, int petalcase, int disk, int lay, int stave, int halfstave, int indexRetrieved) const
676{
677 std::cout << "\nindex = " << index << std::endl;
678 std::cout << "subDetID = " << subDetID << std::endl;
679 std::cout << "petalcase = " << petalcase << std::endl;
680 std::cout << "layer = " << lay << std::endl;
681 std::cout << "disk = " << disk << std::endl;
682 std::cout << "first chip index = " << getFirstChipIndex(lay, petalcase, subDetID) << std::endl;
683 std::cout << "stave = " << stave << std::endl;
684 std::cout << "halfstave = " << halfstave << std::endl;
685 std::cout << "check index Retrieved = " << indexRetrieved << std::endl;
686}
687
688//__________________________________________________________________________
689void GeometryTGeo::Print(Option_t*) const
690{
691 if (!isBuilt()) {
692 LOGF(info, "Geometry not built yet!");
693 return;
694 }
695 std::cout << "Detector ID: " << sInstance.get()->getDetID() << std::endl;
696
697 LOGF(info, "Summary of GeometryTGeo: %s", getName());
698 LOGF(info, "Number of layers ML + OL: %d", mNumberOfLayersMLOT);
699 LOGF(info, "Number of active parts VD: %d", mNumberOfActivePartsVD);
700 LOGF(info, "Number of layers VD: %d", mNumberOfLayersVD);
701 LOGF(info, "Number of petals VD: %d", mNumberOfPetalsVD);
702 LOGF(info, "Number of disks VD: %d", mNumberOfDisksVD);
703 LOGF(info, "Number of chips per petal VD: ");
704 for (int i = 0; i < mNumberOfPetalsVD; i++) {
705 LOGF(info, "%d", mNumberOfChipsPerPetalVD[i]);
706 }
707 LOGF(info, "Number of staves and half staves per layer MLOT: ");
708 for (int i = 0; i < mNumberOfLayersMLOT; i++) {
709 std::string mlot = "";
710 mlot = (i < 4) ? "ML" : "OT";
711 LOGF(info, "Layer: %d, %s, %d staves, %d half staves per stave", i, mlot.c_str(), mNumberOfStaves[i], mNumberOfHalfStaves[i]);
712 }
713 LOGF(info, "Total number of chips: %d", getNumberOfChips());
714
715 std::cout << "mLastChipIndex = [";
716 for (int i = 0; i < mLastChipIndex.size(); i++) {
717 std::cout << mLastChipIndex[i];
718 if (i < mLastChipIndex.size() - 1) {
719 std::cout << ", ";
720 }
721 }
722 std::cout << "]" << std::endl;
723 std::cout << "mLastChipIndexVD = [";
724 for (int i = 0; i < mLastChipIndexVD.size(); i++) {
725 std::cout << mLastChipIndexVD[i];
726 if (i < mLastChipIndexVD.size() - 1) {
727 std::cout << ", ";
728 }
729 }
730 std::cout << "]" << std::endl;
731}
732
733} // namespace trk
734} // namespace o2
int32_t i
uint32_t j
Definition RawData.h:0
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()
void PrintChipID(int index, int subDetID, int petalcase, int disk, int lay, int stave, int halfstave, int indexRetrieved) const
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
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
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"