ATLAS Offline Software
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 
7 namespace 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)<<" --- ";
14  ostr<<Amg::toString(cornerTopLeft(), 1)<<" - "<<Amg::toString(cornerTopRight(), 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  }
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 
MuonGMR4::StripDesign::cornerTopLeft
const Amg::Vector2D & cornerTopLeft() const
Returns the top left corner of the trapezoid.
MuonGMR4::WireGroupDesign::print
void print(std::ostream &ostr) const override final
Dump properties to the ostr.
Definition: WireGroupDesign.cxx:8
MuonGMR4::StripDesign::stereoAngle
double stereoAngle() const
Returns the value of the stereo angle.
MuonGMR4::WireGroupDesign::defineWireCutout
void defineWireCutout(const double wireCutout)
Define the wirelength available for digitization in a gasGap.
Definition: WireGroupDesign.cxx:61
MuonGMR4::StripDesign
Definition: StripDesign.h:30
MuonGMR4::WireGroupDesign::m_groups
wireGrpVector m_groups
Definition: WireGroupDesign.h:87
MuonGMR4::WireGroupDesign
Definition: WireGroupDesign.h:23
MuonGMR4::WireGroupDesign::wireCutout
double wireCutout() const
Extract the wireCutout for a wireGroup layer.
Definition: WireGroupDesign.cxx:59
MuonGMR4::StripDesign::cornerBotLeft
const Amg::Vector2D & cornerBotLeft() const
Returns the bottom left corner of the trapezoid.
WireGroupDesign.h
MuonGMR4::WireGroupDesign::wireGroup
helper construct to cache the number of wires in each group as well as the accumulated number of wire...
Definition: WireGroupDesign.h:77
deg
#define deg
Definition: SbPolyhedron.cxx:17
MuonGMR4::WireGroupDesign::numWiresInGroup
unsigned int numWiresInGroup(unsigned int groupNum) const
Returns the number of wires in a given group.
Definition: WireGroupDesign.cxx:39
MuonGMR4::WireGroupDesign::nAllWires
unsigned int nAllWires() const
Returns the number of all wires.
Definition: WireGroupDesign.cxx:35
MuonGMR4::StripDesign::longHalfHeight
double longHalfHeight() const
Returns the longer half height of the panel.
MuonGMR4::WireGroupDesign::declareGroup
void declareGroup(const unsigned int x)
Adds a new group of wires to the design.
Definition: WireGroupDesign.cxx:32
MuonGMR4::StripDesign::shortHalfHeight
double shortHalfHeight() const
Returns the shorter half height of the panel.
Amg::toString
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
Definition: GeoPrimitivesToStringConverter.h:40
MuonGMR4
The ReadoutGeomCnvAlg converts the Run4 Readout geometry build from the GeoModelXML into the legacy M...
Definition: MdtCalibInput.h:20
MuonGMR4::WireGroupDesign::m_wireCutout
double m_wireCutout
Wire length available for digitization in a gas Gap.
Definition: WireGroupDesign.h:89
MuonGMR4::StripDesign::firstStripNumber
int firstStripNumber() const
Returns the number of the first strip.
MuonGMR4::StripDesign::cornerTopRight
const Amg::Vector2D & cornerTopRight() const
Returns the top right corner of the trapezoid.
MuonGMR4::StripDesign::center
CheckVector2D center(int stripNumb) const
Returns the bisector of the strip (Global numbering scheme)
MuonGMR4::WireGroupDesign::numPitchesToGroup
unsigned int numPitchesToGroup(unsigned int groupNum) const
Returns the number of wire pitches to reach the given group.
Definition: WireGroupDesign.cxx:49
MuonGMR4::StripDesign::halfWidth
double halfWidth() const
Returns the half height of the strip panel.
python.SystemOfUnits.mm
int mm
Definition: SystemOfUnits.py:83
MuonGMR4::StripDesign::cornerBotRight
const Amg::Vector2D & cornerBotRight() const
Returns the bottom right corner of the trapezoid.
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
MuonGMR4::StripDesign::hasStereoAngle
bool hasStereoAngle() const
Returns whether a stereo angle is defined.
MuonGMR4::StripDesign::stripPitch
double stripPitch() const
Distance between two adjacent strips.
MuonGMR4::WireGroupDesign::operator<
bool operator<(const WireGroupDesign &other) const
set sorting operator
Definition: WireGroupDesign.cxx:21
generate::Zero
void Zero(TH1D *hin)
Definition: generate.cxx:32