ATLAS Offline Software
ForDetEnvelopeFactory.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
8 #include "GeoModelKernel/GeoMaterial.h"
9 #include "GeoModelKernel/GeoTube.h"
10 #include "GeoModelKernel/GeoLogVol.h"
11 #include "GeoModelKernel/GeoNameTag.h"
12 #include "GeoModelKernel/GeoPhysVol.h"
13 #include "GeoModelKernel/GeoShapeShift.h"
14 #include "GeoModelKernel/GeoShapeUnion.h"
15 
16 #include "StoreGate/StoreGateSvc.h"
17 #include "GaudiKernel/SystemOfUnits.h"
18 
19 #include <vector>
20 
21 
23  : m_detectorManager(nullptr),
24  m_materialManager(nullptr),
25  m_detectorStore(detStore)
26 {
27 }
28 
29 
30 void ForDetEnvelopeFactory::create(GeoPhysVol *world)
31 {
32  if (StatusCode::SUCCESS != m_detectorStore->retrieve(m_materialManager, std::string("MATERIALS"))) {
33  return;
34  }
35 
36  // Get the materials
37  const GeoMaterial* air = m_materialManager->getMaterial("std::Air");
38 
39  // Build boolean shape: union of two tubes
40  const GeoTube* tube1 = new GeoTube(0.,2000.*Gaudi::Units::mm,188750.*Gaudi::Units::mm);
41  GeoTube* tube2 = new GeoTube(0.,2000.*Gaudi::Units::mm,188750.*Gaudi::Units::mm);
42  GeoTrf::TranslateZ3D xfRelativeA(211250.*Gaudi::Units::mm);
43  GeoTrf::TranslateZ3D xfRelativeC(-211250.*Gaudi::Units::mm);
44 
45  const GeoShapeShift& envShape1 = (*tube1)<<xfRelativeA;
46  const GeoShapeUnion& envShape = envShape1.add((*tube2)<<xfRelativeC);
47 
48  GeoLogVol* lvEnv = new GeoLogVol("ForDetEnvelope",&envShape,air);
49  GeoPhysVol* pvEnv = new GeoPhysVol(lvEnv);
50 
51  GeoNameTag *tag = new GeoNameTag("ForDetEnvelope");
52  world->add(tag);
53  world->add(pvEnv);
54 
57 }
58 
59 
61 {
62  return m_detectorManager;
63 }
64 
ForDetEnvelopeFactory::ForDetEnvelopeFactory
ForDetEnvelopeFactory(StoreGateSvc *pDetStore)
Definition: ForDetEnvelopeFactory.cxx:22
ForDetEnvelopeManager::addTreeTop
void addTreeTop(const PVLink &)
Definition: ForDetEnvelopeManager.cxx:26
ForDetEnvelopeManager
Definition: ForDetEnvelopeManager.h:14
ForDetEnvelopeFactory::m_detectorManager
ForDetEnvelopeManager * m_detectorManager
Definition: ForDetEnvelopeFactory.h:38
ForDetEnvelopeFactory::getDetectorManager
virtual const ForDetEnvelopeManager * getDetectorManager() const override
Definition: ForDetEnvelopeFactory.cxx:60
ForDetEnvelopeFactory::m_detectorStore
StoreGateSvc * m_detectorStore
Definition: ForDetEnvelopeFactory.h:41
StoreGateSvc::retrieve
StatusCode retrieve(const T *&ptr) const
Retrieve the default object into a const T*.
ForDetEnvelopeFactory::m_materialManager
StoredMaterialManager * m_materialManager
Definition: ForDetEnvelopeFactory.h:40
ForDetEnvelopeFactory::create
virtual void create(GeoPhysVol *world) override
Definition: ForDetEnvelopeFactory.cxx:30
StoreGateSvc
The Athena Transient Store API.
Definition: StoreGateSvc.h:125
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
StoredMaterialManager.h
python.SystemOfUnits.mm
int mm
Definition: SystemOfUnits.py:83
ForDetEnvelopeFactory.h
StoredMaterialManager::getMaterial
virtual const GeoMaterial * getMaterial(const std::string &name)=0
CaloCondBlobAlgs_fillNoiseFromASCII.tag
string tag
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:24
StoreGateSvc.h