Import Geant4 9.1.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 15:37:50 +02:00
parent a8e9364cea
commit 96c8bcd0af
6923 changed files with 198390 additions and 41849 deletions
@@ -24,39 +24,25 @@
// ********************************************************************
//
//
// $Id: G4SDChargedFilter.hh,v 1.4 2007/05/18 00:00:37 asaim Exp $
// GEANT4 tag $Name: geant4-09-00 $
// $Id: G4DefaultLinearColorMap.hh,v 1.1 2007/11/04 04:06:08 asaim Exp $
// GEANT4 tag $Name: geant4-09-01 $
//
#ifndef G4SDChargedFilter_h
#define G4SDChargedFilter_h 1
#ifndef G4DefaultLinearColorMap_h
#define G4DefaultLinearColorMap_h 1
class G4Step;
class G4ChargedDefinition;
#include "globals.hh"
#include "G4VSDFilter.hh"
#include "G4VScoreColorMap.hh"
////////////////////////////////////////////////////////////////////////////////
// class description:
//
// This is the class of a filter to be associated with a
// sensitive detector.
// This fileter accepts charged particles.
//
// Created: 2005-11-14 Tsukasa ASO.
//
///////////////////////////////////////////////////////////////////////////////
class G4SDChargedFilter : public G4VSDFilter
class G4DefaultLinearColorMap : public G4VScoreColorMap
{
public:
G4DefaultLinearColorMap(G4String mName);
virtual ~G4DefaultLinearColorMap();
public: // with description
G4SDChargedFilter(G4String name);
virtual ~G4SDChargedFilter();
public: // with description
virtual G4bool Accept(const G4Step*) const;
public:
virtual void GetMapColor(G4double val, G4double color[4]);
};
#endif
@@ -1,67 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4PSCellCharge.hh,v 1.3 2007/05/18 00:00:37 asaim Exp $
// GEANT4 tag $Name: geant4-09-00 $
//
#ifndef G4PSCellCharge_h
#define G4PSCellCharge_h 1
#include "G4VPrimitiveScorer.hh"
#include "G4THitsMap.hh"
///////////////////////////////////////////////////////////////////////////////
// (Description)
// This is a primitive scorer class for scoring cell charge.
// The Cell Charge is defined by a sum of deposited charge in the cell.
//
// Created: 2007-08-20 Tsukasa ASO
//
///////////////////////////////////////////////////////////////////////////////
class G4PSCellCharge : public G4VPrimitiveScorer
{
public: // with description
G4PSCellCharge(G4String name, G4int depth=0);
virtual ~G4PSCellCharge();
protected: // with description
virtual G4bool ProcessHits(G4Step*,G4TouchableHistory*);
public:
virtual void Initialize(G4HCofThisEvent*);
virtual void EndOfEvent(G4HCofThisEvent*);
virtual void clear();
virtual void DrawAll();
virtual void PrintAll();
private:
G4int HCID;
G4THitsMap<G4double>* EvtMap;
};
#endif
@@ -1,75 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4PSCellFlux.hh,v 1.4 2007/05/18 00:00:37 asaim Exp $
// GEANT4 tag $Name: geant4-09-00 $
//
#ifndef G4PSCellFlux_h
#define G4PSCellFlux_h 1
#include "G4VPrimitiveScorer.hh"
#include "G4THitsMap.hh"
///////////////////////////////////////////////////////////////////////////////
// (Description)
// This is a primitive scorer class for scoring cell flux.
// The Cell Flux is defined by a sum of track length divided
// by the geometry volume, where all of the tracks in the geometry
// are taken into account. e.g. the unit of Cell Flux is mm/mm3.
//
//
// If you want to score only tracks passing through the geometry volume,
// please use G4PSPassageCellFlux.
//
//
// Created: 2005-11-14 Tsukasa ASO, Akinori Kimura.
//
///////////////////////////////////////////////////////////////////////////////
class G4PSCellFlux : public G4VPrimitiveScorer
{
public: // with description
G4PSCellFlux(G4String name, G4int depth=0);
virtual ~G4PSCellFlux();
protected: // with description
virtual G4bool ProcessHits(G4Step*,G4TouchableHistory*);
public:
virtual void Initialize(G4HCofThisEvent*);
virtual void EndOfEvent(G4HCofThisEvent*);
virtual void clear();
virtual void DrawAll();
virtual void PrintAll();
private:
G4int HCID;
G4THitsMap<G4double>* EvtMap;
};
#endif
@@ -1,70 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4PSDirectionFlag.hh,v 1.3 2007/05/18 00:00:37 asaim Exp $
// GEANT4 tag $Name: geant4-09-00 $
//
//
//---------------------------------------------------------------
//
// G4PSDirectionFlag.hh
//
// Class Description:
// This is an enumerator to define the direction of
// the particle's Surface Current or Flux for PrimitiveScorer
//
//
//---------------------------------------------------------------
#ifndef G4PSDirectionFlag_h
#define G4PSDirectionFlag_h 1
//////////////////
enum G4PSFluxFlag
//////////////////
{
fFlux_InOut,
// For both direction In / Out.
fFlux_In,
// IN : Direction which comes into the geometry
fFlux_Out
};
/////////////////////
enum G4PSCurrentFlag
/////////////////////
{
fCurrent_InOut,
// For both direction In / Out.
fCurrent_In,
// IN : Direction which comes into the geometry
fCurrent_Out
// OUT : Direction which goes out fromthe geometry
};
#endif
@@ -1,65 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4PSDoseDeposit.hh,v 1.4 2007/05/18 00:00:37 asaim Exp $
// GEANT4 tag $Name: geant4-09-00 $
//
#ifndef G4PSDoseDeposit_h
#define G4PSDoseDeposit_h 1
#include "G4VPrimitiveScorer.hh"
#include "G4THitsMap.hh"
////////////////////////////////////////////////////////////////////////////////
// (Description)
// Primitive scorer class for scoring dose deposit in the geometry volume.
//
// Created: 2005-11-14 Tsukasa ASO, Akinori Kimura.
//
///////////////////////////////////////////////////////////////////////////////
class G4PSDoseDeposit : public G4VPrimitiveScorer
{
public: // with description
G4PSDoseDeposit(G4String name, G4int depth=0);
virtual ~G4PSDoseDeposit();
protected: // with description
virtual G4bool ProcessHits(G4Step*,G4TouchableHistory*);
public:
virtual void Initialize(G4HCofThisEvent*);
virtual void EndOfEvent(G4HCofThisEvent*);
virtual void clear();
virtual void DrawAll();
virtual void PrintAll();
private:
G4int HCID;
G4THitsMap<G4double>* EvtMap;
};
#endif
@@ -1,66 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4PSEnergyDeposit.hh,v 1.3 2007/05/18 00:00:37 asaim Exp $
// GEANT4 tag $Name: geant4-09-00 $
//
#ifndef G4PSEnergyDeposit_h
#define G4PSEnergyDeposit_h 1
#include "G4VPrimitiveScorer.hh"
#include "G4THitsMap.hh"
////////////////////////////////////////////////////////////////////////////////
// Description:
// This is a primitive scorer class for scoring energy deposit.
//
// Created: 2005-11-14 Tsukasa ASO, Akinori Kimura
//
///////////////////////////////////////////////////////////////////////////////
class G4PSEnergyDeposit : public G4VPrimitiveScorer
{
public: // with description
G4PSEnergyDeposit(G4String name, G4int depth=0);
virtual ~G4PSEnergyDeposit();
protected: // with description
virtual G4bool ProcessHits(G4Step*,G4TouchableHistory*);
public:
virtual void Initialize(G4HCofThisEvent*);
virtual void EndOfEvent(G4HCofThisEvent*);
virtual void clear();
virtual void DrawAll();
virtual void PrintAll();
private:
G4int HCID;
G4THitsMap<G4double>* EvtMap;
};
#endif
@@ -1,85 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4PSFlatSurfaceCurrent.hh,v 1.4 2007/05/18 00:00:37 asaim Exp $
// GEANT4 tag $Name: geant4-09-00 $
//
#ifndef G4PSFlatSurfaceCurrent_h
#define G4PSFlatSurfaceCurrent_h 1
#include "G4VPrimitiveScorer.hh"
#include "G4THitsMap.hh"
#include "G4Box.hh"
#include "G4PSDirectionFlag.hh"
////////////////////////////////////////////////////////////////////////////////
// (Description)
// This is a primitive scorer class for scoring Surface Current.
// Current version assumes only for G4Box shape, and the surface
// is defined at the -Z plane of the box.
// The current is given in the unit of area.
// e.g. (Number of tracks)/mm2.
//
// Surface is defined at the -Z surface.
// Direction -Z +Z
// 0 IN || OUT ->|<- | fCurrent_InOut
// 1 IN ->| | fCurrent_In
// 2 OUT |<- | fCurrent_Out
//
//
// Created: 2005-11-14 Tsukasa ASO, Akinori Kimura.
// 17-Nov-2005 T.Aso, Bug fix for area definition.
//
///////////////////////////////////////////////////////////////////////////////
class G4PSFlatSurfaceCurrent : public G4VPrimitiveScorer
{
public: // with description
G4PSFlatSurfaceCurrent(G4String name ,G4int direction, G4int depth=0);
virtual ~G4PSFlatSurfaceCurrent();
protected: // with description
virtual G4bool ProcessHits(G4Step*,G4TouchableHistory*);
G4int IsSelectedSurface(G4Step*,G4Box*);
public:
virtual void Initialize(G4HCofThisEvent*);
virtual void EndOfEvent(G4HCofThisEvent*);
virtual void clear();
virtual void DrawAll();
virtual void PrintAll();
private:
G4int HCID;
G4int fDirection;
G4THitsMap<G4double>* EvtMap;
};
#endif
@@ -1,86 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4PSFlatSurfaceFlux.hh,v 1.5 2007/05/18 00:00:37 asaim Exp $
// GEANT4 tag $Name: geant4-09-00 $
//
#ifndef G4PSFlatSurfaceFlux_h
#define G4PSFlatSurfaceFlux_h 1
#include "G4VPrimitiveScorer.hh"
#include "G4THitsMap.hh"
#include "G4Box.hh"
#include "G4PSDirectionFlag.hh"
////////////////////////////////////////////////////////////////////////////////
// (Description)
// This is a primitive scorer class for scoring Surface Flux.
// Current version assumes only for G4Box shape, and the surface
// is defined at the -Z plane of the box.
// The surface flux is given in the unit of area.
// e.g. sum of 1/cos(T)/mm2, where T is a incident angle of the
// track on the surface.
//
//
// Surface is defined at the -Z surface.
// Direction -Z +Z
// 0 IN || OUT ->|<- | fFlux_InOut
// 1 IN ->| | fFlux_In
// 2 OUT |<- | fFlux_Out
//
// Created: 2005-11-14 Tsukasa ASO, Akinori Kimura.
//
// 18-Nov-2005 T.Aso, To use always positive value for anglefactor.
// Bug fix. Area definition.
// 29-Mar-2007 T.Aso, Bug fix for momentum direction at outgoing flux.
///////////////////////////////////////////////////////////////////////////////
class G4PSFlatSurfaceFlux : public G4VPrimitiveScorer
{
public: // with description
G4PSFlatSurfaceFlux(G4String name,G4int direction, G4int depth=0);
virtual ~G4PSFlatSurfaceFlux();
protected: // with description
virtual G4bool ProcessHits(G4Step*,G4TouchableHistory*);
G4int IsSelectedSurface(G4Step*,G4Box*);
public:
virtual void Initialize(G4HCofThisEvent*);
virtual void EndOfEvent(G4HCofThisEvent*);
virtual void clear();
virtual void DrawAll();
virtual void PrintAll();
private:
G4int HCID;
G4int fDirection;
G4THitsMap<G4double>* EvtMap;
};
#endif
@@ -1,79 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4PSMinKinEAtGeneration.hh,v 1.3 2007/05/18 00:00:37 asaim Exp $
// GEANT4 tag $Name: geant4-09-00 $
//
#ifndef G4PSMinKinEAtGeneration_h
#define G4PSMinKinEAtGeneration_h 1
#include "G4VPrimitiveScorer.hh"
#include "G4THitsMap.hh"
////////////////////////////////////////////////////////////////////////////////
// (Description)
// This is a primitive scorer class for scoring Number of particles
// generated in the geometry.
//
// Created: 2005-11-18 Tsukasa ASO, Akinori Kimura.
//
///////////////////////////////////////////////////////////////////////////////
class G4PSMinKinEAtGeneration : public G4VPrimitiveScorer
{
public: // with description
G4PSMinKinEAtGeneration(G4String name, G4int depth=0);
protected: // with description
virtual G4bool ProcessHits(G4Step*,G4TouchableHistory*);
public:
virtual ~G4PSMinKinEAtGeneration();
public:
virtual void Initialize(G4HCofThisEvent*);
virtual void EndOfEvent(G4HCofThisEvent*);
virtual void clear();
public:
virtual void DrawAll();
virtual void PrintAll();
private:
G4int HCID;
G4THitsMap<G4double>* EvtMap;
public:
};
#endif
@@ -1,83 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4PSNofCollision.hh,v 1.2 2007/06/21 15:03:52 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
//
#ifndef G4PSNofCollision_h
#define G4PSNofCollision_h 1
#include "G4VPrimitiveScorer.hh"
#include "G4THitsMap.hh"
//////////////////////////////////////////////////////////////////////////////////
// (Description)
// This is a primitive scorer class for scoring Number of Steps in the cell.
//
// Created: 2007-2-2 Tsukasa ASO, Akinori Kimura.
//
///////////////////////////////////////////////////////////////////////////////
class G4PSNofCollision : public G4VPrimitiveScorer
{
public: // with description
G4PSNofCollision(G4String name, G4int depth=0);
protected: // with description
virtual G4bool ProcessHits(G4Step*,G4TouchableHistory*);
public:
virtual ~G4PSNofCollision();
inline void Weighted(G4bool flg=true) { weighted = flg; }
// Multiply track weight
public:
virtual void Initialize(G4HCofThisEvent*);
virtual void EndOfEvent(G4HCofThisEvent*);
virtual void clear();
public:
virtual void DrawAll();
virtual void PrintAll();
private:
G4int HCID;
G4THitsMap<G4double>* EvtMap;
G4bool weighted;
public:
};
#endif
@@ -1,78 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4PSNofStep.hh,v 1.3 2007/05/18 00:00:37 asaim Exp $
// GEANT4 tag $Name: geant4-09-00 $
//
#ifndef G4PSNofStep_h
#define G4PSNofStep_h 1
#include "G4VPrimitiveScorer.hh"
#include "G4THitsMap.hh"
////////////////////////////////////////////////////////////////////////////////
// (Description)
// This is a primitive scorer class for scoring Number of Steps in the cell.
//
// Created: 2005-11-14 Tsukasa ASO, Akinori Kimura.
//
///////////////////////////////////////////////////////////////////////////////
class G4PSNofStep : public G4VPrimitiveScorer
{
public: // with description
G4PSNofStep(G4String name, G4int depth=0);
protected: // with description
virtual G4bool ProcessHits(G4Step*,G4TouchableHistory*);
public:
virtual ~G4PSNofStep();
public:
virtual void Initialize(G4HCofThisEvent*);
virtual void EndOfEvent(G4HCofThisEvent*);
virtual void clear();
public:
virtual void DrawAll();
virtual void PrintAll();
private:
G4int HCID;
G4THitsMap<G4double>* EvtMap;
public:
};
#endif
@@ -1,78 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4PSPassageCellFlux.hh,v 1.4 2007/05/18 00:00:37 asaim Exp $
// GEANT4 tag $Name: geant4-09-00 $
//
#ifndef G4PSPassageCellFlux_h
#define G4PSPassageCellFlux_h 1
#include "G4VPrimitiveScorer.hh"
#include "G4THitsMap.hh"
////////////////////////////////////////////////////////////////////////////////
// (Description)
// This is a primitive scorer class for scoring cell flux.
// The Cell Flux is defined by a track length divided by a geometry
// volume, where only tracks passing through the geometry are taken
// into account. e.g. the unit of Cell Flux is mm/mm3.
//
// If you want to score all tracks in the geometry volume,
// please use G4PSCellFlux.
//
// Created: 2005-11-14 Tsukasa ASO, Akinori Kimura.
//
///////////////////////////////////////////////////////////////////////////////
class G4PSPassageCellFlux : public G4VPrimitiveScorer
{
public: // with description
G4PSPassageCellFlux(G4String name, G4int depth=0);
virtual ~G4PSPassageCellFlux();
protected: // with description
virtual G4bool ProcessHits(G4Step*,G4TouchableHistory*);
virtual G4bool IsPassed(G4Step*);
public:
virtual void Initialize(G4HCofThisEvent*);
virtual void EndOfEvent(G4HCofThisEvent*);
virtual void clear();
virtual void DrawAll();
virtual void PrintAll();
private:
G4int HCID;
G4int fCurrentTrkID;
G4double fCellFlux;
G4THitsMap<G4double>* EvtMap;
};
#endif
@@ -1,81 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4PSPassageCurrent.hh,v 1.4 2007/05/18 00:00:37 asaim Exp $
// GEANT4 tag $Name: geant4-09-00 $
//
#ifndef G4PSPassageCurrent_h
#define G4PSPassageCurrent_h 1
#include "G4VPrimitiveScorer.hh"
#include "G4THitsMap.hh"
////////////////////////////////////////////////////////////////////////////////
// (Description)
// This is a primitive scorer class for scoring current.
// The number of tracks passing through the geometry are taken
// into account.
//
// Created: 2005-11-14 Tsukasa ASO, Akinori Kimura.
//
///////////////////////////////////////////////////////////////////////////////
class G4PSPassageCurrent : public G4VPrimitiveScorer
{
public: // with description
G4PSPassageCurrent(G4String name, G4int depth=0);
public:
virtual ~G4PSPassageCurrent();
protected: // with description
virtual G4bool ProcessHits(G4Step*,G4TouchableHistory*);
virtual G4bool IsPassed(G4Step*);
public:
virtual void Initialize(G4HCofThisEvent*);
virtual void EndOfEvent(G4HCofThisEvent*);
virtual void clear();
public:
virtual void DrawAll();
virtual void PrintAll();
private:
G4int HCID;
G4int fCurrentTrkID;
G4double fCurrent;
G4double fCurrentSquare;
G4THitsMap<G4double>* EvtMap;
};
#endif
@@ -1,78 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4PSPassageTrackLength.hh,v 1.4 2007/05/18 00:00:37 asaim Exp $
// GEANT4 tag $Name: geant4-09-00 $
//
#ifndef G4PSPassageTrackLength_h
#define G4PSPassageTrackLength_h 1
#include "G4VPrimitiveScorer.hh"
#include "G4THitsMap.hh"
////////////////////////////////////////////////////////////////////////////////
// (Description)
// This is a primitive scorer class for scoring only track length.
// The tracks which passed a geometry is taken into account.
//
//
// Created: 2005-11-14 Tsukasa ASO, Akinori Kimura.
//
///////////////////////////////////////////////////////////////////////////////
class G4PSPassageTrackLength : public G4VPrimitiveScorer
{
public: // with description
G4PSPassageTrackLength(G4String name, G4int depth=0);
virtual ~G4PSPassageTrackLength();
inline void Weighted(G4bool flg=true) { weighted = flg; }
// Multiply track weight
protected: // with description
virtual G4bool ProcessHits(G4Step*,G4TouchableHistory*);
G4bool IsPassed(G4Step*);
public:
virtual void Initialize(G4HCofThisEvent*);
virtual void EndOfEvent(G4HCofThisEvent*);
virtual void clear();
virtual void DrawAll();
virtual void PrintAll();
private:
G4int HCID;
G4int fCurrentTrkID;
G4double fTrackLength;
G4THitsMap<G4double>* EvtMap;
G4bool weighted;
};
#endif
@@ -1,87 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4PSPopulation.hh,v 1.2 2007/06/21 15:03:54 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
//
#ifndef G4PSPopulation_h
#define G4PSPopulation_h 1
#include "G4VPrimitiveScorer.hh"
#include "G4THitsMap.hh"
#include <map>
#include "G4TrackLogger.hh"
//////////////////////////////////////////////////////////////////////////////////
// (Description)
// This is a primitive scorer class for scoring Number of Steps in the cell.
//
// Created: 2007-02-02 Tsukasa ASO, Akinori Kimura.
//
///////////////////////////////////////////////////////////////////////////////
class G4PSPopulation : public G4VPrimitiveScorer
{
public: // with description
G4PSPopulation(G4String name, G4int depth=0);
protected: // with description
virtual G4bool ProcessHits(G4Step*,G4TouchableHistory*);
public:
virtual ~G4PSPopulation();
inline void Weighted(G4bool flg=true) { weighted = flg; }
// Multiply track weight
public:
virtual void Initialize(G4HCofThisEvent*);
virtual void EndOfEvent(G4HCofThisEvent*);
virtual void clear();
public:
virtual void DrawAll();
virtual void PrintAll();
private:
G4int HCID;
G4THitsMap<G4double>* EvtMap;
G4bool weighted;
std::map<G4int,G4TrackLogger> fCellTrackLogger;
public:
};
#endif
@@ -1,84 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4PSSphereSurfaceCurrent.hh,v 1.4 2007/05/18 00:00:37 asaim Exp $
// GEANT4 tag $Name: geant4-09-00 $
//
#ifndef G4PSSphereSurfaceCurrent_h
#define G4PSSphereSurfaceCurrent_h 1
#include "G4VPrimitiveScorer.hh"
#include "G4THitsMap.hh"
#include "G4Sphere.hh"
#include "G4PSDirectionFlag.hh"
////////////////////////////////////////////////////////////////////////////////
// (Description)
// This is a primitive scorer class for scoring Surface Current.
// Current version assumes only for G4Sphere shape, and the surface
// is defined at the inside of the sphere.
// The current is given in the unit of area.
// e.g. (Number of tracks)/mm2.
//
// Surface is defined at the inside of sphere.
// Direction -Rmin +Rmax
// 0 IN || OUT ->|<- | fCurrent_InOut
// 1 IN ->| | fCurrent_In
// 2 OUT |<- | fCurrent_Out
//
// Created: 2005-11-14 Tsukasa ASO, Akinori Kimura.
// 17-Nov-2005 Bug fix. square definition.
//
///////////////////////////////////////////////////////////////////////////////
class G4PSSphereSurfaceCurrent : public G4VPrimitiveScorer
{
public: // with description
G4PSSphereSurfaceCurrent(G4String name, G4int direction, G4int depth=0);
virtual ~G4PSSphereSurfaceCurrent();
protected: // with description
virtual G4bool ProcessHits(G4Step*,G4TouchableHistory*);
G4int IsSelectedSurface(G4Step*,G4Sphere*);
public:
virtual void Initialize(G4HCofThisEvent*);
virtual void EndOfEvent(G4HCofThisEvent*);
virtual void clear();
virtual void DrawAll();
virtual void PrintAll();
private:
G4int HCID;
G4int fDirection;
G4THitsMap<G4double>* EvtMap;
};
#endif
@@ -1,85 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4PSSphereSurfaceFlux.hh,v 1.2 2007/05/18 00:00:37 asaim Exp $
// GEANT4 tag $Name: geant4-09-00 $
//
#ifndef G4PSSphereSurfaceFlux_h
#define G4PSSphereSurfaceFlux_h 1
#include "G4VPrimitiveScorer.hh"
#include "G4THitsMap.hh"
#include "G4Sphere.hh"
#include "G4PSDirectionFlag.hh"
////////////////////////////////////////////////////////////////////////////////
// (Description)
// This is a primitive scorer class for scoring Surface Flux.
// Flux version assumes only for G4Sphere shape, and the surface
// is defined at the inside of the sphere.
// The current is given in the unit of area.
// e.g. (Number of tracks)/mm2.
//
// Surface is defined at the inside of sphere.
// Direction -Rmin +Rmax
// 0 IN || OUT ->|<- | fFlux_InOut
// 1 IN ->| | fFlux_In
// 2 OUT |<- | fFlux_Out
//
// Created: 2005-11-14 Tsukasa ASO, Akinori Kimura.
// 17-Nov-2005 Bug fix. square definition.
// 29-Mar-2007 T.Aso, Bug fix for momentum direction at outgoing flux.
//
///////////////////////////////////////////////////////////////////////////////
class G4PSSphereSurfaceFlux : public G4VPrimitiveScorer
{
public: // with description
G4PSSphereSurfaceFlux(G4String name, G4int direction, G4int depth=0);
virtual ~G4PSSphereSurfaceFlux();
protected: // with description
virtual G4bool ProcessHits(G4Step*,G4TouchableHistory*);
G4int IsSelectedSurface(G4Step*,G4Sphere*);
public:
virtual void Initialize(G4HCofThisEvent*);
virtual void EndOfEvent(G4HCofThisEvent*);
virtual void clear();
virtual void DrawAll();
virtual void PrintAll();
private:
G4int HCID;
G4int fDirection;
G4THitsMap<G4double>* EvtMap;
};
#endif
@@ -1,86 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4PSTrackCounter.hh,v 1.2 2007/06/21 15:03:56 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
//
#ifndef G4PSTrackCounter_h
#define G4PSTrackCounter_h 1
#include "G4VPrimitiveScorer.hh"
#include "G4THitsMap.hh"
#include "G4PSDirectionFlag.hh"
//////////////////////////////////////////////////////////////////////////////////
// (Description)
// This is a primitive scorer class for scoring Number of Steps in the cell.
//
// Created: 2007-02-02 Tsukasa ASO, Akinori Kimura.
//
///////////////////////////////////////////////////////////////////////////////
class G4PSTrackCounter : public G4VPrimitiveScorer
{
public: // with description
G4PSTrackCounter(G4String name, G4int direction, G4int depth=0);
protected: // with description
virtual G4bool ProcessHits(G4Step*,G4TouchableHistory*);
public:
virtual ~G4PSTrackCounter();
inline void Weighted(G4bool flg=true) { weighted = flg; }
// Multiply track weight
public:
virtual void Initialize(G4HCofThisEvent*);
virtual void EndOfEvent(G4HCofThisEvent*);
virtual void clear();
public:
virtual void DrawAll();
virtual void PrintAll();
private:
G4int HCID;
G4int fDirection;
G4THitsMap<G4double>* EvtMap;
G4bool weighted;
public:
};
#endif
@@ -1,83 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4PSTrackLength.hh,v 1.5 2007/05/18 00:00:37 asaim Exp $
// GEANT4 tag $Name: geant4-09-00 $
//
#ifndef G4PSTrackLength_h
#define G4PSTrackLength_h 1
#include "G4VPrimitiveScorer.hh"
#include "G4THitsMap.hh"
////////////////////////////////////////////////////////////////////////////////
// (Description)
// This is a primitive scorer class for scoring track length.
//
//
// Created: 2005-11-14 Tsukasa ASO, Akinori Kimura.
// Modified: 2007-02-02 Tsukasa ASO, Add MultiolyKineticEnergy()
// and DivideByVelocity().
//
//
///////////////////////////////////////////////////////////////////////////////
class G4PSTrackLength : public G4VPrimitiveScorer
{
public: // with description
G4PSTrackLength(G4String name, G4int depth=0);
virtual ~G4PSTrackLength();
inline void Weighted(G4bool flg=true) { weighted = flg; }
// Multiply track weight
inline void MultiplyKineticEnergy(G4bool flg=true) { multiplyKinE = flg; }
// Multiply Kinetic Energy
inline void DivideByVelocity(G4bool flg=true) { divideByVelocity = flg; }
// Divide by velocity
protected: // with description
virtual G4bool ProcessHits(G4Step*,G4TouchableHistory*);
public:
virtual void Initialize(G4HCofThisEvent*);
virtual void EndOfEvent(G4HCofThisEvent*);
virtual void clear();
virtual void DrawAll();
virtual void PrintAll();
private:
G4int HCID;
G4THitsMap<G4double>* EvtMap;
G4bool weighted;
G4bool multiplyKinE;
G4bool divideByVelocity;
};
#endif
@@ -1,82 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4SDParticleFilter.hh,v 1.4 2007/05/18 00:00:37 asaim Exp $
// GEANT4 tag $Name: geant4-09-00 $
//
#ifndef G4SDParticleFilter_h
#define G4SDParticleFilter_h 1
class G4Step;
class G4ParticleDefinition;
#include "globals.hh"
#include "G4VSDFilter.hh"
#include <vector>
////////////////////////////////////////////////////////////////////////////////
// class description:
//
// This is the class of a filter to be associated with a
// sensitive detector.
// This class filters steps by partilce definition.
// The particles are given at constructor or add() method.
//
// Created: 2005-11-14 Tsukasa ASO.
//
///////////////////////////////////////////////////////////////////////////////
class G4SDParticleFilter : public G4VSDFilter
{
public: // with description
G4SDParticleFilter(G4String name);
G4SDParticleFilter(G4String name,const G4String& particleName);
G4SDParticleFilter(G4String name,
const std::vector<G4String>& particleNames);
G4SDParticleFilter(G4String name,
const std::vector<G4ParticleDefinition*>& particleDef);
// Constructors. Filter name and particle's name.
//
virtual ~G4SDParticleFilter();
public: // with description
virtual G4bool Accept(const G4Step*) const;
void add(const G4String& particleName);
// set method for acceptable particle name.
//
void show();
private:
std::vector<G4ParticleDefinition*> thePdef;
};
#endif
@@ -1,76 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4SDParticleWithEnergyFilter.hh,v 1.4 2007/05/18 00:00:37 asaim Exp $
// GEANT4 tag $Name: geant4-09-00 $
//
#ifndef G4SDParticleWithEnergyFilter_h
#define G4SDParticleWithEnergyFilter_h 1
class G4Step;
class G4ParticleDefinition;
#include "globals.hh"
#include "G4VSDFilter.hh"
#include "G4SDParticleFilter.hh"
#include "G4SDKineticEnergyFilter.hh"
////////////////////////////////////////////////////////////////////////////////
// class description:
//
// This is the class of a filter to be associated with a
// sensitive detector.
// This class filters steps by partilce definition and kinetic energy.
//
// Created: 2005-11-14 Tsukasa ASO.
//
///////////////////////////////////////////////////////////////////////////////
class G4SDParticleWithEnergyFilter : public G4VSDFilter
{
public: // with description
G4SDParticleWithEnergyFilter(G4String name,
G4double elow=0.0, G4double ehigh=DBL_MAX);
virtual ~G4SDParticleWithEnergyFilter();
public: // with description
virtual G4bool Accept(const G4Step*) const;
void add(const G4String& particleName);
// add the particle into accepatable particle list.
//
void SetKineticEnergy(G4double elow, G4double ehigh);
// Set acceptable kinetic energy range.
//
void show();
private:
G4SDParticleFilter* fParticleFilter;
G4SDKineticEnergyFilter* fKineticFilter;
};
#endif
@@ -0,0 +1,126 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4ScoreQuantityMessenger.hh,v 1.4 2007/11/06 17:17:14 asaim Exp $
// GEANT4 tag $Name: geant4-09-01 $
//
// (HISTORY)
// 03-Sep-2007 T.Aso Command definitions are introduced.
// 01-Nov-2007 M.Asai Class is splited into two.
#ifndef G4ScoreQuantityMessenger_h
#define G4ScoreQuantityMessenger_h 1
#include "G4UImessenger.hh"
#include <vector>
#include "G4String.hh"
class G4ScoringManager;
class G4VScoringMesh;
class G4UIdirectory;
class G4UIcmdWithAString;
class G4UIcommand;
typedef std::vector<G4String> G4TokenVec;
// class description:
//
// This is a concrete class of G4UImessenger which handles the commands for
// G4ScoringManager.
//
class G4ScoreQuantityMessenger: public G4UImessenger
{
public:
G4ScoreQuantityMessenger(G4ScoringManager * SManager);
~G4ScoreQuantityMessenger();
void SetNewValue(G4UIcommand * command,G4String newValues);
G4String GetCurrentValue(G4UIcommand * );
protected:
void FillTokenVec(G4String newValues,G4TokenVec& token);
void FParticleCommand(G4VScoringMesh* mesh,G4TokenVec& token);
void FParticleWithEnergyCommand(G4VScoringMesh* mesh,G4TokenVec& token);
private:
void QuantityCommands();
void FilterCommands();
private:
G4ScoringManager* fSMan;
//
// Quantity commands
G4UIdirectory* quantityDir;
G4UIcmdWithAString* qTouchCmd;
//
G4UIcmdWithAString* qCellChgCmd;
G4UIcmdWithAString* qCellFluxCmd;
G4UIcmdWithAString* qPassCellFluxCmd;
G4UIcmdWithAString* qeDepCmd;
G4UIcmdWithAString* qdoseDepCmd;
G4UIcmdWithAString* qnOfStepCmd;
G4UIcmdWithAString* qnOfSecondaryCmd;
//
G4UIcommand* qTrackLengthCmd;
G4UIcommand* qPassCellCurrCmd;
G4UIcommand* qPassTrackLengthCmd;
G4UIcommand* qFlatSurfCurrCmd;
G4UIcommand* qFlatSurfFluxCmd;
// G4UIcommand* qSphereSurfCurrCmd;
// G4UIcommand* qSphereSurfFluxCmd;
// G4UIcommand* qCylSurfCurrCmd;
// G4UIcommand* qCylSurfFluxCmd;
G4UIcommand* qNofCollisionCmd;
G4UIcommand* qPopulationCmd;
G4UIcommand* qTrackCountCmd;
G4UIcommand* qTerminationCmd;
//
// Filter commands
G4UIdirectory* filterDir;
G4UIcmdWithAString* fchargedCmd;
G4UIcmdWithAString* fneutralCmd;
G4UIcommand* fkinECmd;
G4UIcommand* fparticleCmd;
G4UIcommand* fparticleKinECmd;
//
};
#endif
@@ -24,58 +24,57 @@
// ********************************************************************
//
//
// $Id: G4SDKineticEnergyFilter.hh,v 1.4 2007/05/18 00:00:37 asaim Exp $
// GEANT4 tag $Name: geant4-09-00 $
// $Id: G4ScoringBox.hh,v 1.18 2007/11/06 09:41:34 akimura Exp $
// GEANT4 tag $Name: geant4-09-01 $
//
#ifndef G4SDKineticEnergyFilter_h
#define G4SDKineticEnergyFilter_h 1
#ifndef G4ScoringBox_h
#define G4ScoringBox_h 1
#include "globals.hh"
#include "G4VSDFilter.hh"
#include "G4VScoringMesh.hh"
#include "G4RotationMatrix.hh"
class G4VPhysicalVolume;
class G4LogicalVolume;
class G4VPrimitiveScorer;
class G4VScoreColorMap;
////////////////////////////////////////////////////////////////////////////////
// class description:
//
// This is the class of a filter to be associated with a
// sensitive detector.
//
// This filter accepts particles defined energy range.
// The energy range is given at constructor, or Set methods.
//
//
//
// Created: 2005-11-14 Tsukasa ASO.
//
///////////////////////////////////////////////////////////////////////////////
#include <vector>
class G4SDKineticEnergyFilter : public G4VSDFilter
class G4ScoringBox : public G4VScoringMesh
{
public:
G4ScoringBox(G4String wName);
~G4ScoringBox();
//-------
public: // with description
G4SDKineticEnergyFilter(G4String name,
G4double elow=0.0,
G4double ehigh=DBL_MAX);
// Constructor. Filter name and kinetic energy range( elow, ehigh).
public:
virtual void Construct(G4VPhysicalVolume* fWorldPhys);
virtual void List() const;
virtual void Draw(std::map<G4int, G4double*> * map, G4VScoreColorMap* colorMap, G4int axflg=111);
virtual void DrawColumn(std::map<G4int, G4double*> * map, G4VScoreColorMap* colorMap,
G4int idxProj, G4int idxColumn);
virtual ~G4SDKineticEnergyFilter();
// set a direction to segment this mesh
void SetSegmentDirection(G4int dir) {fSegmentDirection = dir;}
public: // with description
virtual G4bool Accept(const G4Step*) const;
void SetKineticEnergy(G4double elow, G4double ehigh);
void SetLowEnergy(G4double elow);
void SetHighEnergy(G4double ehigh);
// Set methods for kinetic energy range.
//
void show();
private:
G4double fLowEnergy;
G4double fHighEnergy;
private:
// construct this mesh
void SetupGeometry(G4VPhysicalVolume * fWorldPhys);
// get replicated position from 3D index (x,y,z)
G4ThreeVector GetReplicaPosition(G4int x, G4int y, G4int z);
// get 3D index (x,y,z) from sequential index
void GetXYZ(G4int index, G4int q[3]) const;
// get sequential index from 3D index (x,y,z)
G4int GetIndex(G4int x, G4int y, G4int z) const;
private:
G4int fSegmentDirection; // =1: x, =2: y, =3: z
G4LogicalVolume * fMeshElementLogical;
};
#endif
@@ -0,0 +1,88 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
#ifndef G4ScoringBoxParametrisation_H
#define G4ScoringBoxParametrisation_H 1
#include "globals.hh"
#include "geomdefs.hh"
#include "G4VPVParameterisation.hh"
#include <vector>
class G4VPhysicalVolume;
class G4Box;
// Dummy declarations to get rid of warnings ...
class G4Tubs;
class G4Trd;
class G4Trap;
class G4Cons;
class G4Orb;
class G4Sphere;
class G4Torus;
class G4Para;
class G4Hype;
class G4Polycone;
class G4Polyhedra;
class G4ScoringBoxParameterisation : public G4VPVParameterisation {
public:
G4ScoringBoxParameterisation(EAxis segaxis,
G4double motherDimension[3],
std::vector<G4double> & segpos);
virtual ~G4ScoringBoxParameterisation();
void ComputeTransformation(const G4int copyNo,
G4VPhysicalVolume *physVol) const;
void ComputeDimensions(G4Box & meshElement,
const G4int copyNo,
const G4VPhysicalVolume * physVol) const;
private: // Dummy declarations to get rid of warnings ...
void ComputeDimensions (G4Trd&,const G4int,const G4VPhysicalVolume*) const {}
void ComputeDimensions (G4Trap&,const G4int,const G4VPhysicalVolume*) const {}
void ComputeDimensions (G4Cons&,const G4int,const G4VPhysicalVolume*) const {}
void ComputeDimensions (G4Orb&,const G4int,const G4VPhysicalVolume*) const {}
void ComputeDimensions (G4Sphere&,const G4int,const G4VPhysicalVolume*) const {}
void ComputeDimensions (G4Torus&,const G4int,const G4VPhysicalVolume*) const {}
void ComputeDimensions (G4Para&,const G4int,const G4VPhysicalVolume*) const {}
void ComputeDimensions (G4Hype&,const G4int,const G4VPhysicalVolume*) const {}
void ComputeDimensions (G4Tubs&,const G4int,const G4VPhysicalVolume*) const {}
void ComputeDimensions (G4Polycone&,const G4int,const G4VPhysicalVolume*) const {}
void ComputeDimensions (G4Polyhedra&,const G4int,const G4VPhysicalVolume*) const {}
private:
EAxis fSegmentAxis;
G4double fMotherDimensions[3];
std::vector<G4double> fSegmentPositions;
};
#endif
@@ -0,0 +1,154 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4ScoringManager.hh,v 1.23 2007/11/14 20:41:17 asaim Exp $
// GEANT4 tag $Name: geant4-09-01 $
//
#ifndef G4ScoringManager_h
#define G4ScoringManager_h 1
#include "globals.hh"
#include "G4VScoringMesh.hh"
#include <vector>
#include <map>
class G4ScoringMessenger;
class G4ScoreQuantityMessenger;
class G4VHitsCollection;
class G4VScoreColorMap;
#include "G4VScoreWriter.hh"
// class description:
//
// This is a singleton class which manages the interactive scoring.
// The user cannot access to the constructor. The pointer of the
// only existing object can be got via G4ScoringManager::GetScoringManager()
// static method. The first invokation of this static method makes
// the singleton object.
//
typedef std::vector<G4VScoringMesh*> MeshVec;
typedef std::vector<G4VScoringMesh*>::iterator MeshVecItr;
typedef std::vector<G4VScoringMesh*>::const_iterator MeshVecConstItr;
typedef std::map<G4String,G4VScoreColorMap*> ColorMapDict;
typedef std::map<G4String,G4VScoreColorMap*>::iterator ColorMapDictItr;
typedef std::map<G4String,G4VScoreColorMap*>::const_iterator ColorMapDictConstItr;
class G4ScoringManager
{
public: // with description
static G4ScoringManager* GetScoringManager();
// Returns the pointer to the singleton object.
public:
static G4ScoringManager* GetScoringManagerIfExist();
public:
static void SetReplicaLevel(G4int);
static G4int GetReplicaLevel();
protected:
G4ScoringManager();
public:
~G4ScoringManager();
public: // with description
void RegisterScoreColorMap(G4VScoreColorMap* colorMap);
// Register a color map. Once registered, it is available by /score/draw and /score/drawColumn
// commands.
public:
void Accumulate(G4VHitsCollection* map);
G4VScoringMesh* FindMesh(G4String);
void List() const;
void Dump() const;
void DrawMesh(G4String meshName,G4String psName,G4String colorMapName,G4int axflg=111);
void DrawMesh(G4String meshName,G4String psName,G4int idxPlane,G4int iColumn,G4String colorMapName);
void DumpQuantityToFile(G4String meshName, G4String psName,G4String fileName, G4String option = "");
void DumpAllQuantitiesToFile(G4String meshName, G4String fileName, G4String option = "");
G4VScoreColorMap* GetScoreColorMap(G4String mapName);
void ListScoreColorMaps();
private:
static G4ScoringManager * fSManager;
static G4int replicaLevel;
G4int verboseLevel;
G4ScoringMessenger* fMessenger;
G4ScoreQuantityMessenger* fQuantityMessenger;
MeshVec fMeshVec;
G4VScoringMesh* fCurrentMesh;
G4VScoreWriter * writer;
G4VScoreColorMap * fDefaultLinearColorMap;
ColorMapDict * fColorMapDict;
public:
inline void SetCurrentMesh(G4VScoringMesh* cm)
{ fCurrentMesh = cm; }
inline G4VScoringMesh* GetCurrentMesh() const
{ return fCurrentMesh; }
inline void CloseCurrentMesh()
{ fCurrentMesh = 0; }
inline void SetVerboseLevel(G4int vl)
{
verboseLevel = vl;
for(MeshVecItr itr = fMeshVec.begin(); itr != fMeshVec.end(); itr++) {
(*itr)->SetVerboseLevel(vl);
}
if(writer) writer->SetVerboseLevel(vl);
}
inline G4int GetVerboseLevel() const
{ return verboseLevel; }
inline size_t GetNumberOfMesh() const
{ return fMeshVec.size(); }
inline void RegisterScoringMesh(G4VScoringMesh * sm)
{
sm->SetVerboseLevel(verboseLevel);
fMeshVec.push_back(sm);
SetCurrentMesh(sm);
}
inline G4VScoringMesh* GetMesh(G4int i) const
{ return fMeshVec[i]; }
inline G4String GetWorldName(G4int i) const
{ return fMeshVec[i]->GetWorldName(); }
public: // with description
inline void SetScoreWriter(G4VScoreWriter * sw)
{
if(writer) { delete writer; }
writer = sw;
if(writer) writer->SetVerboseLevel(verboseLevel);
}
// Replace score writers.
};
#endif
@@ -0,0 +1,138 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4ScoringMessenger.hh,v 1.21 2007/11/07 04:12:07 akimura Exp $
// GEANT4 tag $Name: geant4-09-01 $
//
// (HISTORY)
// 03-Sep-2007 T.Aso Command definitions are introduced.
// 01-Nov-2007 M.Asai Class is splitted into two.
#ifndef G4ScoringMessenger_h
#define G4ScoringMessenger_h 1
#include "G4UImessenger.hh"
#include <vector>
#include "G4String.hh"
class G4ScoringManager;
class G4VScoringMesh;
class G4UIdirectory;
class G4UIcmdWithoutParameter;
class G4UIcmdWithAString;
class G4UIcmdWithABool;
class G4UIcmdWithAnInteger;
class G4UIcmdWithADoubleAndUnit;
class G4UIcmdWith3VectorAndUnit;
class G4UIcommand;
typedef std::vector<G4String> G4TokenVec;
// class description:
//
// This is a concrete class of G4UImessenger which handles the commands for
// G4ScoringManager.
//
class G4ScoringMessenger: public G4UImessenger
{
public:
G4ScoringMessenger(G4ScoringManager * SManager);
~G4ScoringMessenger();
void SetNewValue(G4UIcommand * command,G4String newValues);
G4String GetCurrentValue(G4UIcommand * command);
protected:
void FillTokenVec(G4String newValues,G4TokenVec& token);
void MeshBinCommand(G4VScoringMesh* mesh, G4TokenVec& token);
private:
G4ScoringManager* fSMan;
G4UIdirectory* scoreDir;
G4UIcmdWithoutParameter* listCmd;
G4UIcmdWithoutParameter* dumpCmd;
G4UIcmdWithAnInteger* verboseCmd;
//
G4UIdirectory* meshCreateDir;
G4UIcmdWithAString* meshBoxCreateCmd;
// G4UIcmdWithAString* meshTubsCreateCmd;
// G4UIcmdWithAString* meshSphereCreateCmd;
//
// Mesh commands
G4UIdirectory* meshDir;
G4UIcmdWithAString* meshOpnCmd;
//
G4UIcmdWithoutParameter* meshClsCmd;
// G4UIcmdWithABool* meshActCmd;
//
// Size commands
G4UIcmdWith3VectorAndUnit* mBoxSizeCmd;
G4UIcmdWith3VectorAndUnit* mTubsSizeCmd;
G4UIcmdWith3VectorAndUnit* mSphereSizeCmd;
//
// Division command
G4UIcommand* mBinCmd;
//
// Placement command
G4UIdirectory* mTransDir;
G4UIcmdWithoutParameter* mTResetCmd;
G4UIcmdWith3VectorAndUnit* mTXyzCmd;
G4UIdirectory* mRotDir;
G4UIcmdWithoutParameter* mRResetCmd;
G4UIcmdWithADoubleAndUnit* mRotXCmd;
G4UIcmdWithADoubleAndUnit* mRotYCmd;
G4UIcmdWithADoubleAndUnit* mRotZCmd;
//
// Draw Command
G4UIcommand * drawCmd;
G4UIcommand * drawColumnCmd;
G4UIdirectory * colorMapDir;
G4UIcmdWithoutParameter * listColorMapCmd;
G4UIcmdWithAString * floatMinMaxCmd;
G4UIcommand * colorMapMinMaxCmd;
//
// Dump scoring result to file
G4UIcommand * dumpQtyToFileCmd;
G4UIcommand * dumpAllQtsToFileCmd;
//
};
#endif
@@ -24,56 +24,50 @@
// ********************************************************************
//
//
// $Id: G4PSNofSecondary.hh,v 1.3 2007/05/18 00:00:37 asaim Exp $
// GEANT4 tag $Name: geant4-09-00 $
// $Id: G4VScoreColorMap.hh,v 1.3 2007/11/06 17:17:14 asaim Exp $
// GEANT4 tag $Name: geant4-09-01 $
//
#ifndef G4PSNofSecondary_h
#define G4PSNofSecondary_h 1
#ifndef G4VScoreColorMap_h
#define G4VScoreColorMap_h 1
#include "G4VPrimitiveScorer.hh"
#include "G4THitsMap.hh"
#include "globals.hh"
////////////////////////////////////////////////////////////////////////////////
// (Description)
// This is a primitive scorer class for scoring Number of particles
// generated in the geometry.
//
// Created: 2005-11-18 Tsukasa ASO, Akinori Kimura.
//
///////////////////////////////////////////////////////////////////////////////
class G4PSNofSecondary : public G4VPrimitiveScorer
class G4VScoreColorMap
{
public: // with description
G4PSNofSecondary(G4String name, G4int depth=0);
protected: // with description
virtual G4bool ProcessHits(G4Step*,G4TouchableHistory*);
public:
G4VScoreColorMap(G4String mName);
virtual ~G4VScoreColorMap();
public:
virtual ~G4PSNofSecondary();
public:
virtual void Initialize(G4HCofThisEvent*);
virtual void EndOfEvent(G4HCofThisEvent*);
virtual void clear();
virtual void GetMapColor(G4double val, G4double color[4]) = 0;
public:
virtual void DrawAll();
virtual void PrintAll();
private:
G4int HCID;
G4THitsMap<G4double>* EvtMap;
public:
inline G4String GetName() const
{ return fName; }
inline void SetFloatingMinMax(G4bool vl=true)
{ ifFloat = vl; }
inline G4bool IfFloatMinMax() const
{ return ifFloat; }
inline void SetMinMax(G4double minVal, G4double maxVal)
{
if(fMinVal >= fMaxVal)
{ G4cerr << "G4VScoreColoMap::SetMinMax() : minimum is larger than maximum. Verify values you set, ["
<< fMinVal << ", " << fMaxVal << "]" << G4endl; }
else
{ fMinVal = minVal; fMaxVal = maxVal; }
}
inline G4double GetMin() const
{ return fMinVal; }
inline G4double GetMax() const
{ return fMaxVal; }
protected:
G4String fName;
G4bool ifFloat;
G4double fMinVal;
G4double fMaxVal;
};
#endif
@@ -24,39 +24,48 @@
// ********************************************************************
//
//
// $Id: G4SDNeutralFilter.hh,v 1.4 2007/05/18 00:00:37 asaim Exp $
// GEANT4 tag $Name: geant4-09-00 $
// $Id: G4VScoreWriter.hh,v 1.2 2007/11/06 09:41:34 akimura Exp $
// GEANT4 tag $Name: geant4-09-01 $
//
#ifndef G4SDNeutralFilter_h
#define G4SDNeutralFilter_h 1
#ifndef G4VScoreWriter_h
#define G4VScoreWriter_h 1
class G4Step;
class G4NeutralDefinition;
#include "globals.hh"
#include "G4VSDFilter.hh"
class G4VScoringMesh;
////////////////////////////////////////////////////////////////////////////////
// class description:
//
// This is the class of a filter to be associated with a
// sensitive detector.
// This class represents storing the scored quantity into a file.
//
// This filter accepts neutral tracks.
//
// Created: 2005-11-14 Tsukasa ASO.
//
///////////////////////////////////////////////////////////////////////////////
class G4SDNeutralFilter : public G4VSDFilter
{
class G4VScoreWriter {
public: // with description
G4SDNeutralFilter(G4String name);
virtual ~G4SDNeutralFilter();
public:
G4VScoreWriter();
virtual ~G4VScoreWriter();
public: // with description
virtual G4bool Accept(const G4Step*) const;
public:
// store a quantity into a file
virtual void DumpQuantityToFile(G4String & psName, G4String & fileName, G4String & option);
// store all quantities into a file
virtual void DumpAllQuantitiesToFile(G4String & fileName, G4String & option);
// set a socring mesh to retrieve its quantities
void SetScoringMesh(G4VScoringMesh * sm);
// set a verbose level
inline void SetVerboseLevel(G4int vl) {
verboseLevel = vl;
}
protected:
// get an index from (x,y,z)
G4int GetIndex(G4int x, G4int y, G4int z) const;
protected:
G4int fNMeshSegments[3]; // number of segments of the mesh
G4VScoringMesh * fScoringMesh;
G4int verboseLevel;
};
@@ -0,0 +1,202 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4VScoringMesh.hh,v 1.27 2007/11/06 17:17:14 asaim Exp $
// GEANT4 tag $Name: geant4-09-01 $
//
#ifndef G4VScoringMesh_h
#define G4VScoringMesh_h 1
#include "globals.hh"
#include "G4THitsMap.hh"
#include "G4RotationMatrix.hh"
class G4VPhysicalVolume;
class G4MultiFunctionalDetector;
class G4VPrimitiveScorer;
class G4VSDFilter;
class G4VScoreColorMap;
#include <map>
enum MeshShape { boxMesh, cylinderMesh, sphereMesh };
typedef std::map<G4String,G4THitsMap<G4double>* > MeshScoreMap;
// class description:
//
// This class represents a parallel world for interactive scoring purposes.
//
class G4VScoringMesh
{
public:
G4VScoringMesh(G4String wName);
~G4VScoringMesh();
public: // with description
// a pure virtual function to construct this mesh geometry
virtual void Construct(G4VPhysicalVolume* fWorldPhys)=0;
// list infomration of this mesh
virtual void List() const;
public: // with description
// get the world name
inline const G4String& GetWorldName() const
{ return fWorldName; }
// get whether this mesh is active or not
inline G4bool IsActive() const
{ return fActive; }
// set an activity of this mesh
inline void Activate(G4bool vl = true)
{ fActive = vl; }
// get the shape of this mesh
inline MeshShape GetShape() const
{ return fShape; }
// accumulate hits in a registered primitive scorer
inline void Accumulate(G4THitsMap<G4double> * map);
// dump information of primitive socrers registered in this mesh
void Dump();
// draw a projected quantity on a current viewer
inline void DrawMesh(G4String psName,G4VScoreColorMap* colorMap,G4int axflg=111);
// draw a column of a quantity on a current viewer
inline void DrawMesh(G4String psName,G4int idxPlane,G4int iColumn,G4VScoreColorMap* colorMap);
// draw a projected quantity on a current viewer
virtual void Draw(std::map<G4int, G4double*> * map, G4VScoreColorMap* colorMap, G4int axflg=111) = 0;
// draw a column of a quantity on a current viewer
virtual void DrawColumn(std::map<G4int, G4double*> * map, G4VScoreColorMap* colorMap,
G4int idxProj, G4int idxColumn) = 0;
// reset registered primitive scorers
void ResetScore();
// set size of this mesh
void SetSize(G4double size[3]);
// set position of center of this mesh
void SetCenterPosition(G4double centerPosition[3]);
// set a rotation angle around the x axis
void RotateX(G4double delta);
// set a rotation angle around the y axis
void RotateY(G4double delta);
// set a rotation angle around the z axis
void RotateZ(G4double delta);
// set number of segments of this mesh
void SetNumberOfSegments(G4int nSegment[3]);
// get number of segments of this mesh
void GetNumberOfSegments(G4int nSegment[3]);
// set positions to segment this mesh
inline void SetSegmentPositions(std::vector<G4double> & sp) {fSegmentPositions = sp;}
// register a primitive scorer to the MFD & set it to the current primitive scorer
void SetPrimitiveScorer(G4VPrimitiveScorer * ps);
// register a filter to a current primtive scorer
void SetFilter(G4VSDFilter * filter);
// set a primitive scorer to the current one by the name
void SetCurrentPrimitiveScorer(G4String & name);
// find registered primitive scorer by the name
G4bool FindPrimitiveScorer(G4String & psname);
// get whether current primitive scorer is set or not
G4bool IsCurrentPrimitiveScorerNull() {
if(fCurrentPS == NULL) return true;
else return false;
}
// set current primitive scorer to NULL
void SetNullToCurrentPrimitiveScorer() {fCurrentPS = NULL;}
// set verbose level
inline void SetVerboseLevel(G4int vl)
{ verboseLevel = vl; }
// get the primitive scorer map
MeshScoreMap GetScoreMap() {return fMap;}
// get whether this mesh setup has been ready
inline G4bool ReadyForQuantity() const
{ return (sizeIsSet && nMeshIsSet); }
protected:
// get registered primitive socrer by the name
G4VPrimitiveScorer * GetPrimitiveScorer(G4String & name);
protected:
G4String fWorldName;
G4VPrimitiveScorer * fCurrentPS;
G4bool fConstructed;
G4bool fActive;
MeshShape fShape;
G4double fSize[3];
G4ThreeVector fCenterPosition;
G4RotationMatrix * fRotationMatrix;
G4int fNSegment[3];
std::vector<G4double> fSegmentPositions;
std::map<G4String, G4THitsMap<G4double>* > fMap;
G4MultiFunctionalDetector * fMFD;
G4int verboseLevel;
G4bool sizeIsSet;
G4bool nMeshIsSet;
};
void G4VScoringMesh::Accumulate(G4THitsMap<G4double> * map)
{
G4String psName = map->GetName();
std::map<G4String, G4THitsMap<G4double>* >::const_iterator fMapItr = fMap.find(psName);
*(fMapItr->second) += *map;
if(verboseLevel > 9) {
G4cout << G4endl;
G4cout << "G4VScoringMesh::Accumulate()" << G4endl;
G4cout << " PS name : " << psName << G4endl;
if(fMapItr == fMap.end()) {
G4cout << " "
<< psName << " was not found." << G4endl;
} else {
G4cout << " map size : " << map->GetSize() << G4endl;
map->PrintAllHits();
}
G4cout << G4endl;
}
}
void G4VScoringMesh::DrawMesh(G4String psName,G4VScoreColorMap* colorMap,G4int axflg)
{
std::map<G4String, G4THitsMap<G4double>* >::const_iterator fMapItr = fMap.find(psName);
if(fMapItr!=fMap.end())
{ Draw(fMapItr->second->GetMap(),colorMap,axflg); }
else
{ G4cerr << "Scorer <" << psName << "> is not defined. Method ignored." << G4endl; }
}
void G4VScoringMesh::DrawMesh(G4String psName,G4int idxPlane,G4int iColumn,G4VScoreColorMap* colorMap)
{
std::map<G4String, G4THitsMap<G4double>* >::const_iterator fMapItr = fMap.find(psName);
if(fMapItr!=fMap.end())
{ DrawColumn(fMapItr->second->GetMap(),colorMap,idxPlane,iColumn); }
else
{ G4cerr << "Scorer <" << psName << "> is not defined. Method ignored." << G4endl; }
}
#endif