DD4hep  1.30.0
Detector Description Toolkit for High Energy Physics
Geant4XML.cpp
Go to the documentation of this file.
1 //==========================================================================
2 // AIDA Detector description implementation
3 //--------------------------------------------------------------------------
4 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
5 // All rights reserved.
6 //
7 // For the licensing terms see $DD4hepINSTALL/LICENSE.
8 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
9 //
10 // Author : M.Frank
11 //
12 //==========================================================================
13 
14 #include <XML/Conversions.h>
16 
17 namespace dd4hep {
18  struct Geant4;
19  class GdmlFile;
20  class Property;
21  class SensitiveDetector;
22 
23  template <> void Converter<Geant4>::operator()(xml_h e) const;
24  template <> void Converter<GdmlFile>::operator()(xml_h e) const;
25  template <> void Converter<Property>::operator()(xml_h e) const;
26  template <> void Converter<SensitiveDetector>::operator()(xml_h e) const;
27 }
28 
29 using namespace dd4hep;
30 
31 template <> void Converter<Geant4>::operator()(xml_h element) const {
32  xml_elt_t compact(element);
33  //xml_coll_t(compact,_U(includes) ).for_each(_U(gdmlFile), Converter<GdmlFile>(description,param));
34  xml_coll_t(compact, _U(properties)).for_each(_U(attributes), Converter < Property > (description, param));
35  xml_coll_t(compact, _U(sensitive_detectors)).for_each(_U(sd), Converter < SensitiveDetector > (description, param));
36 }
37 
38 static long create_Geant4(Detector& description, const xml_h& element) {
39  (Converter < Geant4 > (description))(element);
40  return 1;
41 }
42 DECLARE_XML_DOC_READER(geant4,create_Geant4)
43 
44 static Ref_t handle_Geant4(Detector& description, const xml_h& element) {
45  (Converter < Geant4 > (description))(element);
46  return Ref_t(0);
47 }
48 DECLARE_XMLELEMENT(geant4_xml_setup,handle_Geant4)
dd4hep::Property
The property class to assign options to actions.
Definition: ComponentProperties.h:48
dd4hep::SensitiveDetector
Handle class to hold the information of a sensitive detector.
Definition: DetElement.h:44
dd4hep::Handle< NamedObject >
dd4hep::xml::Handle_t
Class to easily access the properties of single XmlElements.
Definition: XMLElements.h:380
xml_coll_t
dd4hep::xml::Collection_t xml_coll_t
Definition: ConditionsRepository.cpp:35
dd4hep::xml::Collection_t::for_each
void for_each(T oper) const
Loop processor using function object.
Definition: XMLElements.h:667
_U
#define _U(a)
Definition: Tags.h:23
DECLARE_XML_DOC_READER
#define DECLARE_XML_DOC_READER(name, func)
Definition: Factories.h:316
DECLARE_XMLELEMENT
#define DECLARE_XMLELEMENT(name, func)
Definition: Factories.h:301
dd4hep::Ref_t
Handle< NamedObject > Ref_t
Default Ref_t definition describing named objects.
Definition: Handle.h:182
DetFactoryHelper.h
Conversions.h
dd4hep::xml::Element
User abstraction class to manipulate XML elements within a document.
Definition: XMLElements.h:769
dd4hep
Namespace for the AIDA detector description toolkit.
Definition: AlignmentsCalib.h:28
dd4hep::Detector
The main interface to the dd4hep detector description package.
Definition: Detector.h:90