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#include "TRKBase/Specs.h"
16#include <TMath.h>
17
18#include <limits>
19
21
22namespace o2
23{
24namespace trk
25{
26std::unique_ptr<o2::trk::GeometryTGeo> GeometryTGeo::sInstance;
27
28// Names
29std::string GeometryTGeo::sVolumeName = "TRKV";
30std::string GeometryTGeo::sServiceVolName = "TRKService";
31std::string GeometryTGeo::sLayerName = "TRKLayer";
32std::string GeometryTGeo::sPetalAssemblyName = "PETAL";
33std::string GeometryTGeo::sPetalName = "PETALCASE";
34std::string GeometryTGeo::sPetalDiskName = "DISK";
35std::string GeometryTGeo::sPetalLayerName = "LAYER";
36std::string GeometryTGeo::sStaveName = "TRKStave";
37std::string GeometryTGeo::sHalfStaveName = "TRKHalfStave";
38std::string GeometryTGeo::sModuleName = "TRKModule";
39std::string GeometryTGeo::sChipName = "TRKChip";
40std::string GeometryTGeo::sSensorName = "TRKSensor";
41std::string GeometryTGeo::sDeadzoneName = "TRKDeadzone";
42std::string GeometryTGeo::sMetalStackName = "TRKMetalStack";
43
44std::string GeometryTGeo::sWrapperVolumeName = "TRKUWrapVol";
45
47{
48 if (!mOwner) {
49 mOwner = true;
50 sInstance.release();
51 }
52}
53GeometryTGeo::GeometryTGeo(bool build, int loadTrans) : DetMatrixCache(detectors::DetID::TRK)
54{
55 if (sInstance) {
56 LOGP(fatal, "Invalid use of public constructor: o2::trk::GeometryTGeo instance exists");
57 }
58 mLayerToWrapper.fill(-1);
59 if (build) {
60 Build(loadTrans);
61 }
62}
63
64//__________________________________________________________________________
65void GeometryTGeo::Build(int loadTrans)
66{
71
72 if (isBuilt()) {
73 LOGP(warning, "Already built");
74 return; // already initialized
75 }
76
77 if (gGeoManager == nullptr) {
78 LOGP(fatal, "Geometry is not loaded");
79 }
80
82
83 LOG(debug) << "Overall layout ML and OT: " << mLayoutMLOT;
84
88 LOGP(info, "VD segmentation set for {} petals", mNumberOfPetalsVD);
89
93
98
103
107
108 for (int i = 0; i < mNumberOfLayersMLOT; i++) {
110 mNumberOfStaves[i] = 1;
112 mNumberOfModules[i] = 1;
113 mNumberOfChips[i] = 1;
114 } else {
119 }
120 }
121
122 int numberOfChipsTotal = 0;
123
125 for (int i = 0; i < mNumberOfPetalsVD; i++) {
127 numberOfChipsTotal += mNumberOfChipsPerPetalVD[i];
128 mLastChipIndex[i] = numberOfChipsTotal - 1;
129 mLastChipIndexVD[i] = numberOfChipsTotal - 1;
130 }
131
133 for (int i = 0; i < mNumberOfLayersMLOT; i++) {
135 numberOfChipsTotal += mNumberOfChipsPerLayerMLOT[i];
136 mLastChipIndex[i + mNumberOfPetalsVD] = numberOfChipsTotal - 1;
137 mLastChipIndexMLOT[i] = numberOfChipsTotal - 1;
138 }
139
140 setSize(numberOfChipsTotal);
143 fillMatrixCache(loadTrans);
144}
145
146//__________________________________________________________________________
148{
149 if (index <= mLastChipIndexVD[mLastChipIndexVD.size() - 1]) {
150 return 0;
151 } else if (index > mLastChipIndexVD[mLastChipIndexVD.size() - 1]) {
152 return 1;
153 }
154 return -1;
155}
156
157//__________________________________________________________________________
159{
160 int petalcase = 0;
161
162 int subDetID = getSubDetID(index);
163 if (subDetID == 1) {
164 return -1;
165 } else if (index <= mLastChipIndexVD[mNumberOfPetalsVD - 1]) {
166 while (index > mLastChipIndexVD[petalcase]) {
167 petalcase++;
168 }
169 }
170 return petalcase;
171}
172
173//__________________________________________________________________________
175{
176 int subDetID = getSubDetID(index);
177 int petalcase = getPetalCase(index);
178
179 if (subDetID == 0) {
181 return -1;
182 }
183 return (index % mNumberOfChipsPerPetalVD[petalcase]) - mNumberOfLayersVD;
184 }
185
186 return -1;
187}
188
189//__________________________________________________________________________
191{
192 int subDetID = getSubDetID(index);
193 int petalcase = getPetalCase(index);
194 int lay = 0;
195
196 if (subDetID == 0) {
198 return -1;
199 }
200 return index % mNumberOfChipsPerPetalVD[petalcase];
201 } else if (subDetID == 1) {
202 while (index > mLastChipIndex[lay]) {
203 lay++;
204 }
205 return lay - mNumberOfPetalsVD;
206 }
207 return -1;
208}
209//__________________________________________________________________________
211{
212 if (getDisk(index) != -1) {
213 return -1;
214 }
215 int subDetID = getSubDetID(index);
216 return subDetID * o2::trk::constants::VD::petal::nLayers + getLayer(index); // MLOT: offset by number of VD layers
217}
218//__________________________________________________________________________
220{
221 int subDetID = getSubDetID(index);
222 int lay = getLayer(index);
223 int petalcase = getPetalCase(index);
224
225 if (subDetID == 0) {
226 return -1;
227 } else if (subDetID == 1) {
228 int lay = getLayer(index);
229 index -= getFirstChipIndex(lay, petalcase, subDetID); // get the index of the sensing element in the layer
230
231 const int Nhs = mNumberOfHalfStaves[lay];
232 const int Nmod = mNumberOfModules[lay];
233 const int Nchip = mNumberOfChips[lay];
234
235 if (Nhs == 2) {
236 int chipsPerModule = Nchip;
237 int chipsPerHalfStave = Nmod * chipsPerModule;
238 int chipsPerStave = Nhs * chipsPerHalfStave;
239 return index / chipsPerStave;
240 } else if (Nhs == 1) {
241 int chipsPerModule = Nchip;
242 int chipsPerStave = Nmod * chipsPerModule;
243 return index / chipsPerStave;
244 }
245 }
246 return -1;
247}
248
249//__________________________________________________________________________
251{
252 int subDetID = getSubDetID(index);
253 int lay = getLayer(index);
254 int petalcase = getPetalCase(index);
255
256 if (subDetID == 0) {
257 return -1;
258 } else if (subDetID == 1) {
259 int lay = getLayer(index);
260 index -= getFirstChipIndex(lay, petalcase, subDetID); // get the index of the sensing element in the layer
261
262 const int Nhs = mNumberOfHalfStaves[lay];
263 const int Nmod = mNumberOfModules[lay];
264 const int Nchip = mNumberOfChips[lay];
265
266 int chipsPerModule = Nchip;
267 int chipsPerHalfStave = Nmod * chipsPerModule;
268 int chipsPerStave = Nhs * chipsPerHalfStave;
269
270 int rem = index % chipsPerStave;
271 return rem / chipsPerHalfStave; // 0 = left, 1 = right
272 }
273 return -1;
274}
275
276//__________________________________________________________________________
278{
279 int subDetID = getSubDetID(index);
280 int lay = getLayer(index);
281 int petalcase = getPetalCase(index);
282
283 if (subDetID == 0) {
284 return -1;
285 } else if (subDetID == 1) {
286 int lay = getLayer(index);
287 index -= getFirstChipIndex(lay, petalcase, subDetID); // get the index of the sensing element in the layer
288
289 const int Nhs = mNumberOfHalfStaves[lay];
290 const int Nmod = mNumberOfModules[lay];
291 const int Nchip = mNumberOfChips[lay];
292
293 if (Nhs == 2) {
294 int chipsPerModule = Nchip;
295 int chipsPerHalfStave = Nmod * chipsPerModule;
296 int rem = index % (Nhs * chipsPerHalfStave);
297 rem = rem % chipsPerHalfStave;
298 return rem / chipsPerModule;
299 } else if (Nhs == 1) {
300 int chipsPerModule = Nchip;
301 int rem = index % (Nmod * chipsPerModule);
302 return rem / chipsPerModule;
303 }
304 }
305 return -1;
306}
307
308//__________________________________________________________________________
310{
311 int subDetID = getSubDetID(index);
312 int lay = getLayer(index);
313 int petalcase = getPetalCase(index);
314
315 if (subDetID == 0) {
316 return -1;
317 } else if (subDetID == 1) {
318 int lay = getLayer(index);
319 index -= getFirstChipIndex(lay, petalcase, subDetID); // get the index of the sensing element in the layer
320
321 const int Nhs = mNumberOfHalfStaves[lay];
322 const int Nmod = mNumberOfModules[lay];
323 const int Nchip = mNumberOfChips[lay];
324
325 if (Nhs == 2) {
326 int chipsPerModule = Nchip;
327 return index % chipsPerModule;
328 } else if (Nhs == 1) {
329 int chipsPerModule = Nchip;
330 return index % chipsPerModule;
331 }
332 }
333 return -1;
334}
335
336//__________________________________________________________________________
337unsigned short GeometryTGeo::getChipIndex(int subDetID, int petalcase, int disk, int lay, int stave, int halfstave, int mod, int chip) const
338{
339 if (subDetID == 0) { // VD
340 if (lay == -1) { // disk
341 return getFirstChipIndex(lay, petalcase, subDetID) + mNumberOfLayersVD + disk;
342 } else { // layer
343 return getFirstChipIndex(lay, petalcase, subDetID) + lay;
344 }
345 } else if (subDetID == 1) { // MLOT
346 const int Nhs = mNumberOfHalfStaves[lay]; // 1 or 2
347 const int Nmod = mNumberOfModules[lay]; // module per half-stave (per stave if Nhs==1)
348 const int Nchip = mNumberOfChips[lay]; // chips per module
349
350 if (Nhs == 2) { // staggered geometry: layer -> stave -> halfstave -> mod -> chip
351 int chipsPerModule = Nchip;
352 int chipsPerHalfStave = Nmod * chipsPerModule;
353 int chipsPerStave = Nhs * chipsPerHalfStave;
354 return getFirstChipIndex(lay, petalcase, subDetID) + stave * chipsPerStave + halfstave * chipsPerHalfStave + mod * chipsPerModule + chip;
355 } else if (Nhs == 1) { // turbo geometry: layer -> stave -> mod -> chip (no halfstave)
356 int chipsPerModule = Nchip;
357 int chipsPerStave = Nmod * chipsPerModule;
358 return getFirstChipIndex(lay, petalcase, subDetID) + stave * chipsPerStave + mod * chipsPerModule + chip;
359 }
360 }
361
362 LOGP(warning, "Chip index not found for subDetID %d, petalcase %d, disk %d, layer %d, stave %d, halfstave %d, module %d, chip %d, returning numeric limit", subDetID, petalcase, disk, lay, stave, halfstave, mod, chip);
363 return std::numeric_limits<unsigned short>::max(); // not found
364}
365
366//__________________________________________________________________________
367unsigned short GeometryTGeo::getChipIndex(int subDetID, int volume, int lay, int stave, int halfstave, int mod, int chip) const
368{
369 if (subDetID == 0) { // VD
370 return volume;
371
372 } else if (subDetID == 1) { // MLOT
373 const int Nhs = mNumberOfHalfStaves[lay]; // 1 or 2
374 const int Nmod = mNumberOfModules[lay]; // module per half-stave (per stave if Nhs==1)
375 const int Nchip = mNumberOfChips[lay]; // chips per module
376
377 if (Nhs == 2) { // staggered geometry: layer -> stave -> halfstave -> mod -> chip
378 int chipsPerModule = Nchip;
379 int chipsPerHalfStave = Nmod * chipsPerModule;
380 int chipsPerStave = Nhs * chipsPerHalfStave;
381 return getFirstChipIndex(lay, -1, subDetID) + stave * chipsPerStave + halfstave * chipsPerHalfStave + mod * chipsPerModule + chip;
382 } else if (Nhs == 1) { // turbo geometry: layer -> stave -> mod -> chip (no halfstave)
383 int chipsPerModule = Nchip;
384 int chipsPerStave = Nmod * chipsPerModule;
385 return getFirstChipIndex(lay, -1, subDetID) + stave * chipsPerStave + mod * chipsPerModule + chip;
386 }
387 }
388
389 LOGP(warning, "Chip index not found for subDetID %d, volume %d, layer %d, stave %d, halfstave %d, module %d, chip %d, returning numeric limit", subDetID, volume, lay, stave, halfstave, mod, chip);
390 return std::numeric_limits<unsigned short>::max(); // not found
391}
392
393//__________________________________________________________________________
394bool GeometryTGeo::getChipID(int index, int& subDetID, int& petalcase, int& disk, int& lay, int& stave, int& halfstave, int& mod, int& chip) const
395{
396 subDetID = getSubDetID(index);
397 petalcase = getPetalCase(index);
398 disk = getDisk(index);
399 lay = getLayer(index);
400 stave = getStave(index);
401 if (mNumberOfHalfStaves[lay] == 2) {
402 halfstave = getHalfStave(index);
403 } else {
404 halfstave = 0; // if not staggered geometry, return 0
405 }
406 halfstave = getHalfStave(index);
407 mod = getModule(index);
408 chip = getChip(index);
409
410 return kTRUE;
411}
412
413//__________________________________________________________________________
415{
416
417 int subDetID, petalcase, disk, layer, stave, halfstave, mod, chip;
418 getChipID(index, subDetID, petalcase, disk, layer, stave, halfstave, mod, chip);
419
420 // PrintChipID(index, subDetID, petalcase, disk, layer, stave, halfstave, mod, chip);
421
422 TString path = Form("/cave_1/barrel_1/%s_2/", GeometryTGeo::getTRKVolPattern());
423
424 // build the path
425 if (subDetID == 0) { // VD
426 if (disk >= 0) {
427 path += Form("%s_%d_%d/", getTRKPetalAssemblyPattern(), petalcase, petalcase + 1); // PETAL_n
428 path += Form("%s%d_%s%d_1/", getTRKPetalPattern(), petalcase, getTRKPetalDiskPattern(), disk); // PETALCASEx_DISKy_1
429 path += Form("%s%d_%s%d_%s%d_1/", getTRKPetalPattern(), petalcase, getTRKPetalDiskPattern(), disk, getTRKChipPattern(), disk); // PETALCASEx_DISKy_TRKChipy_1
430 path += Form("%s%d_%s%d_%s%d_1/", getTRKPetalPattern(), petalcase, getTRKPetalDiskPattern(), disk, getTRKSensorPattern(), disk); // PETALCASEx_DISKy_TRKSensory_1
431 } else if (layer >= 0) {
432 path += Form("%s_%d_%d/", getTRKPetalAssemblyPattern(), petalcase, petalcase + 1); // PETAL_n
433 path += Form("%s%d_%s%d_1/", getTRKPetalPattern(), petalcase, getTRKPetalLayerPattern(), layer); // PETALCASEx_LAYERy_1
434 // path += Form("%s%d_%s%d_%s%d_1/", getTRKPetalPattern(), petalcase, getTRKPetalLayerPattern(), layer, getTRKStavePattern(), layer); // PETALCASEx_LAYERy_TRKStavey_1
435 path += Form("%s%d_%s%d_%s%d_1/", getTRKPetalPattern(), petalcase, getTRKPetalLayerPattern(), layer, getTRKChipPattern(), layer); // PETALCASEx_LAYERy_TRKChipy_1
436 path += Form("%s%d_%s%d_%s%d_1/", getTRKPetalPattern(), petalcase, getTRKPetalLayerPattern(), layer, getTRKSensorPattern(), layer); // PETALCASEx_LAYERy_TRKSensory_1
437 }
438 } else if (subDetID == 1) { // MLOT
439 path += Form("%s%d_1/", getTRKLayerPattern(), layer); // TRKLayerx_1
441 path += Form("%s%d_1/", getTRKSensorPattern(), layer); // TRKSensorx_1
442 } else {
443 path += Form("%s%d_%d/", getTRKStavePattern(), layer, stave); // TRKStavex_y
444 if (mNumberOfHalfStaves[layer] == 2) { // staggered geometry
445 path += Form("%s%d_%d/", getTRKHalfStavePattern(), layer, halfstave); // TRKHalfStavex_y
446 }
447 path += Form("%s%d_%d/", getTRKModulePattern(), layer, mod); // TRKModulx_y
448 path += Form("%s%d_%d/", getTRKChipPattern(), layer, chip); // TRKChipx_y
449 path += Form("%s%d_1/", getTRKSensorPattern(), layer); // TRKSensorx_1
450 }
451 }
452 return path;
453}
454
455//__________________________________________________________________________
457{
458 // extract matrix transforming from the PHYSICAL sensor frame to global one
459 // Note, the if the effective sensitive layer thickness is smaller than the
460 // total physical sensor tickness, this matrix is biased and connot be used
461 // directly for transformation from sensor frame to global one.
462 // Therefore we need to add a shift
463
464 auto path = getMatrixPath(index);
465
466 static TGeoHMatrix matTmp;
467 gGeoManager->PushPath(); // Preserve the modeler state.
468
469 if (!gGeoManager->cd(path.Data())) {
470 gGeoManager->PopPath();
471 LOG(error) << "Error in cd-ing to " << path.Data();
472 return nullptr;
473 } // end if !gGeoManager
474
475 matTmp = *gGeoManager->GetCurrentMatrix(); // matrix may change after cd
476
477 // RSS
478 // matTmp.Print();
479 // Restore the modeler state.
480 gGeoManager->PopPath();
481
482 static int chipInGlo{0};
483
485 // account for the difference between physical sensitive layer (where charge collection is simulated) and effective sensor thicknesses
486 // in the VD case this will be accounted by specialized functions during the clusterization (following what it is done for ITS3)
487 // this can be done once the right sensor thickness is in place in the geometry
488 // double delta = 0.;
489 // if (getSubDetID(index) == 1){ /// ML/OT
490 // delta = Segmentation::SensorLayerThicknessVD - Segmentation::SiliconTickness;
491 // static TGeoTranslation tra(0., 0.5 * delta, 0.);
492 // matTmp *= tra;
493 // }
494 // std::cout<<"-----"<<std::endl;
495 // matTmp.Print();
496
497 return &matTmp;
498}
499
500//__________________________________________________________________________
502{
503 for (int i = 0; i < mSize; i++) {
504 if (getSubDetID(i) == 0) {
505 continue;
506 }
507 sensorsMLOT.push_back(i);
508 }
509}
510
511//__________________________________________________________________________
513{
514 // fill for every sensor of ML & OT its tracking frame parameters
515 if (!isTrackingFrameCachedMLOT() && !sensorsMLOT.empty()) {
516 size_t newSize = sensorsMLOT.size();
517 mCacheRefXMLOT.resize(newSize);
518 mCacheRefAlphaMLOT.resize(newSize);
519 for (int i = 0; i < newSize; i++) {
520 int sensorId = sensorsMLOT[i];
522 }
523 }
524}
525
526//__________________________________________________________________________
528{
529 if (mSize < 1) {
530 LOG(warning) << "The method Build was not called yet";
531 Build(mask);
532 return;
533 }
534
535 // build matrices
536 if ((mask & o2::math_utils::bit2Mask(o2::math_utils::TransformType::L2G)) && !getCacheL2G().isFilled()) {
537 // Matrices for Local (Sensor!!! rather than the full chip) to Global frame transformation
538 LOGP(info, "Loading {} L2G matrices from TGeo; there are {} matrices", getName(), mSize);
539 auto& cacheL2G = getCacheL2G();
540 cacheL2G.setSize(mSize);
541
542 for (int i = 0; i < mSize; i++) {
543 TGeoHMatrix* hm = extractMatrixSensor(i);
544 cacheL2G.setMatrix(Mat3D(*hm), i);
545 }
546 }
547
548 // build T2L matrices for ML & OT !! VD is yet to be implemented once its geometry will be more refined
549 if ((mask & o2::math_utils::bit2Mask(o2::math_utils::TransformType::T2L)) && !getCacheT2L().isFilled()) {
550 LOGP(info, "Loading {} T2L matrices from TGeo for ML & OT", getName());
551 if (sensorsMLOT.size()) {
552 int m_Size = sensorsMLOT.size();
553 auto& cacheT2L = getCacheT2L();
554 cacheT2L.setSize(m_Size);
555 for (int i = 0; i < m_Size; i++) {
556 int sensorID = sensorsMLOT[i];
557 TGeoHMatrix& hm = createT2LMatrixMLOT(sensorID);
558 cacheT2L.setMatrix(Mat3D(hm), i); // here, sensorIDs from 0 to 374, sensorIDs shifted to 36 !
559 }
560 }
561 }
562
563 // TODO: build matrices for the cases T2L, T2G and T2GRot when needed
564}
565
566//__________________________________________________________________________
567
568#ifdef ENABLE_UPGRADES
569const char* GeometryTGeo::composeSymNameLayer(int d, int layer)
570{
571 return Form("%s/%s%d", composeSymNameTRK(d), getTRKLayerPattern(), layer);
572}
573#endif
574
576{
577 return Form("%s/%s%d", composeSymNameLayer(d, layer), getTRKStavePattern(), layer);
578}
579
581{
582 return Form("%s/%s%d", composeSymNameStave(d, layer), getTRKModulePattern(), layer);
583}
584
586{
587 return Form("%s/%s%d", composeSymNameStave(d, layer), getTRKChipPattern(), layer);
588}
589
591{
592 return Form("%s/%s%d", composeSymNameChip(d, layer), getTRKSensorPattern(), layer);
593}
594
595//__________________________________________________________________________
596int GeometryTGeo::extractVolumeCopy(const char* name, const char* prefix) const
597{
598 TString nms = name;
599 if (!nms.BeginsWith(prefix)) {
600 return -1;
601 }
602 nms.Remove(0, strlen(prefix));
603 if (!isdigit(nms.Data()[0])) {
604 return -1;
605 }
606 return nms.Atoi();
607}
608
609//__________________________________________________________________________
611{
612 int numberOfLayers = 0;
613 TGeoVolume* trkV = gGeoManager->GetVolume(getTRKVolPattern());
614 if (trkV == nullptr) {
615 LOG(fatal) << getName() << " volume " << getTRKVolPattern() << " is not in the geometry";
616 }
617
618 // Loop on all TRKV nodes, count Layer volumes by checking names
619 // Build on the fly layer - wrapper correspondence
620 TObjArray* nodes = trkV->GetNodes();
621 // nodes->Print();
622 int nNodes = nodes->GetEntriesFast();
623 for (int j = 0; j < nNodes; j++) {
624 int lrID = -1;
625 auto nd = dynamic_cast<TGeoNode*>(nodes->At(j));
626 const char* name = nd->GetName();
627 if (strstr(name, getTRKLayerPattern()) != nullptr) {
628 numberOfLayers++;
630 LOG(fatal) << "Failed to extract layer ID from the " << name;
631 }
632 mLayerToWrapper[lrID] = -1; // not wrapped
633 } else if (strstr(name, getTRKWrapVolPattern()) != nullptr) { // this is a wrapper volume, may cointain layers
634 int wrID = -1;
636 LOG(fatal) << "Failed to extract wrapper ID from the " << name;
637 }
638 TObjArray* nodesW = nd->GetNodes();
639 int nNodesW = nodesW->GetEntriesFast();
640
641 for (int jw = 0; jw < nNodesW; jw++) {
642 auto ndW = dynamic_cast<TGeoNode*>(nodesW->At(jw))->GetName();
643 if (strstr(ndW, getTRKLayerPattern()) != nullptr) {
644 if ((lrID = extractVolumeCopy(ndW, GeometryTGeo::getTRKLayerPattern())) < 0) {
645 LOGP(fatal, "Failed to extract layer ID from wrapper volume '{}' from one of its nodes '{}'", name, ndW);
646 }
647 numberOfLayers++;
648 mLayerToWrapper[lrID] = wrID;
649 }
650 }
651 }
652 }
653 return numberOfLayers;
654}
655
656//__________________________________________________________________________
658{
659 int numberOfPetals = 0;
660 TGeoVolume* trkV = gGeoManager->GetVolume(getTRKVolPattern());
661 if (!trkV) {
662 LOGP(fatal, "{} volume {} is not in the geometry", getName(), getTRKVolPattern());
663 return 0;
664 }
665
666 // Loop on all TRKV nodes, count PETAL assemblies and their contents
667 TObjArray* nodes = trkV->GetNodes();
668 if (!nodes) {
669 LOGP(warning, "{} volume has no child nodes", getTRKVolPattern());
670 return 0;
671 }
672
673 LOGP(info, "Searching for petal assemblies in {} (pattern: {})",
675
676 for (int j = 0; j < nodes->GetEntriesFast(); j++) {
677 auto* nd = dynamic_cast<TGeoNode*>(nodes->At(j));
678 const char* name = nd->GetName();
679
680 if (strstr(name, getTRKPetalAssemblyPattern()) != nullptr) {
681 numberOfPetals++;
682 LOGP(info, "Found petal assembly: {}", name);
683
684 // Get petal volume and its nodes for debugging
685 TGeoVolume* petalVol = nd->GetVolume();
686 if (petalVol) {
687 TObjArray* petalNodes = petalVol->GetNodes();
688 if (petalNodes) {
689 LOGP(debug, "Petal {} contains {} child nodes", name, petalNodes->GetEntriesFast());
690 // Print all nodes in this petal
691 for (int k = 0; k < petalNodes->GetEntriesFast(); k++) {
692 auto* petalNode = dynamic_cast<TGeoNode*>(petalNodes->At(k));
693 LOGP(debug, " Node {}: {}", k, petalNode->GetName());
694 }
695 } else {
696 LOGP(warning, "Petal {} has no child nodes", name);
697 }
698 } else {
699 LOGP(warning, "Petal {} has no volume", name);
700 }
701 }
702 }
703
704 if (numberOfPetals == 0) {
705 LOGP(warning, "No petal assemblies found in geometry");
706 } else {
707 LOGP(info, "Found {} petal assemblies", numberOfPetals);
708 }
709
710 return numberOfPetals;
711}
712
713//__________________________________________________________________________
715{
716 // The number of active parts returned here is 36 = 4 petals * (3 layers + 6 disks)
717 int numberOfParts = 0;
718 TGeoVolume* vdV = gGeoManager->GetVolume(getTRKVolPattern());
719 if (!vdV) {
720 LOGP(fatal, "{} volume {} is not in the geometry", getName(), getTRKVolPattern());
721 return 0;
722 }
723
724 // Find first petal to count its active parts
725 TObjArray* nodes = vdV->GetNodes();
726 if (!nodes) {
727 LOGP(warning, "{} volume has no child nodes", getTRKVolPattern());
728 return 0;
729 }
730
731 bool petalFound = false;
732
733 for (int j = 0; j < nodes->GetEntriesFast(); j++) {
734 auto* nd = dynamic_cast<TGeoNode*>(nodes->At(j));
735 const char* name = nd->GetName();
736 if (strstr(name, getTRKPetalAssemblyPattern()) == nullptr) {
737 continue;
738 }
739
740 petalFound = true;
741 LOGP(info, "Counting active parts in petal: {}", name);
742
743 // Found a petal, count its layers and disks
744 TGeoVolume* petalVol = nd->GetVolume();
745 if (!petalVol) {
746 LOGP(warning, "Petal {} has no volume", name);
747 break;
748 }
749
750 TObjArray* petalNodes = petalVol->GetNodes();
751 if (!petalNodes) {
752 LOGP(warning, "Petal {} has no child nodes", name);
753 break;
754 }
755
756 for (int k = 0; k < petalNodes->GetEntriesFast(); k++) {
757 auto* petalNode = dynamic_cast<TGeoNode*>(petalNodes->At(k));
758 const char* nodeName = petalNode->GetName();
759
760 if (strstr(nodeName, getTRKPetalLayerPattern()) != nullptr ||
761 strstr(nodeName, getTRKPetalDiskPattern()) != nullptr) {
762 numberOfParts++;
763 LOGP(debug, "Found active part in {}: {}", name, nodeName);
764 }
765 }
766 // We only need to check one petal as they're identical
767 break;
768 }
769
770 if (!petalFound) {
771 LOGP(warning, "No petal assembly found matching pattern '{}'", getTRKPetalAssemblyPattern());
772 return 0;
773 }
774
775 if (numberOfParts == 0) {
776 LOGP(warning, "No active parts (layers/disks) found in petal");
777 return 0;
778 }
779
780 // Multiply by number of petals since all petals are identical
781 int totalParts = numberOfParts * mNumberOfPetalsVD;
782 LOGP(info, "Total number of active parts: {} ({}*{})",
783 totalParts, numberOfParts, mNumberOfPetalsVD);
784 return totalParts;
785}
786
787//__________________________________________________________________________
789{
790 // Count disks in the first petal (all petals are identical)
791 int numberOfDisks = 0;
792 TGeoVolume* vdV = gGeoManager->GetVolume(getTRKVolPattern());
793 if (!vdV) {
794 LOGP(fatal, "{} volume {} is not in the geometry", getName(), getTRKVolPattern());
795 return 0;
796 }
797
798 // Find first petal
799 TObjArray* nodes = vdV->GetNodes();
800 if (!nodes) {
801 LOGP(warning, "{} volume has no child nodes", getTRKVolPattern());
802 return 0;
803 }
804
805 bool petalFound = false;
806
807 for (int j = 0; j < nodes->GetEntriesFast(); j++) {
808 auto* nd = dynamic_cast<TGeoNode*>(nodes->At(j));
809 if (strstr(nd->GetName(), getTRKPetalAssemblyPattern()) == nullptr) {
810 continue;
811 }
812
813 petalFound = true;
814 LOGP(info, "Counting disks in petal: {}", nd->GetName());
815
816 // Count disks in this petal
817 TGeoVolume* petalVol = nd->GetVolume();
818 if (!petalVol) {
819 LOGP(warning, "Petal {} has no volume", nd->GetName());
820 break;
821 }
822
823 TObjArray* petalNodes = petalVol->GetNodes();
824 if (!petalNodes) {
825 LOGP(warning, "Petal {} has no child nodes", nd->GetName());
826 break;
827 }
828
829 for (int k = 0; k < petalNodes->GetEntriesFast(); k++) {
830 auto* petalNode = dynamic_cast<TGeoNode*>(petalNodes->At(k));
831 if (strstr(petalNode->GetName(), getTRKPetalDiskPattern()) != nullptr) {
832 numberOfDisks++;
833 LOGP(info, "Found disk in {} : {}", nd->GetName(), petalNode->GetName());
834 }
835 }
836 // One petal is enough
837 break;
838 }
839
840 if (!petalFound) {
841 LOGP(warning, "No petal assembly found matching pattern '{}'", getTRKPetalAssemblyPattern());
842 }
843
844 if (numberOfDisks == 0) {
845 LOGP(warning, "No disks found in VD geometry");
846 }
847
848 return numberOfDisks;
849}
850
851//__________________________________________________________________________
853{
854 // Count layers in the first petal (all petals are identical)
855 int numberOfLayers = 0;
856 TGeoVolume* vdV = gGeoManager->GetVolume(getTRKVolPattern());
857 if (!vdV) {
858 LOGP(fatal, "{} volume {} is not in the geometry", getName(), getTRKVolPattern());
859 return 0;
860 }
861
862 // Find first petal
863 TObjArray* nodes = vdV->GetNodes();
864 if (!nodes) {
865 LOGP(warning, "{} volume has no child nodes", getTRKVolPattern());
866 return 0;
867 }
868
869 bool petalFound = false;
870
871 for (int j = 0; j < nodes->GetEntriesFast(); j++) {
872 auto* nd = dynamic_cast<TGeoNode*>(nodes->At(j));
873 if (strstr(nd->GetName(), getTRKPetalAssemblyPattern()) == nullptr) {
874 continue;
875 }
876
877 petalFound = true;
878 LOGP(info, "Counting layers in petal: {}", nd->GetName());
879
880 // Count layers in this petal
881 TGeoVolume* petalVol = nd->GetVolume();
882 if (!petalVol) {
883 LOGP(warning, "Petal {} has no volume", nd->GetName());
884 break;
885 }
886
887 TObjArray* petalNodes = petalVol->GetNodes();
888 if (!petalNodes) {
889 LOGP(warning, "Petal {} has no child nodes", nd->GetName());
890 break;
891 }
892
893 for (int k = 0; k < petalNodes->GetEntriesFast(); k++) {
894 auto* petalNode = dynamic_cast<TGeoNode*>(petalNodes->At(k));
895 if (strstr(petalNode->GetName(), getTRKPetalLayerPattern()) != nullptr) {
896 numberOfLayers++;
897 LOGP(info, "Found layer in {} : {}", nd->GetName(), petalNode->GetName());
898 }
899 }
900 // One petal is enough
901 break;
902 }
903
904 if (!petalFound) {
905 LOGP(warning, "No petal assembly found matching pattern '{}'", getTRKPetalAssemblyPattern());
906 }
907
908 if (numberOfLayers == 0) {
909 LOGP(warning, "No layers found in VD geometry");
910 }
911
912 return numberOfLayers;
913}
914
915//__________________________________________________________________________
917{
918 // The number of chips per petal returned here is 9 for each layer = number of layers + number of quarters of disks per petal
919 int numberOfChips = 0;
920 TGeoVolume* vdV = gGeoManager->GetVolume(getTRKVolPattern());
921 if (!vdV) {
922 LOGP(fatal, "{} volume {} is not in the geometry", getName(), getTRKVolPattern());
923 return 0;
924 }
925
926 // Find first petal assembly
927 TObjArray* nodes = vdV->GetNodes();
928 if (!nodes) {
929 LOGP(warning, "{} volume has no child nodes", getTRKVolPattern());
930 return 0;
931 }
932
933 bool petalFound = false;
934
935 for (int j = 0; j < nodes->GetEntriesFast(); j++) {
936 auto* nd = dynamic_cast<TGeoNode*>(nodes->At(j));
937 const char* name = nd->GetName();
938 if (strstr(name, getTRKPetalAssemblyPattern()) == nullptr) {
939 continue;
940 }
941
942 petalFound = true;
943 LOGP(info, "Counting chips in petal: {}", name);
944
945 // Found a petal, count sensors in its layers and disks
946 TGeoVolume* petalVol = nd->GetVolume();
947 if (!petalVol) {
948 LOGP(warning, "Petal {} has no volume", name);
949 break;
950 }
951
952 TObjArray* petalNodes = petalVol->GetNodes();
953 if (!petalNodes) {
954 LOGP(warning, "Petal {} has no child nodes", name);
955 break;
956 }
957
958 for (int k = 0; k < petalNodes->GetEntriesFast(); k++) {
959 auto* petalNode = dynamic_cast<TGeoNode*>(petalNodes->At(k));
960 const char* nodeName = petalNode->GetName();
961 TGeoVolume* vol = petalNode->GetVolume();
962
963 if (!vol) {
964 LOGP(debug, "Node {} has no volume", nodeName);
965 continue;
966 }
967
968 // Look for sensors in this volume
969 TObjArray* subNodes = vol->GetNodes();
970 if (!subNodes) {
971 LOGP(debug, "Node {} has no sub-nodes", nodeName);
972 continue;
973 }
974
975 for (int i = 0; i < subNodes->GetEntriesFast(); i++) {
976 auto* subNode = dynamic_cast<TGeoNode*>(subNodes->At(i));
977 if (strstr(subNode->GetName(), getTRKChipPattern()) != nullptr) {
978 numberOfChips++;
979 LOGP(debug, "Found chip in {}: {}", nodeName, subNode->GetName());
980 }
981 }
982 }
983 // We only need one petal
984 break;
985 }
986
987 if (!petalFound) {
988 LOGP(warning, "No petal assembly found matching pattern '{}'", getTRKPetalAssemblyPattern());
989 }
990
991 if (numberOfChips == 0) {
992 LOGP(warning, "No chips/sensors found in VD petal");
993 }
994
995 LOGP(info, "Number of chips per petal: {}", numberOfChips);
996 return numberOfChips;
997}
998
999//__________________________________________________________________________
1001{
1002 int numberOfStaves = 0;
1003
1004 std::string layName = Form("%s%d", getTRKLayerPattern(), lay);
1005 TGeoVolume* layV = gGeoManager->GetVolume(layName.c_str());
1006
1007 if (layV == nullptr) {
1008 LOG(fatal) << getName() << " volume " << getTRKLayerPattern() << " is not in the geometry";
1009 }
1010
1011 // Loop on all layV nodes, count Layer volumes by checking names
1012 TObjArray* nodes = layV->GetNodes();
1013 // std::cout << "Printing nodes for layer " << lay << std::endl;
1014 // nodes->Print();
1015 int nNodes = nodes->GetEntriesFast();
1016
1017 for (int j = 0; j < nNodes; j++) {
1018 int lrID = -1;
1019 auto nd = dynamic_cast<TGeoNode*>(nodes->At(j));
1020 const char* name = nd->GetName();
1021 if (strstr(name, getTRKStavePattern()) != nullptr) {
1022 numberOfStaves++;
1023 }
1024 }
1025 return numberOfStaves;
1026}
1027
1028//__________________________________________________________________________
1030{
1031 int numberOfHalfStaves = 0;
1032
1033 std::string staveName = Form("%s%d", getTRKStavePattern(), lay);
1034 TGeoVolume* staveV = gGeoManager->GetVolume(staveName.c_str());
1035
1036 if (staveV == nullptr) {
1037 LOG(fatal) << getName() << " volume " << getTRKStavePattern() << " is not in the geometry";
1038 }
1039
1040 // Loop on all layV nodes, count Layer volumes by checking names
1041 TObjArray* nodes = staveV->GetNodes();
1042 // std::cout << "Printing nodes for layer " << lay << std::endl;
1043 // nodes->Print();
1044 int nNodes = nodes->GetEntriesFast();
1045
1046 for (int j = 0; j < nNodes; j++) {
1047 auto nd = dynamic_cast<TGeoNode*>(nodes->At(j));
1048 const char* name = nd->GetName();
1049 if (strstr(name, getTRKHalfStavePattern()) != nullptr) {
1050 numberOfHalfStaves++;
1051 }
1052 }
1053
1054 if (numberOfHalfStaves == 0) {
1055 numberOfHalfStaves = 1;
1056 }
1057 return numberOfHalfStaves;
1058}
1059
1060//__________________________________________________________________________
1062{
1063 int numberOfModules = 0;
1064
1065 std::string staveName = Form("%s%d", (mNumberOfHalfStaves[lay] == 2 ? getTRKHalfStavePattern() : getTRKStavePattern()), lay);
1066 TGeoVolume* staveV = gGeoManager->GetVolume(staveName.c_str());
1067
1068 if (staveV == nullptr) {
1069 LOG(fatal) << getName() << " volume " << (mNumberOfHalfStaves[lay] == 2 ? getTRKHalfStavePattern() : getTRKStavePattern()) << " is not in the geometry";
1070 }
1071
1072 // Loop on all staveV nodes, count Module volumes by checking names
1073 TObjArray* nodes = staveV->GetNodes();
1074 int nNodes = nodes->GetEntriesFast();
1075
1076 for (int j = 0; j < nNodes; j++) {
1077 auto nd = dynamic_cast<TGeoNode*>(nodes->At(j));
1078 const char* name = nd->GetName();
1079 if (strstr(name, getTRKModulePattern()) != nullptr) {
1080 numberOfModules++;
1081 }
1082 }
1083 return numberOfModules;
1084}
1085
1086//__________________________________________________________________________
1088{
1089 int numberOfChips = 0;
1090
1091 std::string moduleName = Form("%s%d", getTRKModulePattern(), lay);
1092 TGeoVolume* moduleV = gGeoManager->GetVolume(moduleName.c_str());
1093
1094 if (moduleV == nullptr) {
1095 LOG(fatal) << getName() << " volume " << getTRKModulePattern() << " is not in the geometry";
1096 }
1097
1098 // Loop on all moduleV nodes, count Chip volumes by checking names
1099 TObjArray* nodes = moduleV->GetNodes();
1100 int nNodes = nodes->GetEntriesFast();
1101
1102 for (int j = 0; j < nNodes; j++) {
1103 auto nd = dynamic_cast<TGeoNode*>(nodes->At(j));
1104 const char* name = nd->GetName();
1105 if (strstr(name, getTRKChipPattern()) != nullptr) {
1106 numberOfChips++;
1107 }
1108 }
1109 return numberOfChips;
1110}
1111
1112//__________________________________________________________________________
1113void GeometryTGeo::PrintChipID(int index, int subDetID, int petalcase, int disk, int lay, int stave, int halfstave, int mod, int chip) const
1114{
1115 std::cout << "\nindex = " << index << std::endl;
1116 std::cout << "subDetID = " << subDetID << std::endl;
1117 std::cout << "petalcase = " << petalcase << std::endl;
1118 std::cout << "layer = " << lay << std::endl;
1119 std::cout << "disk = " << disk << std::endl;
1120 std::cout << "first chip index = " << getFirstChipIndex(lay, petalcase, subDetID) << std::endl;
1121 std::cout << "stave = " << stave << std::endl;
1122 std::cout << "halfstave = " << halfstave << std::endl;
1123 std::cout << "module = " << mod << std::endl;
1124 std::cout << "chip = " << chip << std::endl;
1125}
1126
1127//__________________________________________________________________________
1128void GeometryTGeo::Print(Option_t*) const
1129{
1130 if (!isBuilt()) {
1131 LOGF(info, "Geometry not built yet!");
1132 return;
1133 }
1134 std::cout << "Detector ID: " << sInstance.get()->getDetID() << std::endl;
1135
1136 LOGF(info, "Summary of GeometryTGeo: %s", getName());
1137 LOGF(info, "Number of layers ML + OT: %d", mNumberOfLayersMLOT);
1138 LOGF(info, "Number of active parts VD: %d", mNumberOfActivePartsVD);
1139 LOGF(info, "Number of layers VD: %d", mNumberOfLayersVD);
1140 LOGF(info, "Number of petals VD: %d", mNumberOfPetalsVD);
1141 LOGF(info, "Number of disks VD: %d", mNumberOfDisksVD);
1142 LOGF(info, "Number of chips per petal VD: ");
1143 for (int i = 0; i < mNumberOfPetalsVD; i++) {
1144 LOGF(info, "%d", mNumberOfChipsPerPetalVD[i]);
1145 }
1146 LOGF(info, "Number of staves and half staves per layer MLOT: ");
1147 for (int i = 0; i < mNumberOfLayersMLOT; i++) {
1148 std::string mlot = "";
1149 mlot = (i < constants::ML::nLayers) ? "ML" : "OT";
1150 LOGF(info, "Layer: %d, %s, %d staves, %d half staves per stave", i, mlot.c_str(), mNumberOfStaves[i], mNumberOfHalfStaves[i]);
1151 }
1152 LOGF(info, "Number of modules per stave (half stave) in each ML(OT) layer: ");
1153 for (int i = 0; i < mNumberOfLayersMLOT; i++) {
1154 LOGF(info, "%d", mNumberOfModules[i]);
1155 }
1156 LOGF(info, "Number of chips per module MLOT: ");
1157 for (int i = 0; i < mNumberOfLayersMLOT; i++) {
1158 LOGF(info, "%d", mNumberOfChips[i]);
1159 }
1160 LOGF(info, "Number of chips per layer MLOT: ");
1161 for (int i = 0; i < mNumberOfLayersMLOT; i++) {
1162 LOGF(info, "%d", mNumberOfChipsPerLayerMLOT[i]);
1163 }
1164 LOGF(info, "Total number of chips: %d", getNumberOfChips());
1165
1166 std::cout << "mLastChipIndex = [";
1167 for (int i = 0; i < mLastChipIndex.size(); i++) {
1168 std::cout << mLastChipIndex[i];
1169 if (i < mLastChipIndex.size() - 1) {
1170 std::cout << ", ";
1171 }
1172 }
1173 std::cout << "]" << std::endl;
1174 std::cout << "mLastChipIndexVD = [";
1175 for (int i = 0; i < mLastChipIndexVD.size(); i++) {
1176 std::cout << mLastChipIndexVD[i];
1177 if (i < mLastChipIndexVD.size() - 1) {
1178 std::cout << ", ";
1179 }
1180 }
1181 std::cout << "]" << std::endl;
1182}
1183
1184//__________________________________________________________________________
1185int GeometryTGeo::getBarrelLayer(int chipID) const
1186{
1187 // for barrel layers only,
1188 // so it would be consistent with number of layers i.e. from 0 to 10,
1189 // starting from VD0 to OT10;
1190 // skip the disks;
1191
1192 int subDetID = getSubDetID(chipID);
1193 int subLayerID = getLayer(chipID);
1194
1195 if (subDetID < 0 || subDetID > 1) {
1196 LOG(error) << "getBarrelLayer(): Invalid subDetID for barrel: " << subDetID
1197 << ". Expected values are 0 or 1.";
1198 return -1;
1199 }
1200
1201 if (subLayerID < 0 || subLayerID > 7) {
1202 LOG(error) << "getBarrelLayer(): Invalid subLayerID for barrel: " << subDetID
1203 << ". Expected values are between 0 and 7.";
1204 return -1;
1205 }
1206
1207 const int baseOffsets[] = {0, 3};
1208
1209 return baseOffsets[subDetID] + subLayerID;
1210}
1211
1212//__________________________________________________________________________
1213void GeometryTGeo::extractSensorXAlphaMLOT(int chipID, float& x, float& alp)
1214{
1215 // works for ML and OT only, a.k.a flat sensors !!!
1216 double locA[3] = {-100., 0., 0.}, locB[3] = {100., 0., 0.}, gloA[3], gloB[3];
1217 double xp{0}, yp{0};
1218
1219 if (getSubDetID(chipID) == 0) {
1220
1221 LOG(error) << "extractSensorXAlphaMLOT(): VD layers are not supported yet! chipID = " << chipID;
1222 return;
1223
1224 } else { // flat sensors, ML and OT
1225 const TGeoHMatrix* matL2G = extractMatrixSensor(chipID);
1226 matL2G->LocalToMaster(locA, gloA);
1227 matL2G->LocalToMaster(locB, gloB);
1228 double dx = gloB[0] - gloA[0], dy = gloB[1] - gloA[1];
1229 double t = (gloB[0] * dx + gloB[1] * dy) / (dx * dx + dy * dy);
1230 xp = gloB[0] - dx * t;
1231 yp = gloB[1] - dy * t;
1232 }
1233
1234 alp = std::atan2(yp, xp);
1235 x = std::hypot(xp, yp);
1236 o2::math_utils::bringTo02Pi(alp);
1237
1239 // once the VD segmentation is done, VD should be added
1240}
1241
1242//__________________________________________________________________________
1244{
1245 // works only for ML & OT
1246 // for VD is yet to be implemented once we have more refined geometry
1247 if (getSubDetID(chipID) == 0) {
1248
1249 LOG(error) << "createT2LMatrixMLOT(): VD layers are not supported yet! chipID = " << chipID
1250 << "returning dummy values! ";
1251 static TGeoHMatrix dummy;
1252 return dummy;
1253
1254 } else {
1255 static TGeoHMatrix t2l;
1256 t2l.Clear();
1257 float alpha = getSensorRefAlphaMLOT(chipID);
1258 t2l.RotateZ(alpha * TMath::RadToDeg());
1259 const TGeoHMatrix* matL2G = extractMatrixSensor(chipID);
1260 const TGeoHMatrix& matL2Gi = matL2G->Inverse();
1261 t2l.MultiplyLeft(&matL2Gi);
1262 return t2l;
1263 }
1264}
1265
1266} // namespace trk
1267} // namespace o2
std::ostringstream debug
int32_t i
Timeframe settings Average distance in cm of events merged into Randomize distance around average distance of merged events Simulate correct bunch interactions instead of placing only the average number of events A value[n] sets TFlen for[n] collisions in Number of bunches per trainsort Number of bunch trains Instantaneous interaction rate Do not simulate border Total number of collisions to be placed in the interior of all time Do not select random but walk over array of events in stride steps h Event generator settings h configStandalone Use CPU for GPU Force usage of the specified GPU device no CPU fallback Continue processing after an error First event to Number of events to Number of iterations to Number of iterations to Number of initial iterations excluded from const char Directory with events to Events directory is and not inside events d
char error[CURL_ERROR_SIZE]
uint32_t j
Definition RawData.h:0
Definition of the SegmentationChipclass.
specs of the ALICE3 TRK
Static class with identifiers, bitmasks and names for ALICE detectors.
Definition DetID.h:60
const MatrixCache< Mat3D > & getCacheT2L() const
const char * getName() const
int mSize
prebooked number of sensors
const MatrixCache< Mat3D > & getCacheL2G() const
static const char * composeSymNameModule(int d, int layer)
static const char * getTRKPetalDiskPattern()
int getModule(int index) const
static std::string sPetalAssemblyName
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, not implemented yet.
static const char * composeSymNameChip(int d, int layer)
static std::string sPetalLayerName
static const char * getTRKSensorPattern()
static std::string sStaveName
bool getChipID(int index, int &subDetID, int &petalcase, int &disk, int &lay, int &stave, int &halfstave, int &mod, int &chip) const
std::vector< int > mNumberOfHalfStaves
Number Of Half staves in each stave of the layer in ML/OT.
int extractNumberOfChipsPerPetalVD() const
bool isTrackingFrameCachedMLOT() const
int extractNumberOfHalfStavesMLOT(int lay) const
static const char * getTRKPetalLayerPattern()
int getChip(int index) const
int extractNumberOfLayersMLOT()
Determines the number of active parts in the Geometry.
int extractNumberOfChipsMLOT(int lay) const
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 > mNumberOfModules
Number Of Modules per stave (half stave) in ML/OT.
static std::string sPetalName
int extractNumberOfStavesMLOT(int lay) const
static std::string sPetalDiskName
void Print(Option_t *opt="") const
float getSensorRefAlphaMLOT(int chipId) const
int getLayer(int index) const
local layer index within the sub-detector (0-based per VD/MLOT)
std::vector< unsigned short > mLastChipIndexVD
max ID of the detctor in the layer for the VD
static const char * getTRKWrapVolPattern()
std::vector< float > mCacheRefXMLOT
TString getMatrixPath(int index) const
static const char * getTRKPetalAssemblyPattern()
int getNumberOfChips() const
static const char * getTRKLayerPattern()
static std::string sHalfStaveName
unsigned short getFirstChipIndex(int lay, int petalcase, int subDetID) const
std::vector< int > mNumberOfChips
number of chips per module in ML/OT
o2::math_utils::Transform3D Mat3D
static std::string sWrapperVolumeName
Wrapper volume name, not implemented at the moment.
static std::string sServiceVolName
TGeoHMatrix & createT2LMatrixMLOT(int)
std::vector< float > mCacheRefAlphaMLOT
cache for X of ML and OT
static const char * getTRKHalfStavePattern()
int extractNumberOfLayersVD() const
std::vector< int > mNumberOfChipsPerPetalVD
numbersOfChipPerPetalVD
static std::string sMetalStackName
static std::string sChipName
static std::string sSensorName
void fillMatrixCache(int mask)
std::vector< int > sensorsMLOT
is it owned by the singleton?
static std::string sDeadzoneName
static std::string sLayerName
unsigned short getChipIndex(int subDetID, int petalcase, int disk, int lay, int stave, int halfstave, int mod, int chip) const
int extractNumberOfActivePartsVD() const
void PrintChipID(int index, int subDetID, int petalcase, int disk, int lay, int stave, int halfstave, int mod, int chip) const
static const char * composeSymNameSensor(int d, int layer)
int extractNumberOfModulesMLOT(int lay) const
int extractNumberOfDisksVD() const
int getLayerTRK(int index) const
global layer index across the full TRK (VD layers 0..nVD-1, MLOT layers nVD..nTotal-1)
static const char * getTRKPetalPattern()
Int_t mNumberOfActivePartsVD
number of layers
std::vector< int > mNumberOfChipsPerLayerMLOT
number of chips per layer MLOT
Int_t mNumberOfDisksVD
number of Disks = 6
std::vector< unsigned short > mLastChipIndexMLOT
max ID of the detctor in the layer for the MLOT
Int_t mNumberOfLayersMLOT
number of layers
static const char * composeSymNameLayer(int d, int layer)
int getStave(int index) const
int getBarrelLayer(int) const
static const char * getTRKVolPattern()
static const char * getTRKModulePattern()
static const char * composeSymNameStave(int d, int layer)
int getDisk(int index) const
int extractNumberOfPetalsVD() const
int extractVolumeCopy(const char *name, const char *prefix) const
Extract number following the prefix in the name string.
std::vector< unsigned short > mLastChipIndex
max ID of the detctor in the petal(VD) or layer(MLOT)
void extractSensorXAlphaMLOT(int, float &, float &)
void Build(int loadTrans)
eMLOTLayout mLayoutMLOT
cache for sensor ref alpha ML and OT
Int_t mNumberOfLayersVD
number of layers
int getHalfStave(int index) const
GeometryTGeo(bool build=false, int loadTrans=0)
TGeoHMatrix * extractMatrixSensor(int index) const
static std::string sModuleName
static void setNumberOfPetalsVD(int n)
GLfloat GLfloat GLfloat alpha
Definition glcorearb.h:279
GLint GLenum GLint x
Definition glcorearb.h:403
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
constexpr int nLayers
Definition Specs.h:103
constexpr int nLayers
Definition Specs.h:47
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"