Commit 1b2a9595 authored by Simon Spannagel's avatar Simon Spannagel
Browse files

DepositionGeant4: check add. physics lists for upper-case and regular case name

(cherry picked from commit 72ca6777)
parent a63a64e8
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -27,12 +27,15 @@ namespace allpix::physicslists {
    /**
     * @brief Function to obtain
     * @param  list_name    Name of the additional physics list
     *
     * @note Name check is performed with provided case and upper-case list names
     *
     * @return              Pointer to the G4VModularPhysicsList of the found physics list, or a nullptr if not found.
     */
    inline G4VModularPhysicsList* getList(const std::string& list_name) {

#ifdef ALLPIX_PHYSICSLIST_MICROELEC
        if(list_name == "MICROELEC-SIONLY") {
        if(list_name == "MICROELEC-SIONLY" || allpix::transform(list_name, ::toupper) == "MICROELEC-SIONLY") {
            // Downcasting from a G4VUserPhysicsList* to a G4VModularPhysicsList
            return dynamic_cast<G4VModularPhysicsList*>(new MicroElecSiPhysics());
        }