diff --git a/CMakeLists.txt b/CMakeLists.txt index 6712e0b7ab5504c093d27661d9a37561df524fd9..53631c5c378d41d4cf94de4c2c2849c1b3cfe882 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,8 +5,8 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.5) set(GEANT4_SRCS_REPOSITORY https://gitlab.cern.ch/lhcb/Geant4-srcs.git CACHE STRING "Repository for Geant4 sources") find_package(GaudiProject) -gaudi_project(Geant4 v103r3 - DATA Geant4Files VERSION v103r1) +gaudi_project(Geant4 v104r1 + DATA Geant4Files VERSION v104r0) # FIXME: hack for compatibility with CMT build file(WRITE ${CMAKE_BINARY_DIR}/dummy.cpp "") diff --git a/Geant4/G4config/CMakeLists.txt b/Geant4/G4config/CMakeLists.txt index e108e841b1c2394457331f7c7ada6677cd56af8f..9ff4e7b1f4d080e7847d60e5922582a7d7a84562 100644 --- a/Geant4/G4config/CMakeLists.txt +++ b/Geant4/G4config/CMakeLists.txt @@ -30,7 +30,7 @@ if (NOT GEANT4_TAG) elseif(CMAKE_PROJECT_VERSION STREQUAL "HEAD") # Special mapping of version HEAD # WARNING this must be kept up to date manually - set(GEANT4_TAG "lhcb/v10.3.3-branch") + set(GEANT4_TAG "lhcb/v10.4.1-branch") else() set(GEANT4_TAG lhcb/${CMAKE_PROJECT_VERSION}) endif() diff --git a/LHCbG4PhysLists/LHCbG4PhysLists/G4EmStandardPhysics_option1NoApplyCuts.h b/LHCbG4PhysLists/LHCbG4PhysLists/G4EmStandardPhysics_option1NoApplyCuts.h index d46b7585c6069dadb8eb6e934b0e407432bb053f..49b79bb4bdb2b43c842d0079e31a91b63e2cb7ff 100644 --- a/LHCbG4PhysLists/LHCbG4PhysLists/G4EmStandardPhysics_option1NoApplyCuts.h +++ b/LHCbG4PhysLists/LHCbG4PhysLists/G4EmStandardPhysics_option1NoApplyCuts.h @@ -23,11 +23,11 @@ // * acceptance of all terms of the Geant4 Software license. * // ******************************************************************** // -// $Id$ +// $Id: G4EmStandardPhysics_option1.hh 98736 2016-08-09 10:55:12Z gcosmo $ // //--------------------------------------------------------------------------- // -// ClassName: G4EmStandardPhysics_option1NoApplyCuts +// ClassName: G4EmStandardPhysics_option1 // // Author: V.Ivanchenko 09.11.2005 // @@ -55,15 +55,12 @@ class G4EmStandardPhysics_option1NoApplyCuts : public G4VPhysicsConstructor { public: - G4EmStandardPhysics_option1NoApplyCuts(G4int ver = 1); - - // obsolete - G4EmStandardPhysics_option1NoApplyCuts(G4int ver, const G4String& name); + explicit G4EmStandardPhysics_option1NoApplyCuts(G4int ver=1, const G4String& name=""); virtual ~G4EmStandardPhysics_option1NoApplyCuts(); - void ConstructParticle() override; - void ConstructProcess() override; + virtual void ConstructParticle() override; + virtual void ConstructProcess() override; private: G4int verbose; diff --git a/LHCbG4PhysLists/src/G4EmStandardPhysics_option1NoApplyCuts.cc b/LHCbG4PhysLists/src/G4EmStandardPhysics_option1NoApplyCuts.cc index ed5bda86d6177c40e62aa50216343f27abbeedb3..f1862ccafb88b7732c953ada31379c20fd3d1099 100644 --- a/LHCbG4PhysLists/src/G4EmStandardPhysics_option1NoApplyCuts.cc +++ b/LHCbG4PhysLists/src/G4EmStandardPhysics_option1NoApplyCuts.cc @@ -23,11 +23,11 @@ // * acceptance of all terms of the Geant4 Software license. * // ******************************************************************** // -// $Id$ +// $Id: G4EmStandardPhysics_option1.cc 99938 2016-10-12 08:06:52Z gcosmo $ // //--------------------------------------------------------------------------- // -// ClassName: G4EmStandardPhysics_option1NoApplyCuts +// ClassName: G4EmStandardPhysics_option1 // // Author: V.Ivanchenko 09.11.2005 // @@ -51,7 +51,7 @@ #include "Geant4/G4SystemOfUnits.hh" #include "Geant4/G4ParticleDefinition.hh" #include "Geant4/G4LossTableManager.hh" -#include "Geant4/G4EmProcessOptions.hh" +#include "Geant4/G4EmParameters.hh" #include "Geant4/G4ComptonScattering.hh" #include "Geant4/G4GammaConversion.hh" @@ -102,9 +102,9 @@ #include "Geant4/G4Alpha.hh" #include "Geant4/G4GenericIon.hh" -#include "Geant4/G4VUserPhysicsList.hh" #include "Geant4/G4PhysicsListHelper.hh" #include "Geant4/G4BuilderType.hh" +#include "Geant4/G4EmModelActivator.hh" // factory #include "Geant4/G4PhysicsConstructorFactory.hh" @@ -113,20 +113,16 @@ G4_DECLARE_PHYSCONSTR_FACTORY(G4EmStandardPhysics_option1NoApplyCuts); //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -G4EmStandardPhysics_option1NoApplyCuts::G4EmStandardPhysics_option1NoApplyCuts(G4int ver) +G4EmStandardPhysics_option1NoApplyCuts::G4EmStandardPhysics_option1NoApplyCuts(G4int ver, + const G4String&) : G4VPhysicsConstructor("G4EmStandard_opt1"), verbose(ver) { - G4LossTableManager::Instance(); - SetPhysicsType(bElectromagnetic); - // std::cout<<"This is the v9.6 option 1 physics list with ApplyCuts option commented out"<<std::endl; -} - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -G4EmStandardPhysics_option1NoApplyCuts::G4EmStandardPhysics_option1NoApplyCuts(G4int ver, const G4String&) - : G4VPhysicsConstructor("G4EmStandard_opt1"), verbose(ver) -{ - G4LossTableManager::Instance(); + G4EmParameters* param = G4EmParameters::Instance(); + param->SetDefaults(); + param->SetVerbose(verbose); + param->SetApplyCuts(false); //LHCb Specific modification, don't apply prodcution cuts for specific processes + param->SetMscRangeFactor(0.2); + param->SetMscStepLimitType(fMinimal); SetPhysicsType(bElectromagnetic); } @@ -139,26 +135,26 @@ G4EmStandardPhysics_option1NoApplyCuts::~G4EmStandardPhysics_option1NoApplyCuts( void G4EmStandardPhysics_option1NoApplyCuts::ConstructParticle() { -// gamma + // gamma G4Gamma::Gamma(); -// leptons + // leptons G4Electron::Electron(); G4Positron::Positron(); G4MuonPlus::MuonPlus(); G4MuonMinus::MuonMinus(); -// mesons + // mesons G4PionPlus::PionPlusDefinition(); G4PionMinus::PionMinusDefinition(); G4KaonPlus::KaonPlusDefinition(); G4KaonMinus::KaonMinusDefinition(); -// barions + // barions G4Proton::Proton(); G4AntiProton::AntiProton(); -// ions + // ions G4Deuteron::Deuteron(); G4Triton::Triton(); G4He3::He3(); @@ -170,6 +166,9 @@ void G4EmStandardPhysics_option1NoApplyCuts::ConstructParticle() void G4EmStandardPhysics_option1NoApplyCuts::ConstructProcess() { + if(verbose > 1) { + G4cout << "### " << GetPhysicsName() << " Construct Processes " << G4endl; + } G4PhysicsListHelper* ph = G4PhysicsListHelper::GetPhysicsListHelper(); // muon & hadron bremsstrahlung and pair production @@ -185,26 +184,31 @@ void G4EmStandardPhysics_option1NoApplyCuts::ConstructProcess() // muon & hadron multiple scattering G4MuMultipleScattering* mumsc = new G4MuMultipleScattering(); mumsc->AddEmModel(0, new G4WentzelVIModel()); + G4CoulombScattering* muss = new G4CoulombScattering(); + G4MuMultipleScattering* pimsc = new G4MuMultipleScattering(); pimsc->AddEmModel(0, new G4WentzelVIModel()); + G4CoulombScattering* piss = new G4CoulombScattering(); + G4MuMultipleScattering* kmsc = new G4MuMultipleScattering(); kmsc->AddEmModel(0, new G4WentzelVIModel()); + G4CoulombScattering* kss = new G4CoulombScattering(); + G4MuMultipleScattering* pmsc = new G4MuMultipleScattering(); pmsc->AddEmModel(0, new G4WentzelVIModel()); + G4CoulombScattering* pss = new G4CoulombScattering(); + G4hMultipleScattering* hmsc = new G4hMultipleScattering("ionmsc"); // high energy limit for e+- scattering models and bremsstrahlung G4double highEnergyLimit = 100*MeV; // Add standard EM Processes - auto particleIterator = GetParticleIterator(); - particleIterator->reset(); - while( (*particleIterator)() ){ - G4ParticleDefinition* particle = particleIterator->value(); + auto myParticleIterator=GetParticleIterator(); + myParticleIterator->reset(); + while( (*myParticleIterator)() ){ + G4ParticleDefinition* particle = myParticleIterator->value(); G4String particleName = particle->GetParticleName(); - if(verbose > 1) - G4cout << "### " << GetPhysicsName() << " instantiates for " - << particleName << G4endl; if (particleName == "gamma") { @@ -218,9 +222,9 @@ void G4EmStandardPhysics_option1NoApplyCuts::ConstructProcess() eioni->SetStepFunction(0.8, 1.0*mm); G4eMultipleScattering* msc = new G4eMultipleScattering; - msc->SetStepLimitType(fMinimal); G4UrbanMscModel* msc1 = new G4UrbanMscModel(); G4WentzelVIModel* msc2 = new G4WentzelVIModel(); + msc1->SetLateralDisplasmentFlag(false); msc1->SetHighEnergyLimit(highEnergyLimit); msc2->SetLowEnergyLimit(highEnergyLimit); msc->AddEmModel(0, msc1); @@ -244,9 +248,9 @@ void G4EmStandardPhysics_option1NoApplyCuts::ConstructProcess() eioni->SetStepFunction(0.8, 1.0*mm); G4eMultipleScattering* msc = new G4eMultipleScattering; - msc->SetStepLimitType(fMinimal); G4UrbanMscModel* msc1 = new G4UrbanMscModel(); G4WentzelVIModel* msc2 = new G4WentzelVIModel(); + msc1->SetLateralDisplasmentFlag(false); msc1->SetHighEnergyLimit(highEnergyLimit); msc2->SetLowEnergyLimit(highEnergyLimit); msc->AddEmModel(0, msc1); @@ -272,7 +276,7 @@ void G4EmStandardPhysics_option1NoApplyCuts::ConstructProcess() ph->RegisterProcess(new G4MuIonisation(), particle); ph->RegisterProcess(mub, particle); ph->RegisterProcess(mup, particle); - ph->RegisterProcess(new G4CoulombScattering(), particle); + ph->RegisterProcess(muss, particle); } else if (particleName == "alpha" || particleName == "He3" ) { @@ -294,6 +298,7 @@ void G4EmStandardPhysics_option1NoApplyCuts::ConstructProcess() ph->RegisterProcess(new G4hIonisation(), particle); ph->RegisterProcess(pib, particle); ph->RegisterProcess(pip, particle); + ph->RegisterProcess(piss, particle); } else if (particleName == "kaon+" || particleName == "kaon-" ) { @@ -303,6 +308,7 @@ void G4EmStandardPhysics_option1NoApplyCuts::ConstructProcess() ph->RegisterProcess(new G4hIonisation(), particle); ph->RegisterProcess(kb, particle); ph->RegisterProcess(kp, particle); + ph->RegisterProcess(kss, particle); // } else if (particleName == "proton" ) { } else if (particleName == "proton" || @@ -313,6 +319,7 @@ void G4EmStandardPhysics_option1NoApplyCuts::ConstructProcess() ph->RegisterProcess(new G4hIonisation(), particle); ph->RegisterProcess(pb, particle); ph->RegisterProcess(pp, particle); + ph->RegisterProcess(pss, particle); } else if (particleName == "B+" || particleName == "B-" || @@ -349,15 +356,13 @@ void G4EmStandardPhysics_option1NoApplyCuts::ConstructProcess() ph->RegisterProcess(new G4hIonisation(), particle); } } - G4EmProcessOptions opt; - opt.SetVerbose(verbose); - opt.SetPolarAngleLimit(CLHEP::pi); - //opt.SetApplyCuts(true); // Deexcitation // G4VAtomDeexcitation* de = new G4UAtomicDeexcitation(); G4LossTableManager::Instance()->SetAtomDeexcitation(de); + + G4EmModelActivator mact(GetPhysicsName()); } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... diff --git a/LHCbG4Tests/G4GammaToDiLeptonConversionTest/CMakeLists.txt b/LHCbG4Tests/G4GammaToDiLeptonConversionTest/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..7d1167e0608e03bddd9dc7f8877d579c6449062c --- /dev/null +++ b/LHCbG4Tests/G4GammaToDiLeptonConversionTest/CMakeLists.txt @@ -0,0 +1,33 @@ +gaudi_subdir(G4GammaToDiLeptonConversionTest v1r0) + +gaudi_depends_on_subdirs(Geant4/G4config) +gaudi_depends_on_subdirs(LHCbG4PhysLists) + +find_package(CLHEP REQUIRED) + +include_directories(SYSTEM ${CMAKE_INSTALL_PREFIX}/include ${CLHEP_INCLUDE_DIRS}) +link_directories(${CMAKE_INSTALL_PREFIX}/lib) + +set(Geant4_LIBRARIES + -lG4analysis + -lG4physicslists + -lG4intercoms + -lG4global + -lG4run + -lG4tracking + -lG4track + -lG4event + -lG4processes + -lG4particles + -lG4geometry + -lG4materials + -lG4graphics_reps) + +gaudi_add_executable(G4GammaToDiLeptonConversionTest + G4GammaToDiLeptonConversionTest.cc src/*.cc + INCLUDE_DIRS include CLHEP + LINK_LIBRARIES ${Geant4_LIBRARIES} CLHEP) + +add_dependencies(G4GammaToDiLeptonConversionTest Geant4) + +gaudi_install_scripts() diff --git a/LHCbG4Tests/G4GammaToDiLeptonConversionTest/G4GammaToDiLeptonConversionTest.cc b/LHCbG4Tests/G4GammaToDiLeptonConversionTest/G4GammaToDiLeptonConversionTest.cc new file mode 100644 index 0000000000000000000000000000000000000000..6c998cace94191abe9d948514b4c5a6420815f01 --- /dev/null +++ b/LHCbG4Tests/G4GammaToDiLeptonConversionTest/G4GammaToDiLeptonConversionTest.cc @@ -0,0 +1,157 @@ +// BASED ON TESTEM6 BY THE GEANT4 COLLABORATION +// +// ******************************************************************** +// * License and Disclaimer * +// * * +// * The Geant4 software is copyright of the Copyright Holders of * +// * the Geant4 Collaboration. It is provided under the terms and * +// * conditions of the Geant4 Software License, included in the file * +// * LICENSE and available at http://cern.ch/geant4/license . These * +// * include a list of copyright holders. * +// * * +// * Neither the authors of this software system, nor their employing * +// * institutes,nor the agencies providing financial support for this * +// * work make any representation or warranty, express or implied, * +// * regarding this software system or assume any liability for its * +// * use. Please see the license in the file LICENSE and URL above * +// * for the full disclaimer and the limitation of liability. * +// * * +// * This code implementation is the result of the scientific and * +// * technical work of the GEANT4 collaboration. * +// * By using, copying, modifying or distributing the software (or * +// * any work based on the software) you agree to acknowledge its * +// * use in resulting scientific publications, and indicate your * +// * acceptance of all terms of the Geant4 Software license. * +// ******************************************************************** +// +/// \file electromagnetic/TestEm6/TestEm6.cc +/// \brief Main program of the electromagnetic/TestEm6 example +// +// $Id: TestEm6.cc 83428 2014-08-21 15:46:01Z gcosmo $ +// +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +#include "Geant4/G4RunManager.hh" +#include "Geant4/G4UImanager.hh" +#include "Geant4/Randomize.hh" +#include "Geant4/G4GammaConversionToMuons.hh" +#include "Geant4/G4ProcessTable.hh" + +#include "DetectorConstruction.hh" +#include "PrimaryGeneratorAction.hh" +#include "SteppingVerbose.hh" + +#include "PhysicsList.hh" + +#include "RunAction.hh" +#include "SteppingAction.hh" +#include "StackingAction.hh" + +#ifdef G4VIS_USE + #include "G4VisExecutive.hh" +#endif + +#ifdef G4UI_USE +#include "G4UIExecutive.hh" +#endif + +G4double energy = 1000; //in GeV + +G4int nEvts = 100; + +G4double thickness = 0.3; //in mm + +G4String dimu_xsec_fac = "1000"; + +G4String output_dir = "."; + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + + +int main(int argc,char** argv) { + + for(int i{0}; i<argc; ++i) + { + if(G4String(argv[i]) == "--nevts") + { + ++i; + nEvts = G4int(atoi(argv[i])); + ++i; + } + if(G4String(argv[i]) == "--energy") + { + ++i; + energy = G4double(atof(argv[i])); + ++i; + } + + if(G4String(argv[i]) == "--thickness") + { + ++i; + thickness = G4double(atof(argv[i])); + ++i; + } + if(G4String(argv[i]) == "--scale") + { + ++i; + dimu_xsec_fac = G4String(argv[i]); + ++i; + } + + if(G4String(argv[i]) == "--outputdir") + { + ++i; + output_dir = G4String(argv[i]); + ++i; + } + + } + + //choose the Random engine + CLHEP::HepRandom::setTheEngine(new CLHEP::RanecuEngine); + + //my Verbose output class + G4VSteppingVerbose::SetInstance(new SteppingVerbose); + + //Construct the default run manager + G4RunManager * runManager = new G4RunManager; + + //Set Physics List + runManager->SetUserInitialization(new PhysicsList); + + //set mandatory initialization classes + DetectorConstruction* det; + runManager->SetUserInitialization(det = new DetectorConstruction(thickness)); + runManager->SetUserAction(new PrimaryGeneratorAction(det, energy, nEvts)); + + //set user action classes + RunAction* RunAct; + + runManager->SetUserAction(RunAct = new RunAction(det, energy, thickness, nEvts, output_dir)); + runManager->SetUserAction(new SteppingAction(RunAct)); + runManager->SetUserAction(new StackingAction); + + //get the pointer to the User Interface manager + G4UImanager* UI = G4UImanager::GetUIpointer(); + + + // Initialize Run Manager + + UI->ApplyCommand("/run/initialize"); + + + // Increase Gamma2MuMu XSec to 1000x + + UI->ApplyCommand("/testem/phys/SetGammaToMuPairFac "+dimu_xsec_fac); + + //Start Simulation + UI->ApplyCommand("/run/beamOn"); + + //job termination + delete runManager; + + return 0; +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... diff --git a/LHCbG4Tests/G4GammaToDiLeptonConversionTest/GNUmakefile b/LHCbG4Tests/G4GammaToDiLeptonConversionTest/GNUmakefile new file mode 100644 index 0000000000000000000000000000000000000000..d1454ad82625ede20993497102b6dbe0d9ad7284 --- /dev/null +++ b/LHCbG4Tests/G4GammaToDiLeptonConversionTest/GNUmakefile @@ -0,0 +1,27 @@ +# $Id: GNUmakefile 66241 2012-12-13 18:34:42Z gunter $ +# -------------------------------------------------------------- +# GNUmakefile for examples module. Gabriele Cosmo, 06/04/98. +# -------------------------------------------------------------- + +name := TestEm6 +G4TARGET := $(name) +G4EXLIB := true + +ifndef G4INSTALL + G4INSTALL = ../../../.. +endif + +.PHONY: all +all: lib bin + +include $(G4INSTALL)/config/architecture.gmk + +include $(G4INSTALL)/config/binmake.gmk + +histclean: + rm -f $(G4WORKDIR)/tmp/$(G4SYSTEM)/$(G4TARGET)/RunAction.o + rm -f $(G4WORKDIR)/tmp/$(G4SYSTEM)/$(G4TARGET)/SteppingAction.o + +visclean: + rm -f g4*.prim g4*.eps g4*.wrl + rm -f .DAWN_* diff --git a/LHCbG4Tests/G4GammaToDiLeptonConversionTest/History b/LHCbG4Tests/G4GammaToDiLeptonConversionTest/History new file mode 100644 index 0000000000000000000000000000000000000000..d3e72dda2cb7949867808f59f65abe397365f4ed --- /dev/null +++ b/LHCbG4Tests/G4GammaToDiLeptonConversionTest/History @@ -0,0 +1,193 @@ +$Id: History 100285 2016-10-17 08:42:54Z gcosmo $ +------------------------------------------------------------------- + + ========================================================= + Geant4 - an Object-Oriented Toolkit for Simulation in HEP + ========================================================= + + TestEm6 History file + -------------------- +This file should be used by the G4 example coordinator to briefly +summarize all major modifications introduced in the code and keep +track of all tags. + + ---------------------------------------------------------- + * Reverse chronological order (last date on top), please * + ---------------------------------------------------------- + +14-10-16 G.Folger (testem6-V10-02-02) +- remove direct use of theParticleIterator, use GetParticleTableIterator(). + fix required by clang39 on Linux and MAC + +04-07-16 I. Hrivnacova (testem6-V10-02-01) +- Fixes for Doxygen documentation + +10-12-15 V.Ivant (testem6-V10-02-00) +- H.Burkhardt fixed root macro allowing to work both with root5 and 6 + +28-10-15 D.Sawkey (testem6-V10-01-00) +- update physics description in READMEs +- add more standard EM physics builders + +30-07-14 V.Ivant (testem6-V10-00-02) +- Naruhiro Chikuma have updated PhysicsList, DetectorConstruction, + and RunAction; bug fix + +03-07-14 mma (testem6-V10-00-01) +- replace /testem/event/printModulo by /run/printProgress + +08-06-14 mma (testem6-V10-00-00) +- suppress EventAction and its messenger + +18-09-13 V.Ivant (testem6-V09-06-04) +- fixed tag format + +17-09-13 V.Ivant (testem6-V09-05-04) +- TestEm6.in - added cross section factor to gamma->mu+mu- process + +05-09-13 mma (testem6-V09-06-03) +- PhysicsList: restore G4GammaConversionToMuons + +19-06-13 mma (testem6-V09-06-02) +- SteppingVerbose: use G4Step::GetSecondaryInCurrentStep() + +07-06-13 mma (testem6-V09-06-01) +- Cosmetic in SteppingAction. + +13-02-13 I.Hrivnacova (testem6-V09-06-00) +- Applied coding guidelines (virtual keyword, data members initialization) + +12-10-12 V.Ivant (testem6-V09-05-03) +- Migration to the updated analysis tool and inplicit units + +11-10-12 mma (testem6-V09-05-02) +- coding conventions: virtual + +06-04-12 mma (testem6-V09-05-01) +- all classes : apply G4 coding conventions + +11-03-12 mma (testem6-V09-05-00) +- RunAction.hh and .cc : migrate to new g4tools histogramming system + Do not need aida anymore, nor G4ANALYSIS_USE + +08-11-11 mma (testem6-V09-04-00) +- modify SteppingVerbose for OutOfWorld + +09-11-10 I.Hrivnacova (testem6-V09-03-05) +- Fixed compilation error on gcc-4.5.1. + +09-11-10 M.Asai (testem6-V09-03-04) +- Fix AIDA file option. + +06-06-10 J.Perl (testem6-V09-03-03) +- Remove unused variable in EventAction + +03-06-10 J.Perl (testem6-V09-03-02) +- Updated vis usage + +21-05-10 mma (testem6-V09-03-01) +- TestEm6.cc : introduction of G4UIExecutive + +31-03-10 V.Ivant (testem6-V09-03-00) +- Remove obsolete MSC from comments line + +27-11-09 V.Ivant (testem6-V09-02-01) +- H.Burkhardt add StackingAction allowing remove secondary particles; + cleanup PhysicsList for 9.3. + +13-05-09 V.Ivant (testem6-V09-02-00) +- Increased upper limit of energy in the tables to 1000 TeV + +18-09-08 mma (testem6-V09-01-02) +- RunAction : change default histogram format (root) + +12-06-08 mma (testem6-V09-01-01) +- Remove AIDA from GNUmakefile + +06-05-08 mma (testem6-V09-01-00) +- README : update Aida informations + +20-10-06 mma (testem6-V08-01-00) +- GNUmakefile : LOADLIBS + +24-05-06 mma (testem6-V08-00-01) +- register G4StepLimiter in PhysicsList + +16-02-06 mma (testem6-V08-00-00) +- add command /testem/phys/SetAnnihiToHadronFac + +06-12-05 Gabriele Cosmo +- Trivial changes for support of CLHEP-2.0.X series. + +29-11-05 V.Ivant (testem6-V07-01-02) +- Add GenericIon to the PhysicsList + +23-11-05 V.Ivant (testem6-V07-01-01) +- extend test to mu+mu- and pi+pi- pair creation processes and G4hhIonisation + in order to test all processes of the subdirectory + +22-11-05 mma (testem6-V07-01-00) +- update README for OpenScientist + +01-06-05 mma (testem6-V07-00-01) +- RunAction : option "noErrors" for hbook files; + +3rd May 2005 John Allison (examples-V07-00-03) +- Replaced vis manager with G4VisExecutive. + +02-03-05 mma (testem6-V07-00-00) +- RunAction : put a protection for the creation of analysis factory; + +02 Dec 04: V.Ivant (testem6-V06-02-01) +- Migration to cmath + +27-09-04 mma (testem6-V06-02-00) +- define correctly all UI subdirectories. +- modifs in RunAction for hbook,root,XML (Jaida) + +31-03-04 mma (testem6-V06-01-00) +- remove direct interface with root + +15-03-04 mma (testem6-V06-00-00) +- example of histograms with ROOT: USE_ROOT + +25-11-03 V.Ivanchenko (testem6-V05-02-02) +- Fix geometry (G.Cosmo) + +13-11-03 John Allison +- Removed OPACS from Vis Manager. + +24-10-03 mma (testem6-V05-02-01) +- PhysListEmStandard: AddProcess(Bremsstrahlung,-1,3,3) ..etc.. + +10-10-03 mma (testem6-V05-02-00) + - NOHIST replaced by ANALYSIS_USE + - cosmetic in material definitions + - SetMaterial() in constructor. all macros updated for /run/initialize + +10-06-03 mma (testem6-V05-01-00) + - proper deletion of old geometry in case of update + - fixe compilation warning + +01-04-03 mma (testem6-V05-00-02) + - PVPlacement in logical mother even for the world + +20-02-03 V.Ivant (testem6-V05-00-01) + - Migration to cut per region + +12-02-03 mma (testem6-V05-00-00) + - DetectorConstruction: change volume name + +30-01-03 hbu + - PhysicsList: implementation of (e+,e-) annihilation to (mu+,mu-) + - macros run11.mac and run12.mac + +12-12-02 mma (testem6-V04-01-00) + - migration to aida 3.0 + - UI directory /testem/ + +05-06-02 mma (testem6-V04-00-01) + - old histograming package clhep/hist replaced by AIDA 2.2/anaphe + +23-05-02 mma (testem6-V04-00-00) + - creation diff --git a/LHCbG4Tests/G4GammaToDiLeptonConversionTest/include/DetectorConstruction.hh b/LHCbG4Tests/G4GammaToDiLeptonConversionTest/include/DetectorConstruction.hh new file mode 100644 index 0000000000000000000000000000000000000000..e44ff46a29ed7c2e42cd1d22b164fefcea06a863 --- /dev/null +++ b/LHCbG4Tests/G4GammaToDiLeptonConversionTest/include/DetectorConstruction.hh @@ -0,0 +1,101 @@ +// +// ******************************************************************** +// * License and Disclaimer * +// * * +// * The Geant4 software is copyright of the Copyright Holders of * +// * the Geant4 Collaboration. It is provided under the terms and * +// * conditions of the Geant4 Software License, included in the file * +// * LICENSE and available at http://cern.ch/geant4/license . These * +// * include a list of copyright holders. * +// * * +// * Neither the authors of this software system, nor their employing * +// * institutes,nor the agencies providing financial support for this * +// * work make any representation or warranty, express or implied, * +// * regarding this software system or assume any liability for its * +// * use. Please see the license in the file LICENSE and URL above * +// * for the full disclaimer and the limitation of liability. * +// * * +// * This code implementation is the result of the scientific and * +// * technical work of the GEANT4 collaboration. * +// * By using, copying, modifying or distributing the software (or * +// * any work based on the software) you agree to acknowledge its * +// * use in resulting scientific publications, and indicate your * +// * acceptance of all terms of the Geant4 Software license. * +// ******************************************************************** +// +/// \file electromagnetic/TestEm6/include/DetectorConstruction.hh +/// \brief Definition of the DetectorConstruction class +// +// $Id: DetectorConstruction.hh 83428 2014-08-21 15:46:01Z gcosmo $ +// +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +#ifndef DetectorConstruction_h +#define DetectorConstruction_h 1 + +#include "Geant4/G4VUserDetectorConstruction.hh" +#include "Geant4/globals.hh" + +class G4LogicalVolume; +class G4Material; +class G4UniformMagField; +class G4UserLimits; +class DetectorMessenger; + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +class DetectorConstruction : public G4VUserDetectorConstruction +{ + public: + + DetectorConstruction(G4float); + ~DetectorConstruction(); + + public: + + G4VPhysicalVolume* Construct() override; + + void SetBoxDepth (G4double); + void SetSizeXY (G4double); + void SetMaterial (const G4String&); + void SetMagField (G4double); + void SetMaxStepSize (G4double); + + void UpdateGeometry(); + + public: + + const + G4VPhysicalVolume* GetWorld() {return fP_Box;}; + + G4double GetXYSize() {return fBoxXY;}; + G4double GetBoxDepth() {return fBoxDepth;}; + G4Material* GetMaterial() {return fMaterial;}; + + void PrintParameters(); + + private: + + G4VPhysicalVolume* fP_Box; + G4LogicalVolume* fL_Box; + + G4double fBoxXY; + G4double fBoxDepth; + G4Material* fMaterial; + G4UniformMagField* fMagField; + G4UserLimits* fUserLimits; + + DetectorMessenger* fDetectorMessenger; + + private: + + void DefineMaterials(); + G4VPhysicalVolume* ConstructVolumes(); +}; + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + + +#endif + diff --git a/LHCbG4Tests/G4GammaToDiLeptonConversionTest/include/DetectorMessenger.hh b/LHCbG4Tests/G4GammaToDiLeptonConversionTest/include/DetectorMessenger.hh new file mode 100644 index 0000000000000000000000000000000000000000..7bc1a6c4b976d4082f51f7a66af3d955ee22e73c --- /dev/null +++ b/LHCbG4Tests/G4GammaToDiLeptonConversionTest/include/DetectorMessenger.hh @@ -0,0 +1,73 @@ +// +// ******************************************************************** +// * License and Disclaimer * +// * * +// * The Geant4 software is copyright of the Copyright Holders of * +// * the Geant4 Collaboration. It is provided under the terms and * +// * conditions of the Geant4 Software License, included in the file * +// * LICENSE and available at http://cern.ch/geant4/license . These * +// * include a list of copyright holders. * +// * * +// * Neither the authors of this software system, nor their employing * +// * institutes,nor the agencies providing financial support for this * +// * work make any representation or warranty, express or implied, * +// * regarding this software system or assume any liability for its * +// * use. Please see the license in the file LICENSE and URL above * +// * for the full disclaimer and the limitation of liability. * +// * * +// * This code implementation is the result of the scientific and * +// * technical work of the GEANT4 collaboration. * +// * By using, copying, modifying or distributing the software (or * +// * any work based on the software) you agree to acknowledge its * +// * use in resulting scientific publications, and indicate your * +// * acceptance of all terms of the Geant4 Software license. * +// ******************************************************************** +// +/// \file electromagnetic/TestEm6/include/DetectorMessenger.hh +/// \brief Definition of the DetectorMessenger class +// +// $Id: DetectorMessenger.hh 66241 2012-12-13 18:34:42Z gunter $ +// +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +#ifndef DetectorMessenger_h +#define DetectorMessenger_h 1 + +#include "Geant4/globals.hh" +#include "Geant4/G4UImessenger.hh" + +class DetectorConstruction; +class G4UIdirectory; +class G4UIcmdWithAString; +class G4UIcmdWithADoubleAndUnit; +class G4UIcmdWithoutParameter; + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +class DetectorMessenger: public G4UImessenger +{ + public: + + DetectorMessenger(DetectorConstruction* ); + ~DetectorMessenger(); + + void SetNewValue(G4UIcommand*, G4String) override; + + private: + + DetectorConstruction* fDetector; + + G4UIdirectory* fTestemDir; + G4UIdirectory* fDetDir; + G4UIcmdWithAString* fMaterCmd; + G4UIcmdWithADoubleAndUnit* fSizeCmd; + G4UIcmdWithADoubleAndUnit* fMagFieldCmd; + G4UIcmdWithADoubleAndUnit* fMaxStepCmd; + G4UIcmdWithoutParameter* fUpdateCmd; +}; + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +#endif + diff --git a/LHCbG4Tests/G4GammaToDiLeptonConversionTest/include/PhysicsList.hh b/LHCbG4Tests/G4GammaToDiLeptonConversionTest/include/PhysicsList.hh new file mode 100644 index 0000000000000000000000000000000000000000..7520d00207ee70ff2635602c0343df98a00e1864 --- /dev/null +++ b/LHCbG4Tests/G4GammaToDiLeptonConversionTest/include/PhysicsList.hh @@ -0,0 +1,88 @@ +// +// ******************************************************************** +// * License and Disclaimer * +// * * +// * The Geant4 software is copyright of the Copyright Holders of * +// * the Geant4 Collaboration. It is provided under the terms and * +// * conditions of the Geant4 Software License, included in the file * +// * LICENSE and available at http://cern.ch/geant4/license . These * +// * include a list of copyright holders. * +// * * +// * Neither the authors of this software system, nor their employing * +// * institutes,nor the agencies providing financial support for this * +// * work make any representation or warranty, express or implied, * +// * regarding this software system or assume any liability for its * +// * use. Please see the license in the file LICENSE and URL above * +// * for the full disclaimer and the limitation of liability. * +// * * +// * This code implementation is the result of the scientific and * +// * technical work of the GEANT4 collaboration. * +// * By using, copying, modifying or distributing the software (or * +// * any work based on the software) you agree to acknowledge its * +// * use in resulting scientific publications, and indicate your * +// * acceptance of all terms of the Geant4 Software license. * +// ******************************************************************** +// +/// \file electromagnetic/TestEm6/include/PhysicsList.hh +/// \brief Definition of the PhysicsList class +// +// $Id: PhysicsList.hh 83428 2014-08-21 15:46:01Z gcosmo $ +// +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +#ifndef PhysicsList_h +#define PhysicsList_h 1 + +#include "Geant4/G4VModularPhysicsList.hh" +#include "Geant4/globals.hh" +#include "Geant4/G4EmConfigurator.hh" + + +class G4VPhysicsConstructor; +class StepMax; +class PhysicsListMessenger; +class G4GammaConversionToMuons; +class G4GammaConversion; +class G4AnnihiToMuPair; +class G4eeToHadrons; + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +class PhysicsList: public G4VModularPhysicsList +{ + public: + PhysicsList(); + virtual ~PhysicsList(); + + // Construct particles + void ConstructParticle() override; + void ConstructProcess() override; + + void AddPhysicsList(const G4String& name); + void ConstructHighEnergy(); + + void AddStepMax(); + + // Construct processes and register them + + void SetGammaToMuPairFac(G4double); + void SetAnnihiToMuPairFac(G4double); + void SetAnnihiToHadronFac(G4double); + + private: + + G4VPhysicsConstructor* fEmPhysicsList; + G4VPhysicsConstructor* fDecayPhysicsList; + G4String fEmName; + + StepMax* fStepMaxProcess; + + PhysicsListMessenger* fMes; + +}; + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +#endif + diff --git a/LHCbG4Tests/G4GammaToDiLeptonConversionTest/include/PhysicsListMessenger.hh b/LHCbG4Tests/G4GammaToDiLeptonConversionTest/include/PhysicsListMessenger.hh new file mode 100644 index 0000000000000000000000000000000000000000..473e0fbd589b27e6f88778b2fa23e51ab96282df --- /dev/null +++ b/LHCbG4Tests/G4GammaToDiLeptonConversionTest/include/PhysicsListMessenger.hh @@ -0,0 +1,72 @@ +// +// ******************************************************************** +// * License and Disclaimer * +// * * +// * The Geant4 software is copyright of the Copyright Holders of * +// * the Geant4 Collaboration. It is provided under the terms and * +// * conditions of the Geant4 Software License, included in the file * +// * LICENSE and available at http://cern.ch/geant4/license . These * +// * include a list of copyright holders. * +// * * +// * Neither the authors of this software system, nor their employing * +// * institutes,nor the agencies providing financial support for this * +// * work make any representation or warranty, express or implied, * +// * regarding this software system or assume any liability for its * +// * use. Please see the license in the file LICENSE and URL above * +// * for the full disclaimer and the limitation of liability. * +// * * +// * This code implementation is the result of the scientific and * +// * technical work of the GEANT4 collaboration. * +// * By using, copying, modifying or distributing the software (or * +// * any work based on the software) you agree to acknowledge its * +// * use in resulting scientific publications, and indicate your * +// * acceptance of all terms of the Geant4 Software license. * +// ******************************************************************** +// +/// \file electromagnetic/TestEm6/include/PhysicsListMessenger.hh +/// \brief Definition of the PhysicsListMessenger class +// +// $Id: PhysicsListMessenger.hh 83428 2014-08-21 15:46:01Z gcosmo $ +// +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +#ifndef PhysicsListMessenger_h +#define PhysicsListMessenger_h 1 + +#include "Geant4/globals.hh" +#include "Geant4/G4UImessenger.hh" + +class PhysicsList; +class G4UIdirectory; +class G4UIcmdWithADouble; +class G4UIcmdWithAString; + + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +class PhysicsListMessenger: public G4UImessenger +{ + public: + + PhysicsListMessenger(PhysicsList*); + ~PhysicsListMessenger(); + + void SetNewValue(G4UIcommand*, G4String) override; + + private: + + PhysicsList* fPhysList; + + G4UIdirectory* fPhysDir; + G4UIcmdWithADouble* fGammaToMuPairFacCmd; + G4UIcmdWithADouble* fGammaToEPairFacCmd; + G4UIcmdWithADouble* fAnnihiToMuPairFacCmd; + G4UIcmdWithADouble* fAnnihiToHadronFacCmd; + G4UIcmdWithAString* fListCmd; + +}; + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +#endif diff --git a/LHCbG4Tests/G4GammaToDiLeptonConversionTest/include/PrimaryGeneratorAction.hh b/LHCbG4Tests/G4GammaToDiLeptonConversionTest/include/PrimaryGeneratorAction.hh new file mode 100644 index 0000000000000000000000000000000000000000..a6460164a04f008fa5c60fe50b2c41f81f6c57e0 --- /dev/null +++ b/LHCbG4Tests/G4GammaToDiLeptonConversionTest/include/PrimaryGeneratorAction.hh @@ -0,0 +1,66 @@ +// +// ******************************************************************** +// * License and Disclaimer * +// * * +// * The Geant4 software is copyright of the Copyright Holders of * +// * the Geant4 Collaboration. It is provided under the terms and * +// * conditions of the Geant4 Software License, included in the file * +// * LICENSE and available at http://cern.ch/geant4/license . These * +// * include a list of copyright holders. * +// * * +// * Neither the authors of this software system, nor their employing * +// * institutes,nor the agencies providing financial support for this * +// * work make any representation or warranty, express or implied, * +// * regarding this software system or assume any liability for its * +// * use. Please see the license in the file LICENSE and URL above * +// * for the full disclaimer and the limitation of liability. * +// * * +// * This code implementation is the result of the scientific and * +// * technical work of the GEANT4 collaboration. * +// * By using, copying, modifying or distributing the software (or * +// * any work based on the software) you agree to acknowledge its * +// * use in resulting scientific publications, and indicate your * +// * acceptance of all terms of the Geant4 Software license. * +// ******************************************************************** +// +/// \file electromagnetic/TestEm6/include/PrimaryGeneratorAction.hh +/// \brief Definition of the PrimaryGeneratorAction class +// +// $Id: PrimaryGeneratorAction.hh 66241 2012-12-13 18:34:42Z gunter $ +// +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +#ifndef PrimaryGeneratorAction_h +#define PrimaryGeneratorAction_h 1 + +#include "Geant4/G4VUserPrimaryGeneratorAction.hh" +#include "Geant4/globals.hh" + +class G4ParticleGun; +class G4Event; +class DetectorConstruction; +class PrimaryGeneratorMessenger; + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +class PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction +{ + public: + PrimaryGeneratorAction(DetectorConstruction*, G4double, G4int); + ~PrimaryGeneratorAction(); + + public: + void GeneratePrimaries(G4Event*) override; + + private: + G4ParticleGun* fParticleGun; + DetectorConstruction* fDetector; + PrimaryGeneratorMessenger* fGunMessenger; +}; + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +#endif + + diff --git a/LHCbG4Tests/G4GammaToDiLeptonConversionTest/include/PrimaryGeneratorMessenger.hh b/LHCbG4Tests/G4GammaToDiLeptonConversionTest/include/PrimaryGeneratorMessenger.hh new file mode 100644 index 0000000000000000000000000000000000000000..0743dd38b3a7ce4bf8cfaa83177d4dca0fbc90a3 --- /dev/null +++ b/LHCbG4Tests/G4GammaToDiLeptonConversionTest/include/PrimaryGeneratorMessenger.hh @@ -0,0 +1,60 @@ +// +// ******************************************************************** +// * License and Disclaimer * +// * * +// * The Geant4 software is copyright of the Copyright Holders of * +// * the Geant4 Collaboration. It is provided under the terms and * +// * conditions of the Geant4 Software License, included in the file * +// * LICENSE and available at http://cern.ch/geant4/license . These * +// * include a list of copyright holders. * +// * * +// * Neither the authors of this software system, nor their employing * +// * institutes,nor the agencies providing financial support for this * +// * work make any representation or warranty, express or implied, * +// * regarding this software system or assume any liability for its * +// * use. Please see the license in the file LICENSE and URL above * +// * for the full disclaimer and the limitation of liability. * +// * * +// * This code implementation is the result of the scientific and * +// * technical work of the GEANT4 collaboration. * +// * By using, copying, modifying or distributing the software (or * +// * any work based on the software) you agree to acknowledge its * +// * use in resulting scientific publications, and indicate your * +// * acceptance of all terms of the Geant4 Software license. * +// ******************************************************************** +// +/// \file electromagnetic/TestEm6/include/PrimaryGeneratorMessenger.hh +/// \brief Definition of the PrimaryGeneratorMessenger class +// +// $Id: PrimaryGeneratorMessenger.hh 66241 2012-12-13 18:34:42Z gunter $ +// +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +#ifndef PrimaryGeneratorMessenger_h +#define PrimaryGeneratorMessenger_h 1 + +#include "Geant4/G4UImessenger.hh" +#include "Geant4/globals.hh" + +class PrimaryGeneratorAction; +class G4UIdirectory; +class G4UIcmdWithADouble; + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +class PrimaryGeneratorMessenger: public G4UImessenger +{ + public: + PrimaryGeneratorMessenger(PrimaryGeneratorAction*); + ~PrimaryGeneratorMessenger(); + + private: + PrimaryGeneratorAction* fAction; + G4UIdirectory* fGunDir; +}; + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +#endif + diff --git a/LHCbG4Tests/G4GammaToDiLeptonConversionTest/include/ProcessesCount.hh b/LHCbG4Tests/G4GammaToDiLeptonConversionTest/include/ProcessesCount.hh new file mode 100644 index 0000000000000000000000000000000000000000..bf1c90430068dfb24eee1f51431a52ff44a7f11c --- /dev/null +++ b/LHCbG4Tests/G4GammaToDiLeptonConversionTest/include/ProcessesCount.hh @@ -0,0 +1,62 @@ +// +// ******************************************************************** +// * License and Disclaimer * +// * * +// * The Geant4 software is copyright of the Copyright Holders of * +// * the Geant4 Collaboration. It is provided under the terms and * +// * conditions of the Geant4 Software License, included in the file * +// * LICENSE and available at http://cern.ch/geant4/license . These * +// * include a list of copyright holders. * +// * * +// * Neither the authors of this software system, nor their employing * +// * institutes,nor the agencies providing financial support for this * +// * work make any representation or warranty, express or implied, * +// * regarding this software system or assume any liability for its * +// * use. Please see the license in the file LICENSE and URL above * +// * for the full disclaimer and the limitation of liability. * +// * * +// * This code implementation is the result of the scientific and * +// * technical work of the GEANT4 collaboration. * +// * By using, copying, modifying or distributing the software (or * +// * any work based on the software) you agree to acknowledge its * +// * use in resulting scientific publications, and indicate your * +// * acceptance of all terms of the Geant4 Software license. * +// ******************************************************************** +// +/// \file electromagnetic/TestEm6/include/ProcessesCount.hh +/// \brief Definition of the ProcessesCount class +// +// $Id: ProcessesCount.hh 66241 2012-12-13 18:34:42Z gunter $ +// +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +#ifndef ProcessesCount_HH +#define ProcessesCount_HH + +#include "Geant4/globals.hh" +#include <vector> + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +class OneProcessCount +{ +public: + OneProcessCount(G4String name) {fName=name; fCounter=0;}; + ~OneProcessCount() {}; + +public: + G4String GetName() {return fName;}; + G4int GetCounter() {return fCounter;}; + void Count() {fCounter++;}; + +private: + G4String fName; // process name + G4int fCounter; // process counter +}; + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +typedef std::vector<OneProcessCount*> ProcessesCount; + +#endif diff --git a/LHCbG4Tests/G4GammaToDiLeptonConversionTest/include/RunAction.hh b/LHCbG4Tests/G4GammaToDiLeptonConversionTest/include/RunAction.hh new file mode 100644 index 0000000000000000000000000000000000000000..60c8c792aff684f4681a83fd5cdfafee10dfb81f --- /dev/null +++ b/LHCbG4Tests/G4GammaToDiLeptonConversionTest/include/RunAction.hh @@ -0,0 +1,80 @@ +// +// ******************************************************************** +// * License and Disclaimer * +// * * +// * The Geant4 software is copyright of the Copyright Holders of * +// * the Geant4 Collaboration. It is provided under the terms and * +// * conditions of the Geant4 Software License, included in the file * +// * LICENSE and available at http://cern.ch/geant4/license . These * +// * include a list of copyright holders. * +// * * +// * Neither the authors of this software system, nor their employing * +// * institutes,nor the agencies providing financial support for this * +// * work make any representation or warranty, express or implied, * +// * regarding this software system or assume any liability for its * +// * use. Please see the license in the file LICENSE and URL above * +// * for the full disclaimer and the limitation of liability. * +// * * +// * This code implementation is the result of the scientific and * +// * technical work of the GEANT4 collaboration. * +// * By using, copying, modifying or distributing the software (or * +// * any work based on the software) you agree to acknowledge its * +// * use in resulting scientific publications, and indicate your * +// * acceptance of all terms of the Geant4 Software license. * +// ******************************************************************** +// +/// \file electromagnetic/TestEm6/include/RunAction.hh +/// \brief Definition of the RunAction class +// +// $Id: RunAction.hh 83428 2014-08-21 15:46:01Z gcosmo $ +// +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +#ifndef RunAction_h +#define RunAction_h 1 + +#include "Geant4/G4UserRunAction.hh" +#include "ProcessesCount.hh" +#include "Geant4/globals.hh" +#include "Geant4/G4ParticleDefinition.hh" +#include "DetectorConstruction.hh" + +#include "Geant4/g4root.hh" + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +class G4Run; + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +class RunAction : public G4UserRunAction +{ + public: + RunAction(DetectorConstruction*, G4double, G4double, G4int, G4String); + ~RunAction(); + + public: + void BeginOfRunAction(const G4Run*) override; + void EndOfRunAction(const G4Run*) override; + void CountProcesses(G4String); + + private: + DetectorConstruction* fDetector; + ProcessesCount* fProcCounter; + G4AnalysisManager* fAnalysis; + G4Material* fMat; + + G4double fMinE; + G4double fMaxE; + G4int fnBin; + + G4String fileName; + + G4int fNtColId[3]; +}; + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +#endif + diff --git a/LHCbG4Tests/G4GammaToDiLeptonConversionTest/include/StackingAction.hh b/LHCbG4Tests/G4GammaToDiLeptonConversionTest/include/StackingAction.hh new file mode 100644 index 0000000000000000000000000000000000000000..b0b44d3cacf2edcb3fed209d68a458fe6f61eacb --- /dev/null +++ b/LHCbG4Tests/G4GammaToDiLeptonConversionTest/include/StackingAction.hh @@ -0,0 +1,55 @@ +// +// ******************************************************************** +// * License and Disclaimer * +// * * +// * The Geant4 software is copyright of the Copyright Holders of * +// * the Geant4 Collaboration. It is provided under the terms and * +// * conditions of the Geant4 Software License, included in the file * +// * LICENSE and available at http://cern.ch/geant4/license . These * +// * include a list of copyright holders. * +// * * +// * Neither the authors of this software system, nor their employing * +// * institutes,nor the agencies providing financial support for this * +// * work make any representation or warranty, express or implied, * +// * regarding this software system or assume any liability for its * +// * use. Please see the license in the file LICENSE and URL above * +// * for the full disclaimer and the limitation of liability. * +// * * +// * This code implementation is the result of the scientific and * +// * technical work of the GEANT4 collaboration. * +// * By using, copying, modifying or distributing the software (or * +// * any work based on the software) you agree to acknowledge its * +// * use in resulting scientific publications, and indicate your * +// * acceptance of all terms of the Geant4 Software license. * +// ******************************************************************** +// +/// \file electromagnetic/TestEm6/include/StackingAction.hh +/// \brief Definition of the StackingAction class +// +// $Id: StackingAction.hh 66241 2012-12-13 18:34:42Z gunter $ +// +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +#ifndef StackingAction_h +#define StackingAction_h 1 + +#include "Geant4/G4UserStackingAction.hh" +#include "Geant4/globals.hh" + +class G4Track; + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +class StackingAction : public G4UserStackingAction +{ + public: + + StackingAction(); + ~StackingAction(); + + G4ClassificationOfNewTrack ClassifyNewTrack(const G4Track* ) override; + +}; + +#endif diff --git a/LHCbG4Tests/G4GammaToDiLeptonConversionTest/include/StepMax.hh b/LHCbG4Tests/G4GammaToDiLeptonConversionTest/include/StepMax.hh new file mode 100644 index 0000000000000000000000000000000000000000..e4b0186e65fd9f37c96fd0b6116c6bdfe9ed4fb8 --- /dev/null +++ b/LHCbG4Tests/G4GammaToDiLeptonConversionTest/include/StepMax.hh @@ -0,0 +1,78 @@ +// +// ******************************************************************** +// * License and Disclaimer * +// * * +// * The Geant4 software is copyright of the Copyright Holders of * +// * the Geant4 Collaboration. It is provided under the terms and * +// * conditions of the Geant4 Software License, included in the file * +// * LICENSE and available at http://cern.ch/geant4/license . These * +// * include a list of copyright holders. * +// * * +// * Neither the authors of this software system, nor their employing * +// * institutes,nor the agencies providing financial support for this * +// * work make any representation or warranty, express or implied, * +// * regarding this software system or assume any liability for its * +// * use. Please see the license in the file LICENSE and URL above * +// * for the full disclaimer and the limitation of liability. * +// * * +// * This code implementation is the result of the scientific and * +// * technical work of the GEANT4 collaboration. * +// * By using, copying, modifying or distributing the software (or * +// * any work based on the software) you agree to acknowledge its * +// * use in resulting scientific publications, and indicate your * +// * acceptance of all terms of the Geant4 Software license. * +// ******************************************************************** +// +/// \file electromagnetic/TestEm6/include/StepMax.hh +/// \brief Definition of the StepMax class +// +// $Id: StepMax.hh 66241 2012-12-13 18:34:42Z gunter $ +// +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +#ifndef StepMax_h +#define StepMax_h 1 + +#include "Geant4/globals.hh" +#include "Geant4/G4VDiscreteProcess.hh" +#include "Geant4/G4ParticleDefinition.hh" +#include "Geant4/G4Step.hh" + +class StepMaxMessenger; + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +class StepMax : public G4VDiscreteProcess +{ +public: + + StepMax(const G4String& processName = "UserMaxStep"); + ~StepMax(); + + void SetMaxStep(G4double); + + inline G4double GetMaxStep() { return fMaxChargedStep; }; + + G4bool IsApplicable(const G4ParticleDefinition&) override; + + G4double PostStepGetPhysicalInteractionLength(const G4Track& track, + G4double previousStepSize, + G4ForceCondition* condition) override; + + G4VParticleChange* PostStepDoIt(const G4Track&, const G4Step&) override; + + G4double GetMeanFreePath(const G4Track&, G4double, G4ForceCondition*) override; + +private: + + G4double fMaxChargedStep; + G4double fProposedStep; + + StepMaxMessenger* fMessenger; +}; + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +#endif + diff --git a/LHCbG4Tests/G4GammaToDiLeptonConversionTest/include/StepMaxMessenger.hh b/LHCbG4Tests/G4GammaToDiLeptonConversionTest/include/StepMaxMessenger.hh new file mode 100644 index 0000000000000000000000000000000000000000..ed1efaab45111c19a1fe34671fd3943dc7fb13dc --- /dev/null +++ b/LHCbG4Tests/G4GammaToDiLeptonConversionTest/include/StepMaxMessenger.hh @@ -0,0 +1,61 @@ +// +// ******************************************************************** +// * License and Disclaimer * +// * * +// * The Geant4 software is copyright of the Copyright Holders of * +// * the Geant4 Collaboration. It is provided under the terms and * +// * conditions of the Geant4 Software License, included in the file * +// * LICENSE and available at http://cern.ch/geant4/license . These * +// * include a list of copyright holders. * +// * * +// * Neither the authors of this software system, nor their employing * +// * institutes,nor the agencies providing financial support for this * +// * work make any representation or warranty, express or implied, * +// * regarding this software system or assume any liability for its * +// * use. Please see the license in the file LICENSE and URL above * +// * for the full disclaimer and the limitation of liability. * +// * * +// * This code implementation is the result of the scientific and * +// * technical work of the GEANT4 collaboration. * +// * By using, copying, modifying or distributing the software (or * +// * any work based on the software) you agree to acknowledge its * +// * use in resulting scientific publications, and indicate your * +// * acceptance of all terms of the Geant4 Software license. * +// ******************************************************************** +// +/// \file electromagnetic/TestEm6/include/StepMaxMessenger.hh +/// \brief Definition of the StepMaxMessenger class +// +// $Id: StepMaxMessenger.hh 67268 2013-02-13 11:38:40Z ihrivnac $ +// +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +#ifndef StepMaxMessenger_h +#define StepMaxMessenger_h 1 + +#include "Geant4/globals.hh" +#include "Geant4/G4UImessenger.hh" + +class StepMax; +class G4UIcmdWithADoubleAndUnit; + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +class StepMaxMessenger: public G4UImessenger +{ +public: + + StepMaxMessenger(StepMax*); + ~StepMaxMessenger(); + + void SetNewValue(G4UIcommand*, G4String) override; + +private: + StepMax* fStepMax; + G4UIcmdWithADoubleAndUnit* fStepMaxCmd; +}; + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +#endif diff --git a/LHCbG4Tests/G4GammaToDiLeptonConversionTest/include/SteppingAction.hh b/LHCbG4Tests/G4GammaToDiLeptonConversionTest/include/SteppingAction.hh new file mode 100644 index 0000000000000000000000000000000000000000..3431716b0ac34d0dd13c791590fdaaa2d90543bc --- /dev/null +++ b/LHCbG4Tests/G4GammaToDiLeptonConversionTest/include/SteppingAction.hh @@ -0,0 +1,67 @@ +// +// ******************************************************************** +// * License and Disclaimer * +// * * +// * The Geant4 software is copyright of the Copyright Holders of * +// * the Geant4 Collaboration. It is provided under the terms and * +// * conditions of the Geant4 Software License, included in the file * +// * LICENSE and available at http://cern.ch/geant4/license . These * +// * include a list of copyright holders. * +// * * +// * Neither the authors of this software system, nor their employing * +// * institutes,nor the agencies providing financial support for this * +// * work make any representation or warranty, express or implied, * +// * regarding this software system or assume any liability for its * +// * use. Please see the license in the file LICENSE and URL above * +// * for the full disclaimer and the limitation of liability. * +// * * +// * This code implementation is the result of the scientific and * +// * technical work of the GEANT4 collaboration. * +// * By using, copying, modifying or distributing the software (or * +// * any work based on the software) you agree to acknowledge its * +// * use in resulting scientific publications, and indicate your * +// * acceptance of all terms of the Geant4 Software license. * +// ******************************************************************** +// +/// \file electromagnetic/TestEm6/include/SteppingAction.hh +/// \brief Definition of the SteppingAction class +// +// $Id: SteppingAction.hh 66241 2012-12-13 18:34:42Z gunter $ +// +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +#ifndef SteppingAction_h +#define SteppingAction_h 1 + +#include "Geant4/G4UserSteppingAction.hh" +#include "Geant4/globals.hh" +#include "Geant4/G4ParticleDefinition.hh" +#include "Geant4/G4ParticleTypes.hh" + +class RunAction; + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +class SteppingAction : public G4UserSteppingAction +{ +public: + SteppingAction(RunAction*); + ~SteppingAction(); + + void UserSteppingAction(const G4Step*) override; + +private: + RunAction* fRunAction; + G4double fMuonMass; + G4double fEMass; + + G4MuonPlus* muplus_def = G4MuonPlus::MuonPlusDefinition(); + G4Positron* eplus_def = G4Positron::PositronDefinition(); + + int tuple_index = -1; +}; + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +#endif diff --git a/LHCbG4Tests/G4GammaToDiLeptonConversionTest/include/SteppingVerbose.hh b/LHCbG4Tests/G4GammaToDiLeptonConversionTest/include/SteppingVerbose.hh new file mode 100644 index 0000000000000000000000000000000000000000..280d0debd8c0ad029851831f3529c1ffc08b41a2 --- /dev/null +++ b/LHCbG4Tests/G4GammaToDiLeptonConversionTest/include/SteppingVerbose.hh @@ -0,0 +1,55 @@ +// +// ******************************************************************** +// * License and Disclaimer * +// * * +// * The Geant4 software is copyright of the Copyright Holders of * +// * the Geant4 Collaboration. It is provided under the terms and * +// * conditions of the Geant4 Software License, included in the file * +// * LICENSE and available at http://cern.ch/geant4/license . These * +// * include a list of copyright holders. * +// * * +// * Neither the authors of this software system, nor their employing * +// * institutes,nor the agencies providing financial support for this * +// * work make any representation or warranty, express or implied, * +// * regarding this software system or assume any liability for its * +// * use. Please see the license in the file LICENSE and URL above * +// * for the full disclaimer and the limitation of liability. * +// * * +// * This code implementation is the result of the scientific and * +// * technical work of the GEANT4 collaboration. * +// * By using, copying, modifying or distributing the software (or * +// * any work based on the software) you agree to acknowledge its * +// * use in resulting scientific publications, and indicate your * +// * acceptance of all terms of the Geant4 Software license. * +// ******************************************************************** +// +/// \file electromagnetic/TestEm6/include/SteppingVerbose.hh +/// \brief Definition of the SteppingVerbose class +// +// +// $Id: SteppingVerbose.hh 98272 2016-07-04 17:56:04Z gcosmo $ +// +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +#ifndef SteppingVerbose_h +#define SteppingVerbose_h 1 + +#include "Geant4/G4SteppingVerbose.hh" + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +class SteppingVerbose : public G4SteppingVerbose { + +public: + + SteppingVerbose(); + ~SteppingVerbose(); + + void TrackingStarted() override; + void StepInfo() override; +}; + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +#endif diff --git a/LHCbG4Tests/G4GammaToDiLeptonConversionTest/scripts/G4GammaToDiLeptonConversionTest.py b/LHCbG4Tests/G4GammaToDiLeptonConversionTest/scripts/G4GammaToDiLeptonConversionTest.py new file mode 100644 index 0000000000000000000000000000000000000000..85d632f68c002ddbccb88e772143ae25f13ad874 --- /dev/null +++ b/LHCbG4Tests/G4GammaToDiLeptonConversionTest/scripts/G4GammaToDiLeptonConversionTest.py @@ -0,0 +1,146 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import subprocess +import argparse + +from math import log10 + +import logging + +logging.basicConfig() +_logger = logging.getLogger("GAMMA2DILEPTONPROD") +_logger.setLevel("INFO") + +parser = argparse.ArgumentParser("DILEPTONPROD") + +parser.add_argument("--nevts", default=10000, help="Number of Events") +parser.add_argument("--energies", default="[1000]", help="Energies List") +parser.add_argument("--thickness", default="[0.3]", help="List of thicknesses") +parser.add_argument("--scale", default="100000", help="Scale DiMuon Conversion Cross Section by factor") +parser.add_argument("--debug", default=False, action="store_true", help="Debug Mode") +parser.add_argument("--outputdir", default="G4GammaCVTestROOTFiles", help="Output Location") + +args = parser.parse_args() + +if args.debug: + _logger.setLevel("DEBUG") + +def get_list(argument): + import re + elements = re.findall(r'[\d|\.]+', argument) + return elements + +energies = get_list(args.energies) +thickness = get_list(args.thickness) + +try: + assert int(args.nevts) > 0 +except AssertionError: + _logger.error("Number of Events Must be a Positive Integer") + exit(0) +except TypeError: + _logger.error("Invalid Input for Number of Events") + exit(0) + +_logger.debug("Creating Test Output Directory...") + +subprocess.check_call("mkdir -p {}".format(args.outputdir), shell=True) + +for energy in energies: + for t in thickness: + _logger.info("%s\n\nRunning Gamma->l+ l- Conversion in Aluminium with options:\n"+ + "\n\tNumber of Events :\t%s "+ + "\n\tBeam Energy :\t%s GeV"+ + "\n\tTarget Thickness :\t%s mm"+ + "\n\tDiMuon XSec Scale Factor :\t%s"+ + "\n\tOutput Directory :\t%s\n", + '='*40, args.nevts, energy, t, args.scale, args.outputdir) + _logger.info('='*40) + subprocess.check_call("G4GammaToDiLeptonConversionTest.exe --nevts {} --energy {}".format(args.nevts, energy) + + " --thickness {} --scale {} --outputdir {}".format(t, args.scale, args.outputdir), shell=True) + +_logger.info("Creating Single Combined Plots ROOT File...") + +import ROOT + +_output = ROOT.TFile.Open("G4GammaCVTestROOTFiles/G4GammaToDiLeptonConversionTest.root", "NEW") + +_histo_dim_dict = {'DiElectron' : {'Hist' : {'InvMass' : (100, 0, 100), + 'ThetaSep' : (50, 0, 6E-4), + 'InvMass2D' : (100, 1, 3), + 'Theta' : (100, 0, 0.02), + 'EFrac' : (100,0,1)}, + 'Symbol' : 'e'}, + 'DiMuon' : {'Hist' : {'InvMass' : (150, 250, 550), + 'Theta' : (100, 0, 0.07), + 'ThetaSep' : (50, 0, 1E-1), + 'InvMass2D' : (50, 200, 500), + 'EFrac' : (100,0,1)}, + 'Symbol' : '#mu' } } + +for energy in energies: + for t in thickness: + _logger.debug("Opening file '%s'", "{}/TestEM6_Al_{}mm_{}GeV_{}.root".format(args.outputdir, t, energy, args.nevts)) + _tmp = ROOT.TFile.Open("{}/TestEM6_Al_{}mm_{}GeV_{}.root".format(args.outputdir, t, energy, args.nevts)) + + for particle in _histo_dim_dict.keys(): + _logger.debug("Attempting to retrieve TTree '%s'", particle) + _tree = _tmp.Get(particle) + assert _tree.GetEntries() > 0, "No Entries Found!" + + hist_mm = ROOT.TH1F("{}_InvMass_{}GeV_{}mm_Al".format(particle, energy, t), + "{} Invariant Mass from {}GeV Photons in {}mm of Aluminium".format(particle, energy, t), + *_histo_dim_dict[particle]['Hist']['InvMass']) + hist_mm.GetXaxis().SetTitle("M_{%s}/MeV" % '{s}{s}'.format(s=_histo_dim_dict[particle]['Symbol'])) + + + hist_tp = ROOT.TH1F("{}_Angle_{}GeV_{}mm_Al".format(particle, energy, t), + "#gamma-{} Angle for {}GeV Photons in {}mm of Aluminium".format(_histo_dim_dict[particle]['Symbol']+'^{#pm}', energy, t), + *_histo_dim_dict[particle]['Hist']['Theta']) + hist_tp.GetXaxis().SetTitle("#theta(p_{%s}, p_{%s})" % ('#gamma', _histo_dim_dict[particle]['Symbol']+'^{#pm}')) + + hist_efp = ROOT.TH1F("{}_EnergyFrac_{}GeV_{}mm_Al".format(particle, energy, t), + "Energy Fraction of {} for {}GeV Photons in {}mm of Aluminium".format(_histo_dim_dict[particle]['Symbol']+'^{#pm}', energy, t), + *_histo_dim_dict[particle]['Hist']['EFrac']) + hist_efp.GetXaxis().SetTitle("E_{%s}/E_{%s}" % (_histo_dim_dict[particle]['Symbol']+'^{#pm}', "#gamma")) + + hist_2d_sep_ang_mm = ROOT.TH2F("{}_Separation_Angle_vs_InvMass_{}GeV_{}mm_Al".format(particle, energy, t), + "Separation Angle Between {} Pair vs Invariant Mass for {}GeV Photons in {}mm of Aluminium".format(particle, energy, t), + _histo_dim_dict[particle]['Hist']['InvMass2D'][0], + _histo_dim_dict[particle]['Hist']['InvMass2D'][1], + _histo_dim_dict[particle]['Hist']['InvMass2D'][2], + _histo_dim_dict[particle]['Hist']['ThetaSep'][0], + _histo_dim_dict[particle]['Hist']['ThetaSep'][1], + 10*_histo_dim_dict[particle]['Hist']['ThetaSep'][2]/float(energy)) + + hist_2d_sep_ang_mm.GetXaxis().SetTitle("M_{%s}/MeV" % '{s}{s}'.format(s=_histo_dim_dict[particle]['Symbol'])) + hist_2d_sep_ang_mm.GetYaxis().SetTitle("#theta(p_{%s},p_{%s})" % (_histo_dim_dict[particle]['Symbol']+'^{+}', + _histo_dim_dict[particle]['Symbol']+'^{-}')) + hist_2d_sep_ang_mm.GetYaxis().SetTitleOffset(1.2) + + for event in _tree: # ROOT broke when using Draw(hist >> hist_tmp(i,j,k)) method + hist_mm.Fill(getattr(event, '{}_InvMass'.format(particle))) + hist_tp.Fill(getattr(event, '{}_ThetaPlus'.format(particle))) + hist_tp.Fill(getattr(event, '{}_ThetaMinus'.format(particle))) + hist_efp.Fill(getattr(event, '{}_EnergyFracPlus'.format(particle))) + hist_efp.Fill(getattr(event, '{}_EnergyFracMinus'.format(particle))) + hist_2d_sep_ang_mm.Fill(getattr(event, '{}_InvMass'.format(particle)), getattr(event, '{}_ThetaSep'.format(particle))) + + _output.cd() + + hist_mm.Write(hist_mm.GetName(),ROOT.TObject.kOverwrite) + hist_tp.Write(hist_tp.GetName(),ROOT.TObject.kOverwrite) + hist_efp.Write(hist_efp.GetName(),ROOT.TObject.kOverwrite) + hist_2d_sep_ang_mm.Write(hist_2d_sep_ang_mm.GetName(),ROOT.TObject.kOverwrite) + + hist_mm.Delete() + hist_tp.Delete() + hist_efp.Delete() + hist_2d_sep_ang_mm.Delete() + + _tmp.Close() + +_output.Write() +_output.Close() + diff --git a/LHCbG4Tests/G4GammaToDiLeptonConversionTest/scripts/run_gammaconv_test.sh b/LHCbG4Tests/G4GammaToDiLeptonConversionTest/scripts/run_gammaconv_test.sh new file mode 100644 index 0000000000000000000000000000000000000000..706ec1b8345a14b3dd6ebdb2781bbdea7270a39a --- /dev/null +++ b/LHCbG4Tests/G4GammaToDiLeptonConversionTest/scripts/run_gammaconv_test.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env sh + +echo "Running G4GammaConversionTest..." +python $G4GAMMATODILEPTONCONVERSIONTESTROOT/scripts/G4GammaToDiLeptonConversionTest.py --energies "[10, 100, 1000]" --thickness "[0.3, 1, 10]" +echo "Test Complete." diff --git a/LHCbG4Tests/G4GammaToDiLeptonConversionTest/src/DetectorConstruction.cc b/LHCbG4Tests/G4GammaToDiLeptonConversionTest/src/DetectorConstruction.cc new file mode 100644 index 0000000000000000000000000000000000000000..c4632d65773107846d89d16489b41b44c4a0533b --- /dev/null +++ b/LHCbG4Tests/G4GammaToDiLeptonConversionTest/src/DetectorConstruction.cc @@ -0,0 +1,222 @@ +// +// ******************************************************************** +// * License and Disclaimer * +// * * +// * The Geant4 software is copyright of the Copyright Holders of * +// * the Geant4 Collaboration. It is provided under the terms and * +// * conditions of the Geant4 Software License, included in the file * +// * LICENSE and available at http://cern.ch/geant4/license . These * +// * include a list of copyright holders. * +// * * +// * Neither the authors of this software system, nor their employing * +// * institutes,nor the agencies providing financial support for this * +// * work make any representation or warranty, express or implied, * +// * regarding this software system or assume any liability for its * +// * use. Please see the license in the file LICENSE and URL above * +// * for the full disclaimer and the limitation of liability. * +// * * +// * This code implementation is the result of the scientific and * +// * technical work of the GEANT4 collaboration. * +// * By using, copying, modifying or distributing the software (or * +// * any work based on the software) you agree to acknowledge its * +// * use in resulting scientific publications, and indicate your * +// * acceptance of all terms of the Geant4 Software license. * +// ******************************************************************** +// +/// \file electromagnetic/TestEm6/src/DetectorConstruction.cc +/// \brief Implementation of the DetectorConstruction class +// +// $Id: DetectorConstruction.cc 83428 2014-08-21 15:46:01Z gcosmo $ +// +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +#include "DetectorConstruction.hh" +#include "DetectorMessenger.hh" +#include "Geant4/G4NistManager.hh" +#include "Geant4/G4RunManager.hh" + +#include "Geant4/G4Material.hh" +#include "Geant4/G4Box.hh" +#include "Geant4/G4LogicalVolume.hh" +#include "Geant4/G4PVPlacement.hh" +#include "Geant4/G4UniformMagField.hh" +#include "Geant4/G4UserLimits.hh" + +#include "Geant4/G4GeometryManager.hh" +#include "Geant4/G4PhysicalVolumeStore.hh" +#include "Geant4/G4LogicalVolumeStore.hh" +#include "Geant4/G4SolidStore.hh" + +#include "Geant4/G4UnitsTable.hh" +#include "Geant4/G4SystemOfUnits.hh" + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +DetectorConstruction::DetectorConstruction(G4float thickness) +:G4VUserDetectorConstruction(), + fP_Box(0), fL_Box(0), fBoxXY(10*m), fBoxDepth(thickness*mm), fMaterial(0), fMagField(0), + fUserLimits(0), fDetectorMessenger(0) +{ + DefineMaterials(); + SetMaterial("Aluminium"); + + // create UserLimits + fUserLimits = new G4UserLimits(); + + // create commands for interactive definition of the detector + fDetectorMessenger = new DetectorMessenger(this); +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +DetectorConstruction::~DetectorConstruction() +{ delete fDetectorMessenger;} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +G4VPhysicalVolume* DetectorConstruction::Construct() +{ + return ConstructVolumes(); +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +void DetectorConstruction::DefineMaterials() +{ + G4double a, z, density; + + new G4Material("Aluminium", z= 13., a= 26.98*g/mole, density= 2.700*g/cm3); + + G4cout << *(G4Material::GetMaterialTable()) << G4endl; +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +G4VPhysicalVolume* DetectorConstruction::ConstructVolumes() +{ + G4GeometryManager::GetInstance()->OpenGeometry(); + G4PhysicalVolumeStore::GetInstance()->Clean(); + G4LogicalVolumeStore::GetInstance()->Clean(); + G4SolidStore::GetInstance()->Clean(); + + G4Box* + sBox = new G4Box("Container", //its name + fBoxXY/2.,fBoxXY*2.,fBoxDepth/2.); //its dimensions + + fL_Box = new G4LogicalVolume(sBox, //its shape + fMaterial, //its material + fMaterial->GetName()); //its name + + fL_Box->SetUserLimits(fUserLimits); + + fP_Box = new G4PVPlacement(0, //no rotation + G4ThreeVector(), //at (0,0,0) + fL_Box, //its logical volume + fMaterial->GetName(), //its name + 0, //its mother volume + false, //no boolean operation + 0); //copy number + + PrintParameters(); + + // + //always return the root volume + // + return fP_Box; +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +void DetectorConstruction::PrintParameters() +{ + G4cout << "\n The Box is " << G4BestUnit(fBoxDepth,"Length") + << " of " << fMaterial->GetName() << G4endl; +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +void DetectorConstruction::SetMaterial(const G4String& name) +{ + G4cout << "###SetMaterial" << G4endl; + + // get the pointer to the existing material + G4Material* mat = G4Material::GetMaterial(name, false); + + // create the material by its name + if(!mat) { mat = G4NistManager::Instance()->FindOrBuildMaterial(name); } + + if (mat && mat != fMaterial) { + G4cout << "### New target material: " << mat->GetName() << G4endl; + fMaterial = mat; + if(fL_Box) { + fL_Box->SetMaterial(mat); + G4RunManager::GetRunManager()->PhysicsHasBeenModified(); + } + } +} + + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +void DetectorConstruction::SetSizeXY(G4double value) +{ + fBoxXY = value; +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +void DetectorConstruction::SetBoxDepth(G4double value) +{ + fBoxDepth = value; +} +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +#include "Geant4/G4FieldManager.hh" +#include "Geant4/G4TransportationManager.hh" + +void DetectorConstruction::SetMagField(G4double fieldValue) +{ + //apply a global uniform magnetic field along Z axis + G4FieldManager* fieldMgr + = G4TransportationManager::GetTransportationManager()->GetFieldManager(); + + if (fMagField) delete fMagField; //delete the existing magn field + + if (fieldValue!=0.) // create a new one if non nul + { + fMagField = new G4UniformMagField(G4ThreeVector(0.,0.,fieldValue)); + fieldMgr->SetDetectorField(fMagField); + fieldMgr->CreateChordFinder(fMagField); + } + else + { + fMagField = 0; + fieldMgr->SetDetectorField(fMagField); + } +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +void DetectorConstruction::SetMaxStepSize(G4double val) +{ + // set the maximum allowed step size + // + if (val <= DBL_MIN) + { G4cout << "\n --->warning from SetMaxStepSize: maxStep " + << val << " out of range. Command refused" << G4endl; + return; + } + fUserLimits->SetMaxAllowedStep(val); +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +#include "Geant4/G4RunManager.hh" + +void DetectorConstruction::UpdateGeometry() +{ + G4RunManager::GetRunManager()->DefineWorldVolume(ConstructVolumes()); +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... diff --git a/LHCbG4Tests/G4GammaToDiLeptonConversionTest/src/DetectorMessenger.cc b/LHCbG4Tests/G4GammaToDiLeptonConversionTest/src/DetectorMessenger.cc new file mode 100644 index 0000000000000000000000000000000000000000..82121a08553467333d5eb190f17fa677a8e8ad2f --- /dev/null +++ b/LHCbG4Tests/G4GammaToDiLeptonConversionTest/src/DetectorMessenger.cc @@ -0,0 +1,126 @@ +// +// ******************************************************************** +// * License and Disclaimer * +// * * +// * The Geant4 software is copyright of the Copyright Holders of * +// * the Geant4 Collaboration. It is provided under the terms and * +// * conditions of the Geant4 Software License, included in the file * +// * LICENSE and available at http://cern.ch/geant4/license . These * +// * include a list of copyright holders. * +// * * +// * Neither the authors of this software system, nor their employing * +// * institutes,nor the agencies providing financial support for this * +// * work make any representation or warranty, express or implied, * +// * regarding this software system or assume any liability for its * +// * use. Please see the license in the file LICENSE and URL above * +// * for the full disclaimer and the limitation of liability. * +// * * +// * This code implementation is the result of the scientific and * +// * technical work of the GEANT4 collaboration. * +// * By using, copying, modifying or distributing the software (or * +// * any work based on the software) you agree to acknowledge its * +// * use in resulting scientific publications, and indicate your * +// * acceptance of all terms of the Geant4 Software license. * +// ******************************************************************** +// +/// \file electromagnetic/TestEm6/src/DetectorMessenger.cc +/// \brief Implementation of the DetectorMessenger class +// +// $Id: DetectorMessenger.cc 67268 2013-02-13 11:38:40Z ihrivnac $ +// +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +#include "DetectorMessenger.hh" + +#include "DetectorConstruction.hh" +#include "Geant4/G4UIdirectory.hh" +#include "Geant4/G4UIcmdWithAString.hh" +#include "Geant4/G4UIcmdWithADoubleAndUnit.hh" +#include "Geant4/G4UIcmdWithoutParameter.hh" + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +DetectorMessenger::DetectorMessenger(DetectorConstruction * Det) +:G4UImessenger(),fDetector(Det), + fTestemDir(0), + fDetDir(0), + fMaterCmd(0), + fSizeCmd(0), + fMagFieldCmd(0), + fMaxStepCmd(0), + fUpdateCmd(0) +{ + fTestemDir = new G4UIdirectory("/testem/"); + fTestemDir->SetGuidance(" detector control."); + + fDetDir = new G4UIdirectory("/testem/det/"); + fDetDir->SetGuidance("detector construction commands"); + + fMaterCmd = new G4UIcmdWithAString("/testem/det/setMat",this); + fMaterCmd->SetGuidance("Select material of the box."); + fMaterCmd->SetParameterName("choice",false); + fMaterCmd->AvailableForStates(G4State_PreInit,G4State_Idle); + + fSizeCmd = new G4UIcmdWithADoubleAndUnit("/testem/det/setSize",this); + fSizeCmd->SetGuidance("Set size of the box"); + fSizeCmd->SetParameterName("Size",false); + fSizeCmd->SetRange("Size>0."); + fSizeCmd->SetUnitCategory("Length"); + fSizeCmd->AvailableForStates(G4State_PreInit,G4State_Idle); + + fMagFieldCmd = new G4UIcmdWithADoubleAndUnit("/testem/det/setField",this); + fMagFieldCmd->SetGuidance("Define magnetic field."); + fMagFieldCmd->SetGuidance("Magnetic field will be in Z direction."); + fMagFieldCmd->SetParameterName("Bz",false); + fMagFieldCmd->SetUnitCategory("Magnetic flux density"); + fMagFieldCmd->AvailableForStates(G4State_PreInit,G4State_Idle); + + fUpdateCmd = new G4UIcmdWithoutParameter("/testem/det/update",this); + fUpdateCmd->SetGuidance("Update calorimeter geometry."); + fUpdateCmd->SetGuidance("This command MUST be applied before \"beamOn\" "); + fUpdateCmd->SetGuidance("if you changed geometrical value(s)."); + fUpdateCmd->AvailableForStates(G4State_Idle); + + fMaxStepCmd = new G4UIcmdWithADoubleAndUnit("/testem/tracking/stepMax",this); + fMaxStepCmd->SetGuidance("Set max allowed step size"); + fMaxStepCmd->SetParameterName("Size",false); + fMaxStepCmd->SetRange("Size>0."); + fMaxStepCmd->SetUnitCategory("Length"); + fMaxStepCmd->AvailableForStates(G4State_Idle); +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +DetectorMessenger::~DetectorMessenger() +{ + delete fMaterCmd; + delete fSizeCmd; + delete fMagFieldCmd; + delete fUpdateCmd; + delete fMaxStepCmd; + delete fDetDir; + delete fTestemDir; +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +void DetectorMessenger::SetNewValue(G4UIcommand* command,G4String newValue) +{ + if( command == fMaterCmd ) + { fDetector->SetMaterial(newValue);} + + if( command == fSizeCmd ) + { fDetector->SetBoxDepth(fSizeCmd->GetNewDoubleValue(newValue));} + + if( command == fMagFieldCmd ) + { fDetector->SetMagField(fMagFieldCmd->GetNewDoubleValue(newValue));} + + if( command == fUpdateCmd ) + { fDetector->UpdateGeometry(); } + + if( command == fMaxStepCmd ) + { fDetector->SetMaxStepSize(fMaxStepCmd->GetNewDoubleValue(newValue));} +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... diff --git a/LHCbG4Tests/G4GammaToDiLeptonConversionTest/src/PhysicsList.cc b/LHCbG4Tests/G4GammaToDiLeptonConversionTest/src/PhysicsList.cc new file mode 100644 index 0000000000000000000000000000000000000000..22aa8c6b7054513d1a941fc32a448d04ebd12241 --- /dev/null +++ b/LHCbG4Tests/G4GammaToDiLeptonConversionTest/src/PhysicsList.cc @@ -0,0 +1,286 @@ +// +// ******************************************************************** +// * License and Disclaimer * +// * * +// * The Geant4 software is copyright of the Copyright Holders of * +// * the Geant4 Collaboration. It is provided under the terms and * +// * conditions of the Geant4 Software License, included in the file * +// * LICENSE and available at http://cern.ch/geant4/license . These * +// * include a list of copyright holders. * +// * * +// * Neither the authors of this software system, nor their employing * +// * institutes,nor the agencies providing financial support for this * +// * work make any representation or warranty, express or implied, * +// * regarding this software system or assume any liability for its * +// * use. Please see the license in the file LICENSE and URL above * +// * for the full disclaimer and the limitation of liability. * +// * * +// * This code implementation is the result of the scientific and * +// * technical work of the GEANT4 collaboration. * +// * By using, copying, modifying or distributing the software (or * +// * any work based on the software) you agree to acknowledge its * +// * use in resulting scientific publications, and indicate your * +// * acceptance of all terms of the Geant4 Software license. * +// ******************************************************************** +// +/// \file electromagnetic/TestEm6/src/PhysicsList.cc +/// \brief Implementation of the PhysicsList class +// +// $Id: PhysicsList.cc 100285 2016-10-17 08:42:54Z gcosmo $ +// +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +#include "PhysicsList.hh" +#include "PhysicsListMessenger.hh" + +#include "Geant4/G4EmStandardPhysics.hh" +#include "Geant4/G4EmStandardPhysics_option1.hh" +#include "Geant4/G4EmStandardPhysics_option2.hh" +#include "Geant4/G4EmStandardPhysics_option3.hh" +#include "Geant4/G4EmStandardPhysics_option4.hh" +#include "Geant4/G4EmStandardPhysicsGS.hh" +#include "Geant4/G4EmStandardPhysicsWVI.hh" +#include "Geant4/G4EmStandardPhysicsSS.hh" +#include "Geant4/G4EmLivermorePhysics.hh" +#include "Geant4/G4EmPenelopePhysics.hh" +#include "Geant4/G4EmLowEPPhysics.hh" + +#include "Geant4/G4DecayPhysics.hh" + +#include "Geant4/G4ParticleDefinition.hh" +#include "Geant4/G4ProcessManager.hh" +#include "Geant4/G4ParticleTable.hh" +#include "Geant4/G4ProcessTable.hh" + +#include "Geant4/G4Gamma.hh" +#include "Geant4/G4Electron.hh" +#include "Geant4/G4Positron.hh" + +#include "Geant4/G4GammaConversionToMuons.hh" +#include "Geant4/G4GammaConversion.hh" + +#include "Geant4/G4AnnihiToMuPair.hh" +#include "Geant4/G4eeToHadrons.hh" + +#include "Geant4/G4SystemOfUnits.hh" +#include "Geant4/G4UnitsTable.hh" +#include "Geant4/G4LossTableManager.hh" + +#include "StepMax.hh" + + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +PhysicsList::PhysicsList() : G4VModularPhysicsList(), + fEmPhysicsList(0), + fDecayPhysicsList(0), + fStepMaxProcess(0), + fMes(0) +{ + G4LossTableManager::Instance()->SetVerbose(1); + + defaultCutValue = 1.*km; + fMes = new PhysicsListMessenger(this); + + fStepMaxProcess = new StepMax(); + + fDecayPhysicsList = new G4DecayPhysics(); + + SetVerboseLevel(2); +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +PhysicsList::~PhysicsList() +{ + delete fMes; + delete fDecayPhysicsList; + delete fEmPhysicsList; + delete fStepMaxProcess; +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +void PhysicsList::ConstructParticle() +{ + fDecayPhysicsList->ConstructParticle(); +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +void PhysicsList::ConstructProcess() +{ + AddTransportation(); + + if(fEmPhysicsList) fEmPhysicsList->ConstructProcess(); + fDecayPhysicsList->ConstructProcess(); + + AddStepMax(); + + ConstructHighEnergy(); +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +void PhysicsList::ConstructHighEnergy() +{ + const G4ParticleDefinition* particle = G4Gamma::Gamma(); + G4ProcessManager* pmanager = particle->GetProcessManager(); + + pmanager->AddDiscreteProcess(new G4GammaConversionToMuons); + pmanager->AddDiscreteProcess(new G4GammaConversion); + + particle = G4Positron::Positron(); + pmanager = particle->GetProcessManager(); + + pmanager->AddDiscreteProcess(new G4AnnihiToMuPair); + pmanager->AddDiscreteProcess(new G4eeToHadrons); +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +void PhysicsList::SetGammaToMuPairFac(G4double fac) +{ + G4ProcessTable* theProcessTable = G4ProcessTable::GetProcessTable(); + G4GammaConversionToMuons* gammaToMuPairProcess = (G4GammaConversionToMuons*) + theProcessTable->FindProcess("GammaToMuPair","gamma"); + if(gammaToMuPairProcess) gammaToMuPairProcess->SetCrossSecFactor(fac); + else G4cout + << "Warning. No process GammaToMuPair found, SetGammaToMuPairFac was ignored" + << G4endl; +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +void PhysicsList::SetAnnihiToMuPairFac(G4double fac) +{ + G4ProcessTable* theProcessTable = G4ProcessTable::GetProcessTable(); + G4AnnihiToMuPair* annihiToMuPairProcess = (G4AnnihiToMuPair*) + theProcessTable->FindProcess("AnnihiToMuPair","e+"); + if(annihiToMuPairProcess) annihiToMuPairProcess->SetCrossSecFactor(fac); + else G4cout + << "Warning. No process AnnihiToMuPair found, SetAnnihiToMuPairFac ignored" + << G4endl; +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +void PhysicsList::SetAnnihiToHadronFac(G4double fac) +{ + G4ProcessTable* theProcessTable = G4ProcessTable::GetProcessTable(); + G4eeToHadrons* eehadProcess = (G4eeToHadrons*) + theProcessTable->FindProcess("ee2hadr","e+"); + if(eehadProcess) eehadProcess->SetCrossSecFactor(fac); + else G4cout + << "Warning. No process ee2hadr found, SetAnnihiToHadronFac was ignored" + << G4endl; +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +void PhysicsList::AddPhysicsList(const G4String& name) +{ + if (verboseLevel>1) { + G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl; + } + + if (name == fEmName) { + return; + + } else if (name == "emstandard_opt0") { + + fEmName = name; + delete fEmPhysicsList; + fEmPhysicsList = new G4EmStandardPhysics(); + + } else if (name == "emstandard_opt1") { + + fEmName = name; + delete fEmPhysicsList; + fEmPhysicsList = new G4EmStandardPhysics_option1(); + + } else if (name == "emstandard_opt2") { + + fEmName = name; + delete fEmPhysicsList; + fEmPhysicsList = new G4EmStandardPhysics_option2(); + + } else if (name == "emstandard_opt3") { + + fEmName = name; + delete fEmPhysicsList; + fEmPhysicsList = new G4EmStandardPhysics_option3(); + + } else if (name == "emstandard_opt4") { + + fEmName = name; + delete fEmPhysicsList; + fEmPhysicsList = new G4EmStandardPhysics_option4(); + + } else if (name == "emlivermore") { + + fEmName = name; + delete fEmPhysicsList; + fEmPhysicsList = new G4EmLivermorePhysics(); + + } else if (name == "empenelope") { + + fEmName = name; + delete fEmPhysicsList; + fEmPhysicsList = new G4EmPenelopePhysics(); + + } else if (name == "emlowenergy") { + + fEmName = name; + delete fEmPhysicsList; + fEmPhysicsList = new G4EmLowEPPhysics(); + + } else if (name == "emstandardGS") { + + fEmName = name; + delete fEmPhysicsList; + fEmPhysicsList = new G4EmStandardPhysicsGS(); + + } else if (name == "emstandardSS") { + + fEmName = name; + delete fEmPhysicsList; + fEmPhysicsList = new G4EmStandardPhysicsSS(); + + } else if (name == "emstandardWVI") { + + fEmName = name; + delete fEmPhysicsList; + fEmPhysicsList = new G4EmStandardPhysicsWVI(); + + } else { + + G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" + << " is not defined" + << G4endl; + } +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +void PhysicsList::AddStepMax() +{ + //Step limitation seen as a process + + auto particleIterator=GetParticleIterator(); + particleIterator->reset(); + while ((*particleIterator)()) + { + G4ParticleDefinition* particle = particleIterator->value(); + G4ProcessManager* pmanager = particle->GetProcessManager(); + + if (fStepMaxProcess->IsApplicable(*particle)) + { + pmanager ->AddDiscreteProcess(fStepMaxProcess); + } + } +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + diff --git a/LHCbG4Tests/G4GammaToDiLeptonConversionTest/src/PhysicsListMessenger.cc b/LHCbG4Tests/G4GammaToDiLeptonConversionTest/src/PhysicsListMessenger.cc new file mode 100644 index 0000000000000000000000000000000000000000..427d493cd71bd4138608d89257c7fc065d01e2f2 --- /dev/null +++ b/LHCbG4Tests/G4GammaToDiLeptonConversionTest/src/PhysicsListMessenger.cc @@ -0,0 +1,126 @@ +// +// ******************************************************************** +// * License and Disclaimer * +// * * +// * The Geant4 software is copyright of the Copyright Holders of * +// * the Geant4 Collaboration. It is provided under the terms and * +// * conditions of the Geant4 Software License, included in the file * +// * LICENSE and available at http://cern.ch/geant4/license . These * +// * include a list of copyright holders. * +// * * +// * Neither the authors of this software system, nor their employing * +// * institutes,nor the agencies providing financial support for this * +// * work make any representation or warranty, express or implied, * +// * regarding this software system or assume any liability for its * +// * use. Please see the license in the file LICENSE and URL above * +// * for the full disclaimer and the limitation of liability. * +// * * +// * This code implementation is the result of the scientific and * +// * technical work of the GEANT4 collaboration. * +// * By using, copying, modifying or distributing the software (or * +// * any work based on the software) you agree to acknowledge its * +// * use in resulting scientific publications, and indicate your * +// * acceptance of all terms of the Geant4 Software license. * +// ******************************************************************** +// +/// \file electromagnetic/TestEm6/src/PhysicsListMessenger.cc +/// \brief Implementation of the PhysicsListMessenger class +// +// $Id: PhysicsListMessenger.cc 83428 2014-08-21 15:46:01Z gcosmo $ +// +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +#include "PhysicsListMessenger.hh" + +#include "PhysicsList.hh" +#include "Geant4/G4UIdirectory.hh" +#include "Geant4/G4UIcmdWithADouble.hh" +#include "Geant4/G4UIcmdWithAString.hh" + + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +PhysicsListMessenger::PhysicsListMessenger(PhysicsList* physL) +:G4UImessenger(),fPhysList(physL), + fPhysDir(0), + fGammaToMuPairFacCmd(0), + fAnnihiToMuPairFacCmd(0), + fAnnihiToHadronFacCmd(0), + fListCmd(0) +{ + fPhysDir = new G4UIdirectory("/testem/phys/"); + fPhysDir->SetGuidance("physics list commands"); + + fGammaToMuPairFacCmd=new G4UIcmdWithADouble + ("/testem/phys/SetGammaToMuPairFac",this); + fGammaToMuPairFacCmd->SetGuidance( + "Set factor to artificially increase the GammaToMuPair cross section"); + fGammaToMuPairFacCmd->SetParameterName("GammaToMuPairFac",false); + fGammaToMuPairFacCmd->SetRange("GammaToMuPairFac>0.0"); + fGammaToMuPairFacCmd->AvailableForStates(G4State_PreInit,G4State_Idle); + + fGammaToEPairFacCmd=new G4UIcmdWithADouble + ("/testem/phys/SetGammaToEPairFac",this); + fGammaToEPairFacCmd->SetGuidance( + "Set factor to artificially increase the GammaToEPair cross section"); + fGammaToEPairFacCmd->SetParameterName("GammaToEPairFac",false); + fGammaToEPairFacCmd->SetRange("GammaToMuPairFac>0.0"); + fGammaToEPairFacCmd->AvailableForStates(G4State_PreInit,G4State_Idle); + + fAnnihiToMuPairFacCmd=new G4UIcmdWithADouble + ("/testem/phys/SetAnnihiToMuPairFac",this); + fAnnihiToMuPairFacCmd->SetGuidance( + "Set factor to artificially increase the AnnihiToMuPair cross section"); + fAnnihiToMuPairFacCmd->SetParameterName("AnnihiToMuPairFac",false); + fAnnihiToMuPairFacCmd->SetRange("AnnihiToMuPairFac>0.0"); + fAnnihiToMuPairFacCmd->AvailableForStates(G4State_PreInit,G4State_Idle); + + fAnnihiToHadronFacCmd= + new G4UIcmdWithADouble("/testem/phys/SetAnnihiToHadronFac",this); + fAnnihiToHadronFacCmd->SetGuidance( + "Set factor to artificially increase the AnnihiToHadrons cross section"); + fAnnihiToHadronFacCmd->SetParameterName("AnnihiToHadFac",false); + fAnnihiToHadronFacCmd->SetRange("AnnihiToHadFac>0.0"); + fAnnihiToHadronFacCmd->AvailableForStates(G4State_PreInit,G4State_Idle); + + fListCmd = new G4UIcmdWithAString("/testem/phys/addPhysics",this); + fListCmd->SetGuidance("Add modula physics list."); + fListCmd->SetParameterName("PList",false); + fListCmd->AvailableForStates(G4State_PreInit); +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +PhysicsListMessenger::~PhysicsListMessenger() +{ + delete fGammaToMuPairFacCmd; + delete fAnnihiToMuPairFacCmd; + delete fAnnihiToHadronFacCmd; + delete fPhysDir; + delete fListCmd; +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +void PhysicsListMessenger::SetNewValue(G4UIcommand* command, + G4String newValue) +{ + if(command == fGammaToMuPairFacCmd) + { fPhysList->SetGammaToMuPairFac( + fGammaToMuPairFacCmd->GetNewDoubleValue(newValue));} + + if( command == fAnnihiToMuPairFacCmd) + { fPhysList->SetAnnihiToMuPairFac( + fAnnihiToMuPairFacCmd->GetNewDoubleValue(newValue));} + + if( command == fAnnihiToHadronFacCmd) + { fPhysList->SetAnnihiToHadronFac( + fAnnihiToHadronFacCmd->GetNewDoubleValue(newValue));} + + if( command == fListCmd ) + { fPhysList->AddPhysicsList(newValue); } + +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... diff --git a/LHCbG4Tests/G4GammaToDiLeptonConversionTest/src/PrimaryGeneratorAction.cc b/LHCbG4Tests/G4GammaToDiLeptonConversionTest/src/PrimaryGeneratorAction.cc new file mode 100644 index 0000000000000000000000000000000000000000..9141a2f4366cd26aa2270fc9b31c05a62a961d89 --- /dev/null +++ b/LHCbG4Tests/G4GammaToDiLeptonConversionTest/src/PrimaryGeneratorAction.cc @@ -0,0 +1,84 @@ +// +// ******************************************************************** +// * License and Disclaimer * +// * * +// * The Geant4 software is copyright of the Copyright Holders of * +// * the Geant4 Collaboration. It is provided under the terms and * +// * conditions of the Geant4 Software License, included in the file * +// * LICENSE and available at http://cern.ch/geant4/license . These * +// * include a list of copyright holders. * +// * * +// * Neither the authors of this software system, nor their employing * +// * institutes,nor the agencies providing financial support for this * +// * work make any representation or warranty, express or implied, * +// * regarding this software system or assume any liability for its * +// * use. Please see the license in the file LICENSE and URL above * +// * for the full disclaimer and the limitation of liability. * +// * * +// * This code implementation is the result of the scientific and * +// * technical work of the GEANT4 collaboration. * +// * By using, copying, modifying or distributing the software (or * +// * any work based on the software) you agree to acknowledge its * +// * use in resulting scientific publications, and indicate your * +// * acceptance of all terms of the Geant4 Software license. * +// ******************************************************************** +// +/// \file electromagnetic/TestEm6/src/PrimaryGeneratorAction.cc +/// \brief Implementation of the PrimaryGeneratorAction class +// +// $Id: PrimaryGeneratorAction.cc 67268 2013-02-13 11:38:40Z ihrivnac $ +// +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +#include "PrimaryGeneratorAction.hh" + +#include "DetectorConstruction.hh" +#include "PrimaryGeneratorMessenger.hh" + +#include "Geant4/G4Event.hh" +#include "Geant4/G4ParticleGun.hh" +#include "Geant4/G4ParticleTable.hh" +#include "Geant4/G4ParticleDefinition.hh" +#include "Geant4/G4SystemOfUnits.hh" + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +PrimaryGeneratorAction::PrimaryGeneratorAction( + DetectorConstruction* DC, G4double energy, G4int nevts) +:G4VUserPrimaryGeneratorAction(), + fParticleGun(0), + fDetector(DC), + fGunMessenger(0) +{ + fParticleGun = new G4ParticleGun(nevts); + G4ParticleDefinition* particle + = G4ParticleTable::GetParticleTable()->FindParticle("gamma"); + fParticleGun->SetParticleDefinition(particle); + fParticleGun->SetParticleEnergy(energy*GeV); + fParticleGun->SetParticleMomentumDirection(G4ThreeVector(1.,0.,0.)); + + //create a messenger for this class + fGunMessenger = new PrimaryGeneratorMessenger(this); +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +PrimaryGeneratorAction::~PrimaryGeneratorAction() +{ + delete fParticleGun; + delete fGunMessenger; +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +void PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent) +{ + //this function is called at the begining of event + // + fParticleGun->SetParticlePosition(G4ThreeVector(-0.5*(fDetector->GetBoxDepth()),0.*cm,0.*cm)); + fParticleGun->GeneratePrimaryVertex(anEvent); +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + diff --git a/LHCbG4Tests/G4GammaToDiLeptonConversionTest/src/PrimaryGeneratorMessenger.cc b/LHCbG4Tests/G4GammaToDiLeptonConversionTest/src/PrimaryGeneratorMessenger.cc new file mode 100644 index 0000000000000000000000000000000000000000..e778f31a20b21254b911393ad7e1befd8ebe8267 --- /dev/null +++ b/LHCbG4Tests/G4GammaToDiLeptonConversionTest/src/PrimaryGeneratorMessenger.cc @@ -0,0 +1,59 @@ +// +// ******************************************************************** +// * License and Disclaimer * +// * * +// * The Geant4 software is copyright of the Copyright Holders of * +// * the Geant4 Collaboration. It is provided under the terms and * +// * conditions of the Geant4 Software License, included in the file * +// * LICENSE and available at http://cern.ch/geant4/license . These * +// * include a list of copyright holders. * +// * * +// * Neither the authors of this software system, nor their employing * +// * institutes,nor the agencies providing financial support for this * +// * work make any representation or warranty, express or implied, * +// * regarding this software system or assume any liability for its * +// * use. Please see the license in the file LICENSE and URL above * +// * for the full disclaimer and the limitation of liability. * +// * * +// * This code implementation is the result of the scientific and * +// * technical work of the GEANT4 collaboration. * +// * By using, copying, modifying or distributing the software (or * +// * any work based on the software) you agree to acknowledge its * +// * use in resulting scientific publications, and indicate your * +// * acceptance of all terms of the Geant4 Software license. * +// ******************************************************************** +// +/// \file electromagnetic/TestEm6/src/PrimaryGeneratorMessenger.cc +/// \brief Implementation of the PrimaryGeneratorMessenger class +// +// $Id: PrimaryGeneratorMessenger.cc 67268 2013-02-13 11:38:40Z ihrivnac $ +// +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +#include "PrimaryGeneratorMessenger.hh" + +#include "PrimaryGeneratorAction.hh" +#include "Geant4/G4UIdirectory.hh" +#include "Geant4/G4UIcmdWithADouble.hh" + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +PrimaryGeneratorMessenger::PrimaryGeneratorMessenger( + PrimaryGeneratorAction* Gun) +:G4UImessenger(),fAction(Gun), + fGunDir(0) +{ + fGunDir = new G4UIdirectory("/testem/gun/"); + fGunDir->SetGuidance("gun control"); + +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +PrimaryGeneratorMessenger::~PrimaryGeneratorMessenger() +{ + delete fGunDir; +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... diff --git a/LHCbG4Tests/G4GammaToDiLeptonConversionTest/src/RunAction.cc b/LHCbG4Tests/G4GammaToDiLeptonConversionTest/src/RunAction.cc new file mode 100644 index 0000000000000000000000000000000000000000..8ba8a0f73b41b12eba8074df76b4c3d8a75c45a9 --- /dev/null +++ b/LHCbG4Tests/G4GammaToDiLeptonConversionTest/src/RunAction.cc @@ -0,0 +1,172 @@ +// +// ******************************************************************** +// * License and Disclaimer * +// * * +// * The Geant4 software is copyright of the Copyright Holders of * +// * the Geant4 Collaboration. It is provided under the terms and * +// * conditions of the Geant4 Software License, included in the file * +// * LICENSE and available at http://cern.ch/geant4/license . These * +// * include a list of copyright holders. * +// * * +// * Neither the authors of this software system, nor their employing * +// * institutes,nor the agencies providing financial support for this * +// * work make any representation or warranty, express or implied, * +// * regarding this software system or assume any liability for its * +// * use. Please see the license in the file LICENSE and URL above * +// * for the full disclaimer and the limitation of liability. * +// * * +// * This code implementation is the result of the scientific and * +// * technical work of the GEANT4 collaboration. * +// * By using, copying, modifying or distributing the software (or * +// * any work based on the software) you agree to acknowledge its * +// * use in resulting scientific publications, and indicate your * +// * acceptance of all terms of the Geant4 Software license. * +// ******************************************************************** +// +/// \file electromagnetic/TestEm6/src/RunAction.cc +/// \brief Implementation of the RunAction class +// +// $Id: RunAction.cc 83428 2014-08-21 15:46:01Z gcosmo $ +// +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +#include "Geant4/G4SystemOfUnits.hh" +#include "Geant4/G4PhysicalConstants.hh" +#include "Geant4/G4EmCalculator.hh" +#include "Geant4/G4ParticleTable.hh" +#include "Geant4/G4ParticleDefinition.hh" +#include "Geant4/G4Positron.hh" +#include "Geant4/G4AnnihiToMuPair.hh" +#include "Geant4/G4eeToHadrons.hh" +#include "Geant4/G4eeToHadronsModel.hh" +#include "Geant4/G4eBremsstrahlung.hh" + +#include "RunAction.hh" +#include "Geant4/G4Run.hh" +#include "Geant4/G4RunManager.hh" +#include "Geant4/G4MuonMinus.hh" + +#include <sstream> + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +RunAction::RunAction(DetectorConstruction* det, G4double e, G4double t, G4int n, G4String dir) + : G4UserRunAction(),fDetector(det),fProcCounter(0),fAnalysis(0),fMat(0) +{ + std::stringstream file_name; + file_name << dir; + file_name << "/TestEM6_Al_"; + file_name << t; + file_name << "mm_"; + file_name << e; + file_name << "GeV_"; + file_name << n; + file_name << ".root"; + + fileName = file_name.str(); + + fMinE = 40*GeV; + fMaxE = 10000*GeV; + fnBin = 10000; + fNtColId[0] = fNtColId[1] = fNtColId[2] = 0; +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +RunAction::~RunAction() +{} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +void RunAction::BeginOfRunAction(const G4Run* aRun) +{ + G4cout << "### Run " << aRun->GetRunID() << " start." << G4endl; + + //get material + // + fMat = fDetector->GetMaterial(); + G4cout << "###RunAction::BeginOfRunAction Material:" + << fMat->GetName() << G4endl; + + fProcCounter = new ProcessesCount; + + fAnalysis = G4AnalysisManager::Instance(); + + // Open an output file + // + fAnalysis->OpenFile(fileName); + fAnalysis->SetVerboseLevel(2); + + //=========================================================== + + fAnalysis->CreateNtuple("DiMuon", "DiMuon Production"); + fAnalysis->CreateNtupleDColumn("DiMuon_EnergyFracPlus"); + fAnalysis->CreateNtupleDColumn("DiMuon_EnergyFracMinus"); + fAnalysis->CreateNtupleDColumn("DiMuon_ThetaPlus"); + fAnalysis->CreateNtupleDColumn("DiMuon_ThetaMinus"); + fAnalysis->CreateNtupleDColumn("DiMuon_InvMass"); + fAnalysis->CreateNtupleDColumn("DiMuon_PX_Plus"); + fAnalysis->CreateNtupleDColumn("DiMuon_PY_Plus"); + fAnalysis->CreateNtupleDColumn("DiMuon_PZ_Plus"); + fAnalysis->CreateNtupleDColumn("DiMuon_PX_Minus"); + fAnalysis->CreateNtupleDColumn("DiMuon_PY_Minus"); + fAnalysis->CreateNtupleDColumn("DiMuon_PZ_Minus"); + fAnalysis->CreateNtupleDColumn("DiMuon_ThetaSep"); //Separation Angle Between DiLeptons + fAnalysis->FinishNtuple(); + + fAnalysis->CreateNtuple("DiElectron", "DiElectron Production"); + fAnalysis->CreateNtupleDColumn("DiElectron_EnergyFracPlus"); + fAnalysis->CreateNtupleDColumn("DiElectron_EnergyFracMinus"); + fAnalysis->CreateNtupleDColumn("DiElectron_ThetaPlus"); + fAnalysis->CreateNtupleDColumn("DiElectron_ThetaMinus"); + fAnalysis->CreateNtupleDColumn("DiElectron_InvMass"); + fAnalysis->CreateNtupleDColumn("DiElectron_PX_Plus"); + fAnalysis->CreateNtupleDColumn("DiElectron_PY_Plus"); + fAnalysis->CreateNtupleDColumn("DiElectron_PZ_Plus"); + fAnalysis->CreateNtupleDColumn("DiElectron_PX_Minus"); + fAnalysis->CreateNtupleDColumn("DiElectron_PY_Minus"); + fAnalysis->CreateNtupleDColumn("DiElectron_PZ_Minus"); + fAnalysis->CreateNtupleDColumn("DiElectron_ThetaSep"); //Separation Angle Between DiLeptons + fAnalysis->FinishNtuple(); + + G4cout << "\n----> NTuple file is opened in " << fileName << G4endl; +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +void RunAction::CountProcesses(G4String procName) +{ + //does the process already encounted ? + // + size_t nbProc = fProcCounter->size(); + size_t i = 0; + while ((i<nbProc)&&((*fProcCounter)[i]->GetName()!=procName)) i++; + if (i == nbProc) fProcCounter->push_back( new OneProcessCount(procName)); + + (*fProcCounter)[i]->Count(); +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +void RunAction::EndOfRunAction(const G4Run*) +{ + G4double countTot = 0.; + G4cout << "\n Number of process calls --->"; + for (size_t i=0; i< fProcCounter->size();i++) { + G4String procName = (*fProcCounter)[i]->GetName(); + if (procName != "Transportation") { + G4int count = (*fProcCounter)[i]->GetCounter(); + G4cout << "\t" << procName << " : " << count; + countTot += count; + } + } + + fAnalysis->Write(); + fAnalysis->CloseFile(); + + delete fAnalysis; + G4cout << G4endl; +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... diff --git a/LHCbG4Tests/G4GammaToDiLeptonConversionTest/src/StackingAction.cc b/LHCbG4Tests/G4GammaToDiLeptonConversionTest/src/StackingAction.cc new file mode 100644 index 0000000000000000000000000000000000000000..f960b07699df49ec7ab5ca3b48fd15b7a25a1d25 --- /dev/null +++ b/LHCbG4Tests/G4GammaToDiLeptonConversionTest/src/StackingAction.cc @@ -0,0 +1,62 @@ +// +// ******************************************************************** +// * License and Disclaimer * +// * * +// * The Geant4 software is copyright of the Copyright Holders of * +// * the Geant4 Collaboration. It is provided under the terms and * +// * conditions of the Geant4 Software License, included in the file * +// * LICENSE and available at http://cern.ch/geant4/license . These * +// * include a list of copyright holders. * +// * * +// * Neither the authors of this software system, nor their employing * +// * institutes,nor the agencies providing financial support for this * +// * work make any representation or warranty, express or implied, * +// * regarding this software system or assume any liability for its * +// * use. Please see the license in the file LICENSE and URL above * +// * for the full disclaimer and the limitation of liability. * +// * * +// * This code implementation is the result of the scientific and * +// * technical work of the GEANT4 collaboration. * +// * By using, copying, modifying or distributing the software (or * +// * any work based on the software) you agree to acknowledge its * +// * use in resulting scientific publications, and indicate your * +// * acceptance of all terms of the Geant4 Software license. * +// ******************************************************************** +// +/// \file electromagnetic/TestEm6/src/StackingAction.cc +/// \brief Implementation of the StackingAction class +// +// $Id: StackingAction.cc 67268 2013-02-13 11:38:40Z ihrivnac $ +// +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +#include "StackingAction.hh" +#include "Geant4/G4Track.hh" +#include "Geant4/G4TrackStatus.hh" + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +StackingAction::StackingAction() + : G4UserStackingAction() +{} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +StackingAction::~StackingAction() +{} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +G4ClassificationOfNewTrack +StackingAction::ClassifyNewTrack(const G4Track* aTrack) +{ + G4ClassificationOfNewTrack classification = fUrgent; + + // kill all secondaries + if(aTrack->GetParentID() != 0) classification = fKill; + + return classification; +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... diff --git a/LHCbG4Tests/G4GammaToDiLeptonConversionTest/src/StepMax.cc b/LHCbG4Tests/G4GammaToDiLeptonConversionTest/src/StepMax.cc new file mode 100644 index 0000000000000000000000000000000000000000..2790d7d7898eac593f9029be4cc569714073f7ef --- /dev/null +++ b/LHCbG4Tests/G4GammaToDiLeptonConversionTest/src/StepMax.cc @@ -0,0 +1,98 @@ +// +// ******************************************************************** +// * License and Disclaimer * +// * * +// * The Geant4 software is copyright of the Copyright Holders of * +// * the Geant4 Collaboration. It is provided under the terms and * +// * conditions of the Geant4 Software License, included in the file * +// * LICENSE and available at http://cern.ch/geant4/license . These * +// * include a list of copyright holders. * +// * * +// * Neither the authors of this software system, nor their employing * +// * institutes,nor the agencies providing financial support for this * +// * work make any representation or warranty, express or implied, * +// * regarding this software system or assume any liability for its * +// * use. Please see the license in the file LICENSE and URL above * +// * for the full disclaimer and the limitation of liability. * +// * * +// * This code implementation is the result of the scientific and * +// * technical work of the GEANT4 collaboration. * +// * By using, copying, modifying or distributing the software (or * +// * any work based on the software) you agree to acknowledge its * +// * use in resulting scientific publications, and indicate your * +// * acceptance of all terms of the Geant4 Software license. * +// ******************************************************************** +// +/// \file electromagnetic/TestEm6/src/StepMax.cc +/// \brief Implementation of the StepMax class +// +// $Id: StepMax.cc 67268 2013-02-13 11:38:40Z ihrivnac $ +// +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +#include "StepMax.hh" +#include "StepMaxMessenger.hh" +#include "Geant4/G4VPhysicalVolume.hh" + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +StepMax::StepMax(const G4String& processName) + : G4VDiscreteProcess(processName), + fMaxChargedStep(DBL_MAX), + fMessenger(0) +{ + fMessenger = new StepMaxMessenger(this); +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +StepMax::~StepMax() +{ + delete fMessenger; +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +G4bool StepMax::IsApplicable(const G4ParticleDefinition& particle) +{ + return (particle.GetPDGCharge() != 0.); +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +void StepMax::SetMaxStep(G4double step) +{ + fMaxChargedStep = step; +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +G4double +StepMax::PostStepGetPhysicalInteractionLength(const G4Track&, + G4double, + G4ForceCondition* condition) +{ + // condition is set to "Not Forced" + *condition = NotForced; + fProposedStep = fMaxChargedStep; + + return fProposedStep; +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +G4VParticleChange* StepMax::PostStepDoIt(const G4Track& aTrack, const G4Step&) +{ + aParticleChange.Initialize(aTrack); + return &aParticleChange; +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +G4double StepMax::GetMeanFreePath(const G4Track&, G4double, G4ForceCondition*) +{ + return 0.; +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... diff --git a/LHCbG4Tests/G4GammaToDiLeptonConversionTest/src/StepMaxMessenger.cc b/LHCbG4Tests/G4GammaToDiLeptonConversionTest/src/StepMaxMessenger.cc new file mode 100644 index 0000000000000000000000000000000000000000..d99fcda03a7efb2b4ca836cd2e6ce456235e17fb --- /dev/null +++ b/LHCbG4Tests/G4GammaToDiLeptonConversionTest/src/StepMaxMessenger.cc @@ -0,0 +1,68 @@ +// +// ******************************************************************** +// * License and Disclaimer * +// * * +// * The Geant4 software is copyright of the Copyright Holders of * +// * the Geant4 Collaboration. It is provided under the terms and * +// * conditions of the Geant4 Software License, included in the file * +// * LICENSE and available at http://cern.ch/geant4/license . These * +// * include a list of copyright holders. * +// * * +// * Neither the authors of this software system, nor their employing * +// * institutes,nor the agencies providing financial support for this * +// * work make any representation or warranty, express or implied, * +// * regarding this software system or assume any liability for its * +// * use. Please see the license in the file LICENSE and URL above * +// * for the full disclaimer and the limitation of liability. * +// * * +// * This code implementation is the result of the scientific and * +// * technical work of the GEANT4 collaboration. * +// * By using, copying, modifying or distributing the software (or * +// * any work based on the software) you agree to acknowledge its * +// * use in resulting scientific publications, and indicate your * +// * acceptance of all terms of the Geant4 Software license. * +// ******************************************************************** +// +/// \file electromagnetic/TestEm6/src/StepMaxMessenger.cc +/// \brief Implementation of the StepMaxMessenger class +// +// $Id: StepMaxMessenger.cc 67268 2013-02-13 11:38:40Z ihrivnac $ +// +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +#include "StepMaxMessenger.hh" + +#include "StepMax.hh" +#include "Geant4/G4UIcmdWithADoubleAndUnit.hh" +#include "Geant4/globals.hh" + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +StepMaxMessenger::StepMaxMessenger(StepMax* stepM) + :G4UImessenger(),fStepMax(stepM),fStepMaxCmd(0) +{ + fStepMaxCmd = new G4UIcmdWithADoubleAndUnit("/testem/stepmax",this); + fStepMaxCmd->SetGuidance("Set max allowed step length"); + fStepMaxCmd->SetParameterName("mxStep",false); + fStepMaxCmd->SetRange("mxStep>0."); + fStepMaxCmd->SetUnitCategory("Length"); + fStepMaxCmd->AvailableForStates(G4State_PreInit,G4State_Idle); +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +StepMaxMessenger::~StepMaxMessenger() +{ + delete fStepMaxCmd; +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +void StepMaxMessenger::SetNewValue(G4UIcommand* command, G4String newValue) +{ + if (command == fStepMaxCmd) + { fStepMax->SetMaxStep(fStepMaxCmd->GetNewDoubleValue(newValue));} +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... diff --git a/LHCbG4Tests/G4GammaToDiLeptonConversionTest/src/SteppingAction.cc b/LHCbG4Tests/G4GammaToDiLeptonConversionTest/src/SteppingAction.cc new file mode 100644 index 0000000000000000000000000000000000000000..906dbb61f6176bebb991c2e86f67c19411c071ee --- /dev/null +++ b/LHCbG4Tests/G4GammaToDiLeptonConversionTest/src/SteppingAction.cc @@ -0,0 +1,132 @@ +// +// ******************************************************************** +// * License and Disclaimer * +// * * +// * The Geant4 software is copyright of the Copyright Holders of * +// * the Geant4 Collaboration. It is provided under the terms and * +// * conditions of the Geant4 Software License, included in the file * +// * LICENSE and available at http://cern.ch/geant4/license . These * +// * include a list of copyright holders. * +// * * +// * Neither the authors of this software system, nor their employing * +// * institutes,nor the agencies providing financial support for this * +// * work make any representation or warranty, express or implied, * +// * regarding this software system or assume any liability for its * +// * use. Please see the license in the file LICENSE and URL above * +// * for the full disclaimer and the limitation of liability. * +// * * +// * This code implementation is the result of the scientific and * +// * technical work of the GEANT4 collaboration. * +// * By using, copying, modifying or distributing the software (or * +// * any work based on the software) you agree to acknowledge its * +// * use in resulting scientific publications, and indicate your * +// * acceptance of all terms of the Geant4 Software license. * +// ******************************************************************** +// +/// \file electromagnetic/TestEm6/src/SteppingAction.cc +/// \brief Implementation of the SteppingAction class +// +// $Id: SteppingAction.cc 83428 2014-08-21 15:46:01Z gcosmo $ +// +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +#include "SteppingAction.hh" +#include "RunAction.hh" +#include "Geant4/G4SteppingManager.hh" +#include "Geant4/G4VProcess.hh" + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +SteppingAction::SteppingAction(RunAction* RuAct) +:G4UserSteppingAction(),fRunAction(RuAct) +{ + fMuonMass = G4MuonPlus::MuonPlus()->GetPDGMass(); + fEMass = G4Positron::Positron()->GetPDGMass(); +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +SteppingAction::~SteppingAction() +{ } + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +void SteppingAction::UserSteppingAction(const G4Step* aStep) +{ + const G4VProcess* process = aStep->GetPostStepPoint()->GetProcessDefinedStep(); + if (process == 0) return; + G4String processName = process->GetProcessName(); + fRunAction->CountProcesses(processName); //count processes + + if (processName != "GammaToMuPair" && processName != "conv") return; + + G4StepPoint* PrePoint = aStep->GetPreStepPoint(); + G4double EGamma = PrePoint->GetTotalEnergy(); + G4ThreeVector PGamma = PrePoint->GetMomentum(); + + G4double Eplus(0), Eminus(0), ETot(0); + G4ThreeVector Pplus , Pminus, PTot; + const G4TrackVector* secondary = fpSteppingManager->GetSecondary(); + + G4double particle_mass = -1; + tuple_index = -1; + + if(processName == "conv") + { + particle_mass = fEMass; + tuple_index = 1; + } + else + { + particle_mass = fMuonMass; + tuple_index = 0; + } + + for (size_t lp=0; lp<(*secondary).size(); lp++) { + if ((*secondary)[lp]->GetDefinition()== muplus_def || (*secondary)[lp]->GetDefinition()== eplus_def) { + Eplus = (*secondary)[lp]->GetTotalEnergy(); + Pplus = (*secondary)[lp]->GetMomentum(); + } else { + Eminus = (*secondary)[lp]->GetTotalEnergy(); + Pminus = (*secondary)[lp]->GetMomentum(); + } + + ETot += (*secondary)[lp]->GetTotalEnergy(); + PTot += (*secondary)[lp]->GetMomentum(); + } + + G4double thetaSep = Pplus.angle(Pminus); + G4double xPlus = Eplus/EGamma, xMinus = Eminus/EGamma; + G4double thetaPlus = PGamma.angle(Pplus), thetaMinus = PGamma.angle(Pminus); + G4double GammaPlus = Eplus/particle_mass; + G4double GammaMinus= Eminus/particle_mass; + + G4AnalysisManager* analysisManager = G4AnalysisManager::Instance(); + + if(0.0 == thetaPlus || 0.0 == thetaMinus) { + G4cout << "SteppingAction for GammaToMuPair: " + << "thetaPlus= " << thetaPlus << " thetaMinus= " << thetaMinus + << " gamPlus= " << GammaPlus << " gamMinus= " << GammaMinus + << " " << thetaPlus *GammaPlus - thetaMinus*GammaMinus << G4endl; + return; + } + analysisManager->FillNtupleDColumn(tuple_index, 0, xPlus); + analysisManager->FillNtupleDColumn(tuple_index, 1, xMinus); + analysisManager->FillNtupleDColumn(tuple_index, 2, thetaPlus); + analysisManager->FillNtupleDColumn(tuple_index, 3, thetaMinus); + analysisManager->FillNtupleDColumn(tuple_index, 4, sqrt(pow(ETot,2)-pow(PTot.getR(),2))); + analysisManager->FillNtupleDColumn(tuple_index, 5, Pplus.x()); + analysisManager->FillNtupleDColumn(tuple_index, 6, Pplus.y()); + analysisManager->FillNtupleDColumn(tuple_index, 7, Pplus.z()); + analysisManager->FillNtupleDColumn(tuple_index, 8, Pminus.x()); + analysisManager->FillNtupleDColumn(tuple_index, 9, Pminus.y()); + analysisManager->FillNtupleDColumn(tuple_index, 10, Pminus.z()); + analysisManager->FillNtupleDColumn(tuple_index, 11, thetaSep); + analysisManager->AddNtupleRow(tuple_index); + +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + + diff --git a/LHCbG4Tests/G4GammaToDiLeptonConversionTest/src/SteppingVerbose.cc b/LHCbG4Tests/G4GammaToDiLeptonConversionTest/src/SteppingVerbose.cc new file mode 100644 index 0000000000000000000000000000000000000000..6a5103c7bdfbc17712769423548a14a5ae377b9a --- /dev/null +++ b/LHCbG4Tests/G4GammaToDiLeptonConversionTest/src/SteppingVerbose.cc @@ -0,0 +1,158 @@ +// +// ******************************************************************** +// * License and Disclaimer * +// * * +// * The Geant4 software is copyright of the Copyright Holders of * +// * the Geant4 Collaboration. It is provided under the terms and * +// * conditions of the Geant4 Software License, included in the file * +// * LICENSE and available at http://cern.ch/geant4/license . These * +// * include a list of copyright holders. * +// * * +// * Neither the authors of this software system, nor their employing * +// * institutes,nor the agencies providing financial support for this * +// * work make any representation or warranty, express or implied, * +// * regarding this software system or assume any liability for its * +// * use. Please see the license in the file LICENSE and URL above * +// * for the full disclaimer and the limitation of liability. * +// * * +// * This code implementation is the result of the scientific and * +// * technical work of the GEANT4 collaboration. * +// * By using, copying, modifying or distributing the software (or * +// * any work based on the software) you agree to acknowledge its * +// * use in resulting scientific publications, and indicate your * +// * acceptance of all terms of the Geant4 Software license. * +// ******************************************************************** +// +/// \file electromagnetic/TestEm6/src/SteppingVerbose.cc +/// \brief Implementation of the SteppingVerbose class +// +// +// $Id: SteppingVerbose.cc 98272 2016-07-04 17:56:04Z gcosmo $ +// +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +#include "SteppingVerbose.hh" + +#include "Geant4/G4SteppingManager.hh" +#include "Geant4/G4ParticleTypes.hh" +#include "Geant4/G4UnitsTable.hh" + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +SteppingVerbose::SteppingVerbose() + : G4SteppingVerbose() +{ } + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +SteppingVerbose::~SteppingVerbose() +{} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +void SteppingVerbose::TrackingStarted() +{ + CopyState(); + + G4int prec = G4cout.precision(3); + + //Step zero + // + if( verboseLevel > 0 ){ + G4cout << std::setw( 5) << "Step#" << " " + << std::setw( 6) << "X" << " " + << std::setw( 6) << "Y" << " " + << std::setw( 6) << "Z" << " " + << std::setw( 9) << "KineE" << " " + << std::setw( 9) << "dEStep" << " " + << std::setw(10) << "StepLeng" + << std::setw(10) << "TrakLeng" + << std::setw(10) << "Volume" << " " + << std::setw(10) << "Process" << G4endl; + + G4cout << std::setw(5) << fTrack->GetCurrentStepNumber() << " " + << std::setw(6) << G4BestUnit(fTrack->GetPosition().x(),"Length") + << std::setw(6) << G4BestUnit(fTrack->GetPosition().y(),"Length") + << std::setw(6) << G4BestUnit(fTrack->GetPosition().z(),"Length") + << std::setw(6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy") + << std::setw(6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy") + << std::setw(6) << G4BestUnit(fStep->GetStepLength(),"Length") + << std::setw(6) << G4BestUnit(fTrack->GetTrackLength(),"Length") + << std::setw(10) << fTrack->GetVolume()->GetName() + << " initStep" << G4endl; + } + G4cout.precision(prec); +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +void SteppingVerbose::StepInfo() +{ + CopyState(); + + G4int prec = G4cout.precision(3); + + if( verboseLevel >= 1 ){ + if( verboseLevel >= 4 ) VerboseTrack(); + if( verboseLevel >= 3 ){ + G4cout << G4endl; + G4cout << std::setw( 5) << "#Step#" << " " + << std::setw( 6) << "X" << " " + << std::setw( 6) << "Y" << " " + << std::setw( 6) << "Z" << " " + << std::setw( 9) << "KineE" << " " + << std::setw( 9) << "dEStep" << " " + << std::setw(10) << "StepLeng" + << std::setw(10) << "TrakLeng" + << std::setw(10) << "Volume" << " " + << std::setw(10) << "Process" << G4endl; + } + + G4cout << std::setw( 5) << fTrack->GetCurrentStepNumber() << " " + << std::setw(6) << G4BestUnit(fTrack->GetPosition().x(),"Length") + << std::setw(6) << G4BestUnit(fTrack->GetPosition().y(),"Length") + << std::setw(6) << G4BestUnit(fTrack->GetPosition().z(),"Length") + << std::setw(6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy") + << std::setw(6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy") + << std::setw(6) << G4BestUnit(fStep->GetStepLength(),"Length") + << std::setw(6) << G4BestUnit(fTrack->GetTrackLength(),"Length") + << std::setw(10) << fTrack->GetVolume()->GetName(); + + const G4VProcess* process + = fStep->GetPostStepPoint()->GetProcessDefinedStep(); + G4String procName = " UserLimit"; + if (process) procName = process->GetProcessName(); + if (fStepStatus == fWorldBoundary) procName = "OutOfWorld"; + G4cout << " " << std::setw(10) << procName; + G4cout << G4endl; + + if (verboseLevel == 2) { + const std::vector<const G4Track*>* secondary + = fStep->GetSecondaryInCurrentStep(); + size_t nbtrk = (*secondary).size(); + if (nbtrk) { + G4cout << "\n :----- List of secondaries ----------------" << G4endl; + G4cout.precision(4); + for (size_t lp=0; lp<(*secondary).size(); lp++) { + G4cout << " " + << std::setw(13) + << (*secondary)[lp]->GetDefinition()->GetParticleName() + << ": energy =" + << std::setw(6) + << G4BestUnit((*secondary)[lp]->GetKineticEnergy(),"Energy") + << " time =" + << std::setw(6) + << G4BestUnit((*secondary)[lp]->GetGlobalTime(),"Time"); + G4cout << G4endl; + } + + G4cout << " :------------------------------------------\n" << G4endl; + } + } + + } + G4cout.precision(prec); +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... diff --git a/LHCbG4Tests/G4MScInThinLayerTest/CMakeLists.txt b/LHCbG4Tests/G4MScInThinLayerTest/CMakeLists.txt index 0680977bf42063e3eea2140aecd1a50ee5e08d3c..2e00e1427c5d35ccb84d7abb332d98d12ee0de87 100644 --- a/LHCbG4Tests/G4MScInThinLayerTest/CMakeLists.txt +++ b/LHCbG4Tests/G4MScInThinLayerTest/CMakeLists.txt @@ -5,9 +5,9 @@ gaudi_depends_on_subdirs(LHCbG4PhysLists) find_package(CLHEP REQUIRED) find_package(ROOT COMPONENTS Hist Gpad RIO) +find_package(TBB) include_directories(SYSTEM ${CMAKE_INSTALL_PREFIX}/include ${CLHEP_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS}) -#include_directories(${CMAKE_INSTALL_PREFIX}/include) link_directories(${CMAKE_INSTALL_PREFIX}/lib) set(Geant4_LIBRARIES @@ -23,7 +23,7 @@ set(Geant4_LIBRARIES gaudi_add_executable(G4MScInThinLayerTest G4MScInThinLayerTest.cc src/*.cc INCLUDE_DIRS include CLHEP ROOT - LINK_LIBRARIES ${Geant4_LIBRARIES} CLHEP ROOT G4LHCblists) + LINK_LIBRARIES ${Geant4_LIBRARIES} CLHEP ROOT TBB G4LHCblists) add_dependencies(G4MScInThinLayerTest Geant4) diff --git a/ReleaseNotes/v104r1.md b/ReleaseNotes/v104r1.md new file mode 100644 index 0000000000000000000000000000000000000000..2fa98308ef5ba8a5412578bacd4e25bcf3b208f4 --- /dev/null +++ b/ReleaseNotes/v104r1.md @@ -0,0 +1,19 @@ +2018-04-25 Geant4 v104r1 +=== +This version uses LCG 91 (Gaudi v29r0) and Geant4Files v104r0. + +This version is released on `Sim10` branch. + +## Latest Changes + +#### GEANT4 + +Switched to Geant4 release `10.4.1`. + +#### LHCb G4 Physics Lists + +**[MR !31] Updated method name in PhysLists for 10.4.1** + +#### LHCb G4 Tests + +**[MR !31] Added new test G4GammaToDiLeptonConversionTest based on TestEm6**