Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Geant4 10.7 physics configurations update #33400

Merged
merged 7 commits into from Apr 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -13,8 +13,8 @@
#include "G4HadronPhysicsQGSP_FTFP_BERT.hh"

#include "SimG4Core/Physics/interface/PhysicsListFactory.h"
#include "SimG4Core/PhysicsLists/interface/CMSEmStandardPhysics.h"

#include "G4EmStandardPhysics_option1.hh"
#include "G4DecayPhysics.hh"
#include "G4EmExtraPhysics.hh"
#include "G4HadronElasticPhysics.hh"
Expand All @@ -29,7 +29,7 @@ LaserOpticalPhysics::LaserOpticalPhysics(const edm::ParameterSet &p) : PhysicsLi
<< std::endl;

// EM Physics
RegisterPhysics(new CMSEmStandardPhysics(ver));
RegisterPhysics(new G4EmStandardPhysics_option1(ver));
// Synchroton Radiation & GN Physics
RegisterPhysics(new G4EmExtraPhysics(ver));
// Decays
Expand Down
7 changes: 5 additions & 2 deletions SimG4Core/Application/interface/LowEnergyFastSimModel.h
Expand Up @@ -10,6 +10,8 @@
#include "G4Region.hh"
#include "G4Types.hh"

class TrackingAction;

class LowEnergyFastSimModel : public G4VFastSimulationModel {
public:
LowEnergyFastSimModel(const G4String& name, G4Region* region, const edm::ParameterSet& parSet);
Expand All @@ -19,8 +21,9 @@ class LowEnergyFastSimModel : public G4VFastSimulationModel {
void DoIt(const G4FastTrack& fastTrack, G4FastStep& fastStep) override;

private:
const G4double fEmax;
const G4Envelope* const fRegion;
G4double fEmax;
const G4Envelope* fRegion;
const TrackingAction* fTrackingAction;
GFlashHitMaker fHitMaker;
LowEnergyFastSimParam param;
};
Expand Down
1 change: 0 additions & 1 deletion SimG4Core/Application/interface/RunManagerMT.h
Expand Up @@ -102,7 +102,6 @@ class RunManagerMT {
const std::string m_PhysicsTablesDir;
bool m_StorePhysicsTables;
bool m_RestorePhysicsTables;
bool m_UseParametrisedEMPhysics;
bool m_check;
edm::ParameterSet m_pPhysics;
edm::ParameterSet m_pRunAction;
Expand Down
14 changes: 11 additions & 3 deletions SimG4Core/Application/python/g4SimHits_cfi.py
Expand Up @@ -162,6 +162,14 @@
CutsOnProton = cms.bool(True),
DefaultCutValue = cms.double(1.0), ## cuts in cm
G4BremsstrahlungThreshold = cms.double(0.5), ## cut in GeV
G4MuonBremsstrahlungThreshold = cms.double(10000.), ## cut in GeV
G4MscRangeFactor = cms.double(0.04),
G4MscGeomFactor = cms.double(2.5),
G4MscSafetyFactor = cms.double(0.6),
G4MscLambdaLimit = cms.double(1.0), # mm
G4MscStepLimit = cms.string("UseSafety"),
G4GeneralProcess = cms.bool(False),
ReadMuonData = cms.bool(False),
Verbosity = cms.untracked.int32(0),
# 1 will print cuts as they get set from DD
# 2 will do as 1 + will dump Geant4 table of cuts
Expand All @@ -188,7 +196,7 @@
EmaxFTFP = cms.double(25.), # in GeV
EmaxBERTpi = cms.double(12.), # in GeV
LowEnergyGflashEcal = cms.bool(False),
LowEnergyGflashEcalEmax = cms.double(100),
LowEnergyGflashEcalEmax = cms.double(0.02), # in GeV
civanch marked this conversation as resolved.
Show resolved Hide resolved
GflashEcal = cms.bool(False),
GflashHcal = cms.bool(False),
GflashEcalHad = cms.bool(False),
Expand Down Expand Up @@ -216,8 +224,8 @@
EnergyRMSE = cms.vdouble(0.0,0.0),
MinStepLimit = cms.double(1.0),
ModifyTransportation = cms.bool(False),
ThresholdWarningEnergy = cms.untracked.double(100.0),
ThresholdImportantEnergy = cms.untracked.double(250.0),
ThresholdWarningEnergy = cms.untracked.double(100.0), #in MeV
ThresholdImportantEnergy = cms.untracked.double(250.0), #in MeV
ThresholdTrials = cms.untracked.int32(10)
),
Generator = cms.PSet(
Expand Down
17 changes: 13 additions & 4 deletions SimG4Core/Application/src/LowEnergyFastSimModel.cc
Expand Up @@ -2,8 +2,10 @@
#include "FWCore/MessageLogger/interface/MessageLogger.h"

#include "SimG4Core/Application/interface/LowEnergyFastSimModel.h"
#include "SimG4Core/Application/interface/TrackingAction.h"

#include "G4VFastSimulationModel.hh"
#include "G4EventManager.hh"
#include "G4Electron.hh"
#include "GFlashHitMaker.hh"
#include "G4Region.hh"
Expand All @@ -12,16 +14,23 @@
constexpr double twomass = 2 * CLHEP::electron_mass_c2;

LowEnergyFastSimModel::LowEnergyFastSimModel(const G4String& name, G4Region* region, const edm::ParameterSet& parSet)
: G4VFastSimulationModel(name, region),
fEmax(parSet.getParameter<double>("LowEnergyGflashEcalEmax")),
fRegion(region) {}
: G4VFastSimulationModel(name, region), fRegion(region), fTrackingAction(nullptr) {
fEmax = parSet.getParameter<double>("LowEnergyGflashEcalEmax") * CLHEP::GeV;
}

G4bool LowEnergyFastSimModel::IsApplicable(const G4ParticleDefinition& particle) {
return (11 == std::abs(particle.GetPDGEncoding()));
}

G4bool LowEnergyFastSimModel::ModelTrigger(const G4FastTrack& fastTrack) {
G4double energy = fastTrack.GetPrimaryTrack()->GetKineticEnergy();
const G4Track* track = fastTrack.GetPrimaryTrack();
if (nullptr == fTrackingAction) {
fTrackingAction = static_cast<const TrackingAction*>(G4EventManager::GetEventManager()->GetUserTrackingAction());
}
int pdgMother = std::abs(fTrackingAction->geant4Track()->GetDefinition()->GetPDGEncoding());
if (pdgMother == 11 || pdgMother == 22)
return false;
G4double energy = track->GetKineticEnergy();
return energy < fEmax && fRegion == fastTrack.GetEnvelope();
}

Expand Down
11 changes: 9 additions & 2 deletions SimG4Core/Application/src/ParametrisedEMPhysics.cc
Expand Up @@ -66,13 +66,20 @@ G4ThreadLocal ParametrisedEMPhysics::TLSmod* ParametrisedEMPhysics::m_tpmod = nu

ParametrisedEMPhysics::ParametrisedEMPhysics(const std::string& name, const edm::ParameterSet& p)
: G4VPhysicsConstructor(name), theParSet(p) {
// bremsstrahlung threshold and EM verbosity
G4EmParameters* param = G4EmParameters::Instance();
G4int verb = theParSet.getUntrackedParameter<int>("Verbosity", 0);
param->SetVerbose(verb);

G4double bremth = theParSet.getParameter<double>("G4BremsstrahlungThreshold") * GeV;
G4double bremth = theParSet.getParameter<double>("G4BremsstrahlungThreshold") * CLHEP::GeV;
param->SetBremsstrahlungTh(bremth);
G4double mubrth = theParSet.getParameter<double>("G4MuonBremsstrahlungThreshold") * CLHEP::GeV;
param->SetMuHadBremsstrahlungTh(mubrth);

bool genp = theParSet.getParameter<bool>("G4GeneralProcess");
param->SetGeneralProcessActive(genp);

bool mudat = theParSet.getParameter<bool>("ReadMuonData");
param->SetRetrieveMuDataFromFile(mudat);

bool fluo = theParSet.getParameter<bool>("FlagFluo");
param->SetFluo(fluo);
Expand Down
4 changes: 1 addition & 3 deletions SimG4Core/Application/src/RunManagerMT.cc
Expand Up @@ -70,7 +70,6 @@ RunManagerMT::RunManagerMT(edm::ParameterSet const& p)
m_PhysicsTablesDir(p.getUntrackedParameter<std::string>("PhysicsTablesDirectory", "")),
m_StorePhysicsTables(p.getUntrackedParameter<bool>("StorePhysicsTables", false)),
m_RestorePhysicsTables(p.getUntrackedParameter<bool>("RestorePhysicsTables", false)),
m_UseParametrisedEMPhysics(p.getUntrackedParameter<bool>("UseParametrisedEMPhysics")),
m_pPhysics(p.getParameter<edm::ParameterSet>("Physics")),
m_pRunAction(p.getParameter<edm::ParameterSet>("RunAction")),
m_g4overlap(p.getUntrackedParameter<edm::ParameterSet>("G4CheckOverlap")),
Expand Down Expand Up @@ -171,8 +170,7 @@ void RunManagerMT::initG4(const DDCompactView* pDD,

// adding GFlash, Russian Roulette for eletrons and gamma,
// step limiters on top of any Physics Lists
if (m_UseParametrisedEMPhysics)
phys->RegisterPhysics(new ParametrisedEMPhysics("EMoptions", m_pPhysics));
phys->RegisterPhysics(new ParametrisedEMPhysics("EMoptions", m_pPhysics));

if (m_RestorePhysicsTables) {
m_physicsList->SetPhysicsTableRetrieved(m_PhysicsTablesDir);
Expand Down
10 changes: 9 additions & 1 deletion SimG4Core/PhysicsLists/interface/CMSEmStandardPhysics.h
Expand Up @@ -3,16 +3,24 @@

#include "G4VPhysicsConstructor.hh"
#include "globals.hh"
#include "G4MscStepLimitType.hh"

#include "FWCore/ParameterSet/interface/ParameterSet.h"

class CMSEmStandardPhysics : public G4VPhysicsConstructor {
public:
CMSEmStandardPhysics(G4int ver);
CMSEmStandardPhysics(G4int ver, const edm::ParameterSet& p);
~CMSEmStandardPhysics() override;

void ConstructParticle() override;
void ConstructProcess() override;

private:
G4double fRangeFactor;
G4double fGeomFactor;
G4double fSafetyFactor;
G4double fLambdaLimit;
G4MscStepLimitType fStepLimitType;
G4int verbose;
};

Expand Down
27 changes: 7 additions & 20 deletions SimG4Core/PhysicsLists/interface/CMSHadronPhysicsFTFP_BERT.h
Expand Up @@ -4,8 +4,8 @@
//
// Hadron physics for the new CMS physics list FTFP_BERT_EMM_TRK.
// The hadron physics of FTFP_BERT has the transition between Bertini
// (BERT) intra-nuclear cascade model and Fritiof (FTF) string model in the
// energy region [4, 5] GeV (instead of the default for Geant4 10.4).
// (BERT) intra-nuclear cascade model and Fritiof (FTF) string model
// optimized for CMS.
//---------------------------------------------------------------------------
//
#ifndef SimG4Core_PhysicsLists_CMSHadronPhysicsFTFP_BERT_h
Expand All @@ -14,32 +14,19 @@
#include "globals.hh"
#include "G4ios.hh"

#include "G4VPhysicsConstructor.hh"
#include "G4HadronPhysicsFTFP_BERT.hh"

class CMSHadronPhysicsFTFP_BERT : public G4VPhysicsConstructor {
class CMSHadronPhysicsFTFP_BERT : public G4HadronPhysicsFTFP_BERT {
public:
explicit CMSHadronPhysicsFTFP_BERT(G4int verb);
explicit CMSHadronPhysicsFTFP_BERT(G4double e1, G4double e2, G4double e3);
~CMSHadronPhysicsFTFP_BERT() override;

void ConstructParticle() override;
void ConstructProcess() override;

private:
//This calls the specific ones for the different particles in order
void CreateModels();
void Neutron();
void Proton();
void Pion();
void Kaon();
void Others();
void DumpBanner();
//This contains extra configurataion specific to this PL
void ExtraConfiguration();

G4double minFTFP_;
G4double maxBERT_;
G4double maxBERTpi_;
// copy constructor and hide assignment operator
CMSHadronPhysicsFTFP_BERT(CMSHadronPhysicsFTFP_BERT &) = delete;
CMSHadronPhysicsFTFP_BERT &operator=(const CMSHadronPhysicsFTFP_BERT &right) = delete;
};

#endif
45 changes: 45 additions & 0 deletions SimG4Core/PhysicsLists/interface/CMSHadronPhysicsFTFP_BERT106.h
@@ -0,0 +1,45 @@
//---------------------------------------------------------------------------
// Author: Vladimir Ivanchenko
// Date: March 2018
//
// Hadron physics for the new CMS physics list FTFP_BERT_EMM_TRK.
// The hadron physics of FTFP_BERT has the transition between Bertini
// (BERT) intra-nuclear cascade model and Fritiof (FTF) string model in the
// energy region [4, 5] GeV (instead of the default for Geant4 10.4).
//---------------------------------------------------------------------------
//
#ifndef SimG4Core_PhysicsLists_CMSHadronPhysicsFTFP_BERT106_h
#define SimG4Core_PhysicsLists_CMSHadronPhysicsFTFP_BERT106_h

#include "globals.hh"
#include "G4ios.hh"

#include "G4VPhysicsConstructor.hh"

class CMSHadronPhysicsFTFP_BERT106 : public G4VPhysicsConstructor {
public:
explicit CMSHadronPhysicsFTFP_BERT106(G4int verb);
explicit CMSHadronPhysicsFTFP_BERT106(G4double e1, G4double e2, G4double e3);
~CMSHadronPhysicsFTFP_BERT106() override;

void ConstructParticle() override;
void ConstructProcess() override;

private:
//This calls the specific ones for the different particles in order
void CreateModels();
void Neutron();
void Proton();
void Pion();
void Kaon();
void Others();
void DumpBanner();
//This contains extra configurataion specific to this PL
void ExtraConfiguration();

G4double minFTFP_;
G4double maxBERT_;
G4double maxBERTpi_;
};

#endif
2 changes: 1 addition & 1 deletion SimG4Core/PhysicsLists/plugins/DummyPhysics.cc
Expand Up @@ -11,5 +11,5 @@ DummyPhysics::DummyPhysics(const edm::ParameterSet& p) : PhysicsList(p) {
RegisterPhysics(new DummyEMPhysics(ver));
}
RegisterPhysics(new G4DecayPhysics(ver));
edm::LogInfo("PhysicsList") << "DummyPhysics constructed with EM Physics " << emPhys << " and Decay";
edm::LogVerbatim("PhysicsList") << "DummyPhysics constructed with EM Physics " << emPhys << " and Decay";
}
4 changes: 2 additions & 2 deletions SimG4Core/PhysicsLists/plugins/FTFPCMS_BERT_EML.cc
@@ -1,5 +1,4 @@
#include "FTFPCMS_BERT_EML.h"
#include "SimG4Core/PhysicsLists/interface/CMSEmStandardPhysicsLPM.h"
#include "SimG4Core/PhysicsLists/interface/CMSHadronPhysicsFTFP_BERT.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"

Expand All @@ -10,6 +9,7 @@
#include "G4HadronElasticPhysics.hh"
#include "G4NeutronTrackingCut.hh"
#include "G4HadronicProcessStore.hh"
#include "G4EmStandardPhysics_option1.hh"

FTFPCMS_BERT_EML::FTFPCMS_BERT_EML(const edm::ParameterSet& p) : PhysicsList(p) {
int ver = p.getUntrackedParameter<int>("Verbosity", 0);
Expand All @@ -28,7 +28,7 @@ FTFPCMS_BERT_EML::FTFPCMS_BERT_EML(const edm::ParameterSet& p) : PhysicsList(p)

if (emPhys) {
// EM Physics
RegisterPhysics(new CMSEmStandardPhysicsLPM(ver));
RegisterPhysics(new G4EmStandardPhysics_option1(ver));

// Synchroton Radiation & GN Physics
G4EmExtraPhysics* gn = new G4EmExtraPhysics(ver);
Expand Down
4 changes: 3 additions & 1 deletion SimG4Core/PhysicsLists/plugins/FTFPCMS_BERT_EMM.cc
@@ -1,6 +1,8 @@
#include "FTFPCMS_BERT_EMM.h"
#include "SimG4Core/PhysicsLists/interface/CMSEmStandardPhysics.h"
#include "SimG4Core/PhysicsLists/interface/CMSEmStandardPhysicsLPM.h"
#include "SimG4Core/PhysicsLists/interface/CMSHadronPhysicsFTFP_BERT.h"
#include "SimG4Core/PhysicsLists/interface/CMSHadronPhysicsFTFP_BERT106.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"

#include "G4DecayPhysics.hh"
Expand Down Expand Up @@ -45,7 +47,7 @@ FTFPCMS_BERT_EMM::FTFPCMS_BERT_EMM(const edm::ParameterSet& p) : PhysicsList(p)
RegisterPhysics(new G4HadronElasticPhysics(ver));

// Hadron Physics
RegisterPhysics(new CMSHadronPhysicsFTFP_BERT(minFTFP, maxBERT, maxBERTpi));
RegisterPhysics(new CMSHadronPhysicsFTFP_BERT106(minFTFP, maxBERT, maxBERTpi));

// Stopping Physics
RegisterPhysics(new G4StoppingPhysics(ver));
Expand Down
4 changes: 2 additions & 2 deletions SimG4Core/PhysicsLists/plugins/FTFPCMS_BERT_EMM_TRK.cc
@@ -1,5 +1,5 @@
#include "FTFPCMS_BERT_EMM_TRK.h"
#include "SimG4Core/PhysicsLists/interface/CMSEmStandardPhysicsLPM.h"
#include "SimG4Core/PhysicsLists/interface/CMSEmStandardPhysics.h"
#include "SimG4Core/PhysicsLists/interface/CMSHadronPhysicsFTFP_BERT.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"

Expand All @@ -23,7 +23,7 @@ FTFPCMS_BERT_EMM_TRK::FTFPCMS_BERT_EMM_TRK(const edm::ParameterSet& p) : Physics

if (emPhys) {
// EM Physics
RegisterPhysics(new CMSEmStandardPhysicsLPM(ver));
RegisterPhysics(new CMSEmStandardPhysics(ver, p));

// Synchroton Radiation & GN Physics
G4EmExtraPhysics* gn = new G4EmExtraPhysics(ver);
Expand Down
4 changes: 2 additions & 2 deletions SimG4Core/PhysicsLists/plugins/FTFPCMS_BERT_HP_EMM.cc
@@ -1,5 +1,5 @@
#include "FTFPCMS_BERT_HP_EMM.h"
#include "SimG4Core/PhysicsLists/interface/CMSEmStandardPhysicsLPM.h"
#include "SimG4Core/PhysicsLists/interface/CMSEmStandardPhysics.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"

#include "G4ThermalNeutrons.hh"
Expand Down Expand Up @@ -28,7 +28,7 @@ FTFPCMS_BERT_HP_EMM::FTFPCMS_BERT_HP_EMM(const edm::ParameterSet& p) : PhysicsLi

if (emPhys) {
// EM Physics
RegisterPhysics(new CMSEmStandardPhysicsLPM(ver));
RegisterPhysics(new CMSEmStandardPhysics(ver, p));

// Synchroton Radiation & GN Physics
G4EmExtraPhysics* gn = new G4EmExtraPhysics(ver);
Expand Down
4 changes: 2 additions & 2 deletions SimG4Core/PhysicsLists/plugins/FTFPCMS_INCLXX_EMM.cc
@@ -1,5 +1,5 @@
#include "FTFPCMS_INCLXX_EMM.h"
#include "SimG4Core/PhysicsLists/interface/CMSEmStandardPhysicsLPM.h"
#include "SimG4Core/PhysicsLists/interface/CMSEmStandardPhysics.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"

#include "G4DecayPhysics.hh"
Expand All @@ -24,7 +24,7 @@ FTFPCMS_INCLXX_EMM::FTFPCMS_INCLXX_EMM(const edm::ParameterSet& p) : PhysicsList

if (emPhys) {
// EM Physics
RegisterPhysics(new CMSEmStandardPhysicsLPM(ver));
RegisterPhysics(new CMSEmStandardPhysics(ver, p));

// Synchroton Radiation & GN Physics
G4EmExtraPhysics* gn = new G4EmExtraPhysics(ver);
Expand Down
4 changes: 2 additions & 2 deletions SimG4Core/PhysicsLists/plugins/FTFPCMS_INCLXX_HP_EMM.cc
@@ -1,5 +1,5 @@
#include "FTFPCMS_INCLXX_HP_EMM.h"
#include "SimG4Core/PhysicsLists/interface/CMSEmStandardPhysicsLPM.h"
#include "SimG4Core/PhysicsLists/interface/CMSEmStandardPhysics.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"

#include "G4ThermalNeutrons.hh"
Expand Down Expand Up @@ -28,7 +28,7 @@ FTFPCMS_INCLXX_HP_EMM::FTFPCMS_INCLXX_HP_EMM(const edm::ParameterSet& p) : Physi

if (emPhys) {
// EM Physics
RegisterPhysics(new CMSEmStandardPhysicsLPM(ver));
RegisterPhysics(new CMSEmStandardPhysics(ver, p));

// Synchroton Radiation & GN Physics
G4EmExtraPhysics* gn = new G4EmExtraPhysics(ver);
Expand Down