Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
#include <MuonStationBuilder.h>
|
| MuonStationBuilder (const std::string &, const std::string &, const IInterface *) |
|
virtual | ~MuonStationBuilder ()=default |
|
virtual StatusCode | initialize () override |
|
virtual DetachedVolumeVec | buildDetachedTrackingVolumes (bool blend=false) const override |
|
DetachedVolVec | buildDetachedTrackingVolumesImpl (const MuonGM::MuonDetectorManager *muonMgr, bool blend=false) 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 |
|
| DeclareInterfaceID (IDetachedTrackingVolumeBuilder, 1, 0) |
| Creates the InterfaceID and interfaceID() method. More...
|
|
|
std::vector< std::pair< const GeoVPhysVol *, std::vector< GMInfo > > > | retrieveGMsensitive (const MuonGM::MuonDetectorManager *muonMgr) const |
|
std::unique_ptr< Trk::DetachedTrackingVolume > | buildDetachedTrackingVolumeType (const MuonGM::MuonDetectorManager *muonMgr, const GeoVPhysVol *gv, const GMInfo &info) const |
|
void | glueComponents (Trk::DetachedTrackingVolume *) const |
|
void | encloseLayers (const Trk::DetachedTrackingVolume *) const |
|
void | identifyLayers (Trk::DetachedTrackingVolume *, Identifier, int, int, const MuonGM::MuonDetectorManager *) const |
|
void | identifyNSWLayers (Trk::DetachedTrackingVolume &station, const Identifier &id) const |
|
void | identifyPrototype (Trk::TrackingVolume &station, int eta, int phi, const Amg::Transform3D &transf, const MuonGM::MuonDetectorManager *muonMgr) const |
|
Identifier | resolveId (const std::string &vname, const GMInfo &gm_info, int &eta, int &phi, const MuonGM::MuonDetectorManager *muonMgr) const |
|
void | checkLayerId (std::string_view comment, const MuonGM::MuonDetectorManager *muonMgr, Identifier id, const Trk::Layer *lay) const |
|
void | getNSWStationsForTranslation (const GeoVPhysVol *pv, const std::string &name, const Amg::Transform3D &, std::vector< std::pair< std::pair< const GeoLogVol *, Trk::MaterialProperties * >, std::vector< Amg::Transform3D >>> &vols, std::vector< std::string > &volNames) const |
|
void | renounceArray (SG::VarHandleKeyArray &handlesArray) |
| remove all handles from I/O resolution More...
|
|
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > | renounce (T &h) |
|
void | extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps) |
| Add StoreName to extra input/output deps as needed. More...
|
|
◆ DetachedVolumeVec
◆ DetachedVolVec
◆ GMInfo
◆ StoreGateSvc_t
◆ MuonStationBuilder()
Muon::MuonStationBuilder::MuonStationBuilder |
( |
const std::string & |
t, |
|
|
const std::string & |
n, |
|
|
const IInterface * |
p |
|
) |
| |
Definition at line 8 of file MuonStationBuilder.cxx.
12 declareInterface<Trk::IDetachedTrackingVolumeBuilder>(
this);
◆ ~MuonStationBuilder()
virtual Muon::MuonStationBuilder::~MuonStationBuilder |
( |
| ) |
|
|
virtualdefault |
◆ buildDetachedTrackingVolumes()
◆ buildDetachedTrackingVolumesImpl()
Definition at line 99 of file MuonStationBuilderImpl.cxx.
104 std::vector<std::pair<const GeoVPhysVol*, std::vector<GMInfo>>> stations =
retrieveGMsensitive(muonMgr);
106 for (
const auto& mstation : stations) {
114 std::string
name = mstation.first->getLogVol()->getName();
116 if (
name.substr(0, 4) ==
"sTGC" ||
name.substr(0, 2) ==
"MM") {
117 for (
unsigned int i = 0;
i < mstation.second.size();
i++) {
118 std::string sName =
name.substr(
name.find(
'-') + 1);
122 mstation.second[0].first.inverse());
123 std::unique_ptr<Trk::DetachedTrackingVolume> newStat{msType->
clone(
name, trdef)};
130 translatedStations.push_back(std::move(newStat));
133 for (
auto gminfo : mstation.second) {
135 std::unique_ptr<Trk::DetachedTrackingVolume> newStat{msType->
clone(
name, gminfo.first)};
146 translatedStations.push_back(std::move(newStat));
151 ATH_MSG_DEBUG(
"returns " << translatedStations.size() <<
" stations");
152 return translatedStations;
◆ buildDetachedTrackingVolumeType()
Definition at line 920 of file MuonStationBuilderImpl.cxx.
923 const GeoLogVol* clv = cv->getLogVol();
924 const std::string& vname = clv->getName();
925 ATH_MSG_DEBUG(
name() <<
" building station prototype for " << cv->getLogVol()->getName());
927 MuonStationTypeBuilder::Cache cache{};
929 std::unique_ptr<Trk::DetachedTrackingVolume> typeStat{};
931 if (vname.substr(0, 4) ==
"sTGC" || vname.substr(0, 2) ==
"MM") {
932 std::string sName = vname.substr(vname.find(
'-') + 1);
935 if (vname.substr(0, 4) ==
"sTGC" &&
m_idHelperSvc->issTgc(nswId)) {
937 }
else if (vname.substr(0, 2) ==
"MM" &&
m_idHelperSvc->isMM(nswId)) {
946 if (!
m_buildCsc && vname.compare(0, 1,
"C") == 0)
948 if (!
m_buildTgc && vname.compare(0, 1,
"T") == 0)
951 int etaphi = gmInfo.second;
952 int sign = (etaphi < 0) ? -1 : 1;
953 etaphi =
sign * etaphi;
954 int is_mirr = etaphi / 1000;
955 etaphi = etaphi - is_mirr * 1000;
956 int eta = etaphi / 100;
957 int phi = etaphi -
eta * 100;
965 int etaphi = gmInfo.second;
966 int a_etaphi =
static_cast<int>(etaphi / 100000);
967 int sideC =
static_cast<int>(a_etaphi / 10000);
968 a_etaphi -=
sideC * 10000;
969 is_mirr =
static_cast<int>(a_etaphi / 1000);
970 a_etaphi -= is_mirr * 1000;
971 eta =
static_cast<int>(a_etaphi / 100);
972 phi = a_etaphi -
eta * 100;
978 std::string stname = (vname.compare(0, 1,
"T") == 0) ? vname : (clv->getName()).substr(0, vname.size() - 8);
980 if (stname.compare(0, 1,
"B") == 0 &&
eta < 0) {
981 stname = (clv->getName()).substr(0, vname.size() - 8) +
"-";
983 ATH_MSG_VERBOSE(
" new station type " << stname <<
"," << clv->getShape()->type());
984 ATH_MSG_VERBOSE(
" prototype built from eta, phi:" << eta <<
"," << phi);
986 if (stname.compare(0, 2,
"CS") == 0 || stname.compare(0, 1,
"T") == 0) {
988 if (stname.compare(0, 2,
"CS") == 0) {
993 auto layerVec = std ::make_unique<std::vector<Trk::Layer*>>(
Muon::release(layerRepr.second));
994 typeStat = std::make_unique<Trk::DetachedTrackingVolume>(stname, csc_station.release(),
995 layerRepr.first.release(), layerVec.release());
1001 auto layerVec = std ::make_unique<std::vector<Trk::Layer*>>(
Muon::release(layerRepr.second));
1002 typeStat = std::make_unique<Trk::DetachedTrackingVolume>(stname, tgc_station.release(),
1003 layerRepr.first.release(), layerVec.release());
1007 const GeoShape* shapeS = clv->getShape();
1008 while (shapeS->type() !=
"Trd") {
1009 if (shapeS->type() ==
"Shift") {
1010 const GeoShapeShift* shift =
dynamic_cast<const GeoShapeShift*
>(shapeS);
1011 shapeS = shift->getOp();
1012 }
else if (shapeS->type() ==
"Subtraction") {
1013 const GeoShapeSubtraction* sub =
dynamic_cast<const GeoShapeSubtraction*
>(shapeS);
1014 shapeS = sub->getOpA();
1015 }
else if (shapeS->type() ==
"Union") {
1016 const GeoShapeUnion* uni =
dynamic_cast<const GeoShapeUnion*
>(shapeS);
1017 shapeS = uni->getOpA();
1019 ATH_MSG_WARNING(
"unexpected station shape ? "<< shapeS->type() <<
", station not built");
1023 const GeoTrd* trd =
dynamic_cast<const GeoTrd*
>(shapeS);
1025 double halfX1{0.}, halfX2{0.}, halfY1{0.}, halfY2{0.}, halfZ{0.};
1028 halfX1 = trd->getXHalfLength1();
1029 halfX2 = trd->getXHalfLength2();
1030 halfY1 = trd->getYHalfLength1();
1031 halfY2 = trd->getYHalfLength2();
1032 halfZ = trd->getZHalfLength();
1035 std::unique_ptr<Trk::TrackingVolumeArray> confinedVolumes{};
1036 std::vector<std::unique_ptr<Trk::Layer>> confinedLayers{};
1037 std::unique_ptr<Trk::Volume> envelope;
1038 std::string shape =
"Trd";
1039 if (halfX1 == halfX2 && halfY1 == halfY2)
1041 if (shape ==
"Box") {
1042 auto envBounds = std::make_unique<Trk::CuboidVolumeBounds>(halfX1, halfY1, halfZ);
1045 if (!confinedVolumes) {
1049 envelope = std::make_unique<Trk::Volume>(
nullptr, envBounds.release());
1050 }
else if (shape ==
"Trd") {
1051 std::unique_ptr<Trk::TrapezoidVolumeBounds> envBounds{};
1053 if (halfY1 == halfY2) {
1054 envBounds = std::make_unique<Trk::TrapezoidVolumeBounds>(halfX1, halfX2, halfY1, halfZ);
1055 ATH_MSG_VERBOSE(
"CAUTION!!!: this trapezoid volume does not require XY -> YZ switch");
1057 if (halfY1 != halfY2 && halfX1 == halfX2) {
1059 envBounds = std::make_unique<Trk::TrapezoidVolumeBounds>(halfY1, halfY2, halfZ, halfX1);
1061 if (halfX1 != halfX2 && halfY1 != halfY2) {
1068 envelope = std::make_unique<Trk::Volume>(
makeTransform(transf), envBounds.release());
1074 std::unique_ptr<Trk::TrackingVolume> newType{};
1075 if (!confinedLayers.empty()) {
1076 auto confinedLayerPtr = std::make_unique<std::vector<Trk::Layer*>>(
Muon::release(confinedLayers));
1077 newType = std::make_unique<Trk::TrackingVolume>(*envelope,
m_muonMaterial, confinedLayerPtr.release(), stname);
1079 newType = std::make_unique<Trk::TrackingVolume>(*envelope,
m_muonMaterial,
nullptr, confinedVolumes.release(), stname);
1084 if ((stname.compare(0, 1,
"B") == 0 || stname.compare(0, 1,
"E") == 0))
1091 auto layerVec = std::make_unique<std::vector<Trk::Layer*>>(
Muon::release(layerRepr.second));
1092 typeStat = std::make_unique<Trk::DetachedTrackingVolume>(stname, newType.release(),
1093 layerRepr.first.release(), layerVec.release());
◆ checkLayerId()
◆ 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()
Creates the InterfaceID and interfaceID() method.
◆ 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);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ 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.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ 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.
338 return PBASE::declareProperty(
name, property,
doc);
◆ 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()
◆ encloseLayers()
◆ 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
◆ getNSWStationsForTranslation()
Definition at line 643 of file MuonStationBuilderImpl.cxx.
652 unsigned int nc =
pv->getNChildVols();
654 <<
pv->getLogVol()->getName() <<
","
655 <<
pv->getLogVol()->getMaterial()->getName()
656 <<
", looping over " <<
nc <<
" children");
658 for (
unsigned int ic = 0;
ic <
nc;
ic++) {
660 const GeoVPhysVol* cv =
pv->getChildVol(
ic);
661 const GeoLogVol* clv = cv->getLogVol();
662 std::string childName = clv->getName();
663 ATH_MSG_DEBUG(
"getNSWStationsForTranslation child " << childName);
665 if (childName.empty()) {
666 childName =
"Spacer";
668 if (childName.size() > 9 && childName.substr(childName.size() - 9, 9) ==
"Sensitive") {
672 std::string cName = childName.compare(0, 3,
"NSW") == 0 || childName.compare(0, 8,
"NewSmall") == 0
676 if (!cv->getNChildVols()) {
678 for (
unsigned int is = 0; is < vols.size(); is++) {
679 if (cName == volNames[is]) {
681 vols[is].
second.front().translation().perp()) <
686 double phiTr = (
transform * transf).translation().phi();
687 if (phiTr > -0.001 && phiTr < 0.4) {
688 vols[is].second.insert(vols[is].
second.begin(),
691 vols[is].second.push_back(
transform * transf);
694 << clv->getName() <<
","
695 << (
transform * transf).translation().perp() <<
","
696 << (
transform * transf).translation().z() <<
","
704 std::vector<Amg::Transform3D> volTr;
709 if (
pv->getLogVol()->getMaterial()->getName() !=
"Ether" &&
710 (childName ==
"MM_Frame" || childName ==
"sTGC_Frame")) {
714 pv->getLogVol()->getMaterial());
715 matComb.addMaterial(newMat, thick / newMat.
x0());
717 << matComb.thickness() <<
", "
719 <<
" mat: " << matComb.thicknessInX0());
723 std::pair<const GeoLogVol*, Trk::MaterialProperties*> cpair(
724 pv->getLogVol(), nMat);
725 vols.emplace_back(cpair, volTr);
727 volNames.push_back(cName);
730 << clv->getMaterial()->getName() <<
", "
731 << volTr.back().translation().z() <<
", "
732 << volTr.back().translation().phi()
733 <<
" mat: " << matComb.thicknessInX0());
◆ glueComponents()
Definition at line 155 of file MuonStationBuilderImpl.cxx.
170 if (cubVolBounds && binUtilityX) {
175 if (low >= 0 &&
up >= 0) {
177 for (
unsigned int i = 0;
i < components.size() - 1; ++
i) {
◆ identifyLayers()
Definition at line 185 of file MuonStationBuilderImpl.cxx.
192 const std::string stationStr =
stationName.substr(0, 3);
193 bool is_valid{
false};
197 stationStr, cscEtaSt, phi + 1, 1, 1, 0, 1, is_valid);
202 stationStr, cscEtaSt, phi + 1, 2, 1, 0, 1, is_valid);
207 for (
int gasgap = 0; gasgap < cscRE->
Ngasgaps(); gasgap++) {
221 if (assocVol && assocLay) {
232 }
else if (stationStr[0] ==
'T') {
235 if (stationStr ==
"T1F") {
237 }
else if (stationStr ==
"T1E") {
239 }
else if (stationStr ==
"T2F") {
241 }
else if (stationStr ==
"T2E") {
243 }
else if (stationStr ==
"T3F") {
245 }
else if (stationStr ==
"T3E") {
247 }
else if (stationStr ==
"T4F") {
258 bool is_valid{
false};
260 return is_valid ? muonMgr->getTgcReadoutElement(
id) :
nullptr;
265 unsigned int phit = 0;
293 Identifier wireId = idHelper.channelID(stationStr, etaSt, phiSt, 1, 0, 1, validId);
308 wireId = idHelper.channelID(stationStr, etaSt, phiSt,
il + 1, 1, 1, validId);
318 if ((
layers[
il]->surfaceRepresentation().transform().inverse() * stripSurf->center()).
mag() > 0.001)
319 ATH_MSG_DEBUG(
"TGC strip plane shifted:"<< st <<
"," << eta <<
"," << phi
326 <<
"," << eta <<
"," << phi);
333 const int nameIndex = idHelper.stationNameIndex(
stationName.substr(0, 3));
337 for (
auto* cVol : cVols) {
338 if (cVol->confinedLayers()) {
341 bool is_valid{
false};
343 for (
auto* cLay : cLays) {
346 Identifier newId = idHelper.channelID(nameIndex, eta, phi,
347 idHelper.multilayer(
id),
348 idHelper.tubeLayer(
id),
352 mdtROE = is_valid ? muonMgr->getMdtReadoutElement(newId) :
nullptr;
355 cLay->setLayerType(newid);
358 double ref = cLay->getRef();
362 double loc = (cLay->surfaceRepresentation().transform().inverse() * mdtROE->
tubePos(newId))[1];
363 if (std::abs(
ref) > 10e6) {
364 double sign = (
ref > 0.) ? 1. : -1.;
367 0.5 * (
sign + 1) * 1e5;
368 if (std::abs(
ref - loc) > 0.001) {
369 cLay->setRef(loc + dec * 1e5 + 0.5 * (
sign + 1) * 1e5);
371 }
else if (std::abs(
ref - loc) > 0.001) {
378 if (!cVol->confinedArbitraryLayers().empty()) {
381 for (
auto* cLay : cLays) {
383 bool is_valid{
false};
385 Identifier newId = idHelper.channelID(nameIndex, eta, phi,
386 idHelper.doubletR(
id), idHelper.doubletZ(
id),
387 idHelper.doubletPhi(
id), idHelper.gasGap(
id),
388 1, idHelper.strip(
id),
391 cLay->setLayerType(newid);
402 for (
auto* cVol : cVols) {
403 if (cVol->confinedLayers()) {
405 cVol->confinedLayers()->arrayObjects();
406 for (
unsigned int il = 0;
il < cLays.size();
il++) {
410 <<
"," << cVol->volumeName()
411 <<
", unidentified active layer:" <<
il);
414 " subvolume " + cVol->volumeName(),
415 muonMgr,
id, cLays[
il]);
418 if (!cVol->confinedArbitraryLayers().empty()) {
420 cVol->confinedArbitraryLayers();
421 for (
unsigned int il = 0;
il < cLays.size();
il++) {
425 <<
"," << cVol->volumeName()
426 <<
", unidentified active layer:" <<
il);
429 station->
name() +
" subvolume " +
431 muonMgr,
id, cLays[
il]);
439 for (
unsigned int il = 0;
il < cLays.size();
il++) {
443 <<
"," << station->
name()
444 <<
", unidentified active layer:" <<
il);
447 muonMgr,
id, cLays[
il]);
◆ identifyNSWLayers()
Definition at line 453 of file MuonStationBuilderImpl.cxx.
459 const bool isStgc{station.
name().substr(0, 4) ==
"sTGC"};
460 const bool isMm{station.
name().substr(0, 2) ==
"MM"};
461 if (!isMm && !isStgc)
return;
462 for (
unsigned int il = 0;
il < lays.size();
il++) {
465 const Identifier lid = idHelper.channelID(
id, idHelper.multilayer(
id),
il + 1, 2, 1);
470 const Identifier lid = idHelper.channelID(
id, idHelper.multilayer(
id),
il + 1, 1);
◆ identifyPrototype()
Definition at line 476 of file MuonStationBuilderImpl.cxx.
483 const std::string stationNameShort =
stationName.substr(0, 3);
485 bool is_valid{
false};
487 if (
m_idHelperSvc->hasMDT() && (stationFirstChar ==
'B' || stationFirstChar ==
'E')) {
490 const int nameIndex = idHelper.stationNameIndex(stationNameShort);
492 const Identifier ele_id = idHelper.channelID(nameIndex, eta, phi,
multi, 1, 1, is_valid);
514 assocLay->
setLayerType(
id.get_identifier32().get_compact());
521 if (confinedVolumes) {
523 for (
auto* vol : vols) {
524 if (!
m_idHelperSvc->hasRPC() || vol->volumeName() !=
"RPC") {
530 int nameIndex =
m_idHelperSvc->rpcIdHelper().stationNameIndex(stationNameShort);
532 if (stationNameShort ==
"BME" || stationNameShort ==
"BMG") {
543 if (stationNameShort.find(
"BMS") != std::string::npos && (std::abs(eta) == 2 || std::abs(eta) == 4)) {
546 else if (stationNameShort.find(
"BOG") != std::string::npos) {
547 if (std::abs(eta) == 7 || std::abs(eta) == 8) {
552 }
else if (stationNameShort.find(
"BOF") != std::string::npos && std::abs(eta) == 4){
563 for (
int doubletZ = 1; doubletZ <= doubletZMax; ++doubletZ) {
582 if (
layer->layerType() == 0 ||
583 !
layer->surfaceRepresentation().isOnSurface(stripLocPos,
false, 0.5*
layer->thickness())){
586 const Amg::Vector3D locPos1 =
layer->surfaceRepresentation().transform().inverse() * stripLocPos;
589 double swap = (std::abs(locPos1[1] - locPos2[0]) > 0.001) ? 20000. : 0.;
610 for (
auto* cVol : cVols) {
611 if (cVol->confinedLayers()) {
613 for (
unsigned int il = 0;
il < cLays.size();
il++) {
620 if (!cVol->confinedArbitraryLayers().empty()) {
622 for (
unsigned int il = 0;
il < cLays.size();
il++) {
633 for (
unsigned int il = 0;
il < cLays.size();
il++) {
◆ initialize()
StatusCode Muon::MuonStationBuilder::initialize |
( |
| ) |
|
|
overridevirtual |
◆ 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()
◆ resolveId()
Definition at line 1104 of file MuonStationBuilderImpl.cxx.
1109 int etaphi = gm_info.second;
1110 int sign = (etaphi < 0) ? -1 : 1;
1111 etaphi =
sign * etaphi;
1112 int is_mirr = etaphi / 1000;
1113 etaphi = etaphi - is_mirr * 1000;
1115 phi = etaphi -
eta * 100;
1125 int etaphi = gm_info.second;
1126 int a_etaphi =
static_cast<int>(etaphi / 100000);
1127 int sideC =
static_cast<int>(a_etaphi / 10000);
1128 a_etaphi -=
sideC * 10000;
1129 is_mirr =
static_cast<int>(a_etaphi / 1000);
1130 a_etaphi -= is_mirr * 1000;
1131 eta =
static_cast<int>(a_etaphi / 100);
1132 phi = a_etaphi -
eta * 100;
1139 ATH_MSG_WARNING(
"Muon station not found! " << vname <<
"," << eta <<
","
1143 if (vname.compare(0, 1,
"T") == 0 || vname.compare(0, 1,
"C") == 0) {
1144 stName = vname.substr(0, 4);
1146 stName = (vname.substr(0, vname.size() - 8));
1147 if (stName.compare(0, 1,
"B") == 0 &&
eta < 0) {
1148 stName = vname.substr(0, vname.size() - 8) +
"-";
1154 bool is_valid{
false};
1155 if (
m_idHelperSvc->hasCSC() && stName.compare(0, 1,
"C") == 0) {
1160 if (vname.compare(0, 1,
"C") == 0) {
1162 if (transf.translation().z() < 0)
1164 double phic = transf.translation().phi() + 0.1;
1166 static_cast<int>(phic < 0 ? 4 * phic /
M_PI + 8 : 4 * phic /
M_PI);
1168 if (vname.compare(0, 1,
"T") == 0) {
1170 std::string sub = vname.substr(7, 2);
1171 if (transf.translation().z() < 0)
1175 else if (sub ==
"02")
1177 else if (sub ==
"03")
1179 else if (sub ==
"04")
1181 else if (sub ==
"05")
1183 else if (sub ==
"06")
1185 else if (sub ==
"07")
1187 else if (sub ==
"08")
1189 else if (sub ==
"09")
1191 else if (sub ==
"10")
1193 else if (sub ==
"11")
1195 else if (sub ==
"12")
1197 else if (sub ==
"13")
1199 else if (sub ==
"14")
1201 else if (sub ==
"15")
1203 else if (sub ==
"16")
1205 else if (sub ==
"17")
1207 else if (sub ==
"18")
1209 else if (sub ==
"19")
1211 else if (sub ==
"20")
1213 else if (sub ==
"21")
1215 else if (sub ==
"22")
1219 int etaSt =
eta - 4;
1222 double phic = transf.translation().phi();
1223 if (vname.compare(2, 1,
"E") == 0 && vname.compare(0, 3,
"T4E") != 0)
1224 phi =
static_cast<int>(phic < 0 ? 24 * phic /
M_PI + 48
1225 : 24 * phic /
M_PI);
1227 phi =
static_cast<int>(phic < 0 ? 12 * phic /
M_PI + 24
1228 : 12 * phic /
M_PI);
1230 stId =
m_idHelperSvc->tgcIdHelper().elementID(vname.substr(0, 3), etaSt,
1232 }
else if (
m_idHelperSvc->hasRPC() && stName.compare(0, 3,
"BML") == 0) {
1235 }
else if (
m_idHelperSvc->hasMDT() && stName.compare(0, 1,
"C") != 0) {
1239 if (!is_valid || !stId.get_compact()) {
1241 << vname <<
"," << eta <<
"," << phi);
1242 if (!stId.get_compact())
◆ retrieveGMsensitive()
Definition at line 745 of file MuonStationBuilderImpl.cxx.
749 std::vector<std::pair<
const GeoVPhysVol*,
750 std::vector<GMInfo>>> sensitive;
758 if (sTGC_top && sTGC_top !=
top) {
759 ATH_MSG_DEBUG(
"sTGC GeoModel branch found:" << sTGC_top->getLogVol()->getName());
760 GeoVolumeCursor vol(sTGC_top);
761 while (!vol.atEnd()) {
762 const GeoVPhysVol* cv = vol.getVolume();
763 const std::string& vname = cv->getLogVol()->getName();
764 if (vname.find(
"sTGC_1") == std::string::npos) {
768 std::vector<std::pair<
const GeoVPhysVol*,
771 while (
it < sensitive.end()) {
772 if (vname == (*it).first->getLogVol()->getName() &&
778 if (
it == sensitive.end()) {
779 std::vector<std::pair<Amg::Transform3D, int>> cloneList;
780 cloneList.emplace_back(vol.getTransform(), 0);
781 sensitive.emplace_back(cv, cloneList);
785 double phiTr = transf.translation().phi();
786 if (phiTr > -0.001 && phiTr < 0.4)
787 (*it).second.insert((*it).second.begin(),
788 std::make_pair(vol.getTransform(), 0));
790 (*it).second.emplace_back(vol.getTransform(), 0);
796 if (MM_top && MM_top !=
top) {
797 ATH_MSG_DEBUG(
"MM GeoModel branch found:" << MM_top->getLogVol()->getName());
798 GeoVolumeCursor vol(MM_top);
799 while (!vol.atEnd()) {
800 const GeoVPhysVol* cv = vol.getVolume();
801 const std::string& vname = cv->getLogVol()->getName();
802 if (vname.find(
"MM_1") == std::string::npos) {
806 std::vector<std::pair<
const GeoVPhysVol*,
809 while (
it < sensitive.end()) {
810 if (vname == (*it).first->getLogVol()->getName() &&
816 if (
it == sensitive.end()) {
817 std::vector<std::pair<Amg::Transform3D, int>> cloneList;
818 cloneList.emplace_back(vol.getTransform(), 0);
819 sensitive.emplace_back(cv, cloneList);
823 double phiTr = transf.translation().phi();
824 if (phiTr > -0.001 && phiTr < 0.4)
825 (*it).second.insert((*it).second.begin(), std::make_pair(vol.getTransform(), 0));
827 (*it).second.emplace_back(vol.getTransform(), 0);
833 GeoVolumeCursor vol(
top);
834 while (!vol.atEnd()) {
835 const GeoVPhysVol* cv = &(*(vol.getVolume()));
836 const std::string& vname = cv->getLogVol()->getName();
837 if (vname.find(
"Station") == std::string::npos &&
838 vname.find(
"MM_1") == std::string::npos &&
839 vname.find(
"sTGC_1") == std::string::npos) {
845 if (vname.substr(0, 1) ==
"T") {
848 const GeoLogVol* tlv = tv->getLogVol();
850 const std::string& tgc_name = tlv->getName();
852 std::vector<std::pair<
const GeoVPhysVol*,
855 while (
it < sensitive.end()) {
856 if (tgc_name == (*it).first->getLogVol()->getName() &&
863 if (
it == sensitive.end()) {
864 std::vector<std::pair<Amg::Transform3D, int>> cloneList;
865 cloneList.emplace_back(
transform, vol.getId().value());
866 sensitive.emplace_back(tv, cloneList);
870 double phiTr = transf.translation().phi();
871 if (phiTr > -0.001 && phiTr < 0.4) {
872 (*it).second.insert((*it).second.begin(),
873 std::make_pair(
transform, vol.getId().value()));
876 (*it).second.emplace_back(
transform, vol.getId().value());
884 std::vector<std::pair<
const GeoVPhysVol*,
887 while (
it < sensitive.end()) {
888 if (vname == (*it).first->getLogVol()->getName() &&
894 if (
it == sensitive.end()) {
895 std::vector<std::pair<Amg::Transform3D, int>> cloneList;
896 cloneList.emplace_back(vol.getTransform(), vol.getId().value());
897 sensitive.emplace_back(cv, cloneList);
901 double phiTr = transf.translation().phi();
902 if (phiTr > -0.001 && phiTr < 0.4) {
903 (*it).second.insert((*it).second.begin(),
904 std::make_pair(vol.getTransform(), vol.getId().value()));
907 (*it).second.emplace_back(vol.getTransform(), vol.getId().value());
914 ATH_MSG_DEBUG(
"Number of muon station types in GeoModel tree:" << sensitive.size());
◆ 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_buildBarrel
Gaudi::Property<bool> Muon::MuonStationBuilderImpl::m_buildBarrel {this, "BuildBarrelStations", true} |
|
protectedinherited |
◆ m_buildCsc
Gaudi::Property<bool> Muon::MuonStationBuilderImpl::m_buildCsc {this, "BuildCSCStations", true} |
|
protectedinherited |
◆ m_buildEndcap
Gaudi::Property<bool> Muon::MuonStationBuilderImpl::m_buildEndcap {this, "BuildEndcapStations", true} |
|
protectedinherited |
◆ m_buildTgc
Gaudi::Property<bool> Muon::MuonStationBuilderImpl::m_buildTgc {this, "BuildTGCStations", true} |
|
protectedinherited |
◆ m_detStore
◆ m_evtStore
◆ m_gmBrowser
◆ m_idHelperSvc
Initial value:{
this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
Definition at line 56 of file MuonStationBuilderImpl.h.
◆ m_materialConverter
◆ m_muonMaterial
◆ m_muonMgr
◆ m_muonStationTypeBuilder
Initial value:{
this, "StationTypeBuilder",
"Muon::MuonStationTypeBuilder/"
"MuonStationTypeBuilder"}
Helper Tool to create TrackingVolume Arrays.
Definition at line 91 of file MuonStationBuilderImpl.h.
◆ m_trackingVolumeHelper
Initial value:{
this, "TrackingVolumeHelper",
"Trk::TrackingVolumeHelper/TrackingVolumeHelper"}
Helper Tool to create TrackingVolumes.
Definition at line 98 of file MuonStationBuilderImpl.h.
◆ m_varHandleArraysDeclared
◆ m_vhka
◆ m_volumeConverter
The documentation for this class was generated from the following files:
def retrieve(aClass, aKey=None)
JetConstituentVector::iterator iterator
const RpcReadoutElement * getRpcReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
GeoVolumeVec_t geoGetVolumes(const GeoGraphNode *node, int depthLimit=1, int sizeHint=20)
Return the child volumes and associated transforms.
void setRef(double)
set the reference measure
void checkLayerId(std::string_view comment, const MuonGM::MuonDetectorManager *muonMgr, Identifier id, const Trk::Layer *lay) const
Amg::Transform3D * makeTransform(const Amg::Transform3D &trf)
constexpr uint8_t stationPhi
station Phi 1 to 8
virtual const Amg::Transform3D & transform() const override
Return local to global transform.
int getNLayers() const
Returns the number of tube layers inside the multilayer.
virtual const BinUtility * binUtility() const =0
Return the BinUtility.
void setLayerType(int identifier)
set the Layer coding
virtual const Amg::Vector3D & center(const Identifier &) const override final
Return the center of the surface associated with this identifier In the case of silicon it returns th...
virtual const Amg::Vector3D & center() const override
Return the center of the element.
Scalar perp() const
perp method - perpenticular length
bool inside(const Amg::Vector3D &gp, double tol=0.) const
Inside() method for checks.
Trk::GMTreeBrowser m_gmBrowser
const TrackingVolume * trackingVolume() const
returns the TrackingVolume
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
void identifyPrototype(Trk::TrackingVolume &station, int eta, int phi, const Amg::Transform3D &transf, const MuonGM::MuonDetectorManager *muonMgr) const
void identifyNSWLayers(Trk::DetachedTrackingVolume &station, const Identifier &id) const
Amg::Transform3D getTransform() const
Identifier resolveId(const std::string &vname, const GMInfo &gm_info, int &eta, int &phi, const MuonGM::MuonDetectorManager *muonMgr) const
const TrackingVolume * associatedSubVolume(const Amg::Vector3D &gp) const
Return the associated sub Volume, returns THIS if no subVolume exists.
Gaudi::Property< bool > m_buildTgc
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)
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
std::vector< SG::VarHandleKeyArray * > m_vhka
An RpcReadoutElement corresponds to a single RPC module; therefore typicaly a barrel muon station con...
#define ATH_MSG_VERBOSE(x)
bool isValid(const T &p)
Av: we implement here an ATLAS-sepcific convention: all particles which are 99xxxxx are fine.
std::vector< std::pair< const GeoVPhysVol *, std::vector< GMInfo > > > retrieveGMsensitive(const MuonGM::MuonDetectorManager *muonMgr) const
const Amg::Vector3D & center() const
Returns the center position of the Surface.
virtual const Trk::PlaneSurface & surface() const override
access to chamber surface (phi orientation), uses the first gas gap
value_type get_compact() const
Get the compact id.
virtual unsigned int arrayObjectsNumber() const =0
Number of Entries in the Array.
int layerType() const
get the Layer coding
Amg::Vector3D channelPos(const Identifier &id) const
Returns the position of the active channel (wireGang or strip)
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual void setOwner(IDataHandleHolder *o)=0
Amg::Transform3D getRotateZ3D(double angle)
get a rotation transformation around Z-axis
const LayerArray * confinedLayers() const
Return the subLayer array.
const TgcReadoutElement * getTgcReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
virtual StatusCode initialize() override
int compareGeoVolumes(const GeoVPhysVol *gv1, const GeoVPhysVol *gv2, double tolerance, bool printFullInfo=false, int level=0) const
Recursive comparison of trees/branches/volumes : in quiet mode (printFullInfo=False) ,...
virtual bool isOnSurface(const Amg::Vector3D &glopo, const BoundaryCheck &bchk=true, double tol1=0., double tol2=0.) const
This method returns true if the GlobalPosition is on the Surface for both, within or without check of...
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
virtual const Surface & surfaceRepresentation() const =0
Transforms the layer into a Surface representation for extrapolation.
void glueComponents(Trk::DetachedTrackingVolume *) const
const MdtReadoutElement * getMdtReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
ToolHandle< Muon::MuonStationTypeBuilder > m_muonStationTypeBuilder
Helper Tool to create TrackingVolume Arrays.
const CscReadoutElement * getCscReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
const std::string & geometryVersion() const
it can be Rome-Initial or P03, or ...
CalibratedSpacePoint::Covariance_t inverse(const CalibratedSpacePoint::Covariance_t &mat)
Inverts the parsed matrix.
Eigen::Affine3d Transform3D
bool doesNotDeform(const Amg::Transform3D &trans)
Checks whether the linear part of the transformation rotates or stetches any of the basis vectors.
std::unique_ptr< Trk::DetachedTrackingVolume > buildDetachedTrackingVolumeType(const MuonGM::MuonDetectorManager *muonMgr, const GeoVPhysVol *gv, const GMInfo &info) const
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
A TgcReadoutElement corresponds to a single TGC chamber; therefore typically a TGC station contains s...
ToolHandle< Trk::ITrackingVolumeHelper > m_trackingVolumeHelper
Helper Tool to create TrackingVolumes.
static const GeoVPhysVol * findTopBranch(const GeoVPhysVol *gv, std::string_view name)
search of top branch : returns mother volume for children matching name
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
static constexpr int NTgcStEtaOffset
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
DetachedTrackingVolume * clone(const std::string &name, Amg::Transform3D &shift) const
clone with transform
static constexpr int NCscStEtaOffset
Identifier <-> AMDB conversion constants in use.
const std::string & volumeName() const
Returns the VolumeName - for debug reason, might be depreciated later.
Identifier channelID(int stationName, int stationEta, int stationPhi, int chamberLayer, int wireLayer, int measuresPhi, int strip) const
std::string to_string(const DetectorType &type)
void getNSWStationsForTranslation(const GeoVPhysVol *pv, const std::string &name, const Amg::Transform3D &, std::vector< std::pair< std::pair< const GeoLogVol *, Trk::MaterialProperties * >, std::vector< Amg::Transform3D >>> &vols, std::vector< std::string > &volNames) const
const MuonGM::MuonDetectorManager * m_muonMgr
Amg::Vector3D stripPos(const Identifier &id) const
virtual BinnedArraySpan< T *const > arrayObjects()=0
Return all objects of the Array non-const we can still modify the T.
const std::string & name() const
returns the Name
Amg::Transform3D getRotateY3D(double angle)
get a rotation transformation around Y-axis
Eigen::Matrix< double, 3, 1 > Vector3D
virtual int numberOfLayers(bool measphi=true) const override final
number of layers in phi/eta projection, same for eta/phi planes
const MuonStation * getMuonStation(const std::string &stName, int eta, int phi) const
Gaudi::Property< bool > m_buildEndcap
Amg::Vector3D tubePos(const Identifier &id) const
Returns the global position of the given tube.
#define ATH_MSG_WARNING(x)
const boost::regex ref(r_ef)
const TrackingVolumeArray * confinedVolumes() const
Return the subLayer array.
Identifier identify() const override final
Returns the ATLAS Identifier of the MuonReadOutElement.
unsigned constexpr int sideC
virtual PVConstLink getTreeTop(unsigned int i) const
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
const Layer * layerRepresentation() const
returns layer representation
Trk::Material m_muonMaterial
the material
DetachedVolVec buildDetachedTrackingVolumesImpl(const MuonGM::MuonDetectorManager *muonMgr, bool blend=false) const
Gaudi::Property< bool > m_buildCsc
const CscIdHelper * cscIdHelper() const
virtual const Amg::Transform3D & transform(const Identifier &id) const override final
Return local to global transform associated with this identifier.
constexpr uint8_t stationEta
1 to 3
static constexpr int NTgcStatTypeOff
const Layer * associatedLayer(const Amg::Vector3D &gp) const
Return the associated Layer.
const Amg::Transform3D & transform() const
Returns HepGeom::Transform3D by reference.
std::span< T > BinnedArraySpan
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
void identifyLayers(Trk::DetachedTrackingVolume *, Identifier, int, int, const MuonGM::MuonDetectorManager *) const
Scalar mag() const
mag method
std::vector< ObjType * > release(std::vector< std::unique_ptr< ObjType >> &objVec)
Gaudi::Property< bool > m_buildBarrel
int getStationPhi() const
int getStationEta() const
std::vector< std::unique_ptr< Trk::DetachedTrackingVolume > > DetachedVolVec