diff --git a/DDCore/include/DD4hep/Alignment.h b/DDCore/include/DD4hep/Alignment.h index 142ada4a1584a0a3792bd89cf9a7ce3534e5901d..728b9e8bcb1b61d601e73ec8df3cca79d7dc9f33 100644 --- a/DDCore/include/DD4hep/Alignment.h +++ b/DDCore/include/DD4hep/Alignment.h @@ -26,11 +26,10 @@ namespace DD4hep { class DetElement; - /** @class Alignment Alignment.h DD4hep/Alignment.h - * - * See the documentation about the TGeoPhysicalNode for further - * details. - * + /// Main handle class to hold a TGeo alignment object of type TGeoPhysicalNode + /** + * See the ROOT documentation about the TGeoPhysicalNode for further details: + * @see http://root.cern.ch/root/html/TGeoPhysicalNode.html * * @author M.Frank * @version 1.0 diff --git a/DDCore/include/DD4hep/BasicGrammar.h b/DDCore/include/DD4hep/BasicGrammar.h index fc701a5ddb08f76988211411a4aa862314175a49..ddae3452749bedb3903afa4e8e6263becdf5f4c9 100644 --- a/DDCore/include/DD4hep/BasicGrammar.h +++ b/DDCore/include/DD4hep/BasicGrammar.h @@ -18,8 +18,8 @@ */ namespace DD4hep { - /** @class BasicGrammar - * + /// Base class describing string evaluation to C++ objects using boost::spirit + /** * @author M.Frank * @date 13.08.2013 */ diff --git a/DDCore/include/DD4hep/Callback.h b/DDCore/include/DD4hep/Callback.h index ce1ef65eba78d1fc8c916438a345421c98df14a8..1a97069c96669803546412a45f07a0574ddcf940 100644 --- a/DDCore/include/DD4hep/Callback.h +++ b/DDCore/include/DD4hep/Callback.h @@ -19,10 +19,9 @@ */ namespace DD4hep { - /**@class Callback Callback.h CPP/Callback.h - * - * Definition of the generic callback structure for member functions - * + + /// Definition of the generic callback structure for member functions + /** * @author M.Frank * @date 01/03/2013 * @version 0.1 @@ -280,6 +279,12 @@ namespace DD4hep { } }; + /// Definition of an actor on sequences of callbacks + /** + * @author M.Frank + * @date 01/03/2013 + * @version 0.1 + */ struct CallbackSequence { typedef std::vector<Callback> Callbacks; enum Location { FRONT, END }; @@ -312,9 +317,13 @@ namespace DD4hep { else callbacks.insert(callbacks.end(),cb); } + /// Execution overload for callbacks with no arguments void operator()() const; + /// Execution overload for callbacks with 1 argument template <typename A0> void operator()(A0 a0) const; + /// Execution overload for callbacks with 2 arguments template <typename A0, typename A1> void operator()(A0 a0, A1 a1) const; + /// Execution overload for callbacks with 3 arguments template <typename A0, typename A1, typename A2> void operator()(A0 a0, A1 a1, A2 a2) const; /// Check the compatibility of two typed objects. The test is the result of a dynamic_cast static void checkTypes(const std::type_info& typ1, const std::type_info& typ2, void* test); @@ -336,6 +345,7 @@ namespace DD4hep { } }; + /// Execution overload for callbacks with no arguments inline void CallbackSequence::operator()() const { if (!callbacks.empty()) { const void* args[1] = { 0 }; @@ -343,6 +353,7 @@ namespace DD4hep { (*i).execute(args); } } + /// Execution overload for callbacks with 1 argument template <typename A0> inline void CallbackSequence::operator()(A0 a0) const { if (!callbacks.empty()) { @@ -351,6 +362,7 @@ namespace DD4hep { (*i).execute(args); } } + /// Execution overload for callbacks with 2 arguments template <typename A0, typename A1> inline void CallbackSequence::operator()(A0 a0, A1 a1) const { if (!callbacks.empty()) { @@ -359,6 +371,7 @@ namespace DD4hep { (*i).execute(args); } } + /// Execution overload for callbacks with 3 arguments template <typename A0, typename A1, typename A2> inline void CallbackSequence::operator()(A0 a0, A1 a1, A2 a2) const { if (!callbacks.empty()) { diff --git a/DDCore/include/DD4hep/Conditions.h b/DDCore/include/DD4hep/Conditions.h index 0f8fb5eb0d6131b34168dc5e1de97b098583618d..2f8c89608c155e6a9900ca94f82b9403736e0a55 100644 --- a/DDCore/include/DD4hep/Conditions.h +++ b/DDCore/include/DD4hep/Conditions.h @@ -35,9 +35,10 @@ namespace DD4hep { class IOV; } - /** @class Block ConditionsInterna.h DD4hep/ConditionsInterna.h - * - * Class describing an opaque conditions data block + /// Class describing an opaque conditions data block + /** + * Access methods are templated. Once the access is fixed + * on the first call, the data type may not be changed anymore. * * @author M.Frank * @version 1.0 @@ -67,14 +68,13 @@ namespace DD4hep { template <typename T> inline const T& get() const; }; - /** @class Condition Condition.h DD4hep/Condition.h - * - * See the documentation about the TGeoPhysicalNode for further - * details. + /// Main condition object handle. + /** + * This objects allows access to the data block and + * the interval of validity for a single condition. * - * - * @author M.Frank - * @version 1.0 + * @author M.Frank + * @version 1.0 */ class Condition: public Handle<ConditionsInterna::ConditionObject> { public: @@ -162,8 +162,8 @@ namespace DD4hep { inline Condition::Condition() : Handle<Condition::Object>() { } - /** @class Conditions Conditions.h DD4hep/Conditions.h - * + /// Container class for condition handles aggregated by a detector element + /** * Note: The conditions container is owner by the detector element * On deletion the detector element will destroy the container * and all associated entries. diff --git a/DDCore/include/DD4hep/DD4hepRootPersistency.h b/DDCore/include/DD4hep/DD4hepRootPersistency.h index 51a0bc0e63680619f8f8f37253e4696cbdf35bd0..edfec68d021711daea5c7a07c98ac985d62025bf 100644 --- a/DDCore/include/DD4hep/DD4hepRootPersistency.h +++ b/DDCore/include/DD4hep/DD4hepRootPersistency.h @@ -13,12 +13,18 @@ // Framework include files #include "DD4hep/LCDDData.h" +/// Helper class to support ROOT persistency of LCDD objects class DD4hepRootPersistency : public TNamed, public DD4hep::Geometry::LCDDData { public: + /// Default constructor DD4hepRootPersistency() : TNamed() {} + /// Default destructor virtual ~DD4hepRootPersistency() {} + static int save(DD4hep::Geometry::LCDD& lcdd, const char* fname, const char* instance = "Geometry"); static int load(DD4hep::Geometry::LCDD& lcdd, const char* fname, const char* instance = "Geometry"); + + /// ROOT implementation macro ClassDef(DD4hepRootPersistency,1); }; diff --git a/DDCore/include/DD4hep/DetFactoryHelper.h b/DDCore/include/DD4hep/DetFactoryHelper.h index 1fc06db0428586b969f7e44bd8c3c4b5fec99704..df8a1f302d37f1ee869ba27c68ed0544c8644971 100644 --- a/DDCore/include/DD4hep/DetFactoryHelper.h +++ b/DDCore/include/DD4hep/DetFactoryHelper.h @@ -37,10 +37,12 @@ namespace DD4hep { * Geometry sub-namespace declaration */ namespace Geometry { + /// std::string conversion of XML strings (e.g. Unicode for Xerces-C) static inline std::string _toString(const DD4hep::XML::XmlChar* value) { return XML::_toString(value); } + /// std::string conversion of arbitrary entities including user defined formatting. template <typename T> inline std::string _toString(T value, const char* fmt) { return XML::_toString(value, fmt); } diff --git a/DDCore/include/DD4hep/Detector.h b/DDCore/include/DD4hep/Detector.h index f9cc577302f10c244b71fc976c8fcacdfb426310..14e0d664dbee57e567f33f19020e2805b9977387 100644 --- a/DDCore/include/DD4hep/Detector.h +++ b/DDCore/include/DD4hep/Detector.h @@ -37,8 +37,8 @@ namespace DD4hep { class DetElementObject; class SensitiveDetectorObject; - /** @class SensitiveDetector Detector.h DD4hep/lcdd/Detector.h - * + /// Handle class to hold the information of a sensitive detector. + /** * @author M.Frank * @version 1.0 */ @@ -159,21 +159,22 @@ namespace DD4hep { } }; - /** @class SubDetector Detector.h DD4hep/lcdd/Detector.h - * + /// Handle class describing a detector element + /** * Detector elements (class DetElement are entities which represent * subdetectors or sizable parts of a subdetector. * A DetElement instance has the means to provide to clients information about * - * -- the detector hierarchy by exposing its children. - * -- its placement within the overall experiment if it represents an - * entire subdetector or its placement with respect to its parent - * if the \tw{DetElement} represents a part of a subdetector. - * -- information about the \tw{Readout} structure if the object is - * instrumented and read-out. Otherwise this link is empty. - * -- information about the environmental conditions etc. (\tw{conditons}). - * -- alignment information. - * + * <ul> + * <li> the detector hierarchy by exposing its children. + * <li> its placement within the overall experiment if it represents an + * entire subdetector or its placement with respect to its parent + * if the \tw{DetElement} represents a part of a subdetector. + * <li> information about the \tw{Readout} structure if the object is + * instrumented and read-out. Otherwise this link is empty. + * <li> information about the environmental conditions etc. (\tw{conditons}). + * <li> alignment information. + * </ul> * * @author M.Frank * @version 1.0 @@ -236,7 +237,7 @@ namespace DD4hep { : RefObject() { } - /// Constructor to copy handled object + /// Constructor to hold handled object DetElement(Object* ptr) : RefObject(ptr) { } @@ -402,9 +403,4 @@ namespace DD4hep { } /* End namespace Geometry */ } /* End namespace DD4hep */ -// It is not so clear if Clients do really rely on the interna -// of the DetElement and the SensitiveDetector object .... - -//#include "DD4hep/objects/DetectorInterna.h" - #endif /* DD4HEP_DETECTOR_H */ diff --git a/DDCore/include/DD4hep/DetectorTools.h b/DDCore/include/DD4hep/DetectorTools.h index 7599a5f3b583a87317e7bac0efe0b80885b4fb88..9654ed3da5d13838ccad9ec9480a3a840efb2e41 100644 --- a/DDCore/include/DD4hep/DetectorTools.h +++ b/DDCore/include/DD4hep/DetectorTools.h @@ -27,7 +27,8 @@ namespace DD4hep { // Forward declarations class LCDD; - /** @class Detectortools DetectorTools.h DD4hep/Detectortools.h + /// Helper namespace used to answer detector element specific questons + /** * * @author M.Frank * @version 1.0 diff --git a/DDCore/include/DD4hep/Dictionary.h b/DDCore/include/DD4hep/Dictionary.h index 85634278a66bb94f42334f4e06120612aaaba73e..c55722a75bb2f2eb053eaf84062bd418cbc1bb70 100644 --- a/DDCore/include/DD4hep/Dictionary.h +++ b/DDCore/include/DD4hep/Dictionary.h @@ -22,6 +22,15 @@ #include <map> typedef DD4hep::Geometry::PlacedVolumeExtension::VolID VolID; +#include "TRint.h" +namespace DD4hep { + void run_interpreter(const std::string& name) { + pair<int, char**> a(0,0); + TRint app(name.c_str(), &a.first, a.second); + app.Run(); + } +} + // ------------------------------------------------------------------------- // Regular DD4hep dictionaries @@ -67,6 +76,7 @@ template class DD4hep::Geometry::Handle<TNamed>; #pragma link C++ class DD4hep::Geometry::VolumeManager+; #pragma link C++ class DD4hep::Geometry::VolumeManagerObject+; +#pragma link C++ class DD4hep::Geometry::VolumeManagerContext+; #pragma link C++ class DD4hep::Geometry::Handle<DD4hep::Geometry::VolumeManagerObject>+; #pragma link C++ class DD4hep::Geometry::CartesianField+; @@ -150,6 +160,8 @@ template class DD4hep::Geometry::Handle<TNamed>; #pragma link C++ class vector<DD4hep::Geometry::DetElement>+; #pragma link C++ class pair<string,DD4hep::Geometry::DetElement>+; #pragma link C++ class map<string,DD4hep::Geometry::DetElement>+; +#pragma link C++ class map<string,DD4hep::Geometry::DetElement>::iterator; +#pragma link C++ class map<string,DD4hep::Geometry::DetElement>::const_iterator; #pragma link C++ class DD4hep::Geometry::SensitiveDetector+; #pragma link C++ class DD4hep::Geometry::SensitiveDetectorObject+; @@ -171,6 +183,8 @@ template vector<pair<string, int> >::iterator; #pragma link C++ class DD4hep::Geometry::PlacedVolumeExtension+; #pragma link C++ class vector<DD4hep::Geometry::PlacedVolume>+; #pragma link C++ class DD4hep::Geometry::Handle<TGeoNode>+; +#pragma link C++ class vector<TGeoNode*>+; +#pragma link C++ class vector<TGeoVolume*>+; // Shapes.h @@ -233,6 +247,7 @@ template vector<pair<string, int> >::iterator; #pragma link C++ class DD4hep::Geometry::LCDD+; +#pragma link C++ function DD4hep::run_interpreter(const std::string& name); #pragma link C++ function DD4hep::Geometry::_toDictionary(const string&, const string&); #endif // __CINT__ diff --git a/DDCore/include/DD4hep/Exceptions.h b/DDCore/include/DD4hep/Exceptions.h index 2ae200ce42d451e950c006b86a3c0ac50db5d907..0934cb723b201ec8e926a8b959a8d7b2adbf6cae 100644 --- a/DDCore/include/DD4hep/Exceptions.h +++ b/DDCore/include/DD4hep/Exceptions.h @@ -19,8 +19,8 @@ */ namespace DD4hep { - /** @class unrelated_type_error - * + /// Exception class to signal operations on unrelated classes + /** * @author M.Frank * @date 13.08.2013 */ @@ -31,8 +31,8 @@ namespace DD4hep { } }; - /** @class unrelated_value_error - * + /// Exception class to signal operations on unrelated types of values + /** * @author M.Frank * @date 13.08.2013 */ diff --git a/DDCore/include/DD4hep/FieldTypes.h b/DDCore/include/DD4hep/FieldTypes.h index 10586b2050f260efdaa84ced418ffc9518beaa7c..04a58b7f09f4fdde8e89410ce142abb3d28153b9 100644 --- a/DDCore/include/DD4hep/FieldTypes.h +++ b/DDCore/include/DD4hep/FieldTypes.h @@ -24,6 +24,7 @@ namespace DD4hep { */ namespace Geometry { + /// Implementation object of a field with constant strength /** @class ConstantField FieldTypes.h * * Generic constant uniform field @@ -44,6 +45,7 @@ namespace DD4hep { virtual void fieldComponents(const double* /* pos */, double* field); }; + /// Implementation object of a solenoidal magnetic field. /** @class SolenoidField FieldTypes.h DD4hep/FieldTypes.h * * Generic solonoid magnetic field @@ -67,6 +69,7 @@ namespace DD4hep { virtual void fieldComponents(const double* pos, double* field); }; + /// Implementation object of a dipole magnetic field. /** @class DipoleField FieldTypes.h DD4hep/FieldTypes.h * * Generic solonoid magnetic field diff --git a/DDCore/include/DD4hep/Fields.h b/DDCore/include/DD4hep/Fields.h index 2223da916f7765dfd62e19fab3e1dc73e874fd01..de56ede57004df7767e9b0f02cb76ddc9c07ce4c 100644 --- a/DDCore/include/DD4hep/Fields.h +++ b/DDCore/include/DD4hep/Fields.h @@ -32,8 +32,8 @@ namespace DD4hep { typedef Position Direction; - /** @class CartesianField Fields.h - * + /// Handle class describing any field with 3D cartesian vectors for the field strength. + /** * Generic structure describing any field type (electric or magnetic) * with field components in Cartesian coordinates. * @@ -114,8 +114,8 @@ namespace DD4hep { typedef CartesianField ElectricField; typedef CartesianField MagneticField; - /** @class OverlayedField Fields.h - * + /// Class describing a field overlay with several sources + /** * Generic structure describing any field type (electric or magnetic) * with field components in Cartesian coordinates. * diff --git a/DDCore/include/DD4hep/GeoHandler.h b/DDCore/include/DD4hep/GeoHandler.h index ae2547fc99346391bad70ce1c8fefd2ca56ea46d..0a2ef3038851167ffb6a23bab86f47e0a378f637 100644 --- a/DDCore/include/DD4hep/GeoHandler.h +++ b/DDCore/include/DD4hep/GeoHandler.h @@ -40,6 +40,7 @@ namespace DD4hep { class SensitiveDetector; class VisAttrObject; + /// Defintion of the object types used by generic geometry handlers /** @class GeoHandlerTypes GeoHandler.h * * @author M.Frank @@ -78,7 +79,14 @@ namespace DD4hep { }; }; + /// The base class for all DD4hep geometry crawlers /** @class GeoHandler GeoHandler.h + * + * Geometry crawlers are used for multiple purposes, whenever entire + * geometries must be traversed like e.g. to create a new geometry + * for simulation etc. + * While analysing the geometry, information is collected, which + * may be later processed. * * @author M.Frank * @version 1.0 @@ -115,6 +123,7 @@ namespace DD4hep { Data* release(); }; + /// Geometry scanner (handle object) struct GeoScan { protected: /// Data holder diff --git a/DDCore/include/DD4hep/Handle.h b/DDCore/include/DD4hep/Handle.h index 4ac2fd895c744ba8be5183c414d78eaff236bf2e..4c3c61455ff39d6e761a68e6ad6ad7e172514300 100644 --- a/DDCore/include/DD4hep/Handle.h +++ b/DDCore/include/DD4hep/Handle.h @@ -120,6 +120,7 @@ namespace DD4hep { return 0xFEEDAFFEDEADFACEULL; } + /// Handle: a templated class like a shared pointer, which allows specialized access to tgeometry objects. /** @class Handle Handle.h * * @author M.Frank @@ -130,19 +131,24 @@ namespace DD4hep { typedef T Implementation; typedef Handle<Implementation> handle_t; T* m_element; + /// Defaulot constructor Handle() : m_element(0) { } + /// Initializing constructor from pointer Handle(T* e) : m_element(e) { } + /// Copy constructor Handle(const Handle<T>& e) : m_element(e.m_element) { } + /// Initializing constructor from unrelated pointer with type checking template <typename Q> Handle(Q* e) : m_element((T*) e) { verifyObject(); } + /// Initializing constructor from unrelated handle with type checking template <typename Q> Handle(const Handle<Q>& e) : m_element((T*) e.m_element) { verifyObject(); @@ -164,45 +170,59 @@ namespace DD4hep { bool operator>(const Handle<T>& e) const { return m_element > e.m_element; } + /// Check the validity of the object held by the handle bool isValid() const { return 0 != m_element; } + /// Check the validity of the object held by the handle bool operator!() const { return 0 == m_element; } + /// Release the object held by the handle Handle<T>& clear() { m_element = 0; return *this; } + /// Access the held object using the -> operator T* operator->() const { return m_element; } + /// Automatic type conversion to an object references operator T&() const { return *m_element; } + /// Access the held object using the * operator T& operator*() const { return *m_element; } + /// Access to the held object T* ptr() const { return m_element; } + /// Access to an unrelated object type template <typename Q> Q* _ptr() const { return (Q*) m_element; } + /// Access to an unrelated object type template <typename Q> Q* data() const { return (Q*) m_element; } + /// Access to an unrelated object type template <typename Q> Q& object() const { return *(Q*) m_element; } /// Checked object access. Throws invalid handle runtime exception T* access() const; + /// Verify the object type after a (re-)assignment void verifyObject() const; + /// Access the object name (or "" if not supported by the object) const char* name() const; + /// Helper routine called when unrelated types are assigned. static void bad_assignment(const std::type_info& from, const std::type_info& to); + /// Assign a new named object. Note: object references must be managed by the user void assign(Implementation* n, const std::string& nam, const std::string& title); }; - + /// Default Ref_t definition describing named objects typedef Handle<NamedObject> Ref_t; /// Helper to delete objects from heap and reset the handle @@ -238,6 +258,7 @@ namespace DD4hep { DestroyHandle<typename M::mapped_type>()(p.second); } }; + /// Functional created of map destruction functors template <typename M> DestroyHandles<M> destroyHandles(M& m) { return DestroyHandles<M>(m); } diff --git a/DDCore/include/DD4hep/IDDescriptor.h b/DDCore/include/DD4hep/IDDescriptor.h index 433e087c7b78753bffe95f7d52afe6dcdaafa77e..6678ab95a68e4b52fdaa53f0da70f8f47ec001a7 100644 --- a/DDCore/include/DD4hep/IDDescriptor.h +++ b/DDCore/include/DD4hep/IDDescriptor.h @@ -31,6 +31,7 @@ namespace DD4hep { class IDDescriptorObject; + /// Class implementing the ID encoding of detector response /** @class IDDescriptor IDDescriptor.h DDCore/IDDescriptor.h * * @author M.Frank diff --git a/DDCore/include/DD4hep/InstanceCount.h b/DDCore/include/DD4hep/InstanceCount.h index 059fe78fbbd56e0e2336c1ce1c1055cd952c1483..8a72061fff1890134f9270a44ea47f6153c7a251 100644 --- a/DDCore/include/DD4hep/InstanceCount.h +++ b/DDCore/include/DD4hep/InstanceCount.h @@ -18,6 +18,7 @@ */ namespace DD4hep { + /// Helper to support object counting when debugging memory leaks /** @class InstanceCount InstanceCount.h StorageSvc/InstanceCount.h * * Small class to enable object construction/destruction tracing @@ -32,6 +33,8 @@ namespace DD4hep { enum { NONE = 1 << 0, STRING = 1 << 1, TYPEINFO = 1 << 2, ALL = STRING | TYPEINFO }; + + /// Internal class to could object constructions and destructions /** @class Counter * * Small class to enable object construction/destruction tracing. diff --git a/DDCore/include/DD4hep/LCDD.h b/DDCore/include/DD4hep/LCDD.h index 54a3eb1c7548b9c86c7ff98138fb834d3e81f587..b59167cab04f6600596bbc383c6d0c99fcf7a0ba 100644 --- a/DDCore/include/DD4hep/LCDD.h +++ b/DDCore/include/DD4hep/LCDD.h @@ -51,7 +51,16 @@ namespace DD4hep { BUILD_NONE = 0, BUILD_DEFAULT = 1, BUILD_SIMU = BUILD_DEFAULT, BUILD_RECO, BUILD_DISPLAY }; + /// The main interface to the DD4hep detector description package /** @class LCDD LCDD.h DD4hep/LCDD.h + * + * Note: The usage of the factory method: + * + * static LCDD& getInstance(void); + * + * is DEPRECATED! + * + * You should rather use the plugin mechanism to create a new instance. * * @author M.Frank * @version 1.0 diff --git a/DDCore/include/DD4hep/LCDDData.h b/DDCore/include/DD4hep/LCDDData.h index 538a8d97393f4ce980dc10fac0ff9eca01535c70..6e8443b5bb54b39e7f5bf933ef0af0749f7f156f 100644 --- a/DDCore/include/DD4hep/LCDDData.h +++ b/DDCore/include/DD4hep/LCDDData.h @@ -13,6 +13,7 @@ // Framework includes #include "DD4hep/LCDD.h" #include "DD4hep/ObjectExtensions.h" +#include "DD4hep/objects/VolumeManagerInterna.h" // C/C++ include files #include <stdexcept> @@ -30,6 +31,7 @@ namespace DD4hep { */ namespace Geometry { + /// Data implementation class of the LCDD interface /** @class LCDDData LCDDData.h DD4hep/LCDDData.h * * @author M.Frank @@ -99,6 +101,9 @@ namespace DD4hep { /// Definition of the extension type ObjectExtensions m_extensions; + /// Volume manager reference + VolumeManager m_volManager; + protected: /// Default constructor LCDDData(); diff --git a/DDCore/include/DD4hep/NamedObject.h b/DDCore/include/DD4hep/NamedObject.h index 5caee6671c05e5db9f88e3607724117999d588d9..85b099724ed8f7b52c4a6ca6ab1b53bfabae1fa7 100644 --- a/DDCore/include/DD4hep/NamedObject.h +++ b/DDCore/include/DD4hep/NamedObject.h @@ -17,6 +17,7 @@ */ namespace DD4hep { + /// Implementation of a named object /** @class Container NamedObject.h DD4hep/NamedObject.h * * The data class behind a conditions container handle. diff --git a/DDCore/include/DD4hep/ObjectExtensions.h b/DDCore/include/DD4hep/ObjectExtensions.h index e15ed190d1f1dbc46ef0a87d8176c5d25fc7750d..e528033ffb1fdf52ea293db5d579c024d5b3d516 100644 --- a/DDCore/include/DD4hep/ObjectExtensions.h +++ b/DDCore/include/DD4hep/ObjectExtensions.h @@ -18,7 +18,10 @@ */ namespace DD4hep { + /// Implementation of an object supporting arbitrary user extensions /** @class ObjectExtensions DetectorInterna.h DD4hep/objects/DetectorInterna.h + * + * Usage by inheritance of the client supporting the functionality * * @author M.Frank * @version 1.0 @@ -31,6 +34,7 @@ namespace DD4hep { typedef void* (*copy_t)(const void*, void* arg); /// Extensions destructor type typedef void (*destruct_t)(void*); + /// Defintiion of the extension entry struct Entry { copy_t copy; destruct_t destruct; diff --git a/DDCore/include/DD4hep/Objects.h b/DDCore/include/DD4hep/Objects.h index 8968af9f33b31c768639e244904d9171f3caf93a..0c94899689ef1260587f8cec9689cf649d89b853 100644 --- a/DDCore/include/DD4hep/Objects.h +++ b/DDCore/include/DD4hep/Objects.h @@ -67,8 +67,8 @@ namespace DD4hep { /** Access to identity transformation */ TGeoIdentity* identityTransform(); - /** @class Author Objects.h - * + /// Handle class describing an author identity + /** * @author M.Frank * @version 1.0 */ @@ -108,8 +108,8 @@ namespace DD4hep { void setAuthorEmail(const std::string& addr); }; - /** @class Header Objects.h - * + /// Handle class describing the basic information about geometry objects as it is defined in LCDD + /** * Description of the geometry header. Containes useful auxiliary information. * * @author M.Frank @@ -169,7 +169,10 @@ namespace DD4hep { void setComment(const std::string& new_comment); }; - /** @class Constant Objects.h + /// Handle class describing a constant (define) object in lcdd + /** + * Constant objects are parsed by the expression evaluator and + * are subsequently available for expression evaluation. * * @author M.Frank * @version 1.0 @@ -236,8 +239,8 @@ namespace DD4hep { /** @see http://root.cern.ch/root/html/ROOT__Math__Translations3D.html */ typedef ROOT::Math::Translation3D Translation3D; - /** @class Atom Objects.h - * + /// Handle class describing an element in the periodic table + /** * @author M.Frank * @version 1.0 */ @@ -380,8 +383,8 @@ namespace DD4hep { std::string toString() const; }; - /**@class AligmentEntry - * + /// OBSOLETE: Handle class describing an alignment entry + /** * Class representing an alignment entry * * @author M.Frank @@ -405,9 +408,8 @@ namespace DD4hep { int align(const Position& pos, const RotationZYX& rot, bool check = false, double overlap = 0.001); }; - /** @class Limit Objects.h - * Small object describing a limit structure - * + /// Small object describing a limit structure acting on a particle type + /** * @author M.Frank * @version 1.0 */ @@ -436,8 +438,8 @@ namespace DD4hep { std::string toString() const; }; - /** @class LimitSet Objects.h - * + /// Handle class describing a set of limits as they are used for simulation + /** * @author M.Frank * @version 1.0 */ @@ -471,8 +473,8 @@ namespace DD4hep { const std::set<DD4hep::Geometry::Limit>& limits() const; }; - /** @class Region Objects.h - * + /// Handle class describing a region as used in simulation + /** * @author M.Frank * @version 1.0 */ diff --git a/DDCore/include/DD4hep/Plugins.h b/DDCore/include/DD4hep/Plugins.h index c6e460058b8c1dff8ab3b59ed4b68589e7002250..96963ab7f392c6e819b7a2982bcda80235feea85 100644 --- a/DDCore/include/DD4hep/Plugins.h +++ b/DDCore/include/DD4hep/Plugins.h @@ -21,6 +21,7 @@ namespace DD4hep { typedef ROOT::Reflex::PluginService PluginService; + /// Helper to debug plugin manager calls /** @class PluginDebug. PluginDebug.h DD4hep/PluginDebug.h * * Small helper class to adjust the plugin service debug level diff --git a/DDCore/include/DD4hep/Primitives.h b/DDCore/include/DD4hep/Primitives.h index fb7ba3c832df6cb217dba08c6db106fe906845fc..1fa133ad28b34da6ac16ce67c0d80319c52ed511 100644 --- a/DDCore/include/DD4hep/Primitives.h +++ b/DDCore/include/DD4hep/Primitives.h @@ -53,7 +53,12 @@ namespace DD4hep { /// Throw exception when handles are check for validity void notImplemented(const std::string& msg); + /// Class to perform dynamic casts using unknown pointers. /** @class ComponentCast Primitives.h DD4hep/Primitives.h + * + * It is mandatory that the pointers referred do actually + * support the asked functionalty. + * Miracles also I cannot do..... * * @author M.Frank * @date 13.08.2013 diff --git a/DDCore/include/DD4hep/Readout.h b/DDCore/include/DD4hep/Readout.h index d13af002905e6e6c297abc7c16206c218913b3fc..ba5fa1f2aaf018ca4dcc548ce4d3a32878bf1a7d 100644 --- a/DDCore/include/DD4hep/Readout.h +++ b/DDCore/include/DD4hep/Readout.h @@ -33,6 +33,7 @@ namespace DD4hep { class DetElement; class ReadoutObject; + /// Handle to the implementation of the readout structure of a subdetector /** @class Readout Readout.h DD4hep/Readout.h * * @author M.Frank diff --git a/DDCore/include/DD4hep/Segmentations.h b/DDCore/include/DD4hep/Segmentations.h index c97d12881662b41fd51827bf75be128e1f842a85..5aa55d8db9aa6de6073ddda730017c4f730b468d 100644 --- a/DDCore/include/DD4hep/Segmentations.h +++ b/DDCore/include/DD4hep/Segmentations.h @@ -30,6 +30,7 @@ namespace DD4hep { */ namespace Geometry { + /// Implementation class supporting generic Segmentation of sensitive detectors /** @class Segmentation::Object Segmentations.h DD4hep/Segmentations.h * * @author M.Frank @@ -78,6 +79,7 @@ namespace DD4hep { }; + /// Handle class supporting generic Segmentation of sensitive detectors /** @class Segmentation Segmentations.h DD4hep/Segmentations.h * * @author M.Frank diff --git a/DDCore/include/DD4hep/Shapes.h b/DDCore/include/DD4hep/Shapes.h index fe7601db5190ce42a02aefdfe30aa86a568d2c44..f6bae55469d4b3d83deaf1efe954eb03dd1ea544 100644 --- a/DDCore/include/DD4hep/Shapes.h +++ b/DDCore/include/DD4hep/Shapes.h @@ -41,9 +41,12 @@ namespace DD4hep { // Forward declarations - /**@class Solid_type Shapes.h + /// Base class for Solid (shape) objects + /** + * Generic handle holding an object of base TGeoShape. * - * Base class for Solid objects + * For any further documentation please see the following ROOT documentation: + * @see http://root.cern.ch/root/html/TGeoShape.html * * @author M.Frank * @version 1.0 @@ -92,8 +95,8 @@ namespace DD4hep { }; typedef Solid_type<TGeoShape> Solid; - /**@class Box Shapes.h - * + /// Class describing a box shape + /** * For any further documentation please see the following ROOT documentation: * @see http://root.cern.ch/root/html/TGeoBBox.html * @@ -103,6 +106,7 @@ namespace DD4hep { */ struct Box: public Solid_type<TGeoBBox> { protected: + /// Internal helper method to support object construction void make(const std::string& name, double x, double y, double z); public: @@ -136,8 +140,8 @@ namespace DD4hep { double z() const; }; - /**@class Polycone Shapes.h - * + /// Class describing a Polycone shape + /** * Polycone. It has at least 9 parameters : * - the lower phi limit; * - the range in phi; @@ -170,8 +174,8 @@ namespace DD4hep { void addZPlanes(const std::vector<double>& rmin, const std::vector<double>& rmax, const std::vector<double>& z); }; - /**@class ConeSegment Shapes.h DDCore/Shapes.h - * + /// Class describing a cone segment shape + /** * A ConeSegment is, in the general case, a Phi segment of a cone, with * half-length dz, inner and outer radii specified at -dz and +dz. * @@ -211,8 +215,8 @@ namespace DD4hep { } }; - /**@class Tube Shapes.h - * + /// Class describing a tube shape of a section of a tube + /** * TGeoTube - cylindrical tube class. It takes 3 parameters : * inner radius, outer radius and half-length dz. * @@ -224,6 +228,7 @@ namespace DD4hep { */ struct Tube: public Solid_type< /*TGeoTubeSeg */MyConeSeg> { protected: + /// Internal helper method to support object construction void make(const std::string& name, double rmin, double rmax, double z, double startPhi, double deltaPhi); public: @@ -267,9 +272,8 @@ namespace DD4hep { Tube& setDimensions(double rmin, double rmax, double z, double startPhi=0.0, double deltaPhi=2*M_PI); }; - /**@class Cone Shapes.h - * - * + /// Class describing a cone shape + /** * For any further documentation please see the following ROOT documentation: * @see http://root.cern.ch/root/html/TGeoCone.html * @@ -278,6 +282,7 @@ namespace DD4hep { */ struct Cone: public Solid_type<TGeoCone> { protected: + /// Internal helper method to support object construction void make(const std::string& name, double z, double rmin1, double rmax1, double rmin2, double rmax2); public: @@ -301,8 +306,8 @@ namespace DD4hep { Cone& setDimensions(double z, double rmin1, double rmax1, double rmin2, double rmax2); }; - /**@class Trap Shapes.h - * + /// Class describing a trap shape + /** * For any further documentation please see the following ROOT documentation: * @see http://root.cern.ch/root/html/TGeoTrap.html * @@ -311,6 +316,7 @@ namespace DD4hep { */ struct Trap: public Solid_type<TGeoTrap> { private: + /// Internal helper method to support object construction void make(double pz, double py, double px, double pLTX); public: /// Constructor to be used when passing an already created object @@ -338,8 +344,8 @@ namespace DD4hep { double x3, double x4, double alpha2); }; - /**@class Trapezoid Shapes.h - * + /// Class describing a Trapezoid shape + /** * For any further documentation please see the following ROOT documentation: * @see http://root.cern.ch/root/html/TGeoTrd2.html * @@ -349,6 +355,7 @@ namespace DD4hep { */ struct Trapezoid: public Solid_type<TGeoTrd2> { private: + /// Internal helper method to support object construction void make(double x1, double x2, double y1, double y2, double z); public: /// Constructor to be used when passing an already created object @@ -369,8 +376,8 @@ namespace DD4hep { Trapezoid& setDimensions(double x1, double x2, double y1, double y2, double z); }; - /**@class Torus Shapes.h - * + /// Class describing a Torus shape + /** * For any further documentation please see the following ROOT documentation: * @see http://root.cern.ch/root/html/TGeoTorus.html * @@ -379,6 +386,7 @@ namespace DD4hep { */ struct Torus: public Solid_type<TGeoTorus> { private: + /// Internal helper method to support object construction void make(double r, double rmin, double rmax, double phi, double delta_phi); public: /// Constructor to be used when passing an already created object @@ -400,8 +408,8 @@ namespace DD4hep { Torus& setDimensions(double r, double rmin, double rmax, double phi, double delta_phi); }; - /**@class Sphere Shapes.h - * + /// Class describing a sphere shape + /** * For any further documentation please see the following ROOT documentation: * @see http://root.cern.ch/root/html/TGeoSphere.html * @@ -425,8 +433,8 @@ namespace DD4hep { Sphere& setDimensions(double rmin, double rmax, double theta, double delta_theta, double phi, double delta_phi); }; - /**@class Paraboloid Shapes.h - * + /// Class describing a Paraboloid shape + /** * For any further documentation please see the following ROOT documentation: * @see http://root.cern.ch/root/html/TGeoParaboloid.html * @@ -449,8 +457,8 @@ namespace DD4hep { Paraboloid& setDimensions(double r_low, double r_high, double delta_z); }; - /**@class PolyhedraRegular Shapes.h - * + /// Class describing a regular polyhedron shape + /** * For any further documentation please see the following ROOT documentation: * @see http://root.cern.ch/root/html/TGeoPgon.html * @@ -481,8 +489,8 @@ namespace DD4hep { PolyhedraRegular(int nsides, double phi_start, double rmin, double rmax, double zlen); }; - /**@class EightPointSolid Shapes.h - * + /// Class describing an arbitray solid defined by 8 vertices. + /** * For any further documentation please see the following ROOT documentation: * @see http://root.cern.ch/root/html/TGeoArb8.html * @@ -491,7 +499,7 @@ namespace DD4hep { */ struct EightPointSolid: public Solid_type<TGeoArb8> { private: - /// Creator method + /// Internal helper method to support object construction void make(double dz, const double* vtx); public: /// Constructor to be used when passing an already created object @@ -506,8 +514,8 @@ namespace DD4hep { EightPointSolid(double dz, const double* vertices) { make(dz,vertices); } }; - /**@class BooleanSolid Shapes.h - * + /// Base class describing boolean (=union,intersection,subtraction) solids + /** * For any further documentation please see the following ROOT documentation: * @see http://root.cern.ch/root/html/TGeoCompositeShape.html * @@ -529,8 +537,8 @@ namespace DD4hep { } }; - /**@class SubtractionSolid Shapes.h - * + /// Class describing boolean subtraction solid + /** * For any further documentation please see the following ROOT documentation: * @see http://root.cern.ch/root/html/TGeoCompositeShape.html * @see http://root.cern.ch/root/html/TGeoSubtraction.html @@ -563,8 +571,8 @@ namespace DD4hep { SubtractionSolid(const Solid& shape1, const Solid& shape2, const Transform3D& pos); }; - /**@class UnionSolid Shapes.h - * + /// Class describing boolean union solid + /** * For any further documentation please see the following ROOT documentation: * @see http://root.cern.ch/root/html/TGeoCompositeShape.html * @see http://root.cern.ch/root/html/TGeoUnion.html @@ -597,8 +605,8 @@ namespace DD4hep { UnionSolid(const Solid& shape1, const Solid& shape2, const Transform3D& pos); }; - /**@class IntersectionSolid Shapes.h - * + /// Class describing boolean intersection solid + /** * For any further documentation please see the following ROOT documentation: * @see http://root.cern.ch/root/html/TGeoCompositeShape.html * @see http://root.cern.ch/root/html/TGeoIntersection.html diff --git a/DDCore/include/DD4hep/VolumeManager.h b/DDCore/include/DD4hep/VolumeManager.h index e3f7f3c0593261b5f5fe60c278284037c0bb877b..72be6f5f7fb9971ac9a503d0e4dcd3c3868a7440 100644 --- a/DDCore/include/DD4hep/VolumeManager.h +++ b/DDCore/include/DD4hep/VolumeManager.h @@ -32,6 +32,7 @@ namespace DD4hep { class VolumeManagerContext; class VolumeManagerObject; + /// Class to support the retrieval of detector elements and volumes given a valid identifier /** @class VolumeManager VolumeManager.h DD4hep/lcdd/VolumeManager.h * * The VolumeManager manages the repository of sensitive physical @@ -115,6 +116,8 @@ namespace DD4hep { */ VolumeManager(LCDD& lcdd, const std::string& name, DetElement world = DetElement(), Readout ro = Readout(), int flags = NONE); + /// Initializing constructor for subdetector volume managers. + VolumeManager(DetElement subdetector, Readout ro); /// Assignment operator VolumeManager& operator=(const VolumeManager& m) { @@ -126,12 +129,8 @@ namespace DD4hep { /// Access the volume manager by cell id VolumeManager subdetector(VolumeID id) const; - /// Assign the top level detector element to this manager - void setDetector(DetElement det_eleemnt, Readout ro); /// Access the top level detector element DetElement detector() const; - /// Assign IDDescription to VolumeManager structure - void setIDDescriptor(IDDescriptor spec) const; /// Access IDDescription structure IDDescriptor idSpec() const; diff --git a/DDCore/include/DD4hep/Volumes.h b/DDCore/include/DD4hep/Volumes.h index 35e00ea44ecb16a4216f71c82615e46996620816..2daf76d67302544974b06fe6ba25c164698c988e 100644 --- a/DDCore/include/DD4hep/Volumes.h +++ b/DDCore/include/DD4hep/Volumes.h @@ -61,6 +61,7 @@ namespace DD4hep { class PlacedVolume; class SensitiveDetector; + /// Implementation class extending the ROOT placed volume (TGeoNode) /** @class PlacedVolumeExtension Volume.h DD4hep/lcdd/Volume.h * * @author M.Frank @@ -69,6 +70,7 @@ namespace DD4hep { class PlacedVolumeExtension : public TGeoExtension { public: typedef std::pair<std::string, int> VolID; + /// Volume ID container class VolIDs: public std::vector<VolID> { public: typedef std::vector<VolID> Base; @@ -105,7 +107,11 @@ namespace DD4hep { ClassDef(PlacedVolumeExtension,1); }; + /// Handle class holding a placed volume (also called physical volume) /** @class PlacedVolume Volume.h DD4hep/lcdd/Volume.h + * + * For any further documentation please see the following ROOT documentation: + * @see http://root.cern.ch/root/html/TGeoNode.html * * @author M.Frank * @version 1.0 @@ -153,6 +159,7 @@ namespace DD4hep { std::string toString() const; }; + /// Implementation class extending the ROOT volume (TGeoVolume) /** @class Volume::Object Volume.h DD4hep/Volume.h * * Internal data structure optional to TGeo data @@ -192,12 +199,16 @@ namespace DD4hep { ClassDef(VolumeExtension,1); }; + /// Handle class holding a placed volume (also called physical volume) /** @class Volume Volume.h DD4hep/Volume.h * - * Handle describing a Volume + * Handle describing a Volume * - * @author M.Frank - * @version 1.0 + * For any further documentation please see the following ROOT documentation: + * @see http://root.cern.ch/root/html/TGeoVolume.html + * + * @author M.Frank + * @version 1.0 */ class Volume: public Handle<TGeoVolume> { diff --git a/DDCore/include/DD4hep/objects/ConditionsInterna.h b/DDCore/include/DD4hep/objects/ConditionsInterna.h index e8a6396aad28acc10df8268118f2c9ecc5b589e2..98eb97f752028db239f59b129fdc30a920cdc3e5 100644 --- a/DDCore/include/DD4hep/objects/ConditionsInterna.h +++ b/DDCore/include/DD4hep/objects/ConditionsInterna.h @@ -58,7 +58,8 @@ namespace DD4hep { } _IOVTypes; /// IOV buffer type: Must be a bitmap! int type; - unsigned char data[16]; + int data[4]; + int _spare; /// Initializing constructor IOV(int t=UNKNOWN_IOV); /// Standard Destructor diff --git a/DDCore/include/DD4hep/objects/VolumeManagerInterna.h b/DDCore/include/DD4hep/objects/VolumeManagerInterna.h index e10f626d3c2590ce0195f2a07549b6a5fc2e73ea..f31db2774f7cf470520f01de7dd0f8501b9d6f41 100644 --- a/DDCore/include/DD4hep/objects/VolumeManagerInterna.h +++ b/DDCore/include/DD4hep/objects/VolumeManagerInterna.h @@ -41,7 +41,7 @@ namespace DD4hep { */ class VolumeManagerContext { public: - typedef std::vector<const TGeoNode*> Path; + typedef std::vector<TGeoNode*> Path; typedef PlacedVolume::VolIDs::Base VolIDs; /// Placement identifier @@ -85,8 +85,6 @@ namespace DD4hep { typedef VolumeManager::Context Context; public: - /// Reference to the LCDD instance - LCDD* lcdd; /// The container of subdetector elements Detectors subdetectors; /// The volume managers for the individual subdetector elements @@ -109,7 +107,7 @@ namespace DD4hep { int flags; public: /// Default constructor - VolumeManagerObject(LCDD& lcdd); + VolumeManagerObject(); /// Default destructor virtual ~VolumeManagerObject(); /// Search the locally cached volumes for a matching ID @@ -118,9 +116,6 @@ namespace DD4hep { void update(unsigned long tags, DetElement& det, void* param); }; - /// Enable printouts for debugging - std::ostream& operator<<(std::ostream& os, const VolumeManager& m); - } /* End namespace Geometry */ } /* End namespace DD4hep */ #endif /* DD4hep_GEOMETRY_VOLUMEMANAGERINTERNA_H */ diff --git a/DDCore/include/XML/Conversions.h b/DDCore/include/XML/Conversions.h index 40d69cf27c0e4f134aac2f01125551187e033285..fa894596fc95aef7bb0c139b45f1604e3468d371 100644 --- a/DDCore/include/XML/Conversions.h +++ b/DDCore/include/XML/Conversions.h @@ -24,10 +24,8 @@ namespace DD4hep { struct Handle_t; } - /** @class Converter Conversions.h DD4hep/compact/Conversions.h - * - * Basic conversion objects for handling DD4hep XML files. - * + /// Basic conversion objects for handling DD4hep XML files. + /** * @author M.Frank * @version 1.0 */ diff --git a/DDCore/include/XML/DocumentHandler.h b/DDCore/include/XML/DocumentHandler.h index 3d0eff70b9e3b3bd75ba3cdf66734738a0ae3f2c..ddb770f4a1f2dbf88a8d30e660afd67993c03132 100644 --- a/DDCore/include/XML/DocumentHandler.h +++ b/DDCore/include/XML/DocumentHandler.h @@ -24,8 +24,8 @@ namespace DD4hep { // Forward declarations struct DocumentErrorHandler; - /** @class DocumentHandler XMLDetector.h XML/XMLDetector.h - * + /// Class supporting to read and parse XML documents. + /** * Wrapper object around the document parser. * Supports both, XercesC and TiXml. * diff --git a/DDCore/include/XML/Evaluator.h b/DDCore/include/XML/Evaluator.h index 80cbe589aed420e04d184ec0cd1a84c4bccd2d47..66abfbbae3cef90d1dcdbceb05218d4c6789c66e 100644 --- a/DDCore/include/XML/Evaluator.h +++ b/DDCore/include/XML/Evaluator.h @@ -7,9 +7,8 @@ namespace XmlTools { + /// Evaluator of arithmetic expressions with an extendable dictionary. /** - * Evaluator of arithmetic expressions with an extendable dictionary. - * * Taken from CLHEP 1.9.2.1 * * Example: diff --git a/DDCore/include/XML/XMLDetector.h b/DDCore/include/XML/XMLDetector.h index d5ce308d99bdf9e80a010f07df8d2f227749069c..9d22d735c94f89230f4d4441c8a982af32266012 100644 --- a/DDCore/include/XML/XMLDetector.h +++ b/DDCore/include/XML/XMLDetector.h @@ -22,8 +22,8 @@ namespace DD4hep { */ namespace XML { - /** @class DetElement::Component XMLDetector.h XML/XMLDetector.h - * + /// XML Handle class extending the XML handle Dimension + /** * Helper class to access any field in a xml tag. * Specialized for attributes of a detector sub-element. * @@ -45,8 +45,8 @@ namespace DD4hep { std::string materialStr() const; }; - /** @class DetElement XMLDetector.h XML/XMLDetector.h - * + /// XML Handle class extending the XML handle Dimension + /** * Helper class to access any field in a xml tag. * Specialized for some of the attributes of a detector element. * diff --git a/DDCore/include/XML/XMLDimension.h b/DDCore/include/XML/XMLDimension.h index 1c7f6c9b4eaf7805c6a2b5734a0c35b431960842..2f4b66fb61375cb1ed225dd8c6fdd4490dd9504e 100644 --- a/DDCore/include/XML/XMLDimension.h +++ b/DDCore/include/XML/XMLDimension.h @@ -22,8 +22,8 @@ namespace DD4hep { */ namespace XML { - /** @class Dimension XMLDetector.h XML/XMLDetector.h - * + /// XML Handle to xml elements with predefined attribute access + /** * Helper class to access any field in a xml tag in a * very easy way. * - You may assign any xml handle to a dimension object @@ -38,6 +38,11 @@ namespace DD4hep { * - If a often used function is not present - the * implementation thereof is simple. * + * Such heklper classes may be defined locally by any user + * since XML element handles may easily be transferred. + * Run-time exceptions occur however, if non-exiting attributes + * are accessed. + * * @author M.Frank * @version 1.0 */ diff --git a/DDCore/include/XML/XMLElements.h b/DDCore/include/XML/XMLElements.h index 03b770d566c8f16a6c128c93a3db92565055ab31..102272a8200afa0cc7ca7901fc2a21d62f4e621a 100644 --- a/DDCore/include/XML/XMLElements.h +++ b/DDCore/include/XML/XMLElements.h @@ -35,8 +35,8 @@ namespace DD4hep { typedef const XmlAttr* Attribute; - /** XmlString XMLElements.h XML/XMLElements.h - * + /// Definition of the XmlString class. + /** * Definition of the XmlString class. * Unly used to have the same code base as for XercesC, * where this class does the unicode translations and @@ -61,9 +61,8 @@ namespace DD4hep { }; #ifdef __TIXML__ - /** XmlException XMLElements.h XML/XMLElements.h - * - * Definition of the XmlException class. + /// Definition of the XmlException class. + /** * Currently no real use. Present to make Xerces happy, * which has such a class. * @@ -102,6 +101,8 @@ namespace DD4hep { std::string _toString(unsigned int i, const char* fmt = "%u"); /// Format signed integer (32 bits) to string with atrbitrary format std::string _toString(int i, const char* fmt = "%d"); + /// Format signed long integer to string with atrbitrary format + std::string _toString(long i, const char* fmt = "%fd"); /// Format single procision float number (32 bits) to string with atrbitrary format std::string _toString(float d, const char* fmt = "%f"); /// Format double procision float number (64 bits) to string with atrbitrary format @@ -109,6 +110,10 @@ namespace DD4hep { /// Helper function to populate the evaluator dictionary void _toDictionary(const XmlChar* name, const XmlChar* value); + template <typename T> void _toDictionary(const XmlChar* name, T value); + + void _toDictionary(const XmlChar* name, float value); + void _toDictionary(const XmlChar* name, double value); /// Conversion function from raw unicode string to bool bool _toBool(const XmlChar* value); @@ -121,9 +126,8 @@ namespace DD4hep { /// Conversion function from raw unicode string to double double _toDouble(const XmlChar* value); - /** @class Strng_t XMLElements.h XML/XMLElements.h - * - * Helper class to encapsulate a unicode string. + /// Helper class to encapsulate a unicode string. + /** * Simple conversion from ascii strings to unicode strings. * Useful when using XercesC - dummy implementation for TiXml. * @@ -197,8 +201,8 @@ namespace DD4hep { #endif - /** @class Tag_t XMLElements.h XML/XMLElements.h - * + /// Class to support both way translation between C++ and XML strings + /** * Helper class to easily convert between * -- unicode * -- std::string @@ -271,8 +275,8 @@ namespace DD4hep { return c == b.m_str; } - /** NodeList XMLElements.h XML/XMLElements.h - * + /// Class describing a list of XML nodes + /** * Definition of a "list" of xml elements hanging of the parent. * The list allows iterations, which can be restarted. * Please not: Copies are not entirely free, since the @@ -303,10 +307,8 @@ namespace DD4hep { NodeList& operator=(const NodeList& l); }; - /** @class Handle_t XMLElements.h XML/XMLElements.h - * - * Helper class to easily access the properties of single XmlElements. - * + /// Class to easily access the properties of single XmlElements. + /** * Note: The assignmant operator as well as the copy constructor * do not have to be implemented, they are aut-generated by the compiler! * @@ -497,10 +499,8 @@ namespace DD4hep { { return _toString(attr_value(tag));} #endif - /** @class Collection_t XmlElements.h XML/XMLElements.h - * - * Helper class to easily access collections of XmlNodes (or XmlElements) - * + /// Class to support the access to collections of XmlNodes (or XmlElements) + /** * Typical * @author M.Frank * @version 1.0 @@ -556,8 +556,8 @@ namespace DD4hep { } }; - /** @class Document XMLElements.h XML/XMLElements.h - * + /// Class supporting the basic functionality of an XML document + /** * User class encapsulating a DOM document. * Nothing special - normal handle around pointer. * @@ -593,8 +593,8 @@ namespace DD4hep { Handle_t clone(Handle_t source) const; }; - /** @class DocumentHolder XMLElements.h XML/XMLElements.h - * + /// Class supporting the basic functionality of an XML document including ownership + /** * User class encapsulating a DOM document. * Nothing special - normal handle around pointer. * Contrary to the Document class, on destruction the @@ -613,8 +613,8 @@ namespace DD4hep { virtual ~DocumentHolder(); }; - /** @class Element XMLElements.h XML/XMLElements.h - * + /// User abstraction class to manipulate XML elements within a document + /** * User class encapsulating a DOM element * using the Handle helper. * This is the main class we interact with when @@ -747,8 +747,8 @@ namespace DD4hep { void addComment(const char* text) const; }; - /** @class RefElement XMLElements.h XML/XMLElements.h - * + /// User abstraction class to manipulate named XML elements (references) within a document + /** * User class encapsulating a DOM element which can * be referenced. Like the Element, but the "name" * attribute is required. The reference then has the diff --git a/DDCore/src/ConditionsInterna.cpp b/DDCore/src/ConditionsInterna.cpp index 3561ed5c63cafeaeadb05c3f57c6cbe3e81097c4..bf2a9a07e6a352741c90d076a0120bd954a85441 100644 --- a/DDCore/src/ConditionsInterna.cpp +++ b/DDCore/src/ConditionsInterna.cpp @@ -24,6 +24,7 @@ DD4HEP_INSTANTIATE_HANDLE_NAMED(ConditionsInterna::ConditionContainer); /// Initializing constructor IOV::IOV(int t) : type(t) { + data[0]=data[1]=data[2]=data[3]=data[4]=0; } /// Standard Destructor @@ -33,7 +34,8 @@ IOV::~IOV() { /// Move the data content: 'from' will be reset to NULL void IOV::move(IOV& from) { ::memcpy(this,&from,sizeof(IOV)); - ::memset(&from,0,sizeof(IOV)); + from.data[0]=from.data[1]=from.data[2]=from.data[3]=from.data[4]=0; + from.type = UNKNOWN_IOV; } /// Create IOV data from string representation diff --git a/DDCore/src/LCDDData.cpp b/DDCore/src/LCDDData.cpp index 74e2cdcf69c9996239e0de8899121ddf792205af..b5167719f6f0c662d8c5282765b85449b071f915 100644 --- a/DDCore/src/LCDDData.cpp +++ b/DDCore/src/LCDDData.cpp @@ -26,7 +26,7 @@ using namespace std; LCDDData::LCDDData() : m_manager(0), m_world(), m_trackers(), m_worldVol(), m_trackingVol(), m_field("global"), - m_extensions(typeid(LCDDData)) + m_extensions(typeid(LCDDData)), m_volManager() { InstanceCount::increment(this); } @@ -60,6 +60,7 @@ void LCDDData::destroyData() { m_invisibleVis.clear(); m_materialVacuum.clear(); m_materialAir.clear(); + destroyHandle(m_volManager); deletePtr(m_manager); } @@ -86,6 +87,7 @@ void LCDDData::clearData() { m_invisibleVis.clear(); m_materialVacuum.clear(); m_materialAir.clear(); + m_volManager.clear(); m_manager = 0; } @@ -112,6 +114,7 @@ void LCDDData::adoptData(LCDDData& source) { m_materialVacuum = source.m_materialVacuum; m_materialAir = source.m_materialAir; m_manager = source.m_manager; + m_volManager = source.m_volManager; source.clearData(); } diff --git a/DDCore/src/LCDDImp.cpp b/DDCore/src/LCDDImp.cpp index fa4c1e2708cf62c8bfb883460142f3d573ad8633..b00d5a999261b2509b26bc6a84ac3f1e783af616 100644 --- a/DDCore/src/LCDDImp.cpp +++ b/DDCore/src/LCDDImp.cpp @@ -71,13 +71,15 @@ void lcdd_unexpected(){ << "**************************************************** \n" << std::endl ; + std::set_unexpected( std::unexpected ) ; + std::set_terminate( std::terminate ) ; // this provokes ROOT seg fault and stack trace (comment out to avoid it) exit(1) ; } } /// Disable copy constructor -LCDDImp::LCDDImp(const LCDDImp&) : LCDD(), LCDDData(), m_volManager(), m_buildType(BUILD_NONE) { +LCDDImp::LCDDImp(const LCDDImp&) : LCDD(), LCDDData(), m_buildType(BUILD_NONE) { } /// Disable assignment operator @@ -99,8 +101,7 @@ void LCDD::destroyInstance() { } /// Default constructor -LCDDImp::LCDDImp() - : LCDDData(), m_volManager(), m_buildType(BUILD_NONE) +LCDDImp::LCDDImp() : LCDDData(), m_buildType(BUILD_NONE) { std::set_unexpected( lcdd_unexpected ) ; @@ -133,11 +134,17 @@ LCDDImp::LCDDImp() /// Standard destructor LCDDImp::~LCDDImp() { - destroyHandle(m_volManager); + if ( m_manager == gGeoManager ) gGeoManager = 0; destroyData(); InstanceCount::decrement(this); } +// Load volume manager +void LCDDImp::imp_loadVolumeManager() { + destroyHandle(m_volManager); + m_volManager = VolumeManager(*this, "World", world(), Readout(), VolumeManager::TREE); +} + /// Add an extension object to the LCDD instance void* LCDDImp::addUserExtension(void* ptr, const std::type_info& info, void (*destruct)(void*)) { return m_extensions.addExtension(ptr,info,destruct); @@ -223,7 +230,7 @@ namespace { void patchShapes() { GeoHandler::Data& data = *m_data; string nam; - cout << "++ Patching names of anonymous shapes...." << endl; + printout(INFO,"LCDD","+++ Patching names of anonymous shapes...."); for (GeoHandler::Data::const_reverse_iterator i = data.rbegin(); i != data.rend(); ++i) { const GeoHandler::Data::mapped_type& v = (*i).second; for (GeoHandler::Data::mapped_type::const_iterator j = v.begin(); j != v.end(); ++j) { diff --git a/DDCore/src/LCDDImp.h b/DDCore/src/LCDDImp.h index 82ba49faab4918bbacdb941c586275beb6614642..3970cc4b0fdb4a7117bff177bc80200e9a6966b4 100644 --- a/DDCore/src/LCDDImp.h +++ b/DDCore/src/LCDDImp.h @@ -44,7 +44,10 @@ namespace DD4hep { public: - VolumeManager m_volManager; + /// Local method (no interface): Load volume manager. + void imp_loadVolumeManager(); + + /// VolumeManager m_volManager; LCDDBuildType m_buildType; /// Default constructor @@ -158,6 +161,7 @@ namespace DD4hep { } /// Retrieve a matrial by it's name from the detector description virtual Material material(const std::string& name) const; + /// Retrieve a region object by it's name from the detector description virtual Region region(const std::string& name) const { return getRefChild(m_regions, name); diff --git a/DDCore/src/ObjectExtensions.cpp b/DDCore/src/ObjectExtensions.cpp index c3a967269a504bbbda27f2ecb8fa1bb3754d1f92..ed2e187fce3fe28f135afd7d38fbf55d23bd8bef 100644 --- a/DDCore/src/ObjectExtensions.cpp +++ b/DDCore/src/ObjectExtensions.cpp @@ -68,6 +68,7 @@ void ObjectExtensions::copyFrom(const Extensions& ext, void* arg) { void* ObjectExtensions::addExtension(void* ptr, const type_info& info, destruct_t dtor) { return addExtension(ptr, info, 0, dtor); } + /// Add an extension object to the detector element void* ObjectExtensions::addExtension(void* ptr, const type_info& info, copy_t ctor, destruct_t dtor) { Extensions::iterator j = extensions.find(&info); diff --git a/DDCore/src/VolumeManager.cpp b/DDCore/src/VolumeManager.cpp index ee346e77b897386e3f446807b27f3a99a17ce9da..81213ba7f499d19676d7f20aa97f49ba48cb50c9 100644 --- a/DDCore/src/VolumeManager.cpp +++ b/DDCore/src/VolumeManager.cpp @@ -8,9 +8,7 @@ //==================================================================== // Framework include files #include "DD4hep/LCDD.h" -#include "DD4hep/Handle.inl" #include "DD4hep/Printout.h" -#include "DD4hep/VolumeManager.h" #include "DD4hep/objects/DetectorInterna.h" #include "DD4hep/objects/VolumeManagerInterna.h" @@ -20,19 +18,15 @@ #include <sstream> #include <iomanip> - using namespace std; using namespace DD4hep; using namespace DD4hep::Geometry; -DD4HEP_INSTANTIATE_HANDLE_NAMED(VolumeManagerObject); - - namespace { struct Populator { typedef PlacedVolume::VolIDs VolIDs; - typedef vector<const TGeoNode*> Chain; + typedef vector<TGeoNode*> Chain; /// Reference to the LCDD instance LCDD& m_lcdd; /// Reference to the volume manager to be populated @@ -79,9 +73,8 @@ namespace { return DetElement(); } /// Scan a single physical volume and look for sensitive elements below - size_t scanPhysicalVolume(DetElement parent, DetElement e, PlacedVolume pv, VolIDs ids, SensitiveDetector& sd, - Chain& chain) { - const TGeoNode* node = pv.ptr(); + size_t scanPhysicalVolume(DetElement parent, DetElement e, PlacedVolume pv, VolIDs ids, SensitiveDetector& sd,Chain& chain) { + TGeoNode* node = pv.ptr(); size_t count = 0; if (node) { Volume vol = pv.volume(); @@ -98,7 +91,8 @@ namespace { ++count; } else { - printout(WARNING, "VolumeManager", "%s: Strange constellation volume %s is sensitive, but has no readout! sd:%p", + printout(WARNING, "VolumeManager", + "%s: Strange constellation volume %s is sensitive, but has no readout! sd:%p", parent.name(), pv.volume().name(), sd.ptr()); } } @@ -122,7 +116,8 @@ namespace { count += cnt; } else { - throw runtime_error("Invalid not instrumented placement:"+string(daughter->GetName())+" [Internal error -- bad detector constructor]"); + throw runtime_error("Invalid not instrumented placement:"+string(daughter->GetName())+ + " [Internal error -- bad detector constructor]"); } } if ( sd.isValid() ) { @@ -155,8 +150,7 @@ namespace { } return make_pair(volume_id, mask); } - void add_entry(SensitiveDetector sd, DetElement parent, DetElement e, const TGeoNode* n, const VolIDs& ids, - const Chain& nodes) { + void add_entry(SensitiveDetector sd, DetElement parent, DetElement e, const TGeoNode* n, const VolIDs& ids, Chain& nodes) { Readout ro = sd.readout(); IDDescriptor iddesc = ro.idSpec(); VolumeManager section = m_volManager.addSubdetector(parent, ro); @@ -221,70 +215,28 @@ namespace { }; } -/// Default constructor -VolumeManagerContext::VolumeManagerContext() - : identifier(0), mask(~0x0ULL) { -} - -/// Default destructor -VolumeManagerContext::~VolumeManagerContext() { -} - -/// Default constructor -VolumeManagerObject::VolumeManagerObject(LCDD& l) - : lcdd(&l), top(0), system(0), sysID(0), detMask(~0x0ULL), flags(VolumeManager::NONE) { -} - -/// Default destructor -VolumeManagerObject::~VolumeManagerObject() { - /// Cleanup volume tree - for_each(volumes.begin(), volumes.end(), destroyObjects(volumes)); - volumes.clear(); - /// Cleanup dependent managers - for_each(managers.begin(), managers.end(), destroyHandles(managers)); - managers.clear(); - subdetectors.clear(); -} - -/// Update callback when alignment has changed (called only for subdetectors....) -void VolumeManagerObject::update(unsigned long tags, DetElement& det, void* param) { - if ( DetElement::CONDITIONS_CHANGED == (tags&DetElement::CONDITIONS_CHANGED) ) - printout(DEBUG,"VolumeManager","+++ Conditions update %s param:%p",det.path().c_str(),param); - if ( DetElement::PLACEMENT_CHANGED == (tags&DetElement::PLACEMENT_CHANGED) ) - printout(DEBUG,"VolumeManager","+++ Alignment update %s param:%p",det.path().c_str(),param); - - for(Volumes::iterator i=volumes.begin(); i != volumes.end(); ++i) { - Context* c = (*i).second; - printout(DEBUG,"VolumeManager","+++ Alignment update %s",c->placement.name()); - - } -} - -/// Search the locally cached volumes for a matching ID -VolumeManager::Context* VolumeManagerObject::search(const VolumeID& id) const { - Context* context = 0; - VolumeID volume_id(id); - volume_id &= detMask; - Volumes::const_iterator i = volumes.find(volume_id); - if (i != volumes.end()) { - context = (*i).second; - } - return context; -} - /// Initializing constructor to create a new object VolumeManager::VolumeManager(LCDD& lcdd, const string& nam, DetElement elt, Readout ro, int flags) { - Object* ptr = new Object(lcdd); + Object* ptr = new Object(); assign(ptr, nam, "VolumeManager"); if (elt.isValid()) { Populator p(lcdd, *this); - setDetector(elt, ro); + ptr->detector = elt; + ptr->id = ro.isValid() ? ro.idSpec() : IDDescriptor(); ptr->top = ptr; ptr->flags = flags; p.populate(elt); } } +/// Initializing constructor to create a new object +VolumeManager::VolumeManager(DetElement subdetector, Readout ro) { + Object* ptr = new Object(); + ptr->detector = subdetector; + ptr->id = ro.isValid() ? ro.idSpec() : IDDescriptor(); + assign(ptr, subdetector.name(), "VolumeManager"); +} + /// Add a new Volume manager section according to a new subdetector VolumeManager VolumeManager::addSubdetector(DetElement detector, Readout ro) { if (isValid()) { @@ -308,7 +260,7 @@ VolumeManager VolumeManager::addSubdetector(DetElement detector, Readout ro) { "valid placement VolIDs are allowed. [Invalid DetElement:" + det_name + "]"); } - i = o.subdetectors.insert(make_pair(detector, VolumeManager(*o.lcdd, detector.name()))).first; + i = o.subdetectors.insert(make_pair(detector, VolumeManager(detector,ro))).first; const PlacedVolume::VolID& id = (*vit); VolumeManager m = (*i).second; IDDescriptor::Field field = ro.idSpec().field(id.first); @@ -317,7 +269,6 @@ VolumeManager VolumeManager::addSubdetector(DetElement detector, Readout ro) { "DD4hep: VolumeManager::addSubdetector: IdDescriptor of " + string(detector.name()) + " has no field " + id.first); } Object& mo = m._data(); - m.setDetector(detector, ro); mo.top = o.top; mo.flags = o.flags; mo.system = field; @@ -350,20 +301,6 @@ VolumeManager VolumeManager::subdetector(VolumeID id) const { throw runtime_error("DD4hep: VolumeManager::subdetector(VolID): Cannot assign ID descriptor [Invalid Manager Handle]"); } -/// Assign the top level detector element to this manager -void VolumeManager::setDetector(DetElement e, Readout ro) { - if (isValid()) { - if (e.isValid()) { - Object& o = _data(); - o.id = ro.isValid() ? ro.idSpec() : IDDescriptor(); - o.detector = e; - return; - } - throw runtime_error("DD4hep: VolumeManager::setDetector: Cannot assign invalid detector element [Invalid Handle]"); - } - throw runtime_error("DD4hep: VolumeManager::setDetector: Cannot assign detector element [Invalid Manager Handle]"); -} - /// Access the top level detector element DetElement VolumeManager::detector() const { if (isValid()) { @@ -372,17 +309,6 @@ DetElement VolumeManager::detector() const { throw runtime_error("DD4hep: VolumeManager::detector: Cannot access DetElement [Invalid Handle]"); } -/// Assign IDDescription to VolumeManager structure -void VolumeManager::setIDDescriptor(IDDescriptor new_descriptor) const { - if (isValid()) { - if (new_descriptor.isValid()) { // Do NOT delete! - _data().id = new_descriptor; - return; - } - } - throw runtime_error("DD4hep: VolumeManager::setIDDescriptor: Cannot assign ID descriptor [Invalid Manager Handle]"); -} - /// Access IDDescription structure IDDescriptor VolumeManager::idSpec() const { return _data().id; diff --git a/DDCore/src/VolumeManagerInterna.cpp b/DDCore/src/VolumeManagerInterna.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0657d76d6e370c5b9a4364dde84f7d53d4f6e238 --- /dev/null +++ b/DDCore/src/VolumeManagerInterna.cpp @@ -0,0 +1,68 @@ +// $Id: VolumeManager.cpp 513 2013-04-05 14:31:53Z gaede $ +//==================================================================== +// AIDA Detector description implementation for LCD +//-------------------------------------------------------------------- +// +// Author : M.Frank +// +//==================================================================== +// Framework include files +#include "DD4hep/Printout.h" +#include "DD4hep/Handle.inl" +#include "DD4hep/objects/VolumeManagerInterna.h" + +using namespace DD4hep; +using namespace DD4hep::Geometry; + +DD4HEP_INSTANTIATE_HANDLE_NAMED(VolumeManagerObject); + +/// Default constructor +VolumeManagerContext::VolumeManagerContext() + : identifier(0), mask(~0x0ULL) { +} + +/// Default destructor +VolumeManagerContext::~VolumeManagerContext() { +} + +/// Default constructor +VolumeManagerObject::VolumeManagerObject() + : top(0), system(0), sysID(0), detMask(~0x0ULL), flags(VolumeManager::NONE) { +} + +/// Default destructor +VolumeManagerObject::~VolumeManagerObject() { + /// Cleanup volume tree + for_each(volumes.begin(), volumes.end(), destroyObjects(volumes)); + volumes.clear(); + /// Cleanup dependent managers + for_each(managers.begin(), managers.end(), destroyHandles(managers)); + managers.clear(); + subdetectors.clear(); +} + +/// Update callback when alignment has changed (called only for subdetectors....) +void VolumeManagerObject::update(unsigned long tags, DetElement& det, void* param) { + if ( DetElement::CONDITIONS_CHANGED == (tags&DetElement::CONDITIONS_CHANGED) ) + printout(DEBUG,"VolumeManager","+++ Conditions update %s param:%p",det.path().c_str(),param); + if ( DetElement::PLACEMENT_CHANGED == (tags&DetElement::PLACEMENT_CHANGED) ) + printout(DEBUG,"VolumeManager","+++ Alignment update %s param:%p",det.path().c_str(),param); + + for(Volumes::iterator i=volumes.begin(); i != volumes.end(); ++i) { + Context* c = (*i).second; + printout(DEBUG,"VolumeManager","+++ Alignment update %s",c->placement.name()); + + } +} + +/// Search the locally cached volumes for a matching ID +VolumeManager::Context* VolumeManagerObject::search(const VolumeID& id) const { + Context* context = 0; + VolumeID volume_id(id); + volume_id &= detMask; + Volumes::const_iterator i = volumes.find(volume_id); + if (i != volumes.end()) { + context = (*i).second; + } + return context; +} diff --git a/DDCore/src/Volumes.cpp b/DDCore/src/Volumes.cpp index 4e6bae9adfbf3a7fd2e210147b0a8e03a529fce4..a34bccdce4ce8b8e09ae034c2c72d5c4c423b4d3 100644 --- a/DDCore/src/Volumes.cpp +++ b/DDCore/src/Volumes.cpp @@ -586,6 +586,7 @@ const Volume& Volume::setVisAttributes(const VisAttr& attr) const { if (draw_style == VisAttr::SOLID) { m_element->SetLineColor(bright); m_element->SetFillColor(bright); + // ROOT 6: m_element->SetFillColorAlpha(bright,vis->alpha); m_element->SetFillStyle(1001); // Root: solid } else { diff --git a/DDCore/src/XML/XMLElements.cpp b/DDCore/src/XML/XMLElements.cpp index 52457271b801ba638cd3720695705b095c2a42fe..5423fcaf6e05cacdbbb28eacfa69b28ab2e96b16 100644 --- a/DDCore/src/XML/XMLElements.cpp +++ b/DDCore/src/XML/XMLElements.cpp @@ -210,6 +210,11 @@ string DD4hep::XML::_toString(int v, const char* fmt) { return __to_string(v, fmt); } +/// Format signed long integer to string with atrbitrary format +string DD4hep::XML::_toString(long v, const char* fmt) { + return __to_string(v, fmt); +} + /// Format single procision float number (32 bits) to string with atrbitrary format string DD4hep::XML::_toString(float v, const char* fmt) { return __to_string(v, fmt); @@ -292,6 +297,25 @@ void DD4hep::XML::_toDictionary(const XmlChar* name, const XmlChar* value) { eval.setVariable(n.c_str(), result); } +template <typename T> +void DD4hep::XML::_toDictionary(const XmlChar* name, T value) { + Strng_t item = _toString(value); + const XmlChar* item_value = item; + _toDictionary(name, item_value); +} +#ifndef DD4HEP_USE_TINYXML +template void DD4hep::XML::_toDictionary(const XmlChar* name, const char* value); +#endif +template void DD4hep::XML::_toDictionary(const XmlChar* name, const std::string& value); +template void DD4hep::XML::_toDictionary(const XmlChar* name, unsigned long value); +template void DD4hep::XML::_toDictionary(const XmlChar* name, unsigned int value); +template void DD4hep::XML::_toDictionary(const XmlChar* name, unsigned short value); +template void DD4hep::XML::_toDictionary(const XmlChar* name, int value); +template void DD4hep::XML::_toDictionary(const XmlChar* name, long value); +template void DD4hep::XML::_toDictionary(const XmlChar* name, short value); +template void DD4hep::XML::_toDictionary(const XmlChar* name, float value); +template void DD4hep::XML::_toDictionary(const XmlChar* name, double value); + template <typename B> static inline string i_add(const string& a, B b) { string r = a; diff --git a/DDCore/src/plugins/StandardPlugins.cpp b/DDCore/src/plugins/StandardPlugins.cpp index 16a867e64759c2d54824c266ed2cc19e07e5855e..940650a81ec67e91441d6514289cc0536942f6a9 100644 --- a/DDCore/src/plugins/StandardPlugins.cpp +++ b/DDCore/src/plugins/StandardPlugins.cpp @@ -109,7 +109,7 @@ static long load_volmgr(LCDD& lcdd, int, char**) { try { LCDDImp* imp = dynamic_cast<LCDDImp*>(&lcdd); if ( imp ) { - imp->m_volManager = VolumeManager(lcdd, "World", imp->world(), Readout(), VolumeManager::TREE); + imp->imp_loadVolumeManager(); printout(INFO,"VolumeManager","+++ Volume manager populated and loaded."); return 1; } diff --git a/DDG4/examples/CLICSidSimu.py b/DDG4/examples/CLICSidSimu.py index 6551d470c790595210e32656db85e137dba6850f..aa9301b80acfc998d7397a1f2889fba995418935 100644 --- a/DDG4/examples/CLICSidSimu.py +++ b/DDG4/examples/CLICSidSimu.py @@ -85,8 +85,8 @@ def run(): # Setup particle gun gun = DDG4.GeneratorAction(kernel,"Geant4ParticleGun/Gun") - gun.energy = 50*GeV - gun.particle = 'e-' + gun.energy = 100*GeV + gun.particle = 'pi-' gun.multiplicity = 1 gun.position = (0*mm,0*mm,0*cm) gun.isotrop = True @@ -159,7 +159,7 @@ def run(): act.adoptFilter(kernel.globalFilter('OpticalPhotonRejector')) seq.add(act) - act = DDG4.SensitiveAction(kernel,'Geant4SimpleCalorimeterAction/HcalOpticalBarrelHandler','HcalBarrel') + act = DDG4.SensitiveAction(kernel,'Geant4SimpleCalorimeterAction/HcalBarrelHandler','HcalBarrel') act.adoptFilter(kernel.globalFilter('OpticalPhotonSelector')) seq.add(act) diff --git a/DDG4/plugins/Geant4SDActions.cpp b/DDG4/plugins/Geant4SDActions.cpp index 9cee4fb2382f99801e1d3b2a6244a9c9ab650d8d..aafb4299869363a25fa18c3568ba467ec9de6be9 100644 --- a/DDG4/plugins/Geant4SDActions.cpp +++ b/DDG4/plugins/Geant4SDActions.cpp @@ -119,8 +119,7 @@ namespace DD4hep { /// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ /// Define collections created by this sensitivie action object template <> void Geant4SensitiveAction<SimpleTracker>::defineCollections() { - m_collectionID = defineCollection<SimpleTracker::Hit>(name()+"Hits"); - //m_collectionID = defineCollection<SimpleHit>(name()+"Hits"); + m_collectionID = defineCollection<SimpleTracker::Hit>(m_sensitive.readout().name()); } /// Method for generating hit(s) using the information of G4Step object. @@ -168,8 +167,7 @@ namespace DD4hep { /// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ /// Define collections created by this sensitivie action object template <> void Geant4SensitiveAction<SimpleCalorimeter>::defineCollections() { - m_collectionID = defineCollection<SimpleCalorimeter::Hit>(name()+"Hits"); - //m_collectionID = defineCollection<SimpleHit>(name()+"Hits"); + m_collectionID = defineCollection<SimpleCalorimeter::Hit>(m_sensitive.readout().name()); } /// Method for generating hit(s) using the information of G4Step object. template <> bool Geant4SensitiveAction<SimpleCalorimeter>::process(G4Step* step,G4TouchableHistory*) { @@ -209,7 +207,7 @@ namespace DD4hep { struct SimpleOpticalCalorimeter {}; /// Define collections created by this sensitivie action object template <> void Geant4SensitiveAction<SimpleOpticalCalorimeter>::defineCollections() { - m_collectionID = defineCollection<SimpleCalorimeter::Hit>("Ceren_"+name()+"Hits"); + m_collectionID = defineCollection<SimpleCalorimeter::Hit>(m_sensitive.readout().name()); } /// Method for generating hit(s) using the information of G4Step object. template <> bool Geant4SensitiveAction<SimpleOpticalCalorimeter>::process(G4Step* step,G4TouchableHistory*) { diff --git a/cmake/thisdd4hep.sh b/cmake/thisdd4hep.sh index 4a1057704c1d47cb348accc28a1ace7d0f1e21b0..12bbc741d13112a4bf4a91ca7f3804992eccce8d 100644 --- a/cmake/thisdd4hep.sh +++ b/cmake/thisdd4hep.sh @@ -68,9 +68,9 @@ fi #----PYTHONPATH--------------------------------------------------------------- if [ -z "${PYTHONPATH}" ]; then - PYTHONPATH=@CMAKE_INSTALL_PREFIX@/python/DDG4/python:@CMAKE_SOURCE_DIR@/DDCore/python; export PYTHONPATH + PYTHONPATH=@CMAKE_INSTALL_PREFIX@/python:@CMAKE_SOURCE_DIR@/DDCore/python; export PYTHONPATH else - PYTHONPATH=@CMAKE_INSTALL_PREFIX@/python/DDG4/python:@CMAKE_SOURCE_DIR@/DDCore/python:$PYTHONPATH; export PYTHONPATH + PYTHONPATH=@CMAKE_INSTALL_PREFIX@/python:@CMAKE_SOURCE_DIR@/DDCore/python:$PYTHONPATH; export PYTHONPATH fi #----DD4hep installation directory-------------------------------------------- diff --git a/examples/CLICSiD/compact/compact.xml b/examples/CLICSiD/compact/compact.xml index b1485ee2e3e751065fe48f572e8b010e0fd88d17..37e9eb943df7fdad16b5fb9c6546b4b8ee7be98f 100644 --- a/examples/CLICSiD/compact/compact.xml +++ b/examples/CLICSiD/compact/compact.xml @@ -830,7 +830,6 @@ <zplane rmin="LumiCal_rmax" rmax="LumiCalElectronics_rmax" z="-(LumiCal_zmin+LumiCal_thickness)"/> </detector> - --> <detector id="14" name="BeamCal" reflect="true" type="ForwardDetector" readout="BeamCalHits" vis="LumiCalVis" calorimeterType="BEAM"> <comment>Beam Calorimeter</comment> <dimensions outer_r="BeamCal_rmax" inner_r="0.0*cm" inner_z="BeamCal_zmin" /> diff --git a/examples/CLICSiD/src/PolyhedraEndcapCalorimeter2_geo.cpp b/examples/CLICSiD/src/PolyhedraEndcapCalorimeter2_geo.cpp index 8671efebb1e04b05d84e9e8d62886806161f09b5..31a690d4588eb58217c965481dd03bf30ae22470 100644 --- a/examples/CLICSiD/src/PolyhedraEndcapCalorimeter2_geo.cpp +++ b/examples/CLICSiD/src/PolyhedraEndcapCalorimeter2_geo.cpp @@ -73,25 +73,37 @@ static Ref_t create_detector(LCDD& lcdd, xml_h e, SensitiveDetector sens) { ++layerType; } - DetElement sdet(det_name,x_det.id()); + DetElement sdet(det_name,det_id); Volume motherVol = lcdd.pickMotherVolume(sdet); - PlacedVolume physvol = motherVol.placeVolume(envelopeVol, - Transform3D(RotationZYX(M_PI/numsides,0,0), - Position(0,0,zmin+totalThickness/2))); - physvol.addPhysVolID("system",det_id); - physvol.addPhysVolID("barrel",1); - sdet.setPlacement(physvol); - - if ( reflect ) { - DetElement rdet(det_name+"_neg",x_det.id()); - physvol = motherVol.placeVolume(envelopeVol, - Transform3D(RotationZYX(M_PI/numsides,M_PI,0), + // Reflect it. + if ( reflect ) { + Assembly assembly(det_name+"_assembly"); + PlacedVolume pv = motherVol.placeVolume(assembly); + pv.addPhysVolID("system", det_id); + sdet.setPlacement(pv); + + DetElement sdetA(sdet,det_name+"_A",x_det.id()); + pv = assembly.placeVolume(envelopeVol,Transform3D(RotationZYX(M_PI/numsides,0,0), + Position(0,0,zmin+totalThickness/2))); + pv.addPhysVolID("barrel", 1); + sdetA.setPlacement(pv); + + DetElement sdetB = sdetA.clone(det_name+"_B",x_det.id()); + sdet.add(sdetB); + pv = assembly.placeVolume(envelopeVol,Transform3D(RotationZYX(M_PI/numsides,M_PI,0), Position(0,0,-(zmin+totalThickness/2)))); - physvol.addPhysVolID("system",det_id); - physvol.addPhysVolID("barrel",2); - rdet.setPlacement(physvol); - lcdd.addDetector(rdet); + pv.addPhysVolID("barrel", 2); + sdetB.setPlacement(pv); } + else { + PlacedVolume pv = motherVol.placeVolume(envelopeVol, + Transform3D(RotationZYX(M_PI/numsides,0,0), + Position(0,0,zmin+totalThickness/2))); + pv.addPhysVolID("system", det_id); + pv.addPhysVolID("barrel", 1); + sdet.setPlacement(pv); + } + return sdet; } diff --git a/examples/ClientTests/CMakeLists.txt b/examples/ClientTests/CMakeLists.txt index eeace3a3630c0e4cfca8c0e7326cc79bb14cf850..f6fdb8dc0be72fd7253ea6ff83020a9aaa6bfb04 100644 --- a/examples/ClientTests/CMakeLists.txt +++ b/examples/ClientTests/CMakeLists.txt @@ -67,5 +67,9 @@ install(DIRECTORY compact DESTINATION examples/${PackageName} PATTERN ".svn" EXCLUDE ) +install(DIRECTORY scripts + DESTINATION examples/${PackageName} + PATTERN ".svn" EXCLUDE ) + # to do: add corresponding uninstall... #-------------------------------------------------------