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
15
17
18#include "MFTBase/Geometry.h"
19#include "MFTBase/GeometryTGeo.h"
20
22#include "MathUtils/Cartesian.h"
23
24#include <fairlogger/Logger.h> // for LOG
25
26#include <TClass.h> // for TClass
27#include <TGeoBBox.h> // for TGeoBBox
28#include <TGeoManager.h> // for gGeoManager, TGeoManager
29#include <TGeoMatrix.h> // for TGeoHMatrix
30#include <TGeoNode.h> // for TGeoNode, TGeoNodeMatrix
31#include <TGeoPhysicalNode.h> // for TGeoPNEntry, TGeoPhysicalNode
32#include <TGeoShape.h> // for TGeoShape
33#include <TGeoVolume.h> // for TGeoVolume
34#include <TMath.h> // for Nint, ATan2, RadToDeg
35#include <TMathBase.h> // for Max
36#include <TObjArray.h> // for TObjArray
37#include <TObject.h> // for TObject
38#include <TString.h> // for TString, Form
39
40#include <cctype> // for isdigit
41#include <cstdio> // for snprintf, NULL, printf
42#include <cstring> // for strstr, strlen
43
44using namespace TMath;
45using namespace o2::mft;
46using namespace o2::detectors;
47
49
51
52std::unique_ptr<o2::mft::GeometryTGeo> GeometryTGeo::sInstance;
53
54std::string GeometryTGeo::sVolumeName = "MFT";
55std::string GeometryTGeo::sHalfName = "MFT_H";
56std::string GeometryTGeo::sDiskName = "MFT_D";
57std::string GeometryTGeo::sLadderName = "MFT_L";
58std::string GeometryTGeo::sChipName = "MFT_C";
59std::string GeometryTGeo::sSensorName = "MFTSensor";
60
61GeometryTGeo::~GeometryTGeo() // Instantiate explicitly to avoid missing symbol
62{
63 LOGP(info, "~GeometryTGeo");
64 if (!mOwner) {
65 mOwner = true;
66 sInstance.release();
67 }
68}
69
70//__________________________________________________________________________
71GeometryTGeo::GeometryTGeo(Bool_t build, Int_t loadTrans) : o2::itsmft::GeometryTGeo(DetID::MFT)
72{
73 // default c-tor, if build is true, the structures will be filled and the transform matrices
74 // will be cached
75 if (sInstance) {
76 LOG(fatal) << "Invalid use of public constructor: o2::mft::GeometryTGeo instance exists";
77 // throw std::runtime_error("Invalid use of public constructor: o2::mft::GeometryTGeo instance exists");
78 }
79
80 if (build) {
81 // loadTrans = kTRUE;
82 Build(loadTrans);
83 }
84}
85
86//__________________________________________________________________________
87void GeometryTGeo::adopt(GeometryTGeo* raw, bool canDelete)
88{
89 // adopt the unique instance from external raw pointer (to be used only to read saved instance from file)
90 if (sInstance) {
91 LOG(fatal) << "No adoption: o2::mft::GeometryTGeo instance exists";
92 }
93 sInstance = std::unique_ptr<o2::mft::GeometryTGeo>(raw);
94 sInstance->mOwner = canDelete;
95}
96
97//__________________________________________________________________________
98void GeometryTGeo::Build(Int_t loadTrans)
99{
100 if (isBuilt()) {
101 LOG(warning) << "Already built";
102 return; // already initialized
103 }
104
105 if (!gGeoManager) {
106 // RSTODO: in future there will be a method to load matrices from the CDB
107 LOG(fatal) << "Geometry is not loaded";
108 }
109
111 if (!mNumberOfHalves) {
112 return;
113 }
114
115 // LOG(info) << "Number of halves " << mNumberOfHalves;
117
119 for (Int_t i = 0; i < mNumberOfHalves; i++) {
121 // LOG(info) << "Number of disks " << mNumberOfDisks[i] << " in half " << i;
122
123 // use one half only
124 if (i == 0) {
131
132 // loop over disks
133 for (Int_t j = 0; j < mNumberOfDisks[i]; j++) {
135 Int_t numberOfLadders = 0;
136 for (Int_t nSensor = MinSensorsPerLadder; nSensor <= MaxSensorsPerLadder; nSensor++) {
137 mNumberOfLadders[j][nSensor] = extractNumberOfLadders(i, j, nSensor);
138 // LOG(info) << "Number of ladders with " << nSensor << " sensors is " << mNumberOfLadders[j][nSensor] << " in
139 // disk " << j;
140
141 numberOfLadders += mNumberOfLadders[j][nSensor];
142 mTotalNumberOfSensors += mNumberOfLadders[j][nSensor] * nSensor;
143 mNumberOfSensorsPerDisk[j] += nSensor * mNumberOfLadders[j][nSensor];
144
145 } // nSensor
147 mNumberOfLaddersPerDisk[j] = numberOfLadders;
148
149 mLadderIndex2Id[j].resize(numberOfLadders + 1);
150 mLadderId2Index[j].resize(numberOfLadders + 1);
151 Int_t nL = 0;
152 for (Int_t nSensor = MinSensorsPerLadder; nSensor <= MaxSensorsPerLadder; nSensor++) {
153 if (mNumberOfLadders[j][nSensor] == 0) {
154 continue;
155 }
156 Int_t n = extractNumberOfLadders(i, j, nSensor, nL);
157 } // nSensor
158
159 LOG(debug) << "MFT: Disk " << j << " has " << mNumberOfSensorsPerDisk[j] << " sensors ";
160
161 } // disk
162
163 } // half = 0
164
165 } // halves
166
168 LOG(debug) << "MFT: Total number of sensors " << mTotalNumberOfSensors << " in " << mNumberOfHalves << " detector halves";
169
171 mLayerMedianZ.resize(mNumberOfDisks[0] + 1);
172 Double_t zLay1[mNumberOfDisks[0]], zLay0[mNumberOfDisks[0]];
173 for (Int_t j = 0; j < mNumberOfDisks[0]; j++) {
174 zLay1[j] = +9999.;
175 zLay0[j] = -9999.;
176 }
177 for (Int_t i = 0; i < mTotalNumberOfSensors; i++) {
178 TGeoHMatrix* hm = extractMatrixSensor(i);
179 Double_t* trans = hm->GetTranslation();
180 Int_t disk = getDisk(i);
181 zLay1[disk] = std::min(zLay1[disk], trans[2]);
182 zLay0[disk] = std::max(zLay0[disk], trans[2]);
183 }
184 for (Int_t j = 0; j < mNumberOfDisks[0]; j++) {
185 mLayerMedianZ[j] = 0.5 * (zLay0[j] + zLay1[j]);
186 // LOG(info) << "Disk " << j << " has median z " << mLayerMedianZ[j];
187 }
188 for (Int_t i = 0; i < mTotalNumberOfSensors; i++) {
189 TGeoHMatrix* hm = extractMatrixSensor(i);
190 Double_t* trans = hm->GetTranslation();
191 Int_t disk = getDisk(i);
192 if (trans[2] > mLayerMedianZ[disk]) {
193 mSensorIndexToLayer[i] = 2 * disk;
194 } else {
195 mSensorIndexToLayer[i] = 2 * disk + 1;
196 }
197 // LOG(info) << "Sensor " << i << " is in layer " << mSensorIndexToLayer[i] << " translation z " << trans[2] <<
198 // FairLogger::endl;
199 }
200 /*
201 // checks
202 for (Int_t i = 0; i < mTotalNumberOfSensors; i++) {
203 Int_t ladder = getLadder(i);
204 Int_t disk = getDisk(i);
205 Int_t half = getHalf(i);
206 Int_t ladderID = mLadderIndex2Id[disk][ladder];
207 LOG(info) << "Index " << i << " half " << half << " disk " << disk << " ladder " << ladder << " geomap " << ladderID
208;
209 }
210 */
211 LOG(info) << "MFT GeometryTGeo::Build total number of sensors " << mTotalNumberOfSensors;
213
214 fillMatrixCache(loadTrans);
215 /*
216 // checks
217 Int_t index;
218 for (Int_t iH = 0; iH < mNumberOfHalves; iH++) {
219 for (Int_t iD = 0; iD < mNumberOfDisks[iH]; iD++) {
220 for (Int_t iL = 0; iL < mNumberOfLaddersPerDisk[iD]; iL++) {
221 Int_t ladder = mLadderId2Index[iD][iL];
222 Int_t nS = extractNumberOfSensorsPerLadder(iH,iD,iL);
223 for (Int_t iS = 0; iS < nS; iS++) {
224 index = getSensorIndex(iH,iD,iL,iS);
225 LOG(info) << "Half " << iH << " disk " << iD << " ladder " << ladder << " ladderID " << iL << " sensor " << iS
226 << " index " << index;
227 } // sensor
228 } // ladder
229 } // disk
230 } // half
231 */
232}
233
234//__________________________________________________________________________
235Int_t GeometryTGeo::extractNumberOfSensorsPerLadder(Int_t half, Int_t disk, Int_t ladder) const
236{
237 Int_t numberOfSensors = 0;
238 Char_t laddername[30];
239 snprintf(laddername, 30, "%s_%d_%d_%d", getMFTLadderPattern(), half, disk, ladder);
240 TGeoVolume* volLadder = gGeoManager->GetVolume(laddername);
241 if (!volLadder) {
242 LOG(fatal) << "can't find volume " << laddername;
243 }
244 // Loop on all ladder nodes, count sensor volumes by checking names
245 Int_t nNodes = volLadder->GetNodes()->GetEntries();
246 for (int j = 0; j < nNodes; j++) {
247 // LOG(info) << "GeometryTGeo::extractNumberOfSensorsPerLadder " << half << " " << disk << " " << ladder << " " <<
248 // volLadder->GetNodes()->At(j)->GetName();
249 if (strstr(volLadder->GetNodes()->At(j)->GetName(), getMFTChipPattern())) {
250 numberOfSensors++;
251 }
252 }
253
254 return numberOfSensors;
255}
256
257//__________________________________________________________________________
258Int_t GeometryTGeo::extractNumberOfLadders(Int_t half, Int_t disk, Int_t nsensor) const
259{
260 Int_t numberOfLadders = 0;
261 Char_t diskname[30];
262 snprintf(diskname, 30, "%s_%d_%d", getMFTDiskPattern(), half, disk);
263 TGeoVolume* volDisk = gGeoManager->GetVolume(diskname);
264 if (!volDisk) {
265 LOG(fatal) << "can't find volume " << diskname;
266 }
267 // Loop on all disk nodes, count ladder volumes by checking names
268 TObjArray* nodes = volDisk->GetNodes();
269 Int_t nNodes = nodes->GetEntries();
270 Int_t ladderID = -1;
271 for (int j = 0; j < nNodes; j++) {
272 TGeoNode* nd = (TGeoNode*)nodes->At(j);
273 const Char_t* name = nd->GetName();
274 if (strstr(name, getMFTLadderPattern())) {
275 ladderID = extractVolumeCopy(name, Form("%s_%d_%d", getMFTLadderPattern(), half, disk));
276 if (nsensor == extractNumberOfSensorsPerLadder(half, disk, ladderID)) {
277 numberOfLadders++;
278 }
279 }
280 }
281
282 return numberOfLadders;
283}
284
285//__________________________________________________________________________
286Int_t GeometryTGeo::extractNumberOfLadders(Int_t half, Int_t disk, Int_t nsensor, Int_t& nL)
287{
288 Int_t numberOfLadders = 0;
289 Char_t diskname[30];
290 snprintf(diskname, 30, "%s_%d_%d", getMFTDiskPattern(), half, disk);
291 TGeoVolume* volDisk = gGeoManager->GetVolume(diskname);
292 if (!volDisk) {
293 LOG(fatal) << "can't find volume " << diskname;
294 }
295 // Loop on all disk nodes, count ladder volumes by checking names
296 TObjArray* nodes = volDisk->GetNodes();
297 Int_t nNodes = nodes->GetEntries();
298 Int_t ladderID = -1;
299 for (int j = 0; j < nNodes; j++) {
300 TGeoNode* nd = (TGeoNode*)nodes->At(j);
301 const Char_t* name = nd->GetName();
302 if (strstr(name, getMFTLadderPattern())) {
303 ladderID = extractVolumeCopy(name, Form("%s_%d_%d", getMFTLadderPattern(), half, disk));
304 if (nsensor == extractNumberOfSensorsPerLadder(half, disk, ladderID)) {
305 // map the new index with the one from the geometry
306 mLadderIndex2Id[disk][nL] = ladderID;
307 mLadderId2Index[disk][ladderID] = nL;
308 // LOG(info) << "In disk " << disk << " ladder with " << nsensor << " sensors has matrix index " << nL << " and
309 // geometry index " << mLadderIndex2Id[disk][nL];
310 nL++;
311 //
312 numberOfLadders++;
313 }
314 }
315 }
316
317 return numberOfLadders;
318}
319
320//__________________________________________________________________________
322{
323 Int_t numberOfDisks = 0;
324 Char_t halfname[30];
325 snprintf(halfname, 30, "%s_%d", getMFTHalfPattern(), half);
326 TGeoVolume* volHalf = gGeoManager->GetVolume(halfname);
327 if (!volHalf) {
328 LOG(fatal) << "can't find " << halfname << " volume";
329 return -1;
330 }
331
332 // Loop on all half nodes, count disk volumes by checking names
333 Int_t nNodes = volHalf->GetNodes()->GetEntries();
334 for (Int_t j = 0; j < nNodes; j++) {
335 if (strstr(volHalf->GetNodes()->At(j)->GetName(), getMFTDiskPattern())) {
336 numberOfDisks++;
337 }
338 }
339
340 return numberOfDisks;
341}
342
343//__________________________________________________________________________
345{
346 Int_t numberOfHalves = 0;
347
348 TGeoVolume* volMFT = gGeoManager->GetVolume(getMFTVolPattern());
349 if (!volMFT) {
350 LOG(fatal) << "MFT volume " << getMFTVolPattern() << " is not in the geometry";
351 }
352
353 // Loop on all MFT nodes and count half detector volumes by checking names
354 TObjArray* nodes = volMFT->GetNodes();
355 int nNodes = nodes->GetEntriesFast();
356
357 for (int j = 0; j < nNodes; j++) {
358 Int_t halfID = -1;
359 TGeoNode* nd = (TGeoNode*)nodes->At(j);
360 const Char_t* name = nd->GetName();
361
362 if (strstr(name, getMFTHalfPattern())) {
363 numberOfHalves++;
364 if ((halfID = extractVolumeCopy(name, getMFTHalfPattern())) < 0) {
365 LOG(fatal) << "Failed to extract half ID from the " << name;
366 exit(1);
367 }
368 }
369 }
370
371 return numberOfHalves;
372}
373
374//__________________________________________________________________________
375int GeometryTGeo::extractVolumeCopy(const char* name, const char* prefix) const
376{
377 TString nms = name;
378 if (!nms.BeginsWith(prefix)) {
379 return -1;
380 }
381 nms.Remove(0, strlen(prefix) + 1);
382 if (!isdigit(nms.Data()[0])) {
383 return -1;
384 }
385
386 return nms.Atoi();
387}
388
389//__________________________________________________________________________
391{
392 Int_t half, disk, ladder, sensor, ladderID;
393 getSensorID(index, half, disk, ladder, sensor);
394 ladderID = mLadderIndex2Id[disk][ladder];
395 // LOG(info) << "extractMatrixSensor index " << index << " half " << half << " disk " << disk << " ladder " << ladder
396 // << " ladderID " << ladderID;
397
398 TString path = Form("/cave_1/barrel_1/%s_0/", getMFTVolPattern());
399 path += Form("%s_%d_%d/%s_%d_%d_%d/%s_%d_%d_%d_%d/%s_%d_%d_%d_%d/%s_1", getMFTHalfPattern(), half, half,
400 getMFTDiskPattern(), half, disk, disk, getMFTLadderPattern(), half, disk, ladderID, ladderID,
401 getMFTChipPattern(), half, disk, ladderID, sensor, getMFTSensorPattern());
402 // LOG(info) << "Volume path is " << path.Data();
403
404 static TGeoHMatrix matTmp;
405 gGeoManager->PushPath();
406
407 if (!gGeoManager->cd(path.Data())) {
408 gGeoManager->PopPath();
409 LOG(error) << "Error in cd-ing to " << path.Data();
410 return nullptr;
411 } // end if !gGeoManager
412
413 matTmp = *gGeoManager->GetCurrentMatrix(); // matrix may change after cd
414
415 // Restore the modeler state.
416 gGeoManager->PopPath();
417
418 // account for the difference between sensitive layer and physical sensor ticknesses
420
421 matTmp *= tra;
422
423 return &matTmp;
424}
425
426//__________________________________________________________________________
428{
429 // populate matrix cache for requested transformations
430 //
431 if (mSize < 1) {
432 LOG(warning) << "The method Build was not called yet";
433 Build(mask);
434 return;
435 }
436 // LOG(info) << "mask " << mask << " o2::math_utils::bit2Mask " << o2::math_utils::bit2Mask(o2::math_utils::TransformType::L2G) <<
437 // FairLogger::endl;
438 // build matrices
439 if ((mask & o2::math_utils::bit2Mask(o2::math_utils::TransformType::L2G)) && !getCacheL2G().isFilled()) {
440 LOG(info) << "Loading MFT L2G matrices from TGeo";
441 auto& cacheL2G = getCacheL2G();
442 cacheL2G.setSize(mSize);
443 for (Int_t i = 0; i < mSize; i++) {
444 TGeoHMatrix* hm = extractMatrixSensor(i);
445 cacheL2G.setMatrix(hm ? Mat3D(*hm) : Mat3D(), i);
446 }
447 }
448
449 if ((mask & o2::math_utils::bit2Mask(o2::math_utils::TransformType::T2L)) && !getCacheT2L().isFilled()) {
450 // matrices for Tracking to Local frame transformation
451 LOG(info) << "Loading MFT T2L matrices from TGeo";
452 auto& cacheT2L = getCacheT2L();
453 cacheT2L.setSize(mSize);
454 for (int i = 0; i < mSize; i++) {
455 TGeoHMatrix& hm = createT2LMatrix(i);
456 cacheT2L.setMatrix(Mat3D(hm), i);
457 }
458 }
459
460 if ((mask & o2::math_utils::bit2Mask(o2::math_utils::TransformType::T2G)) && !getCacheT2G().isFilled()) {
461 // matrices for Tracking to Global frame transformation
462 LOG(info) << "Loading MFT T2G matrices from TGeo";
463 auto& cacheT2G = getCacheT2G();
464 cacheT2G.setSize(mSize);
465 for (int i = 0; i < mSize; i++) {
466 TGeoHMatrix& mat = createT2LMatrix(i);
467 mat.MultiplyLeft(extractMatrixSensor(i));
468 cacheT2G.setMatrix(Mat3D(mat), i);
469 }
470 }
471}
472
473//__________________________________________________________________________
474void GeometryTGeo::updateL2GMatrixCache(std::vector<int> chipIDs)
475{
476 // update matrix cache for requested transformations
477 //
478 if (mSize < 1) {
479 LOG(fatal) << "Matrices must be filled beforehand.";
480 return;
481 }
482
483 // build matrices
484 auto& cacheL2G = getCacheL2G();
485 cacheL2G.setSize(mSize);
486 auto setMatrix = [this](auto chipID, auto& cacheL2G) {
487 TGeoHMatrix* hm = extractMatrixSensor(chipID);
488 cacheL2G.setMatrix(hm ? Mat3D(*hm) : Mat3D(), chipID);
489 };
490
491 if (chipIDs.size()) { // Update matrices for provided sensors
492 for (auto& i : chipIDs) {
493 setMatrix(i, cacheL2G);
494 }
495 } else {
496 for (Int_t i = 0; i < mSize; i++) {
497 setMatrix(i, cacheL2G);
498 }
499 }
500}
501//__________________________________________________________________________
503{
504 // create for sensor at index the TGeo matrix for Tracking to Local frame transformations
505
506 static TGeoHMatrix t2l;
507 Float_t x = 0.f, alpha = 0.f;
509 t2l.Clear();
510 /*
511 t2l.RotateZ(alpha * RadToDeg()); // rotate in direction of normal to the sensor plane
512 const TGeoHMatrix* matL2G = extractMatrixSensor(index);
513 const TGeoHMatrix& matL2Gi = matL2G->Inverse();
514 t2l.MultiplyLeft(&matL2Gi);
515 */
516 return t2l;
517}
518
519//__________________________________________________________________________
520void GeometryTGeo::extractSensorXAlpha(int index, float& x, float& alpha) {}
521
522//__________________________________________________________________________
523Bool_t GeometryTGeo::getSensorID(Int_t index, Int_t& half, Int_t& disk, Int_t& ladder, Int_t& sensor) const
524{
525 if (index < 0 || index >= mTotalNumberOfSensors) {
526 return kFALSE;
527 }
528
531 disk = 0;
532 while (index > mLastSensorIndex[disk]) {
533 disk++;
534 }
535 index -= getFirstSensorIndex(disk);
536 Int_t nSensor = MinSensorsPerLadder;
537 Int_t nFirstSensorIndex = 0, nFirstSensorIndexSave = 0;
538 ladder = 0;
539 while (index > ((nFirstSensorIndex += nSensor * mNumberOfLadders[disk][nSensor]) - 1)) {
540 ladder += mNumberOfLadders[disk][nSensor];
541 nFirstSensorIndexSave = nFirstSensorIndex;
542 nSensor++;
543 }
544 index -= nFirstSensorIndexSave;
545 ladder += index / nSensor;
546 sensor = index % nSensor;
547
548 return kTRUE;
549}
550
551//__________________________________________________________________________
552Int_t GeometryTGeo::getHalf(Int_t index) const
553{
555
556 return half;
557}
558
559//__________________________________________________________________________
560Int_t GeometryTGeo::getDisk(Int_t index) const
561{
563 Int_t disk = 0;
564 while (index > mLastSensorIndex[disk]) {
565 disk++;
566 }
567
568 return disk;
569}
570
571//__________________________________________________________________________
573{
575 Int_t disk = 0;
576 while (index > mLastSensorIndex[disk]) {
577 disk++;
578 }
579
580 index -= getFirstSensorIndex(disk);
581
582 Int_t nSensor = MinSensorsPerLadder;
583 Int_t ladder = 0, nFirstSensorIndex = 0, nFirstSensorIndexSave = 0;
584 while (index > ((nFirstSensorIndex += nSensor * mNumberOfLadders[disk][nSensor]) - 1)) {
585 ladder += mNumberOfLadders[disk][nSensor];
586 nFirstSensorIndexSave = nFirstSensorIndex;
587 nSensor++;
588 }
589 index -= nFirstSensorIndexSave;
590 ladder += index / nSensor;
591
592 return ladder;
593}
594
595//__________________________________________________________________________
596Int_t GeometryTGeo::getSensorIndex(Int_t halfID, Int_t diskID, Int_t ladderID, Int_t sensorID) const
597{
598 Int_t index = 0;
599 Int_t ladder = mLadderId2Index[diskID][ladderID];
600
601 Int_t nL = 0;
602 Int_t nS = MinSensorsPerLadder;
603 while (ladder > ((nL += mNumberOfLadders[diskID][nS]) - 1)) {
604 index += nS * mNumberOfLadders[diskID][nS];
605 nS++;
606 }
607 ladder -= nL - mNumberOfLadders[diskID][nS];
608
609 index += ladder * nS;
610 index += sensorID;
611 index += getFirstSensorIndex(diskID);
612 index += halfID * mTotalNumberOfSensors / 2;
613
614 return index;
615}
616
617//__________________________________________________________________________
619
620//__________________________________________________________________________
622{
623 return Form("%s_0/%s_%d_%d", composeSymNameMFT(), getMFTHalfPattern(), hf, hf);
624}
625
626//__________________________________________________________________________
627const char* GeometryTGeo::composeSymNameDisk(int hf, int dk)
628{
629 return Form("%s/%s_%d_%d_%d", composeSymNameHalf(hf), getMFTDiskPattern(), hf, dk, dk);
630}
631
632//__________________________________________________________________________
633const char* GeometryTGeo::composeSymNameLadder(int hf, int dk, int lr)
634{
635 return Form("%s/%s_%d_%d_%d_%d", composeSymNameDisk(hf, dk), getMFTLadderPattern(), hf, dk, lr, lr);
636}
637
638//__________________________________________________________________________
639const char* GeometryTGeo::composeSymNameChip(int hf, int dk, int lr, int chip)
640{
641 return Form("%s/%s_%d_%d_%d_%d", composeSymNameLadder(hf, dk, lr), getMFTChipPattern(), hf, dk, lr, chip);
642}
Definition of the GeometryManager class.
int32_t i
Class handling both virtual segmentation and real volumes.
ClassImp(o2::mft::GeometryTGeo)
uint32_t j
Definition RawData.h:0
Definition of the SegmentationAlpide class.
std::ostringstream debug
Static class with identifiers, bitmasks and names for ALICE detectors.
Definition DetID.h:58
const MatrixCache< Mat3D > & getCacheT2L() const
const MatrixCache< Mat3D > & getCacheT2G() const
int mSize
prebooked number of sensors
const MatrixCache< Mat3D > & getCacheL2G() const
static constexpr float SensorLayerThickness
static constexpr float SensorLayerThicknessEff
static const char * composeSymNameHalf(int hf)
sym name of the half
static std::string sLadderName
static constexpr Int_t MaxSensorsPerLadder
static std::string sDiskName
Int_t getFirstSensorIndex(Int_t disk) const
In a disk start numbering the sensors from zero.
static const Char_t * getMFTSensorPattern()
static const Char_t * getMFTHalfPattern()
Int_t getHalf(Int_t index) const
From matrix index to half ID.
std::vector< std::vector< Int_t > > mLadderId2Index
from to geometry index to matrix index
o2::math_utils::Transform3D Mat3D
static const char * composeSymNameChip(int hf, int dk, int lr, int chip)
Sym name of the chip in the given half/disk/ladder.
std::vector< std::vector< Int_t > > mLadderIndex2Id
from matrix index to geometry index
std::vector< Int_t > mNumberOfDisks
disks/half
static constexpr Int_t MinSensorsPerLadder
void fillMatrixCache(Int_t mask) override
Int_t getDisk(Int_t index) const
From matrix index to disk ID.
std::vector< Int_t > mLastSensorIndex
last sensor index in a layer
static const Char_t * getMFTChipPattern()
void Build(int loadTrans=0) override
Exract MFT parameters from TGeo.
void updateL2GMatrixCache(std::vector< int > chipIDs={})
std::vector< Int_t > mNumberOfSensorsPerDisk
get from sensor index the lay er
Int_t extractNumberOfDisks(Int_t half) const
Determines the number of disks in each detector half.
Int_t extractNumberOfLadders(Int_t half, Int_t disk, Int_t nsensors) const
Determines the number of ladders in each disk of each half.
std::vector< Int_t > mSensorIndexToLayer
get from sensor index the layer
static std::string sHalfName
Int_t mTotalNumberOfSensors
total number of sensors in the detector
static const char * composeSymNameLadder(int hf, int dk, int lr)
Sym name of the ladder at given half/disk.
Int_t getSensorIndex(Int_t half, Int_t disk, Int_t ladder, Int_t sensor) const
static const Char_t * getMFTLadderPattern()
std::vector< Float_t > mLayerMedianZ
z median value between the two planes of a disk
Int_t extractNumberOfHalves()
Determines the number of detector halves in the Geometry.
Int_t getLadder(Int_t index) const
From matrix index to ladder ID (matrix)
static const Char_t * getMFTVolPattern()
std::vector< std::vector< Int_t > > mNumberOfLadders
ladders[nsensor]/halfdisk
Int_t extractNumberOfSensorsPerLadder(Int_t half, Int_t disk, Int_t ladder) const
Determines the number of sensors in each ladder of each disk of each half.
std::vector< Int_t > mNumberOfLaddersPerDisk
ladders/halfdisk
Int_t getLayer(Int_t index) const
get layer index (0:9) from the chip index
TGeoHMatrix * extractMatrixSensor(Int_t index) const
static void adopt(GeometryTGeo *raw, bool canDelete=false)
Bool_t getSensorID(Int_t index, Int_t &half, Int_t &disk, Int_t &ladder, Int_t &sensor) const
~GeometryTGeo() override
Default destructor, don't use.
void extractSensorXAlpha(int index, float &x, float &alp)
TGeoHMatrix & createT2LMatrix(Int_t isn)
static const Char_t * getMFTDiskPattern()
static std::string sSensorName
Int_t extractVolumeCopy(const Char_t *name, const Char_t *prefix) const
Extract number following the prefix in the name string.
static std::string sChipName
static const char * composeSymNameMFT()
sym name of the MFT
static std::string sVolumeName
static const char * composeSymNameDisk(int hf, int dk)
Sym name of the disk at given half.
Int_t mNumberOfHalves
number of detector halves
GLdouble n
Definition glcorearb.h:1982
GLfloat GLfloat GLfloat alpha
Definition glcorearb.h:279
GLint GLenum GLint x
Definition glcorearb.h:403
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
static constexpr int T2L
Definition Cartesian.h:55
static constexpr int T2G
Definition Cartesian.h:56
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"