![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
#include <MuonStationTypeBuilder.h>
|
| MuonStationTypeBuilder (const std::string &, const std::string &, const IInterface *) |
| Constructor. More...
|
|
virtual | ~MuonStationTypeBuilder ()=default |
| Destructor. More...
|
|
StatusCode | initialize () |
| AlgTool initailize method. More...
|
|
StatusCode | finalize () |
| AlgTool finalize method. More...
|
|
std::unique_ptr< Trk::TrackingVolumeArray > | processBoxStationComponents (const GeoVPhysVol *cv, const Trk::CuboidVolumeBounds &envBounds, Cache &) const |
| steering routine More...
|
|
std::vector< std::unique_ptr< Trk::Layer > > | processBoxComponentsArbitrary (const GeoVPhysVol *mv, const Trk::CuboidVolumeBounds &envBounds, Cache &cache) const |
|
std::unique_ptr< Trk::TrackingVolumeArray > | processTrdStationComponents (const GeoVPhysVol *cv, const Trk::TrapezoidVolumeBounds &envBounds, Cache &) const |
|
std::unique_ptr< Trk::TrackingVolume > | processCscStation (const GeoVPhysVol *cv, const std::string &name, Cache &) const |
|
std::unique_ptr< Trk::TrackingVolume > | processTgcStation (const GeoVPhysVol *cv, Cache &) const |
|
std::unique_ptr< Trk::DetachedTrackingVolume > | process_sTGC (const Identifier &id, const GeoVPhysVol *gv, const Amg::Transform3D &transf) const |
|
std::unique_ptr< Trk::DetachedTrackingVolume > | process_MM (const Identifier &id, const GeoVPhysVol *gv, const Amg::Transform3D &transf) const |
|
std::unique_ptr< Trk::TrackingVolume > | processMdtBox (const Trk::Volume &trkVol, const GeoVPhysVol *, const Amg::Transform3D &, double, Cache &) const |
| components More...
|
|
std::unique_ptr< Trk::TrackingVolume > | processMdtTrd (const Trk::Volume &trkVol, const GeoVPhysVol *, const Amg::Transform3D &, Cache &) const |
|
std::unique_ptr< Trk::TrackingVolume > | processRpc (const Trk::Volume &inVol, const std::vector< const GeoVPhysVol * > &childVols, const std::vector< Amg::Transform3D > &childVolsTrf, Cache &) const |
|
std::unique_ptr< Trk::TrackingVolume > | processSpacer (const Trk::Volume &, std::vector< const GeoVPhysVol * >, std::vector< Amg::Transform3D >) const |
|
std::unique_ptr< Trk::LayerArray > | processCSCTrdComponent (const GeoVPhysVol *, const Trk::TrapezoidVolumeBounds &, const Amg::Transform3D &, Cache &) const |
|
std::unique_ptr< Trk::LayerArray > | processCSCDiamondComponent (const GeoVPhysVol *, const Trk::DoubleTrapezoidVolumeBounds &, const Amg::Transform3D &, Cache &) const |
|
std::unique_ptr< Trk::LayerArray > | processTGCComponent (const GeoVPhysVol *, const Trk::TrapezoidVolumeBounds &, const Amg::Transform3D &, Cache &) const |
|
std::pair< std::unique_ptr< Trk::Layer >, std::vector< std::unique_ptr< Trk::Layer > > > | createLayerRepresentation (Trk::TrackingVolume &trVol) const |
|
Identifier | identifyNSW (const std::string &, const Amg::Transform3D &) const |
|
double | get_x_size (const GeoVPhysVol *) const |
|
double | decodeX (const GeoShape *) const |
|
double | envelopeThickness (const Trk::VolumeBounds &vb) const |
|
Trk::MaterialProperties | getAveragedLayerMaterial (const GeoVPhysVol *, double, double) const |
|
Trk::MaterialProperties | collectStationMaterial (const Trk::TrackingVolume &trVol, double) const |
|
ServiceHandle< StoreGateSvc > & | evtStore () |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | evtStore () const |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | detStore () const |
| The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
virtual StatusCode | sysInitialize () override |
| Perform system initialization for an algorithm. More...
|
|
virtual StatusCode | sysStart () override |
| Handle START transition. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
| Return this algorithm's input handles. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
| Return this algorithm's output handles. More...
|
|
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T > &t) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc="none") |
| Declare a new Gaudi property. More...
|
|
void | updateVHKA (Gaudi::Details::PropertyBase &) |
|
MsgStream & | msg () const |
|
MsgStream & | msg (const MSG::Level lvl) const |
|
bool | msgLvl (const MSG::Level lvl) const |
|
The Muon::MuonStationTypeBuilder retrieves components of muon stations from Muon Geometry Tree, builds 'prototype' object (TrackingVolume with NameType)
by Sarka.nosp@m..Tod.nosp@m.orova.nosp@m.@cer.nosp@m.n.ch
Definition at line 52 of file MuonStationTypeBuilder.h.
◆ StoreGateSvc_t
◆ MuonStationTypeBuilder()
Muon::MuonStationTypeBuilder::MuonStationTypeBuilder |
( |
const std::string & |
t, |
|
|
const std::string & |
n, |
|
|
const IInterface * |
p |
|
) |
| |
◆ ~MuonStationTypeBuilder()
virtual Muon::MuonStationTypeBuilder::~MuonStationTypeBuilder |
( |
| ) |
|
|
virtualdefault |
◆ area()
◆ collectStationMaterial()
Definition at line 2365 of file MuonStationTypeBuilder.cxx.
2370 if (vol.confinedLayers()) {
2372 for (
const auto* lay : lays) {
2373 const Trk::MaterialProperties* mLay =lay->layerMaterialProperties()->fullMaterial(lay->surfaceRepresentation().center());
2375 if (mLay && lay->thickness() > 0 && mLay->
material().
x0() > 0.) {
2378 ATH_MSG_VERBOSE(
" collectStationMaterial after add confined lay "<< layMat);
2382 if (!vol.confinedArbitraryLayers().empty()) {
2384 for (
const auto* lay : lays) {
2385 const Trk::MaterialProperties* mLay = lay->layerMaterialProperties()->fullMaterial(lay->surfaceRepresentation().center());
2389 if ((rect || trap) && mLay) {
2393 if (lay->thickness() > 0 && mLay->
material().
x0() > 0.) {
2394 layMat.addMaterial(mLay->
material(),
2396 ATH_MSG_VERBOSE(
" collectStationMaterial after add confined sub lay "<< layMat);
2402 if (vol.confinedVolumes()) {
2404 for (
const auto* subVol : subVols) {
2405 if (subVol->confinedLayers()) {
2407 for (
const auto* lay : lays) {
2409 lay->surfaceRepresentation().center());
2411 if (mLay && lay->thickness() > 0 && mLay->
material().
x0() > 0.) {
2413 ATH_MSG_VERBOSE(
" collectStationMaterial after add confined vol " << layMat);
2417 if (!subVol->confinedArbitraryLayers().empty()) {
2419 for (
const auto* lay : lays) {
2420 const Trk::MaterialProperties* mLay = lay->layerMaterialProperties()->fullMaterial(lay->surfaceRepresentation().center());
2426 if ((rect || trap) && mLay) {
2430 if (lay->thickness() > 0 && mLay->
material().
x0() > 0.) {
2432 ATH_MSG_VERBOSE(
" collectStationMaterial after add sub vols " << layMat);
◆ createLayerRepresentation()
Definition at line 2193 of file MuonStationTypeBuilder.cxx.
2195 std::unique_ptr<Trk::Layer> layRepr{};
2198 std::vector<std::unique_ptr<Trk::Layer>>
multi{};
2222 auto bounds = std::make_unique<Trk::RectangleBounds>(cubBounds->
halflengthY(), cubBounds->
halflengthZ());
2223 std::unique_ptr<Trk::OverlapDescriptor> od;
2236 bounds->clone(),
mat, thickness, std::move(od), 1);
2240 if (vols.size() > 1) {
2241 for (
auto* vol : vols) {
2246 matMulti.
thickness(), std::move(od), 1));
2250 }
else if (trdBounds) {
2253 std::vector<std::unique_ptr<const Trk::Surface>> surfs =
toVec(trdBounds->
decomposeToSurfaces(Amg::Transform3D::Identity()));
2256 std::unique_ptr<Trk::OverlapDescriptor> od =
nullptr;
2267 layRepr = std::make_unique<Trk::PlaneLayer>(subt * trVol.
transform(), bounds,
mat, thickness, std::move(od), 1);
2272 if (vols.size() > 1) {
2273 for (
auto* vol : vols) {
2278 matMulti.
thickness(), std::move(od), 1));
2282 }
else if (dtrdBounds) {
2286 std::vector<std::unique_ptr<const Trk::Surface>> surfs =
toVec(dtrdBounds->
decomposeToSurfaces(Amg::Transform3D::Identity()));
2289 std::unique_ptr<Trk::OverlapDescriptor> od =
nullptr;
2301 layRepr = std::make_unique<Trk::PlaneLayer>(trVol.
transform(), bounds,
mat, thickness, std::move(od), 1);
2305 if (vols.size() > 1) {
2306 for (
auto* vol : vols) {
2308 ATH_MSG_VERBOSE(
" collectStationMaterial dtrd matMulti " << matMulti);
2309 multi.emplace_back(std::make_unique<Trk::PlaneLayer>(vol->transform(), bounds,
2311 matMulti.
thickness(), std::move(od), 1));
2316 return std::make_pair(std::move(layRepr), std::move(
multi));
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleBase
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 245 of file AthCommonDataStore.h.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey
. It just forwards to the base class version of declareProperty
.
Definition at line 333 of file AthCommonDataStore.h.
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This dispatches to either the generic declareProperty
or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
◆ declareProperty() [6/6]
◆ decodeX()
double Muon::MuonStationTypeBuilder::decodeX |
( |
const GeoShape * |
sh | ) |
const |
Definition at line 2136 of file MuonStationTypeBuilder.cxx.
2139 const GeoTrd* trd =
dynamic_cast<const GeoTrd*
>(
sh);
2140 const GeoBox* box =
dynamic_cast<const GeoBox*
>(
sh);
2141 const GeoTube* tub =
dynamic_cast<const GeoTube*
>(
sh);
2142 const GeoTubs* tubs =
dynamic_cast<const GeoTubs*
>(
sh);
2143 const GeoShapeShift* shift =
dynamic_cast<const GeoShapeShift*
>(
sh);
2144 const GeoShapeUnion* uni =
dynamic_cast<const GeoShapeUnion*
>(
sh);
2145 const GeoShapeSubtraction* sub =
dynamic_cast<const GeoShapeSubtraction*
>(
sh);
2146 const GeoSimplePolygonBrep* spb =
dynamic_cast<const GeoSimplePolygonBrep*
>(
sh);
2148 if (!trd && !box && !tub && !tubs && !shift && !uni && !sub && !spb) {
2150 <<
sh->type() <<
"): shape type " <<
sh->type()
2151 <<
" is unknown, returning xHalf=0");
2156 for (
unsigned int i = 0;
i < spb->getNVertices();
i++) {
2158 << spb->getYVertex(
i));
2159 if (spb->getXVertex(
i) > xHalf)
2160 xHalf = spb->getXVertex(
i);
2166 xHalf =
std::max(trd->getXHalfLength1(), trd->getXHalfLength2());
2169 xHalf = box->getXHalfLength();
2172 xHalf = tub->getRMax();
2177 double xA =
decodeX(sub->getOpA());
2184 double xA =
decodeX(shift->getOp());
2185 double xB = shift->getX().translation().x();
2186 xHalf = xA + std::abs(xB);
◆ detStore()
◆ envelopeThickness()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ extraDeps_update_handler()
Add StoreName to extra input/output deps as needed.
use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given
◆ finalize()
StatusCode Muon::MuonStationTypeBuilder::finalize |
( |
| ) |
|
◆ get_x_size()
double Muon::MuonStationTypeBuilder::get_x_size |
( |
const GeoVPhysVol * |
pv | ) |
const |
Definition at line 1741 of file MuonStationTypeBuilder.cxx.
1742 double xlow{0.}, xup{0.};
1746 return decodeX(
pv->getLogVol()->getShape());
1749 for (
const auto& [cv, transf] : vols) {
1750 const GeoLogVol* clv = cv->getLogVol();
1751 double xh =
decodeX(clv->getShape());
1752 xlow =
std::min(xlow, (transf.translation())[0] - xh);
1753 xup =
std::max(xup, (transf.translation())[0] + xh);
◆ getAveragedLayerMaterial()
Trk::MaterialProperties Muon::MuonStationTypeBuilder::getAveragedLayerMaterial |
( |
const GeoVPhysVol * |
pv, |
|
|
double |
volume, |
|
|
double |
thickness |
|
) |
| const |
◆ getLayerBoundsFromEnvelope()
◆ identifyNSW()
Definition at line 2319 of file MuonStationTypeBuilder.cxx.
2323 if ((
vName[0] ==
'Q') || (
vName[0] ==
'M')) {
2325 std::istringstream istr(&
vName[1]);
2327 if (
vName[0] ==
'Q') {
2328 std::istringstream istr2(&
vName[2]);
2332 if (transf.translation().z() < 0.)
2335 unsigned int iPhi = 1;
2338 std::istringstream istm(&
vName[3]);
2342 iMult = (
vName[1] ==
'L') ? 1 : 2;
2344 iMult = (
vName[1] ==
'L') ? 2 : 1;
2347 std::istringstream istl(stl);
2351 if (
vName[0] ==
'Q') {
2352 std::string stName = (
vName[1] ==
'L') ?
"STL" :
"STS";
2354 stName,
iEta,
iPhi, iMult, iLay, 2, 1);
2356 std::string stName = (
vName[2] ==
'L') ?
"MML" :
"MMS";
◆ initialize()
StatusCode Muon::MuonStationTypeBuilder::initialize |
( |
| ) |
|
AlgTool initailize method.
Definition at line 88 of file MuonStationTypeBuilder.cxx.
95 m_muonMaterial = std::make_unique<Trk::Material>(10e10, 10e10, 0., 0., 0.);
99 return StatusCode::FAILURE;
104 return StatusCode::SUCCESS;
◆ inputHandles()
Return this algorithm's input handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ interfaceID()
const InterfaceID & Muon::MuonStationTypeBuilder::interfaceID |
( |
| ) |
|
|
static |
Interface methode.
Definition at line 71 of file MuonStationTypeBuilder.cxx.
72 static const InterfaceID IID_IMuonStationTypeBuilder(
"MuonStationTypeBuilder", 1, 0);
73 return IID_IMuonStationTypeBuilder;
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ outputHandles()
Return this algorithm's output handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ printVolumeBounds()
void Muon::MuonStationTypeBuilder::printVolumeBounds |
( |
std::string |
comment, |
|
|
const Trk::VolumeBounds & |
vb |
|
) |
| const |
|
private |
◆ process_MM()
Definition at line 1677 of file MuonStationTypeBuilder.cxx.
1681 std::string
vName = gv->getLogVol()->getName();
1683 ATH_MSG_DEBUG(
"processing MM:" <<
vName <<
":"<< gv->getLogVol()->getShape()->type());
1695 double layArea =
area(*layBounds);
1700 double scale = 1. / gv->getNChildVols();
1702 mm_layerMat *=
scale;
1706 std::vector<std::unique_ptr<Trk::PlaneLayer>>
layers;
1707 unsigned int ic = 0;
1710 auto layer = std::make_unique<Trk::PlaneLayer>(transf * trc, layBounds, mmLayMaterial, mm_layerMat.thickness());
1711 Identifier id = idHelper.channelID(nswId, idHelper.multilayer(nswId), 1 +
ic, 1);
1712 layer->setLayerType(
id.get_identifier32().get_compact());
1719 std::vector<Trk::SharedObject<Trk::Layer>> layerOrder;
1720 std::vector<float> binSteps;
1721 binSteps.push_back(-thickness);
1723 binSteps.push_back(binSteps.back() + mm_layerMat.thickness());
1724 layerOrder.push_back(std::move(
layers[
il]));
1726 if (binSteps.back() > thickness + 1.e-3) {
1727 ATH_MSG_WARNING(
"rescale mm binning:" << binSteps.back() <<
">" << thickness);
1729 binSteps.back() = thickness;
1731 auto mmLayerArray = std::make_unique<Trk::NavBinnedArray1D<Trk::Layer>>(layerOrder, binUtility.release(),
1734 auto mM = std::make_unique<Trk::TrackingVolume>(*envelope, *
m_muonMaterial, mmLayerArray.release(),
nullptr,
vName);
1736 auto layerRepr = std::make_unique<Trk::PlaneLayer>(transf, layBounds, mmMaterial, mm_mat.
thickness());
1738 return std::make_unique<Trk::DetachedTrackingVolume>(
vName, mM.release(), layerRepr.release(),
nullptr);
◆ process_sTGC()
Definition at line 1608 of file MuonStationTypeBuilder.cxx.
1612 std::string
vName = gv->getLogVol()->getName();
1625 double layArea =
area(*layBounds);
1630 const double scale = 1. / gv->getNChildVols();
1632 sTgc_layerMat *=
scale;
1637 std::vector<std::unique_ptr<Trk::PlaneLayer>>
layers{};
1638 unsigned int ic = 0;
1642 auto layer = std::make_unique<Trk::PlaneLayer>(envelope->
transform() * trc, layBounds,
1643 stgcLayMaterial, sTgc_layerMat.thickness());
1645 const Identifier id = idHelper.channelID(nswId,idHelper.multilayer(nswId),
1648 layer->setLayerType(
id.get_identifier32().get_compact());
1654 std::vector<Trk::SharedObject<Trk::Layer>> layerOrder;
1655 std::vector<float> binSteps;
1656 binSteps.push_back(-thickness);
1658 binSteps.push_back(binSteps.back() + sTgc_layerMat.thickness());
1659 layerOrder.push_back(std::move(
layers[
il]));
1661 if (binSteps.back() > thickness + 1.e-3) {
1662 ATH_MSG_WARNING(
"rescale stgc binning:" << binSteps.back() <<
">" << thickness);
1664 binSteps.back() = thickness;
1666 auto stgcLayerArray = std::make_unique<Trk::NavBinnedArray1D<Trk::Layer>>(layerOrder, binUtility.release(),
1670 stgcLayerArray.release(),
nullptr,
vName);
1672 auto layerRepr = std::make_unique<Trk::PlaneLayer>(transf, layBounds, stgcMaterial, sTgc_mat.
thickness());
1674 return std::make_unique<Trk::DetachedTrackingVolume>(
vName,
sTgc.release(), layerRepr.release(),
nullptr);
◆ processBoxComponentsArbitrary()
Definition at line 107 of file MuonStationTypeBuilder.cxx.
110 ATH_MSG_DEBUG(
" processing station components for "<< mv->getLogVol()->getName());
113 std::vector<std::unique_ptr<Trk::Layer>> lays{};
117 auto layBounds = std::make_shared<Trk::RectangleBounds>(envelope.halflengthY(), envelope.halflengthZ());
119 double layArea=
area(*layBounds);
125 auto layer = std::make_unique<Trk::PlaneLayer>(Amg::Transform3D::Identity(), layBounds,
126 boxMaterial, 2 * envelope.halflengthX());
128 lays.push_back(std::move(
layer));
◆ processBoxStationComponents()
steering routine
BIS78 volumes
Definition at line 134 of file MuonStationTypeBuilder.cxx.
138 << mv->getLogVol()->getName());
145 std::vector<std::pair<double, double>> xVol;
146 double xpos{0}, xh{0};
148 const GeoLogVol* clv = cv->getLogVol();
150 std::string
name = clv->getName();
151 if (
name.find(
"MDT") == std::string::npos &&
name.find(
"RPC") == std::string::npos){
154 xpos = transf.translation().x();
155 if (clv->getShape()->type() ==
"Trd") {
156 const GeoTrd* trd =
dynamic_cast<const GeoTrd*
>(clv->getShape());
157 xh =
std::max(trd->getXHalfLength1(), trd->getXHalfLength2());
158 }
else if (clv->getShape()->type() ==
"Box") {
159 const GeoBox* box =
dynamic_cast<const GeoBox*
>(clv->getShape());
160 xh = box->getXHalfLength();
164 if (!xVol.size() || xpos > xVol.back().first)
165 xVol.push_back(std::make_pair(xpos, xh));
167 std::vector<std::pair<double, double>>
::iterator it = xVol.begin();
168 while (
it != xVol.end() && xpos > (*it).first) {
171 xVol.insert(
it, std::make_pair(xpos, xh));
175 double xl = xVol[0].second;
176 double xc = xVol[0].first;
177 for (
const auto&
xb : xVol) {
178 if (
xb.first > xc &&
xb.first -
xb.second < xc + xl) {
190 std::vector<std::unique_ptr<Trk::Volume>> compVol;
192 std::vector<const GeoVPhysVol*> compGeo;
193 std::vector<Amg::Transform3D> compTransf;
195 const GeoLogVol* clv = cv->getLogVol();
196 std::unique_ptr<Trk::VolumeBounds> volBounds{};
197 std::unique_ptr<Trk::Volume> vol{};
198 if (clv->getShape()->type() ==
"Trd") {
199 const GeoTrd* trd =
dynamic_cast<const GeoTrd*
>(clv->getShape());
200 const double halfX1{trd->getXHalfLength1()}, halfX2{trd->getXHalfLength2()},
201 halfY1{trd->getYHalfLength1()}, halfY2{trd->getYHalfLength2()},
202 halfZ{trd->getZHalfLength()};
203 volBounds = std::make_unique<Trk::CuboidVolumeBounds>(
std::max(halfX1, halfX2),
std::max(halfY1, halfY2), halfZ);
204 }
else if (clv->getShape()->type() ==
"Box") {
205 const GeoBox* box =
dynamic_cast<const GeoBox*
>(clv->getShape());
209 ATH_MSG_VERBOSE(
"subvolume not box nor trapezoid, estimated x size:" << xSize);
210 volBounds = std::make_unique<Trk::CuboidVolumeBounds>(xSize, envelope.halflengthY(), envelope.halflengthZ());
212 vol = std::make_unique<Trk::Volume>(
makeTransform(transf), volBounds.release());
214 std::string cname = clv->getName();
215 const std::string& vname = mv->getLogVol()->getName();
216 int nameSize = vname.size() - 8;
217 if (cname.compare(0, nameSize, vname, 0, nameSize) == 0)
218 cname = cname.substr(nameSize, cname.size() - nameSize);
220 if (compVol.empty() || vol->center().x() >= compVol.back()->center().x()) {
221 compVol.push_back(std::move(vol));
223 compGeo.push_back(cv);
224 compTransf.push_back(transf);
226 std::vector<std::unique_ptr<Trk::Volume>>
::iterator volIter = compVol.begin();
231 while (vol->center().x() >= (*volIter)->center().x()) {
237 compVol.insert(volIter, std::move(vol));
239 compGeo.insert(geoIter, cv);
240 compTransf.insert(transfIter, transf);
245 std::vector<std::unique_ptr<Trk::TrackingVolume>> trkVols{};
246 double envX = envelope.halflengthX();
247 double envY = envelope.halflengthY();
248 double envZ = envelope.halflengthZ();
249 double currX = -envX;
251 bool openSpacer{
false}, openRpc{
false};
252 std::vector<const GeoVPhysVol*> geoSpacer{}, geoRpc{};
253 std::vector<Amg::Transform3D> transfSpacer{}, transfRpc{};
254 double spacerlowXsize{0.}, spaceruppXsize{0.}, rpclowXsize{0.}, rpcuppXsize{0.};
255 std::vector<float> volSteps;
256 volSteps.push_back(-envX);
257 for (
unsigned i = 0;
i < compVol.size(); ++
i) {
258 bool comp_processed =
false;
263 ATH_MSG_WARNING(__FILE__<<
":"<<__LINE__<<
" box station component does not return cuboid shape "
264 <<
typeid(volBounds).
name());
268 double lowX = compVol[
i]->center().x() - compBounds->
halflengthX();
269 double uppX = compVol[
i]->center().x() + compBounds->
halflengthX();
274 <<
": low edge of next volume:" << lowX);
282 double Xcurr = compVol[
i]->center().x() - compBounds->
halflengthX();
283 if (Xcurr >= currX + rpclowXsize + rpcuppXsize) {
284 auto rpcBounds = std::make_unique<Trk::CuboidVolumeBounds>(0.5 * (Xcurr - currX), envY, envZ);
286 auto rpcVol = std::make_unique<Trk::Volume>(
makeTransform(std::move(rpcTrf)),
287 rpcBounds.release());
288 std::unique_ptr<Trk::TrackingVolume> rpcTrkVol =
processRpc(*rpcVol, geoRpc, transfRpc, cache);
289 trkVols.push_back(std::move(rpcTrkVol));
290 volSteps.push_back(Xcurr);
300 double Xcurr = compVol[
i]->center().x() - compBounds->
halflengthX();
301 if (Xcurr - currX - (spacerlowXsize + spaceruppXsize) >= -
tolerance) {
302 auto spacerBounds = std::make_unique<Trk::CuboidVolumeBounds>(0.5 * (Xcurr - currX), envY, envZ);
305 std::unique_ptr<Trk::TrackingVolume> spacerTrkVol{
processSpacer(spacerVol, geoSpacer, transfSpacer)};
306 trkVols.emplace_back(std::move(spacerTrkVol));
307 volSteps.push_back(Xcurr);
318 geoRpc.push_back(compGeo[
i]);
320 transfRpc.push_back(compTransf[
i]);
322 rpclowXsize = compVol[
i]->center().x() - currX;
329 geoRpc.push_back(compGeo[
i]);
330 transfRpc.push_back(compTransf[
i]);
335 if (compVol[
i]->center().
x() + compBounds->
halflengthX() > currX + rpclowXsize + rpcuppXsize) {
336 rpcuppXsize += (compVol[
i]->center().x() + compBounds->
halflengthX()) -
337 (currX + rpclowXsize + rpcuppXsize);
340 comp_processed =
true;
346 geoSpacer.push_back(compGeo[
i]);
347 transfSpacer.clear();
348 transfSpacer.push_back(compTransf[
i]);
350 spacerlowXsize = compVol[
i]->center().x() - currX;
353 if (std::abs(spacerlowXsize) <
355 ATH_MSG_WARNING(
"spacer low edge - not enough space:current:center:halfSize:"
356 << currX <<
"," << compVol[
i]->center().
x() <<
"," << compBounds->
halflengthX());
359 geoSpacer.push_back(compGeo[
i]);
360 transfSpacer.push_back(compTransf[
i]);
363 ATH_MSG_WARNING(
"spacer low edge - not enough space:current:center:halfSize:"
364 << currX <<
"," << compVol[
i]->center().
x() <<
"," << compBounds->
halflengthX());
366 if (compVol[
i]->center().
x() + compBounds->
halflengthX() > currX + spacerlowXsize + spaceruppXsize) {
367 spaceruppXsize += (compVol[
i]->center().x() + compBounds->
halflengthX()) -
368 (currX + spacerlowXsize + spaceruppXsize);
371 comp_processed =
true;
374 std::unique_ptr<Trk::Volume> mdtVol;
376 double zShift = compVol[
i]->transform().translation().z();
377 if (std::abs(zShift) > 0) {
380 double boundHalfLengthX{0.};
382 auto mdtBounds = std::make_unique<Trk::CuboidVolumeBounds>(compBounds->
halflengthX(), envY, envZ);
383 boundHalfLengthX = mdtBounds->halflengthX();
385 mdtBounds.release());
387 if (std::abs(lowX - currX) > 0.002) {
388 ATH_MSG_DEBUG(
"Mdt volume size does not match the envelope:lowX,currX:"<< lowX <<
"," << currX);
391 auto mdtBounds = std::make_unique<Trk::CuboidVolumeBounds>(compBounds->
halflengthX() + 0.5 * (lowX - currX),
393 boundHalfLengthX = mdtBounds->halflengthX();
396 mdtBounds.release());
398 double shiftSign = 1.;
399 if (std::abs(zShift) > 0.) {
400 const std::string& stName = mv->getLogVol()->getName();
401 if (stName.compare(0, 4,
"BIR3") == 0 || stName.compare(0, 4,
"BIR5") == 0 ||
402 stName.compare(0, 4,
"BIR7") == 0 || stName.compare(0, 5,
"BIR10") == 0) {
407 std::unique_ptr<Trk::TrackingVolume> mdtTrkVol{
processMdtBox(*mdtVol, compGeo[
i],
409 shiftSign * std::abs(zShift), cache)};
410 trkVols.push_back(std::move(mdtTrkVol));
411 currX += 2. * boundHalfLengthX;
412 volSteps.push_back(currX);
413 comp_processed =
true;
416 if (!comp_processed) {
423 if (maxX >= currX + spacerlowXsize + spaceruppXsize) {
424 auto spacerBounds = std::make_unique<Trk::CuboidVolumeBounds>(0.5 * (maxX - currX), envY, envZ);
427 spacerBounds.release());
428 std::unique_ptr<Trk::TrackingVolume> spacerTrkVol{
processSpacer(spacerVol, geoSpacer, transfSpacer)};
429 trkVols.emplace_back(std::move(spacerTrkVol));
431 volSteps.push_back(currX);
437 if (maxX >= currX + rpclowXsize + rpcuppXsize) {
438 auto rpcBounds = std::make_unique<Trk::CuboidVolumeBounds>(0.5 * (maxX - currX), envY, envZ);
440 auto rpcVol = std::make_unique<Trk::Volume>(
makeTransform(std::move(rpcTrf)),
441 rpcBounds.release());
442 std::unique_ptr<Trk::TrackingVolume> rpcTrkVol{
processRpc(*rpcVol, geoRpc, transfRpc, cache)};
443 trkVols.push_back(std::move(rpcTrkVol));
445 volSteps.push_back(currX);
452 std::unique_ptr<Trk::TrackingVolumeArray> components{};
◆ processCSCDiamondComponent()
Definition at line 1908 of file MuonStationTypeBuilder.cxx.
1913 std::string
name =
pv->getLogVol()->getName();
1914 std::vector<std::unique_ptr<Trk::PlaneLayer>>
layers{};
1915 std::vector<double> x_array{}, x_thickness{};
1916 std::vector<Trk::MaterialProperties> x_mat;
1917 std::vector<int> x_active;
1918 double currX = -100000;
1928 if (
name.compare(
name.size() - 5, 5,
"CSC02") == 0) {
1929 if (!cache.m_matCSC02) {
1930 double vol = ((minX + medX) * 2 * halfY1 + (medX + maxX) * 2 * halfY2) * thickness;
1936 const GeoVPhysVol* cv1 =
pv->getChildVol(0);
1938 const GeoLogVol* clv = cv->getLogVol();
1939 if (clv->getName() ==
"CscArCO2") {
1940 double xl = transfc.translation().x();
1941 if (x_array.empty() || xl >= x_array.back()) {
1942 x_array.push_back(xl);
1944 unsigned int ix = 0;
1945 while (ix < x_array.size() && x_array[ix] < xl) {
1948 x_array.insert(x_array.begin() + ix, xl);
1953 if (x_array.empty()) {
1954 x_array.push_back(0.);
1955 x_mat.push_back(matCSC);
1956 x_thickness.push_back(thickness);
1957 x_active.push_back(1);
1958 }
else if (x_array.size() == 1) {
1959 x_mat.push_back(matCSC);
1960 x_thickness.push_back(2 *
std::min(x_array[0] + halfZ, halfZ - x_array[0]));
1961 x_active.push_back(1);
1963 double currX = -halfZ;
1964 for (
unsigned int il=0;
il < x_array.size();
il++) {
1966 if (
il < x_array.size() - 1) {
1967 xthick = 2 *
std::min(x_array[
il] - currX, 0.5 * (x_array[
il + 1] - x_array[
il]));
1968 x_thickness.push_back(xthick);
1970 xthick = 2 *
std::min(x_array[
il] - currX, halfZ - x_array[
il]);
1971 x_thickness.push_back(xthick);
1973 x_mat.push_back(matCSC);
1974 currX = x_array[
il] + 0.5 * x_thickness.back();
1975 x_active.push_back(1);
1979 if (
name ==
"CSCspacer") {
1980 if (!cache.m_matCSCspacer2) {
1981 double vol = ((minX + medX) * 2 * halfY1 + (medX + maxX) * 2 * halfY2) *thickness;
1985 x_array.push_back(0.);
1986 x_mat.push_back(matCSC);
1987 x_thickness.push_back(thickness);
1988 x_active.push_back(0);
1991 std::unique_ptr<Trk::OverlapDescriptor> od{};
1993 for (
unsigned int iloop = 0; iloop < x_array.size(); iloop++) {
1996 auto layer = std::make_unique<Trk::PlaneLayer>(cTr, dbounds, cscMaterial,
1997 x_thickness[iloop], std::move(od));
1999 layer->setLayerType(x_active[iloop]);
2004 std::vector<Trk::SharedObject<Trk::Layer>> layerOrder;
2005 std::vector<float> binSteps;
2006 double xShift = transf.translation().x();
2008 binSteps.push_back(lowX);
2012 for (
unsigned int i = 0;
i <
layers.size() - 1;
i++) {
2013 currX = x_array[
i] + 0.5 *
layers[
i]->thickness() + xShift;
2014 binSteps.push_back(currX);
2015 layerOrder.push_back(std::move(
layers[
i]));
2018 layerOrder.push_back(std::move(
layers.back()));
2019 binSteps.push_back(compBounds.
halflengthZ() + xShift);
2023 return std::make_unique<Trk::NavBinnedArray1D<Trk::Layer>>(layerOrder, binUtility.release(),
◆ processCscStation()
Definition at line 1388 of file MuonStationTypeBuilder.cxx.
1395 bool isDiamond =
false;
1396 double xMin{0.}, xMed{0.}, xMax{0},
y1{0.},
y2{0},
z{0.};
1398 const GeoVPhysVol* cv = &(*(mv->getChildVol(0)));
1399 const GeoLogVol* clv = cv->getLogVol();
1402 if (clv->getShape()->type() ==
"Shift") {
1403 const GeoShapeShift* shift =
1404 dynamic_cast<const GeoShapeShift*
>(clv->getShape());
1405 if (shift->getOp()->type() ==
"Union") {
1409 const GeoShapeUnion* uni =
dynamic_cast<const GeoShapeUnion*
>(shift->getOp());
1410 if (uni->getOpA()->type() ==
"Trd") {
1411 const GeoTrd* trdA =
dynamic_cast<const GeoTrd*
>(uni->getOpA());
1412 xMin = trdA->getYHalfLength1();
1413 xMed = trdA->getYHalfLength2();
1414 y1 = trdA->getZHalfLength();
1415 z = trdA->getXHalfLength1();
1417 if (uni->getOpB()->type() ==
"Shift") {
1418 const GeoShapeShift*
sh =
dynamic_cast<const GeoShapeShift*
>(uni->getOpB());
1419 const GeoTrd* trdB =
dynamic_cast<const GeoTrd*
>(
sh->getOp());
1420 if (trdB->getYHalfLength1() != xMed || trdB->getXHalfLength1() !=
z) {
1422 ": something is wrong: dimensions of 2 trapezoids do not match");
1424 xMax = trdB->getYHalfLength2();
1425 y2 = trdB->getZHalfLength();
1428 if (shift->getOp()->type() ==
"Trd") {
1430 const GeoTrd* trd =
dynamic_cast<const GeoTrd*
>(shift->getOp());
1431 xMin = trd->getYHalfLength1();
1432 xMed = trd->getYHalfLength2();
1433 y1 = trd->getZHalfLength();
1434 z = trd->getXHalfLength1();
1437 if (clv->getShape()->type() ==
"Trd") {
1439 const GeoTrd* trd =
dynamic_cast<const GeoTrd*
>(clv->getShape());
1440 xMin = trd->getYHalfLength1();
1441 xMed = trd->getYHalfLength2();
1442 y1 = trd->getZHalfLength();
1443 z = trd->getXHalfLength1();
1447 std::vector<Amg::Transform3D> compTransf;
1449 std::vector<const GeoVPhysVol*> compGeoVol;
1450 std::vector<double> xSizes;
1451 double xmn = +10000.;
1452 double xmx = -10000.;
1454 const GeoLogVol* clv = cv->getLogVol();
1455 unsigned int ich = compTransf.size();
1457 compName.push_back(clv->getName());
1458 compGeoVol.push_back(cv);
1459 if (clv->getShape()->type() ==
"Shift") {
1460 const GeoShapeShift* shift =
dynamic_cast<const GeoShapeShift*
>(clv->getShape());
1461 if (shift->getOp()->type() ==
"Union") {
1464 const GeoShapeUnion* uni =
dynamic_cast<const GeoShapeUnion*
>(shift->getOp());
1465 if (uni->getOpA()->type() ==
"Trd") {
1466 const GeoTrd* trdA =
dynamic_cast<const GeoTrd*
>(uni->getOpA());
1467 double xSize = trdA->getXHalfLength1();
1468 if (!xSizes.empty()){
1469 xSizes.push_back((std::abs(
transform.translation().x() - compTransf[ich - 1].translation().x()) - xSizes.back()));
1471 xSizes.push_back(xSize);
1473 double xpos = (
transform * shift->getX()).translation().x();
1474 xmn =
std::min(xmn, xpos - xSizes.back());
1475 xmx =
std::max(xmx, xpos + xSizes.back());
1479 if (clv->getShape()->type() ==
"Trd") {
1480 const GeoTrd* trd =
dynamic_cast<const GeoTrd*
>(clv->getShape());
1481 double xSize = trd->getXHalfLength1();
1482 if (!xSizes.empty()) {
1483 xSizes.push_back( std::abs(
transform.translation().x() - compTransf[ich - 1].translation().x()) - xSizes.back());
1485 xSizes.push_back(xSize);
1487 double xpos =
transform.translation().x();
1488 xmn =
std::min(xmn, xpos - xSizes.back());
1489 xmx =
std::max(xmx, xpos + xSizes.back());
1494 for (
double xSize : xSizes)
1496 double xShift{0.5 * (xmx + xmn)}, zShift{0.};
1497 zShift = std::abs(compTransf.front().translation().z()) + std::abs(compTransf.back().translation().z());
1500 std::unique_ptr<Trk::Volume> envelope;
1501 double envXMed = xMed;
1504 std::vector<float> volSteps;
1505 volSteps.push_back(-xTotal + xShift);
1506 std::vector<std::unique_ptr<Trk::TrackingVolume>> components{};
1510 auto cscBounds = std::make_unique<Trk::TrapezoidVolumeBounds>(xMin, xMax,
y1, xTotal);
1514 envelope = std::make_unique<Trk::Volume>(
makeTransform(std::move(cTr)), cscBounds.release());
1516 double xCurr = -xTotal;
1517 for (
unsigned int ic = 0;
ic < xSizes.size();
ic++) {
1519 xCurr += xSizes[
ic];
1521 auto compBounds = std::make_unique<Trk::TrapezoidVolumeBounds>(xMin, xMax,
y1, xSizes[
ic]);
1522 std::unique_ptr<Trk::LayerArray> cscLayerArray =
processCSCTrdComponent(compGeoVol[
ic], *compBounds, compTr, cache);
1523 std::unique_ptr<Trk::Volume> compVol = std::make_unique<Trk::Volume>(
makeTransform(compTr), compBounds.release());
1524 auto compTV = std::make_unique<Trk::TrackingVolume>(*compVol, *
m_muonMaterial, cscLayerArray.release(),
nullptr,
compName[
ic]);
1525 components.push_back(std::move(compTV));
1526 xCurr += xSizes[
ic];
1527 volSteps.push_back(xCurr + xShift);
1530 if (xMed != xMin && xMed != xMax) {
1531 envXMed += zShift / (
y1 / (xMed - xMin) +
y2 / (xMed - xMax));
1532 envY1 =
y1 * (envXMed - xMin) / (xMed - xMin);
1533 envY2 =
y2 * (envXMed - xMax) / (xMed - xMax);
1535 auto cscBounds = std::make_unique<Trk::DoubleTrapezoidVolumeBounds>(xMin, envXMed, xMax, envY1, envY2, xTotal);
1539 envelope = std::make_unique<Trk::Volume>(
makeTransform(cTr), cscBounds.release());
1541 double xCurr = -xTotal;
1542 for (
unsigned int ic = 0;
ic < xSizes.size();
ic++) {
1544 xCurr += xSizes[
ic];
1547 auto compBounds = std::make_unique<Trk::DoubleTrapezoidVolumeBounds>(xMin, envXMed, xMax, envY1, envY2, xSizes[
ic]);
1549 std::unique_ptr<Trk::Volume> compVol = std::make_unique<Trk::Volume>(
makeTransform(compTr), compBounds.release());
1550 auto compTV = std::make_unique<Trk::TrackingVolume>(*compVol, *
m_muonMaterial,
1551 cscLayerArray.release(),
nullptr,
compName[
ic]);
1552 components.push_back(std::move(compTV));
1553 xCurr += xSizes[
ic];
1554 volSteps.push_back(xCurr + xShift);
1559 std::unique_ptr<Trk::BinnedArray<Trk::TrackingVolume>> compArray{};
1560 if (!components.empty() && isDiamond) {
1563 }
else if (!components.empty() && !isDiamond) {
1570 return std::make_unique<Trk::TrackingVolume>(*envelope, *
m_muonMaterial,
nullptr, compArray.release(),
name);
◆ processCSCTrdComponent()
Definition at line 1790 of file MuonStationTypeBuilder.cxx.
1795 std::string
name =
pv->getLogVol()->getName();
1796 std::vector<std::unique_ptr<Trk::PlaneLayer>>
layers{};
1797 std::vector<double> x_array{}, x_thickness{};
1798 std::vector<Trk::MaterialProperties> x_mat;
1799 std::vector<int> x_active;
1800 double currX = -100000;
1808 if (
name.compare(
name.size() - 5, 5,
"CSC01") == 0) {
1809 if (!cache.m_matCSC01) {
1810 double vol = (minX + maxX) * 2 * halfY * thickness;
1816 const GeoVPhysVol* cv1 =
pv->getChildVol(0);
1818 const GeoLogVol* clv = cv->getLogVol();
1819 if (clv->getName() ==
"CscArCO2") {
1820 double xl = transfc.translation().x();
1821 if (x_array.empty() || xl >= x_array.back()) {
1822 x_array.push_back(xl);
1824 unsigned int ix = 0;
1825 while (ix < x_array.size() && x_array[ix] < xl) {
1828 x_array.insert(x_array.begin() + ix, xl);
1832 if (x_array.empty()) {
1833 x_array.push_back(0.);
1834 x_mat.push_back(matCSC);
1835 x_thickness.push_back(thickness);
1836 x_active.push_back(1);
1837 }
else if (x_array.size() == 1) {
1838 double xthick = 2 *
std::min(x_array[0] + halfZ, halfZ - x_array[0]);
1839 double scale = xthick / thickness;
1841 matCSC.averageA(), matCSC.averageZ(),
1842 matCSC.averageRho() /
scale);
1843 x_mat.push_back(xmatCSC);
1844 x_thickness.push_back(xthick);
1845 x_active.push_back(1);
1847 double currX = -halfZ;
1848 for (
unsigned int il=0;
il < x_array.size();
il++) {
1850 if (
il < x_array.size() - 1) {
1851 xthick = 2 *
std::min(x_array[
il] - currX, 0.5 * (x_array[
il + 1] - x_array[
il]));
1853 xthick = 2 *
std::min(x_array[
il] - currX, halfZ - x_array[
il]);
1855 x_thickness.push_back(xthick);
1856 x_mat.push_back(matCSC);
1857 currX = x_array[
il] + 0.5 * x_thickness.back();
1858 x_active.push_back(1);
1862 if (
name ==
"CSCspacer") {
1863 if (!cache.m_matCSCspacer1) {
1864 double vol = (minX + maxX) * 2 * halfY * thickness;
1867 x_array.push_back(0.);
1868 x_mat.push_back(*cache.m_matCSCspacer1);
1869 x_thickness.push_back(thickness);
1870 x_active.push_back(0);
1873 std::unique_ptr<Trk::OverlapDescriptor> od{};
1875 for (
unsigned int iloop = 0; iloop < x_array.size(); iloop++) {
1878 auto layer = std::make_unique<Trk::PlaneLayer>(cTr, bounds, cscMaterial, x_thickness[iloop], std::move(od));
1880 layer->setLayerType(x_active[iloop]);
1885 std::vector<Trk::SharedObject<Trk::Layer>> layerOrder;
1886 std::vector<float> binSteps;
1887 double xShift = transf.translation().x();
1889 binSteps.push_back(lowX);
1892 currX = lowX - xShift;
1893 for (
unsigned int i = 0;
i <
layers.size() - 1;
i++) {
1894 currX = x_array[
i] + 0.5 *
layers[
i]->thickness();
1895 layerOrder.push_back(std::move(
layers[
i]));
1896 binSteps.push_back(currX + xShift);
1898 layerOrder.push_back(std::move(
layers.back()));
1899 binSteps.push_back(compBounds.
halflengthZ() + xShift);
1903 return std::make_unique<Trk::NavBinnedArray1D<Trk::Layer>>(layerOrder, binUtility.release(),
◆ processMdtBox()
components
Definition at line 714 of file MuonStationTypeBuilder.cxx.
718 std::vector<std::unique_ptr<Trk::PlaneLayer>>
layers{};
719 std::vector<double> x_array{}, x_ref{}, x_thickness{};
720 std::vector<Trk::MaterialProperties*> x_mat;
721 std::vector<int> x_active;
722 double currX = -100000;
725 const GeoLogVol* clv = cv->getLogVol();
729 if ((clv->getName()).compare(0, 3,
"MDT") == 0) {
731 if (!cache.m_mdtTubeMat) {
732 const GeoTube*
tube =
dynamic_cast<const GeoTube*
>(clv->getShape());
736 double volume = 8 * (
tube->getRMax()) * (
tube->getZHalfLength()) * xv;
740 mdtMat = cache.m_mdtTubeMat.get();
743 if ((clv->getName()) ==
"MultiLayerFoam") {
745 for (
auto&
i : cache.m_mdtFoamMat) {
746 if (std::abs(xv - 0.5 *
i->thickness()) < 0.001) {
754 ATH_MSG_ERROR(__FILE__<<
":"<<__LINE__<<
" box station component does not return cuboid shape");
757 cache.m_mdtFoamMat.push_back(std::make_unique<Trk::MaterialProperties>(
getAveragedLayerMaterial(cv, volume, 2 * xv)));
759 if (!cache.m_mdtFoamMat.empty())
760 mdtMat = cache.m_mdtFoamMat.back().get();
763 if (transfc.translation().x() != currX) {
764 if (x_array.empty() || transfc.translation().x() > x_array.back()) {
765 x_array.push_back(transfc.translation().x());
766 x_mat.push_back(mdtMat);
767 x_thickness.push_back(2 * xv);
768 x_active.push_back(
active);
769 currX = transfc.translation().x();
770 if (std::abs(transfc.translation().y()) > 0.001) {
772 double ref = transfc.translation().z() + 1e5;
773 ref +=
int(1000 * transfc.translation().y()) * 10e6;
774 x_ref.push_back(
ref);
776 x_ref.push_back(transfc.translation().z());
784 while (transfc.translation().x() > *xIter) {
789 x_array.insert(xIter, transfc.translation().x());
790 x_mat.insert(mIter, mdtMat);
791 x_thickness.insert(tIter, 2 * xv);
792 x_active.insert(aIter,
active);
793 if (std::abs(transfc.translation().y()) > 0.001) {
795 double sign = (transfc.translation().y() > 0.) ? 1. : -1.;
796 double ref = transfc.translation().z() +
sign * 1e5;
797 ref +=
int(1000 * transfc.translation().y()) * 10e6;
798 x_ref.insert(rIter,
ref);
800 x_ref.insert(rIter, transfc.translation().z());
802 currX = transfc.translation().x();
807 double thickness{0.};
808 std::unique_ptr<Trk::OverlapDescriptor> od =
nullptr;
814 const auto bounds = std::make_shared<Trk::RectangleBounds>(yv, zv);
815 for (
unsigned int iloop = 0; iloop < x_array.size(); iloop++) {
817 thickness = x_thickness[iloop];
827 auto layer = std::make_unique<Trk::PlaneLayer>(cTr, bounds, mdtMaterial, thickness, std::move(od));
828 layer->setRef(x_ref[iloop] - zShift);
830 layer->setLayerType(x_active[iloop]);
834 minX = transf.translation().x() - volBounds->
halflengthX();
837 std::vector<Trk::SharedObject<Trk::Layer>> layerOrder;
838 std::vector<float> binSteps;
841 binSteps.push_back(minX);
844 for (
unsigned int i = 0;
i <
layers.size(); ++
i) {
847 currX = ltransf.translation().x() + 0.5 *
layers[
i]->thickness();
848 binSteps.push_back(currX);
850 layerOrder.emplace_back(std::move(
layers[
i]));
852 binSteps.push_back(transf.translation().x() + volBounds->
halflengthX());
858 auto mdtLayerArray = std::make_unique<Trk::NavBinnedArray1D<Trk::Layer>>(layerOrder,
859 binUtility.release(),
862 return std::make_unique<Trk::TrackingVolume>(vol, *
m_muonMaterial, mdtLayerArray.release(),
nullptr,
"MDT");
◆ processMdtTrd()
Definition at line 867 of file MuonStationTypeBuilder.cxx.
872 std::vector<std::unique_ptr<Trk::PlaneLayer>>
layers{};
873 std::vector<double> x_array{},x_thickness{},x_ref{};
874 std::vector<Trk::MaterialProperties*> x_mat{};
875 std::vector<int> x_active;
876 double currX = -100000;
878 const GeoLogVol* clv = cv->getLogVol();
881 if (clv->getShape()->type() ==
"Trd") {
882 const GeoTrd* trd =
dynamic_cast<const GeoTrd*
>(clv->getShape());
883 double x1v = trd->getXHalfLength1();
884 double x2v = trd->getXHalfLength2();
889 if ((clv->getName()).compare(0, 3,
"MDT") == 0) {
891 if (!cache.m_mdtTubeMat) {
892 const GeoTube*
tube =
dynamic_cast<const GeoTube*
>(clv->getShape());
893 double volume = 8 * (
tube->getRMax()) * (
tube->getZHalfLength()) * xv;
896 mdtMat = cache.m_mdtTubeMat.get();
899 if ((clv->getName()) ==
"MultiLayerFoam") {
901 for (
auto&
i : cache.m_mdtFoamMat) {
902 if (std::abs(xv - 0.5 *
i->thickness()) < 0.001) {
911 ATH_MSG_ERROR(
"trd station component does not return trapezoid shape");
914 cache.m_mdtFoamMat.push_back(std::make_unique<Trk::MaterialProperties>(
getAveragedLayerMaterial(cv, volume, 2 * xv)));
915 mdtMat = cache.m_mdtFoamMat.back().get();
919 if (transfc.translation().x() != currX) {
920 if (x_array.empty() || transfc.translation().x() > x_array.back()) {
921 x_array.push_back(transfc.translation().x());
922 x_mat.push_back(mdtMat);
923 x_thickness.push_back(2 * xv);
924 x_ref.push_back(transfc.translation().z());
925 currX = transfc.translation().x();
926 x_active.push_back(
active);
933 while (transfc.translation().x() > *xIter) {
938 x_array.insert(xIter, transfc.translation().x());
939 x_mat.insert(mIter, mdtMat);
940 x_thickness.insert(tIter, 2 * xv);
941 x_ref.insert(rIter, transfc.translation().z());
942 x_active.insert(aIter,
active);
943 currX = transfc.translation().x();
948 double thickness{0.};
949 std::unique_ptr<Trk::OverlapDescriptor> od =
nullptr;
959 auto bounds = std::make_shared<const Trk::TrapezoidBounds>(x1v, x2v, yv);
960 for (
unsigned int iloop = 0; iloop < x_array.size(); iloop++) {
961 thickness = x_thickness[iloop];
969 auto layer = std::make_unique<Trk::PlaneLayer>(cTr, bounds, mdtMaterial, thickness, std::move(od));
971 layer->setLayerType(x_active[iloop]);
972 layer->setRef(x_ref[iloop]);
977 std::vector<Trk::SharedObject<Trk::Layer>> layerOrder;
978 std::vector<float> binSteps;
980 double minX = transf.translation().x() - volBounds->
halflengthZ();
981 binSteps.push_back(minX);
984 for (
unsigned int i = 0;
i <
layers.size(); ++
i) {
987 currX = ltransf.translation().x() + 0.5 *
layers[
i]->thickness();
988 binSteps.push_back(currX);
990 layerOrder.emplace_back(std::move(
layers[
i]));
992 binSteps.push_back(transf.translation().x() + volBounds->
halflengthZ());
995 auto mdtLayerArray = std::make_unique<Trk::NavBinnedArray1D<Trk::Layer>>(layerOrder, binUtility.release(),
998 return std::make_unique<Trk::TrackingVolume>(vol, *
m_muonMaterial, mdtLayerArray.release(),
nullptr,
"MDT");
◆ processRpc()
Why not 42?? That number would have much more beauty
Definition at line 1001 of file MuonStationTypeBuilder.cxx.
1006 std::vector<std::unique_ptr<Trk::Layer>>
layers{};
1007 for (
unsigned int ic = 0;
ic < gv.size(); ++
ic) {
1008 const GeoLogVol* glv = gv[
ic]->getLogVol();
1009 const GeoShape* shape = glv->getShape();
1010 if (shape->type() !=
"Box" && shape->type() !=
"Trd") {
1011 const GeoShapeSubtraction* sub =
dynamic_cast<const GeoShapeSubtraction*
>(shape);
1012 const GeoShape* subt =
nullptr;
1014 subt = sub->getOpA();
1015 sub =
dynamic_cast<const GeoShapeSubtraction*
>(subt);
1019 if (shape && shape->type() ==
"Box") {
1020 const GeoBox* box =
dynamic_cast<const GeoBox*
>(shape);
1021 double xs = box->getXHalfLength();
1022 double ys = box->getYHalfLength();
1023 double zs = box->getZHalfLength();
1025 double thickness = 2 * xs;
1026 std::unique_ptr<Trk::OverlapDescriptor> od =
nullptr;
1027 auto bounds = std::make_shared<const Trk::RectangleBounds>(ys, zs);
1030 if (glv->getName().compare(0, 3,
"Ded") == 0) {
1033 for (
auto&
i : cache.m_rpcDed) {
1034 if (std::abs(thickness -
i->thickness()) < 0.001) {
1041 double volc = 8 * xs * ys * zs;
1047 if (std::abs(thickness - 46.0) < 0.001) {
1048 if (!cache.m_rpc46) {
1049 double volc = 8 * xs * ys * zs;
1054 ATH_MSG_WARNING(
"RPC module thickness different from 46: "<< thickness);
1059 auto layer = std::make_unique<Trk::PlaneLayer>(cTr, bounds, rpcMaterial, thickness, std::move(od));
1062 if ((glv->getName()).compare(0, 3,
"Ded") != 0) {
1063 layer->setLayerType(1);
1065 layer->setLayerType(0);
1068 }
else if (shape && shape->type() ==
"Trd") {
1069 const GeoTrd* trd =
dynamic_cast<const GeoTrd*
>(shape);
1070 double xs1 = trd->getXHalfLength1();
1071 double xs2 = trd->getXHalfLength2();
1072 double ys1 = trd->getYHalfLength1();
1073 double ys2 = trd->getYHalfLength2();
1074 double zs = trd->getZHalfLength();
1076 if (xs1 == xs2 && ys1 == ys2) {
1077 double thickness = 2 * xs1;
1078 std::unique_ptr<Trk::OverlapDescriptor> od =
nullptr;
1079 auto bounds = std::make_shared<const Trk::RectangleBounds>(ys1, zs);
1082 if ((glv->getName()).compare(0, 3,
"Ded") == 0) {
1085 for (
auto&
i : cache.m_rpcDed) {
1086 if (std::abs(thickness -
i->thickness()) < 0.001) {
1093 double volc = 8 * xs1 * ys1 * zs;
1099 auto layer = std::make_unique<Trk::PlaneLayer>(cTr, bounds, rpcMaterial, thickness, std::move(od));
1100 layer->setLayerType(0);
1104 unsigned int ngc = gv[
ic]->getNChildVols();
1105 for (
unsigned int igc = 0; igc < ngc; igc++) {
1108 trgc = gv[
ic]->getXToChildVol(igc);
1112 const GeoVPhysVol* gcv = gv[
ic]->getChildVol(igc);
1113 const GeoLogVol* gclv = gcv->getLogVol();
1114 const GeoShape* lshape = gclv->getShape();
1115 while (lshape->type() ==
"Subtraction") {
1116 const GeoShapeSubtraction* sub =
dynamic_cast<const GeoShapeSubtraction*
>(lshape);
1117 lshape = sub->getOpA();
1119 const GeoTrd* gtrd =
dynamic_cast<const GeoTrd*
>(lshape);
1120 double gx = gtrd->getXHalfLength1();
1121 double gy = gtrd->getYHalfLength1();
1122 double gz = gtrd->getZHalfLength();
1124 if ((gclv->getName()).
compare(0, 6,
"RPC_AL") == 0) {
1125 if (std::abs(gx - 5.0) < 0.001) {
1126 if (!cache.m_rpcExtPanel) {
1127 double volc = 8 * gx * gy * gz;
1128 cache.m_rpcExtPanel =
1132 }
else if (std::abs(gx - 4.3) < 0.001) {
1133 if (!cache.m_rpcMidPanel) {
1134 double volc = 8 * gx * gy * gz;
1135 cache.m_rpcMidPanel =
1146 bounds, rpcMaterial, thickness, std::move(od));
1147 layer->setLayerType(0);
1149 }
else if ((gclv->getName()) ==
"Rpclayer") {
1151 if (std::abs(gx - 6.85) > 0.001 && std::abs(gx - 5.9) > 0.001) {
1152 ATH_MSG_WARNING(
"processRpc() - unusual thickness of RPC ("<< glv->getName()<<
") layer :" << 2 * gx);
1154 if (!cache.m_rpcLayer) {
1155 double volc = 8 * gx * gy * gz;
1164 bounds, rpcMaterial, thickness, std::move(od));
1165 layer->setLayerType(1);
1182 return std::make_unique<Trk::TrackingVolume>(vol, *
m_muonMaterial, rpcLayers.release(),
"RPC");
◆ processSpacer()
Definition at line 1186 of file MuonStationTypeBuilder.cxx.
1190 std::vector<std::unique_ptr<Trk::Layer>>
layers{};
1194 while (
idx < gv.size()) {
1195 const GeoVPhysVol* vol = gv[
idx];
1197 if (vol->getNChildVols()) {
1198 for (
unsigned int ich = 0; ich < vol->getNChildVols(); ++ich) {
1199 gv.push_back(vol->getChildVol(ich));
1200 transf.emplace_back(tf * vol->getXToChildVol(ich));
1202 gv.erase(gv.begin() +
idx);
1203 transf.erase(transf.begin() +
idx);
1209 for (
unsigned int ic = 0;
ic < gv.size(); ++
ic) {
1210 const GeoLogVol* clv = gv[
ic]->getLogVol();
1213 << cmat.
X0 <<
" L0 " << cmat.
L0 <<
" A " << cmat.
A
1214 <<
" Z " << cmat.
Z <<
" rho " << cmat.
rho);
1215 if (clv->getShape()->type() ==
"Box") {
1216 const GeoBox* box =
dynamic_cast<const GeoBox*
>(clv->getShape());
1217 double xs = box->getXHalfLength();
1218 double ys = box->getYHalfLength();
1219 double zs = box->getZHalfLength();
1222 double thickness{0.};
1224 if (zs <= xs && zs <= ys) {
1225 bounds = std::make_shared<const Trk::RectangleBounds>(xs, ys);
1228 }
else if (xs <= ys && xs <= zs) {
1229 bounds = std::make_shared<Trk::RectangleBounds>(ys, zs);
1233 bounds = std::make_shared<Trk::RectangleBounds>(xs, zs);
1240 auto layer = std::make_unique<Trk::PlaneLayer>(cTr, bounds, spacerMaterial, thickness,
nullptr, 0);
1242 }
else if (clv->getShape()->type() ==
"Subtraction") {
1243 const GeoShapeSubtraction* sub =
1244 dynamic_cast<const GeoShapeSubtraction*
>(clv->getShape());
1245 if (sub && sub->getOpA()->type() ==
"Box" && sub->getOpB()->type() ==
"Box") {
1247 const GeoBox* boxA =
dynamic_cast<const GeoBox*
>(sub->getOpA());
1248 const GeoBox* boxB =
dynamic_cast<const GeoBox*
>(sub->getOpB());
1249 auto bounds = std::make_shared<const Trk::RectangleBounds>(boxA->getYHalfLength(), boxA->getZHalfLength());
1250 double thickness = (boxA->getXHalfLength() - boxB->getXHalfLength());
1251 double shift = 0.5 * (boxA->getXHalfLength() + boxB->getXHalfLength());
1254 if (thickness > 0.) {
1260 bounds, spacerMaterial, thickness,
nullptr, 0);
1261 layers.push_back(std::move(layx));
1264 bounds, spacerMaterial, thickness,
nullptr, 0);
1265 layers.push_back(std::move(layxx));
1267 thickness = (boxA->getYHalfLength() - boxB->getYHalfLength());
1268 if (thickness > 0.) {
1271 shift = 0.5 * (boxA->getYHalfLength() + boxB->getYHalfLength());
1272 bounds = std::make_shared<const Trk::RectangleBounds>(boxB->getXHalfLength(), boxA->getZHalfLength());
1274 bounds, spacerMaterial, thickness,
nullptr, 0);
1275 layers.push_back(std::move(lay));
1278 bounds, spacerMaterial, thickness,
nullptr, 0);
1280 layers.push_back(std::move(layy));
1282 thickness = (boxA->getZHalfLength() - boxB->getZHalfLength());
1283 if (thickness > 0.) {
1286 shift = 0.5 * (boxA->getZHalfLength() + boxB->getZHalfLength());
1287 bounds = std::make_shared<const Trk::RectangleBounds>(boxB->getXHalfLength(), boxB->getYHalfLength());
1289 bounds, spacerMaterial, thickness,
nullptr, 0);
1290 layers.push_back(std::move(layz));
1293 bounds, spacerMaterial, thickness,
nullptr, 0);
1294 layers.push_back(std::move(layzz));
1297 std::vector<std::pair<const GeoShape*, Amg::Transform3D>> subVs;
1298 const GeoShapeShift* shift =
dynamic_cast<const GeoShapeShift*
>(sub->getOpB());
1300 subVs.emplace_back(shift->getOp(), shift->getX());
1301 const GeoShape* shape = sub->getOpA();
1302 while (shape->type() ==
"Subtraction") {
1303 const GeoShapeSubtraction* subtr =
dynamic_cast<const GeoShapeSubtraction*
>(shape);
1304 const GeoShapeShift* shift =
dynamic_cast<const GeoShapeShift*
>(subtr->getOpB());
1306 subVs.emplace_back(shift->getOp(), shift->getX());
1307 shape = subtr->getOpA();
1309 const GeoBox* box =
dynamic_cast<const GeoBox*
>(shape);
1310 if (box && subVs.size() == 4) {
1311 std::unique_ptr<Trk::Volume> v1{},
v2{};
1312 std::unique_ptr<Trk::VolumeExcluder> volExcl =
nullptr;
1313 const GeoBox* sb1 =
dynamic_cast<const GeoBox*
>(subVs[0].first);
1318 const GeoBox* sb2 =
dynamic_cast<const GeoBox*
>(subVs[1].first);
1323 const GeoBox* boxB =
dynamic_cast<const GeoBox*
>(subVs[2].first);
1324 if (boxB && v1 &&
v2) {
1325 auto bounds = std::make_shared<const Trk::RectangleBounds>(box->getYHalfLength(), box->getZHalfLength());
1326 double thickness = (box->getXHalfLength() - boxB->getXHalfLength());
1327 double shift{0.5 * (box->getXHalfLength() + boxB->getXHalfLength())};
1328 auto combinedBounds = std::make_unique<Trk::CombinedVolumeBounds>(v1.release(),
v2.release(),
false);
1330 combinedBounds.release());
1331 volExcl = std::make_unique<Trk::VolumeExcluder>(cVol->clone());
1333 auto subPlane = std::make_unique<Trk::SubtractedPlaneSurface>(std::move(surf), volExcl.release(),
false);
1334 auto subPlaneX = std::make_unique<Trk::SubtractedPlaneSurface>(*subPlane,
Amg::getTranslateX3D(-2 * shift));
1339 auto layx = std::make_unique<Trk::SubtractedPlaneLayer>(subPlane.get(), spacerMaterial, thickness,
nullptr, 0);
1340 layers.push_back(std::move(layx));
1342 auto layxx = std::make_unique<Trk::SubtractedPlaneLayer>(subPlaneX.get(), spacerMaterial, thickness,
nullptr, 0);
1343 layers.push_back(std::move(layxx));
1345 bounds = std::make_shared<const Trk::RectangleBounds>( boxB->getXHalfLength(), box->getZHalfLength());
1346 thickness = subVs[2].second.translation().mag();
1349 auto volEx = std::make_unique<Trk::VolumeExcluder>(std::make_unique<Trk::Volume>(*cVol,
Amg::getTranslateX3D(2 * shift)).
release());
1352 auto subPlaneBis = std::make_unique<Trk::SubtractedPlaneSurface>(std::move(surf), volEx.release(),
false);
1355 auto lay = std::make_unique<Trk::SubtractedPlaneLayer>(subPlaneBis.get(), spacerMaterial, thickness,
nullptr, 0);
1356 layers.push_back(std::move(lay));
1360 ATH_MSG_DEBUG(clv->getName() <<
", unresolved spacer component " << clv->getName());
1363 ATH_MSG_DEBUG(clv->getName() <<
", unresolved spacer component " << clv->getName());
1368 for (; lIt !=
layers.end(); ++lIt)
1369 if ((*lIt)->thickness() < 0.)
1373 auto spacer = std::make_unique<Trk::TrackingVolume>(vol, *
m_muonMaterial, spacerLayers.release(),
"Spacer");
1378 laySpacer.first->setLayerType(0);
1380 layers.push_back(std::move(laySpacer.first));
1382 spacer = std::make_unique<Trk::TrackingVolume>(vol, *
m_muonMaterial, spacerLays.release(),
"Spacer");
◆ processTGCComponent()
Definition at line 2028 of file MuonStationTypeBuilder.cxx.
2033 constexpr
double tol{0.001};
2034 std::string
name =
pv->getLogVol()->getName();
2035 std::vector<std::unique_ptr<Trk::PlaneLayer>>
layers{};
2036 std::vector<double> x_array{}, x_thickness{};
2037 std::vector<Trk::MaterialProperties> x_mat;
2038 double currX = -100000;
2045 double thickness = 2 * halfZ;
2046 if (std::abs(halfZ - 35.00) < tol) {
2047 if (!cache.m_matTGC01) {
2048 double vol = (minX + maxX) * 2 * halfY * thickness;
2052 }
else if (std::abs(halfZ - 21.85) < tol) {
2053 if (!cache.m_matTGC06) {
2054 double vol = (minX + maxX) * 2 * halfY * thickness;
2063 const GeoLogVol* clv = cv->getLogVol();
2064 if (clv->getName() ==
"muo::TGCGas") {
2065 double xl = transfc.translation().x();
2066 if (x_array.empty() || xl >= x_array.back()) {
2067 x_array.push_back(xl);
2069 unsigned int ix = 0;
2070 while (ix < x_array.size() && x_array[ix] < xl) {
2073 x_array.insert(x_array.begin() + ix, xl);
2077 double activeThick{0.};
2078 if (x_array.empty()) {
2079 x_array.push_back(0.);
2080 x_thickness.push_back(thickness);
2081 activeThick = thickness;
2082 }
else if (x_array.size() == 1) {
2083 x_thickness.push_back(2 * fmin(x_array[0] + halfZ, halfZ - x_array[0]));
2084 activeThick += x_thickness.back();
2086 double currX = -halfZ;
2087 for (
unsigned int il=0;
il < x_array.size(); ++
il) {
2088 if (
il < x_array.size() - 1) {
2089 x_thickness.push_back(2 *
std::min(x_array[
il] - currX, 0.5 * (x_array[
il + 1] - x_array[
il])));
2091 x_thickness.push_back(2 *
std::min(x_array[
il] - currX, halfZ - x_array[
il]));
2093 currX = x_array[
il] + 0.5 * x_thickness.back();
2094 activeThick += x_thickness.back();
2098 double scale = activeThick / thickness;
2100 matTGC.averageA(), matTGC.averageZ(), matTGC.averageRho() /
scale);
2102 std::unique_ptr<Trk::OverlapDescriptor> od =
nullptr;
2105 for (
unsigned int iloop = 0; iloop < x_array.size(); iloop++) {
2108 auto layer = std::make_unique<Trk::PlaneLayer>(cTr, bounds, tgcMaterial, x_thickness[iloop], std::move(od));
2110 layer->setLayerType(1);
2114 std::vector<Trk::SharedObject<Trk::Layer>> layerOrder;
2115 std::vector<float> binSteps;
2117 float xShift = transf.translation().x();
2118 float lowX = -halfZ + xShift;
2119 binSteps.push_back(lowX);
2122 for (
unsigned int i = 0;
i <
layers.size() - 1; ++
i) {
2123 currX = x_array[
i] + 0.5 *
layers[
i]->thickness() + xShift;
2124 binSteps.push_back(currX);
2125 layerOrder.push_back(std::move(
layers[
i]));
2127 layerOrder.push_back(std::move(
layers.back()));
2128 binSteps.push_back(halfZ + xShift);
2131 return std::make_unique<Trk::NavBinnedArray1D<Trk::Layer>>(layerOrder, binUtility.release(),
◆ processTgcStation()
Definition at line 1573 of file MuonStationTypeBuilder.cxx.
1575 const GeoLogVol* clv = cv->getLogVol();
1576 const std::string& tgc_name = clv->getName();
1577 const GeoShape* baseShape = clv->getShape();
1578 if (baseShape->type() ==
"Subtraction") {
1579 const GeoShapeSubtraction* sub =
dynamic_cast<const GeoShapeSubtraction*
>(baseShape);
1581 baseShape = sub->getOpA();
1585 if (baseShape->type() ==
"Trd") {
1586 const GeoTrd* trd =
dynamic_cast<const GeoTrd*
>(baseShape);
1587 double x1 = trd->getXHalfLength1();
1588 double y1 = trd->getYHalfLength1();
1589 double y2 = trd->getYHalfLength2();
1590 double z = trd->getZHalfLength();
1592 auto tgcBounds = std::make_unique<Trk::TrapezoidVolumeBounds>(
y1,
y2,
z,
x1);
1595 std::unique_ptr<Trk::LayerArray> tgcLayerArray{
processTGCComponent(cv, *tgcBounds, tTr, cache)};
1597 auto envelope = std::make_unique<Trk::Volume>(
makeTransform(tTr), tgcBounds.release());
1600 auto tgc_station = std::make_unique<Trk::TrackingVolume>(*envelope, *
m_muonMaterial, tgcLayerArray.release(),
nullptr, tgc_name);
1603 ATH_MSG_WARNING( tgc_name <<
": TGC component not a trapezoid ? no prototype built ");
◆ processTrdStationComponents()
Definition at line 462 of file MuonStationTypeBuilder.cxx.
465 ATH_MSG_DEBUG(
" processing station components for " << mv->getLogVol()->getName());
473 std::vector<std::unique_ptr<Trk::Volume>> compVol;
475 std::vector<const GeoVPhysVol*> compGeo;
476 std::vector<Amg::Transform3D> compTransf;
478 const GeoLogVol* clv = cv->getLogVol();
480 std::unique_ptr<Trk::VolumeBounds> bounds{};
482 if (clv->getShape()->type() ==
"Trd") {
483 const GeoTrd* trd =
dynamic_cast<const GeoTrd*
>(clv->getShape());
484 const double halfX1 = trd->getXHalfLength1();
485 const double halfX2 = trd->getXHalfLength2();
486 const double halfY1 = trd->getYHalfLength1();
487 const double halfY2 = trd->getYHalfLength2();
488 const double halfZ = trd->getZHalfLength();
489 if (halfX1 == halfX2 && halfY1 == halfY2)
490 bounds = std::make_unique<Trk::CuboidVolumeBounds>(
std::max(halfX1, halfX2),
492 if (halfX1 == halfX2 && halfY1 != halfY2) {
495 bounds = std::make_unique<Trk::TrapezoidVolumeBounds>(halfY1, halfY2,
498 if (halfX1 != halfX2 && halfY1 == halfY2) {
499 bounds = std::make_unique<Trk::TrapezoidVolumeBounds>(halfX1, halfX2,
505 }
else if (clv->getShape()->type() ==
"Box") {
506 const GeoBox* box =
dynamic_cast<const GeoBox*
>(clv->getShape());
507 const double halfX1 = box->getXHalfLength();
508 const double halfY1 = box->getYHalfLength();
509 const double halfZ = box->getZHalfLength();
510 bounds = std::make_unique<Trk::CuboidVolumeBounds>(halfX1, halfY1, halfZ);
514 if (clv->getName().compare(0, 1,
"C") != 0 && clv->getName().compare(0, 2,
"LB") != 0) {
518 bounds = std::make_unique<Trk::TrapezoidVolumeBounds>(envelope.minHalflengthX(),
519 envelope.maxHalflengthX(),
520 envelope.halflengthY(), xSize);
522 auto vol = std::make_unique<Trk::Volume>(
makeTransform(std::move(boxTrf)),
524 std::string cname = clv->getName();
525 std::string vname = mv->getLogVol()->getName();
526 int nameSize = vname.size() - 8;
527 if (cname.compare(0, nameSize, vname, 0, nameSize) == 0) {
528 cname = cname.substr(nameSize, cname.size() - nameSize);
531 if (compVol.empty() || vol->center().x() >= compVol.back()->center().x()) {
532 compVol.emplace_back(std::move(vol));
534 compGeo.push_back(cv);
535 compTransf.push_back(transf);
537 std::vector<std::unique_ptr<Trk::Volume>>
::iterator volIter = compVol.begin();
541 while (vol->center().x() >= (*volIter)->center().x()) {
547 compVol.insert(volIter, std::move(vol));
549 compGeo.insert(geoIter, cv);
550 compTransf.insert(transfIter, transf);
554 std::vector<std::unique_ptr<Trk::TrackingVolume>> trkVols;
555 const double envX1{envelope.minHalflengthX()}, envX2{envelope.maxHalflengthX()},
556 envY{envelope.halflengthY()}, envZ{envelope.halflengthZ()};
558 double currX{-envZ}, maxX{envZ};
560 bool openSpacer =
false;
561 std::vector<const GeoVPhysVol*> geoSpacer{}, geoRpc{};
562 std::vector<Amg::Transform3D> transfSpacer{}, transfRpc{};
563 double spacerlowXsize{0.}, spaceruppXsize{0.}, Xcurr{0.}, lowX{0.}, uppX{0.};
564 std::vector<float> volSteps;
565 volSteps.push_back(-envelope.halflengthZ());
566 for (
unsigned i = 0;
i < compVol.size();
i++) {
567 bool comp_processed =
false;
572 lowX = compVol[
i]->center().x() - compCubBounds->
halflengthX();
573 uppX = compVol[
i]->center().x() + compCubBounds->
halflengthX();
574 }
else if (compTrdBounds) {
575 lowX = compVol[
i]->center().x() - compTrdBounds->
halflengthZ();
576 uppX = compVol[
i]->center().x() + compTrdBounds->
halflengthZ();
586 if (!compCubBounds && !compTrdBounds) {
587 ATH_MSG_WARNING(__FILE__<<
":"<<__LINE__<<
" Unknown volume shape "<<
typeid(volBounds).
name());
592 if (Xcurr - currX - (spacerlowXsize + spaceruppXsize) >=-
tolerance) {
593 auto spacerBounds = std::make_unique<Trk::TrapezoidVolumeBounds>(envX1, envX2, envY,
594 0.5 * (Xcurr - currX));
598 std::unique_ptr<Trk::TrackingVolume> spacerTrkVol{
processSpacer(spacerVol, geoSpacer, transfSpacer)};
599 trkVols.push_back(std::move(spacerTrkVol));
601 volSteps.push_back(Xcurr);
604 ATH_MSG_DEBUG(mv->getLogVol()->getName()<<
" : clash in spacer definition ");
608 ATH_MSG_DEBUG(mv->getLogVol()->getName() <<
": RPC components in endcaps? ");
614 geoSpacer.push_back(compGeo[
i]);
615 transfSpacer.clear();
616 transfSpacer.push_back(compTransf[
i]);
618 spacerlowXsize = compVol[
i]->center().x() - currX;
622 if (spacerlowXsize < compCubBounds->halflengthX()){
623 ATH_MSG_DEBUG( mv->getLogVol()->getName() <<
", spacer low edge - not enough space");
629 if (spacerlowXsize < compTrdBounds->halflengthZ()) {
630 ATH_MSG_DEBUG( mv->getLogVol()->getName() <<
", spacer low edge - not enough space");
634 geoSpacer.push_back(compGeo[
i]);
635 transfSpacer.push_back(compTransf[
i]);
638 if (compVol[
i]->center().
x() - currX < compCubBounds->halflengthX()) {
639 ATH_MSG_DEBUG( mv->getLogVol()->getName() <<
", spacer low edge - not enough space");
641 if (compVol[
i]->center().
x() + compCubBounds->
halflengthX() > currX + spacerlowXsize + spaceruppXsize) {
642 spaceruppXsize += (compVol[
i]->center().x() + compCubBounds->
halflengthX()) -
643 (currX + spacerlowXsize + spaceruppXsize);
645 }
else if (compTrdBounds) {
646 if (compVol[
i]->center().x() - currX < compTrdBounds->
halflengthZ()) {
647 ATH_MSG_DEBUG(mv->getLogVol()->getName() <<
", spacer low edge - not enough space");
649 if (compVol[
i]->center().
x() + compTrdBounds->
halflengthZ() > currX + spacerlowXsize + spaceruppXsize) {
650 spaceruppXsize += (compVol[
i]->center().x() + compTrdBounds->
halflengthZ()) -
651 (currX + spacerlowXsize + spaceruppXsize);
655 comp_processed =
true;
658 std::unique_ptr<Trk::Volume> mdtVol{};
660 if (std::abs(lowX - currX) > 0.002) {
661 ATH_MSG_DEBUG(
"Mdt volume size does not match the envelope:lowX,currX:"<< lowX <<
"," << currX);
664 auto mdtBounds = std::make_unique<Trk::TrapezoidVolumeBounds>(envX1, envX2, envY, dZ + 0.5 * (lowX - currX));
665 const double halfZ = mdtBounds->halflengthZ();
667 mdtBounds.release());
668 std::unique_ptr<Trk::TrackingVolume> mdtTrkVol{
processMdtTrd(*mdtVol, compGeo[
i], compTransf[
i], cache)};
669 trkVols.push_back(std::move(mdtTrkVol));
671 volSteps.push_back(currX);
672 comp_processed =
true;
680 if (maxX >= currX + spacerlowXsize + spaceruppXsize) {
681 auto spacerBounds = std::make_unique<Trk::TrapezoidVolumeBounds>(envX1, envX2, envY,
682 0.5 * (maxX - currX));
688 std::unique_ptr<Trk::TrackingVolume> spacerTrkVol{
processSpacer(spacerVol, geoSpacer, transfSpacer)};
689 trkVols.push_back(std::move(spacerTrkVol));
691 volSteps.push_back(currX);
694 ATH_MSG_DEBUG(mv->getLogVol()->getName() <<
", clash in spacer definition (last volume)");
700 std::unique_ptr<Trk::BinUtility> binUtility = std::make_unique<Trk::BinUtility>(volSteps,
704 binUtility.release(),
false)};
◆ renounce()
◆ renounceArray()
◆ sysInitialize()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
◆ m_detStore
◆ m_evtStore
◆ m_geoShapeConverter
◆ m_idHelperSvc
◆ m_materialConverter
◆ m_multilayerRepresentation
Gaudi::Property<bool> Muon::MuonStationTypeBuilder::m_multilayerRepresentation {this, "BuildMultilayerRepresentation", true} |
|
private |
◆ m_muonMaterial
◆ m_resolveSpacer
Gaudi::Property<bool> Muon::MuonStationTypeBuilder::m_resolveSpacer {this, "ResolveSpacerBeams", false} |
|
private |
◆ m_trackingVolumeArrayCreator
Initial value:{this, "TrackingVolumeArrayCreator",
"Trk::TrackingVolumeArrayCreator/TrackingVolumeArrayCreator"}
Definition at line 169 of file MuonStationTypeBuilder.h.
◆ m_varHandleArraysDeclared
◆ m_vhka
◆ m_volumeConverter
The documentation for this class was generated from the following files:
JetConstituentVector::iterator iterator
double halflengthZ() const
This method returns the halflength in local z.
GeoVolumeVec_t geoGetVolumes(const GeoGraphNode *node, int depthLimit=1, int sizeHint=20)
Return the child volumes and associated transforms.
double maxHalflengthX() const
This method returns the maximal halflength in X (first coordinate of local surface frame)
double maxHalflengthX() const
This method returns the maximal halflength in local x.
Amg::Transform3D * makeTransform(const Amg::Transform3D &trf)
double halflengthY2() const
Trk::MaterialProperties collectStationMaterial(const Trk::TrackingVolume &trVol, double) const
std::pair< int, int > compare(const AmgSymMatrix(N) &m1, const AmgSymMatrix(N) &m2, double precision=1e-9, bool relative=false)
compare two matrices, returns the indices of the first element that fails the condition,...
double halflengthZ() const
This method returns the halflength in local z.
double minHalflengthX() const
This method returns the minimal halflength in local x.
constexpr double tolerance
float averageA() const
Return the average A of the material [gram/mole].
std::unique_ptr< Trk::LayerArray > processCSCDiamondComponent(const GeoVPhysVol *, const Trk::DoubleTrapezoidVolumeBounds &, const Amg::Transform3D &, Cache &) const
std::vector< std::pair< const GeoVPhysVol *, GeoTrf::Transform3D > > GeoVolumeVec_t
Return the child volumes and associated transforms.
std::unique_ptr< Trk::TrackingVolume > processMdtTrd(const Trk::Volume &trkVol, const GeoVPhysVol *, const Amg::Transform3D &, Cache &) const
std::unique_ptr< Trk::LayerArray > processCSCTrdComponent(const GeoVPhysVol *, const Trk::TrapezoidVolumeBounds &, const Amg::Transform3D &, Cache &) const
double envelopeThickness(const Trk::VolumeBounds &vb) const
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
double minHalflengthX() const
This method returns the halflength in X at minimal Y (first coordinate of local surface frame)
double get_x_size(const GeoVPhysVol *) const
Amg::Transform3D getTranslateZ3D(const double Z)
: Returns a shift transformation along the z-axis
double halflengthY() const
This method returns the halflength in Y (second coordinate of local surface frame)
static Material convert(const GeoMaterial *gm)
Single conversion , input type GeoMaterial - output type Trk::MaterialProperties.
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
float averageRho() const
Return the average density of the material.
double halflengthX() const
This method returns the halflength in local x.
Trk::VolumeConverter m_volumeConverter
Trk::GeoShapeConverter m_geoShapeConverter
float x0() const
Return the radiation length.
Amg::Transform3D getTranslateY3D(const double Y)
: Returns a shift transformation along the y-axis
double minHalflengthX() const
This method returns the minimal halflength in X (first coordinate of local surface frame)
std::unique_ptr< Trk::TrackingVolume > processMdtBox(const Trk::Volume &trkVol, const GeoVPhysVol *, const Amg::Transform3D &, double, Cache &) const
components
void collectMaterial(const GeoVPhysVol *pv, Trk::MaterialProperties &layMat, double sf) const
material collection for layers
#define ATH_MSG_VERBOSE(x)
std::unique_ptr< Trk::SurfaceBounds > getLayerBoundsFromEnvelope(const Trk::Volume &envelope) const
const Material & material() const
Return the stored Material.
std::unique_ptr< const Trk::Material > m_muonMaterial
the material
std::vector< std::pair< double, double > > xyVertices() const
This method returns the set of xy generating vertices.
double halflengthZ() const
This method returns the halflength in local z.
double halflengthY() const
This method returns the halflength in local y.
virtual void setOwner(IDataHandleHolder *o)=0
Amg::Transform3D getRotateZ3D(double angle)
get a rotation transformation around Z-axis
std::unique_ptr< Trk::LayerArray > processTGCComponent(const GeoVPhysVol *, const Trk::TrapezoidVolumeBounds &, const Amg::Transform3D &, Cache &) const
double maxHalflengthX() const
This method returns the X halflength at maximal Y (local coordinates)
float thickness() const
Return the thickness in mm.
double decodeX(const GeoShape *) const
double medHalflengthX() const
This method returns the (maximal) halflength in X (first coordinate of local surface frame)
double halflengthY() const
This method returns the halflength in local y.
void addMaterial(const Material &mp, float dInX0)
Material averaging.
Amg::Transform3D getRotateX3D(double angle)
get a rotation transformation around X-axis
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
double halflengthX() const
for consistant naming
double halflengthY1() const
This method returns the halflength1 in local y.
Eigen::Affine3d Transform3D
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
double area(const Trk::SurfaceBounds &sb) const
bool isIdentity(const Amg::Transform3D &trans)
Checks whether the transformation is the Identity transformation.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
ToolHandle< Trk::ITrackingVolumeArrayCreator > m_trackingVolumeArrayCreator
double halflengthY2() const
This method returns the halflength2 in local y.
std::unique_ptr< Trk::TrackingVolume > processRpc(const Trk::Volume &inVol, const std::vector< const GeoVPhysVol * > &childVols, const std::vector< Amg::Transform3D > &childVolsTrf, Cache &) const
const Volume * outer() const
This method returns the outer Volume.
virtual void renounce()=0
std::pair< std::unique_ptr< Trk::Layer >, std::vector< std::unique_ptr< Trk::Layer > > > createLayerRepresentation(Trk::TrackingVolume &trVol) const
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
const std::string & volumeName() const
Returns the VolumeName - for debug reason, might be depreciated later.
std::vector< std::unique_ptr< ObjType > > toVec(const std::vector< ObjType * > *vecPtr)
virtual BinnedArraySpan< T *const > arrayObjects()=0
Return all objects of the Array non-const we can still modify the T.
double halflengthY() const
for consitant naming
const Amg::Transform3D & transform() const
Return methods for geometry transform.
Amg::Transform3D getRotateY3D(double angle)
get a rotation transformation around Y-axis
double maxHalflengthX() const
This method returns the halflength in X at maximal Y (first coordinate of local surface frame)
const std::vector< const Trk::Surface * > * decomposeToSurfaces(const Amg::Transform3D &transform) override final
Method to decompose the Bounds into Surfaces.
Trk::GeoMaterialConverter m_materialConverter
std::unique_ptr< Volume > translateGeoShape(const GeoShape *shape, const Amg::Transform3D &trf) const
Convert an arbitrary GeoShape into Trk::Volume.
Trk::MaterialProperties getAveragedLayerMaterial(const GeoVPhysVol *, double, double) const
static std::unique_ptr< CylinderVolumeBounds > convert(const GeoTubs *gtub)
Convert a tubs.
std::shared_ptr< T > SharedObject
double minHalflengthX() const
This method returns the X halflength at minimal Y.
double halflengthY1() const
This method returns the halflength in Y of trapezoid at negative/positive Y (second coordinate)
#define ATH_MSG_WARNING(x)
const boost::regex ref(r_ef)
void printVolumeBounds(std::string comment, const Trk::VolumeBounds &vb) const
double medHalflengthX() const
This method returns the (maximal) halflength in local x.
const TrackingVolumeArray * confinedVolumes() const
Return the subLayer array.
const std::vector< const Trk::Surface * > * decomposeToSurfaces(const Amg::Transform3D &transform) override final
Method to decompose the Bounds into Surfaces.
Gaudi::Property< bool > m_resolveSpacer
float averageZ() const
Returns the average Z of the material.
const VolumeBounds & volumeBounds() const
returns the volumeBounds()
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Gaudi::Property< bool > m_multilayerRepresentation
double halflengthZ() const
This method returns the halflength in local z.
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
setScale setgFexType iEta
float l0() const
Return the nuclear interaction length.
std::span< T > BinnedArraySpan
Amg::Transform3D getTranslateX3D(const double X)
: Returns a shift transformation along the x-axis
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
std::unique_ptr< Trk::TrackingVolume > processSpacer(const Trk::Volume &, std::vector< const GeoVPhysVol * >, std::vector< Amg::Transform3D >) const
std::vector< ObjType * > release(std::vector< std::unique_ptr< ObjType >> &objVec)
Amg::Transform3D getTranslate3D(const double X, const double Y, const double Z)
: Returns a shift transformation along an arbitrary axis