35 {
36
37 int brl_ec=0;
38
39
41
42
43 int nbECSector =
m_gmt_mgr->PixelECNSectors1();
44 if(nbECSector==0){
45 return nullptr;
46 }
47
48 std::ostringstream ostr;
50 const GeoLogVol* theDisk{nullptr};
52
53
54
58 const GeoMaterial* air =
m_mat_mgr->getMaterial(
"std::Air");
59 const GeoTube* diskTube = new GeoTube(rmin,rmax,halflength);
60 theDisk = new GeoLogVol("Disk"+ostr.str(),diskTube,air);
61 }
62
63
66 GeoFullPhysVol* diskPhys =
m_sqliteReader==
nullptr ?
new GeoFullPhysVol(theDisk) : nullptr;
67
68
69
70
72 double zpos =
m_gmt_mgr->PixelECSiDz1()*0.5;
74
76
77
78
79
80 double moduleRadius =
m_gmt_mgr->PixelDiskRMin() + 0.5*
m_gmt_mgr->PixelBoardActiveLength();
81
82
83 bool oldGeometry = (
m_gmt_mgr->dbVersion() < 1);
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
134
135
136
137 int pixelECNSectors1 =
m_gmt_mgr->PixelECNSectors1();
138 for (int ii = 0; ii < pixelECNSectors1*2; ii++) {
139
140
141
142
143
144
145 int phiId = 0;
146 if(pixelECNSectors1>0) phiId = (
m_gmt_mgr->GetSide()>0) ? ii : (3*pixelECNSectors1-ii-1)%(pixelECNSectors1*2);
147
149
151 psd.Build();
152 std::string
key=
"ModuleEC_"+ std::to_string(phiId)+
"_"+std::to_string(
m_gmt_mgr->GetLD())+
"_"+std::to_string(
m_gmt_mgr->Phi())+
"_"+std::to_string(
m_gmt_mgr->Eta());
153 Identifier id = theSensor.getID();
155 continue;
156 }
157
159
160 int diskSide = (ii%2) ? +1 : -1;
161
162
163 GeoTrf::Transform3D rmX(GeoTrf::Transform3D::Identity());
164 if (oldGeometry &&
m_gmt_mgr->GetSide()<0) {
165 if (diskSide > 0) rmX = GeoTrf::RotateX3D(180.*Gaudi::Units::deg);
166 } else {
167 if (diskSide < 0) rmX = GeoTrf::RotateX3D(180.*Gaudi::Units::deg);
168 }
169 GeoTrf::Transform3D rm = GeoTrf::RotateZ3D(
angle) * rmX * GeoTrf::RotateY3D(90*Gaudi::Units::deg);
170 GeoTrf::Vector3D
pos(moduleRadius,0.,diskSide*zpos);
172 GeoAlignableTransform* xform =
new GeoAlignableTransform(GeoTrf::Translate3D(
pos.x(),
pos.y(),
pos.z())*rm);
173 GeoVPhysVol * modulePhys = psd.Build();
174 std::ostringstream nameTag;
175 nameTag << "ModuleEC" << phiId;
176 GeoNameTag *
tag =
new GeoNameTag(nameTag.str());
177 diskPhys->add(tag);
178 diskPhys->add(new GeoIdentifierTag(phiId));
179 diskPhys->add(xform);
180 diskPhys->add(modulePhys);
181
182
183 Identifier id = theSensor.getID();
184 m_DDmgr->addAlignableTransform(0,
id,xform,modulePhys);
185 }
186
188 std::string
key=
"PixelDisk_"+std::to_string(brl_ec)+
"_"+std::to_string(
m_gmt_mgr->GetLD())+
"_"+std::to_string(
m_gmt_mgr->Phi())+
"_"+std::to_string(
m_gmt_mgr->Eta());
189 diskPhys=(*m_mapFPV)[
key];
190 }
191 else {
192
193
194
196 for(int ii =0; ii< pds.NCylinders(); ii++) {
197 pds.SetCylinder(ii);
198 GeoTransform* xform = new GeoTransform( GeoTrf::Translate3D(0, 0, pds.ZPos()) );
199 diskPhys->add(xform);
200 diskPhys->add(pds.Build() );
201 }
202 }
203
204
205 InDetDD::ExtraMaterial xMat(
m_gmt_mgr->distortedMatManager());
206 xMat.add(diskPhys,"PixelDisc");
207
208
209 xMat.add(diskPhys,"PixelDisc"+ostr.str());
211 xMat.add(diskPhys,"PixelDiscA");
212 xMat.add(diskPhys,"PixelDiscA"+ostr.str());
213 } else {
214 xMat.add(diskPhys,"PixelDiscC");
215 xMat.add(diskPhys,"PixelDiscC"+ostr.str());
216 }
217
218
219 return diskPhys;
220}
Scalar deltaPhi(const MatrixBase< Derived > &vec) const
double angle(const GeoTrf::Vector2D &a, const GeoTrf::Vector2D &b)
std::shared_ptr< std::map< std::string, GeoFullPhysVol * > > m_mapFPV
std::shared_ptr< std::map< std::string, GeoAlignableTransform * > > m_mapAX
GeoModelIO::ReadGeoModel * m_sqliteReader
PixelGeometryManager * m_gmt_mgr
InDetDD::PixelDetectorManager * m_DDmgr
InDetMaterialManager * m_mat_mgr