ATLAS Offline Software
Public Member Functions | Protected Attributes | Private Member Functions | List of all members
ToyDetectorTool Class Referencefinal

#include <ToyDetectorTool.h>

Inheritance diagram for ToyDetectorTool:
Collaboration diagram for ToyDetectorTool:

Public Member Functions

 ToyDetectorTool (const std::string &type, const std::string &name, const IInterface *parent)
 
virtual ~ToyDetectorTool () override final
 
virtual StatusCode create () override final
 
virtual GeoVDetectorManager * manager ()
 The Detector Node corresponding to this tool. More...
 
virtual const GeoVDetectorManager * manager () const
 
virtual StatusCode clear () override
 
virtual StatusCode registerCallback ATLAS_NOT_THREAD_SAFE () override
 
virtual StatusCode align (IOVSVC_CALLBACK_ARGS) override
 

Protected Attributes

GeoVDetectorManager * m_detector
 

Private Member Functions

void printVolume (GeoPVConstLink volime, int level=0)
 

Detailed Description

Definition at line 11 of file ToyDetectorTool.h.

Constructor & Destructor Documentation

◆ ToyDetectorTool()

ToyDetectorTool::ToyDetectorTool ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Definition at line 18 of file ToyDetectorTool.cxx.

20 {
21 }

◆ ~ToyDetectorTool()

ToyDetectorTool::~ToyDetectorTool ( )
finaloverridevirtual

Definition at line 23 of file ToyDetectorTool.cxx.

24 {
25  delete m_detector;
26 }

Member Function Documentation

◆ align()

StatusCode GeoModelTool::align ( IOVSVC_CALLBACK_ARGS  )
overridevirtualinherited

Reimplemented in ALFA_DetectorTool, HGTD_DetectorTool, TRT_DetectorTool, LArDetectorToolNV, PixelDetectorTool, and SCT_DetectorTool.

Definition at line 33 of file GeoModelTool.cxx.

34 {
35  return StatusCode::SUCCESS;
36 }

◆ ATLAS_NOT_THREAD_SAFE()

virtual StatusCode registerCallback GeoModelTool::ATLAS_NOT_THREAD_SAFE ( )
overridevirtualinherited

◆ clear()

StatusCode GeoModelTool::clear ( )
overridevirtualinherited

◆ create()

StatusCode ToyDetectorTool::create ( )
finaloverridevirtual

Definition at line 28 of file ToyDetectorTool.cxx.

29 {
30  ATH_MSG_INFO("ToyDetectorTool::create() ...");
31 
32  // Locate the top level experiment
33  GeoModelExperiment* theExpt = nullptr;
34  ATH_CHECK(detStore()->retrieve(theExpt, "ATLAS"));
35 
36  ToyDetectorFactory theToyFactory(detStore().operator->());
37  if(m_detector==nullptr) {
38  // Build geometry
39  try {
40  //
41  // This strange way of casting is to avoid an
42  // utterly brain damaged compiler warning.
43  //
44  GeoPhysVol *world=theExpt->getPhysVol();
45  theToyFactory.create(world);
46  printVolume(world);
47  }
48  catch (const std::bad_alloc&) {
49  ATH_MSG_FATAL("Could not Toy Detector Geometry!");
50  return StatusCode::FAILURE;
51  }
52  // Add detector manager to AtlasExperiment and also record it into DetStore
53  theExpt->addManager(theToyFactory.getDetectorManager());
54  if (detStore()->record(theToyFactory.getDetectorManager(),theToyFactory.getDetectorManager()->getName()).isSuccess()) return StatusCode::SUCCESS;
55  ATH_MSG_FATAL("Failed to record Toy Detector Manager into Detector Store!");
56  }
57  else {
58  ATH_MSG_FATAL("Attempt to build Toy Detector Geometry one more time. The geometry can be built only once!");
59  }
60  return StatusCode::FAILURE;
61 }

◆ manager() [1/2]

GeoVDetectorManager * GeoModelTool::manager ( )
virtualinherited

The Detector Node corresponding to this tool.

Definition at line 21 of file GeoModelTool.cxx.

21  {
22  return m_detector;
23 }

◆ manager() [2/2]

const GeoVDetectorManager * GeoModelTool::manager ( ) const
virtualinherited

Definition at line 24 of file GeoModelTool.cxx.

24  {
25  return m_detector;
26 }

◆ printVolume()

void ToyDetectorTool::printVolume ( GeoPVConstLink  volime,
int  level = 0 
)
private

Definition at line 63 of file ToyDetectorTool.cxx.

64 {
65  GeoVolumeCursor cursor(volume);
66  while(!cursor.atEnd()) {
67  GeoPVConstLink physChild = cursor.getVolume();
68  GeoTrf::Transform3D position = cursor.getTransform();
69  for(int k{0};k<level;++k) std::cout << "... ";
70  std::cout << cursor.getName() << " " << (cursor.getId().isValid()?std::to_string(cursor.getId()).c_str():"N/A")
71  << " Transform:" << "\n";
72  for(int i{0};i<3;++i) {
73  for(int j{0};j<4;++j) {
74  std::cout << position(i,j) << " ";
75  }
76  std::cout << "\n";
77  }
78  printVolume(physChild, level+1);
79  cursor.next();
80  }
81 }

Member Data Documentation

◆ m_detector

GeoVDetectorManager* GeoModelTool::m_detector
protectedinherited

Definition at line 36 of file GeoModelTool.h.


The documentation for this class was generated from the following files:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
GeoModelExperiment::getPhysVol
GeoPhysVol * getPhysVol()
Destructor.
Definition: GeoModelExperiment.cxx:21
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
GeoModelExperiment
Definition: GeoModelExperiment.h:32
GeoModelTool::GeoModelTool
GeoModelTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor(s)
Definition: GeoModelTool.cxx:12
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
lumiFormat.i
int i
Definition: lumiFormat.py:85
ToyDetectorTool::printVolume
void printVolume(GeoPVConstLink volime, int level=0)
Definition: ToyDetectorTool.cxx:63
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
GeoModelTool::m_detector
GeoVDetectorManager * m_detector
Definition: GeoModelTool.h:36
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
ToyDetectorFactory
Definition: ToyDetectorFactory.h:10
GeoModelExperiment::addManager
void addManager(const GeoVDetectorManager *)
Definition: GeoModelExperiment.cxx:40
query_example.cursor
cursor
Definition: query_example.py:21
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
fitman.k
k
Definition: fitman.py:528