diff --git a/DDCore/include/DD4hep/AlignmentData.h b/DDCore/include/DD4hep/AlignmentData.h index c1d131b4a836d173ef44c2f9ad363ae1ad404138..7cd0fa7c9b95337931f8055b8e6497e00d637351 100644 --- a/DDCore/include/DD4hep/AlignmentData.h +++ b/DDCore/include/DD4hep/AlignmentData.h @@ -52,7 +52,7 @@ namespace DD4hep { Position translation; Pivot pivot; RotationZYX rotation; - unsigned int flags; + unsigned int flags = 0; enum AlignmentFlags { HAVE_NONE = 0, @@ -62,7 +62,7 @@ namespace DD4hep { }; /// Default constructor - Delta() : flags(0) {} + Delta() = default; /// Initializing constructor Delta(const Position& tr) : translation(tr), flags(HAVE_TRANSLATION) {} diff --git a/DDCore/include/DD4hep/Alignments.h b/DDCore/include/DD4hep/Alignments.h index e1c4f4f881c0a910e577ec9bbb20f67a2f3f37b2..9153161eae0fc025a1e738360d2a045e0422398c 100644 --- a/DDCore/include/DD4hep/Alignments.h +++ b/DDCore/include/DD4hep/Alignments.h @@ -25,6 +25,7 @@ namespace DD4hep { /// Namespace for the conditions part of the AIDA detector description toolkit namespace Conditions { + class UserPool; /// Conditions internal namespace namespace Interna { @@ -80,7 +81,7 @@ namespace DD4hep { public: /// Default constructor - Alignment() : Handle<Object>() {} + Alignment() = default; /// Default constructor Alignment(Object* p) : Handle<Object>(p) {} /// Constructor to be used when reading the already parsed object diff --git a/DDCore/include/DD4hep/ComponentProperties.h b/DDCore/include/DD4hep/ComponentProperties.h index 0545506727dc5f762eefa6e02e91fa8f7f76b3b2..25e155c44fbc5752db17c297c34d3ea8c711c2a8 100644 --- a/DDCore/include/DD4hep/ComponentProperties.h +++ b/DDCore/include/DD4hep/ComponentProperties.h @@ -86,31 +86,29 @@ namespace DD4hep { class Property { protected: /// Pointer to the data location - void* m_par; - const PropertyGrammar* m_hdl; + void* m_par = 0; + /// Reference to the grammar of this property (extended type description) + const PropertyGrammar* m_hdl = 0; /// Setup property template <typename TYPE> void make(TYPE& value); public: /// Default constructor - Property(); + Property() = default; /// Copy constructor - Property(const Property& p); + Property(const Property& p) = default; /// User constructor - template <typename TYPE> Property(TYPE& val) - : m_par(0), m_hdl(0) { + template <typename TYPE> Property(TYPE& val) : m_par(0), m_hdl(0) { make(val); } /// Property type name static std::string type(const Property& proptery); /// Property type name static std::string type(const std::type_info& proptery); + /// Access void data pointer + void* ptr() const { return m_par; } /// Property type name std::string type() const; - /// Access void data pointer - void* ptr() const { - return m_par; - } /// Access grammar object const PropertyGrammar& grammar() const; /// Conversion to string value @@ -118,7 +116,7 @@ namespace DD4hep { /// Conversion from string value Property& str(const std::string& input); /// Assignment operator - Property& operator=(const Property& p); + Property& operator=(const Property& p) = default; /// Assignment operator / set new balue Property& operator=(const char* val); /// Assignment operator / set new balue @@ -142,38 +140,27 @@ namespace DD4hep { template <class TYPE> class PropertyValue : private Property { public: TYPE data; - PropertyValue() - : Property(data) { - } + /// Default constructor + PropertyValue() : Property(data) {} + /// Copy constructor + PropertyValue(const PropertyValue& c) = default; /// Assignment operator - PropertyValue& operator=(const TYPE& val) { - data = val; - return *this; - } - // Equality operator - bool operator==(const TYPE& val) const { - return val == data; - } + PropertyValue& operator=(const PropertyValue& c) = default; + /// Assignment operator + PropertyValue& operator=(const TYPE& val) { data = val; return *this; } + /// Equality operator + bool operator==(const TYPE& val) const { return val == data; } /// Access grammar object - const PropertyGrammar& grammar() const { - return this->Property::grammar(); - } + const PropertyGrammar& grammar() const { return this->Property::grammar(); } /// Conversion to string value - std::string str() const { - return this->Property::str(); - } + std::string str() const { return this->Property::str(); } /// Retrieve value with data conversion - template <typename T> T value() const { - return this->Property::value<T>(); - } + template <typename T> T value() const { return this->Property::value<T>();} /// Retrieve value from stack with data conversion (large values e.g. vectors etc.) - template <typename T> void value(TYPE& val) const { - this->Property::value(val); - } + template <typename T> + void value(TYPE& val) const { this->Property::value(val); } /// Set value of this property with data conversion - template <typename T> void set(const T& val) { - this->Property::set(val); - } + template <typename T> void set(const T& val) { this->Property::set(val); } }; /// Manager to ease the handling of groups of properties. diff --git a/DDCore/include/DD4hep/Handle.h b/DDCore/include/DD4hep/Handle.h index b346b27e3304cf33f10f94868d0342c0bfa7f5d6..506c0dfe5ad8454db36f4b0f98d907a4bdb34777 100644 --- a/DDCore/include/DD4hep/Handle.h +++ b/DDCore/include/DD4hep/Handle.h @@ -93,19 +93,19 @@ namespace DD4hep { typedef Handle<Implementation> handle_t; /// Single and only data member: Reference to the actual element. - T* m_element; + T* m_element = 0; /// Defaulot constructor - Handle() : m_element(0) { } - /// Initializing constructor from pointer - Handle(T* e) : m_element(e) { } + Handle() = default; /// Copy constructor Handle(const Handle<T>& e) = default; + /// Initializing constructor from pointer + Handle(T* e) : m_element(e) { } /// Initializing constructor from unrelated pointer with type checking template <typename Q> Handle(Q* e) : m_element((T*)e) - { verifyObject(); } + { verifyObject(); } /// Initializing constructor from unrelated handle with type checking template <typename Q> Handle(const Handle<Q>& e) : m_element((T*)e.m_element) - { verifyObject(); } + { verifyObject(); } /// Assignment operator Handle<T>& operator=(const Handle<T>& e) = default; /// Boolean operator == used for RB tree insertions @@ -113,19 +113,19 @@ namespace DD4hep { return m_element == e.m_element; } /// Boolean operator < used for RB tree insertions - bool operator<(const Handle<T>& e) const { + bool operator<(const Handle<T>& e) const { return m_element < e.m_element; } /// Boolean operator > used for RB tree insertions - bool operator>(const Handle<T>& e) const { + 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 { + bool isValid() const { return 0 != m_element; } /// Check the validity of the object held by the handle - bool operator!() const { + bool operator!() const { return 0 == m_element; } /// Release the object held by the handle diff --git a/DDCore/include/DD4hep/IOV.h b/DDCore/include/DD4hep/IOV.h index e45f6303fc36586c1e65a9ba95d41f29abb9a27b..f18c121b025dd68a6c615923c48477c1a1bbd51c 100644 --- a/DDCore/include/DD4hep/IOV.h +++ b/DDCore/include/DD4hep/IOV.h @@ -34,11 +34,11 @@ namespace DD4hep { public: enum { UNKNOWN_IOV = ~0x0 } _IOVTypes; /// integer identifier ised internally - unsigned int type; + unsigned int type = UNKNOWN_IOV; /// String name std::string name; /// Standard Constructor - IOVType() : type(UNKNOWN_IOV), name() {} + IOVType() = default; /// Standard Destructor ~IOVType() = default; /// Copy constructor diff --git a/DDCore/include/DD4hep/InstanceCount.h b/DDCore/include/DD4hep/InstanceCount.h index 874c48462cbf6f315635ae4b178c65eadadcaeb9..723811f27c0299e0d01700bebd3c327b9b41f714 100644 --- a/DDCore/include/DD4hep/InstanceCount.h +++ b/DDCore/include/DD4hep/InstanceCount.h @@ -33,7 +33,10 @@ namespace DD4hep { typedef long long int counter_t; /// Enumeration to steer the output enum { - NONE = 1 << 0, STRING = 1 << 1, TYPEINFO = 1 << 2, ALL = STRING | TYPEINFO + NONE = 1 << 0, + STRING = 1 << 1, + TYPEINFO = 1 << 2, + ALL = STRING | TYPEINFO }; /// Internal class to could object constructions and destructions @@ -47,23 +50,18 @@ namespace DD4hep { class Counter { private: /// Reference counter value - counter_t m_count; + counter_t m_count = 0; /// Increment counter value - counter_t m_tot; + counter_t m_tot = 0; /// Maximum number of simultaneous instances - counter_t m_max; + counter_t m_max = 0; public: /// Default constructor - Counter() - : m_count(0), m_tot(0), m_max(0) { - } + Counter() = default; /// Copy constructor - Counter(const Counter& c) - : m_count(c.m_count), m_tot(c.m_tot), m_max(c.m_max) { - } + Counter(const Counter& c) = default; /// Destructor - ~Counter() { - } + ~Counter() = default; /// Increment counter void increment() { ++m_count; @@ -144,8 +142,8 @@ namespace DD4hep { */ template <typename T> struct Increment { static int& counter() { static int cnt=0; return cnt; } - Increment() { ++counter(); } - ~Increment() { --counter(); } + Increment() { ++counter(); } + ~Increment() { --counter(); } }; } /* End namespace DD4hep */ diff --git a/DDCore/src/ComponentProperties.cpp b/DDCore/src/ComponentProperties.cpp index 5236807c092f6b380ebc8bbfca302f7c1d1c9e43..2528e428da1de0fe1d2f01ed65582d99a0df34fd 100644 --- a/DDCore/src/ComponentProperties.cpp +++ b/DDCore/src/ComponentProperties.cpp @@ -58,25 +58,6 @@ bool PropertyGrammar::fromString(void* ptr, const std::string& value) const { return m_grammar.fromString(ptr,value); } -/// Default constructor -Property::Property() - : m_par(0), m_hdl(0) { -} - -/// Copy constructor -Property::Property(const Property& property) - : m_par(property.m_par), m_hdl(property.m_hdl) { -} - -/// Assignment operator -Property& Property::operator=(const Property& property) { - if ( &property != this ) { - m_par = property.m_par; - m_hdl = property.m_hdl; - } - return *this; -} - /// Property type name string Property::type(const Property& property) { return type(property.grammar().type()); diff --git a/DDEve/include/DDEve/Dictionary.h b/DDEve/include/DDEve/Dictionary.h index d63c31ea21e086cb0294f1a6c148b71e12d89598..df6e75e18d012194a0ff33094fc2c404642f9ade 100644 --- a/DDEve/include/DDEve/Dictionary.h +++ b/DDEve/include/DDEve/Dictionary.h @@ -48,7 +48,7 @@ namespace DD4hep { }; } -#ifdef __CINT__ +#if defined(__CINT__) || defined(__MAKECINT__) || defined(__CLING__) || defined(__ROOTCLING__) #pragma link off all globals; #pragma link off all classes; #pragma link off all functions; diff --git a/DDG4/include/DDG4/Geant4Action.h b/DDG4/include/DDG4/Geant4Action.h index 76dddbc0243fe837903d60841961ec2f444a3a71..eb5e9cbfe20335baf21d2ad0cb3a77ed52eddaaf 100644 --- a/DDG4/include/DDG4/Geant4Action.h +++ b/DDG4/include/DDG4/Geant4Action.h @@ -62,15 +62,15 @@ namespace DD4hep { class TypeName : public std::pair<std::string, std::string> { public: /// Default constructor - TypeName() - : std::pair<std::string, std::string>() { - } + TypeName() = default; + /// Copy constructor + TypeName(const TypeName& copy) = default; + /// Copy constructor TypeName(const std::pair<std::string, std::string>& c) - : std::pair<std::string, std::string>(c) { - } + : std::pair<std::string, std::string>(c) { } + /// Initializing constructor TypeName(const std::string& typ, const std::string& nam) - : std::pair<std::string, std::string>(typ, nam) { - } + : std::pair<std::string, std::string>(typ, nam) { } /// Split string pair according to default delimiter ('/') static TypeName split(const std::string& type_name); /// Split string pair according to custom delimiter @@ -113,8 +113,8 @@ namespace DD4hep { */ class ContextSwap { /// reference to the context; - Geant4Context* context; - Geant4Action* action; + Geant4Context* context = 0; + Geant4Action* action = 0; public: /// Constructor ContextSwap(Geant4Action* a,Geant4Context* c) : action(a) { @@ -145,35 +145,19 @@ namespace DD4hep { public: typedef typename std::vector<T*> _V; _V m_v; - Actors() { - } - ~Actors() { - } - void clear() { - m_v.clear(); - } - void add(T* obj) { - m_v.push_back(obj); - } - void add_front(T* obj) { - m_v.insert(m_v.begin(), obj); - } - operator const _V&() const { - return m_v; - } - operator _V&() { - return m_v; - } - const _V* operator->() const { - return &m_v; - } - _V* operator->() { - return &m_v; - } - typename _V::iterator begin() { return m_v.begin(); } - typename _V::iterator end() { return m_v.end(); } - typename _V::const_iterator begin() const { return m_v.begin(); } - typename _V::const_iterator end() const { return m_v.end(); } + Actors() = default; + ~Actors() = default; + void clear() { m_v.clear(); } + void add(T* obj) { m_v.push_back(obj); } + void add_front(T* obj) { m_v.insert(m_v.begin(), obj); } + operator const _V&() const { return m_v; } + operator _V&() { return m_v; } + const _V* operator->() const { return &m_v; } + _V* operator->() { return &m_v; } + typename _V::iterator begin() { return m_v.begin(); } + typename _V::iterator end() { return m_v.end(); } + typename _V::const_iterator begin() const { return m_v.begin(); } + typename _V::const_iterator end() const { return m_v.end(); } /// Context updates void updateContext(Geant4Context* ctxt) { @@ -253,6 +237,13 @@ namespace DD4hep { } }; + /// Inhibit default constructor + Geant4Action() = delete; + /// Inhibit copy constructor + Geant4Action(const Geant4Action& copy) = delete; + /// Inhibit assignment operator + Geant4Action& operator=(const Geant4Action& copy) = delete; + /// Default destructor virtual ~Geant4Action(); diff --git a/DDG4/include/DDG4/Geant4EventAction.h b/DDG4/include/DDG4/Geant4EventAction.h index f6fe64b9f34e0318932c81daa4a7186de6eadfc7..9788587a00f59d7c2c929413be8eb99489f1f5a2 100644 --- a/DDG4/include/DDG4/Geant4EventAction.h +++ b/DDG4/include/DDG4/Geant4EventAction.h @@ -1,4 +1,3 @@ -// $Id: $ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- @@ -55,6 +54,10 @@ namespace DD4hep { public: typedef Geant4SharedEventAction shared_type; public: + /// Inhibit default constructor + Geant4EventAction() = delete; + /// Inhibit copy constructor + Geant4EventAction(const Geant4EventAction& copy) = delete; /// Standard constructor Geant4EventAction(Geant4Context* context, const std::string& nam); /// Default destructor @@ -83,6 +86,10 @@ namespace DD4hep { /// Reference to the shared action Geant4EventAction* m_action; public: + /// Inhibit default constructor + Geant4SharedEventAction() = delete; + /// Inhibit copy constructor + Geant4SharedEventAction(const Geant4SharedEventAction& copy) = delete; /// Standard constructor Geant4SharedEventAction(Geant4Context* context, const std::string& nam); /// Default destructor @@ -122,7 +129,12 @@ namespace DD4hep { CallbackSequence m_final; /// The list of action objects to be called Actors<Geant4EventAction> m_actors; + public: + /// Inhibit default constructor + Geant4EventActionSequence() = delete; + /// Inhibit copy constructor + Geant4EventActionSequence(const Geant4EventActionSequence& copy) = delete; /// Standard constructor Geant4EventActionSequence(Geant4Context* context, const std::string& nam); /// Default destructor diff --git a/DDG4/include/DDG4/Geant4Handle.h b/DDG4/include/DDG4/Geant4Handle.h index 86bafa087d542242c131e46bae64e948bb85efee..ac90244a7be575239aefa8468dbc040ec1933899 100644 --- a/DDG4/include/DDG4/Geant4Handle.h +++ b/DDG4/include/DDG4/Geant4Handle.h @@ -51,8 +51,7 @@ namespace DD4hep { /// Construction initialized with object pointer Geant4Handle(handled_type* typ); /// Cross type initialization - template <typename T> Geant4Handle(T* typ) - : value(0) { + template <typename T> Geant4Handle(T* typ) : value(0) { checked_assign(dynamic_cast<handled_type*>(typ)); } /// Copy constructor @@ -103,7 +102,7 @@ namespace DD4hep { /// Copy constructor KernelHandle(const KernelHandle& k) : value(k.value) {} /// Default destructor - ~KernelHandle() {} + ~KernelHandle() { } /// Conversion operator operator handled_type*() const { return value; } /// Access to the underlying object diff --git a/DDG4/include/DDG4/Geant4Hits.h b/DDG4/include/DDG4/Geant4Hits.h index 556a0e7b058ad27bb2218ae9571ae70813bb285d..176e391c3f5e34774c805cbe5a5dcaf2774f09b7 100644 --- a/DDG4/include/DDG4/Geant4Hits.h +++ b/DDG4/include/DDG4/Geant4Hits.h @@ -58,9 +58,7 @@ namespace DD4hep { template <class HIT> struct HitPositionCompare: public HitCompare<HIT> { const Position& pos; /// Constructor - HitPositionCompare(const Position& p) - : pos(p) { - } + HitPositionCompare(const Position& p) : pos(p) {} /// Default destructor virtual ~HitPositionCompare() {} /// Comparison function @@ -83,40 +81,31 @@ namespace DD4hep { public: // cellID - unsigned long cellID; + unsigned long cellID = 0; /// Deprecated!!! struct MonteCarloContrib { /// Geant 4 Track identifier - int trackID; + int trackID = -1; /// Particle ID from the PDG table - int pdgID; + int pdgID = -1; /// Total energy deposit in this hit - double deposit; + double deposit = 0.0; /// Timestamp when this energy was deposited - double time; - MonteCarloContrib() - : trackID(-1), pdgID(-1), deposit(0.0), time(0.0) { - } + double time = 0.0; + /// Default constructor + MonteCarloContrib() = default; + /// Copy constructor + MonteCarloContrib(const MonteCarloContrib& c) = default; + /// Initializing constructor MonteCarloContrib(int track_id, double dep, double time_stamp) - : trackID(track_id), pdgID(-1), deposit(dep), time(time_stamp) { - } + : trackID(track_id), pdgID(-1), deposit(dep), time(time_stamp) {} + /// Initializing constructor MonteCarloContrib(int track_id, int pdg, double dep, double time_stamp) - : trackID(track_id), pdgID(pdg), deposit(dep), time(time_stamp) { - } - MonteCarloContrib(const MonteCarloContrib& c) - : trackID(c.trackID), pdgID(c.pdgID), deposit(c.deposit), time(c.time) { - } + : trackID(track_id), pdgID(pdg), deposit(dep), time(time_stamp) {} /// Assignment operator - MonteCarloContrib& operator=(const MonteCarloContrib& c) { - if ( this != &c ) { - trackID = c.trackID; - pdgID = c.pdgID; - deposit = c.deposit; - time = c.time; - } - return *this; - } + MonteCarloContrib& operator=(const MonteCarloContrib& c) = default; + /// Clear data void clear() { time = deposit = 0.0; pdgID = trackID = -1; @@ -127,11 +116,9 @@ namespace DD4hep { public: /// Standard constructor - Geant4Hit() : cellID(0) { - } + Geant4Hit() = default; /// Default destructor - virtual ~Geant4Hit() { - } + virtual ~Geant4Hit() { } /// Check if the Geant4 track is a Geantino static bool isGeantino(G4Track* track); /// Extract the MC contribution for a given hit from the step information @@ -166,8 +153,7 @@ namespace DD4hep { /// Standard initializing constructor Geant4TrackerHit(int track_id, int pdg_id, double deposit, double time_stamp); /// Default destructor - virtual ~Geant4TrackerHit() { - } + virtual ~Geant4TrackerHit() {} /// Clear hit content Geant4TrackerHit& clear(); /// Store Geant4 point and step information into tracker hit structure. @@ -202,8 +188,7 @@ namespace DD4hep { /// Standard constructor Geant4CalorimeterHit(const Position& cell_pos); /// Default destructor - virtual ~Geant4CalorimeterHit() { - } + virtual ~Geant4CalorimeterHit() { } /// Geant4 required object allocator void *operator new(size_t); /// Geat4 required object destroyer diff --git a/DDG4/include/DDG4/Geant4Primary.h b/DDG4/include/DDG4/Geant4Primary.h index bc0c9941d73f27b22892026641d10d9aa13ee190..549fd9556794267e0d8a940b31c415e779dd9d32 100644 --- a/DDG4/include/DDG4/Geant4Primary.h +++ b/DDG4/include/DDG4/Geant4Primary.h @@ -48,7 +48,7 @@ namespace DD4hep { class PrimaryExtension { public: /// Default constructor - PrimaryExtension() {} + PrimaryExtension() = default; /// Default destructor virtual ~PrimaryExtension(); }; @@ -71,7 +71,7 @@ namespace DD4hep { public: /// Default constructor - Geant4PrimaryMap() {} + Geant4PrimaryMap() = default; /// Default destructor virtual ~Geant4PrimaryMap(); /// Add a new object pair (G4 primary particle, DDG4 particle) into the maps @@ -144,9 +144,9 @@ namespace DD4hep { class Geant4PrimaryEvent { private: /// Copy constructor - Geant4PrimaryEvent(const Geant4PrimaryEvent& c); + Geant4PrimaryEvent(const Geant4PrimaryEvent& c) = delete; /// Assignment operator - Geant4PrimaryEvent& operator=(const Geant4PrimaryEvent& c); + Geant4PrimaryEvent& operator=(const Geant4PrimaryEvent& c) = delete; public: typedef Geant4PrimaryInteraction Interaction; @@ -163,7 +163,7 @@ namespace DD4hep { public: /// Default constructor - Geant4PrimaryEvent(); + Geant4PrimaryEvent() = default; /// Default destructor virtual ~Geant4PrimaryEvent(); /// Add a new interaction object to the event diff --git a/DDG4/include/DDG4/Geant4RunAction.h b/DDG4/include/DDG4/Geant4RunAction.h index 4d14b02fa419448b0cdc5375a6b7627533657135..91ff3f4b0a5a893e939b322d352597c18247a7f1 100644 --- a/DDG4/include/DDG4/Geant4RunAction.h +++ b/DDG4/include/DDG4/Geant4RunAction.h @@ -1,4 +1,3 @@ -// $Id: $ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- @@ -47,6 +46,10 @@ namespace DD4hep { public: typedef Geant4SharedRunAction shared_type; public: + /// Inhibit default constructor + Geant4RunAction() = delete; + /// Inhibit copy constructor + Geant4RunAction(const Geant4RunAction& copy) = delete; /// Standard constructor Geant4RunAction(Geant4Context* context, const std::string& nam); /// Default destructor @@ -75,6 +78,10 @@ namespace DD4hep { /// Reference to the shared action Geant4RunAction* m_action; public: + /// Inhibit default constructor + Geant4SharedRunAction() = delete; + /// Inhibit default constructor + Geant4SharedRunAction(const Geant4SharedRunAction& copy) = delete; /// Standard constructor Geant4SharedRunAction(Geant4Context* context, const std::string& nam); /// Default destructor @@ -113,6 +120,10 @@ namespace DD4hep { /// The list of action objects to be called Actors<Geant4RunAction> m_actors; public: + /// Inhibit default constructor + Geant4RunActionSequence() = delete; + /// Inhibit copy constructor + Geant4RunActionSequence(const Geant4RunActionSequence& copy) = delete; /// Standard constructor Geant4RunActionSequence(Geant4Context* context, const std::string& nam); /// Default destructor diff --git a/DDG4/include/DDG4/Geant4SensDetAction.h b/DDG4/include/DDG4/Geant4SensDetAction.h index 0e6da962a7dcff81e7c0ea673c1d926d7e03db14..ad0f82d44281a44c62748977749d274bbc97c7bc 100644 --- a/DDG4/include/DDG4/Geant4SensDetAction.h +++ b/DDG4/include/DDG4/Geant4SensDetAction.h @@ -93,6 +93,10 @@ namespace DD4hep { */ class Geant4Filter: public Geant4Action { public: + /// Inhibit default constructor + Geant4Filter() = delete; + /// Inhibit copy constructor + Geant4Filter(const Geant4Filter& copy) = delete; /// Standard constructor Geant4Filter(Geant4Context* context, const std::string& name); /// Standard destructor @@ -148,6 +152,12 @@ namespace DD4hep { Actors<Geant4Filter> m_filters; public: + /// Inhibit default constructor + Geant4Sensitive() = delete; + + /// Inhibit copy constructor + Geant4Sensitive(const Geant4Sensitive& copy) = delete; + /// Constructor. The sensitive detector element is identified by the detector name Geant4Sensitive(Geant4Context* context, const std::string& name, DetElement det, LCDD& lcdd); @@ -318,6 +328,12 @@ namespace DD4hep { } public: + /// Inhibit default constructor + Geant4SensDetActionSequence() = delete; + + /// Inhibit copy constructor + Geant4SensDetActionSequence(const Geant4SensDetActionSequence& copy) = delete; + /// Standard constructor Geant4SensDetActionSequence(Geant4Context* context, const std::string& name); diff --git a/DDG4/include/DDG4/Geant4SensitiveDetector.h b/DDG4/include/DDG4/Geant4SensitiveDetector.h index 2eaba755e99967c313c8943ada9d0fb096c827fe..e6832786eb104e980f336b654461c17aba3a5db8 100644 --- a/DDG4/include/DDG4/Geant4SensitiveDetector.h +++ b/DDG4/include/DDG4/Geant4SensitiveDetector.h @@ -1,4 +1,3 @@ -// $Id$ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- diff --git a/DDG4/include/DDG4/Geant4StepHandler.h b/DDG4/include/DDG4/Geant4StepHandler.h index 03ec80437260b6e40b216299a2f827d89d5bb842..92b521d8758d51258c62e06eda179325b94b2505 100644 --- a/DDG4/include/DDG4/Geant4StepHandler.h +++ b/DDG4/include/DDG4/Geant4StepHandler.h @@ -51,13 +51,18 @@ namespace DD4hep { G4StepPoint* post; G4Track* track; bool applyBirksLaw; - Geant4StepHandler(const G4Step* s) - : step(s) { + /// Inhibit default constructor + Geant4StepHandler() = delete; + /// Initializing constructor + Geant4StepHandler(const G4Step* s) : step(s) { pre = s->GetPreStepPoint(); post = s->GetPostStepPoint(); track = s->GetTrack(); applyBirksLaw = false; } + /// Assignment operator inhibited. Should not be copied + Geant4StepHandler& operator=(const Geant4StepHandler& copy) = delete; + G4ParticleDefinition* trackDef() const { return track->GetDefinition(); } diff --git a/DDG4/include/DDG4/Geant4SteppingAction.h b/DDG4/include/DDG4/Geant4SteppingAction.h index b1d2087a39ebb02606329331e768ce312383c401..e33778e6a33c4e37c491bfd2b9bd6d5a02dcd744 100644 --- a/DDG4/include/DDG4/Geant4SteppingAction.h +++ b/DDG4/include/DDG4/Geant4SteppingAction.h @@ -1,4 +1,3 @@ -// $Id: $ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- @@ -42,6 +41,8 @@ namespace DD4hep { public: typedef Geant4SharedSteppingAction shared_type; public: + /// Inhibit default constructor + Geant4SteppingAction() = delete; /// Standard constructor Geant4SteppingAction(Geant4Context* context, const std::string& name); /// Default destructor diff --git a/DDG4/include/DDG4/Geant4TrackHandler.h b/DDG4/include/DDG4/Geant4TrackHandler.h index 0be8fde42fdf3cfbdfe7eda377ead96ab1f8bf43..49097098b36af49dc25d9a76b230c1dfd3c1e8c6 100644 --- a/DDG4/include/DDG4/Geant4TrackHandler.h +++ b/DDG4/include/DDG4/Geant4TrackHandler.h @@ -56,9 +56,10 @@ namespace DD4hep { typedef G4ReferenceCountedHandle<G4VTouchable> Touchable; /// Reference to the track object const G4Track* track; + /// Inhibit default constructor + Geant4TrackHandler() = delete; /// Initializing constructor - Geant4TrackHandler(const G4Track* t) - : track(t) { + Geant4TrackHandler(const G4Track* t) : track(t) { /// Should test here if the track pointer is valid to avoind any later trouble if ( 0 == t ) { throw std::runtime_error("Geant4TrackHandler: NULL pointer passed to constructor!"); diff --git a/DDG4/src/Geant4Primary.cpp b/DDG4/src/Geant4Primary.cpp index 147ff886bde0391df81eb0677f5d71ad91d7c84f..c486eba0729483c8a9ed898f3a18dedf458e4bb1 100644 --- a/DDG4/src/Geant4Primary.cpp +++ b/DDG4/src/Geant4Primary.cpp @@ -102,22 +102,6 @@ bool Geant4PrimaryInteraction::applyMask() { return false; } -/// Default constructor -Geant4PrimaryEvent::Geant4PrimaryEvent() -{ -} - -/// Copy constructor -Geant4PrimaryEvent::Geant4PrimaryEvent(const Geant4PrimaryEvent&) -{ -} - -/// Assignment operator -Geant4PrimaryEvent& Geant4PrimaryEvent::operator=(const Geant4PrimaryEvent& c) { - if ( &c == this ) {} - return *this; -} - /// Default destructor Geant4PrimaryEvent::~Geant4PrimaryEvent() { destroyObjects(m_interactions);