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 1042 of file PixelDetectorDC1DC2.cxx.

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

Member Function Documentation

◆ Build()

GeoVPhysVol * GeoPixelServices::Build ( )
overridevirtual

Implements PixelGeoDC2::GeoVPixelFactory.

Definition at line 1135 of file PixelDetectorDC1DC2.cxx.

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

◆ initialize()

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

Definition at line 1063 of file PixelDetectorDC1DC2.cxx.

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

◆ 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:672
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:1550
PixelGeoDC2::GeoPixelServices::m_material
std::vector< std::string > m_material
Definition: PixelDetectorDC1DC2.h:296
mat
GeoMaterial * mat
Definition: LArDetectorConstructionTBEC.cxx:55
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:727
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:1063
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