|
ATLAS Offline Software
|
Go to the documentation of this file.
14 GeoModelsTgcTest::GeoModelsTgcTest(
const std::string&
name, ISvcLocator* pSvcLocator):
31 if (testCham.size() != 6) {
33 return StatusCode::FAILURE;
36 std::string statName = testCham.substr(0, 3);
37 unsigned int statEta =
std::atoi(testCham.substr(3, 1).c_str()) *
38 (testCham[4] ==
'A' ? 1 : -1);
39 unsigned int statPhi =
std::atoi(testCham.substr(5, 1).c_str());
41 const Identifier eleId = id_helper.elementID(statName, statEta, statPhi, is_valid);
43 ATH_MSG_FATAL(
"Failed to deduce a station name for " << testCham);
44 return StatusCode::FAILURE;
47 id_helper.detectorElement_end(),
50 return id_helper.elementID(id) == eleId;
56 std::set<Identifier> excludedStations{};
59 if (testCham.size() != 6) {
61 return StatusCode::FAILURE;
64 std::string statName = testCham.substr(0, 3);
65 unsigned int statEta =
std::atoi(testCham.substr(3, 1).c_str()) * (testCham[4] ==
'A' ? 1 : -1);
66 unsigned int statPhi =
std::atoi(testCham.substr(5, 1).c_str());
68 const Identifier eleId = id_helper.elementID(statName, statEta, statPhi, is_valid);
70 ATH_MSG_FATAL(
"Failed to deduce a station name for " << testCham);
71 return StatusCode::FAILURE;
75 id_helper.detectorElement_end(),
76 std::inserter(excludedStations, excludedStations.end()),
78 return id_helper.elementID(id) == eleId;
83 id_helper.detectorElement_end(),
86 return excludedStations.count(id) == 0;
89 if (!excludedStations.empty()) {
90 std::stringstream excluded_report{};
92 excluded_report <<
" *** " <<
m_idHelperSvc->toString(
id) << std::endl;
94 ATH_MSG_INFO(
"Test all station except the following excluded ones " << std::endl << excluded_report.str());
97 std::stringstream sstr{};
101 ATH_MSG_INFO(
"Test only the following stations "<<std::endl<<sstr.str());
104 return StatusCode::SUCCESS;
108 return StatusCode::SUCCESS;
111 const EventContext& ctx{Gaudi::Hive::currentContext()};
128 return StatusCode::FAILURE;
135 for (
Amg::Vector3D axis :{Amg::Vector3D::UnitX(),Amg::Vector3D::UnitY(),Amg::Vector3D::UnitZ()}) {
136 const double closure_mag = std::abs( (transClosure*
axis).
dot(
axis) - 1.);
137 if (closure_mag > std::numeric_limits<float>::epsilon() ) {
140 return StatusCode::FAILURE;
145 for (
int chType = sTgcIdHelper::sTgcChannelTypes::Pad;
chType <= sTgcIdHelper::sTgcChannelTypes::Wire; ++
chType) {
146 unsigned int numChannel = 0;
147 bool isValidLay{
false};
155 case sTgcIdHelper::sTgcChannelTypes::Pad:
156 numChannel = reElement->
numPads(layID);
159 case sTgcIdHelper::sTgcChannelTypes::Strip:
160 numChannel = reElement->
numStrips(layID);
163 case sTgcIdHelper::sTgcChannelTypes::Wire:
168 bool isValidCh{
false};
177 const IdentifierHash layHash = reElement->
layerHash(chID);
179 <<
" --> layerHash: "<<
static_cast<unsigned>(layHash));
181 if (backCnv != chID) {
184 return StatusCode::FAILURE;
186 if (layHash != reElement->
layerHash(measHash)) {
187 ATH_MSG_FATAL(
"Constructing the layer hash from the identifier "<<
188 m_idHelperSvc->toString(chID)<<
" leads to different layer hashes "<<
189 layHash<<
" vs. "<< reElement->
layerHash(measHash));
190 return StatusCode::FAILURE;
192 if (
chType == sTgcIdHelper::sTgcChannelTypes::Strip) {
196 else if (
chType == sTgcIdHelper::sTgcChannelTypes::Wire) {
200 else if (
chType == sTgcIdHelper::sTgcChannelTypes::Pad) {
209 return StatusCode::SUCCESS;
236 for (
int chType = sTgcIdHelper::sTgcChannelTypes::Pad;
chType <= sTgcIdHelper::sTgcChannelTypes::Wire; ++
chType) {
237 unsigned int numWireGroup = 0;
239 bool isValidLay{
false};
255 case sTgcIdHelper::sTgcChannelTypes::Pad:
265 for (
unsigned int pad = 1; pad <= reElement->
numPads(layID); ++pad) {
266 bool isValidPad{
false};
273 <<
" layer: "<<
layer<<
" pad: "<<pad<<
" channelType: "<<
chType);
278 std::array<Amg::Vector2D,4> localPadCorners{make_array<Amg::Vector2D, 4>(
Amg::Vector2D::Zero())};
280 std::array<Amg::Vector3D,4> globalPadCorners{make_array<Amg::Vector3D, 4>(
Amg::Vector3D::Zero())};
309 if (pad != 1)
continue;
318 case sTgcIdHelper::sTgcChannelTypes::Strip:
322 for (
unsigned int strip = 1; strip <= reElement->
numStrips(layID); ++strip) {
323 bool isValidStrip{
false};
330 <<
" layer: "<<
layer<<
" strip: "<<strip<<
" channelType: "<<
chType);
339 if (strip != 1)
continue;
348 case sTgcIdHelper::sTgcChannelTypes::Wire:
357 std::cout <<
"The number of wire groups are:" << numWireGroup << std::endl;
358 for (
unsigned int wireGroup = 1; wireGroup <= numWireGroup; ++wireGroup) {
359 bool isValidWire{
false};
366 <<
" layer: "<<
layer<<
" wireGroup: "<<wireGroup<<
" channelType: "<<
chType);
374 if (wireGroup != 1)
continue;
384 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.
std::string find(const std::string &s)
return a remapped string
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.
const 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)
The ReadoutGeomCnvAlg converts the Run4 Readout geometry build from the GeoModelXML into the legacy M...
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
Gaudi::Property< std::vector< std::string > > m_excludeStat
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.