CbmRoot
Loading...
Searching...
No Matches
CbmMvdGeoHandler.cxx
Go to the documentation of this file.
1/* Copyright (C) 2014-2020 Institut fuer Kernphysik, Goethe-Universitaet Frankfurt, Frankfurt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Philipp Sitzmann [committer], Florian Uhlig */
4
12#include "CbmMvdGeoHandler.h"
13
14#include "CbmMvdDetector.h" // for CbmMvdDetector
15#include "CbmMvdHelper.h" // for CbmMvdSensorTyp
16#include "CbmMvdMimosa26AHR.h" // for CbmMvdMimosa26AHR
17#include "CbmMvdMimosis.h" // for CbmMvdMimosis
18#include "CbmMvdStationPar.h" // for CbmMvdStationPar
19
20#include <Logger.h> // for LOG, Logger
21
22#include <TGeoBBox.h> // for TGeoBBox
23#include <TGeoManager.h> // for TGeoManager, gGeoManager
24#include <TGeoMaterial.h> // for TGeoMaterial
25#include <TGeoNode.h> // for TGeoNode
26#include <TGeoVolume.h> // for TGeoVolume
27#include <TObjArray.h> // for TObjArray
28#include <TString.h> // for TString, operator+, Form, operator<<
29
30#include <cmath> // for fabs
31
32//--------------------------------------------------------------------------
34 : TObject()
35 , fSensorTyp(CbmMvdSensorTyp::MIMOSA26)
36 , fDetector(nullptr)
37 , fStationPar(nullptr)
38 , fStationMap()
39 , fIsSimulation(kFALSE)
40 , fGeoPathHash()
41 ,
42 fCurrentVolume()
43 ,
44 fVolumeShape()
45 ,
46 fGlobal()
47 ,
48 fGlobalMatrix()
49 ,
50 fLayerId(-1)
51 ,
52 fModuleId(-1)
53 ,
54 fModuleType(-1)
55 ,
56 fStation(-1)
57 ,
58 fMother("")
59 , fGeoTyp()
60 , fVolId()
61 , fStationNumber(-1)
62 , fWidth(0.)
63 , fHeight(0.)
64 , fZRadThickness(0.)
65 , fBeamwidth(0.)
66 , fBeamheight(0.)
67 , fZThickness(0.)
68 , fXres(0.)
69 , fYres(0.)
70 , fStationName("")
71 , fDetectorName("")
72 , fSectorName("")
73 , fQuadrantName("")
74 , fSensorHolding("")
75 , fSensorName("")
76 , fnodeName("")
77{
78}
79//--------------------------------------------------------------------------
80
81//--------------------------------------------------------------------------
83
84//--------------------------------------------------------------------------
85
86//--------------------------------------------------------------------------
87void CbmMvdGeoHandler::Init(Bool_t isSimulation)
88{
89
90
91 fIsSimulation = isSimulation;
92 GetPipe();
94
95
96 if (!isSimulation) {
97 if (fSensorTyp == CbmMvdSensorTyp::MIMOSIS) LOG(info) << "Using Mimosis style sensor";
98 else
99 LOG(info) << "Using Mimosa style sensor";
103 switch (fGeoTyp) {
104 case scripted:
105 case FourStation:
106 case FourStationShift: fStationPar->Init(4); break;
107 case ThreeStation: fStationPar->Init(3); break;
108 case TwoStation: fStationPar->Init(2); break;
109 case MiniCbm: fStationPar->Init(2); break;
110 default: fStationPar->Init(0);
111 }
112 }
113}
114//--------------------------------------------------------------------------
115
116//--------------------------------------------------------------------------
118{
119 // In the simulation we can not rely on the TGeoManager information
120 // In the simulation we get the correct information only from gMC
121
122 return 1;
123}
124//--------------------------------------------------------------------------
125
126//--------------------------------------------------------------------------
127Int_t CbmMvdGeoHandler::GetSensorAddress(const TString& path)
128{
129 if (fGeoPathHash != path.Hash()) { NavigateTo(path); }
130 return GetSensorAddress();
131}
132//--------------------------------------------------------------------------
133
134//--------------------------------------------------------------------------
135Double_t CbmMvdGeoHandler::GetSizeX(const TString& path)
136{
137 if (fGeoPathHash != path.Hash()) { NavigateTo(path); }
138 return fVolumeShape->GetDX();
139}
140//--------------------------------------------------------------------------
141
142//--------------------------------------------------------------------------
143Double_t CbmMvdGeoHandler::GetSizeY(const TString& path)
144{
145 if (fGeoPathHash != path.Hash()) { NavigateTo(path); }
146 return fVolumeShape->GetDY();
147}
148//--------------------------------------------------------------------------
149
150//--------------------------------------------------------------------------
151Double_t CbmMvdGeoHandler::GetSizeZ(const TString& path)
152{
153 if (fGeoPathHash != path.Hash()) { NavigateTo(path); }
154 return fVolumeShape->GetDZ();
155}
156//--------------------------------------------------------------------------
157
158//--------------------------------------------------------------------------
159Double_t CbmMvdGeoHandler::GetZ(const TString& path)
160{
161 if (fGeoPathHash != path.Hash()) { NavigateTo(path); }
162 return fGlobal[2];
163}
164//--------------------------------------------------------------------------
165
166//--------------------------------------------------------------------------
167Double_t CbmMvdGeoHandler::GetY(const TString& path)
168{
169 if (fGeoPathHash != path.Hash()) { NavigateTo(path); }
170 return fGlobal[1];
171}
172//--------------------------------------------------------------------------
173
174//--------------------------------------------------------------------------
175Double_t CbmMvdGeoHandler::GetX(const TString& path)
176{
177 if (fGeoPathHash != path.Hash()) { NavigateTo(path); }
178 return fGlobal[0];
179}
180//--------------------------------------------------------------------------
181
182
183//--------------------------------------------------------------------------
184Int_t CbmMvdGeoHandler::GetStation(const TString& path)
185{
186 if (fGeoPathHash != path.Hash()) { NavigateTo(path); }
187 return fStation;
188}
189//--------------------------------------------------------------------------
190
191
192//--------------------------------------------------------------------------
193void CbmMvdGeoHandler::NavigateTo(const TString& path)
194{
195 //LOG(info) << "path : " << path.Data();
196 if (fIsSimulation) { LOG(fatal) << "This method is not supported in simulation mode"; }
197 else {
198 gGeoManager->cd(path.Data());
199 fGeoPathHash = path.Hash();
200 fCurrentVolume = gGeoManager->GetCurrentVolume();
201 TString name = fCurrentVolume->GetName();
202 LOG(debug2) << "this volume is " << name;
203 fVolumeShape = (TGeoBBox*) fCurrentVolume->GetShape();
204 Double_t local[3] = {0., 0., 0.}; // Local center of volume
205 gGeoManager->LocalToMaster(local, fGlobal);
206 fGlobalMatrix = gGeoManager->GetCurrentMatrix();
207 if (path.Contains("-S0-") || path.Contains("_S0_")) fStationNumber = 0;
208 else if (path.Contains("-S1-") || path.Contains("_S1_"))
209 fStationNumber = 1;
210 else if (path.Contains("-S2-") || path.Contains("_S2_"))
211 fStationNumber = 2;
212 else if (path.Contains("-S3-") || path.Contains("_S3_"))
213 fStationNumber = 3;
214 else
215 LOG(fatal) << "couldn't find Station in volume name, something seems fishy ";
216
217 LOG(debug2) << "I am in path: " << path;
218 LOG(debug2) << "I am: " << name;
219 LOG(debug2) << "I am on station: " << fStationNumber;
220 LOG(debug2) << "I am at X: " << fGlobal[0];
221 LOG(debug2) << "I am at Y: " << fGlobal[1];
222 LOG(debug2) << "I am at Z: " << fGlobal[2];
223
224 local[0] = fVolumeShape->GetDX();
225 local[1] = fVolumeShape->GetDY();
226 local[2] = fVolumeShape->GetDZ();
227 Double_t fGlobalMax[3];
228 gGeoManager->LocalToMaster(local, fGlobalMax);
229
230 local[0] = -1 * fVolumeShape->GetDX();
231 local[1] = -1 * fVolumeShape->GetDY();
232 local[2] = -1 * fVolumeShape->GetDZ();
233 Double_t fGlobalMin[3];
234 gGeoManager->LocalToMaster(local, fGlobalMin);
235
236 if (fGlobalMax[0] > fGlobalMin[0]) {
237 fWidth = fGlobalMax[0];
238 fBeamwidth = fGlobalMin[0];
239 }
240 else {
241 fWidth = fGlobalMin[0];
242 fBeamwidth = fGlobalMax[0];
243 }
244 if (fGlobalMax[1] > fGlobalMin[1]) {
245 fHeight = fGlobalMax[1];
246 fBeamheight = fGlobalMin[1];
247 }
248 else {
249 fHeight = fGlobalMin[1];
250 fBeamheight = fGlobalMax[1];
251 }
252
253 fZThickness = fabs(fGlobalMax[2] - fGlobalMin[2]);
254 Double_t radLength = fCurrentVolume->GetMaterial()->GetRadLen();
255 fZRadThickness = fZThickness / radLength;
256
257 fXres = 3.8; // TODO: pixelSizeX / sqrt{12}
258 fYres = 3.8; // TODO: pixelSizeY / sqrt{12}
259 }
260}
261//--------------------------------------------------------------------------
262
263//--------------------------------------------------------------------------
265{
266 TString pipeName = "pipe";
267 TString motherName;
268 Bool_t fail = kTRUE;
269
270 TObjArray* nodes = gGeoManager->GetTopNode()->GetNodes();
271
272 for (Int_t iNode = 0; iNode < nodes->GetEntriesFast(); iNode++) {
273 TGeoNode* node = (TGeoNode*) nodes->At(iNode);
274 if (TString(node->GetName()).Contains(pipeName, TString::ECaseCompare::kIgnoreCase)) {
275 motherName = node->GetName();
276 fMother = Form("cave_1/%s/pipevac1_0", motherName.Data());
277 LOG(debug) << "MvdGeoHandler found Mother: " << fMother;
278 fail = kFALSE;
279 break;
280 }
281 else
282 continue;
283 }
284 if (fail) {
285 LOG(debug) << "Check for MVD outside of pipe";
286
287 for (Int_t iNode = 0; iNode < nodes->GetEntriesFast(); iNode++) {
288 TGeoNode* node = (TGeoNode*) nodes->At(iNode);
289 if (TString(node->GetName()).Contains("mvd", TString::ECaseCompare::kIgnoreCase)) {
290 motherName = node->GetName();
291 fMother = "cave_1";
292 LOG(debug) << "MvdGeoHandler found Mother: " << fMother;
293 LOG(warn) << "Mvd found outside of pipe, use this setup only in testing";
294 fail = kFALSE;
295 break;
296 }
297 else
298 continue;
299 }
300 }
301 if (fail) LOG(fatal) << "MVD Geometry included, but pipe not found please check your setup";
302}
303//--------------------------------------------------------------------------
304
305//--------------------------------------------------------------------------
306
308{
309 if (gGeoManager->CheckPath(fMother + "/Beamtimeosetupoobgnum_0")) {
310 LOG(info) << "Found Beamtimesetupy";
312 }
313 else if (gGeoManager->CheckPath(fMother + "/MVDoMistraloquero012oStationo150umodigi_0")) {
314 LOG(debug) << "Found MVD with 3 Stations";
316 }
317 else if (gGeoManager->CheckPath(fMother + "/MVDo0123ohoFPCoextoHSoSo0123_0")) {
318 LOG(debug) << "Found MVD with 4 Stations";
320 fDetectorName = "/MVDo0123ohoFPCoextoHSoSo0123_0";
321 }
322 else if (gGeoManager->CheckPath(fMother + "/MVDo1123ohoFPCoextoHSoSo1123_0")) {
323 LOG(debug) << "Found shifted MVD with 4 Stations";
325 fDetectorName = "/MVDo1123ohoFPCoextoHSoSo1123_0";
326 }
327 else if (gGeoManager->CheckPath(fMother + "/MVDomCBM_0")) {
328 LOG(debug) << "Found mCBM MVD configuration";
329 fDetectorName = "/MVDomCBM_0";
331 }
332 else if (gGeoManager->CheckPath(fMother + "/MVDomCBMorotated_0")) {
333 LOG(debug) << "Found mCBM MVD rotated configuration";
334 fDetectorName = "/MVDomCBMorotated_0";
336 }
337 else if (gGeoManager->CheckPath(fMother + "/TwoStation_0")) {
338 LOG(info) << "Found two station scripted MVD configuration";
339 fDetectorName = "/TwoStation_0";
341 }
342 else if (gGeoManager->CheckPath(fMother + "/MVDscripted_0")) {
343 LOG(info) << "Found scripted MVD configuration";
344 fDetectorName = "/MVDscripted_0";
346 }
347 else {
348 LOG(info) << "Try standard Geometry";
350 }
351}
352//--------------------------------------------------------------------------
353
354//--------------------------------------------------------------------------
356{
357 // path is build as: cave_1/*pipe/MVDscripted_0/quadrant_S*_*/sensor_*/sensorActive
358 Int_t id = 0;
359 TString sensorName;
360
361 TString quadrantName;
362 TString stationName;
363
364 gGeoManager->cd(path.Data());
365
366 sensorName = gGeoManager->GetMother(1)->GetName();
367 sensorName.Remove(0, 7);
368 Int_t sensorNumber = sensorName.Atoi();
369
370 quadrantName = gGeoManager->GetMother(2)->GetName();
371 stationName = quadrantName(10);
372 quadrantName.Remove(0, 12);
373 Int_t quadNumber = quadrantName.Atoi();
374 Int_t stationNumber = stationName.Atoi();
375
376 id = 1000 * stationNumber + 100 * quadNumber + sensorNumber;
377
378 // LOG(debug) << "We are on Station: " << stationNumber << " in Quadrant: " << quadNumber << " and Sensor: " << sensorNumber;
379 // LOG(debug) << "This ID is: " << id;
380
381
382 return id;
383}
384//--------------------------------------------------------------------------
385
386
387//--------------------------------------------------------------------------
389{
391 else
392 FillDetector();
393}
394//--------------------------------------------------------------------------
395
396//--------------------------------------------------------------------------
398{
399 if (fGeoTyp == Default)
400 LOG(error) << "Using old Geometry files within the new Digitizer is not supported, "
401 << "please use CbmMvdDigitizeL if you want to use this Geometry";
402
404
405 if (!fDetector) LOG(fatal) << "GeometryHandler couldn't find a valid Detector";
406
407 Int_t iStation = 0;
408 for (Int_t StatNr = 0; StatNr < 4; StatNr++) {
409 fStationNumber = StatNr;
410 if (StatNr == 0 && fGeoTyp == FourStation) fStationName = "/MVDo0ohoFPCoHSoS_1";
411 else
412 fStationName = Form("/MVDo%iohoFPCoextoHSoS_1", StatNr);
413 for (Int_t QuadNr = 0; QuadNr < 4; QuadNr++) {
414 if (StatNr == 0 && fGeoTyp == 4) fQuadrantName = Form("/St0Q%iohoFPC_1", QuadNr);
415 else
416 fQuadrantName = Form("/St%iQ%iohoFPCoext_1", StatNr, QuadNr);
417 for (Int_t Layer = 0; Layer < 2; Layer++) {
418
419 for (Int_t SensNr = 0; SensNr < 50; SensNr++) {
420 fSensorHolding = Form("/MVD-S%i-Q%i-L%i-C%02i-P0oPartAss_1", StatNr, QuadNr, Layer, SensNr);
421 fSensorName = Form("MVD-S%i-Q%i-L%i-C%02i-P0", StatNr, QuadNr, Layer, SensNr);
422 fVolId = gGeoManager->GetUID(fSensorName);
423 if (fVolId > -1)
424 for (Int_t SegmentNr = 0; SegmentNr < 50; SegmentNr++) {
425 fSectorName = Form("/S%iQ%iS%i_1", StatNr, QuadNr, SegmentNr);
427 + fSensorName + "_1";
428 LOG(debug) << "looking for " << fnodeName;
429 Bool_t nodeFound = gGeoManager->CheckPath(fnodeName.Data());
430 if (nodeFound) {
432 0.0, StatNr);
433 iStation++;
435 }
436 }
437 }
438 }
439 }
440 }
441 }
442
443 else if (fGeoTyp == scripted) {
444 fSensorName = "sensorActive";
445 if (!fDetector) LOG(fatal) << "GeometryHandler couldn't find a valid Detector";
446
447
448 Int_t iStation = 0;
449 for (Int_t StatNr = 0; StatNr < 4; StatNr++) {
450 fStationNumber = StatNr;
451 fStationName = Form("/station_S%d_1", StatNr);
452 for (Int_t QuadNr = 0; QuadNr < 4; QuadNr++) {
453 fQuadrantName = Form("/quadrant_S%d_%d", StatNr, QuadNr);
454 for (Int_t SensNr = 0; SensNr < 50; SensNr++) {
455 fSensorHolding = Form("/sensor_%d", SensNr);
456 fnodeName =
458 LOG(debug1) << "looking for " << fnodeName;
459 Bool_t nodeFound = gGeoManager->CheckPath(fnodeName.Data());
460 if (nodeFound) {
461 gGeoManager->cd(fnodeName);
463
466 StatNr);
467 else
469 StatNr);
470 iStation++;
472 LOG(debug1) << "found " << fSensorHolding + "/" + fSensorName << " number: " << fVolId
473 << " and added to MVD Detector";
474 }
475 else
476 break;
477 }
478 }
479 }
480 }
481
482 else if (fGeoTyp == TwoStation) {
483 fSensorName = "sensorActive";
484 if (!fDetector) LOG(fatal) << "GeometryHandler couldn't find a valid Detector";
485 Int_t iStation = 0;
486 for (Int_t StatNr = 0; StatNr < 2; StatNr++) {
487 fStationNumber = StatNr;
488 fStationName = Form("/station_S%d_1", StatNr);
489 for (Int_t QuadNr = 0; QuadNr < 4; QuadNr++) {
490 fQuadrantName = Form("/quadrant_S%d_%d", StatNr, QuadNr);
491 for (Int_t SensNr = 0; SensNr < 50; SensNr++) {
492 fSensorHolding = Form("/sensor_%d", SensNr);
493 fnodeName =
495 LOG(debug1) << "looking for " << fnodeName;
496 Bool_t nodeFound = gGeoManager->CheckPath(fnodeName.Data());
497 if (nodeFound) {
498 gGeoManager->cd(fnodeName);
500
503 StatNr);
504 else
506 StatNr);
507 iStation++;
509 LOG(debug1) << "found " << fSensorHolding + "/" + fSensorName << " number: " << fVolId
510 << " and added to MVD Detector";
511 }
512 else
513 break;
514 }
515 }
516 }
517 }
518
519
520 else if (fGeoTyp == MiniCbm) {
521
522 if (!fDetector) LOG(fatal) << "GeometryHandler couldn't find a valid mCBM Detector";
523
524 Int_t iStation = 0;
525 for (Int_t StatNr = 0; StatNr < 2; StatNr++) {
526 fStationNumber = StatNr;
527 fStationName = Form("/MVDomCBMoS%i_1", StatNr);
528
529 for (Int_t Layer = 0; Layer < 2; Layer++) {
530 for (Int_t SensNr = 0; SensNr < 50; SensNr++) {
531 fQuadrantName = Form("/MVD-S%i-Q0-L%i-C%02i_1", StatNr, Layer, SensNr);
532 fSensorHolding = Form("/MVD-S%i-Q0-L%i-C%02i-P0oPartAss_1", StatNr, Layer, SensNr);
533 fSensorName = Form("MVD-S%i-Q0-L%i-C%02i-P0", StatNr, Layer, SensNr);
534 fVolId = gGeoManager->GetUID(fSensorName);
535 if (fVolId > -1) {
536 fnodeName =
538 Bool_t nodeFound = gGeoManager->CheckPath(fnodeName.Data());
539 if (nodeFound) {
541 StatNr);
542 iStation++;
544 }
545 }
546 }
547 }
548 }
549 }
550 else {
551 LOG(error) << "Tried to load an unsupported MVD Geometry";
552 }
553}
554//--------------------------------------------------------------------------
555
556//--------------------------------------------------------------------------
569//--------------------------------------------------------------------------
570
571//--------------------------------------------------------------------------
573//--------------------------------------------------------------------------
574
575//--------------------------------------------------------------------------
577{
579 Int_t iStation = 0;
580 for (Int_t StatNr = 0; StatNr < 4; StatNr++) {
581 if (StatNr == 0 && fGeoTyp == FourStation) fStationName = "/MVDo0ohoFPCoHSoS_1";
582 else
583 fStationName = Form("/MVDo%iohoFPCoextoHSoS_1", StatNr);
584 for (Int_t QuadNr = 0; QuadNr < 4; QuadNr++) {
585 if (StatNr == 0 && fGeoTyp == 4) fQuadrantName = Form("/St0Q%iohoFPC_1", QuadNr);
586 else
587 fQuadrantName = Form("/St%iQ%iohoFPCoext_1", StatNr, QuadNr);
588 for (Int_t Layer = 0; Layer < 2; Layer++) {
589 for (Int_t SensNr = 0; SensNr < 50; SensNr++) {
590 fSensorHolding = Form("/MVD-S%i-Q%i-L%i-C%02i-P0oPartAss_1", StatNr, QuadNr, Layer, SensNr);
591 fSensorName = Form("MVD-S%i-Q%i-L%i-C%02i-P0", StatNr, QuadNr, Layer, SensNr);
592 fVolId = gGeoManager->GetUID(fSensorName);
593 if (fVolId > -1)
594 for (Int_t SegmentNr = 0; SegmentNr < 50; SegmentNr++) {
595 fSectorName = Form("/S%iQ%iS%i_1", StatNr, QuadNr, SegmentNr);
597 + fSensorName + "_1";
598 LOG(debug) << "looking for " << fnodeName;
599 Bool_t nodeFound = gGeoManager->CheckPath(fnodeName.Data());
600 if (nodeFound) {
601 fStationMap[fVolId] = iStation;
602 iStation++;
603 }
604 }
605 }
606 }
607 }
608 }
609 }
610 else if (fGeoTyp == scripted) {
611 fSensorName = "sensorActive";
612 Int_t iStation = 0;
613 for (Int_t StatNr = 0; StatNr < 4; StatNr++) {
614 fStationName = Form("/station_S%d_1", StatNr);
615 for (Int_t QuadNr = 0; QuadNr < 4; QuadNr++) {
616 fQuadrantName = Form("/quadrant_S%d_%d", StatNr, QuadNr);
617 for (Int_t SensNr = 0; SensNr < 50; SensNr++) {
618 fSensorHolding = Form("/sensor_%d", SensNr);
619 fnodeName =
621 LOG(debug) << "looking for " << fnodeName;
622 Bool_t nodeFound = gGeoManager->CheckPath(fnodeName.Data());
623 if (nodeFound) {
624 gGeoManager->cd(fnodeName);
626 LOG(debug) << "found " << fnodeName << " number: " << iStation << " ID: " << fVolId
627 << " and added to station map";
628 fStationMap[fVolId] = iStation;
629 iStation++;
630 LOG(debug) << "Map now size: " << fStationMap.size();
631 }
632 else
633 break;
634 }
635 }
636 }
637 }
638 else if (fGeoTyp == TwoStation) {
639 fSensorName = "sensorActive";
640 Int_t iStation = 0;
641 for (Int_t StatNr = 0; StatNr < 2; StatNr++) {
642 fStationName = Form("/station_S%d_1", StatNr);
643 for (Int_t QuadNr = 0; QuadNr < 4; QuadNr++) {
644 fQuadrantName = Form("/quadrant_S%d_%d", StatNr, QuadNr);
645 for (Int_t SensNr = 0; SensNr < 50; SensNr++) {
646 fSensorHolding = Form("/sensor_%d", SensNr);
647 fnodeName =
649 LOG(debug) << "looking for " << fnodeName;
650 Bool_t nodeFound = gGeoManager->CheckPath(fnodeName.Data());
651 if (nodeFound) {
652 gGeoManager->cd(fnodeName);
654 LOG(debug) << "found " << fnodeName << " number: " << iStation << " ID: " << fVolId
655 << " and added to station map";
656 fStationMap[fVolId] = iStation;
657 iStation++;
658 LOG(debug) << "Map now size: " << fStationMap.size();
659 }
660 else
661 break;
662 }
663 }
664 }
665 }
666 else if (fGeoTyp == Default) {
667 Int_t iStation = 1;
668 Int_t volId = -1;
669 do {
670 TString volName = Form("mvdstation%02i", iStation);
671 volId = gGeoManager->GetUID(volName);
672 if (volId > -1) {
673 fStationMap[volId] = iStation;
674 LOG(info) << GetName() << "::ConstructAsciiGeometry: "
675 << "Station No. " << iStation << ", volume ID " << volId << ", volume name " << volName;
676 iStation++;
677 }
678 } while (volId > -1);
679 }
680 else if (fGeoTyp == MiniCbm) {
681 Int_t iStation = 0;
682 for (Int_t StatNr = 0; StatNr < 2; StatNr++) {
683 fStationName = Form("/MVDomCBMoS%i_1", StatNr);
684 for (Int_t Layer = 0; Layer < 2; Layer++) {
685 for (Int_t SensNr = 0; SensNr < 50; SensNr++) {
686 fQuadrantName = Form("/MVD-S%i-Q0-L%i-C%02i_1", StatNr, Layer, SensNr);
687 fSensorHolding = Form("/MVD-S%i-Q0-L%i-C%02i-P0oPartAss_1", StatNr, Layer, SensNr);
688 fSensorName = Form("MVD-S%i-Q0-L%i-C%02i-P0", StatNr, Layer, SensNr);
689 //LOG(debug) << "try to find: " << fSensorName;
690 fVolId = gGeoManager->GetUID(fSensorName);
691 if (fVolId > -1) {
692 fnodeName =
694 //LOG(debug) << "sensorfound check for node " << fnodeName;
695 Bool_t nodeFound = gGeoManager->CheckPath(fnodeName.Data());
696 if (nodeFound) {
697 //LOG(debug) << "node found " << fnodeName;
698 fStationMap[fVolId] = iStation;
699 iStation++;
700 }
701 }
702 }
703 }
704 }
705 }
706 else {
707 LOG(error) << "You tried to use an unsuported Geometry";
708 }
709}
710//--------------------------------------------------------------------------
711
ClassImp(CbmConverterManager)
Helper class to extract information from the GeoManager. Addapted from TrdGeoHandler byFlorian Uhlig ...
@ scripted
@ ThreeStation
@ TwoStation
@ Default
@ FourStationShift
@ MiniCbm
@ beamtest
@ FourStation
CbmMvdSensorTyp
Definition CbmMvdHelper.h:8
void AddSensor(TString clearName, TString fullName, TString nodeName, CbmMvdSensorDataSheet *sensorData, Int_t sensorNr, Int_t volumeId, Double_t sensorStartTime, Int_t stationNr)
static CbmMvdDetector * Instance()
void SetParameterFile(CbmMvdStationPar *parameter)
~CbmMvdGeoHandler()
Destructor.
CbmMvdGeoHandler()
Constructor.
void Init(Bool_t isSimulation=kFALSE)
TGeoHMatrix * fGlobalMatrix
Global center of volume.
std::map< Int_t, Int_t > fStationMap
Double_t GetZ(const TString &path)
Double_t GetSizeZ(const TString &path)
TString fMother
StationTypeID, 1..3.
Int_t GetIDfromPath(TString path)
Double_t GetSizeY(const TString &path)
Int_t GetStation(const TString &path)
CbmMvdSensorTyp fSensorTyp
Double_t GetSizeX(const TString &path)
Int_t GetSensorAddress()
Return module address calculated based on the current node in the TGeoManager.
Double_t GetY(const TString &path)
void NavigateTo(const TString &sensor)
CbmMvdDetector * fDetector
Double_t GetX(const TString &path)
TGeoVolume * fCurrentVolume
CbmMvdStationPar * fStationPar
void AddYRes(Int_t stationNumber, Double_t yres)
void Init(Int_t nrOfStations)
void Print(Option_t *opt="") const
void AddZPosition(Int_t stationNumber, Double_t z, Double_t zThickness)
void AddBeamWidth(Int_t stationNumber, Double_t beamwidth)
void AddHeight(Int_t stationNumber, Double_t height)
void AddWidth(Int_t stationNumber, Double_t width)
void AddBeamHeight(Int_t stationNumber, Double_t beamheight)
void AddZRadThickness(Int_t stationNumber, Double_t length)
void AddXRes(Int_t stationNumber, Double_t xres)