aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/G4BeamTestDetectorConstruction.h2
-rw-r--r--include/G4BeamTestEMPhysics.h15
-rw-r--r--include/G4BeamTestEventAction.h42
-rw-r--r--include/G4BeamTestRunManager.h34
-rw-r--r--include/G4BeamTestSiHit.h104
-rw-r--r--include/G4BeamTestSiSD.h42
-rw-r--r--include/G4BeamTestTank.h13
-rw-r--r--include/G4BeamTestUserStackingAction.h28
-rw-r--r--include/G4BeamTestUserSteppingAction.h6
9 files changed, 264 insertions, 22 deletions
diff --git a/include/G4BeamTestDetectorConstruction.h b/include/G4BeamTestDetectorConstruction.h
index a3c0c9f..8b45fde 100644
--- a/include/G4BeamTestDetectorConstruction.h
+++ b/include/G4BeamTestDetectorConstruction.h
@@ -4,7 +4,7 @@
#include <G4VUserDetectorConstruction.hh>
#include <G4ThreeVector.hh>
-#include "G4BeamTestTank.h";
+#include "G4BeamTestTank.h"
class G4BeamTestDetectorConstruction: public G4VUserDetectorConstruction
{
diff --git a/include/G4BeamTestEMPhysics.h b/include/G4BeamTestEMPhysics.h
index e7a88dd..bf20b62 100644
--- a/include/G4BeamTestEMPhysics.h
+++ b/include/G4BeamTestEMPhysics.h
@@ -11,17 +11,6 @@
#include <G4eBremsstrahlung.hh>
#include <G4eplusAnnihilation.hh>
-#include <G4Cerenkov.hh>
-#include <G4Scintillation.hh>
-#include <G4OpAbsorption.hh>
-#include <G4OpRayleigh.hh>
-#include <G4OpMieHG.hh>
-#include <G4OpBoundaryProcess.hh>
-
-#include <G4LossTableManager.hh>
-#include <G4EmSaturation.hh>
-
-
/**
@class G4BeamTestEMPhysics
@brief Electromagnetic physics. Used only if Geant4 version is earlier than 4.10.
@@ -41,7 +30,6 @@ public:
void ConstructParticle();
void ConstructProcess();
- void ConstructOp();
private:
// Gamma physics
@@ -59,9 +47,6 @@ private:
G4eIonisation positronIonisation;
G4eBremsstrahlung positronBremsStrahlung;
G4eplusAnnihilation annihilation;
-
- // Cerenkov physics
- G4Cerenkov cerenkov;
};
#endif // G4TANKRESPONSE_G4BEAMTESTEMPHYSICS_H_INCLUDED
diff --git a/include/G4BeamTestEventAction.h b/include/G4BeamTestEventAction.h
new file mode 100644
index 0000000..2d6de49
--- /dev/null
+++ b/include/G4BeamTestEventAction.h
@@ -0,0 +1,42 @@
+#ifndef G4BeamTestEventAction_h
+#define G4BeamTestEventAction_h 1
+
+#include "G4UserEventAction.hh"
+#include "globals.hh"
+
+/// Event action class
+///
+
+class G4BeamTestEventAction : public G4UserEventAction
+{
+ public:
+ G4BeamTestEventAction();
+ virtual ~G4BeamTestEventAction();
+
+ virtual void BeginOfEventAction(const G4Event* );
+ virtual void EndOfEventAction(const G4Event* );
+
+ void AddEdep(G4double edep) { fEdep += edep; }
+ void AddPath(G4double path) { fIntegralZ +=path; }
+ G4double GetPath(){return fIntegralZ;}
+ void SetXY (G4double xhit, G4double yhit) {fXIn=xhit;fYIn=yhit;}
+ G4double GetX()const {return fXIn;}
+
+
+ G4double GetY()const {return fYIn;}
+ private:
+ G4double fEdep;
+ G4double fIntegralZ;
+ G4double fXIn;
+ G4int SiCollID;
+ G4int hcID;
+
+ G4double fYIn;
+};
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+#endif
+
+
+
diff --git a/include/G4BeamTestRunManager.h b/include/G4BeamTestRunManager.h
new file mode 100644
index 0000000..a7eaff0
--- /dev/null
+++ b/include/G4BeamTestRunManager.h
@@ -0,0 +1,34 @@
+#ifndef TOPSIMULATOR_G4BEAMTESTRUNMANAGER_H
+#define TOPSIMULATOR_G4BEAMTESTRUNMANAGER_H
+
+#include <G4RunManager.hh>
+
+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/G4BeamTestSiHit.h b/include/G4BeamTestSiHit.h
new file mode 100644
index 0000000..44dd69a
--- /dev/null
+++ b/include/G4BeamTestSiHit.h
@@ -0,0 +1,104 @@
+#ifndef G4BeamTestSiHit_h
+#define G4BeamTestSiHit_h 1
+#include <iostream>
+#include <fstream>
+
+#include "G4VHit.hh"
+#include "G4THitsCollection.hh"
+#include "G4Allocator.hh"
+#include "G4ThreeVector.hh"
+#include "tls.hh"
+
+/// Tracker hit class
+///
+/// It defines data members to store the trackID, chamberNb, energy deposit,
+/// and position of charged particles in a selected volume:
+/// - fTrackID, fChamberNB, fEdep, fPos
+
+class G4BeamTestSiHit : public G4VHit
+{
+public:
+ G4BeamTestSiHit();
+ G4BeamTestSiHit(const G4BeamTestSiHit&);
+ virtual ~G4BeamTestSiHit();
+
+ // operators
+ const G4BeamTestSiHit& operator=(const G4BeamTestSiHit&);
+ G4int operator==(const G4BeamTestSiHit&) const;
+
+ inline void* operator new(size_t);
+ inline void operator delete(void*);
+
+ // methods from base class
+ virtual void Draw();
+ virtual void Print();
+ virtual void Dataout();
+
+ // Set methods
+ void SetTrackID (G4int track) { fTrackID = track; };
+ void SetEdep (G4double de) { fEdep = de; };
+ void SetPos (G4ThreeVector xyz){ fPos = xyz; };
+ void SetTime(G4double val) { fTime = val; };
+
+
+ // Get methods
+ G4int GetTrackID() const { return fTrackID; };
+ G4double GetEdep() const { return fEdep; };
+ G4ThreeVector GetPos() const { return fPos; };
+ G4double GetTime() const { return fTime; }
+
+ /* const std::string testnew_out = "./testnew.txt"; */
+
+private:
+
+ G4ThreeVector position;
+ G4ThreeVector momentum;
+ G4double energy;
+ G4double time;
+ // std::ofstream testnew;
+
+
+public:
+ inline void SetPosition(G4ThreeVector pos)
+ { position=pos; }
+ inline G4ThreeVector GetPosition()
+ { return position; }
+ inline void SetEnergy(G4double ene)
+ { energy = ene; }
+ inline G4double GetEnergy()
+ { return energy; }
+
+
+private:
+ G4double fTime;
+ G4int fTrackID;
+ G4double fEdep;
+ G4ThreeVector fPos;
+};
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+typedef G4THitsCollection<G4BeamTestSiHit> G4BeamTestSiHitsCollection;
+
+extern G4ThreadLocal G4Allocator<G4BeamTestSiHit>* G4BeamTestSiHitAllocator;
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+inline void* G4BeamTestSiHit::operator new(size_t)
+{
+ if(!G4BeamTestSiHitAllocator)
+ G4BeamTestSiHitAllocator = new G4Allocator<G4BeamTestSiHit>;
+ return (void *) G4BeamTestSiHitAllocator->MallocSingle();
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+inline void G4BeamTestSiHit::operator delete(void *hit)
+{
+ G4BeamTestSiHitAllocator->FreeSingle((G4BeamTestSiHit*) hit);
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+#endif
+
diff --git a/include/G4BeamTestSiSD.h b/include/G4BeamTestSiSD.h
new file mode 100644
index 0000000..20992c0
--- /dev/null
+++ b/include/G4BeamTestSiSD.h
@@ -0,0 +1,42 @@
+#ifndef G4BeamTestSiSD_h
+#define G4BeamTestSiSD_h 1
+
+#include "G4VSensitiveDetector.hh"
+
+#include "G4BeamTestSiHit.h"
+
+#include <vector>
+
+class G4Step;
+class G4HCofThisEvent;
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+/// B2Tracker sensitive detector class
+///
+/// The hits are accounted in hits in ProcessHits() function which is called
+/// by Geant4 kernel at each step. A hit is created with each step with non zero
+/// energy deposit.
+
+class G4BeamTestSiSD : public G4VSensitiveDetector
+{
+public:
+ G4BeamTestSiSD(const G4String& name,
+ const G4String& hitsCollectionName);
+ virtual ~G4BeamTestSiSD();
+
+ // methods from base class
+ virtual void Initialize(G4HCofThisEvent* hitCollection);
+ virtual G4bool ProcessHits(G4Step* step, G4TouchableHistory* history);
+ virtual void EndOfEvent(G4HCofThisEvent* hitCollection);
+
+
+private:
+ G4BeamTestSiHitsCollection* fHitsCollection;
+
+};
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+#endif
+
diff --git a/include/G4BeamTestTank.h b/include/G4BeamTestTank.h
index 3f2fd8c..c4d3400 100644
--- a/include/G4BeamTestTank.h
+++ b/include/G4BeamTestTank.h
@@ -8,12 +8,13 @@
class G4LogicalVolume;
class G4VPhysicalVolume;
-class G4TankIceSD;
#include <G4Types.hh>
#include <G4ThreeVector.hh>
#include <map>
+#include "G4BeamTestSiSD.h"
+
/**
* This class constructs the physical volume of single tanks, serves as bridge to the sensitive detector in the tank, and computes the location of the point that define the snow surface. It also stores the basic tank dimensions (height, radius, snow).
*
@@ -53,9 +54,9 @@ class G4BeamTestTank
/* double GetSnowHeight_I3(); */
/// Energy deposit for a given OM, in Geant4 units (from G4TankIceSD)
- G4double GetEDep_G4(/* const OMKey& omKey */);
+ /* G4double GetEDep_G4(#<{(| const OMKey& omKey |)}>#); */
/// Emission time for a given OM, in Geant4 units (from G4TankIceSD)
- G4double GetTime_G4(/* const OMKey& omKey */);
+ /* G4double GetTime_G4(#<{(| const OMKey& omKey |)}>#); */
/* /// Energy deposit for a given OM, in Geant4 units (from G4TankIceSD) */
/* double GetEDep_I3(const OMKey& omKey); */
@@ -63,9 +64,9 @@ class G4BeamTestTank
/* double GetTime_I3(const OMKey& omKey); */
/// Number of Cherenkovs for a given OM (from G4TankIceSD)
- double GetNumCherenkov(/* const OMKey& omKey */);
+ /* double GetNumCherenkov(#<{(| const OMKey& omKey |)}>#); */
/// Number of Cherenkovs weighted by emission point (from G4TankIceSD)
- double GetNumCherenkovWeight(/* const OMKey& omKey */);
+ /* double GetNumCherenkovWeight(#<{(| const OMKey& omKey |)}>#); */
/* const TankKey& GetTankKey() const {return tankKey_;} */
@@ -94,7 +95,7 @@ class G4BeamTestTank
// std::map<OMKey, G4ThreeVector> relDomPositions_;
G4LogicalVolume* tankLog_;
- G4TankIceSD* iceSD_;
+ G4BeamTestSiSD* iceSD_;
/* const TankKey& tankKey_; */
/* const I3Geometry& geometry_; */
diff --git a/include/G4BeamTestUserStackingAction.h b/include/G4BeamTestUserStackingAction.h
new file mode 100644
index 0000000..556f3d1
--- /dev/null
+++ b/include/G4BeamTestUserStackingAction.h
@@ -0,0 +1,28 @@
+#ifndef G4BeamTestUserStackingAction_H
+#define G4BeamTestUserStackingAction_H 1
+
+#include "globals.hh"
+#include "G4UserStackingAction.hh"
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+class G4BeamTestUserStackingAction : public G4UserStackingAction
+{
+ public:
+ G4BeamTestUserStackingAction();
+ virtual ~G4BeamTestUserStackingAction();
+
+ public:
+ virtual G4ClassificationOfNewTrack ClassifyNewTrack(const G4Track* aTrack);
+ virtual void NewStage();
+ virtual void PrepareNewEvent();
+
+ private:
+ G4int fScintillationCounter;
+ G4int fCerenkovCounter;
+};
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+#endif
+
diff --git a/include/G4BeamTestUserSteppingAction.h b/include/G4BeamTestUserSteppingAction.h
index 2d09799..c4cc863 100644
--- a/include/G4BeamTestUserSteppingAction.h
+++ b/include/G4BeamTestUserSteppingAction.h
@@ -1,6 +1,7 @@
#ifndef G4BEAMTESTUSERSTEPPINGACTION_H_INCLUDED
#define G4BEAMTESTUSERSTEPPINGACTION_H_INCLUDED
#include "G4UserSteppingAction.hh"
+#include "globals.hh"
/**
* Implementation of G4UserSteppingAction. This class kills gammas below threshold (set by G4BeamTestTank).
@@ -12,6 +13,11 @@ class G4BeamTestUserSteppingAction : public G4UserSteppingAction {
~G4BeamTestUserSteppingAction() {}
void UserSteppingAction(const G4Step*);
+
+ private:
+ G4int fScintillationCounter;
+ G4int fCerenkovCounter;
+ G4int fEventNumber;
};
#endif // G4BEAMTESTUSERSTEPPINGACTION_H_INCLUDED