ATLAS Offline Software
PolyconicalEnvelope.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // Base class
8 
9 #include "G4NistManager.hh"
10 #include "G4LogicalVolume.hh"
11 #include "G4PVPlacement.hh"
12 #include "G4SystemOfUnits.hh"
13 #include "G4Polycone.hh"
14 
15 // Geant4 includes used in functions
16 
17 PolyconicalEnvelope::PolyconicalEnvelope(const std::string& type, const std::string& name, const IInterface* parent)
19 {
20  ATH_MSG_VERBOSE( "PolyconicalEnvelope constructor for " << name );
21 }
22 
24 {
25  ATH_MSG_VERBOSE( "PolyconicalEnvelope::BuildGeometry(): Starting" );
26 
27  // Get nist material manager
28  G4NistManager* nist = G4NistManager::Instance();
29 
30  G4Material* mat = nist->FindOrBuildMaterial(m_materialName.value());
31 
32  if (!m_surfaceNr) m_surfaceNr=m_ZSurfaces.size();
33 
34  if (m_innerRadii.size() != m_surfaceNr)
35  ATH_MSG_ERROR("Size of inner radii vector "<<m_innerRadii.size()<<
36  " differs from nr. of surfaces "<<m_surfaceNr<<"!!!");
37  if (m_outerRadii.size() != m_surfaceNr)
38  ATH_MSG_ERROR("Size of outer radii vector "<<m_outerRadii.size()<<
39  " differs from nr. of surfaces "<<m_surfaceNr<<"!!!");
40  if (m_ZSurfaces.size() != m_surfaceNr)
41  ATH_MSG_ERROR("Size of surface Z vector "<<m_ZSurfaces.size()<<
42  " differs from nr. of surfaces "<<m_surfaceNr<<"!!!");
43 
44  double* zv=new double[m_surfaceNr];
45  double* iv=new double[m_surfaceNr];
46  double* ov=new double[m_surfaceNr];
47 
48  for (unsigned int i=0;i<m_surfaceNr;i++)
49  {
50  zv[i]=m_ZSurfaces[i];
51  iv[i]=m_innerRadii[i];
52  ov[i]=m_outerRadii[i];
53  }
54 
55  G4VSolid* envSolid=new G4Polycone(m_detectorName.value(),m_startphi,m_deltaphi,m_surfaceNr,zv,iv,ov);
56 
57  G4LogicalVolume* logicWorld = new G4LogicalVolume(envSolid,mat,m_detectorName.value());
58 
59  m_envelope.theEnvelope=logicWorld;
60 
61  delete[] zv;
62  delete[] iv;
63  delete[] ov;
64  ATH_MSG_VERBOSE( "PolyconicalEnvelope::BuildGeometry(): Finished" );
65  return;
66 }
ReadFromCoolCompare.ov
ov
Definition: ReadFromCoolCompare.py:230
Envelope::theEnvelope
G4LogicalVolume * theEnvelope
Definition: IDetectorGeometryTool.h:20
PolyconicalEnvelope::m_materialName
Gaudi::Property< std::string > m_materialName
Definition: PolyconicalEnvelope.h:30
mat
GeoMaterial * mat
Definition: LArDetectorConstructionTBEC.cxx:55
PolyconicalEnvelope::BuildGeometry
virtual void BuildGeometry() override final
virtual methods being implemented here
Definition: PolyconicalEnvelope.cxx:23
PolyconicalEnvelope::m_outerRadii
Gaudi::Property< std::vector< double > > m_outerRadii
Definition: PolyconicalEnvelope.h:33
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
PolyconicalEnvelope::m_startphi
Gaudi::Property< double > m_startphi
Definition: PolyconicalEnvelope.h:35
PolyconicalEnvelope.h
PolyconicalEnvelope::m_ZSurfaces
Gaudi::Property< std::vector< double > > m_ZSurfaces
Definition: PolyconicalEnvelope.h:34
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
lumiFormat.i
int i
Definition: lumiFormat.py:85
test_pyathena.parent
parent
Definition: test_pyathena.py:15
DetectorGeometryBase.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
DetectorGeometryBase::m_envelope
Envelope m_envelope
Definition: DetectorGeometryBase.h:70
PolyconicalEnvelope::m_deltaphi
Gaudi::Property< double > m_deltaphi
Definition: PolyconicalEnvelope.h:36
DetectorGeometryBase::m_detectorName
Gaudi::Property< std::string > m_detectorName
Definition: DetectorGeometryBase.h:71
PolyconicalEnvelope::PolyconicalEnvelope
PolyconicalEnvelope(const std::string &type, const std::string &name, const IInterface *parent)
Definition: PolyconicalEnvelope.cxx:17
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
DetectorGeometryBase
Definition: DetectorGeometryBase.h:26
PolyconicalEnvelope::m_surfaceNr
Gaudi::Property< unsigned int > m_surfaceNr
Definition: PolyconicalEnvelope.h:31
PolyconicalEnvelope::m_innerRadii
Gaudi::Property< std::vector< double > > m_innerRadii
Definition: PolyconicalEnvelope.h:32