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,110 @@
//
// ********************************************************************
// * 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 B4cCalorHit.hh
/// \brief Definition of the B4cCalorHit class
#ifndef B4cCalorHit_h
#define B4cCalorHit_h 1
#include "G4VHit.hh"
#include "G4THitsCollection.hh"
#include "G4Allocator.hh"
#include "G4ThreeVector.hh"
/// Calorimeter hit class
///
/// It defines data members to store the the energy deposit and track lengths
/// of charged particles in a selected volume:
/// - fEdep, fTrackLength
class B4cCalorHit : public G4VHit
{
public:
B4cCalorHit();
B4cCalorHit(const B4cCalorHit&);
virtual ~B4cCalorHit();
// operators
const B4cCalorHit& operator=(const B4cCalorHit&);
G4int operator==(const B4cCalorHit&) const;
inline void* operator new(size_t);
inline void operator delete(void*);
// methods from base class
virtual void Draw() {}
virtual void Print();
// methods to handle data
void Add(G4double de, G4double dl);
// get methods
G4double GetEdep() const;
G4double GetTrackLength() const;
private:
G4double fEdep; ///< Energy deposit in the sensitive volume
G4double fTrackLength; ///< Track length in the sensitive volume
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
typedef G4THitsCollection<B4cCalorHit> B4cCalorHitsCollection;
extern G4Allocator<B4cCalorHit> B4cCalorHitAllocator;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline void* B4cCalorHit::operator new(size_t)
{
void *hit;
hit = (void *) B4cCalorHitAllocator.MallocSingle();
return hit;
}
inline void B4cCalorHit::operator delete(void *hit)
{
B4cCalorHitAllocator.FreeSingle((B4cCalorHit*) hit);
}
inline void B4cCalorHit::Add(G4double de, G4double dl) {
fEdep += de;
fTrackLength += dl;
}
inline G4double B4cCalorHit::GetEdep() const {
return fEdep;
}
inline G4double B4cCalorHit::GetTrackLength() const {
return fTrackLength;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -0,0 +1,72 @@
//
// ********************************************************************
// * 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 B4cCalorimeterSD.hh
/// \brief Definition of the B4cCalorimeterSD class
#ifndef B4cCalorimeterSD_h
#define B4cCalorimeterSD_h 1
#include "G4VSensitiveDetector.hh"
#include "B4cCalorHit.hh"
#include <vector>
class G4Step;
class G4HCofThisEvent;
/// Calorimeter sensitive detector class
///
/// In Initialize(), it creates one hit for each calorimeter layer and one more
/// hit for accounting the total quantities in all layers.
///
/// The values are accounted in hits in ProcessHits() function which is called
/// by Geant4 kernel at each step.
class B4cCalorimeterSD : public G4VSensitiveDetector
{
public:
B4cCalorimeterSD(const G4String& name,
const G4String& hitsCollectionName,
G4int nofCells);
virtual ~B4cCalorimeterSD();
// methods from base class
virtual void Initialize(G4HCofThisEvent* hitCollection);
virtual G4bool ProcessHits(G4Step* step, G4TouchableHistory* history);
virtual void EndOfEvent(G4HCofThisEvent* hitCollection);
private:
B4cCalorHitsCollection* fHitsCollection;
G4int fNofCells;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -0,0 +1,91 @@
//
// ********************************************************************
// * 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 B4cDetectorConstruction.hh
/// \brief Definition of the B4cDetectorConstruction class
#ifndef B4cDetectorConstruction_h
#define B4cDetectorConstruction_h 1
#include "G4VUserDetectorConstruction.hh"
#include "globals.hh"
#include "B4cDetectorMessenger.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 B4cCalorimeterSD type
/// 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 B4cDetectorConstruction : public G4VUserDetectorConstruction
{
public:
B4cDetectorConstruction();
virtual ~B4cDetectorConstruction();
public:
virtual G4VPhysicalVolume* Construct();
// set methods
//
void SetMagField(G4double fieldValue);
private:
// methods
//
void DefineMaterials();
G4VPhysicalVolume* DefineVolumes();
// data members
//
B4cDetectorMessenger 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 B4cDetectorMessenger.hh
/// \brief Definition of the B4cDetectorMessenger class
#ifndef B4cDetectorMessenger_h
#define B4cDetectorMessenger_h 1
#include "globals.hh"
#include "G4UImessenger.hh"
class B4cDetectorConstruction;
class G4UIdirectory;
class G4UIcmdWithADoubleAndUnit;
/// Messenger class that defines commands for B4cDetectorConstruction.
///
/// It implements commands:
/// - /B4/det/setMagField value unit
class B4cDetectorMessenger: public G4UImessenger
{
public:
B4cDetectorMessenger(B4cDetectorConstruction* detectorConstruction);
virtual ~B4cDetectorMessenger();
virtual void SetNewValue(G4UIcommand*, G4String);
private:
B4cDetectorConstruction* fDetectorConstruction;
G4UIdirectory* fB4Directory;
G4UIdirectory* fDetDirectory;
G4UIcmdWithADoubleAndUnit* fSetMagFieldCmd;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -0,0 +1,85 @@
//
// ********************************************************************
// * 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 B4cEventAction.hh
/// \brief Definition of the B4cEventAction class
#ifndef B4cEventAction_h
#define B4cEventAction_h 1
#include "G4UserEventAction.hh"
#include "B4cEventActionMessenger.hh"
#include "B4cCalorHit.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 B4cEventActionMassenger
/// class.
class B4cEventAction : public G4UserEventAction
{
public:
B4cEventAction();
virtual ~B4cEventAction();
virtual void BeginOfEventAction(const G4Event* event);
virtual void EndOfEventAction(const G4Event* event);
// set methods
void SetPrintModulo(G4int value);
private:
// methods
B4cCalorHitsCollection* GetHitsCollection(const G4String& hcName,
const G4Event* event) const;
void PrintEventStatistics(G4double absoEdep, G4double absoTrackLength,
G4double gapEdep, G4double gapTrackLength) const;
// data members
B4cEventActionMessenger fMessenger;
G4int fPrintModulo;
};
// inline functions
inline void B4cEventAction::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 B4cEventActionMessenger.hh
/// \brief Definition of the B4cEventActionMessenger class
#ifndef B4cEventActionMessenger_h
#define B4cEventActionMessenger_h 1
#include "G4UImessenger.hh"
#include "globals.hh"
class B4cEventAction;
class G4UIdirectory;
class G4UIcmdWithAnInteger;
/// Messenger class that defines commands for B4cEventAction class.
///
/// It implements commands:
/// - /B4/event/setPrintModulo value
class B4cEventActionMessenger: public G4UImessenger
{
public:
B4cEventActionMessenger(B4cEventAction* eventAction);
virtual ~B4cEventActionMessenger();
virtual void SetNewValue(G4UIcommand* command, G4String value);
private:
B4cEventAction* fEventAction;
G4UIdirectory* fDirectory;
G4UIcmdWithAnInteger* fSetPrintModuloCmd;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif