Import Geant4 0.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-01 15:25:35 +02:00
parent 54d6b71f95
commit b97f8d0df7
3237 changed files with 807095 additions and 0 deletions
@@ -0,0 +1,83 @@
#ifndef ExN04CalorimeterHit_h
#define ExN04CalorimeterHit_h 1
#include "G4VHit.hh"
#include "G4THitsCollection.hh"
#include "G4Allocator.hh"
#include "G4ThreeVector.hh"
#include "G4LogicalVolume.hh"
#include "G4Transform3D.hh"
#include "G4RotationMatrix.hh"
class ExN04CalorimeterHit : public G4VHit
{
public:
ExN04CalorimeterHit();
ExN04CalorimeterHit(G4LogicalVolume* logVol,G4int z,G4int phi);
~ExN04CalorimeterHit();
ExN04CalorimeterHit(const ExN04CalorimeterHit &right);
const ExN04CalorimeterHit& operator=(const ExN04CalorimeterHit &right);
int operator==(const ExN04CalorimeterHit &right) const;
inline void *operator new(size_t);
inline void operator delete(void *aHit);
void Draw();
void Print();
private:
G4int ZCellID;
G4int PhiCellID;
G4double edep;
G4ThreeVector pos;
G4RotationMatrix rot;
const G4LogicalVolume* pLogV;
public:
inline void SetCellID(G4int z,G4int phi)
{
ZCellID = z;
PhiCellID = phi;
}
inline G4int GetZ() { return ZCellID; }
inline G4int GetPhi() { return PhiCellID; }
inline void SetEdep(G4double de)
{ edep = de; }
inline void AddEdep(G4double de)
{ edep += de; }
inline G4double GetEdep()
{ return edep; }
inline void SetPos(G4ThreeVector xyz)
{ pos = xyz; }
inline G4ThreeVector GetPos()
{ return pos; }
inline void SetRot(G4RotationMatrix rmat)
{ rot = rmat; }
inline G4RotationMatrix GetRot()
{ return rot; }
inline const G4LogicalVolume * GetLogV()
{ return pLogV; }
};
typedef G4THitsCollection<ExN04CalorimeterHit> ExN04CalorimeterHitsCollection;
extern G4Allocator<ExN04CalorimeterHit> ExN04CalorimeterHitAllocator;
inline void* ExN04CalorimeterHit::operator new(size_t)
{
void *aHit;
aHit = (void *) ExN04CalorimeterHitAllocator.MallocSingle();
return aHit;
}
inline void ExN04CalorimeterHit::operator delete(void *aHit)
{
ExN04CalorimeterHitAllocator.FreeSingle((ExN04CalorimeterHit*) aHit);
}
#endif
@@ -0,0 +1,29 @@
#ifndef ExN04CalorimeterParametrisation_H
#define ExN04CalorimeterParametrisation_H 1
#include "globals.hh"
#include "G4VPVParameterisation.hh"
class G4VPhysicalVolume;
class G4Tubs;
class ExN04CalorimeterParametrisation : public G4VPVParameterisation
{
public:
ExN04CalorimeterParametrisation();
~ExN04CalorimeterParametrisation();
void ComputeTransformation
(const G4int copyNo,G4VPhysicalVolume *physVol) const;
void ComputeDimensions
(G4Tubs & calorimeterLayer, const G4int copyNo,
const G4VPhysicalVolume * physVol) const;
private:
#include "ExN04DetectorParameterDef.hh"
};
#endif
@@ -0,0 +1,20 @@
#ifndef ExN04CalorimeterROGeometry_h
#define ExN04CalorimeterROGeometry_h 1
#include "G4VReadOutGeometry.hh"
class ExN04CalorimeterROGeometry : public G4VReadOutGeometry
{
public:
ExN04CalorimeterROGeometry();
ExN04CalorimeterROGeometry(G4String);
~ExN04CalorimeterROGeometry();
private:
G4VPhysicalVolume* Build();
#include "ExN04DetectorParameterDef.hh"
};
#endif
@@ -0,0 +1,36 @@
#ifndef ExN04CalorimeterSD_h
#define ExN04CalorimeterSD_h 1
#include "G4VSensitiveDetector.hh"
#include "ExN04CalorimeterHit.hh"
class G4Step;
class G4HCofThisEvent;
class G4TouchableHistory;
class ExN04CalorimeterSD : public G4VSensitiveDetector
{
public:
ExN04CalorimeterSD(G4String name);
~ExN04CalorimeterSD();
void Initialize(G4HCofThisEvent*HCE);
G4bool ProcessHits(G4Step*aStep,G4TouchableHistory*ROhist);
void EndOfEvent(G4HCofThisEvent*HCE);
void clear();
void DrawAll();
void PrintAll();
private:
ExN04CalorimeterHitsCollection *CalCollection;
int CellID[20][48];
const int numberOfCellsInZ;
const int numberOfCellsInPhi;
};
#endif
@@ -0,0 +1,26 @@
#ifndef ExN04DetectorConstruction_h
#define ExN04DetectorConstruction_h 1
#include "G4VUserDetectorConstruction.hh"
#include "globals.hh"
class G4VPhysicalVolume;
class ExN04DetectorConstruction : public G4VUserDetectorConstruction
{
public:
ExN04DetectorConstruction();
~ExN04DetectorConstruction();
public:
G4VPhysicalVolume* Construct();
private:
#include "ExN04DetectorParameterDef.hh"
};
#endif
@@ -0,0 +1,47 @@
G4double expHall_x;
G4double expHall_y;
G4double expHall_z;
G4double trkTubs_rmax;
G4double trkTubs_rmin;
G4double trkTubs_dz;
G4double trkTubs_sphi;
G4double trkTubs_dphi;
G4int notrkLayers;
G4double tracker_radius[5];
G4double tracker_thick;
G4double tracker_length[5];
G4double caloTubs_rmax;
G4double caloTubs_rmin;
G4double caloTubs_dz;
G4double caloTubs_sphi;
G4double caloTubs_dphi;
G4int nocaloLayers;
G4double absorber_thick;
G4double scinti_thick;
G4int segmentsinZ;
G4double caloRing_rmax;
G4double caloRing_rmin;
G4double caloRing_dz;
G4double caloRing_sphi;
G4double caloRing_dphi;
G4int segmentsinPhi;
G4double caloCell_rmax;
G4double caloCell_rmin;
G4double caloCell_dz;
G4double caloCell_sphi;
G4double caloCell_dphi;
G4int nomucounter;
G4double muBox_radius;
G4double muBox_width;
G4double muBox_thick;
G4double muBox_length;
@@ -0,0 +1,28 @@
//
// Dummy sensitive used only to flag sensitivity
// in cells of RO geometry.
//
#ifndef ExN04DummySD_h
#define ExN04DummySD_h 1
#include "G4VSensitiveDetector.hh"
class G4Step;
class ExN04DummySD : public G4VSensitiveDetector
{
public:
ExN04DummySD();
~ExN04DummySD() {};
void Initialize(G4HCofThisEvent*HCE) {};
G4bool ProcessHits(G4Step*aStep,G4TouchableHistory*ROhist) {return false;}
void EndOfEvent(G4HCofThisEvent*HCE) {};
void clear() {};
void DrawAll() {};
void PrintAll() {};
};
ExN04DummySD::ExN04DummySD()
: G4VSensitiveDetector("dummySD")
{}
#endif
@@ -0,0 +1,26 @@
#ifndef ExN04EventAction_h
#define ExN04EventAction_h 1
#include "G4UserEventAction.hh"
#include "globals.hh"
class ExN04EventAction : public G4UserEventAction
{
public:
ExN04EventAction();
~ExN04EventAction();
public:
void BeginOfEventAction();
void EndOfEventAction();
private:
G4int trackerCollID;
G4int calorimeterCollID;
G4int muonCollID;
};
#endif
+24
View File
@@ -0,0 +1,24 @@
#ifndef ExN04Field_H
#define ExN04Field_H 1
#include "globals.hh"
#include "G4MagneticField.hh"
class ExN04Field : public G4MagneticField
{
public:
ExN04Field();
~ExN04Field();
void GetFieldValue( const double Point[3],
double *Bfield ) const;
private:
G4double Bz;
G4double rmax_sq;
G4double zmax;
};
#endif
@@ -0,0 +1,63 @@
#ifndef ExN04MuonHit_h
#define ExN04MuonHit_h 1
#include "G4VHit.hh"
#include "G4THitsCollection.hh"
#include "G4Allocator.hh"
#include "G4ThreeVector.hh"
class ExN04MuonHit : public G4VHit
{
public:
ExN04MuonHit();
~ExN04MuonHit();
ExN04MuonHit(const ExN04MuonHit &right);
const ExN04MuonHit& operator=(const ExN04MuonHit &right);
int operator==(const ExN04MuonHit &right) const;
inline void *operator new(size_t);
inline void operator delete(void *aHit);
void Draw();
void Print();
private:
G4double edep;
G4ThreeVector pos;
public:
inline void SetEdep(G4double de)
{ edep = de; }
inline void AddEdep(G4double de)
{ edep += de; }
inline G4double GetEdep()
{ return edep; }
inline void SetPos(G4ThreeVector xyz)
{ pos = xyz; }
inline G4ThreeVector GetPos()
{ return pos; }
};
typedef G4THitsCollection<ExN04MuonHit> ExN04MuonHitsCollection;
extern G4Allocator<ExN04MuonHit> ExN04MuonHitAllocator;
inline void* ExN04MuonHit::operator new(size_t)
{
void *aHit;
aHit = (void *) ExN04MuonHitAllocator.MallocSingle();
return aHit;
}
inline void ExN04MuonHit::operator delete(void *aHit)
{
ExN04MuonHitAllocator.FreeSingle((ExN04MuonHit*) aHit);
}
#endif
@@ -0,0 +1,35 @@
#ifndef ExN04MuonSD_h
#define ExN04MuonSD_h 1
#include "G4VSensitiveDetector.hh"
#include "ExN04MuonHit.hh"
class G4Step;
class G4HCofThisEvent;
class G4TouchableHistory;
class ExN04MuonSD : public G4VSensitiveDetector
{
public:
ExN04MuonSD(G4String name);
~ExN04MuonSD();
void Initialize(G4HCofThisEvent*HCE);
G4bool ProcessHits(G4Step*aStep,G4TouchableHistory*ROhist);
void EndOfEvent(G4HCofThisEvent*HCE);
void clear();
void DrawAll();
void PrintAll();
private:
ExN04MuonHitsCollection * muonCollection;
G4double positionResolution;
};
#endif
@@ -0,0 +1,33 @@
#ifndef ExN04PhysicsList_h
#define ExN04PhysicsList_h 1
#include "G4VUserPhysicsList.hh"
#include "globals.hh"
class ExN04PhysicsList: public G4VUserPhysicsList
{
public:
ExN04PhysicsList();
virtual ~ExN04PhysicsList();
protected:
// Construct particle and physics
virtual void ConstructParticle();
virtual void ConstructProcess();
//
virtual void SetCuts(G4double aCut);
protected:
// these methods Construct physics processes and register them
void AddParameterisation();
virtual void ConstructGeneral();
virtual void ConstructEM();
virtual void ConstructHad();
virtual void ConstructLeptHad();
};
#endif
@@ -0,0 +1,36 @@
#ifndef ExN04PrimaryGeneratorAction_h
#define ExN04PrimaryGeneratorAction_h 1
#include "G4VUserPrimaryGeneratorAction.hh"
#include "globals.hh"
class G4VPrimaryGenerator;
class G4Event;
class ExN04PrimaryGeneratorMessenger;
class ExN04PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
{
public:
ExN04PrimaryGeneratorAction();
~ExN04PrimaryGeneratorAction();
public:
void GeneratePrimaries(G4Event* anEvent);
private:
G4VPrimaryGenerator* HEPEvt;
G4VPrimaryGenerator* particleGun;
ExN04PrimaryGeneratorMessenger* messenger;
G4bool useHEPEvt;
public:
inline void SetHEPEvtGenerator(G4bool f)
{ useHEPEvt = f; }
inline G4bool GetHEPEvtGenerator()
{ return useHEPEvt; }
};
#endif
@@ -0,0 +1,33 @@
#ifndef ExN04PrimaryGeneratorMessenger_h
#define ExN04PrimaryGeneratorMessenger_h 1
class ExN04PrimaryGeneratorAction;
class G4UIdirectory;
class G4UIcmdWithAString;
#include "G4UImessenger.hh"
#include "globals.hh"
class ExN04PrimaryGeneratorMessenger: public G4UImessenger
{
public:
ExN04PrimaryGeneratorMessenger(ExN04PrimaryGeneratorAction* mpga);
~ExN04PrimaryGeneratorMessenger();
public:
void SetNewValue(G4UIcommand * command,G4String newValues);
G4String GetCurrentValue(G4UIcommand * command);
private:
ExN04PrimaryGeneratorAction * myAction;
private: //commands
G4UIdirectory * mydetDirectory;
G4UIcmdWithAString * genCmd;
};
#endif
@@ -0,0 +1,53 @@
#ifndef ExN04StackingAction_H
#define ExN04StackingAction_H 1
#include "globals.hh"
#include "G4UserStackingAction.hh"
#include "G4ThreeVector.hh"
#include <rw/tpordvec.h>
class G4Track;
#include "ExN04TrackerHit.hh"
#include "ExN04MuonHit.hh"
class ExN04StackingActionMessenger;
class ExN04StackingAction : public G4UserStackingAction
{
public:
ExN04StackingAction();
~ExN04StackingAction();
public:
G4ClassificationOfNewTrack ClassifyNewTrack(G4Track *const aTrack);
void NewStage();
void PrepareNewEvent();
private:
G4bool InsideRoI(G4Track *const aTrack,G4double ang);
G4VHitsCollection* GetCollection(G4String colName);
ExN04TrackerHitsCollection* trkHits;
ExN04MuonHitsCollection* muonHits;
ExN04StackingActionMessenger* theMessenger;
G4int stage;
G4int reqMuon;
G4int reqIsoMuon;
G4int reqIso;
G4double angRoI;
public:
inline void SetNRequestMuon(G4int val) { reqMuon = val; }
inline G4int GetNRequestMuon() const { return reqMuon; }
inline void SetNRequestIsoMuon(G4int val) { reqIsoMuon = val; }
inline G4int GetNRequestIsoMuon() const { return reqIsoMuon; }
inline void SetNIsolation(G4int val) { reqIso = val; }
inline G4int GetNIsolation() const { return reqIso; }
inline void SetRoIAngle(G4double val) { angRoI = val; }
inline G4double GetRoIAngle() const { return angRoI; }
};
#endif
@@ -0,0 +1,35 @@
#ifndef ExN04StackingActionMessenger_h
#define ExN04StackingActionMessenger_h 1
class ExN04StackingAction;
class G4UIcmdWithAnInteger;
class G4UIcmdWithADoubleAndUnit;
#include "G4UImessenger.hh"
#include "globals.hh"
class ExN04StackingActionMessenger: public G4UImessenger
{
public:
ExN04StackingActionMessenger(ExN04StackingAction* msa);
~ExN04StackingActionMessenger();
public:
void SetNewValue(G4UIcommand * command,G4String newValues);
G4String GetCurrentValue(G4UIcommand * command);
private:
ExN04StackingAction * myAction;
private: //commands
G4UIcmdWithAnInteger * muonCmd;
G4UIcmdWithAnInteger * isomuonCmd;
G4UIcmdWithAnInteger * isoCmd;
G4UIcmdWithADoubleAndUnit * roiCmd;
};
#endif
@@ -0,0 +1,18 @@
#ifndef ExN04SteppingAction_H
#define ExN04SteppingAction_H 1
#include "globals.hh"
#include "G4UserSteppingAction.hh"
class ExN04SteppingAction : public G4UserSteppingAction
{
public:
ExN04SteppingAction();
~ExN04SteppingAction();
virtual void UserSteppingAction();
};
#endif
@@ -0,0 +1,60 @@
#ifndef ExN04TrackerHit_h
#define ExN04TrackerHit_h 1
#include "G4VHit.hh"
#include "G4THitsCollection.hh"
#include "G4Allocator.hh"
#include "G4ThreeVector.hh"
class ExN04TrackerHit : public G4VHit
{
public:
ExN04TrackerHit();
~ExN04TrackerHit();
ExN04TrackerHit(const ExN04TrackerHit &right);
const ExN04TrackerHit& operator=(const ExN04TrackerHit &right);
int operator==(const ExN04TrackerHit &right) const;
inline void *operator new(size_t);
inline void operator delete(void *aHit);
void Draw();
void Print();
private:
G4double edep;
G4ThreeVector pos;
public:
inline void SetEdep(G4double de)
{ edep = de; }
inline G4double GetEdep()
{ return edep; }
inline void SetPos(G4ThreeVector xyz)
{ pos = xyz; }
inline G4ThreeVector GetPos()
{ return pos; }
};
typedef G4THitsCollection<ExN04TrackerHit> ExN04TrackerHitsCollection;
extern G4Allocator<ExN04TrackerHit> ExN04TrackerHitAllocator;
inline void* ExN04TrackerHit::operator new(size_t)
{
void *aHit;
aHit = (void *) ExN04TrackerHitAllocator.MallocSingle();
return aHit;
}
inline void ExN04TrackerHit::operator delete(void *aHit)
{
ExN04TrackerHitAllocator.FreeSingle((ExN04TrackerHit*) aHit);
}
#endif
@@ -0,0 +1,29 @@
#ifndef ExN04TrackerParametrisation_H
#define ExN04TrackerParametrisation_H 1
#include "globals.hh"
#include "G4VPVParameterisation.hh"
class G4VPhysicalVolume;
class G4Tubs;
class ExN04TrackerParametrisation : public G4VPVParameterisation
{
public:
ExN04TrackerParametrisation();
~ExN04TrackerParametrisation();
void ComputeTransformation
(const G4int copyNo,G4VPhysicalVolume *physVol) const;
void ComputeDimensions
(G4Tubs & trackerLayer, const G4int copyNo,
const G4VPhysicalVolume * physVol) const;
private:
#include "ExN04DetectorParameterDef.hh"
};
#endif
@@ -0,0 +1,35 @@
#ifndef ExN04TrackerSD_h
#define ExN04TrackerSD_h 1
#include "G4VSensitiveDetector.hh"
#include "ExN04TrackerHit.hh"
class G4Step;
class G4HCofThisEvent;
class G4TouchableHistory;
class ExN04TrackerSD : public G4VSensitiveDetector
{
public:
ExN04TrackerSD(G4String name);
~ExN04TrackerSD();
void Initialize(G4HCofThisEvent*HCE);
G4bool ProcessHits(G4Step*aStep,G4TouchableHistory*ROhist);
void EndOfEvent(G4HCofThisEvent*HCE);
void clear();
void DrawAll();
void PrintAll();
private:
ExN04TrackerHitsCollection *trackerCollection;
public:
};
#endif
@@ -0,0 +1,18 @@
#ifndef ExN04TrackingAction_h
#define ExN04TrackingAction_h 1
#include "G4UserTrackingAction.hh"
class ExN04TrackingAction : public G4UserTrackingAction {
public:
ExN04TrackingAction(){};
~ExN04TrackingAction(){};
void PreUserTrackingAction();
};
#endif