ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
MuonGM::Station Class Reference

#include <Station.h>

Inheritance diagram for MuonGM::Station:
Collaboration diagram for MuonGM::Station:

Public Member Functions

 Station ()
 
 ~Station ()=default
 
 Station (const Station &s)=delete
 
Stationoperator= (const Station &s)=delete
 
 Station (MYSQL &mysql, std::string name)
 
void SetComponent (Component *c)
 
void SetCutout (Cutout *c)
 
ComponentGetComponent (int i) const
 
CutoutGetCutout (int i) const
 
int GetNrOfComponents () const
 
int GetNrOfCutouts () const
 
void SetPosition (Position p)
 
void SetAlignPos (const AlignPos &p)
 
PositionIterator begin () const
 
PositionIterator end () const
 
AlignPosIterator abegin () const
 
AlignPosIterator aend () const
 
PositionIterator FindPosition (int iz, int iphi) const
 
AlignPosIterator FindAlignPos (int iz, int iphi) const
 
int CountAlignPos (int iz, int iphi) const
 
AlignPosIterator getFirstAlignPosInRange (int iz, int iphi, AlignPosIterator &lastAlignPosInRange) const
 
int Npositions () const
 
GeoTrf::Transform3D native_to_tsz_frame (const MYSQL &mysql, const Position &p) const
 
GeoTrf::Transform3D tsz_to_native_frame (const MYSQL &mysql, const Position &p) const
 
GeoTrf::Transform3D tsz_to_global_frame (const MYSQL &mysql, const Position &p) const
 
GeoTrf::Transform3D global_to_tsz_frame (const MYSQL &mysql, const Position &p) const
 
GeoTrf::Transform3D getNominalTransform (const MYSQL &mysql, const Position &p) const
 
GeoTrf::Transform3D getDeltaTransform_tszFrame (const MYSQL &mysql, const AlignPos &ap) const
 
GeoTrf::Transform3D getDeltaTransform (const MYSQL &mysql, const AlignPos &ap, const Position &p) const
 
GeoTrf::Transform3D getAlignedTransform (const MYSQL &mysql, const AlignPos &ap, const Position &p) const
 
std::string GetName () const
 
double GetThickness (const MYSQL &mysql) const
 
double GetExtraBottomThickness () const
 
double GetExtraTopThickness () const
 
double GetLength () const
 
double GetWidth1 () const
 
double GetWidth2 () const
 
double getAmdbOrigine_along_length () const
 
double getAmdbOrigine_along_thickness (const MYSQL &mysql) const
 
bool hasMdts () const
 
void setHasMdts (bool x)
 
double mdtHalfPitch (const MYSQL &mysql) const
 
bool msgLvl (const MSG::Level lvl) const
 Test the output level. More...
 
MsgStream & msg () const
 The standard message stream. More...
 
MsgStream & msg (const MSG::Level lvl) const
 The standard message stream. More...
 
void setLevel (MSG::Level lvl)
 Change the current logging level. More...
 

Private Member Functions

double getYMin () const
 
void initMessaging () const
 Initialize our message level and MessageSvc. More...
 

Private Attributes

std::atomic< double > m_amdbOrigine_along_length
 
std::atomic< double > m_amdbOrigine_along_thickness
 
std::string m_name {}
 
bool m_hasMdts {false}
 
std::vector< std::unique_ptr< Component > > m_components {}
 
std::vector< std::unique_ptr< Cutout > > m_cutouts {}
 
PositionMap m_positions {}
 
AlignPosMap m_alignpositions {}
 
std::string m_nm
 Message source name. More...
 
boost::thread_specific_ptr< MsgStream > m_msg_tls
 MsgStream instance (a std::cout like with print-out levels) More...
 
std::atomic< IMessageSvc * > m_imsg { nullptr }
 MessageSvc pointer. More...
 
std::atomic< MSG::Level > m_lvl { MSG::NIL }
 Current logging level. More...
 
std::atomic_flag m_initialized ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
 Messaging initialized (initMessaging) More...
 

Friends

std::ostream & operator<< (std::ostream &os, const Station &s)
 

Detailed Description

Definition at line 40 of file Station.h.

Constructor & Destructor Documentation

◆ Station() [1/3]

MuonGM::Station::Station ( )

Definition at line 33 of file Station.cxx.

33  :
34  AthMessaging("MuonGeoModel.Station"),
37  m_name("unknown"),
38  m_hasMdts (false)
39  { }

◆ ~Station()

MuonGM::Station::~Station ( )
default

◆ Station() [2/3]

MuonGM::Station::Station ( const Station s)
delete

◆ Station() [3/3]

MuonGM::Station::Station ( MYSQL mysql,
std::string  name 
)

Definition at line 23 of file Station.cxx.

23  :
24  AthMessaging("MuonGeoModel.Station"),
27  m_name(std::move(s)),
28  m_hasMdts (false)
29  {
30  mysql.StoreStation(this);
31  }

Member Function Documentation

◆ abegin()

AlignPosIterator MuonGM::Station::abegin ( ) const

Definition at line 76 of file Station.cxx.

76 { return m_alignpositions.begin(); }

◆ aend()

AlignPosIterator MuonGM::Station::aend ( ) const

Definition at line 77 of file Station.cxx.

77 { return m_alignpositions.end(); }

◆ begin()

PositionIterator MuonGM::Station::begin ( ) const

Definition at line 106 of file Station.cxx.

106 { return m_positions.begin(); }

◆ CountAlignPos()

int MuonGM::Station::CountAlignPos ( int  iz,
int  iphi 
) const

Definition at line 69 of file Station.cxx.

69  {
70  // imt - probably needs to be different key for align pos
71  int key = iz * 100 + iphi;
72  // std::cout<<" looking for align pos. with key "<<key<<std::endl;
73  return m_alignpositions.count(key);
74  }

◆ end()

PositionIterator MuonGM::Station::end ( ) const

Definition at line 108 of file Station.cxx.

108 { return m_positions.end(); }

◆ FindAlignPos()

AlignPosIterator MuonGM::Station::FindAlignPos ( int  iz,
int  iphi 
) const

Definition at line 62 of file Station.cxx.

62  {
63  // imt - probably needs to be different key for align pos
64  int key = iz * 100 + iphi;
65  // std::cout<<" looking for align pos. with key "<<key<<std::endl;
66  return m_alignpositions.find(key);
67  }

◆ FindPosition()

PositionIterator MuonGM::Station::FindPosition ( int  iz,
int  iphi 
) const

Definition at line 99 of file Station.cxx.

99  {
100  int key = iz * 100 + iphi;
101  return m_positions.find(key);
102  }

◆ getAlignedTransform()

GeoTrf::Transform3D MuonGM::Station::getAlignedTransform ( const MYSQL mysql,
const AlignPos ap,
const Position p 
) const

Definition at line 514 of file Station.cxx.

515  {
516  return tsz_to_global_frame(mysql, p) * getDeltaTransform_tszFrame(mysql, ap) * native_to_tsz_frame(mysql, p);
517  }

◆ getAmdbOrigine_along_length()

double MuonGM::Station::getAmdbOrigine_along_length ( ) const

Definition at line 553 of file Station.cxx.

553  {
554  GetLength();
556  }

◆ getAmdbOrigine_along_thickness()

double MuonGM::Station::getAmdbOrigine_along_thickness ( const MYSQL mysql) const

Definition at line 558 of file Station.cxx.

558  {
559  GetThickness(mysql);
561  }

◆ GetComponent()

Component * MuonGM::Station::GetComponent ( int  i) const

Definition at line 83 of file Station.cxx.

83 { return m_components[i].get(); }

◆ GetCutout()

Cutout * MuonGM::Station::GetCutout ( int  i) const

Definition at line 85 of file Station.cxx.

85 { return m_cutouts[i].get(); }

◆ getDeltaTransform()

GeoTrf::Transform3D MuonGM::Station::getDeltaTransform ( const MYSQL mysql,
const AlignPos ap,
const Position p 
) const

Definition at line 546 of file Station.cxx.

547  {
548  // GM applies Delta transform like transform*delta
550  return deltaGM;
551  }

◆ getDeltaTransform_tszFrame()

GeoTrf::Transform3D MuonGM::Station::getDeltaTransform_tszFrame ( const MYSQL mysql,
const AlignPos ap 
) const

Definition at line 519 of file Station.cxx.

520  {
521  if (ap.tras != 0 || ap.trat != 0 || ap.traz != 0 || ap.rots != 0 || ap.rott != 0 || ap.rotz != 0) {
522  ATH_MSG_VERBOSE("Setting corrections. For station " << m_name << " corrections sent are "
523  << ap.tras << " " << ap.traz << " " << ap.trat << " " << ap.rots << " "
524  << ap.rotz << " " << ap.rott << " isBarrel=" << ap.isBarrel
525  << " length=" << GetLength() << " m_thickness=" << GetThickness(mysql));
526  }
527 
528  GeoTrf::RotateX3D rott(ap.rott);
529  GeoTrf::RotateZ3D rotz(ap.rotz);
530  GeoTrf::RotateY3D rots(ap.rots);
531  GeoTrf::Transform3D trans = GeoTrf::TranslateY3D(ap.tras) * GeoTrf::TranslateZ3D(ap.traz) * GeoTrf::TranslateX3D(ap.trat);
532 
533  GeoTrf::Transform3D delta = trans * rots * rotz * rott;
534 
535  if (msgLvl(MSG::VERBOSE)) {
536  msg() << MSG::VERBOSE << " delta transform in the tsz frame --------------" << endmsg
537  << delta(0, 0) << " " << delta(0, 1) << " " << delta(0, 2) << " " << delta(0, 3) << " " << endmsg
538  << delta(1, 0) << " " << delta(1, 1) << " " << delta(1, 2) << " " << delta(1, 3) << " " << endmsg
539  << delta(2, 0) << " " << delta(2, 1) << " " << delta(2, 2) << " " << delta(2, 3) << " " << endmsg;
540  }
541 
542  // our delta transform must be applied in the tsz frame:
543  return delta;
544  }

◆ GetExtraBottomThickness()

double MuonGM::Station::GetExtraBottomThickness ( ) const

Definition at line 155 of file Station.cxx.

155  {
156  return 0.;
157 
158  }

◆ GetExtraTopThickness()

double MuonGM::Station::GetExtraTopThickness ( ) const

Definition at line 151 of file Station.cxx.

151  {
152  return 0.;
153  }

◆ getFirstAlignPosInRange()

AlignPosIterator MuonGM::Station::getFirstAlignPosInRange ( int  iz,
int  iphi,
AlignPosIterator lastAlignPosInRange 
) const

Definition at line 55 of file Station.cxx.

55  {
56  int key = iz * 100 + iphi;
57  std::pair<AlignPosIterator, AlignPosIterator> ppp = m_alignpositions.equal_range(key);
58  lastAlignPosInRange = ppp.second;
59  return ppp.first;
60  }

◆ GetLength()

double MuonGM::Station::GetLength ( ) const

Definition at line 160 of file Station.cxx.

160  {
161  double len = 0;
162  if (m_name[0] == 'T') {
163  double innerrad = std::numeric_limits<double>::max();
164  double outerrad = 0.;
165 
166  for (unsigned int i = 0; i < m_components.size(); i++) {
167  TgcComponent *tg = dynamic_cast<TgcComponent*>(m_components[i].get());
168 
169  if (tg->posy < innerrad) {
170  innerrad = tg->posy;
171  }
172 
173  if (tg->posy + tg->dy > outerrad) {
174  outerrad = tg->posy + tg->dy;
175  }
176  }
177 
178  len = outerrad - innerrad;
179  } else {
180  double ystart = 999999.;
181 
182  for (unsigned int i = 0; i < m_components.size(); i++) {
183  StandardComponent* sc = dynamic_cast<StandardComponent*>(m_components[i].get());
184  if (not sc){
185  ATH_MSG_ERROR("Dynamic cast to StandardComponent failed at line "<<__LINE__);
186  continue;
187  }
188  ATH_MSG_VERBOSE("Station " << m_name << " *** comp " << i << " named " <<
189  sc->name << " posy " << sc->posy << " dy " << sc->dy << " len " << len <<
190  " ystart " << ystart);
191  if ((sc->dy + sc->posy) > len)
192  len = sc->dy + sc->posy;
193  if (i == 0 || sc->posy < ystart)
194  ystart = sc->posy;
195  ATH_MSG_VERBOSE(" now len = " << len << " ystart = " << ystart);
196  }
197 
198  if (std::abs(ystart) > 0.001) {
199  len = len - ystart;
200  m_amdbOrigine_along_length = -ystart;
201 
202  ATH_MSG_VERBOSE("Station " << m_name << " redefining len = " << len << " because ystart = " << ystart);
203  }
204  }
205 
206  return len;
207  }

◆ GetName()

std::string MuonGM::Station::GetName ( ) const

Definition at line 110 of file Station.cxx.

110 { return m_name; }

◆ getNominalTransform()

GeoTrf::Transform3D MuonGM::Station::getNominalTransform ( const MYSQL mysql,
const Position p 
) const

Definition at line 511 of file Station.cxx.

512  { return tsz_to_global_frame(mysql, p) * native_to_tsz_frame(mysql, p); }

◆ GetNrOfComponents()

int MuonGM::Station::GetNrOfComponents ( ) const

Definition at line 322 of file Station.cxx.

322 { return m_components.size(); }

◆ GetNrOfCutouts()

int MuonGM::Station::GetNrOfCutouts ( ) const

Definition at line 324 of file Station.cxx.

324 { return m_cutouts.size(); }

◆ GetThickness()

double MuonGM::Station::GetThickness ( const MYSQL mysql) const

Definition at line 112 of file Station.cxx.

112  {
113  double thick = 0;
114  if (m_name[0] == 'T') {
115  for (unsigned int i = 0; i < m_components.size(); i++) {
116  TgcComponent *t = dynamic_cast<TgcComponent*>(m_components[i].get());
117  if (not t){
118  ATH_MSG_ERROR("Dynamic cast to TgcComponent failed");
119  continue;
120  }
121  thick = thick > t->GetThickness(mysql) + t->posz ? thick : t->GetThickness(mysql) + t->posz;
122  }
123  } else {
124  double zstart = std::numeric_limits<double>::max();
125 
126  for (unsigned int i = 0; i < m_components.size(); i++) {
127  StandardComponent* s = dynamic_cast<StandardComponent*>(m_components[i].get());
128  if (not s){
129  ATH_MSG_ERROR("Dynamic cast to StandardComponent failed");
130  continue;
131  }
132  thick = thick > s->GetThickness(mysql) + s->posz ? thick : s->GetThickness(mysql) + s->posz;
133  if (i == 0 || s->posz < zstart)
134  zstart = s->posz;
135 
136  ATH_MSG_VERBOSE("Station " << m_name << " calculating Thinkness = " << thick << " and zstart = " << zstart);
137  }
138 
139  if (std::abs(zstart) > 0.001) {
140  thick = thick - zstart;
142  ATH_MSG_VERBOSE("Station " << m_name << " redefining Thinkness = " << thick <<
143  " because zstart = " << zstart <<
144  "; then amdbOrigine_along_thickness = " << m_amdbOrigine_along_thickness);
145  }
146  }
147 
148  return thick;
149  }

◆ GetWidth1()

double MuonGM::Station::GetWidth1 ( ) const

Definition at line 227 of file Station.cxx.

227  {
228  double maxdxmin = std::numeric_limits<double>::lowest();
229  double ymin = getYMin();
230  double w = 0;
231  for (unsigned int i = 0; i < m_components.size(); i++) {
232  std::string_view n = std::string_view(m_components[i]->name).substr(0, 3);
233  if (n == "TGC") {
234  double dw = 20.;
235  std::string_view typetgc = std::string_view(m_components[i]->name).substr(3, 2);
236  // in case of station containing one module
237  if (typetgc == "01" || typetgc == "06" || typetgc == "12" || typetgc == "18" || typetgc == "19" || typetgc == "20" || typetgc == "21") {
238  dw = 0.;
239  }
240 
241  if (w == 0) {
242  w = m_components[i]->dx1 + dw;
243  } else {
244  if (w > m_components[i]->dx1 + dw) {
245  w = m_components[i]->dx1 + dw;
246  }
247  }
248  } else {
249  double dxmin = 0.;
250  if (std::abs(m_components[i]->dy) < 1.e-10) {
251  dxmin = m_components[i]->dx1;
252  } else {
253  double num = (m_components[i]->dx2 - m_components[i]->dx1) / 2.;
254  double tantheta = num != 0 ? num / m_components[i]->dy : 0;
255  auto *sc = dynamic_cast<StandardComponent*>(m_components[i].get());
256  if (not sc){
257  ATH_MSG_ERROR("Dynamic cast to StandardComponent failed at line "<<__LINE__);
258  continue;
259  }
260  double y = sc->posy;
261  dxmin = m_components[i]->dx1 + 2. * tantheta * (ymin - y);
262  }
263 
264  if (maxdxmin < dxmin && (n.substr(0, 2) != "LB" || m_name[0] == 'B'))
265  maxdxmin = dxmin;
266  }
267  }
268 
269  if (m_name.substr(0, 1) == "T")
270  return w;
271  else
272  return maxdxmin;
273  }

◆ GetWidth2()

double MuonGM::Station::GetWidth2 ( ) const

Definition at line 275 of file Station.cxx.

275  {
276  // double ymin= -getAmdbOrigine_along_length();
277  double ymax = getYMin() + GetLength();
278  double maxdxmax = std::numeric_limits<double>::lowest();
279  double w = 0;
280 
281  for (unsigned int i = 0; i < m_components.size(); i++) {
282  if (w < m_components[i]->dx2) {
283  w = m_components[i]->dx2;
284  }
285 
286  std::string_view n = std::string_view(m_components[i]->name).substr(0, 3);
287  if (n == "TGC") {
288  double dw = 20.;
289  std::string_view typetgc = std::string_view(m_components[i]->name).substr(3, 2);
290  // in case of one station containing one module
291  if (typetgc == "01" || typetgc == "06" || typetgc == "12" || typetgc == "18" || typetgc == "19" || typetgc == "20" || typetgc == "21") {
292  dw = 0.;
293  }
294  w += dw;
295  } else {
296  double dxmax = 0.;
297  if (std::abs(m_components[i]->dy) < 1.e-10)
298  dxmax = m_components[i]->dx2;
299  else {
300  double num = (m_components[i]->dx2 - m_components[i]->dx1) / 2.;
301  double tantheta = num != 0 ? num / m_components[i]->dy : 0;
302  auto *sc = dynamic_cast<StandardComponent*>(m_components[i].get());
303  if (not sc){
304  ATH_MSG_ERROR("Dynamic cast to StandardComponent failed at line "<<__LINE__);
305  continue;
306  }
307  double y = sc->posy;
308  dxmax = m_components[i]->dx1 + 2. * tantheta * (ymax - y);
309  }
310 
311  if (maxdxmax < dxmax)
312  maxdxmax = dxmax;
313  }
314  }
315 
316  if (m_name.compare(0, 1, "T") == 0)
317  return w;
318  else
319  return maxdxmax;
320  }

◆ getYMin()

double MuonGM::Station::getYMin ( ) const
private

Definition at line 209 of file Station.cxx.

209  {
210  if (m_name[0] != 'T') {
211  double ystart = std::numeric_limits<double>::max();
212 
213  for (unsigned int i = 0; i < m_components.size(); i++) {
214  StandardComponent* sc = dynamic_cast<StandardComponent*>(m_components[i].get());
215  if (not sc){
216  ATH_MSG_ERROR("Dynamic cast to StandardComponent failed at line "<<__LINE__);
217  continue;
218  }
219  if (i == 0 || sc->posy < ystart)
220  ystart = sc->posy;
221  }
222  return ystart;
223  }
224  return 0.;
225  }

◆ global_to_tsz_frame()

GeoTrf::Transform3D MuonGM::Station::global_to_tsz_frame ( const MYSQL mysql,
const Position p 
) const

Definition at line 508 of file Station.cxx.

509  { return (tsz_to_global_frame(mysql, p)).inverse(); }

◆ hasMdts()

bool MuonGM::Station::hasMdts ( ) const
inline

Definition at line 88 of file Station.h.

88 { return m_hasMdts; }

◆ initMessaging()

void AthMessaging::initMessaging ( ) const
privateinherited

Initialize our message level and MessageSvc.

This method should only be called once.

Definition at line 39 of file AthMessaging.cxx.

40 {
42  m_lvl = m_imsg ?
43  static_cast<MSG::Level>( m_imsg.load()->outputLevel(m_nm) ) :
44  MSG::INFO;
45 }

◆ mdtHalfPitch()

double MuonGM::Station::mdtHalfPitch ( const MYSQL mysql) const

Definition at line 343 of file Station.cxx.

343  {
344  const MDT *mdtobj = dynamic_cast<const MDT*>(mysql.GetATechnology("MDT0"));
345  if (not mdtobj){
346  ATH_MSG_ERROR("Dynamic cast to MDT failed at line "<<__LINE__);
347  return 0.;
348  }
349  double mdthalfpitch = 0.5 * (mdtobj->pitch);
350 
351  if (hasMdts()) {
352 
353  for (int icomp = 0; icomp < GetNrOfComponents(); ++icomp) {
354  const Component *c = GetComponent(icomp);
355  if (c->name.compare(0, 3, "MDT") != 0)
356  continue;
357  const MDT *mdtobj = dynamic_cast<const MDT*>(mysql.GetATechnology(c->name));
358  if (!mdtobj) {
359  ATH_MSG_ERROR("Cannot find MDT definition for component " << c->name);
360  continue;
361  }
362  mdthalfpitch = 0.5 * (mdtobj->pitch);
363  ATH_MSG_DEBUG("Setting halfpitch " << mdthalfpitch << " for station " << m_name);
364  break;
365  }
366  }
367  return mdthalfpitch;
368  }

◆ msg() [1/2]

MsgStream & AthMessaging::msg ( ) const
inlineinherited

The standard message stream.

Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.

Definition at line 164 of file AthMessaging.h.

165 {
166  MsgStream* ms = m_msg_tls.get();
167  if (!ms) {
168  if (!m_initialized.test_and_set()) initMessaging();
169  ms = new MsgStream(m_imsg,m_nm);
170  m_msg_tls.reset( ms );
171  }
172 
173  ms->setLevel (m_lvl);
174  return *ms;
175 }

◆ msg() [2/2]

MsgStream & AthMessaging::msg ( const MSG::Level  lvl) const
inlineinherited

The standard message stream.

Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.

Definition at line 179 of file AthMessaging.h.

180 { return msg() << lvl; }

◆ msgLvl()

bool AthMessaging::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Test the output level.

Parameters
lvlThe message level to test against
Returns
boolean Indicating if messages at given level will be printed
Return values
trueMessages at level "lvl" will be printed

Definition at line 151 of file AthMessaging.h.

152 {
153  if (!m_initialized.test_and_set()) initMessaging();
154  if (m_lvl <= lvl) {
155  msg() << lvl;
156  return true;
157  } else {
158  return false;
159  }
160 }

◆ native_to_tsz_frame()

GeoTrf::Transform3D MuonGM::Station::native_to_tsz_frame ( const MYSQL mysql,
const Position p 
) const

Definition at line 371 of file Station.cxx.

371  {
372  int amdbVersion = mysql.getNovaReadVersion();
373 
374  if (amdbVersion > 0 && amdbVersion < 7 && m_name[0] != 'B') {
375  ATH_MSG_DEBUG("For AMDB version " << amdbVersion << " a left-handed chamber coordinate system was used "
376  << " for endcap side A so be very careful.");
377  }
378 
379  // first apply here the mirror symmetry: (we, in fact, apply a rotation)
380  GeoTrf::Transform3D mirrsym = GeoTrf::Transform3D::Identity();
381  if (p.isMirrored) {
382  if (m_name[0] == 'B') {
383  mirrsym = GeoTrf::RotateX3D(180. * Gaudi::Units::deg);
384  }
385  }
386 
387  // define the translation to position the chamber in the tzs frame
388  GeoTrf::Translate3D AMDBorgTranslation(0, 0, 0);
389  if ((m_name[0] == 'B' || p.isBarrelLike) && p.zindex < 0 && (!p.isMirrored) && hasMdts()) {
390  double halfpitch = mdtHalfPitch(mysql);
391  AMDBorgTranslation = GeoTrf::Translate3D(GetThickness(mysql) / 2. - getAmdbOrigine_along_thickness(mysql), 0., GetLength() / 2. - (getAmdbOrigine_along_length() + halfpitch));
392 
393  ATH_MSG_VERBOSE(" GetThickness / getAmdbO_thick / GetLength() / getAmdbO_length " <<
394  GetThickness(mysql) << " " << getAmdbOrigine_along_thickness(mysql) << " " <<
395  GetLength() << " " << getAmdbOrigine_along_length() + halfpitch);
396  } else {
397  if (m_name[0] == 'T') {
398  AMDBorgTranslation = GeoTrf::Translate3D(GetThickness(mysql) / 2. - getAmdbOrigine_along_thickness(mysql), 0.,
399  GetLength() / 2. - getAmdbOrigine_along_length() + ((TgcComponent *)GetComponent(0))->posy);
400  } else {
401  AMDBorgTranslation = GeoTrf::Translate3D(GetThickness(mysql) / 2. - getAmdbOrigine_along_thickness(mysql), 0., GetLength() / 2. - getAmdbOrigine_along_length());
402  }
403 
404  ATH_MSG_VERBOSE(" GetThickness / getAmdbO_thick / GetLength() / getAmdbO_length " <<
405  GetThickness(mysql) << " " << getAmdbOrigine_along_thickness(mysql) << " " <<
406  GetLength() << " " << getAmdbOrigine_along_length());
407  }
408 
409  // // define the rotations by alpha, beta, gamma
410  // GeoTrf::Rotate3D ralpha = GeoTrf::RotateX3D(p.alpha*Gaudi::Units::deg);
411  // GeoTrf::Rotate3D rbeta = GeoTrf::RotateZ3D(p.beta*Gaudi::Units::deg);
412  // GeoTrf::Rotate3D rgamma;
413  // rgamma = GeoTrf::RotateY3D(p.gamma*Gaudi::Units::deg);
414  // log<<MSG::VERBOSE<<" gamma is not changing sign - original "<<p.gamma<<" new one "<<p.gamma<<endmsg;
415  // log<<MSG::VERBOSE<<" alpha / beta "<<p.alpha<<" "<<p.beta<<endmsg;
416 
417  // // apply all transform in sequence
418  // // GeoTrf::Transform3D to_tsz = rgamma*rbeta*ralpha*AMDBorgTranslation*mirrsym; // works for barrel and barrel-like
419  // // imt: tested for CTB2004, seems to work for all amdb versions...
420  // GeoTrf::Transform3D to_tsz = rgamma*rbeta*ralpha*AMDBorgTranslation*mirrsym;
421  GeoTrf::Transform3D to_tsz = AMDBorgTranslation * mirrsym;
422 
423  return to_tsz;
424  }

◆ Npositions()

int MuonGM::Station::Npositions ( ) const

Definition at line 104 of file Station.cxx.

104 { return m_positions.size(); }

◆ operator=()

Station& MuonGM::Station::operator= ( const Station s)
delete

◆ SetAlignPos()

void MuonGM::Station::SetAlignPos ( const AlignPos p)

Definition at line 42 of file Station.cxx.

42  {
43  if (FindAlignPos(p.zindex, p.phiindex) != m_alignpositions.end() && p.jobindex == 0) {
44  ATH_MSG_WARNING(" this alignposition already exists !!!");
45  ATH_MSG_WARNING(" for station named " << m_name << " setting alignposition at z,phi, key " <<
46  p.zindex << " " << p.phiindex << " " << p.zindex * 100 + p.phiindex <<
47  " and jobIndex = 0");
48  assert(0);
49  }
50 
51  int key = p.zindex * 100 + p.phiindex;
52  m_alignpositions.insert(std::pair<int, AlignPos>(key, p));
53  }

◆ SetComponent()

void MuonGM::Station::SetComponent ( Component c)

Definition at line 79 of file Station.cxx.

79 { m_components.emplace_back(c); }

◆ SetCutout()

void MuonGM::Station::SetCutout ( Cutout c)

Definition at line 81 of file Station.cxx.

81 { m_cutouts.emplace_back(c); }

◆ setHasMdts()

void MuonGM::Station::setHasMdts ( bool  x)
inline

Definition at line 89 of file Station.h.

89 { m_hasMdts = x; }

◆ setLevel()

void AthMessaging::setLevel ( MSG::Level  lvl)
inherited

Change the current logging level.

Use this rather than msg().setLevel() for proper operation with MT.

Definition at line 28 of file AthMessaging.cxx.

29 {
30  m_lvl = lvl;
31 }

◆ SetPosition()

void MuonGM::Station::SetPosition ( Position  p)

Definition at line 87 of file Station.cxx.

87  {
88  if (FindPosition(p.zindex, p.phiindex) != end()) {
89  ATH_MSG_WARNING(" this position already exists !!!");
90  ATH_MSG_WARNING(" for station named " << m_name << " setting position at z,phi, key " <<
91  p.zindex << " " << p.phiindex << " " << p.zindex * 100 + p.phiindex);
92  assert(0);
93  } else {
94  p.isAssigned = true;
95  m_positions[p.zindex * 100 + p.phiindex] = p;
96  }
97  }

◆ tsz_to_global_frame()

GeoTrf::Transform3D MuonGM::Station::tsz_to_global_frame ( const MYSQL mysql,
const Position p 
) const

Definition at line 430 of file Station.cxx.

431  {
432  GeoTrf::Transform3D nominalTransf = GeoTrf::Transform3D::Identity();
433 
435  double RAD;
436 
437  if (m_name[0] == 'T') {
438  RAD = p.radius;
439  } else {
440  RAD = p.radius;
441  }
442 
443  vec.x() = RAD * cos(p.phi * Gaudi::Units::deg);
444  vec.x() = vec.x() - p.shift * sin((p.phi) * Gaudi::Units::deg);
445  vec.y() = RAD * sin(p.phi * Gaudi::Units::deg);
446  vec.y() = vec.y() + p.shift * cos((p.phi) * Gaudi::Units::deg);
447 
448  if (p.isMirrored) {
449  if ((p.isBarrelLike) || (m_name[0] == 'B')) {
450  // correct the z location (=-p.z-m_length) for possible m_amdbOrigine_along_length
451  vec.z() = p.z + getAmdbOrigine_along_length();
452  } else {
453  vec.z() = p.z + GetThickness(mysql); // re-establish the amdb z location (with a - sign)
454  }
455  } else {
456  if ((p.isBarrelLike) || (m_name[0] == 'B' && p.zindex < 0 && hasMdts())) {
457  double halfpitch = mdtHalfPitch(mysql);
458  vec.z() = p.z + halfpitch;
459  } else {
460  vec.z() = p.z;
461  }
462  }
463 
464  ATH_MSG_VERBOSE(" translation according to " << vec.x() << " " << vec.y() << " " << vec.z());
465 
466  // // define the rotations by alpha, beta, gamma
467  GeoTrf::RotateX3D ralpha(p.alpha * Gaudi::Units::deg);
468  GeoTrf::RotateZ3D rbeta(p.beta * Gaudi::Units::deg);
469  GeoTrf::RotateY3D rgamma(p.gamma * Gaudi::Units::deg);
470 
471  ATH_MSG_VERBOSE(" gamma is not changing sign - original " << p.gamma << " new one " << p.gamma <<
472  " alpha / beta " << p.alpha << " " << p.beta);
473 
474  // // apply all transform in sequence
475  // // GeoTrf::Transform3D to_tsz = rgamma*rbeta*ralpha*AMDBorgTranslation*mirrsym;
476  // works for barrel and barrel-like
477  // // imt: tested for CTB2004, seems to work for all amdb versions...
478  GeoTrf::Transform3D abgRot = rgamma * rbeta * ralpha;
479 
480  if (m_name[0] == 'B' || p.isBarrelLike) {
481  // here all Barrel chambers
482  nominalTransf = GeoTrf::RotateZ3D(p.phi * Gaudi::Units::deg);
483  } else {
484  // replace this with the folowing lines 8/06/2006 SS because, EC not mirrored chambers have anyway to be rotated
485  // by 180deg around z to mov ecoherently their local reference frame and the tube-layer numbering
486  // if ( p.z>=0 || ( p.z<0 && !(p.isMirrored) ) ){
487  // nominalTransf = GeoTrf::Transform3D(GeoTrf::RotateY3D(-90*Gaudi::Units::deg)*
488  // GeoTrf::RotateX3D(p.phi*Gaudi::Units::deg-180*Gaudi::Units::deg));
489  // }
490  // else if (p.z<0 && p.isMirrored){
491  // nominalTransf = GeoTrf::Transform3D(GeoTrf::RotateY3D(-90*Gaudi::Units::deg)*
492  // GeoTrf::RotateX3D(p.phi*Gaudi::Units::deg-180*Gaudi::Units::deg)*
493  // GeoTrf::RotateZ3D(180*Gaudi::Units::deg));
494  // }
495  if (p.z >= 0) {
496  nominalTransf = GeoTrf::Transform3D(GeoTrf::RotateY3D(-90 * Gaudi::Units::deg) * GeoTrf::RotateX3D(p.phi * Gaudi::Units::deg - 180 * Gaudi::Units::deg));
497  } else if (p.z < 0) {
498  nominalTransf = GeoTrf::Transform3D(GeoTrf::RotateY3D(-90 * Gaudi::Units::deg) * GeoTrf::RotateX3D(p.phi * Gaudi::Units::deg - 180 * Gaudi::Units::deg) *
499  GeoTrf::RotateZ3D(180 * Gaudi::Units::deg));
500  } else {
501  ATH_MSG_WARNING("Problem here p.z, mirrored " << p.z << " " << p.isMirrored);
502  }
503  }
504 
505  return GeoTrf::Translate3D(vec.x(), vec.y(), vec.z()) * nominalTransf * abgRot;
506  }

◆ tsz_to_native_frame()

GeoTrf::Transform3D MuonGM::Station::tsz_to_native_frame ( const MYSQL mysql,
const Position p 
) const

Definition at line 426 of file Station.cxx.

427  { return (native_to_tsz_frame(mysql, p)).inverse(); }

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const Station s 
)
friend

Definition at line 326 of file Station.cxx.

326  {
327  os << "Station m_name: " << s.m_name << " " << s.m_components.size() << std::endl;
328  for (unsigned int i = 0; i < s.m_components.size(); i++)
329  os << "\t" << s.m_components[i].get() << std::endl;
330 
332  for (k = s.begin(); k != s.end(); ++k)
333  os << "\t\t" << (*k).second << std::endl;
334 
335  AlignPosIterator ak;
336  for (ak = s.abegin(); ak != s.aend(); ++ak)
337  os << "\t\t" << (*ak).second << std::endl;
338 
339  os << "--------------------------------------------------" << std::endl;
340  return os;
341  }

Member Data Documentation

◆ ATLAS_THREAD_SAFE

std::atomic_flag m_initialized AthMessaging::ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
mutableprivateinherited

Messaging initialized (initMessaging)

Definition at line 141 of file AthMessaging.h.

◆ m_alignpositions

AlignPosMap MuonGM::Station::m_alignpositions {}
private

Definition at line 102 of file Station.h.

◆ m_amdbOrigine_along_length

std::atomic<double> MuonGM::Station::m_amdbOrigine_along_length
mutableprivate

Definition at line 95 of file Station.h.

◆ m_amdbOrigine_along_thickness

std::atomic<double> MuonGM::Station::m_amdbOrigine_along_thickness
mutableprivate

Definition at line 96 of file Station.h.

◆ m_components

std::vector<std::unique_ptr<Component> > MuonGM::Station::m_components {}
private

Definition at line 99 of file Station.h.

◆ m_cutouts

std::vector< std::unique_ptr<Cutout> > MuonGM::Station::m_cutouts {}
private

Definition at line 100 of file Station.h.

◆ m_hasMdts

bool MuonGM::Station::m_hasMdts {false}
private

Definition at line 98 of file Station.h.

◆ m_imsg

std::atomic<IMessageSvc*> AthMessaging::m_imsg { nullptr }
mutableprivateinherited

MessageSvc pointer.

Definition at line 135 of file AthMessaging.h.

◆ m_lvl

std::atomic<MSG::Level> AthMessaging::m_lvl { MSG::NIL }
mutableprivateinherited

Current logging level.

Definition at line 138 of file AthMessaging.h.

◆ m_msg_tls

boost::thread_specific_ptr<MsgStream> AthMessaging::m_msg_tls
mutableprivateinherited

MsgStream instance (a std::cout like with print-out levels)

Definition at line 132 of file AthMessaging.h.

◆ m_name

std::string MuonGM::Station::m_name {}
private

Definition at line 97 of file Station.h.

◆ m_nm

std::string AthMessaging::m_nm
privateinherited

Message source name.

Definition at line 129 of file AthMessaging.h.

◆ m_positions

PositionMap MuonGM::Station::m_positions {}
private

Definition at line 101 of file Station.h.


The documentation for this class was generated from the following files:
MuonGM::Station::hasMdts
bool hasMdts() const
Definition: Station.h:88
AthMessaging::m_lvl
std::atomic< MSG::Level > m_lvl
Current logging level.
Definition: AthMessaging.h:138
ymin
double ymin
Definition: listroot.cxx:63
MuonGM::Station::tsz_to_global_frame
GeoTrf::Transform3D tsz_to_global_frame(const MYSQL &mysql, const Position &p) const
Definition: Station.cxx:430
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
MuonGM::Station::m_components
std::vector< std::unique_ptr< Component > > m_components
Definition: Station.h:99
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
max
#define max(a, b)
Definition: cfImp.cxx:41
MuonGM::Station::m_amdbOrigine_along_length
std::atomic< double > m_amdbOrigine_along_length
Definition: Station.h:95
MuonGM::Station::getAmdbOrigine_along_thickness
double getAmdbOrigine_along_thickness(const MYSQL &mysql) const
Definition: Station.cxx:558
MuonGM::Station::m_cutouts
std::vector< std::unique_ptr< Cutout > > m_cutouts
Definition: Station.h:100
deg
#define deg
Definition: SbPolyhedron.cxx:17
MuonGM::Station::m_positions
PositionMap m_positions
Definition: Station.h:101
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:12
MuonGM::Station::getYMin
double getYMin() const
Definition: Station.cxx:209
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
AthMessaging::m_imsg
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
Definition: AthMessaging.h:135
x
#define x
python.SystemOfUnits.ms
int ms
Definition: SystemOfUnits.py:132
python.AtlRunQueryParser.ap
ap
Definition: AtlRunQueryParser.py:826
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
CxxUtils::vec
typename vecDetail::vec_typedef< T, N >::type vec
Define a nice alias for the vectorized type.
Definition: vec.h:207
AthMessaging::AthMessaging
AthMessaging()
Default constructor:
TrigConf::MSGTC::Level
Level
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:21
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
AthMessaging::msgLvl
bool msgLvl(const MSG::Level lvl) const
Test the output level.
Definition: AthMessaging.h:151
lumiFormat.i
int i
Definition: lumiFormat.py:92
MuonGM::Station::m_name
std::string m_name
Definition: Station.h:97
beamspotman.n
n
Definition: beamspotman.py:731
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
MuonGM::PositionIterator
std::map< int, Position, std::less< int > >::const_iterator PositionIterator
Definition: Station.h:37
MuonGM::Station::FindPosition
PositionIterator FindPosition(int iz, int iphi) const
Definition: Station.cxx:99
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
MuonGM::Station::getAmdbOrigine_along_length
double getAmdbOrigine_along_length() const
Definition: Station.cxx:553
MuonGM::AlignPosIterator
std::multimap< int, AlignPos, std::less< int > >::const_iterator AlignPosIterator
Definition: Station.h:38
MuonGM::Station::tsz_to_native_frame
GeoTrf::Transform3D tsz_to_native_frame(const MYSQL &mysql, const Position &p) const
Definition: Station.cxx:426
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
AthMessaging::msg
MsgStream & msg() const
The standard message stream.
Definition: AthMessaging.h:164
trigbs_pickEvents.num
num
Definition: trigbs_pickEvents.py:76
MuonGM::Station::FindAlignPos
AlignPosIterator FindAlignPos(int iz, int iphi) const
Definition: Station.cxx:62
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
MuonGM::Station::GetLength
double GetLength() const
Definition: Station.cxx:160
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
makeTRTBarrelCans.dy
tuple dy
Definition: makeTRTBarrelCans.py:21
MuonGM::Station::getDeltaTransform_tszFrame
GeoTrf::Transform3D getDeltaTransform_tszFrame(const MYSQL &mysql, const AlignPos &ap) const
Definition: Station.cxx:519
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
y
#define y
MuonGM::Station::GetNrOfComponents
int GetNrOfComponents() const
Definition: Station.cxx:322
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
lwtDev::Component
Component
Definition: NNLayerConfig.h:25
AthMessaging::m_nm
std::string m_nm
Message source name.
Definition: AthMessaging.h:129
MuonGM::Station::m_alignpositions
AlignPosMap m_alignpositions
Definition: Station.h:102
MuonGM::Station::GetThickness
double GetThickness(const MYSQL &mysql) const
Definition: Station.cxx:112
MuonGM::Station::native_to_tsz_frame
GeoTrf::Transform3D native_to_tsz_frame(const MYSQL &mysql, const Position &p) const
Definition: Station.cxx:371
MuonGM::Station::m_amdbOrigine_along_thickness
std::atomic< double > m_amdbOrigine_along_thickness
Definition: Station.h:96
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14
AthMessaging::initMessaging
void initMessaging() const
Initialize our message level and MessageSvc.
Definition: AthMessaging.cxx:39
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
MuonGM::Station::end
PositionIterator end() const
Definition: Station.cxx:108
python.IoTestsLib.w
def w
Definition: IoTestsLib.py:200
AthMessaging::m_msg_tls
boost::thread_specific_ptr< MsgStream > m_msg_tls
MsgStream instance (a std::cout like with print-out levels)
Definition: AthMessaging.h:132
MuonGM::Station::GetComponent
Component * GetComponent(int i) const
Definition: Station.cxx:83
MuonGM::Station::mdtHalfPitch
double mdtHalfPitch(const MYSQL &mysql) const
Definition: Station.cxx:343
python.compressB64.c
def c
Definition: compressB64.py:93
MuonGM::Station::m_hasMdts
bool m_hasMdts
Definition: Station.h:98
MDT
@ MDT
Definition: RegSelEnums.h:31
fitman.k
k
Definition: fitman.py:528
ymax
double ymax
Definition: listroot.cxx:64
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37