Import Geant4 6.2.0 source tree
This commit is contained in:
@@ -0,0 +1,84 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: HadrontherapyCalorHit.hh,v 1.0
|
||||
// --------------------------------------------------------------
|
||||
// GEANT 4 - Hadrontherapy example
|
||||
// --------------------------------------------------------------
|
||||
// Code developed by:
|
||||
//
|
||||
// G.A.P. Cirrone, G. Russo
|
||||
// Laboratori Nazionali del Sud - INFN, Catania, Italy
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
#ifndef HadrontherapyCalorHit_h
|
||||
#define HadrontherapyCalorHit_h 1
|
||||
|
||||
#include "G4VHit.hh"
|
||||
#include "G4THitsCollection.hh"
|
||||
#include "G4Allocator.hh"
|
||||
|
||||
// --------------------------------------------------------------
|
||||
class HadrontherapyCalorHit : public G4VHit
|
||||
{
|
||||
public:
|
||||
HadrontherapyCalorHit();
|
||||
~HadrontherapyCalorHit();
|
||||
HadrontherapyCalorHit(const HadrontherapyCalorHit&);
|
||||
const HadrontherapyCalorHit& operator=(const HadrontherapyCalorHit&);
|
||||
|
||||
inline void* operator new(size_t);
|
||||
inline void operator delete(void*);
|
||||
void Print();
|
||||
|
||||
public:
|
||||
void AddAbs(G4double de, G4double dl) {EdepAbs += de; TrackLengthAbs += dl;};
|
||||
void AddGap(G4double de, G4double dl) {EdepGap += de; TrackLengthGap += dl;};
|
||||
G4double GetEdepAbs() {return EdepAbs;};
|
||||
G4double GetTrakAbs() {return TrackLengthAbs;};
|
||||
G4double GetEdepGap() {return EdepGap; };
|
||||
G4double GetTrakGap() {return TrackLengthGap;};
|
||||
private:
|
||||
G4double EdepAbs, TrackLengthAbs;
|
||||
G4double EdepGap, TrackLengthGap;
|
||||
};
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
typedef G4THitsCollection<HadrontherapyCalorHit> HadrontherapyCalorHitsCollection;
|
||||
extern G4Allocator<HadrontherapyCalorHit> HadrontherapyCalorHitAllocator;
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
inline void* HadrontherapyCalorHit::operator new(size_t)
|
||||
{
|
||||
void* aHit;
|
||||
aHit = (void*) HadrontherapyCalorHitAllocator.MallocSingle();
|
||||
return aHit;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
inline void HadrontherapyCalorHit::operator delete(void* aHit)
|
||||
{
|
||||
HadrontherapyCalorHitAllocator.FreeSingle((HadrontherapyCalorHit*) aHit);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,105 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: HadrontherapyCalorimeterSD.cc,v 1.0
|
||||
// --------------------------------------------------------------
|
||||
// GEANT 4 - Hadrontherapy example
|
||||
// --------------------------------------------------------------
|
||||
// Code developed by:
|
||||
//
|
||||
// G.A.P. Cirrone, G. Russo
|
||||
// Laboratori Nazionali del Sud - INFN, Catania, Italy
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
#ifndef HadrontherapyCalorimeterSD_h
|
||||
#define HadrontherapyCalorimeterSD_h 1
|
||||
|
||||
#include "G4VSensitiveDetector.hh"
|
||||
#include "globals.hh"
|
||||
#include "G4ios.hh"
|
||||
#include "HadrontherapyHit.hh"
|
||||
class HadrontherapyDetectorConstruction;
|
||||
class G4HCofThisEvent;
|
||||
class G4Step;
|
||||
class HadrontherapyRunAction;
|
||||
class HadrontherapyHit;
|
||||
|
||||
// -------------------------------------------------------------
|
||||
class HadrontherapyCalorimeterSD : public G4VSensitiveDetector
|
||||
{
|
||||
public:
|
||||
|
||||
HadrontherapyCalorimeterSD(G4String, HadrontherapyDetectorConstruction*);
|
||||
~HadrontherapyCalorimeterSD();
|
||||
|
||||
void Initialize(G4HCofThisEvent*);
|
||||
G4bool ProcessHits(G4Step*,G4TouchableHistory*);
|
||||
void EndOfEvent(G4HCofThisEvent*);
|
||||
void clear();
|
||||
void PrintAll();
|
||||
|
||||
private:
|
||||
G4String filename;
|
||||
G4int sliceID[50000];
|
||||
G4double energy[50000];
|
||||
G4double depth;
|
||||
|
||||
HadrontherapyDetectorConstruction* Detector;
|
||||
|
||||
G4double backEnergy;
|
||||
G4double leakEnergy;
|
||||
G4double delta;
|
||||
G4double depthMax;
|
||||
G4double tkinold;
|
||||
G4bool part_is_out;
|
||||
G4int evno;
|
||||
G4int evnOld;
|
||||
G4int trIDold;
|
||||
G4int NbOfLayer;
|
||||
HadrontherapyRunAction* p_Run;
|
||||
HadrontherapyHitsCollection* CalCollection;
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+364
@@ -0,0 +1,364 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: HadrontherapyDetectorConstruction.hh
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// GEANT 4 - Hadrontherapy example
|
||||
// --------------------------------------------------------------
|
||||
// Code developed by:
|
||||
//
|
||||
// G.A.P. Cirrone, G. Russo
|
||||
// Laboratori Nazionali del Sud - INFN, Catania, Italy
|
||||
//
|
||||
//
|
||||
//
|
||||
#ifndef HadrontherapyDetectorConstruction_h
|
||||
#define HadrontherapyDetectorConstruction_h 1
|
||||
|
||||
#include "G4VUserDetectorConstruction.hh"
|
||||
#include "globals.hh"
|
||||
#include "G4UnitsTable.hh"
|
||||
#include "G4ios.hh"
|
||||
#include "G4Region.hh"
|
||||
#include "G4RegionStore.hh"
|
||||
|
||||
class G4Text;
|
||||
class G4Box;
|
||||
class G4Tubs;
|
||||
class G4LogicalVolume;
|
||||
class G4VPhysicalVolume;
|
||||
class G4Material;
|
||||
class HadrontherapyDetectorMessenger;
|
||||
class HadrontherapyCalorimeterSD;
|
||||
|
||||
class HadrontherapyDetectorConstruction : public G4VUserDetectorConstruction
|
||||
{
|
||||
|
||||
public:
|
||||
HadrontherapyDetectorConstruction();
|
||||
~HadrontherapyDetectorConstruction();
|
||||
|
||||
public:
|
||||
void SetModulatorAngle (G4double);
|
||||
void SetDosemeterMaterial (G4String);
|
||||
G4VPhysicalVolume* Construct();
|
||||
|
||||
public:
|
||||
G4double GetModulatorAngle() {return ModulatorAngle;};
|
||||
G4double ModulatorAngle;
|
||||
G4int NbOfLayer;
|
||||
G4double hightDosemeter;
|
||||
G4double DosemeterPosition_x;
|
||||
G4Material* GetDosemeterMaterial() {return DosemeterMaterial;};
|
||||
G4Material* GetWorldMaterial() {return WorldMaterial;};
|
||||
|
||||
const G4VPhysicalVolume* GetTreatmentRoom() {return physiTreatmentRoom;};
|
||||
const G4VPhysicalVolume* GetDosemeter() {return physiDosemeter;};
|
||||
|
||||
private:
|
||||
G4Material* DosemeterMaterial;
|
||||
G4Material* WorldMaterial;
|
||||
|
||||
// TREATMENT ROOM
|
||||
|
||||
G4Box* solidTreatmentRoom;
|
||||
G4LogicalVolume* logicTreatmentRoom;
|
||||
G4VPhysicalVolume* physiTreatmentRoom;
|
||||
|
||||
// BEAM LINE SUPPORT
|
||||
|
||||
G4Box* solidBeamLineSupport;
|
||||
G4LogicalVolume* logicBeamLineSupport;
|
||||
G4VPhysicalVolume* physiBeamLineSupport;
|
||||
|
||||
// BEAM LINE COVER 1 (left panel)
|
||||
|
||||
G4Box* solidBeamLineCover;
|
||||
G4LogicalVolume* logicBeamLineCover;
|
||||
G4VPhysicalVolume* physiBeamLineCover;
|
||||
|
||||
// BEAM LINE COVER 2 (rigth panel)
|
||||
|
||||
G4Box* solidBeamLineCover2;
|
||||
G4LogicalVolume* logicBeamLineCover2;
|
||||
G4VPhysicalVolume* physiBeamLineCover2;
|
||||
|
||||
|
||||
// VACUUM ZONE
|
||||
|
||||
G4Box* solidVacuumZone;
|
||||
G4LogicalVolume* logicVacuumZone;
|
||||
G4VPhysicalVolume* physiVacuumZone;
|
||||
|
||||
// FIRST SCATTERING FOIL
|
||||
|
||||
G4Box* solidFirstScatteringFoil;
|
||||
G4LogicalVolume* logicFirstScatteringFoil;
|
||||
G4VPhysicalVolume* physiFirstScatteringFoil;
|
||||
|
||||
// KAPTON WINDOW
|
||||
|
||||
G4Box* solidKaptonWindow;
|
||||
G4LogicalVolume* logicKaptonWindow;
|
||||
G4VPhysicalVolume* physiKaptonWindow;
|
||||
|
||||
// BEAM STOPPER
|
||||
|
||||
G4Tubs* solidStopper;
|
||||
G4LogicalVolume* logicStopper;
|
||||
G4VPhysicalVolume* physiStopper;
|
||||
|
||||
// SECOND SCATTERING FOIL
|
||||
|
||||
G4Box* solidSecondScatteringFoil;
|
||||
G4LogicalVolume* logicSecondScatteringFoil;
|
||||
G4VPhysicalVolume* physiSecondScatteringFoil;
|
||||
|
||||
// FIRST COLLIMATOR
|
||||
|
||||
G4Box* solidFirstCollimator;
|
||||
G4LogicalVolume* logicFirstCollimator;
|
||||
G4VPhysicalVolume* physiFirstCollimator;
|
||||
|
||||
G4Tubs* solidHoleFirstCollimator;
|
||||
G4LogicalVolume* logicHoleFirstCollimator;
|
||||
G4VPhysicalVolume* physiHoleFirstCollimator;
|
||||
|
||||
|
||||
//FIRST MODULATOR COLLIMATOR
|
||||
|
||||
G4Box* solidFirstCollimatorModulatorBox;
|
||||
G4LogicalVolume* logicFirstCollimatorModulatorBox;
|
||||
G4VPhysicalVolume* physiFirstCollimatorModulatorBox;
|
||||
|
||||
G4Tubs* solidHoleFirstCollimatorModulatorBox;
|
||||
G4LogicalVolume* logicHoleFirstCollimatorModulatorBox;
|
||||
G4VPhysicalVolume* physiHoleFirstCollimatorModulatorBox;
|
||||
|
||||
|
||||
|
||||
G4Box* solidMotherMod; // pointer to the solid
|
||||
G4LogicalVolume* logicMotherMod; // pointer to the logical Target
|
||||
G4VPhysicalVolume* physiMotherMod;
|
||||
|
||||
G4Material* MotherModMater;
|
||||
G4Material* Mod0Mater;
|
||||
G4Material* ModMater;
|
||||
|
||||
|
||||
G4Tubs* solidMod0; // pointer to the
|
||||
G4LogicalVolume* logicMod0; // pointer to the
|
||||
G4VPhysicalVolume* physiMod0;
|
||||
|
||||
|
||||
G4Tubs* solidMod1; // pointer to the
|
||||
G4LogicalVolume* logicMod1; // pointer to the
|
||||
G4VPhysicalVolume* physiMod1;
|
||||
|
||||
G4Tubs* solidMod2; // pointer to the
|
||||
G4LogicalVolume* logicMod2; // pointer to the
|
||||
G4VPhysicalVolume* physiMod2;
|
||||
|
||||
G4Tubs* solidMod3; // pointer to the
|
||||
G4LogicalVolume* logicMod3; // pointer to the
|
||||
G4VPhysicalVolume* physiMod3;
|
||||
|
||||
G4Tubs* solidMod4; // pointer to the
|
||||
G4LogicalVolume* logicMod4; // pointer to the
|
||||
G4VPhysicalVolume* physiMod4;
|
||||
|
||||
G4Tubs* solidMod5; // pointer to the
|
||||
G4LogicalVolume* logicMod5; // pointer to the
|
||||
G4VPhysicalVolume* physiMod5;
|
||||
|
||||
G4Tubs* solidMod6; // pointer to the
|
||||
G4LogicalVolume* logicMod6; // pointer to the
|
||||
G4VPhysicalVolume* physiMod6;
|
||||
|
||||
G4Tubs* solidMod7; // pointer to the
|
||||
G4LogicalVolume* logicMod7; // pointer to the
|
||||
G4VPhysicalVolume* physiMod7;
|
||||
|
||||
G4Tubs* solidMod8; // pointer to the
|
||||
G4LogicalVolume* logicMod8; // pointer to the
|
||||
G4VPhysicalVolume* physiMod8;
|
||||
|
||||
G4Tubs* solidMod9; // pointer to the
|
||||
G4LogicalVolume* logicMod9; // pointer to the
|
||||
G4VPhysicalVolume* physiMod9;
|
||||
|
||||
G4Tubs* solidMod10; // pointer to the
|
||||
G4LogicalVolume* logicMod10; // pointer to the
|
||||
G4VPhysicalVolume* physiMod10;
|
||||
|
||||
G4Tubs* solidMod11; // pointer to the
|
||||
G4LogicalVolume* logicMod11; // pointer to the
|
||||
G4VPhysicalVolume* physiMod11;
|
||||
|
||||
G4Tubs* solidMod12; // pointer to the
|
||||
G4LogicalVolume* logicMod12; // pointer to the
|
||||
G4VPhysicalVolume* physiMod12;
|
||||
|
||||
G4Tubs* solidMod13; // pointer to the
|
||||
G4LogicalVolume* logicMod13; // pointer to the
|
||||
G4VPhysicalVolume* physiMod13;
|
||||
|
||||
G4Tubs* solidMod14; // pointer to the
|
||||
G4LogicalVolume* logicMod14; // pointer to the
|
||||
G4VPhysicalVolume* physiMod14;
|
||||
|
||||
G4Tubs* solidMod15; // pointer to the
|
||||
G4LogicalVolume* logicMod15; // pointer to the
|
||||
G4VPhysicalVolume* physiMod15;
|
||||
|
||||
G4Tubs* solidMod16; // pointer to the
|
||||
G4LogicalVolume* logicMod16; // pointer to the
|
||||
G4VPhysicalVolume* physiMod16;
|
||||
|
||||
G4Tubs* solidMod17; // pointer to the
|
||||
G4LogicalVolume* logicMod17; // pointer to the
|
||||
G4VPhysicalVolume* physiMod17;
|
||||
|
||||
G4Tubs* solidMod18; // pointer to the
|
||||
G4LogicalVolume* logicMod18; // pointer to the
|
||||
G4VPhysicalVolume* physiMod18;
|
||||
|
||||
G4Tubs* solidMod20; // pointer to the
|
||||
G4LogicalVolume* logicMod20; // pointer to the
|
||||
G4VPhysicalVolume* physiMod20;
|
||||
|
||||
//SECOND MODULATOR COLLIMATOR
|
||||
|
||||
G4Box* solidSecondCollimatorModulatorBox;
|
||||
G4LogicalVolume* logicSecondCollimatorModulatorBox;
|
||||
G4VPhysicalVolume* physiSecondCollimatorModulatorBox;
|
||||
|
||||
G4Tubs* solidHoleSecondCollimatorModulatorBox;
|
||||
G4LogicalVolume* logicHoleSecondCollimatorModulatorBox;
|
||||
G4VPhysicalVolume* physiHoleSecondCollimatorModulatorBox;
|
||||
|
||||
//SECOND COLLIMATOR
|
||||
|
||||
G4Box* solidSecondCollimator;
|
||||
G4LogicalVolume* logicSecondCollimator;
|
||||
G4VPhysicalVolume* physiSecondCollimator;
|
||||
|
||||
G4Tubs* solidHoleSecondCollimator;
|
||||
G4LogicalVolume* logicHoleSecondCollimator;
|
||||
G4VPhysicalVolume* physiHoleSecondCollimator;
|
||||
|
||||
// FIRST MONITOR CHAMBER
|
||||
|
||||
G4Box* solidFirstMonitorLayer1;
|
||||
G4LogicalVolume* logicFirstMonitorLayer1;
|
||||
G4VPhysicalVolume* physiFirstMonitorLayer1;
|
||||
|
||||
G4Box* solidFirstMonitorLayer2;
|
||||
G4LogicalVolume* logicFirstMonitorLayer2;
|
||||
G4VPhysicalVolume* physiFirstMonitorLayer2;
|
||||
|
||||
G4Box* solidFirstMonitorLayer3;
|
||||
G4LogicalVolume* logicFirstMonitorLayer3;
|
||||
G4VPhysicalVolume* physiFirstMonitorLayer3;
|
||||
|
||||
G4Box* solidFirstMonitorLayer4;
|
||||
G4LogicalVolume* logicFirstMonitorLayer4;
|
||||
G4VPhysicalVolume* physiFirstMonitorLayer4;
|
||||
|
||||
//SECODN MONITOR CHAMBER
|
||||
|
||||
G4Box* solidSecondMonitorLayer1;
|
||||
G4LogicalVolume* logicSecondMonitorLayer1;
|
||||
G4VPhysicalVolume* physiSecondMonitorLayer1;
|
||||
|
||||
G4Box* solidSecondMonitorLayer2;
|
||||
G4LogicalVolume* logicSecondMonitorLayer2;
|
||||
G4VPhysicalVolume* physiSecondMonitorLayer2;
|
||||
|
||||
G4Box* solidSecondMonitorLayer3;
|
||||
G4LogicalVolume* logicSecondMonitorLayer3;
|
||||
G4VPhysicalVolume* physiSecondMonitorLayer3;
|
||||
|
||||
G4Box* solidSecondMonitorLayer4;
|
||||
G4LogicalVolume* logicSecondMonitorLayer4;
|
||||
G4VPhysicalVolume* physiSecondMonitorLayer4;
|
||||
|
||||
// THIRD MONITOR CHAMBER
|
||||
|
||||
G4Box* solidThirdMonitorLayer1;
|
||||
G4LogicalVolume* logicThirdMonitorLayer1;
|
||||
G4VPhysicalVolume* physiThirdMonitorLayer1;
|
||||
|
||||
G4Box* solidThirdMonitorLayer2;
|
||||
G4LogicalVolume* logicThirdMonitorLayer2;
|
||||
G4VPhysicalVolume* physiThirdMonitorLayer2;
|
||||
|
||||
|
||||
G4Box* solidThirdMonitorLayer3;
|
||||
G4LogicalVolume* logicThirdMonitorLayer3;
|
||||
G4VPhysicalVolume* physiThirdMonitorLayer3;
|
||||
|
||||
G4Box* solidThirdMonitorLayer4;
|
||||
G4LogicalVolume* logicThirdMonitorLayer4;
|
||||
G4VPhysicalVolume* physiThirdMonitorLayer4;
|
||||
|
||||
//NOZZLE
|
||||
|
||||
G4Box* solidNozzleSupport;
|
||||
G4LogicalVolume* logicNozzleSupport;
|
||||
G4VPhysicalVolume* physiNozzleSupport;
|
||||
|
||||
G4Tubs* solidHoleNozzleSupport;
|
||||
G4LogicalVolume* logicHoleNozzleSupport;
|
||||
G4VPhysicalVolume* physiHoleNozzleSupport;
|
||||
|
||||
G4Tubs* solidSecondHoleNozzleSupport;
|
||||
G4LogicalVolume* logicSecondHoleNozzleSupport;
|
||||
G4VPhysicalVolume* physiSecondHoleNozzleSupport;
|
||||
|
||||
//FINAL COLLIMATOR
|
||||
|
||||
G4Tubs* solidFinalCollimator;
|
||||
G4LogicalVolume* logicFinalCollimator;
|
||||
G4VPhysicalVolume* physiFinalCollimator;
|
||||
|
||||
// WATER PHANTOM
|
||||
|
||||
G4Box* solidWaterPhantom;
|
||||
G4LogicalVolume* logicWaterPhantom;
|
||||
G4VPhysicalVolume* physiWaterPhantom;
|
||||
|
||||
//DOSEMETER (sensitive detector)
|
||||
|
||||
G4Tubs* solidDosemeter;
|
||||
G4LogicalVolume* logicDosemeter;
|
||||
G4VPhysicalVolume* physiDosemeter;
|
||||
HadrontherapyDetectorMessenger* detectorMessenger;
|
||||
|
||||
HadrontherapyCalorimeterSD* calorimeterSD; //pointer to the sensitive detector
|
||||
|
||||
private:
|
||||
G4VPhysicalVolume* ConstructCalorimeter();
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: HadrontherapyDetectorMessenger.hh,v 1.0
|
||||
// --------------------------------------------------------------
|
||||
// GEANT 4 - Hadrontherapy example
|
||||
// --------------------------------------------------------------
|
||||
// Code developed by:
|
||||
//
|
||||
// G.A.P. Cirrone, G. Russo
|
||||
// Laboratori Nazionali del Sud - INFN, Catania, Italy
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
|
||||
#ifndef HadrontherapyDetectorMessenger_h
|
||||
#define HadrontherapyDetectorMessenger_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4UImessenger.hh"
|
||||
|
||||
class HadrontherapyDetectorConstruction;
|
||||
class G4UIdirectory;
|
||||
class G4UIcmdWithAString;
|
||||
class G4UIcmdWithAnInteger;
|
||||
class G4UIcmdWithADoubleAndUnit;
|
||||
class G4UIcmdWithoutParameter;
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
class HadrontherapyDetectorMessenger: public G4UImessenger
|
||||
{
|
||||
public:
|
||||
HadrontherapyDetectorMessenger(HadrontherapyDetectorConstruction* );
|
||||
~HadrontherapyDetectorMessenger();
|
||||
|
||||
void SetNewValue(G4UIcommand*, G4String);
|
||||
|
||||
private:
|
||||
HadrontherapyDetectorConstruction* HadrontherapyDetector;
|
||||
|
||||
G4UIdirectory* HadronDir;
|
||||
G4UIdirectory* detDir;
|
||||
G4UIcmdWithADoubleAndUnit* ModulatorAngleCmd;
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: HadrontherapyEventAction.hh,v 1.0
|
||||
// --------------------------------------------------------------
|
||||
// GEANT 4 - Hadrontherapy example
|
||||
// --------------------------------------------------------------
|
||||
// Code developed by:
|
||||
//
|
||||
// G.A.P. Cirrone, G. Russo
|
||||
// Laboratori Nazionali del Sud - INFN, Catania, Italy
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
|
||||
#ifndef HadrontherapyEventAction_h
|
||||
#define HadrontherapyEventAction_h 1
|
||||
#include "G4UserEventAction.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class HadrontherapyRunAction;
|
||||
class HadrontherapyEventActionMessenger;
|
||||
class HadrontherapyHit;
|
||||
// ---------------------------------------------------------------
|
||||
class HadrontherapyEventAction : public G4UserEventAction
|
||||
{
|
||||
public:
|
||||
HadrontherapyEventAction(HadrontherapyRunAction* runAction );
|
||||
~HadrontherapyEventAction();
|
||||
|
||||
public:
|
||||
void BeginOfEventAction(const G4Event*);
|
||||
void EndOfEventAction(const G4Event*);
|
||||
void setEventVerbose(G4int level);
|
||||
void CountStepsCharged() ;
|
||||
void CountStepsNeutral() ;
|
||||
void AddCharged() ;
|
||||
void AddNeutral() ;
|
||||
void AddE();
|
||||
void AddP();
|
||||
void SetTr();
|
||||
void SetRef();
|
||||
|
||||
G4int GetEventno();
|
||||
G4int Trasporto();
|
||||
|
||||
private:
|
||||
G4int event_id;
|
||||
G4int calorimeterCollID;
|
||||
HadrontherapyEventActionMessenger* eventMessenger;
|
||||
HadrontherapyRunAction* p_Run;
|
||||
G4int verboselevel;
|
||||
G4double nstep;
|
||||
G4double energyDep[50000];
|
||||
};
|
||||
#endif
|
||||
@@ -0,0 +1,92 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: HadrontherapyHit.hh,v 1.0
|
||||
// --------------------------------------------------------------
|
||||
// GEANT 4 - Hadrontherapy example
|
||||
// --------------------------------------------------------------
|
||||
// Code developed by:
|
||||
//
|
||||
// G.A.P. Cirrone, G. Russo
|
||||
// Laboratori Nazionali del Sud - INFN, Catania, Italy
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
|
||||
#ifndef HadrontherapyHit_h
|
||||
#define HadrontherapyHit_h 1
|
||||
#include "G4VHit.hh"
|
||||
#include "G4THitsCollection.hh"
|
||||
#include "G4Allocator.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4Transform3D.hh"
|
||||
#include "G4RotationMatrix.hh"
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
class HadrontherapyHit : public G4VHit
|
||||
{
|
||||
public:
|
||||
HadrontherapyHit(G4int);
|
||||
~HadrontherapyHit();
|
||||
HadrontherapyHit(const HadrontherapyHit &right);
|
||||
const HadrontherapyHit& operator=(const HadrontherapyHit &right);
|
||||
int operator==(const HadrontherapyHit &right) const;
|
||||
|
||||
inline void *operator new(size_t);
|
||||
inline void operator delete(void *aHit);
|
||||
|
||||
void Draw();
|
||||
void Print();
|
||||
|
||||
private:
|
||||
|
||||
G4int slice;
|
||||
G4double m_Edep;
|
||||
|
||||
public:
|
||||
inline G4int GetSliceID() {return slice;}
|
||||
inline void SetSliceID(G4int sliceID)
|
||||
{slice= sliceID;}
|
||||
inline void SetEdep(G4double edep)
|
||||
{m_Edep = edep;}
|
||||
inline void AddEdep(G4double edep)
|
||||
{m_Edep += edep;}
|
||||
inline G4double GetEdep()
|
||||
{return m_Edep;}
|
||||
};
|
||||
|
||||
typedef G4THitsCollection<HadrontherapyHit> HadrontherapyHitsCollection;
|
||||
extern G4Allocator<HadrontherapyHit> HadrontherapyHitAllocator;
|
||||
inline void* HadrontherapyHit::operator new(size_t)
|
||||
{
|
||||
void *aHit;
|
||||
aHit = (void *) HadrontherapyHitAllocator.MallocSingle();
|
||||
return aHit;
|
||||
}
|
||||
|
||||
inline void HadrontherapyHit::operator delete(void *aHit)
|
||||
{
|
||||
HadrontherapyHitAllocator.FreeSingle((HadrontherapyHit*) aHit);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: HadrontherapyPhysicsList.hh,v 1.0
|
||||
// --------------------------------------------------------------
|
||||
// GEANT 4 - Hadrontherapy example
|
||||
// --------------------------------------------------------------
|
||||
// Code developed by:
|
||||
//
|
||||
// G.A.P. Cirrone, G. Russo
|
||||
// Laboratori Nazionali del Sud - INFN, Catania, Italy
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
#ifndef HadrontherapyPhysicsList_h
|
||||
#define HadrontherapyPhysicsList_h 1
|
||||
|
||||
#include "G4VUserPhysicsList.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class HadrontherapyDetectorConstruction;
|
||||
class HadrontherapyPhysicsListMessenger;
|
||||
|
||||
// ----------------------------------------------------------------
|
||||
class HadrontherapyPhysicsList: public G4VUserPhysicsList
|
||||
{
|
||||
public:
|
||||
HadrontherapyPhysicsList( HadrontherapyDetectorConstruction*);
|
||||
~HadrontherapyPhysicsList();
|
||||
|
||||
protected:
|
||||
// Construct particle and physics
|
||||
void ConstructParticle();
|
||||
void ConstructProcess();
|
||||
void SetCuts();
|
||||
|
||||
protected:
|
||||
// these methods Construct particles
|
||||
void ConstructBosons();
|
||||
void ConstructLeptons();
|
||||
void ConstructMesons();
|
||||
void ConstructBarions();
|
||||
void ConstructIons();
|
||||
|
||||
protected:
|
||||
// these methods Construct physics processes and register them
|
||||
void ConstructGeneral();
|
||||
void ConstructEM();
|
||||
void ConstructHad();
|
||||
void ConstructOp();
|
||||
|
||||
public:
|
||||
void SetGammaCut(G4double);
|
||||
void SetElectronCut(G4double);
|
||||
void SetProtonCut(G4double);
|
||||
void GetRange(G4double);
|
||||
void SetMaxStep(G4double);
|
||||
|
||||
private:
|
||||
G4double cutForGamma;
|
||||
G4double cutForElectron;
|
||||
G4double cutForProton;
|
||||
G4double currentDefaultCut;
|
||||
G4double defaultCutValue;
|
||||
HadrontherapyDetectorConstruction* pDet;
|
||||
HadrontherapyPhysicsListMessenger* physicsListMessenger;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
+74
@@ -0,0 +1,74 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: HadrontherapyPrimaryGeneratorAction.hh,v 1.0
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// GEANT 4 - Hadrontherapy example
|
||||
// --------------------------------------------------------------
|
||||
// Code developed by:
|
||||
//
|
||||
// G.A.P. Cirrone, G. Russo
|
||||
// Laboratori Nazionali del Sud - INFN, Catania, Italy
|
||||
//
|
||||
// -----------------------------------------------------------------
|
||||
|
||||
#ifndef HadrontherapyPrimaryGeneratorAction_h
|
||||
#define HadrontherapyPrimaryGeneratorAction_h 1
|
||||
|
||||
#include "G4VUserPrimaryGeneratorAction.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class G4ParticleGun;
|
||||
class G4Event;
|
||||
class HadrontherapyDetectorConstruction;
|
||||
class HadrontherapyPrimaryGeneratorMessenger;
|
||||
class HadrontherapyPrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
{
|
||||
public:
|
||||
HadrontherapyPrimaryGeneratorAction(HadrontherapyDetectorConstruction*);
|
||||
~HadrontherapyPrimaryGeneratorAction();
|
||||
|
||||
public:
|
||||
void SetDefaultKinematic();
|
||||
void GeneratePrimaries(G4Event*);
|
||||
|
||||
private:
|
||||
G4ParticleGun* particleGun;
|
||||
HadrontherapyDetectorConstruction* HadrontherapyDetector;
|
||||
|
||||
G4double X0;
|
||||
G4double Y0;
|
||||
G4double Z0;
|
||||
|
||||
G4double sigmaX;
|
||||
G4double sigmaY;
|
||||
G4double sigmaZ;
|
||||
|
||||
HadrontherapyPrimaryGeneratorMessenger* gunMessenger;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: HadrontherapyRunAction.hh,v 1.0
|
||||
// --------------------------------------------------------------
|
||||
// GEANT 4 - Hadrontherapy example
|
||||
// --------------------------------------------------------------
|
||||
// Code developed by:
|
||||
//
|
||||
// G.A.P. Cirrone, G. Russo
|
||||
// Laboratori Nazionali del Sud - INFN, Catania, Italy
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
|
||||
#ifndef HadrontherapyRunAction_h
|
||||
#define HadrontherapyRunAction_h 1
|
||||
|
||||
#include "G4UserRunAction.hh"
|
||||
#include "globals.hh"
|
||||
#include <iostream.h>
|
||||
|
||||
class G4Run;
|
||||
|
||||
// -------------------------------------------------------------
|
||||
class HadrontherapyRunAction : public G4UserRunAction
|
||||
{
|
||||
public:
|
||||
HadrontherapyRunAction();
|
||||
~HadrontherapyRunAction();
|
||||
|
||||
G4double energy[50000];
|
||||
|
||||
public:
|
||||
void BeginOfRunAction(const G4Run*);
|
||||
void EndOfRunAction(const G4Run*);
|
||||
G4int GetProva();
|
||||
|
||||
void EnergyTotSlice(G4int, G4double);
|
||||
void EnergyTotMarkus();
|
||||
|
||||
private:
|
||||
G4int NbOfLayer;
|
||||
G4int slice;
|
||||
G4double energy_dep;
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: HadrontherapySteppingAction.cc,v 1.0
|
||||
// --------------------------------------------------------------
|
||||
// GEANT 4 - Hadrontherapy example
|
||||
// --------------------------------------------------------------
|
||||
// Code developed by:
|
||||
//
|
||||
// G.A.P. Cirrone, G. Russo
|
||||
// Laboratori Nazionali del Sud - INFN, Catania, Italy
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
#ifndef HadrontherapySteppingAction_h
|
||||
#define HadrontherapySteppingAction_h 1
|
||||
|
||||
#include "G4UserSteppingAction.hh"
|
||||
#include "G4Event.hh"
|
||||
#include "G4EventManager.hh"
|
||||
#include "G4ios.hh"
|
||||
#include "globals.hh"
|
||||
#include <iostream.h>
|
||||
|
||||
class HadrontherapyDetectorConstruction;
|
||||
class HadrontherapyRunAction;
|
||||
class HadrontherapyEventAction;
|
||||
class HadrontherapySteppingMessenger;
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
#ifndef G4NOHIST
|
||||
class HepTupleManager;
|
||||
class HepHistogram;
|
||||
#endif
|
||||
|
||||
class HadrontherapySteppingAction : public G4UserSteppingAction
|
||||
{
|
||||
public:
|
||||
HadrontherapySteppingAction( HadrontherapyEventAction* );
|
||||
~HadrontherapySteppingAction();
|
||||
|
||||
void UserSteppingAction(const G4Step*);
|
||||
|
||||
G4int event_id;
|
||||
G4int Controllo;
|
||||
|
||||
private:
|
||||
HadrontherapyDetectorConstruction* detector;
|
||||
HadrontherapyEventAction* eventaction;
|
||||
HadrontherapyRunAction* runaction;
|
||||
HadrontherapySteppingMessenger* steppingMessenger;
|
||||
};
|
||||
#endif
|
||||
@@ -0,0 +1,48 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: HadrontherapyVisManager.hh,v 1.0
|
||||
// --------------------------------------------------------------
|
||||
// GEANT 4 - Hadrontherapy example
|
||||
// --------------------------------------------------------------
|
||||
// Code developed by:
|
||||
//
|
||||
// G.A.P. Cirrone, G. Russo
|
||||
// Laboratori Nazionali del Sud - INFN, Catania, Italy
|
||||
//
|
||||
// -------------------------------------------------------------
|
||||
|
||||
#ifndef HadrontherapyVisManager_h
|
||||
#define HadrontherapyVisManager_h 1
|
||||
|
||||
#include "G4VisManager.hh"
|
||||
|
||||
// ------------------------------------------------------------
|
||||
class HadrontherapyVisManager: public G4VisManager {
|
||||
|
||||
public:
|
||||
HadrontherapyVisManager ();
|
||||
|
||||
private:
|
||||
void RegisterGraphicsSystems ();
|
||||
};
|
||||
#endif
|
||||
Reference in New Issue
Block a user