ATLAS Offline Software
Public Member Functions | Protected Attributes | Private Attributes | List of all members
PixelGeoDC2::GeoPixelServices Class Reference

#include <PixelDetectorDC1DC2.h>

Inheritance diagram for PixelGeoDC2::GeoPixelServices:
Collaboration diagram for PixelGeoDC2::GeoPixelServices:

Public Member Functions

 GeoPixelServices (InDetDD::PixelDetectorManager *ddmgr, PixelGeometryManager *mgr, const std::string &)
 
virtual GeoVPhysVol * Build () override
 
int NCylinders ()
 
void SetCylinder (int n)
 
double ZPos ()
 
void initialize (const std::string &)
 

Protected Attributes

PixelGeometryManagerm_gmt_mgr {}
 
StoredMaterialManagerm_mat_mgr {}
 
InDetDD::PixelDetectorManagerm_DDmgr {}
 
const double m_epsilon {}
 

Private Attributes

std::vector< double > m_rmin
 
std::vector< double > m_rmax
 
std::vector< double > m_halflength
 
std::vector< double > m_zpos
 
std::vector< std::string > m_material
 
std::string m_zone
 
int m_nframe {0}
 

Detailed Description

Definition at line 284 of file PixelDetectorDC1DC2.h.

Constructor & Destructor Documentation

◆ GeoPixelServices()

GeoPixelServices::GeoPixelServices ( InDetDD::PixelDetectorManager ddmgr,
PixelGeometryManager mgr,
const std::string &  root 
)

Definition at line 1040 of file PixelDetectorDC1DC2.cxx.

1043  : GeoVPixelFactory (ddmgr, mgr)
1044 {
1045  //
1046  // Initialize the service geometry properly accordning to the
1047  // mother volume where it goes.
1048  // Of course services cannot be placed in other volumes.
1049  if(root == "/Pixel") {
1050  initialize("Outside");
1051  m_zone = "Out";
1052  } else if (root == "/Pixel/PixelBarrel" || root == "/Pixel/PixelEndcap" ) {
1053  initialize("Inside");
1054  m_zone = "In";
1055  } else {
1056  std::cerr << "Services can not be placed in this volume!!!! " << root << std::endl;
1057  }
1058  m_nframe = 0;
1059 }

Member Function Documentation

◆ Build()

GeoVPhysVol * GeoPixelServices::Build ( )
overridevirtual

Implements PixelGeoDC2::GeoVPixelFactory.

Definition at line 1133 of file PixelDetectorDC1DC2.cxx.

1133  {
1134  const GeoMaterial* serviceMat = m_mat_mgr->getMaterial(m_material[m_nframe]);
1135  //
1136  // Dimensions: (m_nframe set with teh SetCylinder method)
1137  //
1138  double rmin = m_rmin[m_nframe];
1139  double rmax = m_rmax[m_nframe];
1140  double halflength = m_halflength[m_nframe];
1141  const GeoTube* serviceTube = new GeoTube(rmin,rmax,halflength);
1142  std::string logName;
1143  if(m_gmt_mgr->isBarrel() ) logName = m_zone+"Brl";
1144  else logName = m_zone+"EC";
1145  logName = logName+std::to_string(m_nframe);
1146  GeoLogVol* theService = new GeoLogVol(logName,serviceTube,serviceMat);
1147  GeoPhysVol* servicePhys = new GeoPhysVol(theService);
1148  return servicePhys;
1149 }

◆ initialize()

void GeoPixelServices::initialize ( const std::string &  a)

Definition at line 1061 of file PixelDetectorDC1DC2.cxx.

1062 {
1063  //
1064  // Here I inizialize the geometry information contained in the vectors
1065  //
1066 
1067  //
1068  // Loop over the service elements:
1069  //
1070  int NServices = m_gmt_mgr->PixelServiceNFrame(a);
1071  for(int ii = 0; ii<NServices ; ii++) {
1072  //
1073  // If the element is attached to a layer/disk check if the LD is present.
1074  //
1075  int LD = m_gmt_mgr->PixelServiceLD(a, ii);
1076  //
1077  // C counts from zero. So the LDs are 0,1,2. -1 correspond to a
1078  // service which is not attached to any LD.
1079  //
1080  if(LD != -1) m_gmt_mgr->SetCurrentLD(LD);
1081  if(LD ==-1 || m_gmt_mgr->isLDPresent()) {
1082  double zpos,halflength;
1083 //
1084 // Retrieve/calculate the parameters for the volume.
1085 //
1086 // Here the atlsim logic has to be interpreted, as this is going into
1087 // the structure of the PBOI bank that I'm using
1088 //
1089  std::string mat = m_gmt_mgr->PixelServiceMaterial(a, ii);
1090  double* r = m_gmt_mgr->PixelServiceR(a, ii);
1091  double* z = m_gmt_mgr->PixelServiceZ(a, ii);
1092  //
1093  // If zin is 0... (within 10^-5) this is a volume symmetric around
1094  // the origin
1095  //
1096  if(fabs(z[0]) < 0.000001) {
1097  zpos = 0.;
1098  halflength = fabs(z[1])-m_epsilon;
1099  } else {
1100  halflength = fabs(z[1]-z[0])/2.-m_epsilon;
1101  zpos = (z[1]+z[0])/2.+m_epsilon/2.;
1102  }
1103  //
1104  // Push the object into the vectors: (twice if needed)
1105  //
1106  //
1107  //
1108  bool twovolumes;
1109  twovolumes = zpos > 0.00001 && r[0] >0.;
1110  // only once for the inside endcaps as I already have two endcaps!
1111  if(m_gmt_mgr->isEndcap() && a == "Inside") twovolumes = false;
1112  m_rmin.push_back(fabs(r[0]));
1113  m_rmax.push_back(r[1]);
1114  m_zpos.push_back(zpos);
1115  m_halflength.push_back(halflength);
1116  m_material.push_back(mat);
1117  if(twovolumes) {
1118  m_rmin.push_back(fabs(r[0]));
1119  m_rmax.push_back(r[1]);
1120  m_zpos.push_back(-zpos);
1121  m_halflength.push_back(halflength);
1122  m_material.push_back(mat);
1123  }
1124  delete[] r;
1125  delete[] z;
1126  }
1127  //
1128  // Delete r and z...
1129  //
1130  }
1131 }

◆ NCylinders()

int PixelGeoDC2::GeoPixelServices::NCylinders ( )
inline

Definition at line 290 of file PixelDetectorDC1DC2.h.

290 {return m_rmin.size();}

◆ SetCylinder()

void PixelGeoDC2::GeoPixelServices::SetCylinder ( int  n)
inline

Definition at line 291 of file PixelDetectorDC1DC2.h.

291 {m_nframe = n;}

◆ ZPos()

double PixelGeoDC2::GeoPixelServices::ZPos ( )
inline

Definition at line 292 of file PixelDetectorDC1DC2.h.

292 {return m_zpos[m_nframe];}

Member Data Documentation

◆ m_DDmgr

InDetDD::PixelDetectorManager* PixelGeoDC2::GeoVPixelFactory::m_DDmgr {}
protectedinherited

Definition at line 53 of file PixelDetectorDC1DC2.h.

◆ m_epsilon

const double PixelGeoDC2::GeoVPixelFactory::m_epsilon {}
protectedinherited

Definition at line 54 of file PixelDetectorDC1DC2.h.

◆ m_gmt_mgr

PixelGeometryManager* PixelGeoDC2::GeoVPixelFactory::m_gmt_mgr {}
protectedinherited

Definition at line 51 of file PixelDetectorDC1DC2.h.

◆ m_halflength

std::vector<double> PixelGeoDC2::GeoPixelServices::m_halflength
private

Definition at line 295 of file PixelDetectorDC1DC2.h.

◆ m_mat_mgr

StoredMaterialManager* PixelGeoDC2::GeoVPixelFactory::m_mat_mgr {}
protectedinherited

Definition at line 52 of file PixelDetectorDC1DC2.h.

◆ m_material

std::vector<std::string> PixelGeoDC2::GeoPixelServices::m_material
private

Definition at line 296 of file PixelDetectorDC1DC2.h.

◆ m_nframe

int PixelGeoDC2::GeoPixelServices::m_nframe {0}
private

Definition at line 298 of file PixelDetectorDC1DC2.h.

◆ m_rmax

std::vector<double> PixelGeoDC2::GeoPixelServices::m_rmax
private

Definition at line 295 of file PixelDetectorDC1DC2.h.

◆ m_rmin

std::vector<double> PixelGeoDC2::GeoPixelServices::m_rmin
private

Definition at line 295 of file PixelDetectorDC1DC2.h.

◆ m_zone

std::string PixelGeoDC2::GeoPixelServices::m_zone
private

Definition at line 297 of file PixelDetectorDC1DC2.h.

◆ m_zpos

std::vector<double> PixelGeoDC2::GeoPixelServices::m_zpos
private

Definition at line 295 of file PixelDetectorDC1DC2.h.


The documentation for this class was generated from the following files:
beamspotman.r
def r
Definition: beamspotman.py:676
PixelGeoDC2::GeoPixelServices::m_nframe
int m_nframe
Definition: PixelDetectorDC1DC2.h:298
PixelGeoDC2::GeoVPixelFactory::m_gmt_mgr
PixelGeometryManager * m_gmt_mgr
Definition: PixelDetectorDC1DC2.h:51
PixelGeoDC2::GeoVPixelFactory::m_epsilon
const double m_epsilon
Definition: PixelDetectorDC1DC2.h:54
PixelGeoDC2::PixelGeometryManager::PixelServiceLD
virtual int PixelServiceLD(std::string, int)=0
PixelGeoDC2::PixelGeometryManager::PixelServiceMaterial
virtual std::string PixelServiceMaterial(std::string, int)=0
PixelGeoDC2::GeoVPixelFactory::GeoVPixelFactory
GeoVPixelFactory(InDetDD::PixelDetectorManager *ddmgr, PixelGeometryManager *mgr)
Definition: PixelDetectorDC1DC2.cxx:1536
PixelGeoDC2::GeoPixelServices::m_material
std::vector< std::string > m_material
Definition: PixelDetectorDC1DC2.h:296
mat
GeoMaterial * mat
Definition: LArDetectorConstructionTBEC.cxx:53
PixelGeoDC2::GeoVPixelFactory::m_mat_mgr
StoredMaterialManager * m_mat_mgr
Definition: PixelDetectorDC1DC2.h:52
sendEI_SPB.root
root
Definition: sendEI_SPB.py:34
PixelGeoDC2::PixelGeometryManager::PixelServiceR
virtual double * PixelServiceR(std::string, int)=0
PixelGeoDC2::PixelGeometryManager::isEndcap
virtual bool isEndcap()=0
PixelGeoDC2::PixelGeometryManager::SetCurrentLD
virtual void SetCurrentLD(int i)=0
PixelGeoDC2::GeoPixelServices::m_zone
std::string m_zone
Definition: PixelDetectorDC1DC2.h:297
BchCleanup.mgr
mgr
Definition: BchCleanup.py:294
PixelGeoDC2::PixelGeometryManager::PixelServiceZ
virtual double * PixelServiceZ(std::string, int)=0
PixelGeoDC2::PixelGeometryManager::isLDPresent
virtual bool isLDPresent()=0
z
#define z
beamspotman.n
n
Definition: beamspotman.py:731
PixelGeoDC2::GeoPixelServices::m_zpos
std::vector< double > m_zpos
Definition: PixelDetectorDC1DC2.h:295
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
PixelGeoDC2::GeoPixelServices::m_halflength
std::vector< double > m_halflength
Definition: PixelDetectorDC1DC2.h:295
PixelGeoDC2::PixelGeometryManager::PixelServiceNFrame
virtual int PixelServiceNFrame(std::string)=0
a
TList * a
Definition: liststreamerinfos.cxx:10
StoredMaterialManager::getMaterial
virtual const GeoMaterial * getMaterial(const std::string &name)=0
PixelGeoDC2::PixelGeometryManager::isBarrel
virtual bool isBarrel()=0
PixelGeoDC2::GeoPixelServices::initialize
void initialize(const std::string &)
Definition: PixelDetectorDC1DC2.cxx:1061
PixelGeoDC2::GeoPixelServices::m_rmax
std::vector< double > m_rmax
Definition: PixelDetectorDC1DC2.h:295
PixelGeoDC2::GeoPixelServices::m_rmin
std::vector< double > m_rmin
Definition: PixelDetectorDC1DC2.h:295