Ignore:
Timestamp:
Jan 8, 2010, 3:02:48 PM (14 years ago)
Author:
garnier
Message:

update to geant4.9.3

Location:
trunk/examples/advanced/hadrontherapy/include
Files:
23 added
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/examples/advanced/hadrontherapy/include/Decay.hh

    r807 r1230  
    2424// ********************************************************************
    2525//
    26 // $Id: HadrontherapyDetectorMessenger.hh; May 2005
    27 // ----------------------------------------------------------------------------
    28 //                 GEANT 4 - Hadrontherapy example
    29 // ----------------------------------------------------------------------------
    30 // Code developed by:
    31 //
    32 // G.A.P. Cirrone(a)*, F. Di Rosa(a), S. Guatelli(b), G. Russo(a)
    33 //
    34 // (a) Laboratori Nazionali del Sud
    35 //     of the INFN, Catania, Italy
    36 // (b) INFN Section of Genova, Genova, Italy
    37 //
    38 // * cirrone@lns.infn.it
    39 // ----------------------------------------------------------------------------
     26// $Id: HadrontherapyDetectorMessenger.hh;
     27// See more at: http://g4advancedexamples.lngs.infn.it/Examples/hadrontherapy
    4028
    4129// ==============================
  • trunk/examples/advanced/hadrontherapy/include/HadrontherapyAnalysisManager.hh

    r807 r1230  
    2424// ********************************************************************
    2525//
    26 // ----------------------------------------------------------------------------
    27 // $Id: HadrontherapyAnalysisManager.hh; May 2005
    28 // ----------------------------------------------------------------------------
    29 //                 GEANT 4 - Hadrontherapy example
    30 // ----------------------------------------------------------------------------
    31 // Code developed by:
    32 //
    33 // G.A.P. Cirrone(a)*, F. Di Rosa(a), S. Guatelli(b), G. Russo(a)
    34 //
    35 // (a) Laboratori Nazionali del Sud
    36 //     of the INFN, Catania, Italy
    37 // (b) INFN Section of Genova, Genova, Italy
    38 //
    39 // * cirrone@lns.infn.it
    40 // ----------------------------------------------------------------------------
    41 
    42 #ifdef G4ANALYSIS_USE
     26// HadrontherapyAnalysisManager.hh; May 2005
     27// See more at: http://g4advancedexamples.lngs.infn.it/Examples/hadrontherapy
     28
    4329#ifndef HADRONTHERAPYANALYSISMANAGER_HH
    4430#define HADRONTHERAPYANALYSISMANAGER_HH 1
    4531
    4632#include "globals.hh"
    47 # include <AIDA/AIDA.h>
     33
     34#ifdef ANALYSIS_USE ///< If we use analysis
     35
     36#ifdef G4ANALYSIS_USE ///< If analysis is done via AIDA
     37#include <AIDA/AIDA.h>
    4838
    4939namespace AIDA{
    50   class ITree; 
     40  class ITree;
    5141  class IAnalysisFactory;
    5242  class ITreeFactory;
    5343}
    54 
     44#endif
     45
     46#ifdef G4ANALYSIS_USE_ROOT ///< If analysis is done directly with ROOT
     47#include "TROOT.h"
     48#include "TFile.h"
     49#include "TNtuple.h"
     50#include "TH1F.h"
     51#endif
     52
     53/**
     54 * Messenger class for analysis-settings for HadronTherapyAnalysisManager
     55 */
     56class HadrontherapyAnalysisFileMessenger;
     57
     58/**
     59 * A class for connecting the simulation to an analysis package.
     60 */
    5561class HadrontherapyAnalysisManager
    5662{
    5763private:
     64        /**
     65         * Analysis manager is a singleton object (there is only one instance).
     66         * The pointer to this object is available through the use of the method getInstance();
     67         *
     68         * @see getInstance
     69         */
    5870  HadrontherapyAnalysisManager();
    59 
     71 
    6072public:
    6173  ~HadrontherapyAnalysisManager();
     74
     75  /**
     76   * Get the pointer to the analysis manager.
     77   */
     78  static HadrontherapyAnalysisManager* getInstance();
     79
     80  /**
     81  * Book the histograms and ntuples in an AIDA or ROOT file.
     82  */
     83  void book();
     84  /**
     85   * Set name for the analysis file .root (used by macro)
     86   */
     87  void SetAnalysisFileName(G4String);
    6288 
    63   static HadrontherapyAnalysisManager* getInstance();
    64  
    65   void book();
    66   // Book the histograms and ntuples in a .hbk file
    67  
    68   void FillEnergyDeposit(G4int voxelXId, G4int voxelYId, G4int voxelZId,
     89  /**
     90  * Fill the ntuple with the energy deposit in the phantom
     91  */
     92  void FillEnergyDeposit(G4int voxelXId, G4int voxelYId, G4int voxelZId,
    6993                         G4double energyDeposit);
    70   // Fill the ntuple with the energy deposit in the phantom
    71 
    72   void BraggPeak(G4int, G4double);
    73   // Fill 1D histogram with the Bragg peak in the phantom
     94
     95  void BraggPeak(G4int, G4double); ///< Fill 1D histogram with the Bragg peak in the phantom
    7496
    7597  void SecondaryProtonEnergyDeposit(G4int slice, G4double energy);
    76   // Fill 1D histogram with the energy deposit of secondary protons
     98  ///< Fill 1D histogram with the energy deposit of secondary protons
    7799
    78100   void SecondaryNeutronEnergyDeposit(G4int slice, G4double energy);
    79   // Fill 1D histogram with the energy deposit of secondary neutrons
     101  ///< Fill 1D histogram with the energy deposit of secondary neutrons
    80102
    81103  void SecondaryAlphaEnergyDeposit(G4int slice, G4double energy);
    82   // Fill 1D histogram with the energy deposit of secondary alpha particles
     104  ///< Fill 1D histogram with the energy deposit of secondary alpha particles
    83105
    84106  void SecondaryGammaEnergyDeposit(G4int slice, G4double energy);
    85   // Fill 1D histogram with the energy deposit of secondary gamma
     107  ///< Fill 1D histogram with the energy deposit of secondary gamma
    86108
    87109  void SecondaryElectronEnergyDeposit(G4int slice, G4double energy);
    88   // Fill 1D histogram with the energy deposit of secondary electrons
     110  ///< Fill 1D histogram with the energy deposit of secondary electrons
    89111
    90112  void SecondaryTritonEnergyDeposit(G4int slice, G4double energy);
    91   // Fill 1D histogram with the energy deposit of secondary tritons
     113  ///< Fill 1D histogram with the energy deposit of secondary tritons
    92114
    93115  void SecondaryDeuteronEnergyDeposit(G4int slice, G4double energy);
    94   // Fill 1D histogram with the energy deposit of secondary deuterons
     116  ///< Fill 1D histogram with the energy deposit of secondary deuterons
    95117
    96118  void SecondaryPionEnergyDeposit(G4int slice, G4double energy);
    97   // Fill 1D histogram with the energy deposit of secondary pions
     119  ///< Fill 1D histogram with the energy deposit of secondary pions
    98120
    99121  void electronEnergyDistribution(G4double secondaryParticleKineticEnergy);
    100   // Energy distribution of secondary electrons originated in the phantom
     122  ///< Energy distribution of secondary electrons originated in the phantom
    101123
    102124  void gammaEnergyDistribution(G4double secondaryParticleKineticEnergy);
    103   // Energy distribution of secondary gamma originated in the phantom
     125  ///< Energy distribution of secondary gamma originated in the phantom
    104126
    105127  void deuteronEnergyDistribution(G4double secondaryParticleKineticEnergy);
    106   // Energy distribution of secondary deuterons originated in the phantom
     128  ///< Energy distribution of secondary deuterons originated in the phantom
    107129
    108130  void tritonEnergyDistribution(G4double secondaryParticleKineticEnergy);
    109   // Energy distribution of secondary tritons originated in the phantom
     131  ///< Energy distribution of secondary tritons originated in the phantom
    110132
    111133  void alphaEnergyDistribution(G4double secondaryParticleKineticEnergy);
    112   // Energy distribution of secondary alpha originated in the phantom
     134  ///< Energy distribution of secondary alpha originated in the phantom
     135
     136  void heliumEnergy(G4double secondaryParticleKineticEnergy);
     137  ///< Energy distribution of the helium (He3 and alpha) particles after the phantom
     138
     139  void hydrogenEnergy(G4double secondaryParticleKineticEnergy);
     140  ///< Energy distribution of the hydrogen (proton, d, t) particles after the phantom
     141
     142  void fillFragmentTuple(G4int A, G4double Z, G4double energy, G4double posX, G4double posY, G4double posZ);
     143  ///< Energy ntuple
    113144
    114145  void genericIonInformation(G4int, G4double, G4int, G4double);
    115  
     146
     147  void ThintargetBeamDisp(G4double,G4double);
     148
     149  void startNewEvent();
     150  ///< Tell the analysis manager that a new event is starting
     151
     152  void setGeometryMetaData(G4double, G4double, G4double);
     153  ///< from the detector construction information about the geometry can be written as metadata
     154
     155  void setBeamMetaData(G4double, G4double);
     156  ///< metadata about the beam can be written this way
     157
    116158  void finish();
    117   // Close the .hbk file with the histograms and the ntuples
     159  ///< Close the .hbk file with the histograms and the ntuples
     160
     161void flush();
     162
     163#ifdef G4ANALYSIS_USE_ROOT
     164private:
     165  TH1F *createHistogram1D(const TString name, const TString title, int bins, double xmin, double xmax) {
     166    TH1F *histo = new TH1F(name, title, bins, xmin, xmax);
     167    histo->SetLineWidth(2);
     168    return histo;
     169  }
     170#endif
    118171
    119172private:
    120173  static HadrontherapyAnalysisManager* instance;
     174  HadrontherapyAnalysisFileMessenger* fMess;
     175  G4String analysisFileName;
     176#ifdef G4ANALYSIS_USE
    121177  AIDA::IAnalysisFactory* aFact;
    122   AIDA::ITree* theTree; 
     178  AIDA::ITree* theTree;
    123179  AIDA::IHistogramFactory *histFact;
    124180  AIDA::ITupleFactory *tupFact;
     
    129185  AIDA::IHistogram1D *h5;
    130186  AIDA::IHistogram1D *h6;
    131   AIDA::IHistogram1D *h7; 
    132   AIDA::IHistogram1D *h8; 
     187  AIDA::IHistogram1D *h7;
     188  AIDA::IHistogram1D *h8;
    133189  AIDA::IHistogram1D *h9;
    134190  AIDA::IHistogram1D *h10;
    135191  AIDA::IHistogram1D *h11;
    136   AIDA::IHistogram1D *h12; 
    137   AIDA::IHistogram1D *h13; 
     192  AIDA::IHistogram1D *h12;
     193  AIDA::IHistogram1D *h13;
    138194  AIDA::IHistogram1D *h14;
     195  AIDA::IHistogram1D *h15;
     196  AIDA::IHistogram1D *h16;
    139197  AIDA::ITuple *ntuple;
    140198  AIDA::ITuple *ionTuple;
     199  AIDA::ITuple *fragmentTuple;
     200#endif
     201#ifdef G4ANALYSIS_USE_ROOT
     202  TFile *theTFile;
     203  TH1F *histo1;
     204  TH1F *histo2;
     205  TH1F *histo3;
     206  TH1F *histo4;
     207  TH1F *histo5;
     208  TH1F *histo6;
     209  TH1F *histo7;
     210  TH1F *histo8;
     211  TH1F *histo9;
     212  TH1F *histo10;
     213  TH1F *histo11;
     214  TH1F *histo12;
     215  TH1F *histo13;
     216  TH1F *histo14;
     217  TH1F *histo15;
     218  TH1F *histo16;
     219 
     220  TNtuple *theROOTNtuple;
     221  TNtuple *theROOTIonTuple;
     222  TNtuple *fragmentNtuple; // fragments
     223  TNtuple *metaData;
     224#endif
     225  G4long eventCounter;      // Simulation metadata
     226  G4double detectorDistance;
     227  G4double phantomDepth;
     228  G4double beamEnergy;
     229  G4double energyError;
     230  G4double phantomCenterDistance;
    141231};
    142232#endif
    143 #endif
    144 
     233
     234#endif
     235
  • trunk/examples/advanced/hadrontherapy/include/HadrontherapyDetectorConstruction.hh

    r807 r1230  
    2424// ********************************************************************
    2525//
    26 // $Id: HadrontherapyDetectorConstruction.hh; Version 4.0 May 2005
    27 // ----------------------------------------------------------------------------
    28 //                 GEANT 4 - Hadrontherapy example
    29 // ----------------------------------------------------------------------------
    30 // Code developed by:
    31 //
    32 // G.A.P. Cirrone(a)*, F. Di Rosa(a), S. Guatelli(b), G. Russo(a)
    33 //
    34 // (a) Laboratori Nazionali del Sud
    35 //     of the INFN, Catania, Italy
    36 // (b) INFN Section of Genova, Genova, Italy
    37 //
    38 // * cirrone@lns.infn.it
    39 // ----------------------------------------------------------------------------
     26// HadrontherapyDetectorConstruction.hh;
     27// See more at: http://g4advancedexamples.lngs.infn.it/Examples/hadrontherapy//
    4028
    4129#ifndef HadrontherapyDetectorConstruction_H
    4230#define HadrontherapyDetectorConstruction_H 1
    4331
     32#include "G4Box.hh"
    4433#include "globals.hh"
    45 #include "G4VUserDetectorConstruction.hh"
     34#include "G4VisAttributes.hh"
     35#include "G4LogicalVolume.hh"
     36#include "G4UnitsTable.hh"
    4637
    4738class G4VPhysicalVolume;
    4839class G4LogicalVolume;
    49 class HadrontherapyPhantomROGeometry;
    50 class HadrontherapyBeamLine;
     40class HadrontherapyDetectorROGeometry;
    5141class HadrontherapyDetectorMessenger;
    52 class HadrontherapyModulator;
    53 class HadrontherapyPhantomSD;
    54 class HadrontherapyMaterial;
     42class HadrontherapyDetectorSD;
     43class HadrontherapyMatrix;
    5544
    56 class HadrontherapyDetectorConstruction : public G4VUserDetectorConstruction
     45class HadrontherapyDetectorConstruction
    5746{
    5847public:
    5948
    60   HadrontherapyDetectorConstruction();
     49  HadrontherapyDetectorConstruction(G4VPhysicalVolume*);
    6150
    6251  ~HadrontherapyDetectorConstruction();
    6352
    64   G4VPhysicalVolume* Construct(); 
    6553
    6654private:
    6755
    68   void ConstructBeamLine();
    69   // This method allows to define the beam line geometry in the
    70   // experimental set-up
     56  void ConstructPhantom();
     57  void ConstructDetector();
     58  void ConstructSensitiveDetector(G4ThreeVector position_respect_to_WORLD);
     59 
     60public:
     61// Get detector position relative to WORLD
     62inline G4ThreeVector GetDetectorToWorldPosition()
     63  {
     64    return phantomPosition + detectorPosition;
     65  }
     66/////////////////////////////////////////////////////////////////////////////
     67// Get displacement between phantom and detector by detector position, phantom and detector sizes
     68inline G4ThreeVector GetDetectorToPhantomPosition()
     69{
     70    return G4ThreeVector(phantomSizeX - detectorSizeX + detectorPosition.getX(),
     71                         phantomSizeY - detectorSizeY + detectorPosition.getY(),
     72                         phantomSizeZ - detectorSizeZ + detectorPosition.getZ()
     73                          );
     74}
    7175
    72  void ConstructPhantom();
    73  // This method allows to define the phantom geometry in the
    74  // experimental set-up
    75  
    76  void ConstructSensitiveDetector();
    77   // The sensitive detector is associated to the phantom volume
     76/////////////////////////////////////////////////////////////////////////////
     77// Calculate (and set) detector position by displacement, phantom and detector sizes
     78inline void SetDetectorPosition()
     79  {
     80          // Adjust detector position
     81          detectorPosition.setX(detectorToPhantomPosition.getX() - phantomSizeX + detectorSizeX);
     82          detectorPosition.setY(detectorToPhantomPosition.getY() - phantomSizeY + detectorSizeY);
     83          detectorPosition.setZ(detectorToPhantomPosition.getZ() - phantomSizeZ + detectorSizeZ);
     84     
     85      if (detectorPhysicalVolume) detectorPhysicalVolume -> SetTranslation(detectorPosition);
     86  }
     87/////////////////////////////////////////////////////////////////////////////
     88// Check whether detector is inside phantom
     89inline bool IsInside(G4double detectorHalfX,
     90                     G4double detectorHalfY,
     91                     G4double detectorHalfZ,
     92                     G4double phantomHalfX,
     93                     G4double phantomHalfY,
     94                     G4double phantomHalfZ,
     95                     G4ThreeVector detectorToPhantomPosition)
     96{
     97// Dimensions check... X Y and Z
     98// Firstly check what dimension we are modifying
     99        if (detectorHalfX > 0. && phantomHalfX > 0. && detectorToPhantomPosition.getX() >=0.)
     100        {
     101            if (detectorHalfX > phantomHalfX)
     102                 {
     103                    G4cout << "Error: Detector X dimension must be smaller or equal to the corrispondent of the phantom" << G4endl;
     104                    return false;
     105                 }
     106            if ( 2*(phantomHalfX - detectorHalfX) < detectorToPhantomPosition.getX())
     107                 {
     108                    G4cout << "Error: X dimension doesn't fit with detector to phantom relative position" << G4endl;
     109                    return false;
     110                 }
     111        }
    78112
    79 public:
     113        if (detectorHalfY > 0. && phantomHalfY > 0.&& detectorToPhantomPosition.getY() >=0.)
     114        {
     115            if (detectorHalfY > phantomHalfY)
     116                 {
     117                    G4cout << "Error: Detector Y dimension must be smaller or equal to the corrispondent of the phantom" << G4endl;
     118                    return false;
     119                 }
     120            if ( 2*(phantomHalfY - detectorHalfY) < detectorToPhantomPosition.getY())
     121             {
     122                   G4cout << "Error: Y dimension doesn't fit with detector to phantom relative position" << G4endl;
     123                   return false;
     124             }
     125        }                       
    80126
    81   void SetModulatorAngle(G4double angle);
    82   // This method allows moving the modulator through UI commands
     127        if (detectorHalfZ > 0. && phantomHalfZ > 0.&& detectorToPhantomPosition.getZ() >=0.)
     128        {
     129            if (detectorHalfZ > phantomHalfZ)
     130                 {
     131                    G4cout << "Error: Detector Z dimension must be smaller or equal to the corrispondent of the phantom" << G4endl;
     132                    return false;
     133                 }
     134            if ( 2*(phantomHalfZ - detectorHalfZ) < detectorToPhantomPosition.getZ())
     135             {
     136                   G4cout << "Error: Z dimension doesn't fit with detector to phantom relative position" << G4endl;
     137                   return false;
     138             }
     139        }
     140/*
     141    G4cout << "Displacement between Phantom and Detector is: ";
     142    G4cout << "DX= "<< G4BestUnit(detectorToPhantomPosition.getX(),"Length") <<
     143              "DY= "<< G4BestUnit(detectorToPhantomPosition.getY(),"Length") <<
     144              "DZ= "<< G4BestUnit(detectorToPhantomPosition.getZ(),"Length") << G4endl;
     145*/
     146        return true;
     147}
     148/////////////////////////////////////////////////////////////////////////////
    83149
    84   void SetRangeShifterXPosition(G4double translation);
    85   // This method allows to move the Range Shifter along
    86   // the X axis through UI commands
     150  G4bool SetNumberOfVoxelBySize(G4double sizeX, G4double sizeY, G4double sizeZ);
     151  G4bool SetDetectorSize(G4double sizeX, G4double sizeY, G4double sizeZ);
     152  G4bool SetPhantomSize(G4double sizeX, G4double sizeY, G4double sizeZ);
     153  G4bool SetPhantomPosition(G4ThreeVector);
     154  G4bool SetDetectorToPhantomPosition(G4ThreeVector DetectorToPhantomPosition);
     155  G4LogicalVolume* GetDetectorLogicalVolume(){ return detectorLogicalVolume;}
    87156
    88   void SetRangeShifterXSize(G4double halfSize);
    89   // This method allows to change the size of the range shifter along
    90   // the X axis through UI command.
    91157
    92   void SetFirstScatteringFoilSize(G4double halfSize);
    93   // This method allows to change the size of the first scattering foil
    94   // along the X axis through UI command.
     158private:
    95159
    96   void SetSecondScatteringFoilSize (G4double halfSize);
    97   // This method allows to change the size of the second scattering foil
    98   // along the X axis through UI command.
     160  HadrontherapyDetectorMessenger* detectorMessenger;
    99161
    100   void SetOuterRadiusStopper (G4double value);
    101   // This method allows to change the size of the outer radius of the stopper
    102   // through UI command.
     162  G4VisAttributes* skyBlue;
     163  G4VisAttributes* red;
    103164
    104   void SetInnerRadiusFinalCollimator (G4double value);
    105   // This method allows to change the size of the inner radius of the
    106   // final collimator through UI command.
     165  G4VPhysicalVolume* motherPhys;
    107166
    108   void SetRSMaterial(G4String material);
    109   // This method allows to change the material
    110   // of the range shifter through UI command.
     167  HadrontherapyDetectorSD*         detectorSD; // Pointer to sensitive detector
     168  HadrontherapyDetectorROGeometry* detectorROGeometry; // Pointer to ROGeometry
     169  HadrontherapyMatrix*             matrix;
    111170
    112   G4double ComputeVoxelSize() {return phantomSizeX/numberOfVoxelsAlongX;};
    113   // Returns the size of the voxel along the X axis
    114  
    115 private:
     171  G4VPhysicalVolume* phantomPhysicalVolume;
     172  G4LogicalVolume*   phantomLogicalVolume;
     173  G4LogicalVolume*   detectorLogicalVolume;
     174  G4VPhysicalVolume* detectorPhysicalVolume;
    116175 
    117   HadrontherapyPhantomSD* phantomSD; // Pointer to sensitive detector
    118 
    119   HadrontherapyPhantomROGeometry* phantomROGeometry; // Pointer to ROGeometry
    120 
    121   HadrontherapyBeamLine* beamLine; // Pointer to the beam line
    122                                    // geometry component
    123 
    124   HadrontherapyModulator* modulator; // Pointer to the modulator
    125                                      // geometry component
    126 
    127   G4VPhysicalVolume* physicalTreatmentRoom;
    128   G4VPhysicalVolume* patientPhysicalVolume;
    129   G4LogicalVolume* phantomLogicalVolume;
    130   G4VPhysicalVolume* phantomPhysicalVolume;
    131  
    132   HadrontherapyDetectorMessenger* detectorMessenger;
    133   HadrontherapyMaterial* material;
    134 
    135176  G4double phantomSizeX;
    136177  G4double phantomSizeY;
    137178  G4double phantomSizeZ;
    138    
     179
     180  G4double detectorSizeX;
     181  G4double detectorSizeY;
     182  G4double detectorSizeZ;
     183
     184  G4ThreeVector phantomPosition, detectorPosition, detectorToPhantomPosition; //  phantom center, detector center, detector to phantom relative position
     185
     186  G4double sizeOfVoxelAlongX;
     187  G4double sizeOfVoxelAlongY;
     188  G4double sizeOfVoxelAlongZ;
     189
    139190  G4int numberOfVoxelsAlongX;
    140191  G4int numberOfVoxelsAlongY;
    141192  G4int numberOfVoxelsAlongZ; 
     193
     194  G4Box* phantom;
     195  G4Box* detector;
     196
    142197};
    143198#endif
  • trunk/examples/advanced/hadrontherapy/include/HadrontherapyDetectorMessenger.hh

    r807 r1230  
    2424// ********************************************************************
    2525//
    26 // $Id: HadrontherapyDetectorMessenger.hh; May 2005
    27 // ----------------------------------------------------------------------------
    28 //                 GEANT 4 - Hadrontherapy example
    29 // ----------------------------------------------------------------------------
    30 // Code developed by:
    31 //
    32 // G.A.P. Cirrone(a)*, F. Di Rosa(a), S. Guatelli(b), G. Russo(a)
    33 //
    34 // (a) Laboratori Nazionali del Sud
    35 //     of the INFN, Catania, Italy
    36 // (b) INFN Section of Genova, Genova, Italy
    37 //
    38 // * cirrone@lns.infn.it
    39 // ----------------------------------------------------------------------------
     26// HadrontherapyDetectorMessenger.hh;
     27// See more at: http://g4advancedexamples.lngs.infn.it/Examples/hadrontherapy//
     28
    4029#ifndef HadrontherapyDetectorMessenger_h
    4130#define HadrontherapyDetectorMessenger_h 1
     
    4837class G4UIcmdWithADoubleAndUnit;
    4938class G4UIcmdWithAString;
     39class G4UIcmdWith3VectorAndUnit;
    5040
    5141class HadrontherapyDetectorMessenger: public G4UImessenger
     
    5545  ~HadrontherapyDetectorMessenger();
    5646   
    57     void SetNewValue(G4UIcommand*, G4String);
     47  void SetNewValue(G4UIcommand*, G4String);
    5848   
    5949private:
    6050
    61   // Pointer to the detector component
     51  // Pointer to the phantom/detector
    6252  HadrontherapyDetectorConstruction* hadrontherapyDetector;
    63  
    64   G4UIdirectory* modulatorDir; // Control of the modulator
    65   G4UIdirectory* beamLineDir;  // Control of the beam line
    66  
    67   G4UIdirectory* rangeShifterDir;
    68   // Control of the range shifter component of the beam line
    6953
    70   G4UIdirectory* firstScatteringFoilDir;
    71   // Control of the first scattering foil component of the beam line
    72  
    73   G4UIdirectory* secondScatteringFoilDir;
    74   // Control of the first scattering foil component of the beam line
    75  
    76   G4UIdirectory* rangeStopperDir;
    77   // Control of the range stopper component of the beam line
    78  
    79   G4UIdirectory* finalCollimatorDir;
    80   // Control of the final collimator component of the beam line
    81  
    82   G4UIcmdWithADoubleAndUnit* modulatorAngleCmd;
    83   // UI command to rotate the modulator wheel
     54  G4UIdirectory *changeThePhantomDir,  *changeTheDetectorDir;
    8455
    85   G4UIcmdWithAString*   rangeShifterMatCmd;
    86   // UI command to set the material of the rangeShifter component of
    87   // the beam line
    88 
    89   G4UIcmdWithADoubleAndUnit* rangeShifterXSizeCmd;
    90   // UI command to set half of the X size of the rangeShifter component of
    91   // the beam line
    92 
    93   G4UIcmdWithADoubleAndUnit* rangeShifterXPositionCmd;
    94   // UI command to change the X position of the rangeShifter component of
    95   // the beam line
    96 
    97   G4UIcmdWithADoubleAndUnit* firstScatteringFoilXSizeCmd;
    98   // UI command to set half X size of the first scattering foil of
    99   // the beam line
    100 
    101   G4UIcmdWithADoubleAndUnit* secondScatteringFoilXSizeCmd;
    102   // UI command to set half X size of the second scattering foil
    103   // the beam line
    104 
    105   G4UIcmdWithADoubleAndUnit* outerRadiusStopperCmd;
    106   // UI command to set the outer radius of the range stopper component of
    107   // the beam line
    108 
    109   G4UIcmdWithADoubleAndUnit* innerRadiusFinalCollimatorCmd;
    110   // UI command to set the inner radius of the final collimator component of
    111   // the beam line
     56  G4UIcmdWith3VectorAndUnit *changeThePhantomSizeCmd,
     57                            *changeThePhantomPositionCmd,
     58                            *changeTheDetectorSizeCmd,
     59                            *changeTheDetectorToPhantomPositionCmd,
     60                            *changeTheDetectorVoxelCmd;
    11261};
    11362#endif
  • trunk/examples/advanced/hadrontherapy/include/HadrontherapyDummySD.hh

    r807 r1230  
    2424// ********************************************************************
    2525//
    26 // ----------------------------------------------------------------------------
    27 //                 GEANT 4 - Hadrontherapy example
    28 // ----------------------------------------------------------------------------
    29 // Code developed by:
    30 //
    31 // G.A.P. Cirrone(a)*, G. Candiano, F. Di Rosa(a), S. Guatelli(b), G. Russo(a)
    32 //
    33 // (a) Laboratori Nazionali del Sud
    34 //     of the National Institute for Nuclear Physics, Catania, Italy
    35 // (b) National Institute for Nuclear Physics Section of Genova, genova, Italy
    36 //
    37 // * cirrone@lns.infn.it
    38 // --------------------------------------------------------------
     26// HadrontherapyDummySD.hh
     27// See more at: http://g4advancedexamples.lngs.infn.it/Examples/hadrontherapy
    3928
    4029#ifndef HadrontherapyDummySD_h
  • trunk/examples/advanced/hadrontherapy/include/HadrontherapyEventAction.hh

    r807 r1230  
    2424// ********************************************************************
    2525//
    26 // $Id: HadrontherapyEventAction.hh; May 2005
    27 // ----------------------------------------------------------------------------
    28 //                 GEANT 4 - Hadrontherapy example
    29 // ----------------------------------------------------------------------------
    30 // Code developed by:
    31 //
    32 // G.A.P. Cirrone(a)*, G. Candiano, F. Di Rosa(a), S. Guatelli(b), G. Russo(a)
    33 //
    34 // (a) Laboratori Nazionali del Sud
    35 //     of the National Institute for Nuclear Physics, Catania, Italy
    36 // (b) National Institute for Nuclear Physics Section of Genova, genova, Italy
    37 //
    38 // * cirrone@lns.infn.it
    39 // --------------------------------------------------------------
     26// HadrontherapyEventAction.hh;
     27// See more at: http://g4advancedexamples.lngs.infn.it/Examples/hadrontherapy
    4028
    4129#ifndef HadrontherapyEventAction_h
     
    4634
    4735class HadrontherapyMatrix;
     36class HadrontherapyEventActionMessenger;
    4837
    4938class HadrontherapyEventAction : public G4UserEventAction
    5039{
    5140public:
    52   HadrontherapyEventAction(HadrontherapyMatrix*);
     41  HadrontherapyEventAction();
    5342  ~HadrontherapyEventAction();
    5443
     
    5645  void BeginOfEventAction(const G4Event*);
    5746  void EndOfEventAction(const G4Event*);
    58    
     47
     48  void SetPrintModulo(G4int val)
     49  {
     50    printModulo = val;
     51  };
     52
     53  void SetDrawFlag(G4String val)
     54  {
     55    drawFlag = val;
     56  };
     57
    5958private:
    6059  G4String drawFlag; //Visualisation flag
    6160  G4int hitsCollectionID;
    6261  HadrontherapyMatrix *matrix;
     62  G4int printModulo; 
     63  HadrontherapyEventActionMessenger* pointerEventMessenger;
    6364};
    6465
  • trunk/examples/advanced/hadrontherapy/include/HadrontherapyMatrix.hh

    r807 r1230  
    2424// ********************************************************************
    2525//
    26 // $Id: HadrontherapyMatrix.hh; May 2005
    27 // ----------------------------------------------------------------------------
    28 //                 GEANT 4 - Hadrontherapy example
    29 // ----------------------------------------------------------------------------
    30 // Code developed by:
    31 //
    32 // G.A.P. Cirrone(a)*, F. Di Rosa(a), S. Guatelli(b), G. Russo(a)
    33 //
    34 // (a) Laboratori Nazionali del Sud
    35 //     of the National Institute for Nuclear Physics, Catania, Italy
    36 // (b) National Institute for Nuclear Physics Section of Genova, genova, Italy
    37 //
    38 // * cirrone@lns.infn.it
    39 // ----------------------------------------------------------------------------
     26// HadrontherapyMatrix.hh;
     27// See more at: http://g4advancedexamples.lngs.infn.it/Examples/hadrontherapy
    4028
    4129#ifndef HadrontherapyMatrix_H
     
    4331
    4432#include "globals.hh"
     33#include <vector>
    4534
    4635// The information: energy deposit and position in the phantom
     
    4938class HadrontherapyMatrix
    5039{
     40private:
     41  HadrontherapyMatrix(G4int voxelX, G4int voxelY, G4int voxelZ); //<--- this is supposed to be a singleton
     42
    5143public:
    52   HadrontherapyMatrix();
     44
    5345  ~HadrontherapyMatrix();
     46// Get object instance only
     47  static HadrontherapyMatrix* getInstance();
     48// Make & Get instance
     49  static HadrontherapyMatrix* getInstance(G4int nX, G4int nY, G4int nZ);
     50 
     51  void flush();
    5452 
    5553  void Initialize();
    5654  // All the elements of the matrix are initialised to zero
    57  
     55  
    5856  void Fill(G4int i, G4int j, G4int k, G4double energyDeposit);
    5957  // The matrix is filled with the energy deposit
     
    6462  // Store the information of the matrix in a ntuple and in
    6563  // a 1D Histogram
     64 
     65  inline G4int Index(G4int i, G4int j, G4int k){ return (i * numberVoxelY + j) * numberVoxelZ + k; }
     66  // Get a unique index from a three dimensional voxel information
    6667
    6768private:
     69
     70  static HadrontherapyMatrix* instance;
    6871  G4int numberVoxelX;
    6972  G4int numberVoxelY;
  • trunk/examples/advanced/hadrontherapy/include/HadrontherapyParticles.hh

    r807 r1230  
    2424// ********************************************************************
    2525//
    26 // $Id: HadrontherapyParticles.hh; May 2005
    27 // ----------------------------------------------------------------------------
    28 //                 GEANT 4 - Hadrontherapy example
    29 // ----------------------------------------------------------------------------
    30 // Code developed by:
    31 //
    32 // G.A.P. Cirrone(a)*, F. Di Rosa(a), S. Guatelli(b), G. Russo(a)
    33 //
    34 // (a) Laboratori Nazionali del Sud
    35 //     of the National Institute for Nuclear Physics, Catania, Italy
    36 // (b) National Institute for Nuclear Physics Section of Genova, genova, Italy
    37 //
    38 // * cirrone@lns.infn.it
    39 // ----------------------------------------------------------------------------
     26// HadrontherapyParticles.hh;
     27// See more at: http://g4advancedexamples.lngs.infn.it/Examples/hadrontherapy
    4028
    4129#ifndef HADRONTHERAPYPARTICLES_HH
  • trunk/examples/advanced/hadrontherapy/include/HadrontherapyPhysicsList.hh

    r807 r1230  
    2424// ********************************************************************
    2525//
    26 // $Id: HadrontherapyPhysicsList.hh,v 1.0
    27 // ----------------------------------------------------------------------------
    28 //                 GEANT 4 - Hadrontherapy example
    29 // ----------------------------------------------------------------------------
    30 // Code developed by:
    31 //
    32 // G.A.P. Cirrone(a)*, F. Di Rosa(a), S. Guatelli(b), G. Russo(a)
    33 //
    34 // (a) Laboratori Nazionali del Sud
    35 //     of the National Institute for Nuclear Physics, Catania, Italy
    36 // (b) National Institute for Nuclear Physics Section of Genova, genova, Italy
    37 //
    38 // * cirrone@lns.infn.it
    39 // ----------------------------------------------------------------------------
    40 #ifndef HADRONTHERAPYPHYSICSLIST_H
    41 #define HADRONTHERAPYPHYSICSLIST_H 1
     26// HadrontherapyPhysicsList.hh
     27// See more at: http://g4advancedexamples.lngs.infn.it/Examples/hadrontherapy
     28
     29#ifndef HadrontherapyPhysicsList_h
     30#define HadrontherapyPhysicsList_h 1
    4231
    4332#include "G4VModularPhysicsList.hh"
     33#include "G4EmConfigurator.hh"
    4434#include "globals.hh"
    4535
     36class G4VPhysicsConstructor;
     37class HadrontherapyStepMax;
    4638class HadrontherapyPhysicsListMessenger;
    4739
     
    4941{
    5042public:
     43
    5144  HadrontherapyPhysicsList();
    5245  virtual ~HadrontherapyPhysicsList();
    5346
    54   virtual void SetCuts();
    55   void AddPhysicsList(const G4String& name); 
    56  
     47  void ConstructParticle();
     48
     49  void SetCuts();
     50  void SetCutForGamma(G4double);
     51  void SetCutForElectron(G4double);
     52  void SetCutForPositron(G4double);
     53
     54  void AddPhysicsList(const G4String& name);
     55  void ConstructProcess();
     56
     57  void AddStepMax();
     58  HadrontherapyStepMax* GetStepMaxProcess() {return stepMaxProcess;};
     59  void AddPackage(const G4String& name);
     60
    5761private:
    58   G4bool decayIsRegistered;
    59   G4bool emElectronIsRegistered;
    60   G4bool emPositronIsRegistered;
    61   G4bool emPhotonIsRegistered;
    62   G4bool emIonIsRegistered;
    63   G4bool emMuonIsRegistered;
    64   G4bool hadrElasticHadronIonIsRegistered;
    65   G4bool hadrInelasticPionIsRegistered;
    66   G4bool hadrInelasticIonIsRegistered;
    67   G4bool hadrInelasticProtonNeutronIsRegistered;
    68   G4bool hadrAtRestMuonIsRegistered;
    6962
    70   HadrontherapyPhysicsListMessenger* messenger;
     63  G4EmConfigurator em_config;
     64
     65  G4double cutForGamma;
     66  G4double cutForElectron;
     67  G4double cutForPositron;
     68
     69  G4bool helIsRegisted;
     70  G4bool bicIsRegisted;
     71  G4bool biciIsRegisted;
     72  G4bool locIonIonInelasticIsRegistered;
     73  G4bool radioactiveDecayIsRegisted;
     74
     75  G4String                             emName;
     76  G4VPhysicsConstructor*               emPhysicsList;
     77  G4VPhysicsConstructor*               decPhysicsList;
     78  std::vector<G4VPhysicsConstructor*>  hadronPhys;
     79
     80  HadrontherapyStepMax* stepMaxProcess;
     81
     82  HadrontherapyPhysicsListMessenger* pMessenger;
    7183};
    7284
    7385#endif
    74 
    75 
    76 
  • trunk/examples/advanced/hadrontherapy/include/HadrontherapyPhysicsListMessenger.hh

    r807 r1230  
    2424// ********************************************************************
    2525//
    26 // $Id: HadrontherapyPhisicsListMessenger.hh; May 2005
    27 // ----------------------------------------------------------------------------
    28 //                 GEANT 4 - Hadrontherapy example
    29 // ----------------------------------------------------------------------------
    30 // Code developed by:
    31 //
    32 // G.A.P. Cirrone(a)*, F. Di Rosa(a), S. Guatelli(b), G. Russo(a)
    33 //
    34 // (a) Laboratori Nazionali del Sud
    35 //     of the National Institute for Nuclear Physics, Catania, Italy
    36 // (b) National Institute for Nuclear Physics Section of Genova, genova, Italy
    37 //
    38 // * cirrone@lns.infn.it
    39 // ----------------------------------------------------------------------------
     26// HadrontherapyPhysicsListsMessenger.hh
     27// See more at: http://g4advancedexamples.lngs.infn.it/Examples/hadrontherapy
    4028
    41 #ifndef HADRONTHERAPYPHYSICSLISTMESSENGER_HH
    42 #define HADRONTHERAPYPHYSICSLISTMESSENGER_HH 1
     29#ifndef HadrontherapyPhysicsListMessenger_h
     30#define HadrontherapyPhysicsListMessenger_h 1
    4331
    4432#include "globals.hh"
     
    4735class HadrontherapyPhysicsList;
    4836class G4UIdirectory;
    49 class G4UIcmdWithoutParameter;
    50 class G4UIcmdWithADouble;
    5137class G4UIcmdWithADoubleAndUnit;
    52 class G4UIcmdWithABool;
    5338class G4UIcmdWithAString;
    5439
    55 class HadrontherapyPhysicsListMessenger: public G4UImessenger {
     40//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    5641
    57 public:
     42class HadrontherapyPhysicsListMessenger: public G4UImessenger
     43{
     44  public:
    5845 
    59   HadrontherapyPhysicsListMessenger(HadrontherapyPhysicsList* physList);
     46    HadrontherapyPhysicsListMessenger(HadrontherapyPhysicsList* );
     47   ~HadrontherapyPhysicsListMessenger();
     48   
     49    void SetNewValue(G4UIcommand*, G4String);
     50   
     51  private:
    6052 
    61   ~HadrontherapyPhysicsListMessenger();
    62  
    63   void SetNewValue(G4UIcommand*, G4String);
    64  
    65 private:
    66  
    67   HadrontherapyPhysicsList* physicsList;   
    68   G4UIdirectory* listDir;
    69   G4UIcmdWithAString* physicsListCmd;
     53  HadrontherapyPhysicsList* pPhysicsList;
     54   
     55  G4UIdirectory*             physDir;       
     56  G4UIcmdWithADoubleAndUnit* gammaCutCmd;
     57  G4UIcmdWithADoubleAndUnit* electCutCmd;
     58  G4UIcmdWithADoubleAndUnit* protoCutCmd;   
     59  G4UIcmdWithADoubleAndUnit* allCutCmd;    
     60  G4UIcmdWithAString*        pListCmd;
     61  G4UIcmdWithAString* packageListCmd;   
    7062};
     63
     64//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    7165
    7266#endif
    7367
    74 
    75 
    76 
    77 
    78 
    79 
    80 
  • trunk/examples/advanced/hadrontherapy/include/HadrontherapyPrimaryGeneratorAction.hh

    r807 r1230  
    2424// ********************************************************************
    2525//
    26 // $Id: HadrontherapyPrimaryGeneratorAction.hh; May 2005
    27 // ----------------------------------------------------------------------------
    28 //                 GEANT 4 - Hadrontherapy example
    29 // ----------------------------------------------------------------------------
    30 // Code developed by:
    31 //
    32 // G.A.P. Cirrone(a)*, F. Di Rosa(a), S. Guatelli(b), G. Russo(a)
    33 //
    34 // (a) Laboratori Nazionali del Sud
    35 //     of the National Institute for Nuclear Physics, Catania, Italy
    36 // (b) National Institute for Nuclear Physics Section of Genova, genova, Italy
    37 //
    38 // * cirrone@lns.infn.it
    39 // ----------------------------------------------------------------------------
     26// HadrontherapyPrimaryGeneratorAction.hh; May 2005
     27// See more at: http://g4advancedexamples.lngs.infn.it/Examples/hadrontherapy
    4028
    4129#ifndef HadrontherapyPrimaryGeneratorAction_h
     
    6856  void SetsigmaMomentumY(G4double);
    6957  void SetsigmaMomentumZ(G4double);
     58  G4double GetmeanKineticEnergy(void);
    7059   
    7160private:
  • trunk/examples/advanced/hadrontherapy/include/HadrontherapyPrimaryGeneratorMessenger.hh

    r807 r1230  
    2424// ********************************************************************
    2525//
    26 // $Id: HadrontherapyPrimaryGeneratorMessenger.hh; May 2005
    27 // ----------------------------------------------------------------------------
    28 //                 GEANT 4 - Hadrontherapy example
    29 // ----------------------------------------------------------------------------
    30 // Code developed by:
    31 //
    32 // G.A.P. Cirrone(a)*, F. Di Rosa(a), S. Guatelli(b), G. Russo(a)
    33 //
    34 // (a) Laboratori Nazionali del Sud
    35 //     of the National Institute for Nuclear Physics, Catania, Italy
    36 // (b) National Institute for Nuclear Physics Section of Genova, genova, Italy
    37 //
    38 // * cirrone@lns.infn.it
    39 // ----------------------------------------------------------------------------
     26// HadrontherapyPrimaryGeneratorMessenger.hh;
     27// See more at: http://g4advancedexamples.lngs.infn.it/Examples/hadrontherapy
    4028
    4129#ifndef HadrontherapyPrimaryGeneratorMessenger_h
  • trunk/examples/advanced/hadrontherapy/include/HadrontherapyRunAction.hh

    r807 r1230  
    2424// ********************************************************************
    2525//
    26 // $Id: HadrontherapyRunAction.hh,v 3.0, September 2004;
    27 // ----------------------------------------------------------------------------
    28 //                 GEANT 4 - Hadrontherapy example
    29 // ----------------------------------------------------------------------------
    30 // Code developed by:
    31 //
    32 // G.A.P. Cirrone(a)*, F. Di Rosa(a), S. Guatelli(b), G. Russo(a)
    33 //
    34 // (a) Laboratori Nazionali del Sud
    35 //     of the INFN, Catania, Italy
    36 // (b) INFN Section of Genova, Genova, Italy
    37 //
    38 // * cirrone@lns.infn.it
    39 // ----------------------------------------------------------------------------
     26// HadrontherapyRunAction.hh
     27// See more at: http://g4advancedexamples.lngs.infn.it/Examples/hadrontherapy
    4028
    4129#ifndef HadrontherapyRunAction_h
     
    5139class HadrontherapyRunMessenger;
    5240class HadrontherapyFactory;
    53 class HadrontherapyFactoryIr;
    54 class HadrontherapyFactoryI;
    55 
    56 
    5741
    5842class HadrontherapyRunAction : public G4UserRunAction
  • trunk/examples/advanced/hadrontherapy/include/HadrontherapySteppingAction.hh

    r807 r1230  
    2424// ********************************************************************
    2525//
    26 // $Id: HadrontherapyProtonSteppingAction.hh; May 2005
    27 // ----------------------------------------------------------------------------
    28 //                 GEANT 4 - Hadrontherapy example
    29 // ----------------------------------------------------------------------------
    30 // Code developed by:
    31 //
    32 // G.A.P. Cirrone(a)*, F. Di Rosa(a), S. Guatelli(b), G. Russo(a)
    33 //
    34 // (a) Laboratori Nazionali del Sud
    35 //     of the INFN, Catania, Italy
    36 // (b) INFN Section of Genova, Genova, Italy
    37 //
    38 // * cirrone@lns.infn.it
    39 // ----------------------------------------------------------------------------
     26// HadrontherapyProtonSteppingAction.hh;
     27// See more at: http://g4advancedexamples.lngs.infn.it/Examples/hadrontherapy
    4028
    4129#ifndef HadrontherapySteppingAction_h
Note: See TracChangeset for help on using the changeset viewer.