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

#include <ServiceVolumeMaker.h>

Collaboration diagram for InDetDD::ServiceVolumeMaker:

Public Member Functions

 ServiceVolumeMaker (const std::string &label, IRDBRecordset_ptr table, const ServiceVolumeSchema &schema, InDetDD::AthenaComps *)
 
 ServiceVolumeMaker (const ServiceVolumeMaker &)=delete
 
ServiceVolumeMakeroperator= (const ServiceVolumeMaker &)=delete
 
 ~ServiceVolumeMaker ()
 
const std::vector< const ServiceVolume * > & makeAll ()
 
ServiceVolumemake (int index)
 
unsigned int numElements () const
 

Private Attributes

std::string m_label
 
ServiceVolumeMakerMgrm_mgr
 
std::vector< const ServiceVolume * > m_services
 
std::vector< double > m_layerShift
 

Detailed Description

Definition at line 136 of file ServiceVolumeMaker.h.

Constructor & Destructor Documentation

◆ ServiceVolumeMaker() [1/2]

InDetDD::ServiceVolumeMaker::ServiceVolumeMaker ( const std::string &  label,
IRDBRecordset_ptr  table,
const ServiceVolumeSchema schema,
InDetDD::AthenaComps athenaComps 
)

Definition at line 249 of file ServiceVolumeMaker.cxx.

252  : m_label(label) {
253  m_mgr = new ServiceVolumeMakerMgr(std::move(table), schema, athenaComps);
255  // std::cout<<"LAYER SHIFT "<<m_layerShift[0]<<" "<<m_layerShift[1]<<" "<<m_layerShift[2]<<"
256  // "<<m_layerShift[3]<<std::endl;
257  }

◆ ServiceVolumeMaker() [2/2]

InDetDD::ServiceVolumeMaker::ServiceVolumeMaker ( const ServiceVolumeMaker )
delete

◆ ~ServiceVolumeMaker()

InDetDD::ServiceVolumeMaker::~ServiceVolumeMaker ( )

Definition at line 259 of file ServiceVolumeMaker.cxx.

259  {
260  for (unsigned int i = 0; i < m_services.size(); i++) {
261  delete m_services[i];
262  }
263  delete m_mgr;
264  }

Member Function Documentation

◆ make()

ServiceVolume * InDetDD::ServiceVolumeMaker::make ( int  index)

Definition at line 280 of file ServiceVolumeMaker.cxx.

280  {
281  //
282  // Retrieve/calculate the parameters for the volume.
283  //
284  ServiceVolume* param = new ServiceVolume;
285 
286  param->setMaterial(m_mgr->materialName(ii));
287  param->setRmin(m_mgr->rmin(ii));
288  param->setRmax(m_mgr->rmax(ii));
289  param->setZmin(m_mgr->zmin(ii));
290  param->setZmax(m_mgr->zmax(ii));
291  param->setZsymm(m_mgr->zsymm(ii));
292  param->setVolName(m_mgr->volName(ii));
293 
294  double zShift = 0.; // the famous IBL Z shift
295  if (m_mgr->shiftFlag(ii) > 0) zShift = m_layerShift[m_mgr->shiftFlag(ii) - 100];
296  param->setZShift(zShift);
297 
298  int volId = m_mgr->volId(ii);
299  if (volId == 0) volId = ii + 1;
300 
301  bool needsRotation = false;
302 
303  // For TUBE there is no need to read the rest
304  std::string shapeType = m_mgr->shapeType(ii);
305  if (!m_mgr->schema().simple() && !shapeType.empty() && shapeType != "TUBE") {
306  double rmin2 = m_mgr->rmin2(ii);
307  double rmax2 = m_mgr->rmax2(ii);
308 
309  if (rmin2 <= 0) rmin2 = param->rmin();
310  if (rmax2 <= 0) rmax2 = param->rmax();
311 
312  int radialDiv = m_mgr->radialDiv(ii);
313 
314  double phiDelta = m_mgr->phiDelta(ii);
315 
316  bool fullPhiSector = false;
317  if (phiDelta == 0 || phiDelta >= 359.9 * Gaudi::Units::degree) {
318  phiDelta = 360 * Gaudi::Units::degree;
319  fullPhiSector = true;
320  }
321  //else {
322  //phiDelta -= 2*phiepsilon;
323  //phiStart += phiepsilon;
324  // }
325 
326  if (shapeType == "UNKNOWN") {
327  if (radialDiv > 0) {
328  shapeType = "RADIAL";
329  } else if (param->rmin() == rmin2 && param->rmax() == rmax2) {
330  if (fullPhiSector) {
331  shapeType = "TUBE";
332  } else {
333  shapeType = "TUBS";
334  }
335  } else {
336  shapeType = "CONS";
337  }
338  }
339 
340 
341  int repeat = m_mgr->repeat(ii);
342  if (repeat == 0) repeat = 1;
343 
344  double phiStart = m_mgr->phiStart(ii);
345  double phiWidth = phiDelta;
346 
347  if (shapeType == "CONS" || shapeType == "TUBS") {
348  const double phiepsilon = 0.001 * Gaudi::Units::degree;
349  phiWidth -= 2 * phiepsilon;
350  phiStart += phiepsilon;
351  }
352 
353  // Can be in degree or mm. Usually it is deg expect for BOX, TRAP and ROD shape
354  // Geometry manager makes no assumptions about units. So we must interpret here.
355  if (shapeType == "BOX" || shapeType == "ROD" || shapeType == "ROD2" || shapeType == "TRAP") {
356  phiWidth = m_mgr->width(ii); // in mm
357  }
358 
359  if (shapeType == "PGON" || shapeType == "PGON2" ||
360  shapeType == "CONE" || shapeType == "CONS" ||
361  shapeType == "PGON3" || shapeType == "PGON4") {
362  if ((rmin2 != param->rmin()) || (rmax2 != param->rmax())) {
363  needsRotation = true;
364  }
365  }
366 
367  int sides = 0;
368  int nCopies = 1;
369  if (shapeType == "PGON" || shapeType == "PGON2" ||
370  shapeType == "PGON3" || shapeType == "PGON4") {
371  sides = repeat;
372  } else {
373  nCopies = repeat;
374  }
375 
376  // Force nCopies to 1 for TUBE and CONE
377  if (shapeType.empty() || shapeType == "TUBE" || shapeType == "CONE") {
378  nCopies = 1;
379  }
380 
381  param->setShapeType(shapeType);
382  param->setRmin2(rmin2);
383  param->setRmax2(rmax2);
384  param->setPhiLoc(phiStart);
385  param->setPhiWidth(phiWidth);
386  param->setSides(sides);
387  param->setNCopies(nCopies);
388  //param->setRadialDiv(radialDiv);
389  //param->setPhiStep(phiStep);
390  }
391 
392  param->setNeedsRotation(needsRotation);
393 
394 
395  //
396  // If zin is 0... (within 10^-5) this is a volume symmetric around
397  // the origin
398  //
399  if (std::abs(param->zmin()) < 0.000001) {
400  param->setZmin(-param->zmax());
401  param->setZsymm(false);
402  }
403 
404  param->setLabel(m_label, volId);
405 
406  return param;
407  }

◆ makeAll()

const std::vector< const ServiceVolume * > & InDetDD::ServiceVolumeMaker::makeAll ( )

Definition at line 267 of file ServiceVolumeMaker.cxx.

267  {
268  for (unsigned int ii = 0; ii < numElements(); ++ii) {
269  m_services.push_back(make(ii));
270  }
271  return m_services;
272  }

◆ numElements()

unsigned int InDetDD::ServiceVolumeMaker::numElements ( ) const

Definition at line 275 of file ServiceVolumeMaker.cxx.

275  {
276  return m_mgr->numElements();
277  }

◆ operator=()

ServiceVolumeMaker& InDetDD::ServiceVolumeMaker::operator= ( const ServiceVolumeMaker )
delete

Member Data Documentation

◆ m_label

std::string InDetDD::ServiceVolumeMaker::m_label
private

Definition at line 150 of file ServiceVolumeMaker.h.

◆ m_layerShift

std::vector<double> InDetDD::ServiceVolumeMaker::m_layerShift
private

Definition at line 153 of file ServiceVolumeMaker.h.

◆ m_mgr

ServiceVolumeMakerMgr* InDetDD::ServiceVolumeMaker::m_mgr
private

Definition at line 151 of file ServiceVolumeMaker.h.

◆ m_services

std::vector<const ServiceVolume *> InDetDD::ServiceVolumeMaker::m_services
private

Definition at line 152 of file ServiceVolumeMaker.h.


The documentation for this class was generated from the following files:
ServiceVolume
Definition: InDetServMatGeoModel/src/ServiceVolume.h:14
InDetDD::ServiceVolumeMakerMgr::shapeType
std::string shapeType(int index) const
Definition: ServiceVolumeMaker.cxx:178
InDetDD::ServiceVolumeMakerMgr::zsymm
bool zsymm(int index) const
Definition: ServiceVolumeMaker.cxx:159
InDetDD::ServiceVolumeMakerMgr::width
double width(int index) const
Definition: ServiceVolumeMaker.cxx:138
InDetDD::ServiceVolumeMaker::m_services
std::vector< const ServiceVolume * > m_services
Definition: ServiceVolumeMaker.h:152
PlotCalibFromCool.label
label
Definition: PlotCalibFromCool.py:78
InDetDD::ServiceVolumeMaker::m_label
std::string m_label
Definition: ServiceVolumeMaker.h:150
InDetDD::ServiceVolumeMakerMgr::repeat
int repeat(int index) const
Definition: ServiceVolumeMaker.cxx:164
InDetDD::ServiceVolumeMaker::numElements
unsigned int numElements() const
Definition: ServiceVolumeMaker.cxx:275
InDetDD::ServiceVolumeMakerMgr::volId
int volId(int index) const
Definition: ServiceVolumeMaker.cxx:208
InDetDD::ServiceVolumeMakerMgr::zmin
double zmin(int index) const
Definition: ServiceVolumeMaker.cxx:123
InDetDD::ServiceVolumeMaker::m_layerShift
std::vector< double > m_layerShift
Definition: ServiceVolumeMaker.h:153
CheckTagAssociation.schema
schema
Definition: CheckTagAssociation.py:22
InDetDD::ServiceVolumeMaker::make
ServiceVolume * make(int index)
Definition: ServiceVolumeMaker.cxx:280
InDetDD::ServiceVolumeMakerMgr::phiStart
double phiStart(int index) const
Definition: ServiceVolumeMaker.cxx:146
InDetDD::ServiceVolumeMakerMgr::rmax2
double rmax2(int index) const
Definition: ServiceVolumeMaker.cxx:118
lumiFormat.i
int i
Definition: lumiFormat.py:92
InDetDD::ServiceVolumeMakerMgr::zmax
double zmax(int index) const
Definition: ServiceVolumeMaker.cxx:128
InDetDD::ServiceVolumeSchema::simple
bool simple() const
Definition: ServiceVolumeMaker.h:68
InDetDD::ServiceVolumeMakerMgr::materialName
std::string materialName(int index) const
Definition: ServiceVolumeMaker.cxx:198
InDetDD::ServiceVolumeMakerMgr::volName
std::string volName(int index) const
Definition: ServiceVolumeMaker.cxx:190
python.ext.table_printer.table
list table
Definition: table_printer.py:81
InDetDD::ServiceVolumeMakerMgr::shiftFlag
int shiftFlag(int index) const
Definition: ServiceVolumeMaker.cxx:216
InDetDD::ServiceVolumeMakerMgr::readLayerShift
std::vector< double > readLayerShift()
Definition: ServiceVolumeMaker.cxx:225
InDetDD::ServiceVolumeMakerMgr::numElements
unsigned int numElements() const
Definition: ServiceVolumeMaker.cxx:203
InDetDD::ServiceVolumeMakerMgr::rmin2
double rmin2(int index) const
Definition: ServiceVolumeMaker.cxx:113
xAOD::phiWidth
phiWidth
Definition: RingSetConf_v1.cxx:612
InDetDD::ServiceVolumeMakerMgr::rmax
double rmax(int index) const
Definition: ServiceVolumeMaker.cxx:108
InDetDD::ServiceVolumeMakerMgr::phiDelta
double phiDelta(int index) const
Definition: ServiceVolumeMaker.cxx:133
InDetDD::ServiceVolumeMakerMgr::schema
const ServiceVolumeSchema & schema() const
Definition: ServiceVolumeMaker.h:127
InDetDD::ServiceVolumeMakerMgr::radialDiv
int radialDiv(int index) const
Definition: ServiceVolumeMaker.cxx:169
InDetDD::ServiceVolumeMaker::m_mgr
ServiceVolumeMakerMgr * m_mgr
Definition: ServiceVolumeMaker.h:151
python.SystemOfUnits.degree
tuple degree
Definition: SystemOfUnits.py:106
InDetDD::ServiceVolumeMakerMgr::rmin
double rmin(int index) const
Definition: ServiceVolumeMaker.cxx:103