ATLAS Offline Software
Loading...
Searching...
No Matches
WireGroupDesign.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
5#include <GaudiKernel/SystemOfUnits.h>
6
7namespace MuonGMR4{
8 void WireGroupDesign::print(std::ostream& ostr) const {
9 ostr<<"Dimension -- width x height [mm]: "<<halfWidth() * Gaudi::Units::mm<<" x ";
10 ostr<<shortHalfHeight()<<"/"<<longHalfHeight()<<" [mm], ";
11 if (hasStereoAngle()) ostr<<"stereo angle: "<<stereoAngle() / Gaudi::Units::deg<<", ";
12 ostr<<"position first strip "<<Amg::toString(center(firstStripNumber()).value_or(Amg::Vector2D::Zero()),1);
13 ostr<<" *** Trapezoid edges "<<Amg::toString(cornerBotLeft(),1)<<" - "<<Amg::toString(cornerBotRight(), 1)<<" --- ";
15 ostr<<" -- numWireGroups: "<<m_groups.size()<<", wire pitch: "<<stripPitch()<<", nWires: [";
16 for (const wireGroup & grp : m_groups){
17 ostr<<grp.numWires<<",";
18 }
19 ostr<<"] ";
20 }
22 if (other.m_groups.size() != m_groups.size()) {
23 return m_groups.size() < other.m_groups.size();
24 }
25 for (unsigned int grp = 0; grp < m_groups.size(); ++grp) {
26 if (m_groups[grp].numWires != other.m_groups[grp].numWires) {
27 return m_groups[grp].numWires < other.m_groups[grp].numWires;
28 }
29 }
30 return static_cast<const StripDesign&>(*this) < other;
31 }
32 void WireGroupDesign::declareGroup(const unsigned int numWires) {
33 m_groups.emplace_back(numWires, nAllWires());
34 }
35 unsigned int WireGroupDesign::nAllWires() const {
36 return m_groups.empty() ? 0 : m_groups.back().accumlWires + m_groups.back().numWires;
37 }
38
39 unsigned int WireGroupDesign::numWiresInGroup(unsigned int groupNum) const {
40 unsigned int grpIdx = groupNum - firstStripNumber();
41 if (grpIdx >= m_groups.size()) {
42 ATH_MSG_WARNING(__FILE__<<":"<<__LINE__<<" The group number "<<groupNum
43 <<" is out of range. Expect ["<<firstStripNumber()
44 <<"-"<<m_groups.size()+firstStripNumber()<<").");
45 return 0;
46 }
47 return m_groups[grpIdx].numWires;
48 }
49 unsigned int WireGroupDesign::numPitchesToGroup(unsigned int groupNum) const {
50 unsigned int grpIdx = groupNum - firstStripNumber();
51 if (grpIdx >= m_groups.size()) {
52 ATH_MSG_WARNING(__FILE__<<":"<<__LINE__<<" The group number "<<groupNum
53 <<" is out of range. Expect ["<<firstStripNumber()
54 <<"-"<<m_groups.size()+firstStripNumber()<<").");
55 return 0;
56 }
57 return m_groups[grpIdx].accumlWires;
58 }
59 double WireGroupDesign::wireCutout() const {return m_wireCutout;}
60
62}
63
#define ATH_MSG_WARNING(x)
double halfWidth() const
Returns the half height of the strip panel.
double stereoAngle() const
Returns the value of the stereo angle.
const Amg::Vector2D & cornerTopLeft() const
Returns the top left corner of the trapezoid.
int firstStripNumber() const
Returns the number of the first strip.
CheckVector2D center(int stripNumb) const
Returns the bisector of the strip (Global numbering scheme)
const Amg::Vector2D & cornerTopRight() const
Returns the top right corner of the trapezoid.
double stripPitch() const
Distance between two adjacent strips.
double shortHalfHeight() const
Returns the shorter half height of the panel.
double longHalfHeight() const
Returns the longer half height of the panel.
bool hasStereoAngle() const
Returns whether a stereo angle is defined.
const Amg::Vector2D & cornerBotRight() const
Returns the bottom right corner of the trapezoid.
const Amg::Vector2D & cornerBotLeft() const
Returns the bottom left corner of the trapezoid.
void declareGroup(const unsigned int x)
Adds a new group of wires to the design.
bool operator<(const WireGroupDesign &other) const
set sorting operator
double m_wireCutout
Wire length available for digitization in a gas Gap.
unsigned int numWiresInGroup(unsigned int groupNum) const
Returns the number of wires in a given group.
unsigned int numPitchesToGroup(unsigned int groupNum) const
Returns the number of wire pitches to reach the given group.
double wireCutout() const
Extract the wireCutout for a wireGroup layer.
void print(std::ostream &ostr) const override final
Dump properties to the ostr.
unsigned int nAllWires() const
Returns the number of all wires.
void defineWireCutout(const double wireCutout)
Define the wirelength available for digitization in a gasGap.
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
The ReadoutGeomCnvAlg converts the Run4 Readout geometry build from the GeoModelXML into the legacy M...
helper construct to cache the number of wires in each group as well as the accumulated number of wire...