Import Geant4 5.0.0 source tree
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# $Id: GNUmakefile,v 1.3 2000/10/31 10:34:39 flei Exp $
|
||||
# $Id: GNUmakefile,v 1.4 2002/10/28 10:06:00 dressel Exp $
|
||||
# ------------------------------------------------------------
|
||||
# GNUmakefile for events library. Makoto Asai, 5/9/95.
|
||||
# ------------------------------------------------------------
|
||||
@@ -30,6 +30,7 @@ CPPFLAGS += \
|
||||
-I$(G4BASE)/materials/include \
|
||||
-I$(G4BASE)/geometry/management/include \
|
||||
-I$(G4BASE)/geometry/volumes/include \
|
||||
-I$(G4BASE)/geometry/biasing/include \
|
||||
-I$(G4BASE)/digits+hits/detector/include \
|
||||
-I$(G4BASE)/digits+hits/hits/include \
|
||||
-I$(G4BASE)/digits+hits/digits/include \
|
||||
|
||||
+42
-1
@@ -1,4 +1,4 @@
|
||||
$Id: History,v 1.40 2002/06/08 20:36:18 asaim Exp $
|
||||
$Id: History,v 1.56 2002/12/06 19:17:57 gcosmo Exp $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
@@ -17,6 +17,47 @@ committal in the CVS repository !
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
Dec 06 2002, G.Cosmo (event-V04-01-11)
|
||||
- Corrected tag to include also "event-V04-01-09" !!
|
||||
|
||||
Dec 04 2002, M.Asai (event-V04-01-10)
|
||||
- Migration to new G4ApplicationState
|
||||
|
||||
Dec 03 2002, M.Asai (event-V04-01-09)
|
||||
- Fix memory leak caused by deleting stacked tracks.
|
||||
|
||||
Dec 03 2002, G.Cosmo (event-V04-01-08)
|
||||
- Protect code defining interface to HepMC from compilation on Windows systems.
|
||||
Temporarly solution until CLHEP will support the HepMC module on Windows.
|
||||
|
||||
Nov 25 2002, M.Asai (event-V04-01-07)
|
||||
- Fix a bug in G4CellScorer.cc
|
||||
|
||||
Nov 18 2002, M.Asai (event-v04-01-06)
|
||||
- Introducing HepMC interfaces
|
||||
- Tag for Geant4 5.0 release
|
||||
|
||||
Nov 4th 2002 M.Dressel (event-V04-01-05)
|
||||
- remove G4std:: where it does not belong to
|
||||
|
||||
Oct 28 2002, M.Dressel (event-V04-01-04)
|
||||
- Added G4CellScorer[.hh.cc], G4CellScorerStore[.hh.cc], G4ScoreTable[.hh.cc], G4Scorer[.hh.cc]
|
||||
|
||||
Oct 06 2002, M.Asai (event-V04-01-03)
|
||||
- Protect user's mis-use of destructor of G4TrajectoryContainer.
|
||||
By design it was expected that G4TrajectoryContainer would be
|
||||
deleted by G4Event destructor, after "clearAndDestroy" is
|
||||
separately invoked.
|
||||
|
||||
Aug 19 2002, M.Asai (event-V04-01-02)
|
||||
- Change the default value of charge for G4PrimaryParticle.
|
||||
|
||||
Aug 13 2002, M.Asai (event-V04-01-01)
|
||||
- G4Event: Introducing an EventAborted flag.
|
||||
|
||||
Jun 29 2002, V.Ivantchenko (event-V04-01-00)
|
||||
- G4PrimaryParticle: fixed initialisation of 'charge' in constructors.
|
||||
|
||||
Jun 8 2002, M.Asai (event-V04-00-04)
|
||||
- Fix G4TrajectoryContainer to be compliant to gcc-3.1.
|
||||
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4CellScorer.hh,v 1.1 2002/10/28 10:06:00 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// Class G4CellScorer
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
// This class does standard scoring for a cell. The cell may be a
|
||||
// physical volume or replica in the mass or a parallel geometry.
|
||||
// One object of this class per cell is used.
|
||||
// See intercoms/include/G4VCellScorer.hh
|
||||
//
|
||||
|
||||
// Author: Michael Dressel (Michael.Dressel@cern.ch)
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#ifndef G4CellScorer_hh
|
||||
#define G4CellScorer_hh G4CellScorer_hh
|
||||
|
||||
#include "G4VCellScorer.hh"
|
||||
#include "G4TrackLogger.hh"
|
||||
#include "G4CellScoreComposer.hh"
|
||||
#include "G4CellScoreValues.hh"
|
||||
|
||||
class G4CellScorer : public G4VCellScorer {
|
||||
public: // with description
|
||||
|
||||
G4CellScorer();
|
||||
|
||||
virtual ~G4CellScorer();
|
||||
|
||||
virtual void ScoreAnExitingStep(const G4Step &aStep,
|
||||
const G4GeometryCell &gCell);
|
||||
// to update scores related with the exiting of a cell
|
||||
|
||||
virtual void ScoreAnEnteringStep(const G4Step &aStep,
|
||||
const G4GeometryCell &gCell);
|
||||
// to update scores related with the entering of a cell
|
||||
|
||||
virtual void ScoreAnInVolumeStep(const G4Step &aStep,
|
||||
const G4GeometryCell &gCell);
|
||||
// to update scores related with the stepping inside the cell
|
||||
|
||||
const G4CellScoreComposer &GetCellScoreComposer() const;
|
||||
// return the G4CellScoreComposer
|
||||
|
||||
const G4CellScoreValues &GetCellScoreValues() const;
|
||||
// return scores in G4CellScoreValues
|
||||
|
||||
private:
|
||||
void ScorePopulation(const G4GeometryCell &post_gCell,
|
||||
const G4Step &aStep);
|
||||
G4CellScoreComposer fCellScoreComposer;
|
||||
G4TrackLogger fTrackLogger;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#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: G4CellScorerStore.hh,v 1.1 2002/10/28 10:06:00 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// Class G4CellScorerStore
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
// This class stores pointers to G4CellScorer. Objects of G4CellScorer for
|
||||
// each cell may be created the first time a cell is hit: therefore
|
||||
// SetAutoScorerCreate() has to be called before the run starts.
|
||||
// Alternative the store may be filled with pointers to G4CellScorer
|
||||
// before the run. In this case only the cells for which a G4CellScorer
|
||||
// exists are scored.
|
||||
//
|
||||
|
||||
// Author: Michael Dressel (Michael.Dressel@cern.ch)
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#ifndef G4CellScorerStore_hh
|
||||
#define G4CellScorerStore_hh G4CellScorerStore_hh
|
||||
|
||||
#include "g4std/map"
|
||||
#include "G4GeometryCell.hh"
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4VCellScorerStore.hh"
|
||||
#include "G4GeometryCellComp.hh"
|
||||
|
||||
class G4CellScorer;
|
||||
|
||||
typedef G4std::map<G4GeometryCell, G4CellScorer *, G4GeometryCellComp> G4MapGeometryCellCellScorer;
|
||||
|
||||
class G4CellScorerStore : public G4VCellScorerStore {
|
||||
public: // with description
|
||||
|
||||
G4CellScorerStore();
|
||||
|
||||
virtual ~G4CellScorerStore();
|
||||
|
||||
virtual G4VCellScorer *GetCellScore(const G4GeometryCell &gCell);
|
||||
// return the current cell scorer
|
||||
|
||||
void SetAutoScorerCreate();
|
||||
// if this function is called cell scorers will be created
|
||||
// automatically for a cell the first time a track hits the cell
|
||||
|
||||
G4CellScorer *AddCellScorer(const G4GeometryCell &gCell);
|
||||
// add a G4CellScorer for the given cell, needed if
|
||||
// SetAutoScorerCreate is not called. This way the user
|
||||
// may specify to score only for the given cells.
|
||||
|
||||
|
||||
G4CellScorer *AddCellScorer(G4VPhysicalVolume &vol, G4int repnum = 0);
|
||||
// same functionallity as above only that the cell is specified
|
||||
// by the physical volume and a replica number
|
||||
|
||||
|
||||
const G4MapGeometryCellCellScorer &GetMapGeometryCellCellScorer() const ;
|
||||
// return the map of GeometryCell to the G4CellScorer
|
||||
|
||||
void DeleteAllScorers();
|
||||
|
||||
private:
|
||||
G4MapGeometryCellCellScorer fMapGeometryCellCellScorer;
|
||||
G4bool fAutoCreate;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4ClassificationOfNewTrack.hh,v 1.5 2001/07/19 00:14:15 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4EvManMessenger.hh,v 1.4 2001/07/11 09:58:47 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
|
||||
#ifndef G4EvManMessenger_h
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Event.hh,v 1.5 2001/07/13 15:01:45 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// $Id: G4Event.hh,v 1.6 2002/08/13 18:17:53 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
|
||||
#ifndef G4Event_h
|
||||
@@ -83,6 +83,10 @@ class G4Event
|
||||
// TrajectoryContainer
|
||||
G4TrajectoryContainer * trajectoryContainer;
|
||||
|
||||
// Boolean flag which shall be set to true if the event is aborted and
|
||||
// thus the containing information is not to be used.
|
||||
G4bool eventAborted;
|
||||
|
||||
public:
|
||||
inline void SetEventID(G4int i)
|
||||
{ eventID = i; }
|
||||
@@ -92,6 +96,8 @@ class G4Event
|
||||
{ DC = value; }
|
||||
inline void SetTrajectoryContainer(G4TrajectoryContainer*value)
|
||||
{ trajectoryContainer = value; }
|
||||
inline void SetEventAborted()
|
||||
{ eventAborted = true; }
|
||||
public: // with description
|
||||
inline G4int GetEventID() const
|
||||
{ return eventID; }
|
||||
@@ -137,6 +143,9 @@ class G4Event
|
||||
// (hits collections of this event), G4DCofThisEvent (digi collections
|
||||
// of this event), and G4TrajectoryContainer (trajectory coonainer),
|
||||
// respectively.
|
||||
inline G4bool IsAborted() const { return eventAborted; }
|
||||
// Return a boolean which indicates the event has been aborted and thus
|
||||
// it should not be used for analysis.
|
||||
};
|
||||
|
||||
extern G4Allocator<G4Event> anEventAllocator;
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4EventManager.hh,v 1.9 2001/07/19 00:14:15 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// $Id: G4GeneralParticleSource.hh,v 1.7 2001/10/19 16:48:28 flei Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Class Description:
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// $Id: G4GeneralParticleSourceMessenger.hh,v 1.8 2002/02/26 16:34:04 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Class Description:
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4HEPEvtInterface.hh,v 1.6 2001/07/11 09:58:48 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
|
||||
#ifndef G4HEPEvtInterface_h
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4HEPEvtParticle.hh,v 1.5 2001/07/13 15:01:45 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
|
||||
// ====================================================================
|
||||
//
|
||||
// G4HepMCAsciiReader.hh
|
||||
// $Id: G4HepMCAsciiReader.hh,v 1.1 2002/11/18 22:43:13 asaim Exp $
|
||||
//
|
||||
// ====================================================================
|
||||
#ifndef G4_HEPMC_ASCII_READER_H
|
||||
#define G4_HEPMC_ASCII_READER_H
|
||||
|
||||
#include "g4std/fstream"
|
||||
#include "G4HepMCInterface.hh"
|
||||
#include "CLHEP/HepMC/ReadHepMC.h"
|
||||
|
||||
class G4HepMCAsciiReaderMessenger;
|
||||
|
||||
class G4HepMCAsciiReader : public G4HepMCInterface {
|
||||
protected:
|
||||
G4String filename;
|
||||
G4std::ifstream from;
|
||||
|
||||
G4int verbose;
|
||||
G4HepMCAsciiReaderMessenger* messenger;
|
||||
|
||||
virtual HepMC::GenEvent* GenerateHepMCEvent();
|
||||
|
||||
public:
|
||||
G4HepMCAsciiReader();
|
||||
~G4HepMCAsciiReader();
|
||||
|
||||
// set/get methods
|
||||
void SetFileName(G4String name);
|
||||
G4String GetFileName() const;
|
||||
|
||||
void SetVerboseLevel(G4int i);
|
||||
G4int GetVerboseLevel() const;
|
||||
|
||||
// methods...
|
||||
void Initialize();
|
||||
};
|
||||
|
||||
// ====================================================================
|
||||
// inline functions
|
||||
// ====================================================================
|
||||
|
||||
inline void G4HepMCAsciiReader::SetFileName(G4String name)
|
||||
{
|
||||
filename= name;
|
||||
}
|
||||
|
||||
inline G4String G4HepMCAsciiReader::GetFileName() const
|
||||
{
|
||||
return filename;
|
||||
}
|
||||
|
||||
inline void G4HepMCAsciiReader::SetVerboseLevel(G4int i)
|
||||
{
|
||||
verbose= i;
|
||||
}
|
||||
|
||||
inline G4int G4HepMCAsciiReader::GetVerboseLevel() const
|
||||
{
|
||||
return verbose;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,56 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
|
||||
// ====================================================================
|
||||
//
|
||||
// G4HepMCAsciiReaderMessenger.hh
|
||||
// $Id: G4HepMCAsciiReaderMessenger.hh,v 1.1 2002/11/18 22:43:13 asaim Exp $
|
||||
//
|
||||
// ====================================================================
|
||||
#ifndef G4_HEPMC_ASCII_READER_MESSENGER_H
|
||||
#define G4_HEPMC_ASCII_READER_MESSENGER_H
|
||||
|
||||
#include "G4UImessenger.hh"
|
||||
|
||||
class G4HepMCAsciiReader;
|
||||
class G4UIdirectory;
|
||||
class G4UIcmdWithoutParameter;
|
||||
class G4UIcmdWithAString;
|
||||
class G4UIcmdWithAnInteger;
|
||||
|
||||
class G4HepMCAsciiReaderMessenger : public G4UImessenger {
|
||||
private:
|
||||
G4HepMCAsciiReader* gen;
|
||||
|
||||
G4UIdirectory* dir;
|
||||
G4UIcmdWithAnInteger* verbose;
|
||||
G4UIcmdWithAString* open;
|
||||
|
||||
public:
|
||||
G4HepMCAsciiReaderMessenger(G4HepMCAsciiReader* agen);
|
||||
~G4HepMCAsciiReaderMessenger();
|
||||
|
||||
void SetNewValue(G4UIcommand* command, G4String newValues);
|
||||
G4String GetCurrentValue(G4UIcommand* command);
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,79 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
|
||||
// ====================================================================
|
||||
//
|
||||
// G4HepMCInterface.hh
|
||||
// $Id: G4HepMCInterface.hh,v 1.1 2002/11/18 22:43:13 asaim Exp $
|
||||
//
|
||||
// A base class for primary generation via HepMC object.
|
||||
// This class is derived from G4VPrimaryGenerator.
|
||||
//
|
||||
// ====================================================================
|
||||
#ifndef G4_HEPMC_INTERFACE_H
|
||||
#define G4_HEPMC_INTERFACE_H
|
||||
|
||||
#include "G4VPrimaryGenerator.hh"
|
||||
#include "CLHEP/HepMC/GenEvent.h"
|
||||
|
||||
class G4HepMCInterface : public G4VPrimaryGenerator {
|
||||
protected:
|
||||
// Note that the life of HepMC event object must be handled by users.
|
||||
// In the default implementation, a current HepMC event will be
|
||||
// deleted at GeneratePrimaryVertex() in the next event.
|
||||
HepMC::GenEvent* hepmcEvent; // (care for single event case only)
|
||||
|
||||
// We have to take care for the position of primaries because
|
||||
// primary vertices outside the world voulme give rise to G4Execption.
|
||||
// If the default implementation is not adequate, an alternative
|
||||
// can be implemented in your own class.
|
||||
virtual G4bool CheckVertexInsideWorld(const G4ThreeVector& pos) const;
|
||||
|
||||
// service method for conversion from HepMC::GenEvent to G4Event
|
||||
void HepMC2G4(const HepMC::GenEvent* hepmcevt, G4Event* g4event);
|
||||
|
||||
// Implement this method in his/her own concrete class.
|
||||
// An empty event will be created in default.
|
||||
virtual HepMC::GenEvent* GenerateHepMCEvent();
|
||||
|
||||
public:
|
||||
G4HepMCInterface();
|
||||
virtual ~G4HepMCInterface();
|
||||
|
||||
// set/get methods
|
||||
HepMC::GenEvent* GetHepMCGenEvent() const;
|
||||
|
||||
// The default behavior is that a single HepMC event generated by
|
||||
// GenerateHepMCEvent() will be converted to G4Event through HepMC2G4().
|
||||
virtual void GeneratePrimaryVertex(G4Event* anEvent);
|
||||
};
|
||||
|
||||
// ====================================================================
|
||||
// inline functions
|
||||
// ====================================================================
|
||||
|
||||
inline HepMC::GenEvent* G4HepMCInterface::GetHepMCGenEvent() const
|
||||
{
|
||||
return hepmcEvent;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4ParticleGun.hh,v 1.7 2001/11/20 23:21:41 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
|
||||
#ifndef G4ParticleGun_h
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4ParticleGunMessenger.hh,v 1.7 2002/02/26 16:34:04 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4PrimaryParticle.hh,v 1.10 2001/07/13 15:01:46 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4PrimaryTransformer.hh,v 1.6 2001/07/18 01:25:44 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
|
||||
#ifndef G4PromaryTransformer_h
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4PrimaryVertex.hh,v 1.7 2001/07/13 15:01:46 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4ScoreTable.hh,v 1.1 2002/10/28 10:06:01 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// Class G4ScoreTable
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
// This class creates a table from a given G4CellScoreStore
|
||||
// and prints it to a given output stream.
|
||||
//
|
||||
|
||||
// Author: Michael Dressel (Michael.Dressel@cern.ch)
|
||||
// ----------------------------------------------------------------------
|
||||
//
|
||||
|
||||
#ifndef G4ScoreTable_hh
|
||||
#define G4ScoreTable_hh G4ScoreTable_hh
|
||||
|
||||
#include "g4std/iostream"
|
||||
#include "g4std/iomanip"
|
||||
#include "g4std/vector"
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4CellScorerStore.hh"
|
||||
#include "G4CellScoreValues.hh"
|
||||
class G4VIStore;
|
||||
|
||||
|
||||
class G4ScoreTable
|
||||
{
|
||||
public: // with description
|
||||
explicit G4ScoreTable(const G4VIStore *aIStore = 0);
|
||||
|
||||
~G4ScoreTable();
|
||||
|
||||
void Print(const G4MapGeometryCellCellScorer &cs,
|
||||
G4std::ostream *out = 0);
|
||||
// create the table and print it to the ouput stream.
|
||||
|
||||
void PrintHeader(G4std::ostream *out);
|
||||
// print the table header, done by the above Print() function
|
||||
|
||||
void PrintTable(const G4MapGeometryCellCellScorer &cs,
|
||||
G4std::ostream *out);
|
||||
// print the table contend, done by the above Print() function
|
||||
|
||||
G4std::string FillString(const G4std::string &name,
|
||||
char c, G4int n, G4bool back = true);
|
||||
// create a string of length n, by filling up
|
||||
// name with the char c.
|
||||
|
||||
private:
|
||||
G4ScoreTable(const G4ScoreTable &);
|
||||
G4ScoreTable &operator=(const G4ScoreTable &);
|
||||
|
||||
G4String CreateName(const G4GeometryCell &gCell);
|
||||
void PrintLine(const G4String &name,
|
||||
const G4CellScoreValues &sc_scores,
|
||||
G4std::ostream *out);
|
||||
const G4VIStore *fIStore;
|
||||
G4int FieldName;
|
||||
G4int FieldValue;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,65 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4Scorer.hh,v 1.1 2002/10/28 10:06:01 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// Class G4Scorer
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
// This is a simple scorer using the G4CellScorerStore and
|
||||
// G4CellStoreScorer.
|
||||
//
|
||||
|
||||
// Author: Michael Dressel (Michael.Dressel@cern.ch)
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#ifndef G4Scorer_hh
|
||||
#define G4Scorer_hh G4Scorer_hh
|
||||
|
||||
#include "G4VScorer.hh"
|
||||
#include "G4CellScorerStore.hh"
|
||||
#include "G4CellStoreScorer.hh"
|
||||
|
||||
class G4Scorer : public G4VScorer {
|
||||
public: // with description
|
||||
G4Scorer();
|
||||
|
||||
virtual ~G4Scorer();
|
||||
|
||||
virtual void Score(const G4Step &aStep, const G4GeometryCellStep &aPStep);
|
||||
// called to score a track for every step
|
||||
|
||||
const G4MapGeometryCellCellScorer &GetMapGeometryCellCellScorer() const ;
|
||||
// returns a reference to the store containing the scores
|
||||
|
||||
private:
|
||||
G4Scorer(const G4Scorer &);
|
||||
G4Scorer &operator=(const G4Scorer &);
|
||||
G4CellScorerStore fCellScorerStore;
|
||||
G4CellStoreScorer fCellStoreScorer;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4StackManager.hh,v 1.9 2002/05/29 22:51:45 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// $Id: G4StackManager.hh,v 1.10 2002/08/24 17:36:23 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
//
|
||||
|
||||
@@ -52,9 +52,6 @@ class G4VTrajectory;
|
||||
// waiting stack, and the postpone to next event stack. The meanings
|
||||
// of each stack is descrived in the Geant4 user's manual.
|
||||
//
|
||||
// The only method the user can invoke is ReClassify(), which can
|
||||
// be used from the user's concrete class of G4UserStackingAction.
|
||||
//
|
||||
|
||||
|
||||
class G4StackManager
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4StackedTrack.hh,v 1.6 2001/07/13 15:01:47 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
//
|
||||
// Last Modification : 02/Feb/96 M.Asai
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4StackingMessenger.hh,v 1.4 2001/07/11 09:58:49 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
|
||||
#ifndef G4StackingMessenger_h
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4TrackStack.hh,v 1.5 2001/07/13 15:01:47 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
//
|
||||
// Last Modification : 09/Dec/96 M.Asai
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4TrajectoryContainer.hh,v 1.10 2002/06/08 20:36:18 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
//
|
||||
// G4TrajectoryContainer
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4UserEventAction.hh,v 1.5 2001/07/11 09:58:50 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4UserStackingAction.hh,v 1.5 2001/07/11 09:58:50 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
|
||||
#ifndef G4UserStackingAction_h
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VPrimaryGenerator.hh,v 1.6 2001/11/21 13:48:40 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
|
||||
#ifndef G4VPrimaryGenerator_h
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: eventgendefs.hh,v 1.3 2001/07/11 09:58:50 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
#ifndef EventGenerator_DEBUG
|
||||
#define EventGenerator_DEBUG
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: evmandefs.hh,v 1.3 2001/07/11 09:58:50 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
|
||||
///#define G4EVENTMANAGER_DEBUG 1
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: trajectoryControl.hh,v 1.3 2001/07/11 09:58:51 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
////#define G4_STORE_TRAJECTORY 1
|
||||
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4CellScorer.cc,v 1.2 2002/11/23 12:30:40 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
//
|
||||
// G4CellScorer.cc
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#include "G4CellScorer.hh"
|
||||
#include "G4GeometryCell.hh"
|
||||
#include "G4Track.hh"
|
||||
#include "G4EventManager.hh"
|
||||
#include "G4Event.hh"
|
||||
|
||||
G4CellScorer::G4CellScorer()
|
||||
{}
|
||||
|
||||
G4CellScorer::~G4CellScorer()
|
||||
{}
|
||||
|
||||
void G4CellScorer::ScoreAnExitingStep(const G4Step &aStep,
|
||||
const G4GeometryCell &pre_gCell){
|
||||
fCellScoreComposer.EstimatorCalculation(aStep);
|
||||
ScorePopulation(pre_gCell, aStep);
|
||||
}
|
||||
|
||||
void G4CellScorer::ScoreAnEnteringStep(const G4Step &aStep,
|
||||
const G4GeometryCell &post_gCell){
|
||||
// population counting
|
||||
ScorePopulation(post_gCell, aStep);
|
||||
// entering tracks
|
||||
fCellScoreComposer.TrackEnters();
|
||||
}
|
||||
|
||||
void G4CellScorer::ScoreAnInVolumeStep(const G4Step &aStep,
|
||||
const G4GeometryCell &post_gCell){
|
||||
// population counting
|
||||
ScorePopulation(post_gCell, aStep);
|
||||
// collisions counting
|
||||
if (aStep.GetPostStepPoint()->GetStepStatus() != fGeomBoundary) {
|
||||
fCellScoreComposer.SetCollisionWeight(aStep.GetTrack()->GetWeight());
|
||||
}
|
||||
|
||||
// counting for step length estimators
|
||||
fCellScoreComposer.EstimatorCalculation(aStep);
|
||||
|
||||
}
|
||||
|
||||
void G4CellScorer::ScorePopulation(const G4GeometryCell &post_gCell,
|
||||
const G4Step &aStep) {
|
||||
// check for new event
|
||||
fTrackLogger.SetEventID(G4EventManager::GetEventManager()->
|
||||
GetConstCurrentEvent()->
|
||||
GetEventID());
|
||||
// increase population
|
||||
if (fTrackLogger.FirstEnterance(aStep.GetTrack()->GetTrackID())) {
|
||||
fCellScoreComposer.NewTrackPopedUp();
|
||||
}
|
||||
}
|
||||
|
||||
const G4CellScoreComposer &G4CellScorer::GetCellScoreComposer() const {
|
||||
return fCellScoreComposer;
|
||||
}
|
||||
|
||||
const G4CellScoreValues &G4CellScorer::GetCellScoreValues() const {
|
||||
return fCellScoreComposer.GetStandardCellScoreValues();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4CellScorerStore.cc,v 1.2 2002/11/04 10:52:39 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
//
|
||||
// G4CellScorerStore.cc
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#include "G4CellScorerStore.hh"
|
||||
|
||||
#include "G4CellScorer.hh"
|
||||
|
||||
G4CellScorerStore::G4CellScorerStore() :
|
||||
fAutoCreate(false)
|
||||
{}
|
||||
|
||||
G4CellScorerStore::~G4CellScorerStore()
|
||||
{}
|
||||
|
||||
void G4CellScorerStore::SetAutoScorerCreate(){
|
||||
fAutoCreate = true;
|
||||
}
|
||||
|
||||
G4CellScorer *G4CellScorerStore::
|
||||
AddCellScorer(G4VPhysicalVolume &vol, G4int repnum) {
|
||||
G4CellScorer *s = 0;
|
||||
s = new G4CellScorer;
|
||||
if (!s) {
|
||||
G4Exception("ERROR:G4CellScorerStore::AddCellScorer new failed to create G4CellScorer!");
|
||||
}
|
||||
fMapGeometryCellCellScorer[G4GeometryCell(vol, repnum)] = s;
|
||||
return s;
|
||||
};
|
||||
|
||||
G4CellScorer *G4CellScorerStore::
|
||||
AddCellScorer(const G4GeometryCell &gCell) {
|
||||
G4CellScorer *s = 0;
|
||||
s = new G4CellScorer;
|
||||
if (!s) {
|
||||
G4Exception("ERROR:G4CellScorerStore::AddCellScorer new failed to create G4CellScorer!");
|
||||
}
|
||||
fMapGeometryCellCellScorer[gCell] = s;
|
||||
return s;
|
||||
};
|
||||
|
||||
const G4MapGeometryCellCellScorer &G4CellScorerStore::GetMapGeometryCellCellScorer() const {
|
||||
return fMapGeometryCellCellScorer;
|
||||
}
|
||||
|
||||
G4VCellScorer *G4CellScorerStore::
|
||||
GetCellScore(const G4GeometryCell &gCell){
|
||||
G4VCellScorer *s=0;
|
||||
G4MapGeometryCellCellScorer::iterator it = fMapGeometryCellCellScorer.find(gCell);
|
||||
if (it != fMapGeometryCellCellScorer.end()) {
|
||||
s = (*it).second;
|
||||
}
|
||||
else {
|
||||
if (fAutoCreate) {
|
||||
s = AddCellScorer(gCell);
|
||||
}
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
void G4CellScorerStore::DeleteAllScorers(){
|
||||
for(G4MapGeometryCellCellScorer::iterator it =
|
||||
fMapGeometryCellCellScorer.begin();
|
||||
it!=fMapGeometryCellCellScorer.end();
|
||||
++it){
|
||||
delete it->second;
|
||||
}
|
||||
fMapGeometryCellCellScorer.clear();
|
||||
}
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4EvManMessenger.cc,v 1.3 2001/07/11 09:58:52 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// $Id: G4EvManMessenger.cc,v 1.4 2002/12/04 18:43:15 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -40,7 +40,7 @@ G4EvManMessenger::G4EvManMessenger(G4EventManager * fEvMan)
|
||||
|
||||
abortCmd = new G4UIcmdWithoutParameter("/event/abort",this);
|
||||
abortCmd->SetGuidance("Abort current event.");
|
||||
abortCmd->AvailableForStates(EventProc);
|
||||
abortCmd->AvailableForStates(G4State_EventProc);
|
||||
|
||||
verboseCmd = new G4UIcmdWithAnInteger("/event/verbose",this);
|
||||
verboseCmd->SetGuidance("Set Verbose level of event management category.");
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Event.cc,v 1.4 2001/07/13 15:01:52 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// $Id: G4Event.cc,v 1.5 2002/08/13 18:17:53 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
|
||||
// G4Event
|
||||
@@ -40,13 +40,13 @@ G4Allocator<G4Event> anEventAllocator;
|
||||
G4Event::G4Event()
|
||||
:eventID(0),
|
||||
thePrimaryVertex(0),numberOfPrimaryVertex(0),
|
||||
HC(0),DC(0),trajectoryContainer(0)
|
||||
HC(0),DC(0),trajectoryContainer(0),eventAborted(false)
|
||||
{;}
|
||||
|
||||
G4Event::G4Event(G4int evID)
|
||||
:eventID(evID),
|
||||
thePrimaryVertex(0),numberOfPrimaryVertex(0),
|
||||
HC(0),DC(0),trajectoryContainer(0)
|
||||
HC(0),DC(0),trajectoryContainer(0),eventAborted(false)
|
||||
{;}
|
||||
|
||||
G4Event::~G4Event()
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4EventManager.cc,v 1.12 2002/05/15 05:47:49 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// $Id: G4GeneralParticleSource.cc,v 1.14 2001/10/19 16:48:28 flei Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// CHANGE HISTORY
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4HEPEvtInterface.cc,v 1.7 2001/11/20 23:21:41 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4HEPEvtParticle.cc,v 1.4 2001/07/13 15:01:53 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
|
||||
// ====================================================================
|
||||
//
|
||||
// G4HepMCAsciiReader.cc
|
||||
// $Id: G4HepMCAsciiReader.cc,v 1.2 2002/12/03 14:44:32 gcosmo Exp $
|
||||
//
|
||||
// ====================================================================
|
||||
|
||||
#ifndef WIN32 // Temporarly disabled on Windows, until CLHEP
|
||||
// will support the HepMC module
|
||||
|
||||
#include "G4HepMCAsciiReader.hh"
|
||||
#include "G4HepMCAsciiReaderMessenger.hh"
|
||||
|
||||
//#include "g4std/iostream"
|
||||
|
||||
////////////////////////////////////////
|
||||
G4HepMCAsciiReader::G4HepMCAsciiReader()
|
||||
: filename("xxx.dat"), verbose(0)
|
||||
////////////////////////////////////////
|
||||
{
|
||||
messenger= new G4HepMCAsciiReaderMessenger(this);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////
|
||||
G4HepMCAsciiReader::~G4HepMCAsciiReader()
|
||||
/////////////////////////////////////////
|
||||
{
|
||||
delete messenger;
|
||||
}
|
||||
|
||||
/////////////////////////////////////
|
||||
void G4HepMCAsciiReader::Initialize()
|
||||
/////////////////////////////////////
|
||||
{
|
||||
from.close();
|
||||
from.open(filename.c_str(), G4std::ios::in);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////
|
||||
HepMC::GenEvent* G4HepMCAsciiReader::GenerateHepMCEvent()
|
||||
/////////////////////////////////////////////////////////
|
||||
{
|
||||
HepMC::GenEvent* evt= HepMC::readGenEvent(from);
|
||||
if(evt==0) {
|
||||
return 0; // no more event
|
||||
from.close();
|
||||
}
|
||||
|
||||
if(verbose>0) evt-> print();
|
||||
|
||||
return evt;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,102 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
|
||||
// ====================================================================
|
||||
//
|
||||
// G4HepMCAsciiReaderMessenger.cc
|
||||
// $Id: G4HepMCAsciiReaderMessenger.cc,v 1.2 2002/12/03 14:44:32 gcosmo Exp $
|
||||
//
|
||||
// ====================================================================
|
||||
|
||||
#ifndef WIN32 // Temporarly disabled on Windows, until CLHEP
|
||||
// will support the HepMC module
|
||||
|
||||
#include "G4HepMCAsciiReaderMessenger.hh"
|
||||
#include "G4HepMCAsciiReader.hh"
|
||||
|
||||
#include "G4UIdirectory.hh"
|
||||
#include "G4UIcmdWithoutParameter.hh"
|
||||
#include "G4UIcmdWithAString.hh"
|
||||
#include "G4UIcmdWithAnInteger.hh"
|
||||
|
||||
////////////////////////////////////////////////////////
|
||||
G4HepMCAsciiReaderMessenger::G4HepMCAsciiReaderMessenger
|
||||
(G4HepMCAsciiReader* agen)
|
||||
: gen(agen)
|
||||
////////////////////////////////////////////////////////
|
||||
{
|
||||
dir= new G4UIdirectory("/generator/hepmcAscii/");
|
||||
dir-> SetGuidance("Reading HepMC event from an Ascii file");
|
||||
|
||||
verbose=
|
||||
new G4UIcmdWithAnInteger("/generator/hepmcAscii/verbose", this);
|
||||
verbose-> SetGuidance("Set verbose level");
|
||||
verbose-> SetParameterName("verboseLevel", false, false);
|
||||
verbose-> SetRange("verboseLevel>=0 && verboseLevel<=1");
|
||||
|
||||
open= new G4UIcmdWithAString("/generator/hepmcAscii/open", this);
|
||||
open-> SetGuidance("(re)open data file (HepMC Ascii format)");
|
||||
open-> SetParameterName("input ascii file", true, true);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
G4HepMCAsciiReaderMessenger::~G4HepMCAsciiReaderMessenger()
|
||||
///////////////////////////////////////////////////////////
|
||||
{
|
||||
delete verbose;
|
||||
delete open;
|
||||
|
||||
delete dir;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////
|
||||
void G4HepMCAsciiReaderMessenger::SetNewValue(G4UIcommand* command,
|
||||
G4String newValues)
|
||||
///////////////////////////////////////////////////////////////////
|
||||
{
|
||||
if (command==verbose) {
|
||||
int level= verbose-> GetNewIntValue(newValues);
|
||||
gen-> SetVerboseLevel(level);
|
||||
} else if (command==open) {
|
||||
gen-> SetFileName(newValues);
|
||||
G4cout << "HepMC Ascii inputfile: "
|
||||
<< gen-> GetFileName() << G4endl;
|
||||
gen-> Initialize();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
G4String G4HepMCAsciiReaderMessenger::GetCurrentValue(G4UIcommand* command)
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
{
|
||||
G4String cv;
|
||||
|
||||
if (command == verbose) {
|
||||
cv= verbose-> ConvertToString(gen-> GetVerboseLevel());
|
||||
} else if (command == open) {
|
||||
cv= gen-> GetFileName();
|
||||
}
|
||||
return cv;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,145 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
|
||||
// ====================================================================
|
||||
//
|
||||
// G4HepMCInterface.cc
|
||||
// $Id: G4HepMCInterface.cc,v 1.2 2002/12/03 14:44:33 gcosmo Exp $
|
||||
//
|
||||
// ====================================================================
|
||||
|
||||
#ifndef WIN32 // Temporarly disabled on Windows, until CLHEP
|
||||
// will support the HepMC module
|
||||
|
||||
#include "G4HepMCInterface.hh"
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4LorentzVector.hh"
|
||||
#include "G4Event.hh"
|
||||
#include "G4PrimaryParticle.hh"
|
||||
#include "G4PrimaryVertex.hh"
|
||||
#include "G4TransportationManager.hh"
|
||||
|
||||
////////////////////////////////////
|
||||
G4HepMCInterface::G4HepMCInterface()
|
||||
: hepmcEvent(0)
|
||||
////////////////////////////////////
|
||||
{
|
||||
}
|
||||
|
||||
/////////////////////////////////////
|
||||
G4HepMCInterface::~G4HepMCInterface()
|
||||
/////////////////////////////////////
|
||||
{
|
||||
delete hepmcEvent;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////
|
||||
G4bool G4HepMCInterface::CheckVertexInsideWorld
|
||||
(const G4ThreeVector& pos) const
|
||||
/////////////////////////////////////////////////////////
|
||||
{
|
||||
G4Navigator* navigator= G4TransportationManager::GetTransportationManager()
|
||||
-> GetNavigatorForTracking();
|
||||
|
||||
G4VPhysicalVolume* world= navigator-> GetWorldVolume();
|
||||
G4VSolid* solid= world-> GetLogicalVolume()-> GetSolid();
|
||||
EInside qinside= solid-> Inside(pos);
|
||||
|
||||
if( qinside != kInside) return false;
|
||||
else return true;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
void G4HepMCInterface::HepMC2G4(const HepMC::GenEvent* hepmcevt,
|
||||
G4Event* g4event)
|
||||
////////////////////////////////////////////////////////////////
|
||||
{
|
||||
for(HepMC::GenEvent::vertex_const_iterator vitr= hepmcevt->vertices_begin();
|
||||
vitr != hepmcevt->vertices_end(); ++vitr ) { // loop for vertex ...
|
||||
|
||||
// real vertex?
|
||||
G4bool qvtx=false;
|
||||
for (HepMC::GenVertex::particle_iterator
|
||||
pitr= (*vitr)->particles_begin(HepMC::children);
|
||||
pitr != (*vitr)->particles_end(HepMC::children); ++pitr) {
|
||||
|
||||
if (!(*pitr)->end_vertex() && (*pitr)->status()==1) {
|
||||
qvtx=true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!qvtx) continue;
|
||||
|
||||
// check world boundary
|
||||
G4LorentzVector xvtx= (*vitr)-> position();
|
||||
if (! CheckVertexInsideWorld(xvtx.vect()*mm)) continue;
|
||||
|
||||
// create G4PrimaryVertex and associated G4PrimaryParticles
|
||||
G4PrimaryVertex* g4vtx=
|
||||
new G4PrimaryVertex(xvtx.x()*mm, xvtx.y()*mm, xvtx.z()*mm,
|
||||
xvtx.t()*mm/c_light);
|
||||
|
||||
for (HepMC::GenVertex::particle_iterator
|
||||
vpitr= (*vitr)->particles_begin(HepMC::children);
|
||||
vpitr != (*vitr)->particles_end(HepMC::children); ++vpitr) {
|
||||
|
||||
if( (*vpitr)->status() != 1 ) continue;
|
||||
|
||||
G4int pdgcode= (*vpitr)-> pdg_id();
|
||||
G4LorentzVector p= (*vpitr)-> momentum();
|
||||
G4PrimaryParticle* g4prim=
|
||||
new G4PrimaryParticle(pdgcode, p.x()*GeV, p.y()*GeV, p.z()*GeV);
|
||||
|
||||
g4vtx-> SetPrimary(g4prim);
|
||||
}
|
||||
g4event-> AddPrimaryVertex(g4vtx);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////
|
||||
HepMC::GenEvent* G4HepMCInterface::GenerateHepMCEvent()
|
||||
///////////////////////////////////////////////////////
|
||||
{
|
||||
HepMC::GenEvent* aevent= new HepMC::GenEvent();
|
||||
return aevent;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
void G4HepMCInterface::GeneratePrimaryVertex(G4Event* anEvent)
|
||||
//////////////////////////////////////////////////////////////
|
||||
{
|
||||
// delete previous event object
|
||||
delete hepmcEvent;
|
||||
|
||||
// generate next event
|
||||
hepmcEvent= GenerateHepMCEvent();
|
||||
if(! hepmcEvent) {
|
||||
G4Exception("G4HepMCInterface","GeneratePrimaryVertex",RunMustBeAborted,
|
||||
"HepMCInterface: no generated particles. run terminated..." );
|
||||
return;
|
||||
}
|
||||
HepMC2G4(hepmcEvent, anEvent);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4ParticleGun.cc,v 1.6 2001/11/20 23:21:41 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
|
||||
// G4ParticleGun
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4ParticleGunMessenger.cc,v 1.8 2002/02/26 16:34:06 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
|
||||
#include "G4ParticleGunMessenger.hh"
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4PrimaryParticle.cc,v 1.7 2001/07/13 15:01:54 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// $Id: G4PrimaryParticle.cc,v 1.9 2002/08/19 20:20:18 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
|
||||
#include "G4PrimaryParticle.hh"
|
||||
@@ -35,33 +35,38 @@ G4Allocator<G4PrimaryParticle> aPrimaryParticleAllocator;
|
||||
G4PrimaryParticle::G4PrimaryParticle()
|
||||
:PDGcode(0),G4code(0),Px(0.),Py(0.),Pz(0.),
|
||||
nextParticle(0),daughterParticle(0),trackID(-1),
|
||||
mass(0.),polX(0.),polY(0.),polZ(0.),Weight0(1.0),properTime(0.0)
|
||||
mass(0.),charge(DBL_MAX),polX(0.),polY(0.),polZ(0.),
|
||||
Weight0(1.0),properTime(0.0)
|
||||
{;}
|
||||
|
||||
G4PrimaryParticle::G4PrimaryParticle(G4int Pcode)
|
||||
:PDGcode(Pcode),Px(0.),Py(0.),Pz(0.),
|
||||
nextParticle(0),daughterParticle(0),trackID(-1),
|
||||
mass(0.),polX(0.),polY(0.),polZ(0.),Weight0(1.0),properTime(0.0)
|
||||
mass(0.),charge(DBL_MAX),polX(0.),polY(0.),polZ(0.),
|
||||
Weight0(1.0),properTime(0.0)
|
||||
{ G4code = G4ParticleTable::GetParticleTable()->FindParticle(Pcode); }
|
||||
|
||||
G4PrimaryParticle::G4PrimaryParticle(G4int Pcode,
|
||||
G4double px,G4double py,G4double pz)
|
||||
:PDGcode(Pcode),Px(px),Py(py),Pz(pz),
|
||||
nextParticle(0),daughterParticle(0),trackID(-1),
|
||||
mass(0.),polX(0.),polY(0.),polZ(0.),Weight0(1.0),properTime(0.0)
|
||||
mass(0.),charge(DBL_MAX),polX(0.),polY(0.),polZ(0.),
|
||||
Weight0(1.0),properTime(0.0)
|
||||
{ G4code = G4ParticleTable::GetParticleTable()->FindParticle(Pcode); }
|
||||
|
||||
G4PrimaryParticle::G4PrimaryParticle(G4ParticleDefinition* Gcode)
|
||||
:G4code(Gcode),Px(0.),Py(0.),Pz(0.),
|
||||
nextParticle(0),daughterParticle(0),trackID(-1),
|
||||
mass(0.),polX(0.),polY(0.),polZ(0.),Weight0(1.0),properTime(0.0)
|
||||
mass(0.),charge(DBL_MAX),polX(0.),polY(0.),polZ(0.),
|
||||
Weight0(1.0),properTime(0.0)
|
||||
{ PDGcode = Gcode->GetPDGEncoding(); }
|
||||
|
||||
G4PrimaryParticle::G4PrimaryParticle(G4ParticleDefinition* Gcode,
|
||||
G4double px,G4double py,G4double pz)
|
||||
:G4code(Gcode),Px(px),Py(py),Pz(pz),
|
||||
nextParticle(0),daughterParticle(0),trackID(-1),
|
||||
mass(0.),polX(0.),polY(0.),polZ(0.),Weight0(1.0),properTime(0.0)
|
||||
mass(0.),charge(DBL_MAX),polX(0.),polY(0.),polZ(0.),
|
||||
Weight0(1.0),properTime(0.0)
|
||||
{ PDGcode = Gcode->GetPDGEncoding(); }
|
||||
|
||||
G4PrimaryParticle::~G4PrimaryParticle()
|
||||
@@ -98,7 +103,11 @@ void G4PrimaryParticle::Print() const
|
||||
if(G4code != 0)
|
||||
{ G4cout << G4code->GetParticleName() << G4endl; }
|
||||
else
|
||||
{ G4cout << "is not defined in G4." << G4endl; }
|
||||
{ G4cout << " is not defined in G4." << G4endl; }
|
||||
if(charge<DBL_MAX)
|
||||
{ G4cout << " Assigned charge : " << charge << G4endl; }
|
||||
else
|
||||
{ G4cout << " Charge will be taken from PDG charge." << G4endl; }
|
||||
G4cout << " Momentum ( " << Px << ", " << Py << ", " << Pz << " )" << G4endl;
|
||||
G4cout << " Polarization ( " << polX << ", " << polY << ", "
|
||||
<< polZ << " )" << G4endl;
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4PrimaryTransformer.cc,v 1.14 2002/01/23 03:20:38 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// $Id: G4PrimaryTransformer.cc,v 1.15 2002/08/19 20:20:18 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
|
||||
#include "G4PrimaryTransformer.hh"
|
||||
@@ -129,8 +129,8 @@ void G4PrimaryTransformer::GenerateSingleTrack
|
||||
primaryParticle->GetPolZ());
|
||||
if(primaryParticle->GetProperTime()>0.0)
|
||||
{ DP->SetPreAssignedDecayProperTime(primaryParticle->GetProperTime()); }
|
||||
// Set Charge
|
||||
if (abs(primaryParticle->GetCharge()-DP->GetCharge())>eplus) {
|
||||
// Set Charge is specified
|
||||
if (primaryParticle->GetCharge()<DBL_MAX) {
|
||||
DP->SetCharge(primaryParticle->GetCharge());
|
||||
}
|
||||
// Set decay products to the DynamicParticle
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4PrimaryVertex.cc,v 1.5 2001/07/13 15:01:54 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
|
||||
#include "G4PrimaryVertex.hh"
|
||||
|
||||
@@ -0,0 +1,186 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4ScoreTable.cc,v 1.2 2002/11/04 10:52:39 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
//
|
||||
// G4ScoreTable.cc
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#include "G4ScoreTable.hh"
|
||||
#include "g4std/strstream"
|
||||
|
||||
#include "G4VPhysicalVolume.hh"
|
||||
#include "G4VIStore.hh"
|
||||
#include "g4std/set"
|
||||
#include "G4CellScorer.hh"
|
||||
|
||||
|
||||
G4ScoreTable::G4ScoreTable(const G4VIStore *aIStore) :
|
||||
fIStore(aIStore),
|
||||
FieldName(25),
|
||||
FieldValue(12)
|
||||
{}
|
||||
|
||||
G4ScoreTable::~G4ScoreTable()
|
||||
{}
|
||||
void G4ScoreTable::
|
||||
Print(const G4MapGeometryCellCellScorer &cs,
|
||||
G4std::ostream *out){
|
||||
if (!out) {
|
||||
out = &G4cout;
|
||||
}
|
||||
PrintHeader(out);
|
||||
PrintTable(cs, out);
|
||||
}
|
||||
|
||||
void G4ScoreTable::PrintHeader(G4std::ostream *out)
|
||||
{
|
||||
G4std::vector<G4String> vecScoreName;
|
||||
vecScoreName.push_back("Importance");
|
||||
vecScoreName.push_back("Tr.Entering");
|
||||
vecScoreName.push_back("Population");
|
||||
vecScoreName.push_back("Collisions");
|
||||
vecScoreName.push_back("Coll*WGT");
|
||||
vecScoreName.push_back("NumWGTedE");
|
||||
vecScoreName.push_back("FluxWGTedE");
|
||||
vecScoreName.push_back("Av.Tr.WGT");
|
||||
|
||||
// head line
|
||||
G4std::string vname = FillString("Volume name", ' ', FieldName+1);
|
||||
*out << vname << '|';
|
||||
for (G4std::vector<G4String>::iterator it = vecScoreName.begin();
|
||||
it != vecScoreName.end(); it++) {
|
||||
vname = FillString((*it),
|
||||
' ',
|
||||
FieldValue+1,
|
||||
false);
|
||||
*out << vname << '|';
|
||||
}
|
||||
*out << G4endl;
|
||||
}
|
||||
|
||||
G4String G4ScoreTable::CreateName(const G4GeometryCell &gCell) {
|
||||
|
||||
char st[200];
|
||||
G4std::ostrstream os(st,200);
|
||||
os << gCell.GetPhysicalVolume().GetName()
|
||||
<< "_rep:" << gCell.GetReplicaNumber()
|
||||
<< '\0';
|
||||
G4String name(st);
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
|
||||
void G4ScoreTable::PrintTable(const G4MapGeometryCellCellScorer &mcs,
|
||||
G4std::ostream *out) {
|
||||
|
||||
// this lines sort the ScoreValues according to the volume
|
||||
// name they belong to
|
||||
G4std::map<G4String , G4CellScoreComposer> MapStringSCScorer;
|
||||
for (G4MapGeometryCellCellScorer::const_iterator mit =
|
||||
mcs.begin();
|
||||
mit != mcs.end(); ++mit) {
|
||||
G4GeometryCell gCell = (*mit).first; // get a key identifying a volume
|
||||
G4String name(CreateName(gCell));
|
||||
|
||||
G4double importance = 1;
|
||||
if (fIStore) {
|
||||
if (fIStore->IsKnown(gCell)) {
|
||||
importance = fIStore->GetImportance(gCell);
|
||||
}
|
||||
}
|
||||
MapStringSCScorer[name] = (*mit).second->GetCellScoreComposer();
|
||||
MapStringSCScorer[name].SetImportnace(importance);
|
||||
}
|
||||
// now do the printing
|
||||
for ( G4std::map<G4String , G4CellScoreComposer>::iterator
|
||||
it = MapStringSCScorer.begin();
|
||||
it != MapStringSCScorer.end(); ++it) {
|
||||
G4String name((*it).first);
|
||||
PrintLine(name, (*it).second.GetStandardCellScoreValues(), out);
|
||||
}
|
||||
*out << '\0';
|
||||
out->flush();
|
||||
}
|
||||
|
||||
void G4ScoreTable::PrintLine(const G4String &name,
|
||||
const G4CellScoreValues &sc_scores,
|
||||
G4std::ostream *out)
|
||||
{
|
||||
G4std::string fname = FillString(name, '.', FieldName);
|
||||
*out << fname << " |";
|
||||
*out << G4std::setw(FieldValue) << sc_scores.fImportance
|
||||
<< " |";
|
||||
*out << G4std::setw(FieldValue) << sc_scores.fSumTracksEntering
|
||||
<< " |";
|
||||
*out << G4std::setw(FieldValue) << sc_scores.fSumPopulation << " |";
|
||||
*out << G4std::setw(FieldValue) << sc_scores.fSumCollisions << " |";
|
||||
*out << G4std::setw(FieldValue) << sc_scores.fSumCollisionsWeight
|
||||
<< " |";
|
||||
*out << G4std::setw(FieldValue) << sc_scores.fNumberWeightedEnergy
|
||||
<< " |";
|
||||
*out << G4std::setw(FieldValue) << sc_scores.fFluxWeightedEnergy
|
||||
<< " |";
|
||||
*out << G4std::setw(FieldValue) << sc_scores.fAverageTrackWeight*
|
||||
sc_scores.fImportance
|
||||
<< " |";
|
||||
|
||||
*out << G4endl;
|
||||
}
|
||||
|
||||
|
||||
G4std::string G4ScoreTable::FillString(const G4std::string &name,
|
||||
char c, G4int n, G4bool back)
|
||||
{
|
||||
G4std::string fname("");
|
||||
G4int k = n - name.size();
|
||||
if (k > 0) {
|
||||
if (back) {
|
||||
fname = name;
|
||||
fname += G4std::string(k,c);
|
||||
}
|
||||
else {
|
||||
fname = G4std::string(k,c);
|
||||
fname += name;
|
||||
}
|
||||
}
|
||||
else {
|
||||
fname = name;
|
||||
}
|
||||
return fname;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4Scorer.cc,v 1.1 2002/10/28 10:06:01 dressel Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
//
|
||||
// G4Scorer.cc
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#include "G4Scorer.hh"
|
||||
|
||||
G4Scorer::G4Scorer()
|
||||
:
|
||||
fCellStoreScorer(fCellScorerStore)
|
||||
{
|
||||
fCellScorerStore.SetAutoScorerCreate();
|
||||
}
|
||||
|
||||
G4Scorer::~G4Scorer()
|
||||
{
|
||||
}
|
||||
|
||||
void G4Scorer::Score(const G4Step &aStep, const G4GeometryCellStep &aPStep){
|
||||
fCellStoreScorer.Score(aStep, aPStep);
|
||||
}
|
||||
|
||||
const G4MapGeometryCellCellScorer &G4Scorer::GetMapGeometryCellCellScorer() const {
|
||||
return fCellScorerStore.GetMapGeometryCellCellScorer();
|
||||
}
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4StackManager.cc,v 1.7 2002/05/29 22:51:45 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// $Id: G4StackManager.cc,v 1.8 2002/12/03 17:04:22 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
//
|
||||
// Last Modification : 09/Dec/96 M.Asai
|
||||
@@ -99,8 +99,6 @@ G4int G4StackManager::PushOneTrack(G4Track *newTrack,G4VTrajectory *newTrajector
|
||||
case fPostpone:
|
||||
postponeStack->PushToStack( newStackedTrack );
|
||||
break;
|
||||
case fKill:
|
||||
break;
|
||||
default:
|
||||
G4int i = classification - 10;
|
||||
if(i<1||i>numberOfAdditionalWaitingStacks) {
|
||||
@@ -245,6 +243,7 @@ G4int G4StackManager::PrepareNewEvent()
|
||||
if(classification==fKill)
|
||||
{
|
||||
delete aTrack;
|
||||
delete aStackedTrack->GetTrajectory();
|
||||
delete aStackedTrack;
|
||||
}
|
||||
else
|
||||
@@ -261,8 +260,6 @@ G4int G4StackManager::PrepareNewEvent()
|
||||
case fPostpone:
|
||||
postponeStack->PushToStack( aStackedTrack );
|
||||
break;
|
||||
case fKill:
|
||||
break;
|
||||
default:
|
||||
G4int i = classification - 10;
|
||||
if(i<1||i>numberOfAdditionalWaitingStacks) {
|
||||
@@ -329,6 +326,7 @@ void G4StackManager::TransferStackedTracks(G4ClassificationOfNewTrack origin, G4
|
||||
while( (aStackedTrack=originStack->PopFromStack()) != 0 )
|
||||
{
|
||||
delete aStackedTrack->GetTrack();
|
||||
delete aStackedTrack->GetTrajectory();
|
||||
delete aStackedTrack;
|
||||
}
|
||||
}
|
||||
@@ -387,6 +385,7 @@ void G4StackManager::TransferOneStackedTrack(G4ClassificationOfNewTrack origin,
|
||||
if( (aStackedTrack=originStack->PopFromStack()) != 0 )
|
||||
{
|
||||
delete aStackedTrack->GetTrack();
|
||||
delete aStackedTrack->GetTrajectory();
|
||||
delete aStackedTrack;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4StackedTrack.cc,v 1.5 2001/07/13 15:01:55 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
//
|
||||
// Last Modification : 02/Feb/96 M.Asai
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4StackingMessenger.cc,v 1.3 2001/07/11 09:58:54 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// $Id: G4StackingMessenger.cc,v 1.4 2002/12/04 18:43:15 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -52,7 +52,7 @@ G4StackingMessenger::G4StackingMessenger(G4StackManager * fCont)
|
||||
clearCmd->SetParameterName("level",true);
|
||||
clearCmd->SetDefaultValue(0);
|
||||
clearCmd->SetRange("level>=-2&&level<=2");
|
||||
clearCmd->AvailableForStates(GeomClosed,EventProc);
|
||||
clearCmd->AvailableForStates(G4State_GeomClosed,G4State_EventProc);
|
||||
}
|
||||
|
||||
G4StackingMessenger::~G4StackingMessenger()
|
||||
|
||||
@@ -21,21 +21,35 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4TrackStack.cc,v 1.4 2001/07/13 15:01:55 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// Last Modification : 09/Dec/96 M.Asai
|
||||
// $Id: G4TrackStack.cc,v 1.5 2002/12/03 17:04:22 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
|
||||
#include "G4TrackStack.hh"
|
||||
#include "G4VTrajectory.hh"
|
||||
|
||||
G4TrackStack::G4TrackStack()
|
||||
:n_stackedTrack(0),firstStackedTrack(0),lastStackedTrack(0)
|
||||
{;}
|
||||
|
||||
G4TrackStack::~G4TrackStack()
|
||||
{;}
|
||||
{
|
||||
if( n_stackedTrack != 0 )
|
||||
{
|
||||
G4StackedTrack * aStackedTrack = firstStackedTrack;
|
||||
G4StackedTrack * nextStackedTrack;
|
||||
|
||||
// delete tracks in the stack
|
||||
while( aStackedTrack != 0 )
|
||||
{
|
||||
nextStackedTrack = aStackedTrack->GetNext();
|
||||
delete aStackedTrack->GetTrack();
|
||||
delete aStackedTrack->GetTrajectory();
|
||||
delete aStackedTrack;
|
||||
aStackedTrack = nextStackedTrack;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const G4TrackStack & G4TrackStack::operator=(const G4TrackStack &right)
|
||||
{
|
||||
@@ -140,6 +154,7 @@ void G4TrackStack::clear()
|
||||
{
|
||||
nextStackedTrack = aStackedTrack->GetNext();
|
||||
delete aStackedTrack->GetTrack();
|
||||
delete aStackedTrack->GetTrajectory();
|
||||
delete aStackedTrack;
|
||||
aStackedTrack = nextStackedTrack;
|
||||
}
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4TrajectoryContainer.cc,v 1.1 2002/05/15 05:47:49 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// $Id: G4TrajectoryContainer.cc,v 1.2 2002/10/06 11:46:48 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
|
||||
#include "G4TrajectoryContainer.hh"
|
||||
@@ -32,7 +32,8 @@ G4TrajectoryContainer::G4TrajectoryContainer()
|
||||
{ vect = new TrajectoryVector; }
|
||||
|
||||
G4TrajectoryContainer::~G4TrajectoryContainer()
|
||||
{ delete vect; }
|
||||
{ clearAndDestroy();
|
||||
delete vect; }
|
||||
|
||||
G4int G4TrajectoryContainer::operator==(const G4TrajectoryContainer& right) const
|
||||
{ return (this==&right); }
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4UserEventAction.cc,v 1.4 2001/07/11 09:58:54 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
|
||||
#include "G4UserEventAction.hh"
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4UserStackingAction.cc,v 1.4 2001/07/11 09:58:54 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
|
||||
#include "G4UserStackingAction.hh"
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VPrimaryGenerator.cc,v 1.3 2001/07/11 09:58:54 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
//
|
||||
|
||||
// G4VPrimaryGenerator
|
||||
|
||||
Reference in New Issue
Block a user