src/modules/DepositionGeant4/AdditionalPhysicsLists.hpp
Handler for implementation of additional PhysicsLists included in AllPix2 but not in the G4PhysListFactory. More…
Namespaces
Name |
---|
allpix Helper class to hold support layers for a detector model. |
allpix::physicslists Handler namespace for implementing additional PhysicsLists included in AllPix2 but not in the G4PhysListFactory. |
Functions
Name | |
---|---|
G4VModularPhysicsList * | getList(const std::string & list_name) Function to obtain. |
Detailed Description
Handler for implementation of additional PhysicsLists included in AllPix2 but not in the G4PhysListFactory.
Copyright: Copyright (c) 2023-2024 CERN and the Allpix Squared authors. This software is distributed under the terms of the MIT License, copied verbatim in the file “LICENSE.md”. In applying this license, CERN does not waive the privileges and immunities granted to it by virtue of its status as an Intergovernmental Organization or submit itself to any jurisdiction. SPDX-License-Identifier: MIT
Functions Documentation
function getList
inline G4VModularPhysicsList * getList(
const std::string & list_name
)
Function to obtain.
Parameters:
- list_name Name of the additional physics list
Return: Pointer to the G4VModularPhysicsList of the found physics list, or a nullptr if not found.
Note: Name check is performed with provided case and upper-case list names
Source code
#ifndef ALLPIX_ADDITIONAL_PHYSICS_LISTS_H
#define ALLPIX_ADDITIONAL_PHYSICS_LISTS_H
#include "core/utils/text.h"
#include <G4VModularPhysicsList.hh>
#ifdef ALLPIX_PHYSICSLIST_MICROELEC
#include <MicroElecSiPhysics.hh>
#endif
namespace allpix::physicslists {
inline G4VModularPhysicsList* getList(const std::string& list_name) {
#ifdef ALLPIX_PHYSICSLIST_MICROELEC
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());
}
#endif
return nullptr;
}
} // namespace allpix::physicslists
#endif
Updated on 2024-12-13 at 08:31:37 +0000