Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Member Functions | Public Attributes | Private Attributes | List of all members
MuonGM::Rpc Class Reference

#include <Rpc.h>

Inheritance diagram for MuonGM::Rpc:
Collaboration diagram for MuonGM::Rpc:

Public Member Functions

 Rpc (const MYSQL &mysql, Component *s)
 
GeoIntrusivePtr< GeoFullPhysVol > build (StoredMaterialManager &matManager, const MYSQL &mysql, int minimalgeo)
 
GeoIntrusivePtr< GeoFullPhysVol > build (StoredMaterialManager &matManager, const MYSQL &mysql, int minimalgeo, int cutoutson, const std::vector< Cutout * > &)
 
virtual void print () const override
 
unsigned int nGasGaps () const
 
void setLogVolName (const std::string &str)
 

Public Attributes

double width {0.}
 
double length {0.}
 
double thickness {0.}
 
double longWidth {0.}
 
double idiv {0.}
 
double jdiv {0.}
 
float y_translation {0.f}
 
float z_translation {0.f}
 
std::string name {}
 
std::string logVolName {}
 

Private Attributes

RpcComponentm_component {nullptr}
 
unsigned int m_nlayers {0}
 

Detailed Description

Definition at line 20 of file Rpc.h.

Constructor & Destructor Documentation

◆ Rpc()

MuonGM::Rpc::Rpc ( const MYSQL mysql,
Component s 
)

Definition at line 41 of file Rpc.cxx.

41  : DetectorElement(ss->name) {
42  double tol = 1.e-3;
43  RpcComponent *s = (RpcComponent *)ss;
44  width = s->dx1;
45  longWidth = s->dx2;
46  thickness = s->GetThickness(mysql);
47  length = s->dy - tol;
48  m_component = s;
49  idiv = s->ndivy;
50  jdiv = s->ndivz;
51  y_translation = 0;
52  z_translation = 0;
53  m_nlayers = 2;
54  // the BI RPCs are the only ones with 3 gas gaps
55  if (std::find(std::begin(biRpcs), std::end(biRpcs), ss->name) != std::end(biRpcs))
56  m_nlayers = 3;
57  }

Member Function Documentation

◆ build() [1/2]

GeoIntrusivePtr< GeoFullPhysVol > MuonGM::Rpc::build ( StoredMaterialManager matManager,
const MYSQL mysql,
int  minimalgeo 
)

Definition at line 59 of file Rpc.cxx.

61  {
62  std::vector<Cutout *> vcutdef;
63  int cutoutson = 0;
64  return build(matManager, mysql, minimalgeo, cutoutson, vcutdef);
65  }

◆ build() [2/2]

GeoIntrusivePtr< GeoFullPhysVol > MuonGM::Rpc::build ( StoredMaterialManager matManager,
const MYSQL mysql,
int  minimalgeo,
int  cutoutson,
const std::vector< Cutout * > &  vcutdef 
)

Definition at line 67 of file Rpc.cxx.

70  {
71  MsgStream log(Athena::getMessageSvc(), "MuonGM::Rpc::build");
72 
73  std::string geometry_version = mysql.getGeometryVersion();
74  const RPC *r = dynamic_cast<const RPC*>(mysql.GetTechnology(name));
75 
76  // Retrieve geometrical information, these are for middle and outer alyers ("standard" RPCs)
77  double thickness = r->maxThickness;
78  width = width / idiv;
80  length = length / jdiv;
81 
82  double extSupThick = r->externalSupPanelThickness;
83  double extAlSupThick = r->externalAlSupPanelThickness;
84  double rpcLayerThickness = r->rpcLayerThickness;
85  double centSupThick = r->centralSupPanelThickness;
86  double centAlSupThick = r->centralAlSupPanelThickness;
87 
88  // Geometrical information to be overwritten for BI chambers (having 3 gas gaps)
89  if (m_nlayers == 3) {
90  // width, longWidth, length are taken from geometry DB
91  thickness = rpc3GapMaxThickness;
92  rpcLayerThickness = rpc3GapLayerThickness;
93  }
94 
95  if (RPCprint) {
96  log << MSG::VERBOSE << " RPC build: " << name << " has thickness = " << thickness << " long width = " << longWidth << " width = " << width << " length = " << length
97  << endmsg;
98  }
99 
100  const GeoShape *srpc = new GeoTrd(thickness / 2, thickness / 2, width / 2, longWidth / 2, length / 2);
101  // Apply cutouts to mother volume
102 
103  if (cutoutson && !vcutdef.empty()) {
104  Cutout *cut = nullptr;
105  GeoShape *cutoutShape = nullptr;
106  GeoTrf::Transform3D cutTrans{GeoTrf::Transform3D::Identity()};
107  for (unsigned i = 0; i < vcutdef.size(); i++) {
108  cut = vcutdef[i];
109  cutoutShape = new GeoTrd(thickness / 2. + 1., thickness / 2. + 1., cut->widthXs / 2., cut->widthXl / 2., cut->lengthY / 2.);
110  cutTrans = GeoTrf::Translate3D(0.0, cut->dx, -length / 2 + cut->dy + cut->lengthY / 2.);
111  srpc = &(srpc->subtract((*cutoutShape) << cutTrans));
112  }
113  }
114 
115  const GeoMaterial *mrpc = matManager.getMaterial("std::Air");
116  GeoLogVol *lrpc = new GeoLogVol(logVolName, srpc, mrpc);
117  GeoIntrusivePtr<GeoFullPhysVol> prpc = new GeoFullPhysVol(lrpc);
118 
119  if (minimalgeo == 1)
120  return prpc;
121 
122  if (geometry_version.compare(0, 1,"M") != 0) {
123  // here layout P and following (hopefully!)
124  if (idiv * jdiv != 1)
125  assert(0);
126 
127  // Note: the standard RPC (iswap != -1) has DED at the top:
128  // from bottom to top it consists of the external support panel
129  // and then the RPC doublet
130 
131  double newpos = -thickness / 2.;
132 
133  // here the bottom/external/pre-bent support panel
134  // shape of the al skin of the support panel
135  GeoTrd *slpan = new GeoTrd(extSupThick / 2, extSupThick / 2, width / 2, longWidth / 2, length / 2);
136  GeoTrd *sholpan =
137  new GeoTrd(extSupThick / 2 - extAlSupThick, extSupThick / 2 - extAlSupThick, width / 2 - extAlSupThick, longWidth / 2 - extAlSupThick, length / 2 - extAlSupThick);
138  const GeoShape *sallpan = slpan;
139  const GeoShape *sholpan2 = sholpan;
140  const GeoMaterial *mallpan = matManager.getMaterial("std::Aluminium");
141  GeoLogVol *lallpan = new GeoLogVol("RPC_AL_extsuppanel", sallpan, mallpan);
142  PVLink pallpan = new GeoPhysVol(lallpan);
143  const GeoMaterial *mholpan = matManager.getMaterial("muo::RpcAlHonC");
144  GeoLogVol *lholpan = new GeoLogVol("RPC_honeyc_extsuppanel", sholpan2, mholpan);
145  PVLink pholpan = new GeoPhysVol(lholpan);
146  pallpan->add(pholpan); // this way the honeycomb is a child of its al skin
147 
148  // Apply cutouts
149  if (cutoutson && !vcutdef.empty()) {
150  Cutout *cut = nullptr;
151  GeoTrf::Transform3D cutTrans{GeoTrf::Transform3D::Identity()};
152  for (unsigned i = 0; i < vcutdef.size(); i++) {
153  cut = vcutdef[i];
154  GeoRef<GeoTrd> cutoutShape (new GeoTrd (thickness / 2. + 1., thickness / 2. + 1., cut->widthXs / 2., cut->widthXl / 2., cut->lengthY / 2.));
155  cutTrans = GeoTrf::Translate3D(0.0, cut->dx, -length / 2 + cut->dy + cut->lengthY / 2.);
156 
157  GeoCutVolAction cutAction(*cutoutShape, cutTrans);
158  pallpan->apply(&cutAction);
159  pallpan = cutAction.getPV();
160  }
161  }
162 
163  if (m_nlayers == 2) { // only to be done for standard (non-BI) RPCs
164  newpos += extSupThick / 2.;
165  GeoTransform *tlpan = new GeoTransform(GeoTrf::TranslateX3D(newpos));
166  if (RPCprint) {
167  log << MSG::VERBOSE << " Rpc:: put ext.sup panel at " << newpos << " from centre" << endmsg;
168  }
169  if (!skip_rpc) {
170  prpc->add(tlpan);
171  prpc->add(pallpan);
172  }
173 
174  // The first layer is support for RPCs with 2 gaps, is a layer for 3 gaps (BI chambers, no supports)
175  newpos += extSupThick / 2.;
176  }
177 
178  // bottom RpcLayer
179  std::unique_ptr<RpcLayer> rl = std::make_unique<RpcLayer>(name, this);
180  PVLink plowergg;
181  if (cutoutson && !vcutdef.empty()) {
182  plowergg = rl->build(matManager, mysql, cutoutson, vcutdef);
183  } else {
184  plowergg = rl->build(matManager, mysql);
185  }
186 
187  newpos += rpcLayerThickness / 2.;
188  GeoTransform *tlgg = new GeoTransform(GeoTrf::TranslateX3D(newpos));
189  if (RPCprint) {
190  log << MSG::VERBOSE << " Rpc:: put lower RPC layer at " << newpos << " from centre " << endmsg;
191  }
192  if (!skip_rpc) {
193  prpc->add(new GeoIdentifierTag(1));
194  prpc->add(tlgg);
195  prpc->add(plowergg);
196  }
197 
198  // central support panel
199  newpos += rpcLayerThickness / 2.;
200  GeoTrd *scpan = new GeoTrd(centSupThick / 2, centSupThick / 2, width / 2, longWidth / 2, length / 2);
201  GeoTrd *shocpan = new GeoTrd(centSupThick / 2 - centAlSupThick, centSupThick / 2 - centAlSupThick, width / 2 - centAlSupThick, longWidth / 2 - centAlSupThick,
202  length / 2 - centAlSupThick);
203 
204  const GeoShape *salcpan = scpan;
205  const GeoShape *shocpan2 = shocpan;
206  GeoLogVol *lalcpan = new GeoLogVol("RPC_AL_midsuppanel", salcpan, mallpan);
207  PVLink palcpan = new GeoPhysVol(lalcpan);
208  const GeoMaterial *mhocpan = matManager.getMaterial("muo::RpcPapHonC");
209  GeoLogVol *lhocpan = new GeoLogVol("RPC_honeyc_midsuppanel", shocpan2, mhocpan);
210  PVLink phocpan = new GeoPhysVol(lhocpan);
211  palcpan->add(phocpan); // this way the honeycomb is a child of its al skin
212 
213  // Apply cutouts
214  if (cutoutson && !vcutdef.empty()) {
215  Cutout *cut = nullptr;
216  GeoTrf::Transform3D cutTrans{GeoTrf::Transform3D::Identity()};
217  for (unsigned i = 0; i < vcutdef.size(); i++) {
218  cut = vcutdef[i];
219  GeoRef<GeoTrd> cutoutShape (new GeoTrd (thickness / 2. + 1., thickness / 2. + 1., cut->widthXs / 2., cut->widthXl / 2., cut->lengthY / 2.));
220  cutTrans = GeoTrf::Translate3D(0.0, cut->dx, -length / 2 + cut->dy + cut->lengthY / 2.);
221 
222  GeoCutVolAction cutAction(*cutoutShape, cutTrans);
223  palcpan->apply(&cutAction);
224  palcpan = cutAction.getPV();
225  }
226  }
227 
228  if (m_nlayers == 2) { // only to be done for standard (non-BI) RPCs
229  newpos += centSupThick / 2.;
230  GeoTransform *tcpan = new GeoTransform(GeoTrf::TranslateX3D(newpos));
231  if (RPCprint) {
232  log << MSG::VERBOSE << " Rpc:: put central sup panel at " << newpos << " from centre" << endmsg;
233  }
234  if (!skip_rpc) {
235  prpc->add(tcpan);
236  prpc->add(palcpan);
237  }
238  newpos += centSupThick / 2.;
239  }
240 
241  // top RpcLayer
242  std::unique_ptr<RpcLayer> ru = std::make_unique<RpcLayer>(name, this);
243  PVLink puppergg;
244  if (cutoutson && !vcutdef.empty()) {
245  // This code required to take into account the various
246  // 180 degree rotations of RPC panels in BMS chambers
247  int subtype = 0;
248  int ijob = 0;
249  for (unsigned int i = 0; i < vcutdef.size(); i++) {
250  subtype = vcutdef[i]->subtype;
251  ijob = vcutdef[i]->ijob;
252 
253  // For BMS2, BMS13
254  if (name == "RPC06" && ijob == 3) {
255  if (subtype == 2) {
256  vcutdef[i]->dy = 0;
257  } else if (subtype == 13) {
258  vcutdef[i]->dy = this->length - vcutdef[i]->lengthY;
259  }
260  }
261 
262  // For BMS5, BMS9
263  if (name == "RPC07") {
264  if (subtype == 5) { // BMS5
265  if (ijob == 24)
266  vcutdef[i]->dy = this->length - vcutdef[i]->lengthY;
267  if (ijob == 32)
268  vcutdef[i]->dy = 0.;
269  } else if (subtype == 9) { // BMS9
270  if (ijob == 32)
271  vcutdef[i]->dy = this->length - vcutdef[i]->lengthY;
272  if (ijob == 24)
273  vcutdef[i]->dy = 0.;
274  }
275  }
276 
277  // For BMS6, BMS11
278  if (subtype == 6) {
279  if (ijob == 29 && name == "RPC07")
280  vcutdef[i]->dy = this->length - vcutdef[i]->lengthY;
281  if (ijob == 21 && name == "RPC08")
282  vcutdef[i]->dy = 0;
283  } else if (subtype == 11) {
284  if (ijob == 29 && name == "RPC07")
285  vcutdef[i]->dy = 0;
286  if (ijob == 21 && name == "RPC08")
287  vcutdef[i]->dy = this->length - vcutdef[i]->lengthY - vcutdef[i]->dy;
288  }
289  }
290 
291  puppergg = ru->build(matManager, mysql, cutoutson, vcutdef);
292  } else {
293  puppergg = ru->build(matManager, mysql);
294  }
295 
296  newpos += rpcLayerThickness / 2.;
297  GeoTransform *tugg = new GeoTransform(GeoTrf::TranslateX3D(newpos));
298  if (RPCprint) {
299  log << MSG::VERBOSE << " Rpc:: put upper RPC layer at " << newpos << " from centre " << endmsg;
300  }
301  if (!skip_rpc) {
302  prpc->add(new GeoIdentifierTag(2));
303  prpc->add(tugg);
304  if (m_nlayers == 2) {
305  GeoTransform *rugg = new GeoTransform(GeoTrf::RotateY3D(180 * Gaudi::Units::deg));
306  prpc->add(rugg); // only to be done for standard (non-BI) RPCs
307  }
308  prpc->add(puppergg);
309  }
310 
311  // additional RpcLayer for BI (3 gaps)
312  if (m_nlayers == 3) {
313  newpos += rpcLayerThickness / 2.;
314  RpcLayer rthird (name, this);
315  PVLink pthirdgg;
316  if (cutoutson && !vcutdef.empty()) {
317  pthirdgg = rthird.build(matManager, mysql, cutoutson, vcutdef);
318  } else {
319  pthirdgg = rthird.build(matManager, mysql);
320  }
321 
322  newpos += rpcLayerThickness / 2.;
323  GeoTransform *tthirdgg = new GeoTransform(GeoTrf::TranslateX3D(newpos));
324  if (RPCprint)
325  log << MSG::VERBOSE << " Rpc:: put upper RPC layer at " << newpos << " from centre " << endmsg;
326  if (!skip_rpc) {
327  prpc->add(new GeoIdentifierTag(3));
328  prpc->add(tthirdgg);
329  prpc->add(pthirdgg);
330  }
331  }
332  }
333  return prpc;
334  }

◆ nGasGaps()

unsigned int MuonGM::Rpc::nGasGaps ( ) const
inline

Definition at line 48 of file Rpc.h.

48 { return m_nlayers; }

◆ print()

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

Implements MuonGM::DetectorElement.

Definition at line 336 of file Rpc.cxx.

336  {
337  MsgStream log(Athena::getMessageSvc(), "MuonGM::Rpc::build");
338  log << MSG::INFO << "Rpc " << name.c_str() << " :" << endmsg;
339  }

◆ setLogVolName()

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

Definition at line 22 of file DetectorElement.h.

22 { logVolName = str; }

Member Data Documentation

◆ idiv

double MuonGM::Rpc::idiv {0.}

Definition at line 27 of file Rpc.h.

◆ jdiv

double MuonGM::Rpc::jdiv {0.}

Definition at line 28 of file Rpc.h.

◆ length

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

Definition at line 24 of file Rpc.h.

◆ logVolName

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

Definition at line 18 of file DetectorElement.h.

◆ longWidth

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

Definition at line 26 of file Rpc.h.

◆ m_component

RpcComponent* MuonGM::Rpc::m_component {nullptr}
private

Definition at line 45 of file Rpc.h.

◆ m_nlayers

unsigned int MuonGM::Rpc::m_nlayers {0}
private

Definition at line 46 of file Rpc.h.

◆ name

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

Definition at line 17 of file DetectorElement.h.

◆ thickness

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

Definition at line 25 of file Rpc.h.

◆ width

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

Definition at line 23 of file Rpc.h.

◆ y_translation

float MuonGM::Rpc::y_translation {0.f}

Definition at line 29 of file Rpc.h.

◆ z_translation

float MuonGM::Rpc::z_translation {0.f}

Definition at line 30 of file Rpc.h.


The documentation for this class was generated from the following files:
beamspotman.r
def r
Definition: beamspotman.py:676
MuonGM::DetectorElement::name
std::string name
Definition: DetectorElement.h:17
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
MuonGM::Rpc::m_component
RpcComponent * m_component
Definition: Rpc.h:45
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
MuonGM::Rpc::thickness
double thickness
Definition: Rpc.h:25
MuonGM::Rpc::width
double width
Definition: Rpc.h:23
MuonGM::Rpc::y_translation
float y_translation
Definition: Rpc.h:29
MuonGM::Rpc::jdiv
double jdiv
Definition: Rpc.h:28
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
skip_rpc
#define skip_rpc
Definition: Rpc.cxx:30
deg
#define deg
Definition: SbPolyhedron.cxx:17
MuonGM::Rpc::z_translation
float z_translation
Definition: Rpc.h:30
RPCprint
#define RPCprint
Definition: DBReader.h:106
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
lumiFormat.i
int i
Definition: lumiFormat.py:85
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
python.CaloAddPedShiftConfig.str
str
Definition: CaloAddPedShiftConfig.py:42
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
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
MuonGM::Rpc::idiv
double idiv
Definition: Rpc.h:27
RPC
@ RPC
Definition: RegSelEnums.h:32
MuonGM::Rpc::m_nlayers
unsigned int m_nlayers
Definition: Rpc.h:46
PlotCalibFromCool.rl
rl
Definition: PlotCalibFromCool.py:529
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
StoredMaterialManager::getMaterial
virtual const GeoMaterial * getMaterial(const std::string &name)=0
MuonGM::DetectorElement::logVolName
std::string logVolName
Definition: DetectorElement.h:18
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:13
MuonGM::Rpc::longWidth
double longWidth
Definition: Rpc.h:26
subproc.subtype
string subtype
Definition: subproc.py:19
GeoRef
GeoIntrusivePtr< T > GeoRef
Definition: GeoRef.h:20
MuonGM::DetectorElement::DetectorElement
DetectorElement(const std::string &n)
Definition: DetectorElement.h:20
MuonGM::Rpc::build
GeoIntrusivePtr< GeoFullPhysVol > build(StoredMaterialManager &matManager, const MYSQL &mysql, int minimalgeo)
Definition: Rpc.cxx:59
MuonGM::Rpc::length
double length
Definition: Rpc.h:24