diff --git a/DDG4/include/DDG4/Geant4FastSimShowerModel.h b/DDG4/include/DDG4/Geant4FastSimShowerModel.h index 2089b4fad8b9a5741cfa2413a05b2f016106698a..e8677389efe2d7b78e6a7bb455fc53ad8a417331 100644 --- a/DDG4/include/DDG4/Geant4FastSimShowerModel.h +++ b/DDG4/include/DDG4/Geant4FastSimShowerModel.h @@ -52,7 +52,7 @@ namespace dd4hep { // typedef std::vector<std::pair<std::string, double> > ParticleConfig; typedef std::map<const G4ParticleDefinition*, double> ParticleCut; typedef std::map<std::string, std::string> ParticleConfig; - typedef std::unique_ptr<Geant4ShowerModelWrapper> Wrapper; + typedef Geant4ShowerModelWrapper* Wrapper; /// Property: Region name to which this parametrization should be applied std::string m_regionName { "Region-name-not-specified"}; @@ -78,7 +78,7 @@ namespace dd4hep { /// Reference to the G4 fast simulation model G4VFastSimulationModel* m_model { nullptr }; /// Reference to the shower model - Wrapper m_wrapper { }; + Wrapper m_wrapper { nullptr }; protected: /// Define standard assignments and constructors diff --git a/DDG4/src/Geant4FastSimShowerModel.cpp b/DDG4/src/Geant4FastSimShowerModel.cpp index 9aa4edf3e3df338de2ddb334533d664f6c9e5052..ee9d54d8b09ad3c9b526465020a02dcfbdaf502e 100644 --- a/DDG4/src/Geant4FastSimShowerModel.cpp +++ b/DDG4/src/Geant4FastSimShowerModel.cpp @@ -99,13 +99,13 @@ Geant4FastSimShowerModel::Geant4FastSimShowerModel(Geant4Context* ctxt, const st this->declareProperty("Emax", this->m_eMax); this->declareProperty("Ekill", this->m_eKill); this->declareProperty("Etrigger", this->m_eTriggerNames); - this->m_wrapper.reset(new Geant4ShowerModelWrapper(this)); + this->m_wrapper= new Geant4ShowerModelWrapper(this); } /// Default destructor Geant4FastSimShowerModel::~Geant4FastSimShowerModel() { detail::deletePtr(m_model); - m_wrapper.reset(); + detail::deletePtr(m_wrapper); } /// Access particle definition from string @@ -163,7 +163,7 @@ void Geant4FastSimShowerModel::addShowerModel(G4Region* region) { if ( m_model ) fastsimManager->AddFastSimulationModel(m_model); else if ( m_wrapper ) - fastsimManager->AddFastSimulationModel(m_wrapper.get()); + fastsimManager->AddFastSimulationModel(m_wrapper); else except("Geant4FastSimShowerModel::addShowerModel: Invalid shower model reference!"); }