forked from AliceO2Group/AliceO2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDescriptorInnerBarrelITS3.cxx
More file actions
72 lines (63 loc) · 3.23 KB
/
DescriptorInnerBarrelITS3.cxx
File metadata and controls
72 lines (63 loc) · 3.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
#include "ITS3Simulation/DescriptorInnerBarrelITS3.h"
#include "ITSBase/GeometryTGeo.h"
#include "Framework/Logger.h"
using namespace o2::its3;
ClassImp(DescriptorInnerBarrelITS3);
void DescriptorInnerBarrelITS3::createLayer(int iLayer, TGeoVolume* dest)
{
mIBLayers[iLayer] = std::make_unique<ITS3Layer>(iLayer);
mIBLayers[iLayer]->createLayer(dest);
}
void DescriptorInnerBarrelITS3::createServices(TGeoVolume* dest)
{
mServices = std::make_unique<ITS3Services>();
mServices->createCYSSAssembly(dest);
}
void DescriptorInnerBarrelITS3::addAlignableVolumesLayer(int idLayer, int wrapperLayerId, TString& parentPath, int& lastUID) const
{
TString wrpV = wrapperLayerId != -1 ? Form("%s%d_1", its::GeometryTGeo::getITSWrapVolPattern(), wrapperLayerId) : "";
TString path = Form("%s/%s/%s%d_0", parentPath.Data(), wrpV.Data(), its::GeometryTGeo::getITS3LayerPattern(), idLayer);
TString sname = its::GeometryTGeo::composeSymNameLayer(idLayer, true);
for (int iHalfBarrel{0}; iHalfBarrel < 2; ++iHalfBarrel) {
addAlignableVolumesHalfBarrel(idLayer, iHalfBarrel, path, lastUID);
}
}
void DescriptorInnerBarrelITS3::addAlignableVolumesHalfBarrel(int idLayer, int iHB, TString& parentPath, int& lastUID) const
{
// for ITS3 smallest alignable volume is the half-barrel (e.g., the carbon-form composite structure with the sensors)
TString path = Form("%s/%s%d_%d", parentPath.Data(), its::GeometryTGeo::getITS3HalfBarrelPattern(), idLayer, iHB);
TString sname = its::GeometryTGeo::composeSymNameHalfBarrel(idLayer, iHB, true);
if (!gGeoManager->SetAlignableEntry(sname.Data(), path.Data())) {
LOG(fatal) << "Unable to set alignable entry ! " << sname << " : " << path;
}
addAlignableVolumesChips(idLayer, iHB, path, lastUID);
}
void DescriptorInnerBarrelITS3::addAlignableVolumesChips(int idLayer, int iHB, TString& parentPath, int& lastUID) const
{
for (int seg{0}; seg < constants::nSegments[idLayer]; ++seg) {
for (int rsu{0}; rsu < constants::segment::nRSUs; ++rsu) {
for (int tile{0}; tile < constants::rsu::nTiles; ++tile) {
TString path = parentPath;
path += Form("/%s_0/", its::GeometryTGeo::getITS3ChipPattern(idLayer));
path += Form("%s_%d/", its::GeometryTGeo::getITS3SegmentPattern(idLayer), seg);
path += Form("%s_%d/", its::GeometryTGeo::getITS3RSUPattern(idLayer), rsu);
path += Form("%s_%d/", its::GeometryTGeo::getITS3TilePattern(idLayer), tile);
TString sname = its::GeometryTGeo::composeSymNameChip(idLayer, iHB, 0, seg, rsu, tile, true);
if (!gGeoManager->SetAlignableEntry(sname.Data(), path.Data())) {
LOG(fatal) << "Unable to set alignable entry ! " << sname << " : " << path;
}
++lastUID;
}
}
}
}