![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
#include <MuonDetectorBuilderTool.h>
|
| MuonDetectorBuilderTool (const std::string &type, const std::string &name, const IInterface *parent) |
| Standard tool constructor. More...
|
|
virtual | ~MuonDetectorBuilderTool ()=default |
|
StatusCode | initialize () override final |
|
Acts::Experimental::DetectorComponent | construct (const Acts::GeometryContext &context) const override final |
|
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 |
|
| DeclareInterfaceID (IDetectorVolumeBuilderTool, 1, 0) |
|
Definition at line 13 of file MuonDetectorBuilderTool.h.
◆ StoreGateSvc_t
◆ MuonDetectorBuilderTool()
ActsTrk::MuonDetectorBuilderTool::MuonDetectorBuilderTool |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
◆ ~MuonDetectorBuilderTool()
virtual ActsTrk::MuonDetectorBuilderTool::~MuonDetectorBuilderTool |
( |
| ) |
|
|
virtualdefault |
◆ construct()
Acts::Experimental::DetectorComponent ActsTrk::MuonDetectorBuilderTool::construct |
( |
const Acts::GeometryContext & |
context | ) |
const |
|
finaloverride |
Definition at line 53 of file MuonDetectorBuilderTool.cxx.
56 using ChamberIdKey = std::pair<Muon::MuonStationIndex::ChIndex, unsigned int>;
57 using EnvelopeIdentifierMap = std::map<ChamberIdKey, unsigned int>;
58 using ChamberIdentifierMap = std::map<unsigned int, unsigned int>;
59 EnvelopeIdentifierMap volIds{};
60 ChamberIdentifierMap chamberIds{};
62 std::vector< std::shared_ptr< Acts::Experimental::DetectorVolume > > detectorVolumeBoundingVolumes{};
63 detectorVolumeBoundingVolumes.reserve(chambers.size());
64 std::vector<surfacePtr> surfaces = {};
65 std::pair<std::vector<volumePtr>, std::vector<surfacePtr>> readoutElements;
67 auto portalGenerator = Acts::Experimental::defaultPortalGenerator();
70 unsigned int volNumb = volIds[std::make_pair(
chamber->chamberIndex(),
chamber->stationPhi())];
71 if (!volNumb) volNumb = volIds.size();
73 unsigned int chNumb = (++chamberIds[volNumb]);
75 std::shared_ptr<Acts::TrapezoidVolumeBounds> bounds =
chamber->bounds();
77 volumePtr detectorVolume = Acts::Experimental::DetectorVolumeFactory::construct(
79 bounds, readoutElements.second, readoutElements.first, Acts::Experimental::tryAllSubVolumes(), Acts::Experimental::tryAllPortalsAndSurfaces());
80 detectorVolume->assignGeometryId(Acts::GeometryIdentifier{}.setLayer(volNumb).setVolume(chNumb));
85 Acts::ObjVisualization3D
helper;
86 Acts::GeometryView3D::drawDetectorVolume(
helper, *detectorVolume, gctx->
context());
90 detectorVolumeBoundingVolumes.push_back(std::move(detectorVolume));
91 readoutElements.first.clear();
92 readoutElements.second.clear();
94 std::unique_ptr<Acts::CutoutCylinderVolumeBounds> msBounds = std::make_unique<Acts::CutoutCylinderVolumeBounds>(0, 4000, 145000, 220000, 3200);
95 volumePtr msDetectorVolume = Acts::Experimental::DetectorVolumeFactory::construct(
96 portalGenerator, gctx->
context(),
"Envelope",
97 Acts::Transform3::Identity(), std::move(msBounds), surfaces,
98 detectorVolumeBoundingVolumes, Acts::Experimental::tryAllSubVolumes(),
99 Acts::Experimental::tryAllPortalsAndSurfaces());
100 msDetectorVolume->assignGeometryId(Acts::GeometryIdentifier{}.setVolume(15));
104 Acts::ObjVisualization3D
helper;
105 Acts::GeometryView3D::drawDetectorVolume(
helper, *msDetectorVolume, gctx->
context());
106 helper.write(
"detector.obj");
111 Acts::Experimental::DetectorComponent::PortalContainer portalContainer;
112 for (
auto [
ip,
p] : Acts::enumerate(msDetectorVolume->portalPtrs())) {
113 portalContainer[
ip] =
p;
116 return Acts::Experimental::DetectorComponent{
119 {{msDetectorVolume}, Acts::Experimental::tryRootVolumes()}};
◆ constructElements()
Definition at line 122 of file MuonDetectorBuilderTool.cxx.
124 std::vector<volumePtr> readoutDetectorVolumes = {};
125 std::vector<surfacePtr> readoutSurfaces = {};
126 std::pair<std::vector<volumePtr>, std::vector<surfacePtr>> pairElements;
127 Acts::GeometryIdentifier::Value surfId{1};
128 Acts::GeometryIdentifier::Value mdtId{1};
139 std::vector<surfacePtr> surfaces = {};
142 for(
unsigned int lay=1; lay<=mdtReadoutEle->
numLayers(); ++lay){
145 if (!mdtReadoutEle->
isValid(measHash))
continue;
147 surface->assignGeometryId(Acts::GeometryIdentifier{}.setLayer(chId.first).setVolume(chId.second).setBoundary(mdtId).setSensitive(++surfId));
148 surfaces.push_back(surface);
160 Acts::Experimental::MultiWireStructureBuilder::Config mlCfg;
163 mlCfg.mlSurfaces = surfaces;
164 mlCfg.transform = mdtTransform;
166 mlCfg.mlBounds= mdtBounds->values();
167 mlCfg.mlBinning = {Acts::Experimental::ProtoBinning(
Acts::binY, Acts::detail::AxisBoundaryType::Bound,
168 -mdtBounds->values()[1], mdtBounds->values()[1], std::lround(2*mdtBounds->values()[1]/
parameters.tubePitch), 0
u), Acts::Experimental::ProtoBinning(
Acts::binZ, Acts::detail::AxisBoundaryType::Bound,
169 -mdtBounds->values()[2], mdtBounds->values()[2], std::lround(2*mdtBounds->values()[2]/
parameters.tubePitch), 0
u)};
171 Acts::Experimental::MultiWireStructureBuilder mdtBuilder(mlCfg);
173 mdtVolume->assignGeometryId(Acts::GeometryIdentifier{}.setLayer(chId.first).setVolume(chId.second).setBoundary(mdtId++));
176 readoutDetectorVolumes.push_back(mdtVolume);
185 if (!
layer)
continue;
188 rpcSurface->assignGeometryId(Acts::GeometryIdentifier{}.setLayer(chId.first).setVolume(chId.second).setSensitive(++surfId));
189 readoutSurfaces.push_back(rpcSurface);
200 if (!layerPtr)
continue;
203 tgcSurface->assignGeometryId(Acts::GeometryIdentifier{}.setLayer(chId.first).setVolume(chId.second).setSensitive(++surfId));
205 readoutSurfaces.push_back(tgcSurface);
218 stgcSurface->assignGeometryId(Acts::GeometryIdentifier{}.setLayer(chId.first).setVolume(chId.second).setSensitive(++surfId));
220 readoutSurfaces.push_back(stgcSurface);
230 mmSurface->assignGeometryId(Acts::GeometryIdentifier{}.setLayer(chId.first).setVolume(chId.second).setSensitive(++surfId));
232 readoutSurfaces.push_back(mmSurface);
242 pairElements = std::make_pair(readoutDetectorVolumes, readoutSurfaces);
◆ 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]
◆ DeclareInterfaceID()
◆ 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]
◆ detStore()
◆ 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
◆ initialize()
StatusCode ActsTrk::MuonDetectorBuilderTool::initialize |
( |
| ) |
|
|
finaloverride |
Definition at line 45 of file MuonDetectorBuilderTool.cxx.
48 ATH_MSG_DEBUG(
"ACTS version is: v"<< Acts::VersionMajor <<
"." << Acts::VersionMinor <<
"." << Acts::VersionPatch <<
" [" << Acts::CommitHash <<
"]");
50 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.
◆ 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.
◆ 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_detMgr
◆ m_detStore
◆ m_dumpVisual
Gaudi::Property<bool> ActsTrk::MuonDetectorBuilderTool::m_dumpVisual {this, "DumpVisualization", true, "If set to true the DetectorVolumes are dumped into a visualization file format"} |
|
private |
◆ m_evtStore
◆ m_idHelperSvc
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
def retrieve(aClass, aKey=None)
unsigned int numTubesInLay() const
Returns the number of tubes per layer.
Set of parameters to describe a RPC chamber.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
static IdentifierHash measurementHash(unsigned int layerNumber, unsigned int tubeNumber)
Transform the layer and tube number to the measurementHash.
@ Tgc
Resitive Plate Chambers.
The MuonReadoutElement is an abstract class representing the geometry representing the muon detector.
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
GeoModel::TransientConstSharedPtr< MuonGMR4::StripLayer > StripLayerPtr
std::vector< const MuonReadoutElement * > ReadoutSet
std::shared_ptr< Acts::Surface > surfacePtr
#define ATH_MSG_VERBOSE(x)
@ u
Enums for curvilinear frames.
const parameterBook & getParameters() const
Set of parameters to describe a RPC chamber.
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual void setOwner(IDataHandleHolder *o)=0
Acts::GeometryContext context() const
unsigned int multilayer() const
Returns the multi layer of the MdtReadoutElement.
const parameterBook & getParameters() const
@ Mm
Maybe not needed in the migration.
const ReadoutSet & readOutElements() const
Returns the list of all associated readout elements.
Set of parameters to describe a MDT chamber.
const parameterBook & getParameters() const
unsigned int numLayers() const
Returns the number of tube layer.
Set of parameters to describe a Tgc chamber.
Amg::Vector3D center(const ActsGeometryContext &ctx) const
Returns the detector center (Which is the same as the detector center of the first measurement layer)
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Include the GeoPrimitives which need to be put first.
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
const parameterBook & getParameters() const
std::string to_string(const DetectorType &type)
Eigen::Matrix< double, 3, 1 > Vector3D
std::shared_ptr< Acts::Experimental::DetectorVolume > volumePtr
const Amg::Transform3D & localToGlobalTrans(const ActsGeometryContext &gctx) const
Returns the transformation of the MuonChamber.
int stationName() const
Returns the stationName (BIS, BOS, etc) encoded into the integer.
MuonChamberSet getAllChambers() const
: Returns all MuonChambers associated with the readout geometry
std::shared_ptr< Acts::Surface > surfacePtr(const IdentifierHash &hash) const
Returns the pointer associated to a certain wire / plane.
Eigen::Translation< double, 3 > Translation3D
@ Rpc
Monitored Drift Tubes.
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Set of parameters to describe an sTGC chamber.
int stationEta() const
Returns the stationEta (positive A site, negative O site)
const parameterBook & getParameters() const
Amg::Transform3D globalToLocalTrans(const ActsGeometryContext &gctx) const
bool isValid(const IdentifierHash &measHash) const
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
int stationPhi() const
Returns the stationPhi (1-8) -> sector (2*phi - (isSmall))