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

#include <MuonChamberLite.h>

Inheritance diagram for MuonGM::MuonChamberLite:
Collaboration diagram for MuonGM::MuonChamberLite:

Public Member Functions

 MuonChamberLite (const MYSQL &mysql, Station *s, std::map< std::string, GeoFullPhysVol * > *mapFPV, std::map< std::string, GeoAlignableTransform * > *mapAXF)
 
GeoVPhysVol * addReadoutLayers (const MYSQL &mysql, MuonDetectorManager *manager, int ieta, int iphi, bool is_mirrored, bool &isAssembly)
 
virtual void print () const override
 
void setKeyset (std::set< std::string > *keySet)
 
void setLogVolName (const std::string &str)
 
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...
 

Public Attributes

double width {0.}
 
double length {0.}
 
double thickness {0.}
 
double longWidth {0.}
 
std::array< double, 10 > rotangle {}
 
std::string name {}
 
std::string logVolName {}
 

Private Member Functions

void setCscReadoutGeom (const MYSQL &mysql, CscReadoutElement *re, const CscComponent *cc, const Position &p)
 
void setMdtReadoutGeom (const MYSQL &mysql, MdtReadoutElement *re, const MdtComponent *cc, const Position &p)
 
void setRpcReadoutGeom (const MYSQL &mysql, RpcReadoutElement *re, const RpcComponent *cc, const Position &p)
 
void setTgcReadoutGeom (const MYSQL &mysql, TgcReadoutElement *re, const TgcComponent *cc, const Position &p, const std::string &statname)
 
void initMessaging () const
 Initialize our message level and MessageSvc. More...
 

Private Attributes

Stationm_station {nullptr}
 
std::map< std::string, GeoFullPhysVol * > * m_mapFPV {nullptr}
 
std::map< std::string, GeoAlignableTransform * > * m_mapAXF {nullptr}
 
std::set< std::string > * m_keySet {nullptr}
 
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...
 

Detailed Description

Definition at line 31 of file MuonChamberLite.h.

Constructor & Destructor Documentation

◆ MuonChamberLite()

MuonGM::MuonChamberLite::MuonChamberLite ( const MYSQL mysql,
Station s,
std::map< std::string, GeoFullPhysVol * > *  mapFPV,
std::map< std::string, GeoAlignableTransform * > *  mapAXF 
)

Definition at line 84 of file MuonChamberLite.cxx.

86  :
87  DetectorElement(s->GetName()),
88  AthMessaging{"MuonchamberLite"},
89  m_mapFPV(mapFPV),
90  m_mapAXF(mapAXF)
91  {
92  width = s->GetWidth1();
93  longWidth = s->GetWidth2();
94  thickness = s->GetThickness(mysql);
95  length = s->GetLength();
96  m_station = s;
97 
98  // CSL envelope is too small for its components - enlarge it slightly
99  std::string stname(m_station->GetName(), 0, 3);
100  if (stname == "CSL")
101  longWidth *= 1.015;
102 
103 
104  }

Member Function Documentation

◆ addReadoutLayers()

GeoVPhysVol * MuonGM::MuonChamberLite::addReadoutLayers ( const MYSQL mysql,
MuonDetectorManager manager,
int  ieta,
int  iphi,
bool  is_mirrored,
bool &  isAssembly 
)

< fi here goes from 0 to 7; in amdb from 1 to 8;

< fi here goes from 0 to 7; in amdb from 1 to 8;

init design : design uses global (converting back to local) positions

Definition at line 106 of file MuonChamberLite.cxx.

108  {
109 
110 
111 
112  ATH_MSG_VERBOSE( " Building a MuonChamberLite for m_station " << m_station->GetName() << " at zi, fi " << zi << " " << fi + 1 << " is_mirrored " << is_mirrored
113  << " is assembly = " << isAssembly );
114 
115  std::string stname(m_station->GetName(), 0, 3);
116 
117  double halfpitch = m_station->mdtHalfPitch(mysql);
118  const std::string stName = m_station->GetName();
119 
120  const MdtIdHelper *mdt_id = manager->mdtIdHelper();
121  int stationType = mdt_id->stationNameIndex(stName.substr(0, 3));
122 
123  double extratop = m_station->GetExtraTopThickness();
124  double extrabottom = m_station->GetExtraBottomThickness();
125  double totthick = thickness + extratop + extrabottom;
126 
127 
128  double amdbOrigine_along_length = m_station->getAmdbOrigine_along_length();
129  double amdbOrigine_along_thickness = m_station->getAmdbOrigine_along_thickness(mysql);
130 
131 
132  // This will allow the MDT tube structure to be mirrored w.r.t. the chamber at z>0
133  // and to correctly place any other component in the m_station
134  if (zi < 0 && !is_mirrored && stName[0] == 'B') {
135  if (m_station->hasMdts()) {
136  amdbOrigine_along_length += halfpitch;
137  }
138  }
139  ATH_MSG_VERBOSE( "amdb origine: in the length direction = "
140  << amdbOrigine_along_length << " in the thickness direction = " << amdbOrigine_along_thickness);
141 
142  if (isAssembly) {
143  ATH_MSG_DEBUG("Station " << stName << " at zi, fi " << zi << " " << fi + 1 << " will be described as Assembly" );
144 
145  }
146 
147  // for BOG in layout Q we will have to shorten CHV, CMI as these
148  // are not shortened in AMDB
149 
150 
151  // if this is a BOG, we want to make cutouts in the MOTHER VOLUME
152  if (stName.compare(0, 3, "BOG") == 0 && (manager->IncludeCutoutsBogFlag() || manager->IncludeCutoutsFlag())) {
153 
154  ATH_MSG_VERBOSE( "amdb org: length= " << amdbOrigine_along_length << " thickness= " << amdbOrigine_along_thickness );
155 
156  std::string statType = stName.substr(0, 3);
157  if (m_station->GetNrOfCutouts() > 0) {
158  ATH_MSG_DEBUG( "Station " << stName << " at zi, fi " << zi << " " << fi + 1 << " has components with cutouts " );
159  isAssembly = true;
160 
161  // look for FIRST component with cutouts and loop over all of the cutouts:
162  bool foundCutouts = false;
163  for (int j = 0; j < m_station->GetNrOfComponents(); j++) {
164  StandardComponent *c = (StandardComponent *)m_station->GetComponent(j);
165 
166  if (!foundCutouts) {
167  for (int ii = 0; ii < m_station->GetNrOfCutouts(); ii++) {
168  Cutout *cut = m_station->GetCutout(ii);
169  // if this is a BOG in layout Q, set the CP param:
170  // (both cuts have same length so ok to reset it)
171  // also do here some tweaking to prevent undershoot
172  // of the cutouts wrt mother volume:
173  if (std::abs(cut->dx - 600.7) < 0.1) {
174  cut->dx = cut->dx + 10. * Gaudi::Units::mm;
175  cut->widthXs = cut->widthXs + 20. * Gaudi::Units::mm;
176  cut->widthXl = cut->widthXl + 20. * Gaudi::Units::mm;
177  }
178  if (std::abs(cut->dx + 600.7) < 0.1) {
179  cut->dx = cut->dx - 10. * Gaudi::Units::mm;
180  cut->widthXs = cut->widthXs + 20. * Gaudi::Units::mm;
181  cut->widthXl = cut->widthXl + 20. * Gaudi::Units::mm;
182  }
183  if (std::abs(cut->lengthY - 180.2) < 0.001) {
184  cut->lengthY = cut->lengthY + (0.010) * Gaudi::Units::mm;
185  }
186  if (std::abs(cut->dy - 1019.8) < 0.001) {
187  cut->dy = 1216.4185 - cut->lengthY;
188  }
189  // create the cutout with the full thickness of the STATION
190  cut->setThickness(totthick * 1.01); // extra to be sure
191  if ((cut->subtype == mysql.allocPosFindSubtype(std::string(statType), fi, zi)) && (cut->icut == mysql.allocPosFindCutout(std::string(statType), fi, zi)) &&
192  (cut->ijob == c->index)) {
193 
194  foundCutouts = true;
195  }
196  } // Loop over cutouts
197  } // If no cutouts
198  } // Loop over components
199  }
200  } // end of special loop just for cutouts
201 
202 
203 
204  double ypos{0.}, zpos{0.}, xpos{0.}, irad{0.};
205  std::array<int, 2 > ndbz{0, 0};
206 
207  // Compute how many RPC modules there are in the m_station
208  int nDoubletR{0}, nRpc{0}, nTgc{0}, nCsc{0}, nMdt{0};
209  double previous_depth = 0.;
210 
211  ATH_MSG_VERBOSE( " Station Name = " << stName << " fi/zi " << fi << "/" << zi << " defining the n. of DoubletR to " );
212 
213 
214  for (int j = 0; j < m_station->GetNrOfComponents(); j++) {
215  StandardComponent *d = (StandardComponent *)m_station->GetComponent(j);
216  std::string_view cn = std::string_view(d->name).substr(0, 3);
217  if (cn == "RPC") {
218  nRpc++;
219  if (nRpc == 1)
220  nDoubletR++;
221  double depth = -thickness / 2. + d->posz + d->GetThickness(mysql) / 2.;
222  // BI RPC Chambers have one one doubletR
223  if (!(stname.compare(0, 2, "BI") == 0) && nDoubletR == 1 && nRpc > 1 && depth * previous_depth < 0)
224  nDoubletR++;
225 
226  previous_depth = depth;
227  }
228  else if (cn == "CSC") {
229  nCsc++;
230  }
231  else if (cn == "TGC") {
232  nTgc++;
233  }
234  else if (cn == "MDT") {
235  nMdt++;
236  }
237  }
238  ATH_MSG_DEBUG( "nDoubletR: " << nDoubletR<<" nMdt/Rpc/Tgc/Csc " << nMdt << "/" << nRpc << "/" << nTgc << "/" << nCsc );
239 
240  // Get location and dimensions of long beams and pass them to cross beams
241  // in order to make holes
242  int numLB = -1;
243  double LBheight{0.}, LBwidth{0.};
244  std::array<double, 2> LBpos{-1, -1};
245  for (int i = 0; i < m_station->GetNrOfComponents(); i++) {
246  StandardComponent *c = (StandardComponent *)m_station->GetComponent(i);
247  std::string_view cname = std::string_view(c->name).substr(0, 2);
248  if (cname == "LB") {
249  const LBI *lb = dynamic_cast<const LBI *>(mysql.GetTechnology(c->name));
250  numLB++;
251  LBpos[numLB] = c->posy + c->dy / 2.;
252  LBheight = lb->height;
253  LBwidth = c->dy;
254  }
255  if (numLB > 0)
256  break; // only 2 LBs per chamber
257  }
258 
259  for (int i = 0; i < m_station->GetNrOfComponents(); i++) {
260  StandardComponent *c = (StandardComponent *)m_station->GetComponent(i);
261  std::string_view cname = std::string_view(c->name).substr(0, 3);
262  if (cname == "CRO" || cname == "CMI" || cname == "CHV") {
263  CbmComponent *ccbm = (CbmComponent *)c;
264  ccbm->lb_height = LBheight;
265  ccbm->lb_width = LBwidth;
266  ccbm->hole_pos1 = LBpos[0];
267  ccbm->hole_pos2 = LBpos[1];
268  }
269  }
270 
271  // Look for the subtype of the CMI in the chamber to let LB know ...
272  std::string CMIcomponentNumber = "";
273  for (int j = 0; j < m_station->GetNrOfComponents(); j++) {
274  StandardComponent *d = (StandardComponent *)m_station->GetComponent(j);
275  std::string_view cn = std::string_view(d->name).substr(0, 3);
276  if (cn == "CMI") {
277  CMIcomponentNumber = (d->name).substr(3, 2);
278  break;
279  }
280  }
281 
282  for (int j = 0; j < m_station->GetNrOfComponents(); j++) {
283  StandardComponent *d = (StandardComponent *)m_station->GetComponent(j);
284  std::string_view cn = std::string_view(d->name).substr(0, 2);
285  if (cn == "LB") {
286  LbiComponent *lbic = (LbiComponent *)d;
287  if (lbic) {
288  lbic->associated_CMIsubtype = CMIcomponentNumber;
289  } else
290  ATH_MSG_ERROR( "MuonChamberLite :: cannot associate a CMI subtype to the LB component " );
291  }
292  }
293 
294  // Build the MuonStation(readout-geometry) corresponding to this MuonChamberLite(raw-geometry)
295  MuonStation *mstat;
296  if (stName.compare(0, 1, "B") == 0) {
297  mstat = new MuonStation(stName.substr(0, 3), width, totthick, length, longWidth, totthick, length, zi, fi + 1,
298  (zi < 0 && !is_mirrored));
299  } else {
300  mstat = new MuonStation(stName.substr(0, 3), width, length, totthick, longWidth, length, totthick, zi, fi + 1,
301  (zi < 0 && !is_mirrored));
302  }
303 
304  manager->addMuonStation(std::unique_ptr<MuonStation>(mstat));
305  ATH_MSG_DEBUG( " Building a MuonStation for this MuonChamberLite " << m_station->GetName()
306  << " at zi, fi " << zi << " " << fi + 1 << " is_mirrored " << is_mirrored);
307 
308  GeoFullPhysVol *ptrd=(*m_mapFPV)[std::string(stName)+"_Station"+"_"+std::to_string(zi)+"_"+std::to_string(fi)];
309  mstat->setPhysVol(ptrd);
310  // here the big loop over the components !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
311  for (int i = 0; i < m_station->GetNrOfComponents(); i++) {
312  StandardComponent *c = (StandardComponent *)m_station->GetComponent(i);
313  ATH_MSG_VERBOSE( " Component index " << c->index << " in loop for " << stName << " " << stationType << " at zi, fi " << zi << " " << fi + 1 << " cName "
314  << c->name << " thickness " << c->GetThickness(mysql) << " length " << c->dy << " w, lw " << c->dx1 << " " << c->dx2 );
315  ATH_MSG_VERBOSE( " Component local (amdb) coords " << c->posx << " " << c->posy << " " << c->posz );
316 
317  ypos = -thickness / 2. + c->posz + c->GetThickness(mysql) / 2.;
318  zpos = 0.;
319  xpos = 0.;
320 
321  ypos = -thickness / 2. + (c->posz + amdbOrigine_along_thickness) + c->GetThickness(mysql) / 2.;
322  zpos = -length / 2. + amdbOrigine_along_length + c->posy + c->dy / 2.;
323  xpos = c->posx;
324 
325  const std::string &techname = c->name;
326  std::string_view type = std::string_view(techname).substr(0, 3);
327 
328 
329 
330  GeoFullPhysVol *lvm = nullptr;
331  GeoFullPhysVol *lvr = nullptr;
332  GeoFullPhysVol *lvt = nullptr;
333  GeoFullPhysVol *lvc = nullptr;
334 
335 
336 
337  // Are there cutouts?
338  std::string statType = stName.substr(0, 3);
339  double cthickness = c->GetThickness(mysql);
340  int ncutouts = 0;
341  std::vector<Cutout *> vcutdef;
342  std::vector<std::unique_ptr<Cutout>> vcutdef_todel;
343  for (int ii = 0; ii < m_station->GetNrOfCutouts(); ii++) {
344  Cutout *cut = m_station->GetCutout(ii);
345  cut->setThickness(cthickness * 1.01); // extra thickness to be sure
346 
347  if ((cut->subtype == mysql.allocPosFindSubtype(std::string(statType), fi, zi)) && (cut->icut == mysql.allocPosFindCutout(std::string(statType), fi, zi)) && (cut->ijob == c->index)) {
348 
349  double tempdx = cut->dx;
350  double tempdy = cut->dy;
351  double templengthY = cut->lengthY;
352  cut->dx = 0.;
353  cut->dy = 0.;
354 
355  if (stName.compare(0, 3, "BOG") == 0) {
356  // make the cutouts a bit longer
357  cut->lengthY = templengthY + 31.;
358  }
359 
360  cut->dx = tempdx;
361  cut->dy = tempdy;
362 
363  if (std::abs(cut->dead1) > 1. && techname == "MDT03")
364  cut->dy = cut->dy + 15.0 * cos(cut->dead1 * Gaudi::Units::deg);
365  // should compensate for the dy position defined in amdb at the bottom of the foam in ML 1 of EMS1,3 and BOS 6
366  // can be applied only for layout >=r.04.04 in rel 15.6.X.Y due to the frozen Tier0 policy
367 
368  cut->lengthY = templengthY;
369  // in thickness, cutout will coincide with component
370  // not needed (DHW) double xposcut = 0.; // rel. to component thickness
371  ncutouts++;
372  ATH_MSG_VERBOSE( "A new cutout for this component " );
373  ATH_MSG_VERBOSE( *cut );
374 
375  // Corrected cutout values for BMS7, BMS14
376  if (stName.compare(0, 3, "BMS") == 0) {
377  if (fi == 3) { // stationPhi = 4
378  if (std::abs(zi) == 1) { // stationEta = +-1
379  double margin = 1.0; // make cutout a little bigger to avoid coincident boundaries
380 
381  if (type == "RPC" || type == "DED") {
382  cut->widthXl += 2 * margin;
383  cut->widthXs += 2 * margin;
384  cut->dx += margin;
385  cut->lengthY += 2 * margin;
386 
387  if (zi > 0)
388  cut->dy = -margin;
389  }
390  }
391 
392  if (zi == -1) {
393  if (type == "MDT")
394  cut->dy = 0.;
395  }
396  }
397  }
398 
399  // the following is a fine tuning ----- MUST CHECK for a better solution
400  if (stName.compare(0, 3,"BOS") == 0 && zi == -6 && type == "MDT") {
401  cut->dy = c->dy - cut->dy - cut->lengthY - halfpitch;
402  cut->dead1 = 30.; // why this is not 30. or -30. already ?????
403  if (techname == "MDT03")
404  cut->dy = cut->dy + 30.0; // *cos(cut->dead1*Gaudi::Units::deg);
405  ATH_MSG_VERBOSE( "Cut dead1 for BOS 6 on C side is " << cut->dead1 );
406 
407  }
408 
409  // this mirroring of the cutout is necessary only for barrel MDT chambers; for EC the cutout will be automatically mirrored
410  // this fix cannot be applied in 15.6.X.Y for layout < r.04.04 due to the frozen tier0 policy
411 
412  if (type == "MDT" && (is_mirrored || zi < 0) && stName.compare(0, 1, "B") == 0) {
413  // MDT in chambers explicitly described at z<0 have to be
414  // rotated by 180deg to adj. tube staggering
415  // reverse the position (x amdb) of the cutout if the m_station is mirrored
416  Cutout *cutmirr = new Cutout(*cut);
417  cutmirr->dx = -cutmirr->dx;
418  // this way, after the rotation by 180 Gaudi::Units::deg, the cut will be at the same global phi
419  // it has for the m_station at z>0
420  vcutdef.push_back(cutmirr);
421  vcutdef_todel.emplace_back(cutmirr);
422  ATH_MSG_VERBOSE( "adding for application mirrored cut \n" << *cutmirr );
423 
424  } else if (type == "RPC" || type == "DED") {
425  Cutout *cutRpcType = new Cutout(*cut);
426  // temporary for testing fixes to r.03.09
427  if (stName.compare(0, 3, "BMS") == 0 && zi == 4 && (c->index == 20 || c->index == 21 || c->index == 24 || c->index == 25)) {
428  cutRpcType->dy = 1102.5;
429  }
430 
431  if (stName.compare(0, 3, "BOS") == 0 && zi == 6 && type == "DED")
432  cutRpcType->dy = 706.;
433 
434  cutRpcType->dy = cutRpcType->dy - c->posy;
435  cutRpcType->dx = cutRpcType->dx - c->posx;
436 
437  if (type == "RPC") {
438  RpcComponent *rp = (RpcComponent *)c;
439  if (rp->iswap == -1) {
440  cutRpcType->dy = c->dy - (cutRpcType->dy + cutRpcType->lengthY);
441  }
442  }
443 
444  ATH_MSG_VERBOSE( " Rpc or ded cutout redefined as follows \n" << *cutRpcType );
445  vcutdef.push_back(cutRpcType);
446  vcutdef_todel.emplace_back(cutRpcType);
447  } else if (type == "TGC") {
448  // In AMDB, y coordinates of cutout and component are given by
449  // radius from detector z-axis. To get standard y value of cutout,
450  // subtract radius of component from radius of cutout
451  Cutout *tgccut = new Cutout(*cut);
452  tgccut->dy -= c->posy; //
453 
454  ATH_MSG_VERBOSE( " Tgc cutout redefined as follows \n" << *tgccut );
455  vcutdef.push_back(tgccut);
456  vcutdef_todel.emplace_back(tgccut);
457  } else {
458  vcutdef.push_back(cut);
459  }
460  }
461  } // Loop over cutouts in m_station
462 
463  if (ncutouts > 0) {
464  ATH_MSG_DEBUG( c->name << " of station " << stName << " at fi/zi " << fi + 1 << "/" << zi << " has " << ncutouts << " cutouts " );
465  }
466  // define here the total transform that will be applied to component:
467  GeoTrf::Transform3D htcomponent(GeoTrf::Transform3D::Identity());
468  GeoAlignableTransform *xfaligncomponent{nullptr};
469  // for RPCs we need a vector of transforms for M28 geometry...
470 
471  if (type == "CRO") {
472  if (stName.compare(0, 1, "B") != 0 && is_mirrored)
473  mstat->setxAmdbCRO(-xpos);
474  else
475  mstat->setxAmdbCRO(xpos);
476  }
477 
478  if (type == "MDT") {
479  MdtComponent *md= (MdtComponent *) c;
480  htcomponent = GeoTrf::TranslateX3D(ypos) * GeoTrf::TranslateZ3D(zpos) * GeoTrf::TranslateY3D(xpos);
481 
482  if (zi < 0 && !is_mirrored && stName[0] == 'B') {
483  // this (rotation + shift of halfpitch) will mirror the tube structure w.r.t. the chamber at z>0
484  htcomponent = htcomponent * GeoTrf::RotateX3D(180. * Gaudi::Units::deg);
485  htcomponent = htcomponent * GeoTrf::TranslateZ3D(halfpitch);
486  }
487 
488  // ss - 24-05-2006 I don't really understand if this is needed at all
489  // it was introduced by Isabel T.
490  if (zi < 0 && stName.compare(0, 3, "BOG") == 0 && is_mirrored) {
491  // htcomponent = htcomponent*GeoTrf::RotateX3D(180.*Gaudi::Units::deg);
492  // tubes OK but chambers wrong
493  // htcomponent = GeoTrf::RotateX3D(180.*Gaudi::Units::deg)*htcomponent;
494  // chambers OK but tubes wrong
495  htcomponent = GeoTrf::RotateX3D(180. * Gaudi::Units::deg) * htcomponent * GeoTrf::RotateX3D(180. * Gaudi::Units::deg); // turn chambers but go back for tubes
496  } // ss - 24-05-2006 I don't really understand if this is needed at all
497 
498  std::string key =std::string( stName) + techname;
499  xfaligncomponent = (*m_mapAXF)[key+"_"+std::to_string(zi)+"_"+std::to_string(fi)+"_"+std::to_string(md->index)];
500 
501  // for cutouts:
502  // MDT cutouts for BOS1,5, BMS7,14, (problem with BMS4,10), EMS, BMG and BIS MDT14
503  bool mdtCutoutFlag = ((stname == "BOS" && std::abs(zi) == 6) || stname == "BMG" || techname == "MDT14" || (stname == "BMS" && (std::abs(zi) == 1 && fi == 3)) ||
504  (stname == "EMS" && (std::abs(zi) == 1 || std::abs(zi) == 3)));
505  if (((manager->IncludeCutoutsFlag() && mdtCutoutFlag) || (manager->IncludeCutoutsBogFlag() && stName.compare(0, 3, "BOG") == 0)) && zi >= 0) {
506  key += "p" + buildString(mysql.allocPosFindSubtype(statType, fi, zi), 0) + "_" + buildString(mysql.allocPosFindCutout(statType, fi, zi), 0);
507  } else if (((manager->IncludeCutoutsFlag() && mdtCutoutFlag) || (manager->IncludeCutoutsBogFlag() && stName.compare(0, 3, "BOG")) == 0) && zi < 0) {
508  key += "m" + buildString(mysql.allocPosFindSubtype(statType, fi, zi), 0) + "_" + buildString(mysql.allocPosFindCutout(statType, fi, zi), 0);
509  }
510  if (m_keySet->find(key)==m_keySet->end()) {
511  std::unique_ptr<Mdt> r = std::make_unique<Mdt>(mysql, c, stName + techname);
512  if ((manager->IncludeCutoutsFlag() && mdtCutoutFlag) || (manager->IncludeCutoutsBogFlag() && stName.compare(0, 3, "BOG") == 0)) {
513  if (!vcutdef.empty()) r->processCutouts(vcutdef);
514  }
515  m_keySet->insert(key);
516  }
517  lvm = (*m_mapFPV)[key+"_"+std::to_string(zi)+"_"+std::to_string(fi)+"_"+std::to_string(md->index)];
518 
519  } else if (type == "RPC") {
520  // position stuff needed for cutout, used to be below:
521  RpcComponent *rp = (RpcComponent *)c;
522  int ndivy = rp->ndivy;
523  int ndivz = rp->ndivz;
524 
525  if (ndivz != 1 || ndivy != 1) {
526  ATH_MSG_ERROR( " RPC segmentation z,y " << ndivz << " " << ndivy );
527  }
528 
529  double xpos = c->posx;
530  // implement really the mirror symmetry
531  if (is_mirrored)
532  xpos = -xpos;
533 
534  ATH_MSG_VERBOSE( " In station " << stName << " with " << nDoubletR << " doubletR,"
535  << " RPC " << (c->name).substr(3, 2) << " has swap flag = " << rp->iswap << " ypos, zpos " << ypos << " " << zpos << " " );
536 
537  htcomponent = GeoTrf::TranslateX3D(ypos) * GeoTrf::TranslateY3D(xpos) * GeoTrf::TranslateZ3D(zpos);
538  if (rp->iswap == -1) { // this is like amdb iswap
539  htcomponent = htcomponent * GeoTrf::RotateY3D(180 * Gaudi::Units::deg);
540  }
541 
542  // end of position stuff
543 
544  bool rpcCutoutFlag = (stname == "BOS" && std::abs(zi) == 6) || (stname == "BMS" && (std::abs(zi) == 2 || std::abs(zi) == 4 || std::abs(zi) == 6)) ||
545  (stname == "BMS" && std::abs(zi) == 1 && fi == 3);
546  std::string key = stName + techname;
547  if (((manager->IncludeCutoutsFlag() && rpcCutoutFlag) || (manager->IncludeCutoutsBogFlag() && stName.compare(0, 3, "BOG") == 0)) && zi >= 0) {
548  key += "p" + buildString(mysql.allocPosFindSubtype(statType, fi, zi), 0) + "_" + buildString(mysql.allocPosFindCutout(statType, fi, zi), 0) + "_" +
549  buildString(vcutdef.size(), 0) + "_" + buildString(rp->iswap, 0);
550  } else if (((manager->IncludeCutoutsFlag() && rpcCutoutFlag) || (manager->IncludeCutoutsBogFlag() && stName.compare(0, 3, "BOG") == 0)) && zi < 0) {
551  key += "m" + buildString(mysql.allocPosFindSubtype(statType, fi, zi), 0) + "_" + buildString(mysql.allocPosFindCutout(statType, fi, zi), 0) + "_" +
552  buildString(vcutdef.size(), 0) + "_" + buildString(rp->iswap, 0);
553  }
554  xfaligncomponent = (*m_mapAXF)[key+"_"+std::to_string(zi)+"_"+std::to_string(fi)+"_"+std::to_string(rp->index)];
555  lvr = (*m_mapFPV)[key+"_"+std::to_string(zi)+"_"+std::to_string(fi)+"_"+std::to_string(rp->index)];
556  } else if (type == "TGC") {
557  TgcComponent *tg = (TgcComponent *)m_station->GetComponent(i);
558  TgcComponent *tgInner = (TgcComponent *)m_station->GetComponent(0);
559  irad = tgInner->posy;
560  TgcComponent *tgOuter = (TgcComponent *)m_station->GetComponent(m_station->GetNrOfComponents() - 1);
561  double orad = tgOuter->posy + tgOuter->dy;
562  double start = -(orad - irad) / 2. + (tg->posy - irad) + tg->dy / 2;
563  double xstart = -thickness / 2. + tg->GetThickness(mysql) / 2.;
564  htcomponent = GeoTrf::TranslateX3D(xstart + tg->posz) * GeoTrf::TranslateZ3D(start);
565 
566  // Define key for this TGC component
567  std::string key = std::string(stName) + techname;
568  if (manager->IncludeCutoutsFlag()) {
569  if (mysql.allocPosFindCutout(statType, fi, zi) > 0) {
570  // If there is a cutout for this chamber, give it a special key
571  if (zi >= 0) {
572  key += "p" + buildString(mysql.allocPosFindSubtype(statType, fi, zi), 0) + "_" + buildString(mysql.allocPosFindCutout(statType, fi, zi), 0);
573  } else if (zi < 0) {
574  key += "m" + buildString(mysql.allocPosFindSubtype(statType, fi, zi), 0) + "_" + buildString(mysql.allocPosFindCutout(statType, fi, zi), 0);
575  }
576  }
577  }
578 
579  key += std::to_string(int(10 * c->dx1));
580  xfaligncomponent = (*m_mapAXF)[key+"_"+std::to_string(zi)+"_"+std::to_string(fi)];
581 
582  lvt = (*m_mapFPV)[key+"_"+std::to_string(zi)+"_"+std::to_string(fi)];
583 
584  } else if (type == "CSC") {
585  htcomponent = GeoTrf::TranslateX3D(ypos) * GeoTrf::TranslateZ3D(zpos);
586  // Here define the key for this CSC component
587  std::string key = std::string(stName) + techname;
588  if (manager->IncludeCutoutsFlag() && zi >= 0) {
589  key += "p" + buildString(mysql.allocPosFindSubtype(statType, fi, zi), 0) + "_" + buildString(mysql.allocPosFindCutout(statType, fi, zi), 0);
590  } else if (manager->IncludeCutoutsFlag() && zi < 0) {
591  key += "m" + buildString(mysql.allocPosFindSubtype(statType, fi, zi), 0) + "_" + buildString(mysql.allocPosFindCutout(statType, fi, zi), 0);
592  }
593 
594  xfaligncomponent = (*m_mapAXF)[key+"_"+std::to_string(zi)+"_"+std::to_string(fi)];
595  lvc=(*m_mapFPV)[key+"_"+std::to_string(zi)+"_"+std::to_string(fi)];
596  } else {
597  if (type != "MDT" && type != "RPC" && type != "TGC" && type != "SUP" && type != "DED" && type != "SPA" && type != "CHV" && type != "CRO" && type != "CMI" &&
598  type != "LB0" && type != "LBI") {
599  ATH_MSG_WARNING("Unknown component " << type );
600  }
601  }
602 
603  // Place components in chamber envelope
604  if (lvm && manager->mdtIdHelper()) {
605  int stationEta = zi;
606  int stationPhi = fi + 1;
607  int ml = 1;
608  int tubel = 1;
609  int tube = 1;
610  if (ypos > 5.)
611  ml = 2; // Need >5 instead of >0 because BIS78 is not perfectly centered
612 
613 
614  const MdtIdHelper *mdt_id = manager->mdtIdHelper();
615  std::unique_ptr<MdtReadoutElement> det = std::make_unique<MdtReadoutElement>(lvm, stName, manager);
616  Position ip = mysql.GetStationPosition(stName.substr(0, 3), fi, zi);
617  setMdtReadoutGeom(mysql, det.get(), (MdtComponent *)c, ip);
618  det->setHasCutouts(ncutouts > 0);
619  det->setNMdtInStation(nMdt);
620  Identifier id = mdt_id->channelID(stationType, stationEta, stationPhi, ml, tubel, tube);
621  det->setIdentifier(id);
622  det->setMultilayer(ml);
623  det->setParentStationPV(PVConstLink(ptrd));
624  det->setParentMuonStation(mstat);
625  det->geoInitDone();
626 
627  if (ml == 1) {
628  // set fixed point for MDT deformations: s0,z0,t0 for the point at lowest t,z (z,y amdb) and s=x=0
629  mstat->setBlineFixedPointInAmdbLRS(c->posx, c->posy, c->posz);
630  } else {
631  const Amg::Vector3D b0 = mstat->getBlineFixedPointInAmdbLRS();
632  if (c->posy < b0.y())
633  mstat->setBlineFixedPointInAmdbLRS(b0.x(), c->posy, b0.z());
634  }
635 
636  int jobIndex = c->index;
637 
638  mstat->addMuonReadoutElementWithAlTransf(det.get(), xfaligncomponent, jobIndex);
639  manager->addMdtReadoutElement(std::move(det));
640  }
641 
642  if (lvc && manager->cscIdHelper()) {
643  CscComponent *cs = (CscComponent *)m_station->GetComponent(i);
644  int stationEta = zi;
645  int stationPhi = fi + 1;
646  int chamberLayer = 1;
647  if (ypos > 0.)
648  chamberLayer = 2;
649 
650  std::unique_ptr<CscReadoutElement> det = std::make_unique<CscReadoutElement>(lvc, stName, manager);
651  Position ip = mysql.GetStationPosition(stName.substr(0, 3), fi, zi);
652  setCscReadoutGeom(mysql, det.get(), cs, ip);
653 
654  const CscIdHelper *csc_id = manager->cscIdHelper();
655  det->setHasCutouts(ncutouts > 0);
656  Identifier id = csc_id->channelID(stationType, stationEta, stationPhi, chamberLayer, 1, 0, 1);
657  det->setIdentifier(id);
658 
659  det->setChamberLayer(chamberLayer);
660  det->setParentStationPV(PVConstLink(ptrd));
661  det->setParentMuonStation(mstat);
662 
663  int jobIndex = c->index;
664  //
665  mstat->addMuonReadoutElementWithAlTransf(det.get(), xfaligncomponent, jobIndex);
666 
667 
668 
669  // set alignment parameters for the wire layers
670  manager->addCscReadoutElement(std::move(det));
671  }
672 
673  if (lvt && manager->tgcIdHelper()) {
674 
675  ATH_MSG_DEBUG( " Adding a TGC chamber to the tree zi,fi, is_mirrored " << zi << " " << fi + 1 << " " << is_mirrored );
676 
677 
678  TgcComponent *tg = (TgcComponent *)m_station->GetComponent(i);
679 
680  ATH_MSG_VERBOSE( "There's a TGC named " << techname << " of thickness " << tg->GetThickness(mysql) );
681 
682  const TgcIdHelper *tgc_id = manager->tgcIdHelper();
683  int stationEta = 0;
684  stationEta = tg->index;
685  if (zi < 0)
687  int stationPhi = 0;
688  stationPhi = stationPhiTGC(stName, fi + 1,zi);
689 
690  std::unique_ptr<TgcReadoutElement> det = std::make_unique<TgcReadoutElement>(lvt, stName, manager);
691  Position ip = mysql.GetStationPosition(stName.substr(0, 3), fi, zi);
692  setTgcReadoutGeom(mysql, det.get(), tg, ip, stName);
693  det->setHasCutouts(ncutouts > 0);
694  Identifier id = tgc_id->channelID(stationType, stationEta, stationPhi, 1, false, 1);
695  det->setIdentifier(id);
696  det->setParentStationPV(PVConstLink(ptrd));
697  det->setParentMuonStation(mstat);
698 
699  int jobIndex = c->index;
700 
701  mstat->addMuonReadoutElementWithAlTransf(det.get(), xfaligncomponent, jobIndex);
702 
703  manager->addTgcReadoutElement(std::move(det));
704  }
705  if (lvr && RPCON && manager->rpcIdHelper()) {
706  RpcComponent *rp = (RpcComponent *)c;
707  int ndivy = rp->ndivy;
708  int ndivz = rp->ndivz;
709 
710  if (ndivz != 1 || ndivy != 1) {
711  ATH_MSG_ERROR( " RPC segmentation z,y " << ndivz << " " << ndivy );
712  }
713 
714  double zpos = -length / 2. + c->posy + c->dy / 2.;
715  double xpos = c->posx;
716 
717  // implement really the mirror symmetry
718  if (is_mirrored)
719  xpos = -xpos;
720  // ... putting back to here!
721 
722  const RpcIdHelper *rpc_id = manager->rpcIdHelper();
723  int stationEta = zi;
724  int stationPhi = fi + 1;
725  int doubletR = 1;
726  int doubletZ = 1;
727 
728  if (nRpc > 1 && nDoubletR == 2 && ypos > 0.)
729  doubletR = 2;
730  ndbz[doubletR - 1]++;
731 
732  // the BI RPCs are 3-gap RPCs mounted inside of the BI (s)MDTs
733  if (stname.find("BI") != std::string::npos) {
734  if (stname.find("BIS") != std::string::npos) {
735  // for BIS78, there is a second RPC doubletZ at amdb-y (MuonGeoModel-z)=144mm inside the station
736  if (std::abs(stationEta)>= 7){
737  ATH_MSG_DEBUG("BIS78 station eta: "<<stationEta<<" phi: "<<stationPhi<<" dR: "<<doubletR<<" dZ:"<< doubletZ <<" rp: "<<rp->posz);
738  }
739  if (std::abs(stationEta) >= 7 && rp->posz > 80)
740  doubletZ = 2;
741  else
742  doubletZ = 1;
743  } else {
744  // for BIL/BIM/BIR, we have 10 RPCs put on 6 MDT stations, thus, need to exploit doubletZ as additional variable on top of stationEta
745  // only for BIL, there are sometimes 2 RPCs per 1 MDT station, namely for stationEta 1,3,4,6
746  if (stname.find("BIL") != std::string::npos && std::abs(stationEta) < 7 && std::abs(stationEta) != 2 && std::abs(stationEta) != 5) {
747  if (rp->posy > 1)
748  doubletZ = 2; // put the chamber with positive amdb-z to doubletZ=2
749  } else
750  doubletZ = 1;
751  }
752  } else {
753  if (zi <= 0 && !is_mirrored) {
754  if (zpos < -100 * Gaudi::Units::mm)
755  doubletZ = 2;
756  } else {
757  if (zpos > 100 * Gaudi::Units::mm)
758  doubletZ = 2;
759  }
760  }
761 
762  // BMS (BOG) RPCs can have |xpos|=950 (|xpos|=350)
763  if (std::abs(xpos) > 100. * Gaudi::Units::mm) {
764  if (ndbz[doubletR - 1] > 2) {
765  doubletZ = 3;
766  }
767  ndbz[doubletR - 1]--;
768  }
769 
770  int dbphi = 1;
771 
772  // this special patch is needed for BMS in the ribs where xpos is ~950mm;
773  // the theshold to 100mm (too low) caused a bug
774  // in BOG at eta +/-4 and stationEta 7 (not 6) ==>> 28 Jan 2016 raising the threshold to 400.mm
775  // doublet phi not aware of pos. in space !!!
776  if (xpos > 400. * Gaudi::Units::mm)
777  dbphi = 2;
778 
779  int doubletPhi = dbphi;
780  //
781  if (zi < 0 && is_mirrored && doubletZ == 3) {
782  doubletPhi++;
783  if (doubletPhi > 2)
784  doubletPhi = 1;
785  } else if (zi < 0 && is_mirrored && doubletZ == 2 && doubletR == 1 && stName == "BMS6") {
786  doubletPhi++;
787  if (doubletPhi > 2)
788  doubletPhi = 1;
789  }
790  // never defined fields: set to the lower limit
791  int gasGap = 1;
792  int measuresPhi = 0;
793  int strip = 1;
794 
795  int tag = doubletZ + doubletR * 100 + dbphi * 1000;
796  if (rp->iswap == -1)
797  tag = -1 * tag;
798  if (useAssemblies || isAssembly) {
799  //
800  } else {
801  int tag = rp->index + doubletR * 100 + dbphi * 1000;
802  if (rp->iswap == -1)
803  tag = -1 * tag;
804 
805  }
806 
807 
808  std::unique_ptr<RpcReadoutElement> det = std::make_unique<RpcReadoutElement>(lvr, stName, zi, fi + 1, is_mirrored, manager);
809  Position ip = mysql.GetStationPosition(stName.substr(0, 3), fi, zi);
810  setRpcReadoutGeom(mysql, det.get(), rp, ip);
811  det->setHasCutouts(ncutouts > 0);
812  Identifier id = rpc_id->channelID(stationType, stationEta, stationPhi, doubletR, doubletZ, doubletPhi, gasGap, measuresPhi, strip);
813  det->setIdentifier(id);
814  det->setDoubletR(doubletR);
815  det->setDoubletZ(doubletZ);
816  det->setDoubletPhi(doubletPhi);
817  if (stName.find("BI") != std::string::npos)
818  det->setNumberOfLayers(3); // all BI RPCs always have 3 gas gaps
819  det->setParentStationPV(PVConstLink(ptrd));
820  det->setParentMuonStation(mstat);
821 
822  int jobIndex = c->index;
823 
824  mstat->addMuonReadoutElementWithAlTransf(det.get(), xfaligncomponent, jobIndex);
825 
826 
827 
828  if (stName.find("BI") != std::string::npos) {
829  std::map<std::string, float>::const_iterator yItr = rpcYTrans.find(techname);
830  if (yItr != rpcYTrans.end())
831  det->setYTranslation(yItr->second);
832  std::map<std::string, float>::const_iterator zItr = rpcZTrans.find(techname);
833  if (zItr != rpcZTrans.end())
834  det->setZTranslation(zItr->second);
835  }
836 
837  det->fillCache(); // fill temporary cache (global position on known yet)
838  det->initDesign();
839  det->clearCache(); // clear temporary cache
840  manager->addRpcReadoutElement(std::move(det));
841 
842  } // if (lvr && RPCON && manager->rpcIdHelper()) {
843 
844  } // End big loop over components
845  mstat->updateBlineFixedPointInAmdbLRS();
846 
847  return ptrd;
848  }

◆ 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 }

◆ 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 }

◆ print()

void MuonGM::MuonChamberLite::print ( ) const
overridevirtual

Implements MuonGM::DetectorElement.

Definition at line 1082 of file MuonChamberLite.cxx.

1082  {
1083  ATH_MSG_INFO("MuonChamberLite " << name << " :" );
1084  }

◆ setCscReadoutGeom()

void MuonGM::MuonChamberLite::setCscReadoutGeom ( const MYSQL mysql,
CscReadoutElement re,
const CscComponent cc,
const Position p 
)
private

Definition at line 850 of file MuonChamberLite.cxx.

851  {
852 
853  re->m_Ssize = cc->dx1;
854  re->m_LongSsize = cc->dx2;
855  re->m_Rsize = cc->dy;
856  re->m_LongRsize = cc->dy;
857  re->m_Zsize = cc->GetThickness(mysql);
858  re->m_LongZsize = cc->GetThickness(mysql);
859  re->m_RlengthUpToMaxWidth = cc->maxwdy;
860  re->m_excent = cc->excent;
861 
862  // Csc features specific to this readout element
863  std::string tname = cc->name;
864  re->setTechnologyName(tname);
865 
866  if (ip.isAssigned) {
867  re->setStationS(ip.shift);
868  } else {
869  throw std::runtime_error(" MuonChamberLite::setCscReadoutGeom: position not found ");
870  }
871 
872  const CSC *thisc = dynamic_cast<const CSC*>(mysql.GetTechnology(tname));
873  re->m_anodecathode_distance = thisc->anocathodist;
874  re->m_ngasgaps = thisc->numOfLayers;
875  re->m_nstriplayers = thisc->numOfLayers;
876  re->m_nwirelayers = thisc->numOfLayers;
877  re->m_roxacellwidth = thisc->roxacellwith;
878  re->m_nEtastripsperlayer = thisc->nEtastrips;
879  re->m_nPhistripsperlayer = thisc->nPhistrips;
880  re->m_Etastrippitch = thisc->cathreadoutpitch;
881  re->m_Phistrippitch = thisc->phireadoutpitch;
882  re->m_Etastripwidth = re->m_Etastrippitch;
883  re->m_Phistripwidth = re->m_Phistrippitch;
884  }

◆ setKeyset()

void MuonGM::MuonChamberLite::setKeyset ( std::set< std::string > *  keySet)
inline

Definition at line 47 of file MuonChamberLite.h.

47 {m_keySet=keySet;};

◆ 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 }

◆ setLogVolName()

void MuonGM::DetectorElement::setLogVolName ( const std::string &  str)
inlineinherited

Definition at line 22 of file DetectorElement.h.

22 { logVolName = str; }

◆ setMdtReadoutGeom()

void MuonGM::MuonChamberLite::setMdtReadoutGeom ( const MYSQL mysql,
MdtReadoutElement re,
const MdtComponent cc,
const Position p 
)
private

Definition at line 886 of file MuonChamberLite.cxx.

887  {
888  re->m_Ssize = cc->dx1;
889  re->m_LongSsize = cc->dx2;
890 
891  if (re->m_inBarrel) {
892  re->m_Rsize = cc->GetThickness(mysql);
893  re->m_LongRsize = cc->GetThickness(mysql);
894  re->m_Zsize = cc->dy;
895  re->m_LongZsize = cc->dy;
896  } else {
897  re->m_Rsize = cc->dy;
898  re->m_LongRsize = cc->dy;
899  re->m_Zsize = cc->GetThickness(mysql);
900  re->m_LongZsize = cc->GetThickness(mysql);
901  }
902 
903  re->m_cutoutShift = cc->cutoutTubeXShift;
904  re->m_tubelenStepSize = cc->tubelenStepSize;
905 
906  if (ip.isAssigned) {
907  re->setStationS(ip.shift);
908  } else {
909  throw std::runtime_error(" MuonChamberLite::setMdtReadoutGeom: position not found ");
910  }
911 
912  std::string tname = cc->name;
913  re->setTechnologyName(tname);
914  const MDT *thism = dynamic_cast<const MDT*>(mysql.GetTechnology(tname));
915  re->m_nlayers = thism->numOfLayers;
916  re->m_tubepitch = thism->pitch;
917  re->m_tubelayerpitch = thism->y[1] - thism->y[0];
918  re->m_endpluglength = thism->tubeEndPlugLength;
919  re->m_deadlength = cc->deadx; // thism->tubeDeadLength;
920  re->m_innerRadius = thism->innerRadius;
921  re->m_tubeWallThickness = thism->tubeWallThickness;
922 
923  if (re->m_inBarrel) {
924  re->m_ntubesperlayer = int(re->m_Zsize / re->m_tubepitch);
925  re->m_nsteps = 1; // all tubes have the same length
926  re->m_ntubesinastep = re->m_ntubesperlayer;
927  re->m_tubelength[0] = re->m_Ssize;
928  } else {
929  re->m_ntubesperlayer = int(re->m_Rsize / re->m_tubepitch);
930  re->m_nsteps = int(re->m_Rsize / re->m_tubelenStepSize);
931  re->m_ntubesinastep = int(re->m_tubelenStepSize / re->m_tubepitch);
932  re->m_tubelength[0] = re->m_Ssize;
933  double diff = (re->m_LongSsize - re->m_Ssize) * (re->m_LongRsize - re->m_tubepitch / 2.) / re->m_LongRsize;
934  for (int is = 0; is < re->m_nsteps; ++is) {
935  double len = re->m_Ssize + is * diff / re->m_nsteps;
936  re->m_tubelength[is] = len;
937  }
938  }
939 
940  for (int tl = 0; tl < re->m_nlayers; ++tl) {
941  re->m_firstwire_x[tl] = thism->x[tl];
942  re->m_firstwire_y[tl] = thism->y[tl];
943  }
944  }

◆ setRpcReadoutGeom()

void MuonGM::MuonChamberLite::setRpcReadoutGeom ( const MYSQL mysql,
RpcReadoutElement re,
const RpcComponent cc,
const Position p 
)
private

the values from MuonGeoModel have an offset of 0.74, TO BE INVESTIGATED, cf. ATLASSIM-5021 On the other hand this detector has never sent any good data. So the investigation doesn't really matter

Definition at line 946 of file MuonChamberLite.cxx.

949  {
950 
951  re->m_Ssize = cc->dx1;
952  re->m_LongSsize = cc->dx2;
953  re->m_Rsize = cc->GetThickness(mysql);
954  re->m_LongRsize = cc->GetThickness(mysql);
955  re->m_Zsize = cc->dy;
956  re->m_LongZsize = cc->dy;
957 
958  re->m_hasDEDontop = true;
959  if (cc->iswap == -1)
960  re->m_hasDEDontop = false;
961 
962  if (ip.isAssigned) {
963  re->setStationS(ip.shift);
964  } else {
965  ATH_MSG_ERROR( " MuonChamber::setRpcReadoutGeom: position not found " );
966  assert(0);
967  }
968 
969  std::string tname = cc->name;
970  re->setTechnologyName(tname);
971  const RPC *thisr = dynamic_cast<const RPC*>(mysql.GetTechnology(tname));
972  re->m_nphigasgaps = thisr->NGasGaps_in_s;
973  re->m_gasgapssize = re->m_Ssize / re->m_nphigasgaps - 2. * thisr->bakeliteframesize;
974  re->m_gasgapzsize = re->m_Zsize - 2. * thisr->bakeliteframesize;
975  re->m_nphistrippanels = thisr->NstripPanels_in_s;
976  re->m_phistrippitch = thisr->stripPitchS;
977  re->m_etastrippitch = thisr->stripPitchZ;
978 
979  if (re->getStationName().find("BI") != std::string::npos) {
980  re->setNumberOfLayers(3); // all BI RPCs always have 3 gas gaps
981 
982  }
983  const RPC* genericRpc = dynamic_cast<const RPC*>(mysql.GetATechnology("RPC0"));
984 
985  if (re->numberOfLayers() == 3) {
986  constexpr double rpc3GapLayerThickness = 11.8; // gas vol. + ( bakelite + graphite + PET )x2
987  for (int gasGap =1 ; gasGap <= re->numberOfLayers(); ++gasGap) {
990  re->m_gasGap_xPos[gasGap -1] = (gasGap - 2) * rpc3GapLayerThickness - 0.74;
991  }
992  } else {
993  re->m_gasGap_xPos[0] = -re->m_Rsize / 2. + thisr->externalSupPanelThickness + genericRpc->stripPanelThickness
994  + genericRpc->GasGapThickness / 2;
995  re->m_gasGap_xPos[1] = re->m_gasGap_xPos[0] + genericRpc->rpcLayerThickness +
996  genericRpc->centralSupPanelThickness;
997  if (!re->m_hasDEDontop) {
998  std::swap(re->m_gasGap_xPos[0], re->m_gasGap_xPos[1]);
999  }
1000  }
1001 
1002  re->m_phistripwidth = re->m_phistrippitch - genericRpc->stripSeparation;
1003  re->m_etastripwidth = re->m_etastrippitch - genericRpc->stripSeparation;
1004  re->m_nphistripsperpanel = int((re->m_Ssize / re->m_nphistrippanels) / re->m_phistrippitch);
1005  if (re->getStationName().compare(0, 3, "BME") != 0) {
1006  re->m_nphistripsperpanel-=(re->m_nphistripsperpanel % 8) ;
1007  }
1008  re->m_netastripsperpanel = int((re->m_Zsize) / re->m_etastrippitch);
1009  re->m_netastripsperpanel -= (re->m_netastripsperpanel % 8);
1010 
1011  re->m_phipaneldead = re->m_Ssize / re->m_nphistrippanels -
1012  re->m_nphistripsperpanel * re->m_phistrippitch +
1013  genericRpc->stripSeparation;
1014  re->m_phipaneldead = re->m_phipaneldead / 2.;
1015  re->m_etapaneldead = re->m_Zsize - re->m_netastripsperpanel * re->m_etastrippitch + genericRpc->stripSeparation;
1016  re->m_etapaneldead = re->m_etapaneldead / 2.;
1017  re->m_phistriplength = re->m_LongZsize;
1018  re->m_etastriplength = re->m_LongSsize / re->m_nphistrippanels;
1019 
1020  re->m_first_phistrip_s[0] = -re->m_Ssize / 2. + re->m_phipaneldead + re->m_phistripwidth / 2.;
1021  if (re->m_nphistrippanels == 2) {
1022  re->m_first_phistrip_s[1] = re->m_phipaneldead + re->m_phistripwidth / 2.;
1023  }
1024 
1025  double offset = 0.;
1026  re->m_phistrip_z = -re->m_Zsize / 2. + offset + re->m_phistriplength / 2.;
1027 
1028  // first strip position on each eta panel
1029  re->m_first_etastrip_z = -re->m_Zsize / 2. + re->m_etapaneldead + re->m_etastripwidth / 2.;
1030  re->m_etastrip_s[0] = -re->m_Ssize / 2. + offset + re->m_etastriplength / 2.;
1031  if (re->m_nphistrippanels == 2) {
1032  re->m_etastrip_s[1] = re->m_Ssize / 2. - offset - re->m_etastriplength / 2.;
1033  }
1034 
1035  }

◆ setTgcReadoutGeom()

void MuonGM::MuonChamberLite::setTgcReadoutGeom ( const MYSQL mysql,
TgcReadoutElement re,
const TgcComponent cc,
const Position p,
const std::string &  statname 
)
private

Definition at line 1037 of file MuonChamberLite.cxx.

1041  {
1042 
1043  re->setSsize(cc->dx1);
1044  re->setLongSsize(cc->dx2);
1045  re->setRsize(cc->dy);
1046  re->setLongRsize(cc->dy);
1047  re->setZsize(cc->GetThickness(mysql));
1048  re->setLongZsize(cc->GetThickness(mysql));
1049 
1050 
1051  const TGC *genericTgc = dynamic_cast<const TGC*>(mysql.GetATechnology("TGC0"));
1052  re->setFrameThickness(genericTgc->frame_h,
1053  genericTgc->frame_ab);
1054 
1055 
1056  const std::string &tname = cc->name;
1057  int tname_index = MuonGM::strtoint(tname, 3, 2);
1058  re->setTechnologyName(tname);
1059 
1060  if (ip.isAssigned) {
1061  re->setStationS(ip.shift);
1062  } else {
1063  throw std::runtime_error(" MuonChamberLite::setTgcReadoutGeom position not found ");
1064  }
1065 
1066  re->setReadOutName(stName.substr(0, 4) + '_' + std::to_string(cc->index));
1067  re->setReadOutParams(mysql.GetTgcRPars(tname_index));
1068 
1069  const TGC *thist = dynamic_cast<const TGC*>(mysql.GetTechnology(tname));
1070  const std::size_t ncomp = (thist->materials).size();
1071 
1072  unsigned int gasGap{0};
1073  for (std::size_t i = 0; i < ncomp; ++i) {
1074  double newpos = -re->getZsize() / 2. + thist->positions[i] + thist->tck[i] / 2.;
1075 
1076  if ( thist->materials[i].find("TGCGas") != std::string::npos) {
1077  re->setPlaneZ(newpos, ++gasGap);
1078  }
1079  }
1080  }

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.

◆ length

double MuonGM::MuonChamberLite::length {0.}

Definition at line 35 of file MuonChamberLite.h.

◆ logVolName

std::string MuonGM::DetectorElement::logVolName {}
inherited

Definition at line 18 of file DetectorElement.h.

◆ longWidth

double MuonGM::MuonChamberLite::longWidth {0.}

Definition at line 37 of file MuonChamberLite.h.

◆ m_imsg

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

MessageSvc pointer.

Definition at line 135 of file AthMessaging.h.

◆ m_keySet

std::set<std::string>* MuonGM::MuonChamberLite::m_keySet {nullptr}
private

Definition at line 63 of file MuonChamberLite.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_mapAXF

std::map<std::string, GeoAlignableTransform*>* MuonGM::MuonChamberLite::m_mapAXF {nullptr}
private

Definition at line 62 of file MuonChamberLite.h.

◆ m_mapFPV

std::map<std::string, GeoFullPhysVol*>* MuonGM::MuonChamberLite::m_mapFPV {nullptr}
private

Definition at line 61 of file MuonChamberLite.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_nm

std::string AthMessaging::m_nm
privateinherited

Message source name.

Definition at line 129 of file AthMessaging.h.

◆ m_station

Station* MuonGM::MuonChamberLite::m_station {nullptr}
private

Definition at line 59 of file MuonChamberLite.h.

◆ name

std::string MuonGM::DetectorElement::name {}
inherited

Definition at line 17 of file DetectorElement.h.

◆ rotangle

std::array<double,10> MuonGM::MuonChamberLite::rotangle {}

Definition at line 39 of file MuonChamberLite.h.

◆ thickness

double MuonGM::MuonChamberLite::thickness {0.}

Definition at line 36 of file MuonChamberLite.h.

◆ width

double MuonGM::MuonChamberLite::width {0.}

Definition at line 34 of file MuonChamberLite.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
MuonIdHelper::stationNameIndex
int stationNameIndex(const std::string &name) const
Definition: MuonIdHelper.cxx:842
beamspotman.r
def r
Definition: beamspotman.py:676
Muon::nsw::STGTPSegments::moduleIDBits::stationPhi
constexpr uint8_t stationPhi
station Phi 1 to 8
Definition: NSWSTGTPDecodeBitmaps.h:161
dumpTgcDigiDeadChambers.gasGap
list gasGap
Definition: dumpTgcDigiDeadChambers.py:33
MuonGM::DetectorElement::name
std::string name
Definition: DetectorElement.h:17
egammaParameters::depth
@ depth
pointing depth of the shower as calculated in egammaqgcld
Definition: egammaParamDefs.h:276
MuonGM::MuonChamberLite::m_station
Station * m_station
Definition: MuonChamberLite.h:59
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
MuonGM::Station::GetExtraBottomThickness
double GetExtraBottomThickness() const
Definition: Station.cxx:155
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
RPCON
#define RPCON
Definition: MuonChamberLite.cxx:60
MuonGM::MuonChamberLite::longWidth
double longWidth
Definition: MuonChamberLite.h:37
TRTCalib_Extractor.det
det
Definition: TRTCalib_Extractor.py:36
TgcIdHelper
Definition: TgcIdHelper.h:50
MuonGM::Station::getAmdbOrigine_along_thickness
double getAmdbOrigine_along_thickness(const MYSQL &mysql) const
Definition: Station.cxx:558
hist_file_dump.d
d
Definition: hist_file_dump.py:137
mergePhysValFiles.start
start
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:14
MuonGM::MuonChamberLite::width
double width
Definition: MuonChamberLite.h:34
createCablingJSON.doubletR
int doubletR
Definition: createCablingJSON.py:15
deg
#define deg
Definition: SbPolyhedron.cxx:17
mc.diff
diff
Definition: mc.SFGenPy8_MuMu_DD.py:14
MuonGM::MuonChamberLite::m_keySet
std::set< std::string > * m_keySet
Definition: MuonChamberLite.h:63
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
RpcIdHelper::channelID
Identifier channelID(int stationName, int stationEta, int stationPhi, int doubletR, int doubletZ, int doubletPhi, int gasGap, int measuresPhi, int strip) const
Definition: RpcIdHelper.cxx:939
AthMessaging::m_imsg
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
Definition: AthMessaging.h:135
python.SystemOfUnits.ms
int ms
Definition: SystemOfUnits.py:132
RpcIdHelper
Definition: RpcIdHelper.h:51
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
keylayer_zslicemap.strip
strip
Definition: keylayer_zslicemap.py:151
MuonGM::MuonChamberLite::setCscReadoutGeom
void setCscReadoutGeom(const MYSQL &mysql, CscReadoutElement *re, const CscComponent *cc, const Position &p)
Definition: MuonChamberLite.cxx:850
MuonGM::MuonChamberLite::setRpcReadoutGeom
void setRpcReadoutGeom(const MYSQL &mysql, RpcReadoutElement *re, const RpcComponent *cc, const Position &p)
Definition: MuonChamberLite.cxx:946
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
MuonGM::Component::dy
double dy
Definition: Component.h:21
TrigConf::MSGTC::Level
Level
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:21
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
python.BunchSpacingUtils.lb
lb
Definition: BunchSpacingUtils.py:88
useAssemblies
#define useAssemblies
Definition: MuonChamberLite.cxx:61
lumiFormat.i
int i
Definition: lumiFormat.py:85
TGC
Definition: TgcBase.h:6
MuonGM::MuonChamberLite::m_mapAXF
std::map< std::string, GeoAlignableTransform * > * m_mapAXF
Definition: MuonChamberLite.h:62
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
MuonGM::Station::getAmdbOrigine_along_length
double getAmdbOrigine_along_length() const
Definition: Station.cxx:553
BindingsTest.cut
cut
This script demonstrates how to call a C++ class from Python Also how to use PyROOT is shown.
Definition: BindingsTest.py:13
MdtIdHelper
Definition: MdtIdHelper.h:61
AthMessaging
Class to provide easy MsgStream access and capabilities.
Definition: AthMessaging.h:55
find_tgc_unfilled_channelids.ip
ip
Definition: find_tgc_unfilled_channelids.py:3
MuonGM::Station::GetExtraTopThickness
double GetExtraTopThickness() const
Definition: Station.cxx:151
WriteCalibToCool.swap
swap
Definition: WriteCalibToCool.py:94
AthMessaging::msg
MsgStream & msg() const
The standard message stream.
Definition: AthMessaging.h:164
MuonGM::MuonChamberLite::m_mapFPV
std::map< std::string, GeoFullPhysVol * > * m_mapFPV
Definition: MuonChamberLite.h:61
RPC
@ RPC
Definition: RegSelEnums.h:32
CscIdHelper::channelID
Identifier channelID(int stationName, int stationEta, int stationPhi, int chamberLayer, int wireLayer, int measuresPhi, int strip) const
Definition: CscIdHelper.cxx:706
MuonGM::MuonChamberLite::length
double length
Definition: MuonChamberLite.h:35
MdtIdHelper::channelID
Identifier channelID(int stationName, int stationEta, int stationPhi, int multilayer, int tubeLayer, int tube) const
Definition: MdtIdHelper.cxx:659
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
MuonGM::MuonChamberLite::thickness
double thickness
Definition: MuonChamberLite.h:36
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
MuonGM::Station::GetNrOfCutouts
int GetNrOfCutouts() const
Definition: Station.cxx:324
MuonGM::strtoint
int strtoint(std::string_view str, unsigned int istart, unsigned int length)
Definition: GlobalUtilities.cxx:37
python.SystemOfUnits.mm
int mm
Definition: SystemOfUnits.py:83
python.CaloScaleNoiseConfig.str
str
Definition: CaloScaleNoiseConfig.py:78
MuonGM::Station::GetNrOfComponents
int GetNrOfComponents() const
Definition: Station.cxx:322
CscIdHelper
Definition: CscIdHelper.h:52
MuonGM::MuonChamberLite::setMdtReadoutGeom
void setMdtReadoutGeom(const MYSQL &mysql, MdtReadoutElement *re, const MdtComponent *cc, const Position &p)
Definition: MuonChamberLite.cxx:886
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
AthMessaging::m_nm
std::string m_nm
Message source name.
Definition: AthMessaging.h:129
re
const boost::regex re(r_e)
MuonGM::stationPhiTGC
int stationPhiTGC(std::string_view stName, int fi, int zi_input)
Converts the AMDB phi index to the Identifier phi Index.
Definition: GlobalUtilities.cxx:44
convertTimingResiduals.offset
offset
Definition: convertTimingResiduals.py:71
checkFileSG.fi
fi
Definition: checkFileSG.py:65
MuonGM::Station::GetCutout
Cutout * GetCutout(int i) const
Definition: Station.cxx:85
createCablingJSON.doubletPhi
int doubletPhi
Definition: createCablingJSON.py:16
TgcIdHelper::channelID
Identifier channelID(int stationName, int stationEta, int stationPhi, int gasGap, int isStrip, int channel) const
Definition: TgcIdHelper.cxx:583
MuonGM::DetectorElement::logVolName
std::string logVolName
Definition: DetectorElement.h:18
python.Logging.manager
manager
Definition: PhysicsAnalysis/D3PDTools/AnaAlgorithm/python/Logging.py:92
dqt_zlumi_alleff_HIST.tl
tl
Definition: dqt_zlumi_alleff_HIST.py:73
CSC
@ CSC
Definition: RegSelEnums.h:34
CaloCondBlobAlgs_fillNoiseFromASCII.tag
string tag
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:24
AthMessaging::initMessaging
void initMessaging() const
Initialize our message level and MessageSvc.
Definition: AthMessaging.cxx:39
Muon::nsw::STGTPSegments::moduleIDBits::stationEta
constexpr uint8_t stationEta
1 to 3
Definition: NSWSTGTPDecodeBitmaps.h:159
rp
ReadCards * rp
Definition: IReadCards.cxx:26
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::buildString
std::string buildString(int i, int ncha)
Definition: GlobalUtilities.cxx:23
MuonGM::Station::GetComponent
Component * GetComponent(int i) const
Definition: Station.cxx:83
MuonGM::Station::GetName
const std::string & GetName() const
Definition: Station.cxx:110
MuonGM::Station::mdtHalfPitch
double mdtHalfPitch(const MYSQL &mysql) const
Definition: Station.cxx:343
python.compressB64.c
def c
Definition: compressB64.py:93
calibdata.tube
tube
Definition: calibdata.py:31
MuonGM::DetectorElement::DetectorElement
DetectorElement(const std::string &n)
Definition: DetectorElement.h:20
MDT
@ MDT
Definition: RegSelEnums.h:31
python.handimod.cc
int cc
Definition: handimod.py:523
MuonGM::MuonChamberLite::setTgcReadoutGeom
void setTgcReadoutGeom(const MYSQL &mysql, TgcReadoutElement *re, const TgcComponent *cc, const Position &p, const std::string &statname)
Definition: MuonChamberLite.cxx:1037
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
Identifier
Definition: IdentifierFieldParser.cxx:14