Import Geant4 5.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 16:57:27 +02:00
parent 330b82b769
commit 37fff30d2e
5733 changed files with 263867 additions and 74574 deletions
+12 -34
View File
@@ -1,4 +1,4 @@
# $Id: GNUmakefile,v 1.35 2001/12/13 11:38:48 gcosmo Exp $
# $Id: GNUmakefile,v 1.38 2002/11/25 11:58:25 gcosmo Exp $
# -----------------------------------------------------------------
# "gmake" makes default libraries for each subdomain.
# "gmake global" makes global libraries for each subdomain.
@@ -12,12 +12,11 @@
#
# (The .o files(s) are made by implicit rules.)
MAKEFLAGS= --no-print-directory
SUBDIR1 = global particles processes geometry digits+hits
SUBDIR2 = event tracking track materials run graphics_reps intercoms parameterisations readout
SUBDIR3 = g3tog4 interfaces visualization
SUBDIR4 = persistency
SUBDIR1 = global particles processes geometry digits+hits
SUBDIR2 = event tracking track materials run graphics_reps intercoms
SUBDIR2 += parameterisations persistency readout
SUBDIR3 = interfaces visualization
SUBDIR4 = g3tog4
ifndef G4INSTALL
G4INSTALL = ..
@@ -32,34 +31,20 @@ unique := $(shell echo $$$$)
.PHONY: all glob global libmap includes clean_libs clean clean_all
all:
ifdef G4USE_HEPODBMS
@$(ECHO) Making granular libraries with HepODBMS option ...
@for dir in $(SUBDIR4); do (cd $$dir && $(MAKE) cleandb); done;:
@if [ ! -f $(G4LIBDIR)/schema/G4SCHEMA ] ; then \
$(ECHO) "Temporary boot file does not exist. Stop." ; exit 1 ; \
fi
endif
@for dir in $(SUBDIR1); do (cd $$dir && $(MAKE)); done;:
@for dir in $(SUBDIR2); do (cd $$dir && $(MAKE)); done;:
@for dir in $(SUBDIR3); do (cd $$dir && $(MAKE)); done;:
ifdef G4USE_HEPODBMS
ifdef G4USE_G3TOG4
@for dir in $(SUBDIR4); do (cd $$dir && $(MAKE)); done;:
endif
$(MAKE) libmap
glob global:
ifdef G4USE_HEPODBMS
@$(ECHO) Making global libraries with HepODBMS option ...
@for dir in $(SUBDIR4); do (cd $$dir && $(MAKE) cleandb); done;:
@if [ ! -f $(G4LIBDIR)/schema/G4SCHEMA ] ; then \
$(ECHO) "Temporary boot file does not exist. Stop." ; exit 1 ; \
fi
endif
@for dir in $(SUBDIR1); do (cd $$dir && $(MAKE) global); done;:
@for dir in $(SUBDIR2); do (cd $$dir && $(MAKE)); done;:
@for dir in $(SUBDIR3); do (cd $$dir && $(MAKE)); done;:
ifdef G4USE_HEPODBMS
@for dir in $(SUBDIR4); do (cd $$dir && $(MAKE) && $(MAKE) global); done;:
ifdef G4USE_G3TOG4
@for dir in $(SUBDIR4); do (cd $$dir && $(MAKE)); done;:
endif
@@ -111,7 +96,7 @@ includes:
@for dir in $(SUBDIR1); do (cd $$dir && $(MAKE) $@); done
@for dir in $(SUBDIR2); do (cd $$dir && $(MAKE) $@); done
@for dir in $(SUBDIR3); do (cd $$dir && $(MAKE) $@); done
ifdef G4USE_HEPODBMS
ifdef G4USE_G3TOG4
@for dir in $(SUBDIR4); do (cd $$dir && $(MAKE) $@); done
endif
@@ -120,8 +105,8 @@ clean_libs:
@for dir in $(SUBDIR1); do (cd $$dir && $(MAKE) clean_libs); done
@for dir in $(SUBDIR2); do (cd $$dir && $(MAKE) clean_libs); done
@for dir in $(SUBDIR3); do (cd $$dir && $(MAKE) clean_libs); done
ifdef G4USE_HEPODBMS
@for dir in $(SUBDIR4); do (cd $$dir && $(MAKE) $@ cleandb); done
ifdef G4USE_G3TOG4
@for dir in $(SUBDIR4); do (cd $$dir && $(MAKE) clean_libs); done
endif
@rm -rf $(G4LIBDIR)/libname.map
@@ -131,9 +116,6 @@ clean:
@rm -rf $(G4LIBDIR)
@rm -rf $(G4BINDIR)
@rm -rf $(G4INSTALL)/.config/bin/$(G4SYSTEM)
ifdef G4USE_HEPODBMS
@for dir in $(SUBDIR4); do (cd $$dir && $(MAKE) $@ cleandb); done
endif
ifdef CFRONT
@rm -rf $(G4TREP)
endif
@@ -150,9 +132,5 @@ clean_all:
@rm -rf $(G4BIN)
@echo Removing $(G4INCLUDE) ...
@rm -rf $(G4INCLUDE)
ifdef G4USE_HEPODBMS
@echo Removing ODBMS federations and directories ...
@rm -rf $(G4INSTALL)/exampleSchema $(G4INSTALL)/exampleFD
endif
@echo Removing installation configurations ...
@rm -rf $(G4INSTALL)/.config
+34 -1
View File
@@ -1,4 +1,4 @@
$Id: History,v 1.5 2001/07/13 15:00:02 gcosmo Exp $
$Id: History,v 1.16 2002/11/27 19:03:42 asaim Exp $
-------------------------------------------------------------------
=========================================================
@@ -17,6 +17,39 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
Nov 27, 2002, M.Asai (digits_hits-V04-01-05)
- Fix memory leak in G4SDManager.
Nov 18, 2002, M.Asai (digits_hits-V04-01-04)
- Tag for Geant4 5.0 release.
Nov 04, 2002, G.Cosmo (digits_hits-V04-01-03)
- Fixed compilation errors on SUN-CC (usage of G4std:: namespace) in
"detector" module. (M.Dressel)
Nov 01, 2002, M.Asai (digits_hits-V04-01-02)
- Tag for Geant4 5.0 tag-set#1.
Nov 1, 2002, J.Allison (digits+hits-V04-01-01 - does not include V04-01-00)
- Canonical tag of hits-traj03a.
Oct 30, 2002, M.Asai/J.Allison (hits-traj03a)
- Added default implementation of G4VHitsCollection::GetHit and GetSize.
Oct 28, 2002, J.Allison (hits-traj03 - does *not* include digits_hits-V04-01-00)
- Changed GetAttDefs return signature to map.
- Changed GetAttValues to CreateAttValues.
- Improved description in G4VHit.
Oct 24, 2002, M.Asai/J.Allison (hits-traj02)
- Added virtual const G4std::vector<G4AttDef>* GetAttDefs/Values to G4VHit.hh.
- Added GetHit and GetSize to G4VHitsCollection.
Oct 23, 2002, M.Dressel (digits_hits-V04-01-00)
- Added classes for event scoring in module "detector":
G4CellScoreComposer[.hh.cc], G4CellScoreValues.hh,
G4CellStoreScorer[.hh.cc], G4TrackLogger[.hh.cc].
Jul 13, 2001, G.Cosmo (digits+hits-V03-02-00)
- Cleanup of pedantic warnings in Linux-g++ ANSI setup.
- Corrected "int" to "G4int".
+2 -1
View File
@@ -1,4 +1,4 @@
# $Id: GNUmakefile,v 1.2 2000/01/31 09:36:55 gcosmo Exp $
# $Id: GNUmakefile,v 1.3 2002/10/28 10:01:49 dressel Exp $
# --------------------------------------------------------------
# GNUmakefile for digits+hits library. Makoto Asai, 1/11/96.
# --------------------------------------------------------------
@@ -19,6 +19,7 @@ CPPFLAGS += \
-I$(G4BASE)/particles/management/include \
-I$(G4BASE)/materials/include \
-I$(G4BASE)/geometry/management/include \
-I$(G4BASE)/geometry/biasing/include \
-I$(G4BASE)/geometry/volumes/include \
-I$(G4BASE)/digits+hits/hits/include \
-I$(G4BASE)/intercoms/include
+8 -1
View File
@@ -1,4 +1,4 @@
$Id: History,v 1.1 1999/01/07 16:06:24 gunter Exp $
$Id: History,v 1.4 2002/11/04 10:51:49 dressel Exp $
-------------------------------------------------------------------
=========================================================
@@ -17,5 +17,12 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
Nov, 4th 2002 M.Dressel
- remove G4std:: where it does not belong to
Oct 28th, 2002 M.Dressel
- added G4CellScoreComposer[.hh.cc], G4CellScoreValues.hh,
G4CellStoreScorer[.hh.cc], G4TrackLogger[.hh.cc]
June 6, 98 M.Asai
- Created.
@@ -0,0 +1,86 @@
//
// ********************************************************************
// * 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: G4CellScoreComposer.hh,v 1.1 2002/10/28 10:01:50 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
// ----------------------------------------------------------------------
// Class G4CellScoreComposer
//
// Class description:
// This class will be created for every cell standard
// scoring should be applied. It does the actual scoring.
// GetStandardCellScoreValues() delivers the struct
// G4CellScoreValues does calculations based on the
// sums of scores and delivers the results in
// G4CellScoreValues.
//
// Author: Michael Dressel (Michael.Dressel@cern.ch)
// ----------------------------------------------------------------------
#ifndef G4CellScoreComposer_hh
#define G4CellScoreComposer_hh G4CellScoreComposer_hh
#include "G4CellScoreValues.hh"
class G4Step;
class G4CellScoreComposer {
public: // with description
G4CellScoreComposer();
~G4CellScoreComposer();
void EstimatorCalculation(const G4Step &step);
// get values for estimators based on
// track length
void TrackEnters();
// to be called if a track enters the cell
void NewTrackPopedUp();
// to be caled if the cell popultion is increased
void SetCollisionWeight(G4double weight);
// to be called for every collision
// in the cell with the weight of the colliding particle
void SetImportnace(G4double importance);
// informs G4CellScoreComposer about the importance of the cell
const G4CellScoreValues &GetStandardCellScoreValues() const;
// return scores in G4CellScoreValues
private:
mutable G4CellScoreValues fSCScoreValues;
};
G4std::ostream& operator<<(G4std::ostream &out,
const G4CellScoreComposer &ps);
#endif
@@ -0,0 +1,59 @@
//
// ********************************************************************
// * 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: G4CellScoreValues.hh,v 1.1 2002/10/28 10:01:50 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
// ----------------------------------------------------------------------
// Class G4CellScoreValues
//
// Class description:
// This struct holds sums of scores for standard scoring.
//
//
// Author: Michael Dressel (Michael.Dressel@cern.ch)
// ----------------------------------------------------------------------
#ifndef G4CellScoreValues_hh
#define G4CellScoreValues_hh G4CellScoreValues_hh
#include "globals.hh"
struct G4CellScoreValues {
G4double fSumSL;
G4double fSumSLW;
G4double fSumSLW_v;
G4double fSumSLWE;
G4double fSumSLWE_v;
G4int fSumTracksEntering;
G4int fSumPopulation;
G4int fSumCollisions;
G4double fSumCollisionsWeight;
G4double fNumberWeightedEnergy;
G4double fFluxWeightedEnergy;
G4double fAverageTrackWeight;
G4double fImportance;
};
#endif
@@ -20,57 +20,54 @@
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: G4PScorer.hh,v 1.5 2002/04/10 13:14:16 dressel Exp $
// GEANT4 tag $Name: geant4-04-01 $
// $Id: G4CellStoreScorer.hh,v 1.1 2002/10/28 10:01:50 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
// ----------------------------------------------------------------------
// Class G4PScorer
// Class G4CellStoreScorer
//
// Class description:
//
// This class invokes a G4VCellScorer according to the current
// step:
// - pre and post step are in a volume -> chose post gCell (cell)
// and call ScoreInVolume
// - cross boundary between gCells (cells)
// call ScoreAnExtingStep on the pre cell
// and ScoreAnEnteringStep on the post cell.
//
// A scorer for standard tallies. Under development.
// See also G4VPScorer.
// It scores using informations form G4Step and G4PStep.
// The tallies are contained and related with "cells"
// in the container G4PMapPtkTallys (see G4PMapPtkTallys.hh)
// Author: Michael Dressel (Michael.Dressel@cern.ch)
// ----------------------------------------------------------------------
#ifndef G4Pscorer_hh
#define G4Pscorer_hh G4Pscorer_hh
//
#include "g4std/iostream"
#ifndef G4CellStoreScorer_hh
#define G4CellStoreScorer_hh G4CellStoreScorer_hh
#include "G4VPScorer.hh"
#include "G4PMapPtkTallys.hh"
#include "G4VScorer.hh"
class G4VCellScorerStore;
class G4Step;
class G4PStep;
class G4GeometryCellStep;
class G4GeometryCell;
class G4PScorer : public G4VPScorer
class G4CellStoreScorer : public G4VScorer
{
public: // with description
explicit G4CellStoreScorer(G4VCellScorerStore &csc);
// take a G4VCellScorerStore created by the user to score
// the cells contained in it.
public: // with description
G4PScorer();
// simple construction
~G4PScorer();
// simple destruction
void Score(const G4Step &aStep, const G4PStep &aPStep);
// perform scoring for the G4Step and G4PStep
virtual ~G4CellStoreScorer();
virtual void Score(const G4Step &aStep, const G4GeometryCellStep &aPStep);
// called to score a track for every step
const G4PMapPtkTallys &GetMapPtkTallys() const {return fPtkTallys;}
// get a reference to the G4PMapPtkTallys containing
// the tallies
private:
G4PMapPtkTallys fPtkTallys;
G4VCellScorerStore &fCellScorerStore;
};
G4std::ostream& operator<<(G4std::ostream &out, const G4PScorer &ps);
#endif
@@ -22,7 +22,7 @@
//
//
// $Id: G4CollectionNameVector.hh,v 1.2 2001/07/11 09:58:42 gunter Exp $
// GEANT4 tag $Name: geant4-04-01 $
// GEANT4 tag $Name: geant4-05-00 $
//
#ifndef G4CollectionNameVector_H
@@ -22,7 +22,7 @@
//
//
// $Id: G4HCtable.hh,v 1.6 2001/07/11 09:58:42 gunter Exp $
// GEANT4 tag $Name: geant4-04-01 $
// GEANT4 tag $Name: geant4-05-00 $
//
#ifndef G4HCtable_H
@@ -22,7 +22,7 @@
//
//
// $Id: G4SDManager.hh,v 1.4 2001/07/11 09:58:43 gunter Exp $
// GEANT4 tag $Name: geant4-04-01 $
// GEANT4 tag $Name: geant4-05-00 $
//
#ifndef G4SDManager_h
@@ -22,7 +22,7 @@
//
//
// $Id: G4SDStructure.hh,v 1.7 2001/07/13 15:00:06 gcosmo Exp $
// GEANT4 tag $Name: geant4-04-01 $
// GEANT4 tag $Name: geant4-05-00 $
//
#ifndef G4SDStructure_h
@@ -22,7 +22,7 @@
//
//
// $Id: G4SDmessenger.hh,v 1.4 2001/07/11 09:58:43 gunter Exp $
// GEANT4 tag $Name: geant4-04-01 $
// GEANT4 tag $Name: geant4-05-00 $
//
#ifndef G4SDmessenger_h
@@ -22,7 +22,7 @@
//
//
// $Id: G4SensitiveVolumeList.hh,v 1.6 2001/07/11 09:58:43 gunter Exp $
// GEANT4 tag $Name: geant4-04-01 $
// GEANT4 tag $Name: geant4-05-00 $
//
// ------------------------------------------------------------
// GEANT 4 class header file --- Copyright CERN 1996
@@ -22,7 +22,7 @@
//
//
// $Id: G4SensitiveVolumeList.icc,v 1.5 2001/07/11 09:58:43 gunter Exp $
// GEANT4 tag $Name: geant4-04-01 $
// GEANT4 tag $Name: geant4-05-00 $
//
// -----------------------------------------------------------
// Inline functions of GEANT 4 class header file.
@@ -0,0 +1,66 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: G4TrackLogger.hh,v 1.1 2002/10/28 10:01:50 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
// ----------------------------------------------------------------------
// Class G4TrackLogger
//
// Class description:
//
// This class loggs every track via it's id. It may tell if
// a track has been logged. The loggs are cleared when ever
// the object has been informed about a new event.
//
// Author: Michael Dressel (Michael.Dressel@cern.ch)
// ----------------------------------------------------------------------
//
#ifndef G4TrackLogger_hh
#define G4TrackLogger_hh G4TrackLogger_hh
#include "globals.hh"
#include "g4std/set"
class G4TrackLogger {
public:
G4TrackLogger();
~G4TrackLogger();
void SetEventID(G4int id);
// inform the object about the event number
// if the event number changes the loggs are cleared.
G4bool FirstEnterance(G4int trid);
// returns true if the track is new to this event.
typedef G4std::set<G4int > TrackIDsSet;
// log for the track ids.
private:
G4int fPreviousEventID;
TrackIDsSet fTrackIDsSet;
};
#endif
@@ -22,7 +22,7 @@
//
//
// $Id: G4VReadOutGeometry.hh,v 1.3 2001/07/11 09:58:43 gunter Exp $
// GEANT4 tag $Name: geant4-04-01 $
// GEANT4 tag $Name: geant4-05-00 $
//
// ------------------------------------------------------------
@@ -22,7 +22,7 @@
//
//
// $Id: G4VSensitiveDetector.hh,v 1.7 2001/07/13 15:00:06 gcosmo Exp $
// GEANT4 tag $Name: geant4-04-01 $
// GEANT4 tag $Name: geant4-05-00 $
//
#ifndef G4VSensitiveDetector_h
@@ -0,0 +1,114 @@
//
// ********************************************************************
// * 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: G4CellScoreComposer.cc,v 1.2 2002/11/04 10:51:49 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
// ----------------------------------------------------------------------
// GEANT 4 class source file
//
// G4CellSCoreComposer.cc
//
// ----------------------------------------------------------------------
#include "G4CellScoreComposer.hh"
#include "G4Step.hh"
G4CellScoreComposer::G4CellScoreComposer()
{
G4CellScoreValues v = {0};
fSCScoreValues = v;
}
G4CellScoreComposer::~G4CellScoreComposer()
{}
void G4CellScoreComposer::EstimatorCalculation(const G4Step &aStep){
G4StepPoint *p = 0;
p = aStep.GetPreStepPoint();
if (!p) {
G4Exception("G4CellScoreComposer::EstimatorCalculation: no pointer to pre PreStepPoint!");
}
G4double sl = aStep.GetStepLength();
G4double slw = sl * p->GetWeight();
G4double slwe = slw * p->GetKineticEnergy();
G4double v = p->GetVelocity();
if (!(v>0.)) {
v = 10e-9;
}
fSCScoreValues.fSumSL += sl;
fSCScoreValues.fSumSLW += slw;
fSCScoreValues.fSumSLW_v += slw / v;
fSCScoreValues.fSumSLWE += slwe;
fSCScoreValues.fSumSLWE_v += slwe / v;
}
void G4CellScoreComposer::TrackEnters(){
fSCScoreValues.fSumTracksEntering++;
}
void G4CellScoreComposer::NewTrackPopedUp(){
fSCScoreValues.fSumPopulation++;
}
void G4CellScoreComposer::SetCollisionWeight(G4double weight){
fSCScoreValues.fSumCollisions++;
fSCScoreValues.fSumCollisionsWeight+=weight;
}
const G4CellScoreValues &G4CellScoreComposer::
GetStandardCellScoreValues() const {
if (fSCScoreValues.fSumSLW > 0.) {
//divide by SumSLW or SumSLW_v ?
fSCScoreValues.fNumberWeightedEnergy =
fSCScoreValues.fSumSLWE_v / fSCScoreValues.fSumSLW_v;
fSCScoreValues.fFluxWeightedEnergy =
fSCScoreValues.fSumSLWE / fSCScoreValues.fSumSLW;
fSCScoreValues.fAverageTrackWeight =
fSCScoreValues.fSumSLW / fSCScoreValues.fSumSL;
}
return fSCScoreValues;
}
void G4CellScoreComposer::SetImportnace(G4double importance){
fSCScoreValues.fImportance = importance;
};
G4std::ostream& operator<<(G4std::ostream &out,
const G4CellScoreComposer &ps) {
G4CellScoreValues scores = ps.GetStandardCellScoreValues();
out << "Tracks entering: " << scores.fSumTracksEntering << G4endl;
out << "Population: " << scores.fSumPopulation << G4endl;
out << "Collisions: " << scores.fSumCollisions << G4endl;
out << "Collisions*Wgt: " << scores.fSumCollisionsWeight << G4endl;
out << "NumWGTedEnergy: " << scores.fNumberWeightedEnergy << G4endl;
out << "FluxWGTedEnergy: " << scores.fFluxWeightedEnergy << G4endl;
out << "Aver.TrackWGT*I: " << scores.fAverageTrackWeight*
scores.fImportance << G4endl;
return out;
}
@@ -21,57 +21,67 @@
// ********************************************************************
//
//
// $Id: G4PScorer.cc,v 1.7 2002/04/09 17:40:15 gcosmo Exp $
// GEANT4 tag $Name: geant4-04-01 $
// $Id: G4CellStoreScorer.cc,v 1.2 2002/11/04 10:51:49 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
// ----------------------------------------------------------------------
// GEANT 4 class source file
//
// G4PScorer.cc
// G4CellStoreScorer
//
// ----------------------------------------------------------------------
#include "G4PScorer.hh"
#include "G4CellStoreScorer.hh"
#include "G4VCellScorer.hh"
#include "G4Track.hh"
#include "G4GeometryCell.hh"
#include "G4Step.hh"
#include "G4PStep.hh"
#include "G4Sigma.hh"
#include "G4StateManager.hh"
#include "G4GeometryCellStep.hh"
#include "G4VCellScorerStore.hh"
G4PScorer::G4PScorer(){}
G4PScorer::~G4PScorer(){}
G4CellStoreScorer::G4CellStoreScorer(G4VCellScorerStore &csc) :
fCellScorerStore(csc)
{}
void G4PScorer::Score(const G4Step &aStep, const G4PStep &aPstep)
{
G4Track *track = aStep.GetTrack();
G4CellStoreScorer::~G4CellStoreScorer()
{}
void G4CellStoreScorer::
Score(const G4Step &aStep, const G4GeometryCellStep &aPstep){
G4Track *track = 0;
track = aStep.GetTrack();
if (track->GetTrackStatus()==fStopAndKill) {
G4cout << " track status is StopAndKill -> do nothing" << G4endl;
G4cout << "G4CellStoreScorer::Score: track status is StopAndKill -> do nothing" << G4endl;
}
// do the scoring
else {
G4double weight = track->GetWeight();
// the map fPtkTallys, the map nametallys and the "G4Sigma" will
// be setup the first time they are accesed.
G4PTouchableKey post_ptk(aPstep.fPostTouchableKey);
if (aPstep.fCrossBoundary) {
// Pstep crosses boundary
fPtkTallys[post_ptk]["WeighteOfHistorysEntering"].Xin(weight);
fPtkTallys[post_ptk]["HistorysEnteringWeighted"].Xin(1,weight);
fPtkTallys[post_ptk]["EnergyEnteringHistoryWeighted"].
Xin(track->GetKineticEnergy(), weight);
else {
// chose the cells to be scored
G4GeometryCell pre_gCell(aPstep.GetPreGeometryCell());
G4GeometryCell post_gCell(aPstep.GetPostGeometryCell());
G4VCellScorer *post_cs = 0;
post_cs = fCellScorerStore.GetCellScore(post_gCell);
if (aPstep.GetCrossBoundary()) {
// entering post_gCell
if (post_cs) {
post_cs->ScoreAnEnteringStep(aStep, post_gCell);
}
// exiting pre_gCell
G4VCellScorer *pre_cs = 0;
pre_cs = fCellScorerStore.GetCellScore(pre_gCell);
if (pre_cs) {
pre_cs->ScoreAnExitingStep(aStep, pre_gCell);
}
}
else {
// Pstep with both points in the same I volume
if (aStep.GetPostStepPoint()->GetStepStatus() != fGeomBoundary) {
fPtkTallys[post_ptk]["WeighteOfCollisions"].Xin(weight);
fPtkTallys[post_ptk]["CollisionsWeighted"].Xin(1,weight);
else {
// step in post_gCell
if (post_cs) {
post_cs->ScoreAnInVolumeStep(aStep, post_gCell);
}
}
}
}
G4std::ostream& operator<<(G4std::ostream &out, const G4PScorer &ps)
{
out << ps.GetMapPtkTallys();
return out;
}
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4HCtable.cc,v 1.6 2001/07/13 15:00:08 gcosmo Exp $
// GEANT4 tag $Name: geant4-04-01 $
// GEANT4 tag $Name: geant4-05-00 $
//
#include "G4HCtable.hh"
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4SDManager.cc,v 1.4 2001/07/13 15:00:08 gcosmo Exp $
// GEANT4 tag $Name: geant4-04-01 $
// $Id: G4SDManager.cc,v 1.5 2002/11/27 19:03:42 asaim Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
#include "G4SDManager.hh"
@@ -58,6 +58,8 @@ G4SDManager::G4SDManager():verboseLevel(0)
G4SDManager::~G4SDManager()
{
delete theMessenger;
delete HCtable;
delete treeTop;
}
void G4SDManager::AddNewDetector(G4VSensitiveDetector*aSD)
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4SDStructure.cc,v 1.6 2001/07/13 15:00:08 gcosmo Exp $
// GEANT4 tag $Name: geant4-04-01 $
// $Id: G4SDStructure.cc,v 1.7 2002/11/27 19:03:42 asaim Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
// G4SDStructure
@@ -45,6 +45,12 @@ G4SDStructure::G4SDStructure(G4String aPath):verboseLevel(0)
G4SDStructure::~G4SDStructure()
{
size_t nTree = structure.size();
for(size_t iTree=0;iTree<nTree;iTree++)
{ delete structure[iTree]; }
size_t nDet = detector.size();
for(size_t iDet=0;iDet<nDet;iDet++)
{ delete detector[iDet]; }
}
G4int G4SDStructure::operator==(const G4SDStructure &right) const
@@ -22,7 +22,7 @@
//
//
// $Id: G4SDmessenger.cc,v 1.3 2001/07/11 09:58:44 gunter Exp $
// GEANT4 tag $Name: geant4-04-01 $
// GEANT4 tag $Name: geant4-05-00 $
//
// ---------------------------------------------------------------------
@@ -22,7 +22,7 @@
//
//
// $Id: G4SensitiveVolumeList.cc,v 1.5 2001/07/13 15:00:09 gcosmo Exp $
// GEANT4 tag $Name: geant4-04-01 $
// GEANT4 tag $Name: geant4-05-00 $
//
// --------------------------------------------------------------
// GEANT 4 class implementation file
@@ -21,37 +21,46 @@
// ********************************************************************
//
//
// $Id: G4PMapPtkTallys.cc,v 1.4 2002/04/09 16:23:49 gcosmo Exp $
// GEANT4 tag $Name: geant4-04-01 $
// $Id: G4TrackLogger.cc,v 1.2 2002/11/04 10:51:49 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
// ----------------------------------------------------------------------
// GEANT 4 class source file
//
// G4PMapPtkTallys.cc
// G4TrackLogger.cc
//
// ----------------------------------------------------------------------
#include "G4PMapPtkTallys.hh"
#include "G4PStepStream.hh"
#include "G4Sigma.hh"
#include "G4TrackLogger.hh"
G4std::ostream& operator << (G4std::ostream &out, const G4PMapNameTally &tallys)
{
for (G4PMapNameTally::const_iterator it = tallys.begin();
it != tallys.end(); it++) {
out << (*it).first << "\n";
out << (*it).second;
}
return out;
}
G4TrackLogger::G4TrackLogger() :
fPreviousEventID(-1)
{}
G4std::ostream& operator << (G4std::ostream &out,
const G4PMapPtkTallys &tallystore)
{
for (G4PMapPtkTallys::const_iterator it = tallystore.begin();
it != tallystore.end(); it++) {
out << (*it).first << "\n";
out << (*it).second;
G4TrackLogger::~G4TrackLogger(){}
void G4TrackLogger::SetEventID(G4int id){
if (id != fPreviousEventID) {
fTrackIDsSet.clear();
fPreviousEventID =id;
}
return out;
}
};
G4bool G4TrackLogger::FirstEnterance(G4int trid){
G4bool first = true;
G4int n = fTrackIDsSet.count(trid);
if (n==1) {
first=false;
}
else if(n==0) {
fTrackIDsSet.insert(trid);
}
else if (n>1) {
G4cout << "Error G4TrackLogger::FirstEnterance: "
<< "more than one elm in set!" << G4endl;
}
return first;
};
@@ -22,7 +22,7 @@
//
//
// $Id: G4VReadOutGeometry.cc,v 1.5 2001/07/13 15:00:09 gcosmo Exp $
// GEANT4 tag $Name: geant4-04-01 $
// GEANT4 tag $Name: geant4-05-00 $
//
#include "G4VReadOutGeometry.hh"
@@ -22,7 +22,7 @@
//
//
// $Id: G4VSensitiveDetector.cc,v 1.5 2001/07/13 15:00:09 gcosmo Exp $
// GEANT4 tag $Name: geant4-04-01 $
// GEANT4 tag $Name: geant4-05-00 $
//
// G4VSensitiveDetector
#include "G4VSensitiveDetector.hh"
@@ -22,7 +22,7 @@
//
//
// $Id: G4DCofThisEvent.hh,v 1.7 2001/07/13 15:00:12 gcosmo Exp $
// GEANT4 tag $Name: geant4-04-01 $
// GEANT4 tag $Name: geant4-05-00 $
//
#ifndef G4DCofThisEvent_h
@@ -22,7 +22,7 @@
//
//
// $Id: G4TDigiCollection.hh,v 1.10 2001/07/13 15:00:12 gcosmo Exp $
// GEANT4 tag $Name: geant4-04-01 $
// GEANT4 tag $Name: geant4-05-00 $
//
#ifndef G4TDigiCollection_h
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4VDigi.hh,v 1.7 2001/07/13 15:00:12 gcosmo Exp $
// GEANT4 tag $Name: geant4-04-01 $
// GEANT4 tag $Name: geant4-05-00 $
//
#ifndef G4VDigi_h
@@ -22,7 +22,7 @@
//
//
// $Id: G4VDigiCollection.hh,v 1.7 2001/07/13 15:00:12 gcosmo Exp $
// GEANT4 tag $Name: geant4-04-01 $
// GEANT4 tag $Name: geant4-05-00 $
//
#ifndef G4VDigiCollection_h
@@ -22,7 +22,7 @@
//
//
// $Id: G4DCofThisEvent.cc,v 1.6 2001/07/13 15:00:14 gcosmo Exp $
// GEANT4 tag $Name: geant4-04-01 $
// GEANT4 tag $Name: geant4-05-00 $
//
#include "G4DCofThisEvent.hh"
@@ -22,7 +22,7 @@
//
//
// $Id: G4TDigiCollection.cc,v 1.4 2001/07/13 15:00:14 gcosmo Exp $
// GEANT4 tag $Name: geant4-04-01 $
// GEANT4 tag $Name: geant4-05-00 $
//
#include "G4TDigiCollection.hh"
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4VDigi.cc,v 1.6 2001/07/13 15:00:14 gcosmo Exp $
// GEANT4 tag $Name: geant4-04-01 $
// GEANT4 tag $Name: geant4-05-00 $
//
// G4VDigi
@@ -22,7 +22,7 @@
//
//
// $Id: G4VDigiCollection.cc,v 1.6 2001/07/13 15:00:15 gcosmo Exp $
// GEANT4 tag $Name: geant4-04-01 $
// GEANT4 tag $Name: geant4-05-00 $
//
// G4VDigiCollection
@@ -22,7 +22,7 @@
//
//
// $Id: G4HCofThisEvent.hh,v 1.7 2001/07/13 15:00:17 gcosmo Exp $
// GEANT4 tag $Name: geant4-04-01 $
// GEANT4 tag $Name: geant4-05-00 $
//
#ifndef G4HCofThisEvent_h
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4THitsCollection.hh,v 1.9 2001/07/13 15:00:17 gcosmo Exp $
// GEANT4 tag $Name: geant4-04-01 $
// $Id: G4THitsCollection.hh,v 1.11 2002/10/18 14:36:11 asaim Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
#ifndef G4THitsCollection_h
@@ -101,6 +101,12 @@ template <class T> class G4THitsCollection : public G4HitsCollection
}
// Returns the number of hit objects stored in this collection
public:
virtual G4VHit* GetHit(size_t i) const
{ return (*((G4std::vector<T*>*)theCollection))[i]; }
virtual size_t GetSize() const
{ return ((G4std::vector<T*>*)theCollection)->size(); }
};
template <class T> inline void* G4THitsCollection<T>::operator new(size_t)
+23 -3
View File
@@ -21,14 +21,19 @@
// ********************************************************************
//
//
// $Id: G4VHit.hh,v 1.6 2001/07/13 15:00:17 gcosmo Exp $
// GEANT4 tag $Name: geant4-04-01 $
// $Id: G4VHit.hh,v 1.9 2002/10/28 11:08:48 johna Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
#ifndef G4VHit_h
#define G4VHit_h 1
#include "globals.hh"
#include "g4std/vector"
#include "g4std/map"
class G4AttDef;
class G4AttValue;
// class description:
//
@@ -50,7 +55,22 @@ class G4VHit
virtual void Draw();
virtual void Print();
virtual const G4std::map<G4String,G4AttDef>* GetAttDefs() const
{ return 0; }
// If implemented by a derived class, returns a pointer to a map
// of attribute definitions for the attribute values below. The
// user must test the validity of this pointer. See
// G4Trajectory for an example of a concrete implementation of
// this method.
virtual const G4std::vector<G4AttValue>* CreateAttValues() const
{ return 0; }
// If implemented by a derived class, returns a pointer to a
// list of attribute values suitable, e.g., for picking. Each
// must refer to an attribute definition in the above map; its
// name is the key. The user must test the validity of this
// pointer and delete the list after use. See G4Trajectory for
// an example of a concrete implementation of this method.
};
#endif
@@ -21,13 +21,14 @@
// ********************************************************************
//
//
// $Id: G4VHitsCollection.hh,v 1.6 2001/07/13 15:00:18 gcosmo Exp $
// GEANT4 tag $Name: geant4-04-01 $
// $Id: G4VHitsCollection.hh,v 1.10 2002/10/30 16:20:06 asaim Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
#ifndef G4VHitsCollection_h
#define G4VHitsCollection_h 1
class G4VHit;
#include "globals.hh"
// class description:
@@ -61,6 +62,14 @@ class G4VHitsCollection
{ return collectionName; }
inline G4String GetSDname()
{ return SDname; }
public:
// GetHit and GetSize are given a default implementation here so
// that the template G4THitsCollection can be used, but they
// are re-implemented G4THitsCollection.
virtual G4VHit* GetHit(size_t i) const { return 0; }
virtual size_t GetSize() const { return 0; };
};
#endif
@@ -22,7 +22,7 @@
//
//
// $Id: G4HCofThisEvent.cc,v 1.6 2001/07/13 15:00:20 gcosmo Exp $
// GEANT4 tag $Name: geant4-04-01 $
// GEANT4 tag $Name: geant4-05-00 $
//
#include "G4HCofThisEvent.hh"
@@ -22,7 +22,7 @@
//
//
// $Id: G4THitsCollection.cc,v 1.3 2001/07/11 09:58:47 gunter Exp $
// GEANT4 tag $Name: geant4-04-01 $
// GEANT4 tag $Name: geant4-05-00 $
//
#include "G4THitsCollection.hh"
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4VHit.cc,v 1.4 2001/07/13 15:00:21 gcosmo Exp $
// GEANT4 tag $Name: geant4-04-01 $
// GEANT4 tag $Name: geant4-05-00 $
//
// G4VHit
@@ -22,7 +22,7 @@
//
//
// $Id: G4VHitsCollection.cc,v 1.4 2001/07/13 15:00:21 gcosmo Exp $
// GEANT4 tag $Name: geant4-04-01 $
// GEANT4 tag $Name: geant4-05-00 $
//
// G4VHitsCollection
+2 -1
View File
@@ -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
View File
@@ -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.
+83
View File
@@ -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
+92
View File
@@ -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 $
//
//
+1 -1
View File
@@ -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
+11 -2
View File
@@ -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;
+1 -1
View File
@@ -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:
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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
@@ -19,48 +19,38 @@
// * 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 $
//
// $Id: G4PSphere.ddl,v 1.7 2001/07/11 10:02:23 gunter Exp $
// GEANT4 tag $Name: geant4-04-01 $
// ====================================================================
#ifndef G4_HEPMC_ASCII_READER_MESSENGER_H
#define G4_HEPMC_ASCII_READER_MESSENGER_H
// Class Description:
// Persistent version of G4PSphere solid.
#include "G4UImessenger.hh"
// History:
// 19.06.98 A.Kimura Converted G4Sphere.hh
#ifndef G4PSphere_DDL
#define G4PSphere_DDL
#include "G4PersistentSchema.hh"
#include "G4PCSGSolid.hh"
class G4VSolid;
class G4Sphere;
#include "G4ThreeVector.hh"
class G4PSphere
: public G4PCSGSolid
{
public: // With description
G4PSphere(const G4Sphere* theSphere);
virtual ~G4PSphere() ;
// Constructor and Destructor
G4VSolid* MakeTransientObject() const;
// Creates a transient boolean solid object.
virtual G4GeometryType GetEntityType() const {return G4String("G4Sphere");}
// Returns the G4GeometryType of this solid.
class G4HepMCAsciiReader;
class G4UIdirectory;
class G4UIcmdWithoutParameter;
class G4UIcmdWithAString;
class G4UIcmdWithAnInteger;
class G4HepMCAsciiReaderMessenger : public G4UImessenger {
private:
G4HepMCAsciiReader* gen;
G4double fRmin,fRmax,
fSPhi,fDPhi,
fSTheta,fDTheta;
G4UIdirectory* dir;
G4UIcmdWithAnInteger* verbose;
G4UIcmdWithAString* open;
public:
G4HepMCAsciiReaderMessenger(G4HepMCAsciiReader* agen);
~G4HepMCAsciiReaderMessenger();
void SetNewValue(G4UIcommand* command, G4String newValues);
G4String GetCurrentValue(G4UIcommand* command);
};
#endif
#endif
+79
View File
@@ -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
+1 -1
View File
@@ -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 $
//
//
+1 -1
View File
@@ -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 $
//
//
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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 $
//
//
@@ -20,87 +20,69 @@
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: G4Sigma.hh,v 1.6 2002/04/10 13:13:07 dressel Exp $
// GEANT4 tag $Name: geant4-04-01 $
// $Id: G4ScoreTable.hh,v 1.1 2002/10/28 10:06:01 dressel Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
// ----------------------------------------------------------------------
// Class G4Sigma
// Class G4ScoreTable
//
// Class description:
//
// This class creates a table from a given G4CellScoreStore
// and prints it to a given output stream.
//
// A class for simple Gaussian statistics taking into account
// weights.
// Author: Michael Dressel (Michael.Dressel@cern.ch)
// ----------------------------------------------------------------------
#ifndef G4Sigma_hh
#define G4Sigma_hh G4Sigma_hh
//
#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 G4Sigma
{
public: // with description
G4Sigma();
// call Init()
class G4ScoreTable
{
public: // with description
explicit G4ScoreTable(const G4VIStore *aIStore = 0);
~G4Sigma();
// simple deonstruction
~G4ScoreTable();
void Init();
// initialisation
void Print(const G4MapGeometryCellCellScorer &cs,
G4std::ostream *out = 0);
// create the table and print it to the ouput stream.
G4int Xin(G4double x, G4double w = 1.);
// enter a value [with a weight]
void PrintHeader(G4std::ostream *out);
// print the table header, done by the above Print() function
G4int GetEntries() const;
// get the number of entries
void PrintTable(const G4MapGeometryCellCellScorer &cs,
G4std::ostream *out);
// print the table contend, done by the above Print() function
G4double GetMean() const;
// get the weighted mean value: Sum(w*x)/Sum(w)
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.
G4double GetSigma() const;
// get the weighted sigma: sqrt(Sum(w*x*x)/Sum(w)-mean^2)
G4double GetXsum() const;
// get sum over x: Sum(x)
G4double GetXXsum() const;
// get sum over squared x: Sum(x*x)
G4double GetSumOfWeights() const;
// get sum over weights: Sum(w)
G4double GetWeightedXsum() const;
// get weighted sum over x*w: Sum(w*x)
G4double GetWeightedXXsum() const;
// get weighted sum over squarted x: Sum(W*x*x)
private:
G4int GetCalc() const;
G4int Calculate() const;
void Error(const G4String &m);
private:
G4int fEntries;
mutable G4double fMean;
mutable G4double fSigma;
G4double fXsum;
G4double fXXsum;
G4double fWsum;
G4double fWXsum;
G4double fWXXsum;
mutable G4int fcalc;
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;
};
G4std::ostream& operator<<(G4std::ostream &out, const G4Sigma &s);
#endif
+65
View File
@@ -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
+2 -5
View File
@@ -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
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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 $
//
//
//
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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
+93
View File
@@ -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();
}
+98
View File
@@ -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();
}
+3 -3
View File
@@ -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.");
+4 -4
View File
@@ -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()
+1 -1
View File
@@ -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 $
//
//
//
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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 $
//
//
// --------------------------------------------------------------------
+1 -1
View File
@@ -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 $
//
//
@@ -19,50 +19,58 @@
// * 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 $
//
// $Id: G4PSubtractionSolid.ddl,v 1.5 2001/07/11 10:02:22 gunter Exp $
// GEANT4 tag $Name: geant4-04-01 $
// ====================================================================
// Class Description:
// Persistent class for description of subtraction of two CSG solids: A - B
#ifndef WIN32 // Temporarly disabled on Windows, until CLHEP
// will support the HepMC module
// History:
// 10.11.99 Y.Morita, Initial creation
#include "G4HepMCAsciiReader.hh"
#include "G4HepMCAsciiReaderMessenger.hh"
#ifndef G4PSUBTRACTIONSOLID_DDL
#define G4PSUBTRACTIONSOLID_DDL
//#include "g4std/iostream"
#include "G4PersistentSchema.hh"
#include "G4PBooleanSolid.hh"
class G4VSolid;
class G4PSubtractionSolid
: public G4PBooleanSolid
////////////////////////////////////////
G4HepMCAsciiReader::G4HepMCAsciiReader()
: filename("xxx.dat"), verbose(0)
////////////////////////////////////////
{
public: // With description
G4PSubtractionSolid( const G4String& pName,
HepRef(G4PVSolid) persSolidA,
HepRef(G4PVSolid) persSolidB );
virtual ~G4PSubtractionSolid() ;
// Constructor and Destructor
messenger= new G4HepMCAsciiReaderMessenger(this);
}
G4VSolid* MakeTransientObject() const;
G4VSolid* MakeTransientBooleanSolid(
G4VSolid* aSolidA,
G4VSolid* aSolidB ) const;
// Creates a transient G4SubtractionSolid object.
/////////////////////////////////////////
G4HepMCAsciiReader::~G4HepMCAsciiReader()
/////////////////////////////////////////
{
delete messenger;
}
virtual G4GeometryType GetEntityType() const
{ return G4String("G4SubtractionSolid"); }
// Returns the G4GeometryType of this solid.
/////////////////////////////////////
void G4HepMCAsciiReader::Initialize()
/////////////////////////////////////
{
from.close();
from.open(filename.c_str(), G4std::ios::in);
}
protected:
/////////////////////////////////////////////////////////
HepMC::GenEvent* G4HepMCAsciiReader::GenerateHepMCEvent()
/////////////////////////////////////////////////////////
{
HepMC::GenEvent* evt= HepMC::readGenEvent(from);
if(evt==0) {
return 0; // no more event
from.close();
}
private:
};
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
+145
View File
@@ -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
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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"
+17 -8
View File
@@ -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;
+4 -4
View File
@@ -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
+1 -1
View File
@@ -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"
+186
View File
@@ -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;
}
+54
View File
@@ -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();
}
+5 -6
View File
@@ -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;
}
}
+1 -1
View File
@@ -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
+3 -3
View File
@@ -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 -6
View File
@@ -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;
}
+4 -3
View File
@@ -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); }
+1 -1
View File
@@ -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"

Some files were not shown because too many files have changed in this diff Show More