Import Geant4 9.5.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 16:46:55 +02:00
parent 89a9605df1
commit b1eb5424d2
10957 changed files with 888481 additions and 160139 deletions
@@ -0,0 +1,39 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * 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. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id$
//
/// \file B4Analysis.hh
/// \brief Selection of the analysis technology
#ifndef B4Analysis_h
#define B4Analysis_h 1
#include "g4analysis_defs.hh"
using namespace G4Root;
//using namespace G4Xml;
#endif
@@ -0,0 +1,66 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * 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. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id$
//
/// \file B4PrimaryGeneratorAction.hh
/// \brief Definition of the B4PrimaryGeneratorAction class
#ifndef B4PrimaryGeneratorAction_h
#define B4PrimaryGeneratorAction_h 1
#include "G4VUserPrimaryGeneratorAction.hh"
#include "globals.hh"
class G4ParticleGun;
class G4Event;
/// The primary generator action class with particle gum.
///
/// It defines a single particle which hits the calorimeter
/// perpendicular to the input face. The type of the particle
/// can be changed via the G4 build-in commands of G4ParticleGun class
/// (see the macros provided with this example).
class B4PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
{
public:
B4PrimaryGeneratorAction();
virtual ~B4PrimaryGeneratorAction();
virtual void GeneratePrimaries(G4Event* event);
// set methods
void SetRandomFlag(G4bool value);
private:
G4ParticleGun* fParticleGun; // G4 particle gun
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -0,0 +1,70 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * 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. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id$
//
/// \file B4RunAction.hh
/// \brief Definition of the B4RunAction class
#ifndef B4RunAction_h
#define B4RunAction_h 1
#include "G4UserRunAction.hh"
#include "globals.hh"
class G4Run;
/// Run action class
///
/// It accumulates statistic and computes dispersion of the energy deposit
/// and track lengths of charged particles with use of analysis tools:
/// H1D histograms are created in BeginOfRunAction() for the following
/// physics quantities:
/// - Edep in absorber
/// - Edep in gap
/// - Track length in absorber
/// - Track length in gap
/// The same values are also saved in the ntuple.
/// The histograms and ntuple are saved in the output file in a format
/// accoring to a selected technology in B4Analysis.hh.
///
/// In EndOfRunAction(), the accumulated statistic and computed
/// dispersion is printed.
///
class B4RunAction : public G4UserRunAction
{
public:
B4RunAction();
virtual ~B4RunAction();
virtual void BeginOfRunAction(const G4Run*);
virtual void EndOfRunAction(const G4Run*);
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -0,0 +1,93 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * 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. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id$
//
/// \file B4dDetectorConstruction.hh
/// \brief Definition of the B4dDetectorConstruction class
#ifndef B4dDetectorConstruction_h
#define B4dDetectorConstruction_h 1
#include "G4VUserDetectorConstruction.hh"
#include "globals.hh"
#include "B4dDetectorMessenger.hh"
class G4Box;
class G4VPhysicalVolume;
class G4UniformMagField;
/// Detector construction class to define materials and geometry.
/// The calorimeter is a box made of a given number of layers. A layer consists
/// of an absorber plate and of a detection gap. The layer is replicated.
///
/// Four parameters define the geometry of the calorimeter :
///
/// - the thickness of an absorber plate,
/// - the thickness of a gap,
/// - the number of layers,
/// - the transverse size of the calorimeter (the input face is a square).
///
/// In DefineVolumes(), sensitive detectors of G4MultiFunctionalDetector type
/// with primitive scorers are created and associated with the Absorber
/// and Gap volumes.
///
/// In addition a transverse uniform magnetic field is defined in
/// SetMagField() method which can be activated
/// via a command defined in the B4DetectorMessenger class.
class B4dDetectorConstruction : public G4VUserDetectorConstruction
{
public:
B4dDetectorConstruction();
virtual ~B4dDetectorConstruction();
public:
virtual G4VPhysicalVolume* Construct();
// set methods
//
void SetMagField(G4double fieldValue);
private:
// methods
//
void DefineMaterials();
G4VPhysicalVolume* DefineVolumes();
// data members
//
B4dDetectorMessenger fMessenger; // messenger
G4UniformMagField* fMagField; // magnetic field
G4bool fCheckOverlaps; // option to activate checking of volumes overlaps
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -0,0 +1,65 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * 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. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id$
//
/// \file B4dDetectorMessenger.hh
/// \brief Definition of the B4dDetectorMessenger class
#ifndef B4dDetectorMessenger_h
#define B4dDetectorMessenger_h 1
#include "globals.hh"
#include "G4UImessenger.hh"
class B4dDetectorConstruction;
class G4UIdirectory;
class G4UIcmdWithADoubleAndUnit;
/// Messenger class that defines commands for B4dDetectorConstruction.
///
/// It implements commands:
/// - /B4/det/setMagField value unit
class B4dDetectorMessenger: public G4UImessenger
{
public:
B4dDetectorMessenger(B4dDetectorConstruction* detectorConstruction);
virtual ~B4dDetectorMessenger();
virtual void SetNewValue(G4UIcommand*, G4String);
private:
B4dDetectorConstruction* fDetectorConstruction;
G4UIdirectory* fB4Directory;
G4UIdirectory* fDetDirectory;
G4UIcmdWithADoubleAndUnit* fSetMagFieldCmd;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -0,0 +1,86 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * 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. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id$
//
/// \file B4dEventAction.hh
/// \brief Definition of the B4dEventAction class
#ifndef B4dEventAction_h
#define B4dEventAction_h 1
#include "G4UserEventAction.hh"
#include "B4dEventActionMessenger.hh"
#include "G4THitsMap.hh"
#include "globals.hh"
/// Event action class
///
/// In EndOfEventAction(), it prints the accumulated quantities of the energy
/// deposit and track lengths of charged particles in Absober and Gap layers
/// stored in the hits collections.
///
/// The data member fPrintModulo defines the frequency of printing.
/// Its value can be changed via a command defined in B4dEventActionMassenger
/// class.
class B4dEventAction : public G4UserEventAction
{
public:
B4dEventAction();
virtual ~B4dEventAction();
virtual void BeginOfEventAction(const G4Event* event);
virtual void EndOfEventAction(const G4Event* event);
// set methods
void SetPrintModulo(G4int value);
private:
// methods
G4THitsMap<G4double>* GetHitsCollection(const G4String& hcName,
const G4Event* event) const;
G4double GetSum(G4THitsMap<G4double>* hitsMap) const;
void PrintEventStatistics(G4double absoEdep, G4double absoTrackLength,
G4double gapEdep, G4double gapTrackLength) const;
// data members
B4dEventActionMessenger fMessenger;
G4int fPrintModulo;
};
// inline functions
inline void B4dEventAction::SetPrintModulo(G4int value) {
fPrintModulo = value;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -0,0 +1,62 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * 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. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id$
//
/// \file B4dEventActionMessenger.hh
/// \brief Definition of the B4dEventActionMessenger class
#ifndef B4dEventActionMessenger_h
#define B4dEventActionMessenger_h 1
#include "G4UImessenger.hh"
#include "globals.hh"
class B4dEventAction;
class G4UIdirectory;
class G4UIcmdWithAnInteger;
/// Messenger class that defines commands for B4dEventAction class.
///
/// It implements commands:
/// - /B4/event/setPrintModulo value
class B4dEventActionMessenger: public G4UImessenger
{
public:
B4dEventActionMessenger(B4dEventAction* eventAction);
virtual ~B4dEventActionMessenger();
virtual void SetNewValue(G4UIcommand* command, G4String value);
private:
B4dEventAction* fEventAction;
G4UIdirectory* fDirectory;
G4UIcmdWithAnInteger* fSetPrintModuloCmd;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif