![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
14 GeoModelsTgcTest::GeoModelsTgcTest(
const std::string&
name, ISvcLocator* pSvcLocator):
26 if (testCham.size() != 6) {
28 return StatusCode::FAILURE;
31 std::string statName = testCham.substr(0, 3);
32 unsigned int statEta =
std::atoi(testCham.substr(3, 1).c_str()) *
33 (testCham[4] ==
'A' ? 1 : -1);
34 unsigned int statPhi =
std::atoi(testCham.substr(5, 1).c_str());
36 const Identifier eleId = id_helper.elementID(statName, statEta, statPhi, is_valid);
38 ATH_MSG_FATAL(
"Failed to deduce a station name for " << testCham);
39 return StatusCode::FAILURE;
42 id_helper.detectorElement_end(),
44 [&](
const Identifier&
id) {
45 return id_helper.elementID(id) == eleId;
50 std::copy(id_helper.detectorElement_begin(),
51 id_helper.detectorElement_end(),
54 std::stringstream sstr{};
58 ATH_MSG_INFO(
"Test only the following stations "<<std::endl<<sstr.str());
61 return StatusCode::SUCCESS;
65 return StatusCode::SUCCESS;
68 const EventContext& ctx{Gaudi::Hive::currentContext()};
85 return StatusCode::FAILURE;
92 for (
Amg::Vector3D axis :{Amg::Vector3D::UnitX(),Amg::Vector3D::UnitY(),Amg::Vector3D::UnitZ()}) {
93 const double closure_mag = std::abs( (transClosure*
axis).
dot(
axis) - 1.);
94 if (closure_mag > std::numeric_limits<float>::epsilon() ) {
97 return StatusCode::FAILURE;
102 for (
int chType = sTgcIdHelper::sTgcChannelTypes::Pad;
chType <= sTgcIdHelper::sTgcChannelTypes::Wire; ++
chType) {
103 unsigned int numChannel = 0;
104 bool isValidLay{
false};
105 const Identifier layID = id_helper.channelID(reElement->
identify(),
112 case sTgcIdHelper::sTgcChannelTypes::Pad:
113 numChannel = reElement->
numPads(layID);
116 case sTgcIdHelper::sTgcChannelTypes::Strip:
117 numChannel = reElement->
numStrips(layID);
120 case sTgcIdHelper::sTgcChannelTypes::Wire:
125 bool isValidCh{
false};
126 const Identifier chID = id_helper.channelID(reElement->
identify(),
134 const IdentifierHash layHash = reElement->
layerHash(chID);
136 <<
" --> layerHash: "<<
static_cast<unsigned>(layHash));
137 const Identifier backCnv = reElement->
measurementId(measHash);
138 if (backCnv != chID) {
141 return StatusCode::FAILURE;
143 if (layHash != reElement->
layerHash(measHash)) {
144 ATH_MSG_FATAL(
"Constructing the layer hash from the identifier "<<
145 m_idHelperSvc->toString(chID)<<
" leads to different layer hashes "<<
146 layHash<<
" vs. "<< reElement->
layerHash(measHash));
147 return StatusCode::FAILURE;
149 if (
chType == sTgcIdHelper::sTgcChannelTypes::Strip) {
153 else if (
chType == sTgcIdHelper::sTgcChannelTypes::Wire) {
157 else if (
chType == sTgcIdHelper::sTgcChannelTypes::Pad) {
166 return StatusCode::SUCCESS;
193 for (
int chType = sTgcIdHelper::sTgcChannelTypes::Pad;
chType <= sTgcIdHelper::sTgcChannelTypes::Wire; ++
chType) {
194 unsigned int numWireGroup = 0;
196 bool isValidLay{
false};
197 const Identifier layID = id_helper.channelID(reElement->
identify(),
212 case sTgcIdHelper::sTgcChannelTypes::Pad:
222 for (
unsigned int pad = 1; pad <= reElement->
numPads(layID); ++pad) {
223 bool isValidPad{
false};
224 const Identifier padID = id_helper.channelID(reElement->
identify(),
230 <<
" layer: "<<
layer<<
" pad: "<<pad<<
" channelType: "<<
chType);
235 std::array<Amg::Vector2D,4> localPadCorners{make_array<Amg::Vector2D, 4>(
Amg::Vector2D::Zero())};
237 std::array<Amg::Vector3D,4> globalPadCorners{make_array<Amg::Vector3D, 4>(
Amg::Vector3D::Zero())};
266 if (pad != 1)
continue;
275 case sTgcIdHelper::sTgcChannelTypes::Strip:
279 for (
unsigned int strip = 1; strip <= reElement->
numStrips(layID); ++strip) {
280 bool isValidStrip{
false};
281 const Identifier stripID = id_helper.channelID(reElement->
identify(),
287 <<
" layer: "<<
layer<<
" strip: "<<strip<<
" channelType: "<<
chType);
296 if (strip != 1)
continue;
305 case sTgcIdHelper::sTgcChannelTypes::Wire:
314 std::cout <<
"The number of wire groups are:" << numWireGroup << std::endl;
315 for (
unsigned int wireGroup = 1; wireGroup <= numWireGroup; ++wireGroup) {
316 bool isValidWire{
false};
317 const Identifier wireGroupID = id_helper.channelID(reElement->
identify(),
323 <<
" layer: "<<
layer<<
" wireGroup: "<<wireGroup<<
" channelType: "<<
chType);
331 if (wireGroup != 1)
continue;
341 return m_tree.
fill(ctx) ? StatusCode::SUCCESS : StatusCode::FAILURE;
Amg::Vector2D localChannelPosition(const Identifier &measId) const
Returns the local pad/strip/wireGroup position.
def retrieve(aClass, aKey=None)
double yCutout(const Identifier &measId) const
Returns the yCutout value of the chamber.
sTgcIdHelper::sTgcChannelTypes chType
MuonVal::ScalarBranch< float > & m_wireWidth
int multilayer() const
Returns the multilayer of the sTgcReadoutElement.
MuonVal::ScalarBranch< float > & m_lChamberLength
double padHeight(const Identifier &measId) const
Returns the height of all the pads that are not adjacent to the bottom edge of the trapezoid active a...
MuonVal::VectorBranch< int > & m_padNumber
unsigned int padEta(const Identifier &measId) const
Returns the Eta index of the pad for the given pad identifier.
MuonVal::VectorBranch< float > & m_stripLengths
MuonVal::VectorBranch< uint8_t > & m_padRotGasGap
StatusCode init(OWNER *instance)
Initialize method.
MuonVal::VectorBranch< uint8_t > & m_wireGroupRotGasGap
MuonVal::MuonTesterTree m_tree
unsigned int numPadEta(const Identifier &measId) const
Returns the number of pads in the eta direction in the given layer.
Gaudi::Property< std::vector< std::string > > m_selectStat
String should be formated like <stationName><stationEta><A/C><stationPhi>
MuonVal::ThreeVectorBranch m_globalPadCornerTL
Eigen::Matrix< double, 2, 1 > Vector2D
MuonVal::TwoVectorBranch m_localPadPos
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
unsigned int numPadPhi(const Identifier &measId) const
Returns the number of pads in the Phi direction in the given gasGap layer.
std::string chamberDesign() const
The chamber design refers to the construction parameters of a readout element.
MuonVal::TwoVectorBranch m_localPadCornerBL
MuonVal::VectorBranch< uint8_t > & m_wireGroupNum
MuonVal::TwoVectorBranch m_hitPosition
MuonVal::VectorBranch< float > & m_padPhiShift
MuonVal::VectorBranch< uint > & m_firstWireGroupWidth
MuonVal::ThreeVectorBranch m_globalPadCornerBL
MuonVal::VectorBranch< uint > & m_numPadEta
MuonVal::CoordSystemsBranch m_padRot
Rotation matrix of the respective pad layers.
MuonVal::ScalarBranch< float > & m_sPadLength
MuonVal::VectorBranch< uint8_t > & m_wireGroupGasGap
double stripLength(const Identifier &measId) const
Length of each strip.
Amg::Transform3D globalToLocalTrans(const ActsGeometryContext &ctx) const
Transformations to translate between local <-> global coordinates.
#define ATH_MSG_VERBOSE(x)
MuonVal::ScalarBranch< short > & m_stIndex
Identifier of the readout element.
double sPadLength(const Identifier &measId) const
Length of gas Gap on short side for wireGroup/Pads.
StatusCode initialize() override
unsigned int padNumber(const Identifier &measId) const
Returns the pad number in the conventional pad numbering scheme from the sequential channel number.
MuonVal::ScalarBranch< short > & m_stPhi
MuonVal::ThreeVectorBranch m_globalPadCornerBR
IdentifierHash measurementHash(const Identifier &measId) const override final
Constructs the identifier hash from the full measurement Identifier.
double chamberHeight() const
Height of the chamber.
MuonVal::ScalarBranch< float > & m_sChamberLength
Chamber Length for debug.
MuonVal::ScalarBranch< float > & m_yCutout
double firstPadPhiDiv(const Identifier &measId) const
Returns the angle of the first pad outer edge w.r.t. the gasGap center from the beamline for the give...
MuonVal::VectorBranch< float > & m_padHeight
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
MuonVal::ScalarBranch< float > & m_gasTck
MuonVal::ScalarBranch< float > & m_stripPitch
double padPhiShift(const Identifier &measId) const
Returns the staggering shift of inner pad edges in the phi direction.
MuonVal::VectorBranch< uint > & m_numWireGroups
void push_back(const Amg::Vector3D &vec)
interface using the Amg::Vector3D
MuonVal::ScalarBranch< float > & m_lGapLength
SG::ReadHandleKey< ActsGeometryContext > m_geoCtxKey
StatusCode dumpToTree(const EventContext &ctx, const ActsGeometryContext &gctx, const sTgcReadoutElement *readoutEle)
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
MuonVal::CoordTransformBranch m_readoutTransform
Transformation of the readout element (Translation, ColX, ColY, ColZ)
A muon chamber is a collection of readout elements belonging to the same station.
MuonVal::VectorBranch< uint8_t > & m_stripRotGasGap
void push_back(const Amg::Vector2D &vec)
interface using the Amg::Vector3D
unsigned int numWireGroups(unsigned int gasGap) const
Number of wire groups in the gas gap.
MuonVal::VectorBranch< uint > & m_stripNum
::StatusCode StatusCode
StatusCode definition for legacy code.
MuonVal::VectorBranch< float > & m_firstPadPhiDiv
MuonVal::ScalarBranch< float > & m_stripWidth
MuonVal::CoordSystemsBranch m_wireGroupRot
Rotation matrix of the respective wireGroup layers.
MuonVal::ScalarBranch< float > & m_gapHeight
Eigen::Affine3d Transform3D
MuonVal::CoordTransformBranch m_alignableNode
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
MuonVal::VectorBranch< uint > & m_numPads
Pad dimensions.
double gapHeight(const Identifier &measId) const
Height of gas Gap.
MuonVal::CoordSystemsBranch m_stripRot
Rotation matrix of the respective strip layers.
MuonVal::VectorBranch< uint > & m_padEta
MuonVal::ScalarBranch< float > & m_beamlineRadius
MuonVal::ScalarBranch< short > & m_stEta
MuonVal::VectorBranch< uint > & m_numWires
MuonVal::TwoVectorBranch m_localPadCornerBR
Out copy_if(In first, const In &last, Out res, const Pred &p)
MuonVal::VectorBranch< uint8_t > & m_padGasGap
MuonVal::TwoVectorBranch m_localStripPos
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
MuonVal::ScalarBranch< float > & m_lPadLength
Identifier measurementId(const IdentifierHash &measHash) const override final
Converts the measurement hash back to the full Identifier.
def dot(G, fn, nodesToHighlight=[])
MuonVal::ThreeVectorBranch m_globalPadPos
Include the GeoPrimitives which need to be put first.
double beamlineRadius(const Identifier &measId) const
Returns the distance between the gasGap center and the beamline.
const MuonDetectorManager * m_detMgr
MuonVal::VectorBranch< float > & m_firstPadHeight
void push_back(const T &value)
Adds a new element at the end of the vector.
MuonVal::ThreeVectorBranch m_globalWireGroupPos
double sChamberLength() const
Length of the chamber on the short side.
std::set< Identifier > m_testStations
Set of stations to be tested.
Amg::Vector3D globalChannelPosition(const ActsGeometryContext &ctx, const Identifier &measId) const
Returns the global pad/strip/wireGroup position.
double lChamberLength() const
Length of the chamber on the long side.
double gasGapThickness() const
Returns the thickness of the gas gap.
const GeoAlignableTransform * alignableTransform() const
Returnsthe alignable transform of the readout element.
unsigned int wireGroupWidth(unsigned int gasGap) const
Number of wires in a normal wire group.
double sGapLength(const Identifier &measId) const
Length of gas Gap on short side for strips.
Identifier identify() const override final
Return the athena identifier.
MuonVal::ScalarBranch< uint > & m_wireGroupWidth
MuonVal::VectorBranch< uint > & m_padPhi
MuonVal::ScalarBranch< float > & m_anglePadPhi
MuonVal::ScalarBranch< float > & m_wirePitch
Eigen::Matrix< double, 3, 1 > Vector3D
MuonVal::VectorBranch< uint8_t > & m_stripGasGap
unsigned int numWires(unsigned int gasGap) const
Number of wires in the gas gap.
MuonVal::ScalarBranch< float > & m_chamberHeight
MuonVal::VectorBranch< float > & m_wireCutout
unsigned int numLayers() const
Returns the number of gas gap layers.
MuonVal::ScalarBranch< uint > & m_numStrips
Strip dimensions.
unsigned int padPhi(const Identifier &measId) const
Returns the Phi index of the pad for the given pad identifier.
MuonVal::TwoVectorBranch m_localPadCornerTL
MuonVal::ScalarBranch< short > & m_numLayers
unsigned int firstWireGroupWidth(unsigned int gasGap) const
Number of wires in the first wire group.
double stripWidth(const Identifier &measId) const
Width of a strip.
int stationName() const
Returns the stationName (BIS, BOS, etc) encoded into the integer.
double anglePadPhi(const Identifier &measId) const
Returns the angular pitch of the pads in the phi direction.
#define ATH_MSG_WARNING(x)
double wireCutout(unsigned int gasGap) const
Wire Cutout of a gas Gap.
globalCornerArray globalPadCorners(const ActsGeometryContext &ctx, const Identifier &measId) const
void push_back(const Amg::Transform3D &trans)
localCornerArray localPadCorners(const Identifier &measId) const
MuonVal::ScalarBranch< float > & m_sGapLength
GasGap Lengths for debug.
bool fill(const EventContext &ctx)
Fills the tree per call.
MuonVal::ThreeVectorBranch m_globalPadCornerTR
unsigned int numPads(const Identifier &measId) const
Pads Total number of pads in the given layer.
unsigned int numStrips(const Identifier &measId) const
Strips Number of strips in a chamber.
const Amg::Transform3D & localToGlobalTrans(const ActsGeometryContext &ctx) const
Returns the local to global transformation into the ATLAS coordinate system.
StatusCode write()
Finally write the TTree objects.
double lGapLength(const Identifier &measId) const
Length of gas Gap on long side for strips.
int atoi(std::string_view str)
Helper functions to unpack numbers decoded in string into integers and doubles The strings are requir...
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
MuonVal::TwoVectorBranch m_localWireGroupPos
double wirePitch(const Identifier &measId) const
Wires Pitch of the wire.
StatusCode finalize() override
int stationEta() const
Returns the stationEta (positive A site, negative O site)
MuonVal::ScalarBranch< short > & m_stML
double lPadLength(const Identifier &measId) const
Length of gas Gap on long side for wireGroup/Pads.
IdentifierHash layerHash(const Identifier &measId) const override final
Transforms the Identifier into a layer hash.
StatusCode execute() override
MuonVal::ScalarBranch< std::string > & m_chamberDesign
int stationPhi() const
Returns the stationPhi (1-8) -> sector (2*phi - (isSmall))
double firstPadHeight(const Identifier &measId) const
Returns the height of the pads that are adjacent to the bottom edge of the trapezoid active area.
double stripPitch(const Identifier &measId) const
Pitch of a strip.
MuonVal::VectorBranch< uint > & m_numPadPhi
MuonVal::TwoVectorBranch m_localPadCornerTR
MuonVal::ThreeVectorBranch m_globalStripPos
double wireWidth(const Identifier &measId) const
Width of a single wire.