From 738c2f88939a041fbc8b6b9cfa3c547b86bc6e42 Mon Sep 17 00:00:00 2001 From: shivesh Date: Sat, 25 Aug 2018 17:57:22 +0100 Subject: Add Cerenkov Processes --- include/G4BeamTestEMPhysics.h | 15 ++++++++++++ include/G4BeamTestPrimaryGeneratorAction.h | 33 ++++++++++++++++++++++++++ include/G4BeamTestPrimaryGeneratorMessenger.h | 30 +++++++++++++++++++++++ include/G4BeamTestRunAction.h | 30 +++++++++++++++++++++++ include/G4BeamTestRunManager.h | 34 --------------------------- include/G4BeamTestRunManager.h.backup | 34 +++++++++++++++++++++++++++ include/G4BeamTestTank.h | 1 - include/G4Interface.h | 13 +++++----- 8 files changed, 149 insertions(+), 41 deletions(-) create mode 100644 include/G4BeamTestPrimaryGeneratorAction.h create mode 100644 include/G4BeamTestPrimaryGeneratorMessenger.h create mode 100644 include/G4BeamTestRunAction.h delete mode 100644 include/G4BeamTestRunManager.h create mode 100644 include/G4BeamTestRunManager.h.backup (limited to 'include') diff --git a/include/G4BeamTestEMPhysics.h b/include/G4BeamTestEMPhysics.h index bf20b62..e7a88dd 100644 --- a/include/G4BeamTestEMPhysics.h +++ b/include/G4BeamTestEMPhysics.h @@ -11,6 +11,17 @@ #include #include +#include +#include +#include +#include +#include +#include + +#include +#include + + /** @class G4BeamTestEMPhysics @brief Electromagnetic physics. Used only if Geant4 version is earlier than 4.10. @@ -30,6 +41,7 @@ public: void ConstructParticle(); void ConstructProcess(); + void ConstructOp(); private: // Gamma physics @@ -47,6 +59,9 @@ private: G4eIonisation positronIonisation; G4eBremsstrahlung positronBremsStrahlung; G4eplusAnnihilation annihilation; + + // Cerenkov physics + G4Cerenkov cerenkov; }; #endif // G4TANKRESPONSE_G4BEAMTESTEMPHYSICS_H_INCLUDED diff --git a/include/G4BeamTestPrimaryGeneratorAction.h b/include/G4BeamTestPrimaryGeneratorAction.h new file mode 100644 index 0000000..83fbacc --- /dev/null +++ b/include/G4BeamTestPrimaryGeneratorAction.h @@ -0,0 +1,33 @@ +#ifndef G4BeamTestPrimaryGeneratorAction_h +#define G4BeamTestPrimaryGeneratorAction_h 1 + +#include "G4VUserPrimaryGeneratorAction.hh" +#include "globals.hh" + +class G4GeneralParticleSource; +class G4Event; +class G4BeamTestPrimaryGeneratorMessenger; + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +class G4BeamTestPrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction +{ + public: + G4BeamTestPrimaryGeneratorAction(); + virtual ~G4BeamTestPrimaryGeneratorAction(); + + public: + virtual void GeneratePrimaries(G4Event*); + + void SetOptPhotonPolar(); + void SetOptPhotonPolar(G4double); + + private: + G4GeneralParticleSource* fParticleGun; + G4BeamTestPrimaryGeneratorMessenger* fGunMessenger; +}; + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +#endif /*G4BeamTestPrimaryGeneratorAction_h*/ + diff --git a/include/G4BeamTestPrimaryGeneratorMessenger.h b/include/G4BeamTestPrimaryGeneratorMessenger.h new file mode 100644 index 0000000..0063f95 --- /dev/null +++ b/include/G4BeamTestPrimaryGeneratorMessenger.h @@ -0,0 +1,30 @@ +#ifndef G4BeamTestPrimaryGeneratorMessenger_h +#define G4BeamTestPrimaryGeneratorMessenger_h 1 + +#include "G4UImessenger.hh" +#include "globals.hh" + +class G4BeamTestPrimaryGeneratorAction; +class G4UIdirectory; +class G4UIcmdWithADoubleAndUnit; + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +class G4BeamTestPrimaryGeneratorMessenger: public G4UImessenger +{ + public: + G4BeamTestPrimaryGeneratorMessenger(G4BeamTestPrimaryGeneratorAction* ); + virtual ~G4BeamTestPrimaryGeneratorMessenger(); + + virtual void SetNewValue(G4UIcommand*, G4String); + + private: + G4BeamTestPrimaryGeneratorAction* fG4BeamTestAction; + G4UIdirectory* fGunDir; + G4UIcmdWithADoubleAndUnit* fPolarCmd; +}; + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +#endif + diff --git a/include/G4BeamTestRunAction.h b/include/G4BeamTestRunAction.h new file mode 100644 index 0000000..b25ad7e --- /dev/null +++ b/include/G4BeamTestRunAction.h @@ -0,0 +1,30 @@ +#ifndef G4BeamTestRunAction_h +#define G4BeamTestRunAction_h 1 + +#include "globals.hh" +#include "G4UserRunAction.hh" + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +class G4Timer; +class G4Run; + +class G4BeamTestRunAction : public G4UserRunAction +{ + public: + G4BeamTestRunAction(); + virtual ~G4BeamTestRunAction(); + + public: + virtual G4Run* GenerateRun(); + virtual void BeginOfRunAction(const G4Run* aRun); + virtual void EndOfRunAction(const G4Run* aRun); + + private: + G4Timer* fTimer; +}; + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + +#endif /*G4BeamTestRunAction_h*/ + diff --git a/include/G4BeamTestRunManager.h b/include/G4BeamTestRunManager.h deleted file mode 100644 index a7eaff0..0000000 --- a/include/G4BeamTestRunManager.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef TOPSIMULATOR_G4BEAMTESTRUNMANAGER_H -#define TOPSIMULATOR_G4BEAMTESTRUNMANAGER_H - -#include - -class G4ParticleGun; - -/** - * Implementation of G4RunManager - */ -class G4BeamTestRunManager: public G4RunManager -{ - public: - G4BeamTestRunManager(); - - static G4BeamTestRunManager* GetIceTopRunManager() {return (G4BeamTestRunManager*)GetRunManager();} - - // Disable BeamOn - void BeamOn(G4int n_event,const char* macroFile=0,G4int n_select=-1); - - void InitializeRun(); - void InjectParticle(G4ParticleGun* particleGun); - void TerminateRun(); - - protected: - G4Event* GenerateEvent(G4int i_event); - - private: - // This method is an exact copy of UpdateScoring which is private in the G4RunManager - void Update_Scoring(); - -}; - -#endif diff --git a/include/G4BeamTestRunManager.h.backup b/include/G4BeamTestRunManager.h.backup new file mode 100644 index 0000000..a7eaff0 --- /dev/null +++ b/include/G4BeamTestRunManager.h.backup @@ -0,0 +1,34 @@ +#ifndef TOPSIMULATOR_G4BEAMTESTRUNMANAGER_H +#define TOPSIMULATOR_G4BEAMTESTRUNMANAGER_H + +#include + +class G4ParticleGun; + +/** + * Implementation of G4RunManager + */ +class G4BeamTestRunManager: public G4RunManager +{ + public: + G4BeamTestRunManager(); + + static G4BeamTestRunManager* GetIceTopRunManager() {return (G4BeamTestRunManager*)GetRunManager();} + + // Disable BeamOn + void BeamOn(G4int n_event,const char* macroFile=0,G4int n_select=-1); + + void InitializeRun(); + void InjectParticle(G4ParticleGun* particleGun); + void TerminateRun(); + + protected: + G4Event* GenerateEvent(G4int i_event); + + private: + // This method is an exact copy of UpdateScoring which is private in the G4RunManager + void Update_Scoring(); + +}; + +#endif diff --git a/include/G4BeamTestTank.h b/include/G4BeamTestTank.h index c7a1713..3f2fd8c 100644 --- a/include/G4BeamTestTank.h +++ b/include/G4BeamTestTank.h @@ -80,7 +80,6 @@ class G4BeamTestTank G4double innerRadius_; G4double outerRadius_; - G4double waterHeight_; G4double airHeight_; G4double glassOuterRadius_; diff --git a/include/G4Interface.h b/include/G4Interface.h index 4b88f00..e2956af 100644 --- a/include/G4Interface.h +++ b/include/G4Interface.h @@ -1,7 +1,8 @@ #ifndef _TOPSIM_G4INTERFACE_H_ #define _TOPSIM_G4INTERFACE_H_ -#include "G4BeamTestRunManager.h" +#include "G4RunManager.hh" +/* #include "G4BeamTestRunManager.h" */ /* #include */ #ifdef G4VIS_USE @@ -33,17 +34,17 @@ class G4Interface /// To be called after simulating each IceTray event. void TerminateEvent(); /// Simulate a single particle (InitializeEvent must be called first) - void InjectParticle(const std::string& particleName, - const G4ThreeVector& particlePosition, - const G4ThreeVector& particleDirection, - const G4double particleEnergy); + /* void InjectParticle(const std::string& particleName, */ + /* const G4ThreeVector& particlePosition, */ + /* const G4ThreeVector& particleDirection, */ + /* const G4double particleEnergy); */ private: void Initialize(); static G4Interface* g4Interface_; - G4BeamTestRunManager runManager_; + G4RunManager runManager_; #ifdef G4VIS_USE G4VisManager* visManager_; -- cgit v1.2.3