diff --git a/Generators/EvgenProdTools/share/G4particle_whitelist_Mesons.txt b/Generators/EvgenProdTools/share/G4particle_whitelist_Mesons.txt new file mode 100644 index 0000000000000000000000000000000000000000..7c72028787fb345967753044cc04fd85e79026e2 --- /dev/null +++ b/Generators/EvgenProdTools/share/G4particle_whitelist_Mesons.txt @@ -0,0 +1,22 @@ +413 D_star(2010)+ 2010.26 (MeV/c) meson D 0 +-413 D_star(2010)- 2010.26 (MeV/c) meson D 0 +423 D_star(2007)0 2006.85 (MeV/c) meson D 0 +-423 anti_D_star(2007)0 2006.85 (MeV/c) meson D 0 +10421 D0_star(2300)0 2300 (MeV/c) meson D 0 +-10421 anti_D0_star(2300)0 2300 (MeV/c) meson D 0 +10423 D1(2420)0 2420.8 (MeV/c) meson D 0 +-10423 anti_D1(2420)0 2420.8 (MeV/c) meson D 0 +425 D2_star(2460)0 2460.7 (MeV/c) meson D 0 +-425 anti_D2_star(2460)0 2460.7 (MeV/c) meson D 0 +415 D2_star(2460)+ 2465.4 (MeV/c) meson D 0 +-415 D2_star(2460)- 2465.4 (MeV/c) meson D 0 +513 B_star0 5324.70 (MeV/c) meson B 0 +-513 anti_B_star0 5324.70 (MeV/c) meson B 0 +10523 B1(5721)+ 5725.9 (MeV/c) meson B 0 +-10523 B1(5721)- 5725.9 (MeV/c) meson B 0 +10513 B1(5721)0 5726.1 (MeV/c) meson B 0 +-10513 anti_B1(5721)0 5726.1 (MeV/c) meson B 0 +525 B2_star(5747)+ 5737.2 (MeV/c) meson B 0 +-525 B2_star(5747)- 5737.2 (MeV/c) meson B 0 +515 B2_star(5747)0 5739.5 (MeV/c) meson B 0 +-515 anti_B2_star(5747)0 5739.5 (MeV/c) meson B 0 diff --git a/Simulation/G4Atlas/G4AtlasApps/python/SimFlags.py b/Simulation/G4Atlas/G4AtlasApps/python/SimFlags.py index 947384f9959cdcbf4578223c7c848172772e35a2..05755b1ec4b1675616be15ba46b817e1364a3465 100644 --- a/Simulation/G4Atlas/G4AtlasApps/python/SimFlags.py +++ b/Simulation/G4Atlas/G4AtlasApps/python/SimFlags.py @@ -788,6 +788,12 @@ class TruthService(JobProperty): allowedTypes = ['str'] StoredValue = 'ISF_TruthService' +class ParticleSimWhiteList(JobProperty): + """Steering of ISF: set the ParticleSimWhiteList tool""" + statusOn = True + allowedTypes = ['str'] + StoredValue = 'ISF_ParticleSimWhiteList' + ## Definition and registration of the simulation flag container class SimFlags(JobPropertyContainer): diff --git a/Simulation/G4Extensions/Mesons/CMakeLists.txt b/Simulation/G4Extensions/Mesons/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..34d859f51c3b4bb66e3c74849e4cce92b8025fba --- /dev/null +++ b/Simulation/G4Extensions/Mesons/CMakeLists.txt @@ -0,0 +1,29 @@ +################################################################################ +# Package: Mesons +################################################################################ + +# Declare the package name: +atlas_subdir( Mesons ) + +# Declare the package's dependencies: +atlas_depends_on_subdirs( PUBLIC + GaudiKernel + PRIVATE + Control/AthenaBaseComps + Simulation/G4Atlas/G4AtlasInterfaces ) + +# External dependencies: +find_package( CLHEP ) +find_package( Geant4 ) +find_package( XercesC ) + +# Component(s) in the package: +atlas_add_component( Mesons + src/*.cxx + src/components/*.cxx + INCLUDE_DIRS ${GEANT4_INCLUDE_DIRS} ${XERCESC_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} + LINK_LIBRARIES ${GEANT4_LIBRARIES} ${XERCESC_LIBRARIES} ${CLHEP_LIBRARIES} GaudiKernel AthenaBaseComps G4AtlasInterfaces ) + +# Install files from the package: +atlas_install_python_modules( python/*.py ) + diff --git a/Simulation/G4Extensions/Mesons/python/MesonsConfig.py b/Simulation/G4Extensions/Mesons/python/MesonsConfig.py new file mode 100644 index 0000000000000000000000000000000000000000..55e04ef30b45967f3cee83eafc74229289ab654b --- /dev/null +++ b/Simulation/G4Extensions/Mesons/python/MesonsConfig.py @@ -0,0 +1,11 @@ +# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + +from AthenaCommon import CfgMgr +from Mesons.MesonsList import createMesonsList + +def getMesonsPhysicsTool(name="MesonsPhysicsTool", **kwargs): + kwargs.setdefault("OutputLevel", 1) + kwargs.setdefault("MesonsConfig", createMesonsList()) + + return CfgMgr.MesonsPhysicsTool(name, **kwargs) + diff --git a/Simulation/G4Extensions/Mesons/python/MesonsConfigDb.py b/Simulation/G4Extensions/Mesons/python/MesonsConfigDb.py new file mode 100644 index 0000000000000000000000000000000000000000..82a8975cc23128d213be8c08e62a4af5a24d61c0 --- /dev/null +++ b/Simulation/G4Extensions/Mesons/python/MesonsConfigDb.py @@ -0,0 +1,4 @@ +# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + +from AthenaCommon.CfgGetter import addTool +addTool("Mesons.MesonsConfig.getMesonsPhysicsTool" , "MesonsPhysicsTool" ) diff --git a/Simulation/G4Extensions/Mesons/python/MesonsList.py b/Simulation/G4Extensions/Mesons/python/MesonsList.py new file mode 100644 index 0000000000000000000000000000000000000000..55eddc1b9ada9a65f60c2e3116ff6b17aa7c441a --- /dev/null +++ b/Simulation/G4Extensions/Mesons/python/MesonsList.py @@ -0,0 +1,189 @@ +# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + +from AthenaCommon.SystemOfUnits import keV, MeV, ns + +""" +Pythong configuration file for additional mesons. + +The 'mesons' dictionary holds variables related to particles +and anti-particles are automatically created. + +Eventually everything is passed into a +std::map<std::string, std::vector<double>> m_mesonsConfig C++ +object where G4ParticleDefinition pointers get created. + +""" +mesons = {} + +## Additional D mesons +# source: +# http://pdg.lbl.gov/2019/tables/rpp2019-tab-mesons-charm.pdf +#______________________________________________________________ +mesons.update({ + 'D_star(2007)0' : { + 'mass' : 2006.85 * MeV, + 'width' : 2.1 * MeV, + 'charge' : 0, + 'spin' : 1, + 'parity' : -1, + 'PDG' : 423, + 'lifetime' : 3.13e-13 * ns, + }, + 'D_star(2010)+' : { + 'mass' : 2010.26 * MeV, + 'width' : 83.4 * keV, + 'charge' : 1, + 'spin' : 1, + 'parity' : -1, + 'PDG' : 413, + 'lifetime' : 7.892-12 * ns, + }, + 'D0_star(2300)0' : { + 'mass' : 2300 * MeV, + 'width' : 274 * MeV, + 'charge' : 0, + 'spin' : 0, + 'parity' : +1, + 'PDG' : 10421, + 'lifetime' : 2.402-15 * ns, + }, + 'D1(2420)0' : { + 'mass' : 2420.8 * MeV, + 'width' : 31.7 * MeV, + 'charge' : 0, + 'spin' : 1, + 'parity' : +1, + 'PDG' : 10423, + 'lifetime' : 2.076-14 * ns, + }, + 'D2_star(2460)0' : { + 'mass' : 2460.7 * MeV, + 'width' : 47.5 * MeV, + 'charge' : 0, + 'spin' : 2, + 'parity' : +1, + 'PDG' : 425, + 'lifetime' : 1.386-14 * ns, + }, + 'D2_star(2460)+' : { + 'mass' : 2465.4 * MeV, + 'width' : 46.7 * MeV, + 'charge' : 1, + 'spin' : 2, + 'parity' : +1, + 'PDG' : 415, + 'lifetime' : 1.409-14 * ns, + }, +}) + +## Additional B mesons +# source: +# http://pdg.lbl.gov/2019/tables/rpp2019-tab-mesons-bottom.pdf +#______________________________________________________________ +mesons.update({ + 'B_star0' : { + 'mass' : 5324.70 * MeV, + 'width' : 45 * MeV, + 'charge' : 0, + 'spin' : 1, + 'parity' : -1, + 'PDG' : 513, + 'lifetime' : 1.463-14 * ns, + }, + 'B1(5721)+' : { + 'mass' : 5725.9 * MeV, + 'width' : 31 * MeV, + 'charge' : 1, + 'spin' : 1, + 'parity' : +1, + 'PDG' : 10523, + 'lifetime' : 2.123e-14 * ns, + }, + 'B1(5721)0' : { + 'mass' : 5726.1 * MeV, + 'width' : 27.5 * MeV, + 'charge' : 0, + 'spin' : 1, + 'parity' : +1, + 'PDG' : 10513, + 'lifetime' : 2.393-14 * ns, + }, + 'B2_star(5747)+' : { + 'mass' : 5737.2 * MeV, + 'width' : 20 * MeV, + 'charge' : 1, + 'spin' : 2, + 'parity' : +1, + 'PDG' : 525, + 'lifetime' : 3.291-14 * ns, + }, + 'B2_star(5747)0' : { + 'mass' : 5739.5 * MeV, + 'width' : 24.2 * MeV, + 'charge' : 0, + 'spin' : 2, + 'parity' : +1, + 'PDG' : 515, + 'lifetime' : 2.72-14 * ns, + }, +}) + + +def createMesonsList(): + """ + Creates a compact object that holds configuration + for the MesonsPhysicsTool. + + Gaudi cannot parse* nested std::map objects, so the 'mesons' + dictionary is converted into a + + std::map< std::string, std::vector< double > > + + object and ordering of values therefore important--- + + Rows are: + name + mass [MeV] + width [MeV] + charge + 2*spin + parity + 2*isospin3 + PDG + lifetime [ns] + + *: see Gaudi/GaudiKernel/GaudiKernel/Parsers.h + """ + + mesonsList = {} + for meson in mesons: + mesonProperties = mesons[meson] + # meson + mesonsList[meson] = ( + mesonProperties['mass'], + mesonProperties['width'], + mesonProperties['charge'], + mesonProperties['spin'], + mesonProperties['parity'], + -1/2., + mesonProperties['PDG'], + mesonProperties['lifetime'], + ) + # anti-meson + antiName = "anti_" + meson + if meson[-1] == '+': + antiName = meson.replace('+', '-') + mesonsList[antiName] = ( + mesonProperties['mass'], + mesonProperties['width'], + -mesonProperties['charge'], + mesonProperties['spin'], + mesonProperties['parity'], + +1/2., + -mesonProperties['PDG'], + mesonProperties['lifetime'], + ) + return mesonsList + + + diff --git a/Simulation/G4Extensions/Mesons/src/CustomMeson.cxx b/Simulation/G4Extensions/Mesons/src/CustomMeson.cxx new file mode 100644 index 0000000000000000000000000000000000000000..de75981b4ed24100ecf709ccac9e6b807028643a --- /dev/null +++ b/Simulation/G4Extensions/Mesons/src/CustomMeson.cxx @@ -0,0 +1,29 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +#include "CustomMeson.hh" + +// ###################################################################### +// ### CustomMeson ### +// ###################################################################### + +CustomMeson::CustomMeson(const G4String &name, G4double mass, G4double width, + G4int charge, G4double spin, G4int parity, + G4int isospin3, G4int PDG, G4double lifetime, + const G4String &subType) + +// Arguments for constructor are as follows +// name mass width charge +// 2*spin parity C-conjugation +// 2*Isospin 2*Isospin3 G-parity +// type lepton number baryon number PDG encoding +// stable lifetime decay table +// shortlived subType anti_encoding + + : G4ParticleDefinition( name, mass, width, charge, + 2*spin, parity, 0, + 1, 2*isospin3, 0, + "meson", 0, 0, PDG, + false, lifetime, NULL, + false, subType) {} diff --git a/Simulation/G4Extensions/Mesons/src/CustomMeson.hh b/Simulation/G4Extensions/Mesons/src/CustomMeson.hh new file mode 100644 index 0000000000000000000000000000000000000000..93c6f042bcf6be15d85408f75457c9a81f25a474 --- /dev/null +++ b/Simulation/G4Extensions/Mesons/src/CustomMeson.hh @@ -0,0 +1,25 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef CustomMeson_h +#define CustomMeson_h 1 + +#include "G4ParticleDefinition.hh" +#include "globals.hh" + +// ###################################################################### +// ### CustomMeson ### +// ###################################################################### + +class CustomMeson : public G4ParticleDefinition { + + public: + CustomMeson(const G4String &name, G4double mass, G4double width, + G4int charge, G4double spin, G4int parity, G4int isospin3, + G4int PDG, G4double lifetime, const G4String &subType); + + virtual ~CustomMeson() {} +}; + +#endif diff --git a/Simulation/G4Extensions/Mesons/src/MesonsPhysicsTool.cxx b/Simulation/G4Extensions/Mesons/src/MesonsPhysicsTool.cxx new file mode 100644 index 0000000000000000000000000000000000000000..b9b314baa1bd72e0e0b6db6617973a5564f12737 --- /dev/null +++ b/Simulation/G4Extensions/Mesons/src/MesonsPhysicsTool.cxx @@ -0,0 +1,116 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +// Include files + +// local +#include "MesonsPhysicsTool.h" +#include "CustomMeson.hh" + +// Geant4 headers +#include "G4MuIonisation.hh" +#include "G4ProcessManager.hh" +#include "G4Transportation.hh" +#include "G4Version.hh" +#include "G4hIonisation.hh" +#include "G4hMultipleScattering.hh" + +// CLHEP headers +#include "CLHEP/Units/SystemOfUnits.h" + +//----------------------------------------------------------------------------- +// Implementation file for class : MesonsPhysicsTool +// +// 01-July-2019 : Miha Muskinja +//----------------------------------------------------------------------------- + +//============================================================================= +// Standard constructor, initializes variables +//============================================================================= +MesonsPhysicsTool::MesonsPhysicsTool(const std::string &type, + const std::string &name, + const IInterface *parent) + : base_class(type, name, parent) { + + declareProperty("MesonsConfig", m_mesonsConfig); +} + +//============================================================================= +// Destructor +//============================================================================= +MesonsPhysicsTool::~MesonsPhysicsTool() {} + +//============================================================================= +// Initialize +//============================================================================= +StatusCode MesonsPhysicsTool::initialize() { + ATH_MSG_DEBUG("initializing..."); + this->SetPhysicsName(this->name()); + return StatusCode::SUCCESS; +} + +//============================================================================= +// GetPhysicsOption +//============================================================================= +MesonsPhysicsTool *MesonsPhysicsTool::GetPhysicsOption() { return this; } + +//============================================================================= +// ConstructParticle +//============================================================================= +void MesonsPhysicsTool::ConstructParticle() { + ATH_MSG_DEBUG("ConstructParticle for the Mesons being run"); + + for (const auto& meson : m_mesonsConfig) { + /* Unpack the config: + values must be in the same order as in + the 'MesonsList.py' config file. + */ + G4String name = meson.first; + G4double mass = meson.second[0]; + G4double width = meson.second[1]; + G4int charge = meson.second[2]; + G4double spin = meson.second[3]; + G4int parity = meson.second[4]; + G4int isospin3 = meson.second[5]; + G4int PDG = meson.second[6]; + G4double lifetime = meson.second[7]; + G4String subType = "meson"; + if (name.find("D") == 0 || name.find("anti_D") == 0) + subType = "D"; + else if (name.find("B") == 0 || name.find("anti_B") == 0) + subType = "B"; + + // debug printout + ATH_MSG_DEBUG("Constructing meson " << name); + ATH_MSG_DEBUG(" mass: " << mass); + ATH_MSG_DEBUG(" width: " << width); + ATH_MSG_DEBUG(" charge: " << charge); + ATH_MSG_DEBUG(" spin: " << spin); + ATH_MSG_DEBUG(" parity: " << parity); + ATH_MSG_DEBUG(" isospin3: " << isospin3); + ATH_MSG_DEBUG(" PDG: " << PDG); + ATH_MSG_DEBUG(" lifetime: " << lifetime); + ATH_MSG_DEBUG(" subType: " << subType); + + // create the new meson + m_setOfMesons.insert(new CustomMeson(name, mass, width, charge, spin, + parity, isospin3, PDG, lifetime, + subType)); + } +} + +//============================================================================= +// ConstructProcess +//============================================================================= +void MesonsPhysicsTool::ConstructProcess() { + for (auto *meson : m_setOfMesons) { + if (meson->GetPDGCharge() != 0) { + ATH_MSG_DEBUG("Adding EM processes for " + << meson->GetParticleName()); + G4ProcessManager *proc = meson->GetProcessManager(); + proc->AddProcess(new G4hMultipleScattering, -1, 1, 1); + proc->AddProcess(new G4hIonisation, -1, 2, 2); + } + } +} diff --git a/Simulation/G4Extensions/Mesons/src/MesonsPhysicsTool.h b/Simulation/G4Extensions/Mesons/src/MesonsPhysicsTool.h new file mode 100644 index 0000000000000000000000000000000000000000..a0017dc0f2dac6582896a8b740aa5d1742409c94 --- /dev/null +++ b/Simulation/G4Extensions/Mesons/src/MesonsPhysicsTool.h @@ -0,0 +1,46 @@ +/* + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef MESONS_MESONSPHYSICSTOOL_H +#define MESONS_MESONSPHYSICSTOOL_H + +// Include files +#include "AthenaBaseComps/AthAlgTool.h" +#include "G4AtlasInterfaces/IPhysicsOptionTool.h" +#include "G4VPhysicsConstructor.hh" + +/** @class MesonsPhysicsTool MesonsPhysicsTool.h + * "G4AtlasInfrstructure/MesonsPhysicsTool.h" + * + * Tool for the concrete implementation of a Physics List selection class + * + * @author Miha Muskinja + * @date 01-July-2019 + */ +class MesonsPhysicsTool : public G4VPhysicsConstructor, + public extends<AthAlgTool, IPhysicsOptionTool> { + public: + /// Standard constructor + MesonsPhysicsTool(const std::string &type, const std::string &name, + const IInterface *parent); + + virtual ~MesonsPhysicsTool(); ///< Destructor + + /// Initialize method + virtual StatusCode initialize() override final; + virtual void ConstructParticle() override final; + virtual void ConstructProcess() override final; + + /** Implements */ + virtual MesonsPhysicsTool *GetPhysicsOption() override final; + + protected: + /// a set of parameters for Meson building + std::map<std::string, std::vector<double>> m_mesonsConfig; + + /// a set to hold the newly created mesons + std::set<G4ParticleDefinition *> m_setOfMesons; +}; + +#endif // MESONS_MESONSPHYSICSTOOL_H diff --git a/Simulation/G4Extensions/Mesons/src/components/Mesons_entries.cxx b/Simulation/G4Extensions/Mesons/src/components/Mesons_entries.cxx new file mode 100644 index 0000000000000000000000000000000000000000..63253ea4d9d96e522aabf18316c06902d2e29f99 --- /dev/null +++ b/Simulation/G4Extensions/Mesons/src/components/Mesons_entries.cxx @@ -0,0 +1,3 @@ +#include "../MesonsPhysicsTool.h" + +DECLARE_COMPONENT( MesonsPhysicsTool ) diff --git a/Simulation/ISF/ISF_Core/ISF_Services/python/ISF_ServicesConfig.py b/Simulation/ISF/ISF_Core/ISF_Services/python/ISF_ServicesConfig.py index af01d49c6cfbb9a8c5f9e03d11148288673306db..042c5e3930d3b108513128b4d6bad45b7710de1d 100644 --- a/Simulation/ISF/ISF_Core/ISF_Services/python/ISF_ServicesConfig.py +++ b/Simulation/ISF/ISF_Core/ISF_Services/python/ISF_ServicesConfig.py @@ -83,7 +83,8 @@ def getInputConverter(name="ISF_InputConverter", **kwargs): def getLongLivedInputConverter(name="ISF_LongLivedInputConverter", **kwargs): - kwargs.setdefault("GenParticleFilters" , [ 'ISF_ParticleSimWhiteList', + from G4AtlasApps.SimFlags import simFlags + kwargs.setdefault("GenParticleFilters" , [ simFlags.ParticleSimWhiteList.get_Value(), 'ISF_ParticlePositionFilterDynamic', 'ISF_EtaPhiFilter', 'ISF_GenParticleInteractingFilter', ] ) diff --git a/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/python/ISF_HepMC_ToolsConfig.py b/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/python/ISF_HepMC_ToolsConfig.py index 0bc48a4f18a00d44bcbbc2380c735e50d8d536b5..8a738ad2bdc62c3a638eb4742aed560d11f3de06 100644 --- a/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/python/ISF_HepMC_ToolsConfig.py +++ b/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/python/ISF_HepMC_ToolsConfig.py @@ -26,6 +26,11 @@ def getParticleSimWhiteList(name="ISF_ParticleSimWhiteList", **kwargs): # GenParticleSimWhiteList return CfgMgr.ISF__GenParticleSimWhiteList(name, **kwargs) +def getParticleSimWhiteList_LongLived(name="ISF_ParticleSimWhiteList_LongLived", **kwargs): + # GenParticleSimWhiteList_LongLived + kwargs.setdefault('WhiteLists' , ['G4particle_whitelist.txt', 'G4particle_whitelist_Mesons.txt'] ) + return CfgMgr.ISF__GenParticleSimWhiteList(name, **kwargs) + def getParticlePositionFilter(name="ISF_ParticlePositionFilter", **kwargs): # ParticlePositionFilter kwargs.setdefault('GeoIDService' , 'ISF_GeoIDSvc' ) diff --git a/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/python/ISF_HepMC_ToolsConfigDb.py b/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/python/ISF_HepMC_ToolsConfigDb.py index 11046ab3af78960747d68475019761a7961c3cc6..97ddb380fa3f042538097aaf041c0ab000a6ffb9 100644 --- a/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/python/ISF_HepMC_ToolsConfigDb.py +++ b/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/python/ISF_HepMC_ToolsConfigDb.py @@ -4,6 +4,7 @@ from AthenaCommon.CfgGetter import addTool ## GenParticle Filters addTool("ISF_HepMC_Tools.ISF_HepMC_ToolsConfig.getParticleFinalStateFilter", "ISF_ParticleFinalStateFilter") addTool("ISF_HepMC_Tools.ISF_HepMC_ToolsConfig.getParticleSimWhiteList", "ISF_ParticleSimWhiteList") +addTool("ISF_HepMC_Tools.ISF_HepMC_ToolsConfig.getParticleSimWhiteList_LongLived", "ISF_ParticleSimWhiteList_LongLived") addTool("ISF_HepMC_Tools.ISF_HepMC_ToolsConfig.getParticlePositionFilterID", "ISF_ParticlePositionFilterID") addTool("ISF_HepMC_Tools.ISF_HepMC_ToolsConfig.getParticlePositionFilterCalo", "ISF_ParticlePositionFilterCalo") addTool("ISF_HepMC_Tools.ISF_HepMC_ToolsConfig.getParticlePositionFilterMS", "ISF_ParticlePositionFilterMS") diff --git a/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/src/GenParticleSimWhiteList.cxx b/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/src/GenParticleSimWhiteList.cxx index b75e219631f7d2008d607a59b8da5157d2587928..c4f80f888c733f34d8a403d8856b1517fdc2939e 100644 --- a/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/src/GenParticleSimWhiteList.cxx +++ b/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/src/GenParticleSimWhiteList.cxx @@ -28,7 +28,7 @@ ISF::GenParticleSimWhiteList::GenParticleSimWhiteList( const std::string& t, : base_class(t,n,p) { // different options - declareProperty("WhiteList", m_whiteList="G4particle_whitelist.txt"); + declareProperty("WhiteLists", m_whiteLists={"G4particle_whitelist.txt"}); declareProperty("QuasiStableSim", m_qs=true); } @@ -40,27 +40,29 @@ StatusCode ISF::GenParticleSimWhiteList::initialize() // Initialize the list m_pdgId.clear(); - // Get the appropriate file handle - std::string resolvedFilename = PathResolver::find_file( m_whiteList , "DATAPATH" ); - std::ifstream white_list; - white_list.open( resolvedFilename ); - if (!white_list.is_open()){ - ATH_MSG_ERROR("Could not find white list " << m_whiteList); - return StatusCode::FAILURE; + for (auto &whiteList : m_whiteLists) { + // Get the appropriate file handle + std::string resolvedFilename = PathResolver::find_file( whiteList , "DATAPATH" ); + std::ifstream white_list; + white_list.open( resolvedFilename ); + if (!white_list.is_open()){ + ATH_MSG_ERROR("Could not find white list " << whiteList); + return StatusCode::FAILURE; + } + + // Parse the list into the vector + std::string a_line; + char * pEnd; + while (!white_list.eof()){ + getline( white_list , a_line ); + long int pdg = strtol( a_line.c_str() , &pEnd , 10 ); + m_pdgId.push_back(pdg); + } + + // Sort the list for use later + std::sort( m_pdgId.begin() , m_pdgId.end() ); } - // Parse the list into the vector - std::string a_line; - char * pEnd; - while (!white_list.eof()){ - getline( white_list , a_line ); - long int pdg = strtol( a_line.c_str() , &pEnd , 10 ); - m_pdgId.push_back(pdg); - } - - // Sort the list for use later - std::sort( m_pdgId.begin() , m_pdgId.end() ); - // All done! return StatusCode::SUCCESS; } diff --git a/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/src/GenParticleSimWhiteList.h b/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/src/GenParticleSimWhiteList.h index 2a5f8d257f274e7b12e7bc946db562e44d93d751..bcd25eebef1da8bf59e7b2571b9a84810a3919a0 100644 --- a/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/src/GenParticleSimWhiteList.h +++ b/Simulation/ISF/ISF_HepMC/ISF_HepMC_Tools/src/GenParticleSimWhiteList.h @@ -49,7 +49,7 @@ namespace ISF { private: /** returns true if the the particle and all daughters are on the white list */ bool pass(const HepMC::GenParticle& particle , std::vector<int> & used_vertices ) const; - std::string m_whiteList; //!< The location of the white list + std::vector<std::string> m_whiteLists; //!< The location of the white lists std::vector<long int> m_pdgId; //!< Allowed PDG IDs bool m_qs; //!< Switch for quasi-stable particle simulation }; diff --git a/Simulation/SimulationJobOptions/share/specialConfig/preInclude.Mesons.py b/Simulation/SimulationJobOptions/share/specialConfig/preInclude.Mesons.py new file mode 100644 index 0000000000000000000000000000000000000000..824b7ff3aa6b62abec06f45448b88ff0b37c9c5b --- /dev/null +++ b/Simulation/SimulationJobOptions/share/specialConfig/preInclude.Mesons.py @@ -0,0 +1,18 @@ +######################################################### +# +# SimulationJobOptions/preInclude.Mesons.py +# Miha Muskinja +# +# Adds extra mesons to the Geant4 particle list. Mesons +# are configured in Mesons.MesonsList module. +# +# +######################################################### + +## Add the physics tool for new mesons +simFlags.PhysicsOptions += ['MesonsPhysicsTool'] + +## Add the additional mesons to the white list +from G4AtlasApps.SimFlags import SimFlags +if hasattr(simFlags, 'ParticleSimWhiteList'): + SimFlags.ParticleSimWhiteList.set_Value_and_Lock('ISF_ParticleSimWhiteList_LongLived')