diff --git a/ILDEx/CMakeLists.txt b/ILDEx/CMakeLists.txt deleted file mode 100644 index f9da59c4730b71724e900a20497b3a8ee5557b41..0000000000000000000000000000000000000000 --- a/ILDEx/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ - -cmake_minimum_required(VERSION 2.6.4 FATAL_ERROR) -project(ILDExample) - - -set( Geant4_CONFIG_DEBUG TRUE ) -find_package(Geant4 REQUIRED COMPONENTS gdml qt ) -include(${Geant4_USE_FILE}) - - -GEANT4_COLLATE_APPLICATION_SOURCES(ILDEXAMPLE_SOURCES) - -add_executable(ILDExample ${ILDEXAMPLE_SOURCES}) -target_link_libraries(ILDExample ${Geant4_LIBRARIES} ) - - diff --git a/ILDEx/ILDExample.cc b/ILDEx/ILDExample.cc deleted file mode 100644 index a8f7576b1880dda2b1ef1f551d0295562b9108f1..0000000000000000000000000000000000000000 --- a/ILDEx/ILDExample.cc +++ /dev/null @@ -1,112 +0,0 @@ - -// This example is adapted from the Geant4 example N03 - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -#include "G4RunManager.hh" - -#include "G4UImanager.hh" - -#include "G4UIQt.hh" -#include "G4Qt.hh" -#include "G4UIsession.hh" - -#include "Randomize.hh" - -#include "ILDExDetectorConstruction.hh" -#include "ILDExPhysicsList.hh" -#include "ILDExPrimaryGeneratorAction.hh" -#include "ILDExRunAction.hh" -#include "ILDExEventAction.hh" -#include "ILDExSteppingAction.hh" -#include "ILDExSteppingVerbose.hh" - -#include "G4VisExecutive.hh" - -//#include "G4UIExecutive.hh" - - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -int main(int argc,char** argv) -{ - - // Choose the Random engine - // - CLHEP::HepRandom::setTheEngine(new CLHEP::RanecuEngine); - - // User Verbose output class - // - G4VSteppingVerbose::SetInstance(new ILDExSteppingVerbose); - - // Construct the default run manager - // - G4RunManager * runManager = new G4RunManager; - - - // Set mandatory initialization classes - // - ILDExDetectorConstruction* detector = new ILDExDetectorConstruction; - runManager->SetUserInitialization(detector); - // - G4VUserPhysicsList* physics = new ILDExPhysicsList; - runManager->SetUserInitialization(physics); - - // Set user action classes - // - G4VUserPrimaryGeneratorAction* gen_action = - new ILDExPrimaryGeneratorAction(detector); - runManager->SetUserAction(gen_action); - // - ILDExRunAction* run_action = new ILDExRunAction; - runManager->SetUserAction(run_action); - // - ILDExEventAction* event_action = new ILDExEventAction(run_action); - runManager->SetUserAction(event_action); - // - G4UserSteppingAction* stepping_action = - new ILDExSteppingAction(detector, event_action); - runManager->SetUserAction(stepping_action); - - // Initialize G4 kernel - // - runManager->Initialize(); - - // Initialize visualization - // - G4VisManager* visManager = new G4VisExecutive; - visManager->Initialize(); - - // Get the pointer to the User Interface manager - - G4UImanager* UImanager = G4UImanager::GetUIpointer(); - - if (argc!=1) { // batch mode - G4String command = "/control/execute "; - G4String fileName = argv[1]; - UImanager->ApplyCommand(command+fileName); - } - else { // interactive mode : define UI session - - G4UIsession* ui = new G4UIQt(argc, argv); - - ui->SessionStart(); - delete ui; - - } - - // Job termination - // Free the store: user actions, physics_list and detector_description are - // owned and deleted by the run manager, so they should not - // be deleted in the main() program ! - - delete visManager; - - - delete runManager; - - return 0; -} - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... diff --git a/ILDEx/README b/ILDEx/README deleted file mode 100644 index a8a5d9a5633386220e389b28032b8b9f053ea3e5..0000000000000000000000000000000000000000 --- a/ILDEx/README +++ /dev/null @@ -1,17 +0,0 @@ - -This Geant4 example is based on the N03 Example which comes with Geant4 - -The Geometry represents a simplfied structure for the ILD central tracking detectors, VXD, SIT and TPC. - -This example should function as a test for DD4hep and should be adapted as needed. - -The build setup is performed via CMake, i.e. : - -cmake -DGeant4_DIR=[PATH_TO_GEANT4] -GXcode .. - -And has been tested against the beta release of Geant4 geant4.9.5.b01 - -Currently no sensitive detectors are implemented only the material. - - - diff --git a/ILDEx/include/ILDExDetectorConstruction.hh b/ILDEx/include/ILDExDetectorConstruction.hh deleted file mode 100644 index d2e2e47364d70459c807285dd4ae76dc04cf5b86..0000000000000000000000000000000000000000 --- a/ILDEx/include/ILDExDetectorConstruction.hh +++ /dev/null @@ -1,74 +0,0 @@ - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -#ifndef ILDExDetectorConstruction_h -#define ILDExDetectorConstruction_h 1 - -#include "G4VUserDetectorConstruction.hh" -#include "globals.hh" - -class G4Box; -class G4LogicalVolume; -class G4VPhysicalVolume; -class G4Material; -class G4UniformMagField; -class ILDExDetectorMessenger; - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -class ILDExDetectorConstruction : public G4VUserDetectorConstruction -{ -public: - - ILDExDetectorConstruction(); - ~ILDExDetectorConstruction(); - -public: - - - void SetMagField(G4double); - - G4VPhysicalVolume* Construct(); - - void UpdateGeometry(); - -public: - - void PrintDetectorParameters(); - - G4double GetWorldSizeX() {return WorldSizeX;} - G4double GetWorldSizeY() {return WorldSizeY;} - G4double GetWorldSizeZ() {return WorldSizeZ;} - - const G4VPhysicalVolume* GetphysiWorld() {return physiWorld;} - -private: - - G4Material* defaultMaterial; - - G4double WorldSizeX; - G4double WorldSizeY; - G4double WorldSizeZ; - - G4Box* solidWorld; //pointer to the solid World - G4LogicalVolume* logicWorld; //pointer to the logical World - G4VPhysicalVolume* physiWorld; //pointer to the physical World - - - G4UniformMagField* magField; //pointer to the magnetic field - - ILDExDetectorMessenger* detectorMessenger; //pointer to the Messenger - -private: - - void DefineMaterials(); - void ComputeDetectorParameters(); - G4VPhysicalVolume* ConstructDetector(); -}; - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - - -#endif - diff --git a/ILDEx/include/ILDExDetectorMessenger.hh b/ILDEx/include/ILDExDetectorMessenger.hh deleted file mode 100644 index 64a914eecff69f8ec1c35246a7e53107fa20f2bb..0000000000000000000000000000000000000000 --- a/ILDEx/include/ILDExDetectorMessenger.hh +++ /dev/null @@ -1,40 +0,0 @@ - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -#ifndef ILDExDetectorMessenger_h -#define ILDExDetectorMessenger_h 1 - -#include "globals.hh" -#include "G4UImessenger.hh" - -class ILDExDetectorConstruction; -class G4UIdirectory; -class G4UIcmdWithAString; -class G4UIcmdWithAnInteger; -class G4UIcmdWithADoubleAndUnit; -class G4UIcmdWithoutParameter; - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -class ILDExDetectorMessenger: public G4UImessenger -{ - public: - ILDExDetectorMessenger(ILDExDetectorConstruction* ); - ~ILDExDetectorMessenger(); - - void SetNewValue(G4UIcommand*, G4String); - - private: - ILDExDetectorConstruction* ILDExDetector; - - G4UIdirectory* ILDExDir; - G4UIdirectory* detDir; - G4UIcmdWithADoubleAndUnit* MagFieldCmd; - G4UIcmdWithoutParameter* UpdateCmd; -}; - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -#endif - diff --git a/ILDEx/include/ILDExEventAction.hh b/ILDEx/include/ILDExEventAction.hh deleted file mode 100644 index 3a4cd7eea0acf1047d6661c3acaad711fe8bdffb..0000000000000000000000000000000000000000 --- a/ILDEx/include/ILDExEventAction.hh +++ /dev/null @@ -1,46 +0,0 @@ - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -#ifndef ILDExEventAction_h -#define ILDExEventAction_h 1 - -#include "G4UserEventAction.hh" -#include "globals.hh" - -class ILDExRunAction; -class ILDExEventActionMessenger; - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -class ILDExEventAction : public G4UserEventAction -{ -public: - ILDExEventAction(ILDExRunAction*); - virtual ~ILDExEventAction(); - - void BeginOfEventAction(const G4Event*); - void EndOfEventAction(const G4Event*); - - void SumSupport(G4double de, G4double dl, G4double da) {EnergySupport += de; TrackLSupport += dl; AngleSupport += da; }; - void SumSensitive(G4double de, G4double dl, G4double da) {EnergySensitive += de; TrackLSensitive += dl; AngleSensitive += da; }; - - void SetPrintModulo(G4int val) {printModulo = val;}; - -private: - ILDExRunAction* runAct; - - G4double EnergySupport, EnergySensitive; - G4double TrackLSupport, TrackLSensitive; - G4double AngleSupport, AngleSensitive; - - G4int printModulo; - - ILDExEventActionMessenger* eventMessenger; -}; - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -#endif - - diff --git a/ILDEx/include/ILDExEventActionMessenger.hh b/ILDEx/include/ILDExEventActionMessenger.hh deleted file mode 100644 index 97191427ee980a2bb2f56599e053e277918e083a..0000000000000000000000000000000000000000 --- a/ILDEx/include/ILDExEventActionMessenger.hh +++ /dev/null @@ -1,33 +0,0 @@ - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -#ifndef ILDExEventActionMessenger_h -#define ILDExEventActionMessenger_h 1 - -#include "globals.hh" -#include "G4UImessenger.hh" - -class ILDExEventAction; -class G4UIdirectory; -class G4UIcmdWithAnInteger; - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -class ILDExEventActionMessenger: public G4UImessenger -{ -public: - ILDExEventActionMessenger(ILDExEventAction*); - virtual ~ILDExEventActionMessenger(); - - void SetNewValue(G4UIcommand*, G4String); - -private: - ILDExEventAction* eventAction; - G4UIdirectory* eventDir; - G4UIcmdWithAnInteger* PrintCmd; -}; - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -#endif diff --git a/ILDEx/include/ILDExPhysicsList.hh b/ILDEx/include/ILDExPhysicsList.hh deleted file mode 100644 index 0a658ba446d101a0ed28f53b62b37e2ac2bf2cd5..0000000000000000000000000000000000000000 --- a/ILDEx/include/ILDExPhysicsList.hh +++ /dev/null @@ -1,37 +0,0 @@ - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -#ifndef ILDExPhysicsList_h -#define ILDExPhysicsList_h 1 - -#include "G4VUserPhysicsList.hh" -#include "globals.hh" - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -class ILDExPhysicsList: public G4VUserPhysicsList -{ -public: - ILDExPhysicsList(); - virtual ~ILDExPhysicsList(); - - // Construct particle and physics - void ConstructParticle(); - void ConstructProcess(); - - void SetCuts(); - -private: - - // these methods Construct physics processes and register them - void ConstructDecay(); - void ConstructEM(); -}; - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -#endif - - - diff --git a/ILDEx/include/ILDExPrimaryGeneratorAction.hh b/ILDEx/include/ILDExPrimaryGeneratorAction.hh deleted file mode 100644 index 355dd196cfc4c3787d3401088a68dd74615b27e3..0000000000000000000000000000000000000000 --- a/ILDEx/include/ILDExPrimaryGeneratorAction.hh +++ /dev/null @@ -1,39 +0,0 @@ - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -#ifndef ILDExPrimaryGeneratorAction_h -#define ILDExPrimaryGeneratorAction_h 1 - -#include "G4VUserPrimaryGeneratorAction.hh" -#include "globals.hh" - -class G4ParticleGun; -class G4Event; -class ILDExDetectorConstruction; -class ILDExPrimaryGeneratorMessenger; - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -class ILDExPrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction -{ -public: - ILDExPrimaryGeneratorAction(ILDExDetectorConstruction*); - virtual ~ILDExPrimaryGeneratorAction(); - - void GeneratePrimaries(G4Event*); - void SetRndmFlag(G4String val) { rndmFlag = val;} - -private: - G4ParticleGun* particleGun; //pointer a to G4 class - ILDExDetectorConstruction* ILDExDetector; //pointer to the geometry - - ILDExPrimaryGeneratorMessenger* gunMessenger; //messenger of this class - G4String rndmFlag; //flag for a rndm impact point -}; - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -#endif - - diff --git a/ILDEx/include/ILDExPrimaryGeneratorMessenger.hh b/ILDEx/include/ILDExPrimaryGeneratorMessenger.hh deleted file mode 100644 index 0d69df84c2ad9455adc6a460f1ffaa6fa752f573..0000000000000000000000000000000000000000 --- a/ILDEx/include/ILDExPrimaryGeneratorMessenger.hh +++ /dev/null @@ -1,34 +0,0 @@ - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -#ifndef ILDExPrimaryGeneratorMessenger_h -#define ILDExPrimaryGeneratorMessenger_h 1 - -#include "G4UImessenger.hh" -#include "globals.hh" - -class ILDExPrimaryGeneratorAction; -class G4UIdirectory; -class G4UIcmdWithAString; - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -class ILDExPrimaryGeneratorMessenger: public G4UImessenger -{ -public: - ILDExPrimaryGeneratorMessenger(ILDExPrimaryGeneratorAction*); - virtual ~ILDExPrimaryGeneratorMessenger(); - - void SetNewValue(G4UIcommand*, G4String); - -private: - ILDExPrimaryGeneratorAction* ILDExAction; - G4UIdirectory* gunDir; - G4UIcmdWithAString* RndmCmd; -}; - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -#endif - diff --git a/ILDEx/include/ILDExRunAction.hh b/ILDEx/include/ILDExRunAction.hh deleted file mode 100644 index 850f930829afdb0f784d36f92e5ea2b79529d188..0000000000000000000000000000000000000000 --- a/ILDEx/include/ILDExRunAction.hh +++ /dev/null @@ -1,44 +0,0 @@ - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -#ifndef ILDExRunAction_h -#define ILDExRunAction_h 1 - -#include "G4UserRunAction.hh" -#include "globals.hh" - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -class G4Run; - -class ILDExRunAction : public G4UserRunAction -{ -public: - ILDExRunAction(); - virtual ~ILDExRunAction(); - - void BeginOfRunAction(const G4Run*); - void EndOfRunAction(const G4Run*); - - void fillPerEvent(G4double ESupport, G4double ESensitive, - G4double LSupport, G4double LSensitive, - G4double AngleSupport, G4double AngleSensitive); - -private: - - G4double sumESupport, sum2ESupport; - G4double sumESensitive, sum2ESensitive; - - G4double sumLSupport, sum2LSupport; - G4double sumLSensitive, sum2LSensitive; - - G4double sumAngleSupport, sum2AngleSupport; - G4double sumAngleSensitive, sum2AngleSensitive; - -}; - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -#endif - diff --git a/ILDEx/include/ILDExSIT.h b/ILDEx/include/ILDExSIT.h deleted file mode 100644 index aedad01edc97c4d99a887e418cf69fd067a4615a..0000000000000000000000000000000000000000 --- a/ILDEx/include/ILDExSIT.h +++ /dev/null @@ -1,7 +0,0 @@ -// -// ILDExSIT.h -// ILDExample -// -// Created by Steve Aplin on 11/2/11. -// Copyright 2011 DESY. All rights reserved. -// diff --git a/ILDEx/include/ILDExSIT.hh b/ILDEx/include/ILDExSIT.hh deleted file mode 100644 index 9056ee5914345fc7f932818d4f43c24c0b9d46ae..0000000000000000000000000000000000000000 --- a/ILDEx/include/ILDExSIT.hh +++ /dev/null @@ -1,50 +0,0 @@ -// -// ILDExSIT.h -// ILDExample -// -#ifndef ILDExSIT_h -#define ILDExSIT_h 1 - -#include "globals.hh" -#include <vector> - -class G4LogicalVolume; -class G4Material; - -class ILDExSIT { - - G4LogicalVolume* _motherlog; - - struct SIT_Layer { - - - G4double nladders; - - G4double half_z; - - G4double sensitive_radius; - G4double sensitive_thickness; - - G4double support_thickness; - - G4Material* sensitive_material; - G4Material* support_material; - - } ; - - std::vector<SIT_Layer> _layers; - - void set_geom_values(); - - void build(); - -public: - - ILDExSIT( G4LogicalVolume* motherlog ); - - ~ILDExSIT() {/* no-op */;} - - -}; - -#endif diff --git a/ILDEx/include/ILDExSteppingAction.hh b/ILDEx/include/ILDExSteppingAction.hh deleted file mode 100644 index 64d18bd165aeefbb873aadf5b81e64287d07a7c4..0000000000000000000000000000000000000000 --- a/ILDEx/include/ILDExSteppingAction.hh +++ /dev/null @@ -1,30 +0,0 @@ - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -#ifndef ILDExSteppingAction_h -#define ILDExSteppingAction_h 1 - -#include "G4UserSteppingAction.hh" - -class ILDExDetectorConstruction; -class ILDExEventAction; - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -class ILDExSteppingAction : public G4UserSteppingAction -{ -public: - ILDExSteppingAction(ILDExDetectorConstruction*, ILDExEventAction*); - virtual ~ILDExSteppingAction(); - - void UserSteppingAction(const G4Step*); - -private: - ILDExDetectorConstruction* detector; - ILDExEventAction* eventaction; -}; - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -#endif diff --git a/ILDEx/include/ILDExSteppingVerbose.hh b/ILDEx/include/ILDExSteppingVerbose.hh deleted file mode 100644 index cf7b1a4ee5602ac156c49a9b3fb260a53848fa67..0000000000000000000000000000000000000000 --- a/ILDEx/include/ILDExSteppingVerbose.hh +++ /dev/null @@ -1,28 +0,0 @@ - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -class ILDExSteppingVerbose; - -#ifndef ILDExSteppingVerbose_h -#define ILDExSteppingVerbose_h 1 - -#include "G4SteppingVerbose.hh" - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -class ILDExSteppingVerbose : public G4SteppingVerbose -{ - public: - - ILDExSteppingVerbose(); - ~ILDExSteppingVerbose(); - - void StepInfo(); - void TrackingStarted(); - -}; - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -#endif diff --git a/ILDEx/include/ILDExTPC.hh b/ILDEx/include/ILDExTPC.hh deleted file mode 100644 index 5c4107238b1f7dbeb5ffd342faff41478d4d4d8b..0000000000000000000000000000000000000000 --- a/ILDEx/include/ILDExTPC.hh +++ /dev/null @@ -1,45 +0,0 @@ -// -// ILDExTPC.h -// ILDExample -// - -#ifndef ILDExTPC_h -#define ILDExTPC_h 1 - -#include "globals.hh" - -class G4LogicalVolume; -class G4Material; - -class ILDExTPC { - - G4LogicalVolume* _motherlog; - - G4double _rmin; - G4double _rmax; - G4double _halfz; - - G4double _inner_wall_thickness; - G4double _outer_wall_thickness; - - G4double _endcap_thickness; - - G4Material* _sensitive_gas_material; - G4Material* _wall_material; - G4Material* _endcap_material; - - void set_geom_values(); - - void build(); - -public: - - ILDExTPC( G4LogicalVolume* motherlog ); - - ~ILDExTPC() {/* no-op */;} - -}; - - - -#endif diff --git a/ILDEx/include/ILDExVXD.hh b/ILDEx/include/ILDExVXD.hh deleted file mode 100644 index 3b3cafde472ff0929819f9f0878a40f8cc90ef6f..0000000000000000000000000000000000000000 --- a/ILDEx/include/ILDExVXD.hh +++ /dev/null @@ -1,53 +0,0 @@ -// -// ILDExVXD.h -// ILDExample -// - -#ifndef ILDExVXD_h -#define ILDExVXD_h 1 - -#include "globals.hh" -#include "vector" - -class G4LogicalVolume; -class G4Material; - -class ILDExVXD { - - G4LogicalVolume* _motherlog; - - struct VXD_Layer { - - G4double nladders; - - G4double half_z; - - G4double ladder_transverse_offset; - - G4double sensitive_radius; - G4double sensitive_thickness; - - G4double support_thickness; - - G4Material* sensitive_material; - G4Material* support_material; - - - } ; - - std::vector<VXD_Layer> _layers; - - void set_geom_values(); - - void build(); - - -public: - - ILDExVXD( G4LogicalVolume* motherlog ); - - ~ILDExVXD() {/* no-op */;} - -}; - -#endif diff --git a/ILDEx/run1.mac b/ILDEx/run1.mac deleted file mode 100644 index 5d1ef3ec4b43a09ebb160dc5c795517a7440afb2..0000000000000000000000000000000000000000 --- a/ILDEx/run1.mac +++ /dev/null @@ -1,20 +0,0 @@ -# $Id: run1.mac,v 1.2 2000-11-21 10:59:42 maire Exp $ -# -# Macro file for "exampleN03.cc" -# -# can be run in batch, without graphic -# or interactively: Idle> /control/execute run1.mac -# -/control/verbose 2 -/control/saveHistory -# -/run/verbose 2 -/event/verbose 0 -/tracking/verbose 1 -# -# muon 300 MeV to the direction (1.,0.,0.) -# 3 events -# -/gun/particle mu+ -/gun/energy 300 MeV -/run/beamOn 3 diff --git a/ILDEx/src/ILDExDetectorConstruction.cc b/ILDEx/src/ILDExDetectorConstruction.cc deleted file mode 100644 index a2fe22c450d4345be99692d10cdd669f5f198f20..0000000000000000000000000000000000000000 --- a/ILDEx/src/ILDExDetectorConstruction.cc +++ /dev/null @@ -1,284 +0,0 @@ - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -#include "ILDExDetectorConstruction.hh" -#include "ILDExDetectorMessenger.hh" - -#include "G4GDMLParser.hh" -#include "G4PVPlacement.hh" - -#include "G4Material.hh" -#include "G4Box.hh" -#include "G4LogicalVolume.hh" -#include "G4PVPlacement.hh" -#include "G4PVReplica.hh" -#include "G4UniformMagField.hh" - -#include "G4GeometryManager.hh" -#include "G4PhysicalVolumeStore.hh" -#include "G4LogicalVolumeStore.hh" -#include "G4SolidStore.hh" - -#include "G4VisAttributes.hh" -#include "G4Colour.hh" - -#include "ILDExVXD.hh" -#include "ILDExSIT.hh" -#include "ILDExTPC.hh" - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -ILDExDetectorConstruction::ILDExDetectorConstruction() -: solidWorld(0),logicWorld(0),physiWorld(0), -magField(0) -{ - - WorldSizeX = 10.0 * m; WorldSizeY = 10.0 * m; WorldSizeZ = 10.0 * m; - - // materials - DefineMaterials(); - - // create commands for interactive definition of the calorimeter - detectorMessenger = new ILDExDetectorMessenger(this); - -} - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -ILDExDetectorConstruction::~ILDExDetectorConstruction() -{ delete detectorMessenger;} - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -G4VPhysicalVolume* ILDExDetectorConstruction::Construct() -{ - return ConstructDetector(); -} - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -void ILDExDetectorConstruction::DefineMaterials() -{ - //This function illustrates the possible ways to define materials - - G4String symbol; // a=mass of a mole; - G4double a, z, density; // z=mean number of protons; - G4int iz, n; // iz=number of protons in an isotope; - // n=number of nucleons in an isotope; - - G4int ncomponents, natoms; - G4double abundance, fractionmass; - - // - // define Elements - // - - G4Element* H = new G4Element("Hydrogen",symbol="H" , z= 1., a= 1.01*g/mole); - G4Element* C = new G4Element("Carbon" ,symbol="C" , z= 6., a= 12.01*g/mole); - G4Element* N = new G4Element("Nitrogen",symbol="N" , z= 7., a= 14.01*g/mole); - G4Element* O = new G4Element("Oxygen" ,symbol="O" , z= 8., a= 16.00*g/mole); - G4Element* Si = new G4Element("Silicon",symbol="Si" , z= 14., a= 28.09*g/mole); - - // - // define an Element from isotopes, by relative abundance - // - - G4Isotope* U5 = new G4Isotope("U235", iz=92, n=235, a=235.01*g/mole); - G4Isotope* U8 = new G4Isotope("U238", iz=92, n=238, a=238.03*g/mole); - - G4Element* U = new G4Element("enriched Uranium",symbol="U",ncomponents=2); - U->AddIsotope(U5, abundance= 90.*perCent); - U->AddIsotope(U8, abundance= 10.*perCent); - - // - // define simple materials - // - - new G4Material("Aluminium" , z=13., a= 26.98*g/mole, density= 2.700*g/cm3); - new G4Material("liquidArgon", z=18., a= 39.95*g/mole, density= 1.390*g/cm3); - new G4Material("Lead" , z=82., a= 207.19*g/mole, density= 11.35*g/cm3); - new G4Material("Carbon" , z=6. , a= 12.01*g/mole, density= 2.210*g/cm3); - new G4Material("Silicon" , z=14., a= 28.09*g/mole, density= 2.329*g/cm3); - new G4Material("Gold" , z=79., a= 196.97*g/mole, density=19.320*g/cm3); - new G4Material("Argon" , z=18., a= 39.948*g/mole, - density=0.001784*g/cm3); - // - // define a material from elements. case 1: chemical molecule - // - - G4Material* H2O = - new G4Material("Water", density= 1.000*g/cm3, ncomponents=2); - H2O->AddElement(H, natoms=2); - H2O->AddElement(O, natoms=1); - // overwrite computed meanExcitationEnergy with ICRU recommended value - H2O->GetIonisation()->SetMeanExcitationEnergy(75.0*eV); - - G4Material* Sci = - new G4Material("Scintillator", density= 1.032*g/cm3, ncomponents=2); - Sci->AddElement(C, natoms=9); - Sci->AddElement(H, natoms=10); - - G4Material* Myl = - new G4Material("Mylar", density= 1.397*g/cm3, ncomponents=3); - Myl->AddElement(C, natoms=10); - Myl->AddElement(H, natoms= 8); - Myl->AddElement(O, natoms= 4); - - G4Material* SiO2 = - new G4Material("quartz",density= 2.200*g/cm3, ncomponents=2); - SiO2->AddElement(Si, natoms=1); - SiO2->AddElement(O , natoms=2); - - // - // define a material from elements. case 2: mixture by fractional mass - // - - G4Material* Air = - new G4Material("Air" , density= 1.290*mg/cm3, ncomponents=2); - Air->AddElement(N, fractionmass=0.7); - Air->AddElement(O, fractionmass=0.3); - - // - // define a material from elements and/or others materials (mixture of mixtures) - // - - G4Material* Aerog = - new G4Material("Aerogel", density= 0.200*g/cm3, ncomponents=3); - Aerog->AddMaterial(SiO2, fractionmass=62.5*perCent); - Aerog->AddMaterial(H2O , fractionmass=37.4*perCent); - Aerog->AddElement (C , fractionmass= 0.1*perCent); - - // - // examples of gas in non STP conditions - // - - G4Material* CO2 = - new G4Material("CarbonicGas", density= 1.842*mg/cm3, ncomponents=2, - kStateGas, 325.*kelvin, 50.*atmosphere); - CO2->AddElement(C, natoms=1); - CO2->AddElement(O, natoms=2); - - G4Material* steam = - new G4Material("WaterSteam", density= 0.3*mg/cm3, ncomponents=1, - kStateGas, 500.*kelvin, 2.*atmosphere); - steam->AddMaterial(H2O, fractionmass=1.); - - // - // examples of vacuum - // - - G4Material* Vacuum = - new G4Material("Vacuum", z=1., a=1.01*g/mole,density= universe_mean_density, - kStateGas, 2.73*kelvin, 3.e-18*pascal); - - G4Material* beam = - new G4Material("Beam", density= 1.e-5*g/cm3, ncomponents=1, - kStateGas, STP_Temperature, 2.e-2*bar); - beam->AddMaterial(Air, fractionmass=1.); - - G4cout << *(G4Material::GetMaterialTable()) << G4endl; - - //default materials of the World - defaultMaterial = Vacuum; -} - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -G4VPhysicalVolume* ILDExDetectorConstruction::ConstructDetector() -{ - - // Clean old geometry, if any - // - G4GeometryManager::GetInstance()->OpenGeometry(); - G4PhysicalVolumeStore::GetInstance()->Clean(); - G4LogicalVolumeStore::GetInstance()->Clean(); - G4SolidStore::GetInstance()->Clean(); - - G4VisAttributes* VisAtt ; - - VisAtt = new G4VisAttributes(G4Colour(1.,1.,1.)); - VisAtt->SetVisibility(true); - - // - // World - // - solidWorld = new G4Box("World", //its name - WorldSizeX/2,WorldSizeY/2,WorldSizeZ/2); //its size - - logicWorld = new G4LogicalVolume(solidWorld, //its solid - defaultMaterial, //its material - "World"); //its name - - physiWorld = new G4PVPlacement(0, //no rotation - G4ThreeVector(), //at (0,0,0) - logicWorld, //its logical volume - "World", //its name - 0, //its mother volume - false, //no boolean operation - 0); //copy number - - - logicWorld->SetVisAttributes(G4VisAttributes::Invisible); - - ILDExVXD vxd(logicWorld); - - ILDExSIT sit(logicWorld); - - ILDExTPC tpc(logicWorld); - - std::ifstream gdml_file("World.gdml"); - if (gdml_file.good()) { - G4cout << G4endl; - G4cout << "#############################################" << G4endl; - G4cout << "# Please remove file World.gdml #" << G4endl; - G4cout << "#############################################" << G4endl; - G4cout << G4endl; - exit(1); - } - - //G4GDMLParser parser; - //parser.Write("World.gdml", physiWorld) ; - - // - //always return the physical World - // - return physiWorld; -} - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - - -#include "G4FieldManager.hh" -#include "G4TransportationManager.hh" - -void ILDExDetectorConstruction::SetMagField(G4double fieldValue) -{ - //apply a global uniform magnetic field along Z axis - G4FieldManager* fieldMgr - = G4TransportationManager::GetTransportationManager()->GetFieldManager(); - - if(magField) delete magField; //delete the existing magn field - - if(fieldValue!=0.) // create a new one if non nul - { magField = new G4UniformMagField(G4ThreeVector(0.,0.,fieldValue)); - fieldMgr->SetDetectorField(magField); - fieldMgr->CreateChordFinder(magField); - } else { - magField = 0; - fieldMgr->SetDetectorField(magField); - } -} - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -#include "G4RunManager.hh" - -void ILDExDetectorConstruction::UpdateGeometry() -{ - G4RunManager::GetRunManager()->DefineWorldVolume(ConstructDetector()); -} - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - - diff --git a/ILDEx/src/ILDExDetectorMessenger.cc b/ILDEx/src/ILDExDetectorMessenger.cc deleted file mode 100644 index c214e522c45a1ff2b59e8f9742b97b9514b0aceb..0000000000000000000000000000000000000000 --- a/ILDEx/src/ILDExDetectorMessenger.cc +++ /dev/null @@ -1,61 +0,0 @@ - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -#include "ILDExDetectorMessenger.hh" - -#include "ILDExDetectorConstruction.hh" -#include "G4UIdirectory.hh" -#include "G4UIcmdWithAString.hh" -#include "G4UIcmdWithAnInteger.hh" -#include "G4UIcmdWithADoubleAndUnit.hh" -#include "G4UIcmdWithoutParameter.hh" - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -ILDExDetectorMessenger::ILDExDetectorMessenger( - ILDExDetectorConstruction* ILDExDet) -:ILDExDetector(ILDExDet) -{ - ILDExDir = new G4UIdirectory("/ILDExDir/"); - ILDExDir->SetGuidance("UI commands of this example"); - - detDir = new G4UIdirectory("/ILDExDir/det/"); - detDir->SetGuidance("detector control"); - - UpdateCmd = new G4UIcmdWithoutParameter("/ILDExDir/det/update",this); - UpdateCmd->SetGuidance("Update detector geometry."); - UpdateCmd->SetGuidance("This command MUST be applied before \"beamOn\" "); - UpdateCmd->SetGuidance("if you changed geometrical value(s)."); - UpdateCmd->AvailableForStates(G4State_Idle); - - MagFieldCmd = new G4UIcmdWithADoubleAndUnit("/ILDExDir/det/setField",this); - MagFieldCmd->SetGuidance("Define magnetic field."); - MagFieldCmd->SetGuidance("Magnetic field will be in Z direction."); - MagFieldCmd->SetParameterName("Bz",false); - MagFieldCmd->SetUnitCategory("Magnetic flux density"); - MagFieldCmd->AvailableForStates(G4State_PreInit,G4State_Idle); -} - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -ILDExDetectorMessenger::~ILDExDetectorMessenger() -{ - delete MagFieldCmd; - delete detDir; - delete ILDExDir; -} - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -void ILDExDetectorMessenger::SetNewValue(G4UIcommand* command,G4String newValue) -{ - - if( command == UpdateCmd ) - { ILDExDetector->UpdateGeometry(); } - - if( command == MagFieldCmd ) - { ILDExDetector->SetMagField(MagFieldCmd->GetNewDoubleValue(newValue));} -} - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... diff --git a/ILDEx/src/ILDExEventAction.cc b/ILDEx/src/ILDExEventAction.cc deleted file mode 100644 index 45b872b60dbad42b55be80352310666297882a4c..0000000000000000000000000000000000000000 --- a/ILDEx/src/ILDExEventAction.cc +++ /dev/null @@ -1,82 +0,0 @@ - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -#include "ILDExEventAction.hh" - -#include "ILDExRunAction.hh" -#include "ILDExEventActionMessenger.hh" - -#include "G4Event.hh" -#include "G4TrajectoryContainer.hh" -#include "G4VTrajectory.hh" -#include "G4VVisManager.hh" -#include "G4UnitsTable.hh" - -#include "Randomize.hh" -#include <iomanip> - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -ILDExEventAction::ILDExEventAction(ILDExRunAction* run) -:runAct(run),printModulo(1),eventMessenger(0) -{ - eventMessenger = new ILDExEventActionMessenger(this); -} - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -ILDExEventAction::~ILDExEventAction() -{ - delete eventMessenger; -} - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -void ILDExEventAction::BeginOfEventAction(const G4Event* evt) -{ - G4int evtNb = evt->GetEventID(); - if (evtNb%printModulo == 0) { - G4cout << "\n---> Begin of event: " << evtNb << G4endl; - CLHEP::HepRandom::showEngineStatus(); -} - - // initialisation per event - EnergySupport = EnergySensitive = 0.; - TrackLSupport = TrackLSensitive = 0.; - AngleSupport = AngleSensitive = 0.; - - -} - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -void ILDExEventAction::EndOfEventAction(const G4Event* evt) -{ - //accumulates statistic - // - runAct->fillPerEvent(EnergySupport, EnergySensitive, TrackLSupport, TrackLSensitive, AngleSupport, AngleSensitive); - - //print per event (modulo n) - // - G4int evtNb = evt->GetEventID(); - if (evtNb%printModulo == 0) { - G4cout << "---> End of event: " << evtNb << G4endl; - - G4cout - << " Support: total energy: " << std::setw(7) - << G4BestUnit(EnergySupport,"Energy") - << " total track length: " << std::setw(7) - << G4BestUnit(TrackLSupport,"Length") - << G4endl - << " Sensitive: total energy: " << std::setw(7) - << G4BestUnit(EnergySensitive,"Energy") - << " total track length: " << std::setw(7) - << G4BestUnit(TrackLSensitive,"Length") - << G4endl; - - } - -} - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... diff --git a/ILDEx/src/ILDExEventActionMessenger.cc b/ILDEx/src/ILDExEventActionMessenger.cc deleted file mode 100644 index 4b1edfdc418f49c43650ecd427dc846bc7260367..0000000000000000000000000000000000000000 --- a/ILDEx/src/ILDExEventActionMessenger.cc +++ /dev/null @@ -1,43 +0,0 @@ - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -#include "ILDExEventActionMessenger.hh" - -#include "ILDExEventAction.hh" -#include "G4UIdirectory.hh" -#include "G4UIcmdWithAnInteger.hh" -#include "globals.hh" - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -ILDExEventActionMessenger::ILDExEventActionMessenger(ILDExEventAction* EvAct) -:eventAction(EvAct) -{ - eventDir = new G4UIdirectory("/ILDExDir/event/"); - eventDir->SetGuidance("event control"); - - PrintCmd = new G4UIcmdWithAnInteger("/ILDExDir/event/printModulo",this); - PrintCmd->SetGuidance("Print events modulo n"); - PrintCmd->SetParameterName("EventNb",false); - PrintCmd->SetRange("EventNb>0"); -} - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -ILDExEventActionMessenger::~ILDExEventActionMessenger() -{ - delete PrintCmd; - delete eventDir; -} - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -void ILDExEventActionMessenger::SetNewValue( - G4UIcommand* command,G4String newValue) -{ - if(command == PrintCmd) - {eventAction->SetPrintModulo(PrintCmd->GetNewIntValue(newValue));} -} - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... diff --git a/ILDEx/src/ILDExPhysicsList.cc b/ILDEx/src/ILDExPhysicsList.cc deleted file mode 100644 index dfeea175a43b023a4467098ca2ac2f5eefc1603d..0000000000000000000000000000000000000000 --- a/ILDEx/src/ILDExPhysicsList.cc +++ /dev/null @@ -1,195 +0,0 @@ - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -#include "ILDExPhysicsList.hh" - -#include "G4ProcessManager.hh" - -#include "G4BosonConstructor.hh" -#include "G4LeptonConstructor.hh" -#include "G4MesonConstructor.hh" -#include "G4BosonConstructor.hh" -#include "G4BaryonConstructor.hh" -#include "G4IonConstructor.hh" - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -ILDExPhysicsList::ILDExPhysicsList(): G4VUserPhysicsList() -{ - defaultCutValue = 1.0*mm; - SetVerboseLevel(1); -} - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -ILDExPhysicsList::~ILDExPhysicsList() -{} - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -void ILDExPhysicsList::ConstructParticle() -{ - // In this method, static member functions should be called - // for all particles which you want to use. - // This ensures that objects of these particle types will be - // created in the program. - - G4BosonConstructor pBosonConstructor; - pBosonConstructor.ConstructParticle(); - - G4LeptonConstructor pLeptonConstructor; - pLeptonConstructor.ConstructParticle(); - -// G4MesonConstructor pMesonConstructor; -// pMesonConstructor.ConstructParticle(); -// -// G4BaryonConstructor pBaryonConstructor; -// pBaryonConstructor.ConstructParticle(); -// -// G4IonConstructor pIonConstructor; -// pIonConstructor.ConstructParticle(); -} - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -void ILDExPhysicsList::ConstructProcess() -{ - AddTransportation(); - ConstructEM(); - ConstructDecay(); -} - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -#include "G4ComptonScattering.hh" -#include "G4GammaConversion.hh" -#include "G4PhotoElectricEffect.hh" - -#include "G4eMultipleScattering.hh" -#include "G4eIonisation.hh" -#include "G4eBremsstrahlung.hh" -#include "G4eplusAnnihilation.hh" - -#include "G4MuMultipleScattering.hh" -#include "G4MuIonisation.hh" -#include "G4MuBremsstrahlung.hh" -#include "G4MuPairProduction.hh" - -#include "G4hMultipleScattering.hh" -#include "G4hIonisation.hh" -#include "G4hBremsstrahlung.hh" -#include "G4hPairProduction.hh" - -#include "G4ionIonisation.hh" - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -void ILDExPhysicsList::ConstructEM() -{ - theParticleIterator->reset(); - while( (*theParticleIterator)() ){ - G4ParticleDefinition* particle = theParticleIterator->value(); - G4ProcessManager* pmanager = particle->GetProcessManager(); - G4String particleName = particle->GetParticleName(); - - if (particleName == "gamma") { - // gamma -// pmanager->AddDiscreteProcess(new G4PhotoElectricEffect); -// pmanager->AddDiscreteProcess(new G4ComptonScattering); -// pmanager->AddDiscreteProcess(new G4GammaConversion); - - } else if (particleName == "e-") { - //electron - pmanager->AddProcess(new G4eMultipleScattering,-1, 1, 1); - pmanager->AddProcess(new G4eIonisation, -1, 2, 2); -// pmanager->AddProcess(new G4eBremsstrahlung, -1, 3, 3); - - } else if (particleName == "e+") { - //positron - pmanager->AddProcess(new G4eMultipleScattering,-1, 1, 1); - pmanager->AddProcess(new G4eIonisation, -1, 2, 2); -// pmanager->AddProcess(new G4eBremsstrahlung, -1, 3, 3); -// pmanager->AddProcess(new G4eplusAnnihilation, 0,-1, 4); - - } else if( particleName == "mu+" || - particleName == "mu-" ) { - //muon - pmanager->AddProcess(new G4MuMultipleScattering,-1, 1, 1); - pmanager->AddProcess(new G4MuIonisation, -1, 2, 2); - // pmanager->AddProcess(new G4MuBremsstrahlung, -1, 3, 3); - // pmanager->AddProcess(new G4MuPairProduction, -1, 4, 4); - - } else if( particleName == "proton" || - particleName == "pi-" || - particleName == "pi+" ) { - //proton -// pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1); -// pmanager->AddProcess(new G4hIonisation, -1, 2, 2); -// pmanager->AddProcess(new G4hBremsstrahlung, -1, 3, 3); -// pmanager->AddProcess(new G4hPairProduction, -1, 4, 4); - - } else if( particleName == "alpha" || - particleName == "He3" ) { - //alpha -// pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1); -// pmanager->AddProcess(new G4ionIonisation, -1, 2, 2); - - } else if( particleName == "GenericIon" ) { - //Ions -// pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1); -// pmanager->AddProcess(new G4ionIonisation, -1, 2, 2); - - } else if ((!particle->IsShortLived()) && - (particle->GetPDGCharge() != 0.0) && - (particle->GetParticleName() != "chargedgeantino")) { - //all others charged particles except geantino -// pmanager->AddProcess(new G4hMultipleScattering,-1, 1, 1); -// pmanager->AddProcess(new G4hIonisation, -1, 2, 2); - } - } -} - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -#include "G4Decay.hh" - -void ILDExPhysicsList::ConstructDecay() -{ - // Add Decay Process - G4Decay* theDecayProcess = new G4Decay(); - theParticleIterator->reset(); - while( (*theParticleIterator)() ){ - G4ParticleDefinition* particle = theParticleIterator->value(); - G4ProcessManager* pmanager = particle->GetProcessManager(); - if (theDecayProcess->IsApplicable(*particle)) { - pmanager ->AddProcess(theDecayProcess); - // set ordering for PostStepDoIt and AtRestDoIt - pmanager ->SetProcessOrdering(theDecayProcess, idxPostStep); - pmanager ->SetProcessOrdering(theDecayProcess, idxAtRest); - } - } -} - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -void ILDExPhysicsList::SetCuts() -{ - if (verboseLevel >0){ - G4cout << "ILDExPhysicsList::SetCuts:"; - G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl; - } - - // set cut values for gamma at first and for e- second and next for e+, - // because some processes for e+/e- need cut values for gamma - // - SetCutValue(defaultCutValue, "gamma"); - SetCutValue(defaultCutValue, "e-"); - SetCutValue(defaultCutValue, "e+"); - // SetCutValue(defaultCutValue, "proton"); - - if (verboseLevel>0) DumpCutValuesTable(); -} - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - diff --git a/ILDEx/src/ILDExPrimaryGeneratorAction.cc b/ILDEx/src/ILDExPrimaryGeneratorAction.cc deleted file mode 100644 index 7504e86a19a4bc6112dec2dffa3f418bb375c5cd..0000000000000000000000000000000000000000 --- a/ILDEx/src/ILDExPrimaryGeneratorAction.cc +++ /dev/null @@ -1,66 +0,0 @@ - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -#include "ILDExPrimaryGeneratorAction.hh" - -#include "ILDExDetectorConstruction.hh" -#include "ILDExPrimaryGeneratorMessenger.hh" - -#include "G4Event.hh" -#include "G4ParticleGun.hh" -#include "G4ParticleTable.hh" -#include "G4ParticleDefinition.hh" -#include "Randomize.hh" - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -ILDExPrimaryGeneratorAction::ILDExPrimaryGeneratorAction( - ILDExDetectorConstruction* ILDExDC) -:ILDExDetector(ILDExDC),rndmFlag("off") -{ - G4int n_particle = 1; - particleGun = new G4ParticleGun(n_particle); - - //create a messenger for this class - gunMessenger = new ILDExPrimaryGeneratorMessenger(this); - - // default particle kinematic - - G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable(); - G4String particleName; - G4ParticleDefinition* particle - = particleTable->FindParticle(particleName="e-"); - particleGun->SetParticleDefinition(particle); - particleGun->SetParticleMomentumDirection(G4ThreeVector(1.,0.,0.)); - particleGun->SetParticleEnergy(50.*MeV); - G4double position = -0.5*(ILDExDetector->GetWorldSizeX()); - particleGun->SetParticlePosition(G4ThreeVector(position,0.*cm,0.*cm)); - -} - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -ILDExPrimaryGeneratorAction::~ILDExPrimaryGeneratorAction() -{ - delete particleGun; - delete gunMessenger; -} - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -void ILDExPrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent) -{ - //this function is called at the begining of event - // - G4double x0 = 0.*cm; - G4double y0 = 0.*cm; - G4double z0 = 0.*cm; - - particleGun->SetParticlePosition(G4ThreeVector(x0,y0,z0)); - - particleGun->GeneratePrimaryVertex(anEvent); -} - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - diff --git a/ILDEx/src/ILDExPrimaryGeneratorMessenger.cc b/ILDEx/src/ILDExPrimaryGeneratorMessenger.cc deleted file mode 100644 index d09354700c412a437e94ed6a16b1b38ad4fc688f..0000000000000000000000000000000000000000 --- a/ILDEx/src/ILDExPrimaryGeneratorMessenger.cc +++ /dev/null @@ -1,47 +0,0 @@ - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -#include "ILDExPrimaryGeneratorMessenger.hh" - -#include "ILDExPrimaryGeneratorAction.hh" -#include "G4UIdirectory.hh" -#include "G4UIcmdWithAString.hh" - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -ILDExPrimaryGeneratorMessenger::ILDExPrimaryGeneratorMessenger( - ILDExPrimaryGeneratorAction* ILDExGun) -:ILDExAction(ILDExGun) -{ - gunDir = new G4UIdirectory("/ILDExDir/gun/"); - gunDir->SetGuidance("PrimaryGenerator control"); - - RndmCmd = new G4UIcmdWithAString("/ILDExDir/gun/rndm",this); - RndmCmd->SetGuidance("Shoot randomly the incident particle."); - RndmCmd->SetGuidance(" Choice : on, off(default)"); - RndmCmd->SetParameterName("choice",true); - RndmCmd->SetDefaultValue("on"); - RndmCmd->SetCandidates("on off"); - RndmCmd->AvailableForStates(G4State_PreInit,G4State_Idle); -} - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -ILDExPrimaryGeneratorMessenger::~ILDExPrimaryGeneratorMessenger() -{ - delete RndmCmd; - delete gunDir; -} - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -void ILDExPrimaryGeneratorMessenger::SetNewValue( - G4UIcommand* command, G4String newValue) -{ - if( command == RndmCmd ) - { ILDExAction->SetRndmFlag(newValue);} -} - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - diff --git a/ILDEx/src/ILDExRunAction.cc b/ILDEx/src/ILDExRunAction.cc deleted file mode 100644 index 8fb120686ffcf820567be51c46dffc628c0c07f9..0000000000000000000000000000000000000000 --- a/ILDEx/src/ILDExRunAction.cc +++ /dev/null @@ -1,119 +0,0 @@ - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -#include "ILDExRunAction.hh" - -#include "G4Run.hh" -#include "G4RunManager.hh" -#include "G4UnitsTable.hh" - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -ILDExRunAction::ILDExRunAction() -{} - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -ILDExRunAction::~ILDExRunAction() -{} - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -void ILDExRunAction::BeginOfRunAction(const G4Run* aRun) -{ - G4cout << "### Run " << aRun->GetRunID() << " start." << G4endl; - - //inform the runManager to save random number seed - G4RunManager::GetRunManager()->SetRandomNumberStore(true); - - - //initialize cumulative quantities - // - - sumESupport = sum2ESupport = sumESensitive = sum2ESensitive = 0.; - sumLSupport = sum2LSupport = sumLSensitive = sum2LSensitive = 0.; - sumAngleSupport = sum2AngleSupport = sumAngleSensitive = sum2AngleSensitive = 0.; - -} - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -void ILDExRunAction::fillPerEvent(G4double ESupport, G4double ESensitive, - G4double LSupport, G4double LSensitive, - G4double AngleSupport, G4double AngleSensitive) -{ - //accumulate statistic - // - sumESupport += ESupport; sum2ESupport += ESupport*ESupport; - sumESensitive += ESensitive; sum2ESensitive += ESensitive*ESensitive; - - sumLSupport += LSupport; sum2LSupport += LSupport*LSupport; - sumLSensitive += LSensitive; sum2LSensitive += LSensitive*LSensitive; - - sumAngleSupport += AngleSupport; sum2AngleSupport += AngleSupport*AngleSupport; - sumAngleSensitive += AngleSensitive; sum2AngleSensitive += AngleSensitive*AngleSensitive; -} - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -void ILDExRunAction::EndOfRunAction(const G4Run* aRun) -{ - G4int NbOfEvents = aRun->GetNumberOfEvent(); - if (NbOfEvents == 0) return; - - //compute statistics: mean and rms - // - sumESupport /= NbOfEvents; sum2ESupport /= NbOfEvents; - G4double rmsESupport = sum2ESupport - sumESupport*sumESupport; - if (rmsESupport >0.) rmsESupport = std::sqrt(rmsESupport); else rmsESupport = 0.; - - sumESensitive /= NbOfEvents; sum2ESensitive /= NbOfEvents; - G4double rmsESensitive = sum2ESensitive - sumESensitive*sumESensitive; - if (rmsESensitive >0.) rmsESensitive = std::sqrt(rmsESensitive); else rmsESensitive = 0.; - - sumLSupport /= NbOfEvents; sum2LSupport /= NbOfEvents; - G4double rmsLSupport = sum2LSupport - sumLSupport*sumLSupport; - if (rmsLSupport >0.) rmsLSupport = std::sqrt(rmsLSupport); else rmsLSupport = 0.; - - sumLSensitive /= NbOfEvents; sum2LSensitive /= NbOfEvents; - G4double rmsLSensitive = sum2LSensitive - sumLSensitive*sumLSensitive; - if (rmsLSensitive >0.) rmsLSensitive = std::sqrt(rmsLSensitive); else rmsLSensitive = 0.; - - sumAngleSupport /= NbOfEvents; sum2AngleSupport /= NbOfEvents; - G4double rmsAngleSupport = sum2AngleSupport - sumAngleSupport*sumAngleSupport; - if (rmsAngleSupport >0.) rmsAngleSupport = std::sqrt(rmsAngleSupport); else rmsAngleSupport = 0.; - - sumAngleSensitive /= NbOfEvents; sum2AngleSensitive /= NbOfEvents; - G4double rmsAngleSensitive = sum2AngleSensitive - sumAngleSensitive*sumAngleSensitive; - if (rmsAngleSensitive >0.) rmsAngleSensitive = std::sqrt(rmsAngleSensitive); else rmsAngleSensitive = 0.; - - - //print - // - G4cout - << "\n--------------------End of Run------------------------------\n" - << "\n mean Energy in Support : " << G4BestUnit(sumESupport,"Energy") - << " +- " << G4BestUnit(rmsESupport,"Energy") - << "\n mean Energy in Sensitive: " << G4BestUnit(sumESensitive,"Energy") - << " +- " << G4BestUnit(rmsESensitive,"Energy") - << G4endl; - - G4cout - << "\n mean trackLength in Support : " << G4BestUnit(sumLSupport,"Length") - << " +- " << G4BestUnit(rmsLSupport,"Length") - << "\n mean trackLength in Sensitive : " << G4BestUnit(sumLSensitive,"Length") - << " +- " << G4BestUnit(rmsLSensitive,"Length") - << G4endl; - - G4cout - << "\n mean Angle in Support : " << G4BestUnit(sumAngleSupport,"Angle") - << " +- " << G4BestUnit(rmsAngleSupport,"Angle") - << "\n mean Angle in Sensitive: " << G4BestUnit(sumAngleSensitive,"Angle") - << " +- " << G4BestUnit(rmsAngleSensitive,"Angle") - << "\n------------------------------------------------------------\n" - << G4endl; - -} - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... diff --git a/ILDEx/src/ILDExSIT.cc b/ILDEx/src/ILDExSIT.cc deleted file mode 100644 index d40cff0a603a968fb8686256c4b75962c896a8ef..0000000000000000000000000000000000000000 --- a/ILDEx/src/ILDExSIT.cc +++ /dev/null @@ -1,208 +0,0 @@ -// -// ILDExSIT.cc -// ILDExample -// - -#include "ILDExSIT.hh" - -#include "G4Material.hh" -#include "G4Box.hh" - -#include "G4LogicalVolume.hh" -#include "G4PVPlacement.hh" - -#include "G4VisAttributes.hh" -#include "G4Colour.hh" - - -ILDExSIT::ILDExSIT( G4LogicalVolume* motherlog ) : _motherlog(motherlog) { - - this->set_geom_values(); - this->build(); - -} - -void ILDExSIT::set_geom_values(){ - - SIT_Layer layer; - - layer.nladders = 10; - layer.half_z = 370.0 * mm; - - layer.sensitive_thickness = 0.01 * mm; - layer.sensitive_material = G4Material::GetMaterial("Silicon"); - - layer.support_thickness = 0.1 * mm; - layer.support_material = G4Material::GetMaterial("Carbon"); - - layer.sensitive_radius = 155.0 * mm; - - _layers.push_back(layer); - - layer.nladders = 19; - - layer.sensitive_radius = 300.0 * mm; - layer.half_z = 650.0 * mm; - - _layers.push_back(layer); - - -} - - -void ILDExSIT::build(){ - - G4PVPlacement *Phys; - G4VisAttributes *VisAtt; - - G4Colour bounding_colour ( 1.0, 1.0, 1.0 ); - G4Colour sensitive_colour( 0.0, 0.7, 0.3 ); - G4Colour support_colour ( 0.0, 0.3, 0.7 ); - - for (unsigned int i=0; i<_layers.size(); ++i) { - - - const G4double ladder_dphi = ( twopi / _layers[i].nladders ) * rad; - - - G4double support_radius = _layers[i].sensitive_radius + 0.5 * _layers[i].sensitive_thickness + 0.5 * _layers[i].support_thickness; - - G4double ladder_width = 2.0 * tan(ladder_dphi*0.5) * (_layers[i].sensitive_radius - 0.5 * _layers[i].sensitive_thickness); - - - std::cout << "SIT_Simple_Planar: Layer:" << i - << "\t half length = " << _layers[i].half_z - << "\t min r sensitive = " << _layers[i].sensitive_radius - << "\t min r support = " << support_radius - << "\t n ladders = " << _layers[i].nladders - << "\t ladder width = " << ladder_width - << "\t ladder dphi = " << ladder_dphi / degree - << "\t sensitive mat = " << _layers[i].sensitive_material->GetName() - << "\t support mat = " << _layers[i].sensitive_material->GetName() - << std::endl; - - - std::stringstream name_base; - - name_base << "SIT"; - - std::stringstream name_enum; - name_enum << i; - - // create a bounding volume e.g. a single ladder - - G4Box *sitLadderSolid - = new G4Box(name_base.str()+"_LadderSolid_"+name_enum.str(), - ( _layers[i].sensitive_thickness + _layers[i].support_thickness ) / 2.0 , - ladder_width / 2.0, - _layers[i].half_z); - - - G4LogicalVolume *sitLadderLogical - = new G4LogicalVolume(sitLadderSolid, - _layers[i].sensitive_material, - name_base.str()+"_LadderLogical_"+name_enum.str() ); - - - VisAtt = new G4VisAttributes( bounding_colour ); - // VisAtt->SetForceWireframe(true); - - sitLadderLogical->SetVisAttributes(VisAtt); - - // create the sensitive layer and place it in the bounding volume - - G4Box *sitSenSolid - = new G4Box(name_base.str()+"_SenSolid_"+name_enum.str(), - ( _layers[i].sensitive_thickness ) / 2.0 , - ladder_width / 2.0, - _layers[i].half_z); - - G4LogicalVolume *sitSenLogical - = new G4LogicalVolume(sitSenSolid, - _layers[i].sensitive_material, - name_base.str()+"_SenLogical_"+name_enum.str()); - - - VisAtt = new G4VisAttributes( sensitive_colour ); - // VisAtt->SetForceWireframe(true); - - sitSenLogical->SetVisAttributes(VisAtt); - - - // create the support layer and place it in the bounding volume - - G4Box *sitSupSolid - = new G4Box(name_base.str()+"_SupSolid_"+name_enum.str(), - ( _layers[i].support_thickness ) / 2.0 , - ladder_width / 2.0, - _layers[i].half_z); - - G4LogicalVolume *sitSupLogical - = new G4LogicalVolume(sitSupSolid, - _layers[i].support_material, - name_base.str()+"_SupLogical_"+name_enum.str()); - - - VisAtt = new G4VisAttributes( support_colour ); - // VisAtt->SetForceWireframe(true); - - sitSupLogical->SetVisAttributes(VisAtt); - - G4int cellID0 = i; - - Phys = - new G4PVPlacement(0, - G4ThreeVector( (-( _layers[i].sensitive_thickness + _layers[i].support_thickness ) / 2.0 + (_layers[i].sensitive_thickness / 2.0) ), - 0., - 0.), - sitSenLogical, - name_base.str()+"_SenPhys_"+name_enum.str(), - sitLadderLogical, - false, - cellID0, - false); - - Phys = - new G4PVPlacement(0, - G4ThreeVector( (-( _layers[i].sensitive_thickness + _layers[i].support_thickness ) / 2.0 + _layers[i].sensitive_thickness + (_layers[i].support_thickness / 2.0) ), - 0., - 0.), - sitSupLogical, - name_base.str()+"_SupPhys_"+name_enum.str(), - sitLadderLogical, - false, - 0, - false); - - - for( int j = 0 ; j < _layers[i].nladders ; ++j ){ - - std::stringstream ladder_enum; - - ladder_enum << j; - - G4RotationMatrix *rot = new G4RotationMatrix(); - rot->rotateZ( j * -ladder_dphi ); - - cellID0 = i+1 * j ; - - G4float dr = ( ( _layers[i].sensitive_thickness + _layers[i].support_thickness ) / 2.0 ) - ( _layers[i].sensitive_thickness / 2.0 ) ; - - Phys = - new G4PVPlacement(rot, - G4ThreeVector( (_layers[i].sensitive_radius+dr) * cos(j * ladder_dphi), - (_layers[i].sensitive_radius+dr) * sin(j * ladder_dphi), - 0.), - sitLadderLogical, - name_base.str()+"_LadderPhys_"+name_enum.str()+"_"+ladder_enum.str(), - _motherlog, - false, - cellID0, - false); - - } - } -} - - - diff --git a/ILDEx/src/ILDExSteppingAction.cc b/ILDEx/src/ILDExSteppingAction.cc deleted file mode 100644 index 48f45c3188655aa28a2574ba1997c429a36511a3..0000000000000000000000000000000000000000 --- a/ILDEx/src/ILDExSteppingAction.cc +++ /dev/null @@ -1,53 +0,0 @@ - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -#include "ILDExSteppingAction.hh" - -#include "ILDExDetectorConstruction.hh" -#include "ILDExEventAction.hh" - -#include "G4Step.hh" - -////#include "G4RunManager.hh" - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -ILDExSteppingAction::ILDExSteppingAction(ILDExDetectorConstruction* det, - ILDExEventAction* evt) -:detector(det), eventaction(evt) -{ } - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -ILDExSteppingAction::~ILDExSteppingAction() -{ } - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -void ILDExSteppingAction::UserSteppingAction(const G4Step* aStep) -{ - - static G4Material* SiMaterial = G4Material::GetMaterial("Silicon"); - static G4Material* TPCGasMaterial = G4Material::GetMaterial("Argon"); - - // get volume of the current step - G4VPhysicalVolume* volume = aStep->GetPreStepPoint()->GetTouchableHandle()->GetVolume(); - G4Material* material = volume->GetLogicalVolume()->GetMaterial(); - - // collect energy and track length step by step - G4double edep = aStep->GetTotalEnergyDeposit(); - - G4double stepl = 0.; - if (aStep->GetTrack()->GetDefinition()->GetPDGCharge() != 0.) stepl = aStep->GetStepLength(); - - if (material == SiMaterial || material == TPCGasMaterial) { - eventaction->SumSensitive(edep, stepl, 0.0); - } - else { - eventaction->SumSupport(edep, stepl, 0.0); - } - -} - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... diff --git a/ILDEx/src/ILDExSteppingVerbose.cc b/ILDEx/src/ILDExSteppingVerbose.cc deleted file mode 100644 index bf8a7edfcd86aa9b9d5c28b311580b6ea951301e..0000000000000000000000000000000000000000 --- a/ILDEx/src/ILDExSteppingVerbose.cc +++ /dev/null @@ -1,154 +0,0 @@ - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -#include "ILDExSteppingVerbose.hh" - -#include "G4SteppingManager.hh" -#include "G4UnitsTable.hh" - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -ILDExSteppingVerbose::ILDExSteppingVerbose() -{} - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -ILDExSteppingVerbose::~ILDExSteppingVerbose() -{} - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -void ILDExSteppingVerbose::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") - << " "; - - // if( fStepStatus != fWorldBoundary){ - if( fTrack->GetNextVolume() != 0 ) { - G4cout << std::setw(10) << fTrack->GetVolume()->GetName(); - } else { - G4cout << std::setw(10) << "OutOfWorld"; - } - - if(fStep->GetPostStepPoint()->GetProcessDefinedStep() != 0){ - G4cout << " " - << std::setw(10) - << fStep->GetPostStepPoint()->GetProcessDefinedStep() - ->GetProcessName(); - } else { - G4cout << " UserLimit"; - } - - G4cout << G4endl; - - if( verboseLevel == 2 ){ - G4int tN2ndariesTot = fN2ndariesAtRestDoIt + - fN2ndariesAlongStepDoIt + - fN2ndariesPostStepDoIt; - if(tN2ndariesTot>0){ - G4cout << " :----- List of 2ndaries - " - << "#SpawnInStep=" << std::setw(3) << tN2ndariesTot - << "(Rest=" << std::setw(2) << fN2ndariesAtRestDoIt - << ",Along=" << std::setw(2) << fN2ndariesAlongStepDoIt - << ",Post=" << std::setw(2) << fN2ndariesPostStepDoIt - << "), " - << "#SpawnTotal=" << std::setw(3) << (*fSecondary).size() - << " ---------------" - << G4endl; - - for(size_t lp1=(*fSecondary).size()-tN2ndariesTot; - lp1<(*fSecondary).size(); lp1++){ - G4cout << " : " - << std::setw(6) - << G4BestUnit((*fSecondary)[lp1]->GetPosition().x(),"Length") - << std::setw(6) - << G4BestUnit((*fSecondary)[lp1]->GetPosition().y(),"Length") - << std::setw(6) - << G4BestUnit((*fSecondary)[lp1]->GetPosition().z(),"Length") - << std::setw(6) - << G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(),"Energy") - << std::setw(10) - << (*fSecondary)[lp1]->GetDefinition()->GetParticleName(); - G4cout << G4endl; - } - - G4cout << " :-----------------------------" - << "----------------------------------" - << "-- EndOf2ndaries Info ---------------" - << G4endl; - } - } - - } - G4cout.precision(prec); -} - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... - -void ILDExSteppingVerbose::TrackingStarted() -{ - - CopyState(); -G4int prec = G4cout.precision(3); - 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") - << " "; - - if(fTrack->GetNextVolume()){ - G4cout << std::setw(10) << fTrack->GetVolume()->GetName(); - } else { - G4cout << "OutOfWorld"; - } - G4cout << " initStep" << G4endl; - } - G4cout.precision(prec); -} - -//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... diff --git a/ILDEx/src/ILDExTPC.cc b/ILDEx/src/ILDExTPC.cc deleted file mode 100644 index f2a13bc4e5759f4fa2f5375f90f0a0bb4fbf2201..0000000000000000000000000000000000000000 --- a/ILDEx/src/ILDExTPC.cc +++ /dev/null @@ -1,176 +0,0 @@ -// -// ILDExTPC.cc -// ILDExample -// - -#include "ILDExTPC.hh" - -#include "G4Material.hh" -#include "G4Tubs.hh" - -#include "G4LogicalVolume.hh" -#include "G4PVPlacement.hh" - -#include "G4VisAttributes.hh" -#include "G4Colour.hh" - - -ILDExTPC::ILDExTPC( G4LogicalVolume* motherlog ) : _motherlog(motherlog){ - - this->set_geom_values(); - this->build(); - -} - -void ILDExTPC::set_geom_values(){ - - _halfz = 2500 * mm; - _rmax = 1800 * mm; - _rmin = 350 * mm; - - _inner_wall_thickness = 2.0 * mm; - _outer_wall_thickness = 3.0 * mm; - - _endcap_thickness = 1.0 * mm; - - _sensitive_gas_material = G4Material::GetMaterial("Argon"); - _wall_material = G4Material::GetMaterial("Carbon"); - _endcap_material = G4Material::GetMaterial("Silicon"); - -} - -void ILDExTPC::build() { - - G4PVPlacement *Phys; - G4VisAttributes *VisAtt; - - G4Colour bounding_colour ( 1.0, 1.0, 1.0 ); - G4Colour sensitive_colour( 0.7, 0.2, 0.1 ); - G4Colour support_colour ( 0.1, 0.2, 7.0 ); - - - std::cout << "TPC_Simple:" - << "\t half length = " << _halfz - << "\t r max = " << _rmax - << "\t r min = " << _rmin - << "\t sensitive mat = " << _sensitive_gas_material->GetName() - << "\t support mat = " << _endcap_material->GetName() - << std::endl; - - std::stringstream name_base; - - name_base << "TPC"; - - // create a bounding volume - - G4Tubs* tpcBoundingSolid = new G4Tubs(name_base.str()+"_BoundingSolid", _rmin, _rmax, _halfz, 0.0*rad, twopi*rad); - - G4LogicalVolume* tpcBoundingLogical = new G4LogicalVolume(tpcBoundingSolid, _sensitive_gas_material, name_base.str()+"_BoundingLogical"); - - VisAtt = new G4VisAttributes(bounding_colour); - - - tpcBoundingLogical->SetVisAttributes(VisAtt); - - Phys = new G4PVPlacement(0, - G4ThreeVector(0.,0.,0.), - tpcBoundingLogical, - name_base.str()+"_BoundPhys", - _motherlog, - false, - 0, - false); - - - // inner wall - - G4Tubs* tpcInnerWallSolid = new G4Tubs(name_base.str()+"_InnerWallSolid", _rmin, _rmin+_inner_wall_thickness, _halfz, 0.0*rad, twopi*rad); - - G4LogicalVolume* tpcInnerWallLogical = new G4LogicalVolume(tpcInnerWallSolid, _wall_material, name_base.str()+"_InnerWallLogical"); - - VisAtt = new G4VisAttributes(support_colour); - - - tpcInnerWallLogical->SetVisAttributes(VisAtt); - - Phys = new G4PVPlacement(0, - G4ThreeVector(0.,0.,0.), - tpcInnerWallLogical, - name_base.str()+"_InnerWallPhys", - tpcBoundingLogical, - false, - 0, - false); - - // outer wall - - G4Tubs* tpcOuterWallSolid = new G4Tubs(name_base.str()+"_OuterWallSolid", _rmax-_outer_wall_thickness, _rmax, _halfz, 0.0*rad, twopi*rad); - - G4LogicalVolume* tpcOuterWallLogical = new G4LogicalVolume(tpcOuterWallSolid, _wall_material, name_base.str()+"_OuterWallLogical"); - - VisAtt = new G4VisAttributes(support_colour); - - - tpcOuterWallLogical->SetVisAttributes(VisAtt); - - Phys = new G4PVPlacement(0, - G4ThreeVector(0.,0.,0.), - tpcOuterWallLogical, - name_base.str()+"_OuterWallPhys", - tpcBoundingLogical, - false, - 0, - false); - - // endcap - - G4Tubs* tpcEndCapSolid = new G4Tubs(name_base.str()+"_EndCapSolid", _rmin+_inner_wall_thickness, _rmax-_outer_wall_thickness, 0.5*_endcap_thickness, 0.0*rad, twopi*rad); - - G4LogicalVolume* tpcEndCapLogical = new G4LogicalVolume(tpcEndCapSolid, _wall_material, name_base.str()+"_EndCapLogical"); - - VisAtt = new G4VisAttributes(support_colour); - - - tpcEndCapLogical->SetVisAttributes(VisAtt); - - Phys = new G4PVPlacement(0, - G4ThreeVector(0.0,0.0,_halfz-0.5*_endcap_thickness), - tpcEndCapLogical, - name_base.str()+"_EndCapPhysFwd", - tpcBoundingLogical, - false, - 0, - false); - - Phys = new G4PVPlacement(0, - G4ThreeVector(0.0,0.0,-(_halfz-0.5*_endcap_thickness)), - tpcEndCapLogical, - name_base.str()+"_EndCapPhysBwd", - tpcBoundingLogical, - false, - 0, - false); - - - // sensitive gas - - G4Tubs* tpcSensitiveGasSolid = new G4Tubs(name_base.str()+"_SensitiveGasSolid", _rmin+_inner_wall_thickness, _rmax-_outer_wall_thickness, _halfz-_endcap_thickness, 0.0*rad, twopi*rad); - - G4LogicalVolume* tpcSensitiveGasLogical = new G4LogicalVolume(tpcSensitiveGasSolid, _sensitive_gas_material, name_base.str()+"_SensitiveGasLogical"); - - VisAtt = new G4VisAttributes(sensitive_colour); - - - tpcSensitiveGasLogical->SetVisAttributes(VisAtt); - - Phys = new G4PVPlacement(0, - G4ThreeVector(0.,0.,0.), - tpcSensitiveGasLogical, - name_base.str()+"_SensitiveGasPhys", - tpcBoundingLogical, - false, - 0, - false); - - -} diff --git a/ILDEx/src/ILDExVXD.cc b/ILDEx/src/ILDExVXD.cc deleted file mode 100644 index ec01169f576a69cf8f0c064a6f51ad099ed44cf4..0000000000000000000000000000000000000000 --- a/ILDEx/src/ILDExVXD.cc +++ /dev/null @@ -1,236 +0,0 @@ -// -// ILDExVXD.cc -// ILDExample -// - -#include "ILDExVXD.hh" - -#include "G4Material.hh" -#include "G4Box.hh" - -#include "G4LogicalVolume.hh" -#include "G4PVPlacement.hh" - -#include "G4VisAttributes.hh" -#include "G4Colour.hh" - - -ILDExVXD::ILDExVXD( G4LogicalVolume* motherlog ) : _motherlog(motherlog) { - - this->set_geom_values(); - this->build(); - -} - -void ILDExVXD::set_geom_values() { - - VXD_Layer layer; - - - layer.sensitive_thickness = 0.01 * mm; - layer.sensitive_material = G4Material::GetMaterial("Silicon"); - - layer.support_thickness = 0.1 * mm; - layer.support_material = G4Material::GetMaterial("Carbon"); - - layer.ladder_transverse_offset = -2.0 * mm; - - - layer.nladders = 10; - layer.half_z = 65.0 * mm; - - layer.sensitive_radius = 16.0 * mm; - - _layers.push_back(layer); - - layer.sensitive_radius = 18.0 * mm; - - _layers.push_back(layer); - - - layer.nladders = 11; - layer.half_z = 125.0 * mm; - - layer.sensitive_radius = 38.0 * mm; - - _layers.push_back(layer); - - layer.sensitive_radius = 40.0 * mm; - - _layers.push_back(layer); - - - layer.nladders = 17; - layer.half_z = 125.0 * mm; - - layer.sensitive_radius = 58.0 * mm; - - _layers.push_back(layer); - - layer.sensitive_radius = 60.0 * mm; - - _layers.push_back(layer); - -} - - -void ILDExVXD::build(){ - - G4PVPlacement *Phys; - G4VisAttributes *VisAtt; - - G4Colour bounding_colour ( 1.0, 1.0, 1.0 ); - G4Colour sensitive_colour( 1.0, 0.0, 0.0 ); - G4Colour support_colour ( 0.0, 1.0, 0.0 ); - - - for (unsigned int i=0; i<_layers.size(); ++i) { - - - const G4double ladder_dphi = ( twopi / _layers[i].nladders ) * rad; - - - G4double support_radius = _layers[i].sensitive_radius + 0.5 * _layers[i].sensitive_thickness + 0.5 * _layers[i].support_thickness; - - G4double ladder_width = 2.0 * tan(ladder_dphi*0.5) * (_layers[i].sensitive_radius - 0.5 * _layers[i].sensitive_thickness); - - - std::cout << "VXD_Simple_Planar: Layer:" << i - << "\t half length = " << _layers[i].half_z - << "\t min r sensitive = " << _layers[i].sensitive_radius - << "\t min r support = " << support_radius - << "\t n ladders = " << _layers[i].nladders - << "\t ladder width = " << ladder_width - << "\t ladder dphi = " << ladder_dphi / degree - << "\t sensitive mat = " << _layers[i].sensitive_material->GetName() - << "\t support mat = " << _layers[i].sensitive_material->GetName() - << std::endl; - - - std::stringstream name_base; - - name_base << "VDX"; - - std::stringstream name_enum; - name_enum << i; - - // create a bounding volume e.g. a single ladder - - G4Box *sitLadderSolid - = new G4Box(name_base.str()+"_LadderSolid_"+name_enum.str(), - ( _layers[i].sensitive_thickness + _layers[i].support_thickness ) / 2.0 , - ladder_width / 2.0, - _layers[i].half_z); - - - G4LogicalVolume *sitLadderLogical - = new G4LogicalVolume(sitLadderSolid, - _layers[i].sensitive_material, - name_base.str()+"_LadderLogical_"+name_enum.str() ); - - VisAtt = new G4VisAttributes( bounding_colour ); - - sitLadderLogical->SetVisAttributes(VisAtt); - - // create the sensitive layer and place it in the bounding volume - - G4Box *sitSenSolid - = new G4Box(name_base.str()+"_SenSolid_"+name_enum.str(), - ( _layers[i].sensitive_thickness ) / 2.0 , - ladder_width / 2.0, - _layers[i].half_z); - - G4LogicalVolume *sitSenLogical - = new G4LogicalVolume(sitSenSolid, - _layers[i].sensitive_material, - name_base.str()+"_SenLogical_"+name_enum.str()); - - - VisAtt = new G4VisAttributes( sensitive_colour ); - - sitSenLogical->SetVisAttributes(VisAtt); - - - // create the support layer and place it in the bounding volume - - G4Box *sitSupSolid - = new G4Box(name_base.str()+"_SupSolid_"+name_enum.str(), - ( _layers[i].support_thickness ) / 2.0 , - ladder_width / 2.0, - _layers[i].half_z); - - G4LogicalVolume *sitSupLogical - = new G4LogicalVolume(sitSupSolid, - _layers[i].support_material, - name_base.str()+"_SupLogical_"+name_enum.str()); - - - VisAtt = new G4VisAttributes( support_colour ); - - sitSupLogical->SetVisAttributes(VisAtt); - - G4int cellID0 = i; - - G4ThreeVector pos_sen( - (-( _layers[i].sensitive_thickness + _layers[i].support_thickness ) / 2.0 + (_layers[i].sensitive_thickness / 2.0) ), - 0., - 0.); - - Phys = - new G4PVPlacement(0, - pos_sen, - sitSenLogical, - name_base.str()+"_SenPhys_"+name_enum.str(), - sitLadderLogical, - false, - cellID0, - false); - - G4ThreeVector pos_sup( - (-( _layers[i].sensitive_thickness + _layers[i].support_thickness ) / 2.0 + _layers[i].sensitive_thickness + (_layers[i].support_thickness / 2.0) ), - 0., - 0.); - - Phys = - new G4PVPlacement(0, - pos_sup, - sitSupLogical, - name_base.str()+"_SupPhys_"+name_enum.str(), - sitLadderLogical, - false, - 0, - false); - - - for( int j = 0 ; j < _layers[i].nladders ; ++j ){ - - std::stringstream ladder_enum; - - ladder_enum << j; - - G4RotationMatrix *rot = new G4RotationMatrix(); - rot->rotateZ( j * -ladder_dphi ); - - cellID0 = i+1 * j ; - - G4float dr = ( ( _layers[i].sensitive_thickness + _layers[i].support_thickness ) / 2.0 ) - ( _layers[i].sensitive_thickness / 2.0 ) ; - - G4ThreeVector pos( - (_layers[i].sensitive_radius+dr) * cos(j * ladder_dphi) - _layers[i].ladder_transverse_offset * sin(j*ladder_dphi), - (_layers[i].sensitive_radius+dr) * sin(j * ladder_dphi) + _layers[i].ladder_transverse_offset * cos(j*ladder_dphi), - 0. - ); - - Phys = - new G4PVPlacement(rot, - pos, - sitLadderLogical, - name_base.str()+"_LadderPhys_"+name_enum.str()+"_"+ladder_enum.str(), - _motherlog, - false, - cellID0, - false); - - } - } -}