Import Geant4 4.0.0 source tree
This commit is contained in:
+23
-35
@@ -38,6 +38,9 @@
|
||||
// CHANGE HISTORY
|
||||
// --------------
|
||||
//
|
||||
// 07.12.2001 A.Pfeiffer
|
||||
// - merged with Guy Barrand's AIDA 2.2 port
|
||||
//
|
||||
// 30.11.2000 M.G. Pia, R. Nartallo
|
||||
// - Simplification of code
|
||||
// - Inheritance directly from the base class G4VAnalysisManager instead
|
||||
@@ -49,59 +52,44 @@
|
||||
//
|
||||
// **********************************************************************
|
||||
|
||||
#ifndef XrayTelAnalysisManager_h
|
||||
#define XrayTelAnalysisManager_h 1
|
||||
|
||||
#include "G4VAnalysisManager.hh"
|
||||
#ifndef XrayTelAnalysis_h
|
||||
#define XrayTelAnalysis_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "g4std/vector"
|
||||
#include "G4ThreeVector.hh"
|
||||
class G4SteppingManager;
|
||||
class G4VAnalysisSystem;
|
||||
|
||||
#ifdef G4ANALYSIS_USE
|
||||
class IHistogramFactory;
|
||||
class G4Track;
|
||||
|
||||
class IAnalysisFactory;
|
||||
class ITree;
|
||||
class IHistogram1D;
|
||||
class IHistogram2D;
|
||||
#endif
|
||||
class IPlotter;
|
||||
|
||||
#ifdef G4ANALYSIS_USE
|
||||
class XrayTelAnalysisManager: public G4VAnalysisManager {
|
||||
#endif
|
||||
#ifndef G4ANALYSIS_USE
|
||||
class XrayTelAnalysisManager {
|
||||
#endif
|
||||
class XrayTelAnalysis {
|
||||
public:
|
||||
XrayTelAnalysisManager(const G4String&);
|
||||
~XrayTelAnalysisManager();
|
||||
|
||||
G4bool RegisterAnalysisSystem(G4VAnalysisSystem*);
|
||||
virtual ~XrayTelAnalysis();
|
||||
|
||||
#ifdef G4ANALYSIS_USE
|
||||
IHistogramFactory* GetHistogramFactory(const G4String&);
|
||||
void book();
|
||||
void finish();
|
||||
void analyseStepping(const G4Track& track, G4bool entering);
|
||||
|
||||
virtual void Store(IHistogram* = 0,const G4String& = "");
|
||||
virtual void Plot(IHistogram*);
|
||||
#endif
|
||||
|
||||
void BeginOfRun();
|
||||
void EndOfRun();
|
||||
void Step(const G4SteppingManager*);
|
||||
static XrayTelAnalysis* getInstance(int = 0, char** = 0);
|
||||
|
||||
private:
|
||||
G4VAnalysisSystem* analysisSystem;
|
||||
|
||||
#ifdef G4ANALYSIS_USE
|
||||
IHistogramFactory* hFactory;
|
||||
XrayTelAnalysis(int,char**);
|
||||
|
||||
static XrayTelAnalysis* instance;
|
||||
|
||||
IAnalysisFactory* analysisFactory;
|
||||
ITree* tree;
|
||||
IHistogram1D* enteringEnergyHistogram;
|
||||
IHistogram2D* yzHistogram;
|
||||
#endif
|
||||
IPlotter* plotter;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,126 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: XrayTelAnalysis.hh-Anaphe,v 1.1 2001/12/10 16:06:37 pfeiffer Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
// Author: A. Pfeiffer (Andreas.Pfeiffer@cern.ch)
|
||||
// (copy of his UserAnalyser class)
|
||||
//
|
||||
// History:
|
||||
// -----------
|
||||
// 7 Nov 2001 MGP Implemented according to A. Pfeiffer's instructions
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
// Class description:
|
||||
// Example of analysis in a simulation application (histograms, ntuples etc.)
|
||||
// This class follows the singleton design pattern;
|
||||
// it is responsible for the analysis management and algorithms
|
||||
// Histograms are compliant with AIDA 1.0 (the header files are
|
||||
// copies from the Anaphe Interfaces directory), except for the usage of
|
||||
// IHistoManager which is Anaphe/Lizard-specific
|
||||
// For ntuples, for which the AIDA interfaces and compliant implementations
|
||||
// are still in progress at the time of the current Geant4 release,
|
||||
// an implementation with Anaphe/Lizard is shown
|
||||
// Other implementations specific to an analysis system are possible too
|
||||
// (see, for instance, JAS and OpenScientist documentation from the links
|
||||
// in http://aida.freehep.org/)
|
||||
// The implementation of the usage of ntuples shown in this example
|
||||
// is expected to change in future Geant4 releases, when AIDA interfaces
|
||||
// and related implementations would be available
|
||||
// Further documentation is available from: http://www.ge.infn.it/geant4/lowE/
|
||||
// http://aida.freehep.org/
|
||||
// http://cern.ch/anaphe/
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
#ifndef G4PROCESSTESTANALYSIS_HH
|
||||
#define G4PROCESSTESTANALYSIS_HH
|
||||
|
||||
#include "globals.hh"
|
||||
|
||||
// Histogramming from AIDA (through their copy in Anaphe)
|
||||
#include "Interfaces/IHistogram1D.h"
|
||||
#include "Interfaces/IHistogram2D.h"
|
||||
|
||||
// Histogramming from Anaphe
|
||||
#include "Interfaces/IHistoManager.h"
|
||||
|
||||
// Ntuples from Anaphe
|
||||
#include "NtupleTag/LizardNTupleFactory.h"
|
||||
#include "NtupleTag/LizardQuantity.h"
|
||||
|
||||
// Vectors from Anaphe
|
||||
#include "Interfaces/IVector.h"
|
||||
#include "Interfaces/IVectorFactory.h"
|
||||
|
||||
// Plotting from Anaphe
|
||||
#include "Interfaces/IPlotter.h"
|
||||
|
||||
class G4Track;
|
||||
class NTuple;
|
||||
|
||||
class XrayTelAnalysis
|
||||
{
|
||||
public:
|
||||
|
||||
~XrayTelAnalysis();
|
||||
|
||||
void book();
|
||||
|
||||
void finish();
|
||||
|
||||
void analyseStepping(const G4Track& track, G4bool entering);
|
||||
|
||||
static XrayTelAnalysis* getInstance();
|
||||
|
||||
private:
|
||||
|
||||
XrayTelAnalysis();
|
||||
|
||||
void plot1D(IHistogram1D* histo);
|
||||
void plot2D(IHistogram2D* histo);
|
||||
|
||||
static XrayTelAnalysis* instance;
|
||||
|
||||
IHistoManager* histoManager;
|
||||
IVectorFactory* vectorFactory;
|
||||
IPlotter* plotter;
|
||||
|
||||
// ---- NOTE ----
|
||||
// Histograms are compliant to AIDA interfaces, ntuples are Lizard specific
|
||||
|
||||
Lizard::NTuple* ntuple;
|
||||
Lizard::NTupleFactory* ntFactory;
|
||||
|
||||
// Quantities for the ntuple
|
||||
Lizard::Quantity<float> eKin;
|
||||
Lizard::Quantity<float> y;
|
||||
Lizard::Quantity<float> z;
|
||||
Lizard::Quantity<float> dirX;
|
||||
Lizard::Quantity<float> dirY;
|
||||
Lizard::Quantity<float> dirZ;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -28,8 +28,8 @@
|
||||
// * MODULE: XrayTelEventAction.hh *
|
||||
// * ------- *
|
||||
// * *
|
||||
// * Version: 0.4 *
|
||||
// * Date: 06/11/00 *
|
||||
// * Version: 0.5 *
|
||||
// * Date: 16/10/01 *
|
||||
// * Author: R Nartallo *
|
||||
// * Organisation: ESA/ESTEC, Noordwijk, THe Netherlands *
|
||||
// * *
|
||||
@@ -38,6 +38,12 @@
|
||||
// CHANGE HISTORY
|
||||
// --------------
|
||||
//
|
||||
// 05.12.2001 R.Nartallo
|
||||
// - Add "Update" function as in LowEnTest
|
||||
//
|
||||
// 16.10.2001 R.Nartallo
|
||||
// - Clean up code to avoid 'pedantic' and 'ANSI' compiler warnings
|
||||
//
|
||||
// 06.11.2000 R.Nartallo
|
||||
// - First implementation of X-ray Telescope advanced example.
|
||||
// - Based on Chandra and XMM models
|
||||
@@ -53,24 +59,25 @@
|
||||
|
||||
class XrayTelEventActionMessenger;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
class XrayTelEventAction : public G4UserEventAction
|
||||
{
|
||||
public:
|
||||
XrayTelEventAction(G4bool* dEvent);
|
||||
|
||||
XrayTelEventAction();
|
||||
~XrayTelEventAction();
|
||||
|
||||
public:
|
||||
void BeginOfEventAction(const G4Event* anEvent);
|
||||
void EndOfEventAction(const G4Event* anEvent);
|
||||
|
||||
void SetDrawFlag(G4String val) {drawFlag = val;};
|
||||
|
||||
|
||||
void Update();
|
||||
|
||||
private:
|
||||
G4bool* drawEvent;
|
||||
|
||||
G4String drawFlag; // control the drawing of event
|
||||
XrayTelEventActionMessenger* eventMessenger;
|
||||
G4bool drawEvent;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -28,8 +28,8 @@
|
||||
// * MODULE: XrayTelRunAction.hh *
|
||||
// * ------- *
|
||||
// * *
|
||||
// * Version: 0.4 *
|
||||
// * Date: 06/11/00 *
|
||||
// * Version: 0.5 *
|
||||
// * Date: 16/10/01 *
|
||||
// * Author: R Nartallo *
|
||||
// * Organisation: ESA/ESTEC, Noordwijk, THe Netherlands *
|
||||
// * *
|
||||
@@ -38,6 +38,12 @@
|
||||
// CHANGE HISTORY
|
||||
// --------------
|
||||
//
|
||||
// 07.11.2001 M.G. Pia
|
||||
// - Modified the analysis management
|
||||
//
|
||||
// 16.10.2001 R.Nartallo
|
||||
// - Clean up code to avoid 'pedantic' and 'ANSI' compiler warnings
|
||||
//
|
||||
// 06.11.2000 R.Nartallo
|
||||
// - First implementation of X-ray Telescope advanced example.
|
||||
// - Based on Chandra and XMM models
|
||||
@@ -49,34 +55,28 @@
|
||||
#define XrayTelRunAction_h 1
|
||||
|
||||
#include "G4UserRunAction.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
#include "globals.hh"
|
||||
#include "g4std/vector"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
class G4Run;
|
||||
class XrayTelAnalysisManager;
|
||||
|
||||
class XrayTelRunAction : public G4UserRunAction
|
||||
{
|
||||
public:
|
||||
XrayTelRunAction(G4std::vector<G4double*> *enEnergy,
|
||||
G4std::vector<G4ThreeVector*> *enDirect,
|
||||
G4bool* dEvent,
|
||||
XrayTelAnalysisManager* = 0);
|
||||
XrayTelRunAction();
|
||||
|
||||
~XrayTelRunAction();
|
||||
|
||||
public:
|
||||
void BeginOfRunAction(const G4Run*);
|
||||
|
||||
void EndOfRunAction(const G4Run*);
|
||||
|
||||
private:
|
||||
G4bool* drawEvent;
|
||||
G4std::vector<G4double*>* enteringEnergy;
|
||||
G4std::vector<G4ThreeVector*>* enteringDirection;
|
||||
void Update(G4double energy);
|
||||
|
||||
private:
|
||||
|
||||
G4int nEnteringTracks;
|
||||
G4double totEnteringEnergy;
|
||||
|
||||
XrayTelAnalysisManager* fAnalysisManager;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -28,8 +28,8 @@
|
||||
// * MODULE: XrayTelSteppingAction.hh *
|
||||
// * ------- *
|
||||
// * *
|
||||
// * Version: 0.4 *
|
||||
// * Date: 06/11/00 *
|
||||
// * Version: 0.5 *
|
||||
// * Date: 16/10/01 *
|
||||
// * Author: R Nartallo *
|
||||
// * Organisation: ESA/ESTEC, Noordwijk, THe Netherlands *
|
||||
// * *
|
||||
@@ -38,6 +38,12 @@
|
||||
// CHANGE HISTORY
|
||||
// --------------
|
||||
//
|
||||
// 07.11.2001 M.G. Pia
|
||||
// - Modified the analysis management
|
||||
//
|
||||
// 16.10.2001 R.Nartallo
|
||||
// - Clean up code to avoid 'pedantic' and 'ANSI' compiler warnings
|
||||
//
|
||||
// 06.11.2000 R.Nartallo
|
||||
// - First implementation of X-ray Telescope advanced example.
|
||||
// - Based on Chandra and XMM models
|
||||
@@ -48,32 +54,22 @@
|
||||
#ifndef XrayTelSteppingAction_h
|
||||
#define XrayTelSteppingAction_h 1
|
||||
|
||||
class XrayTelAnalysisManager;
|
||||
|
||||
#include "G4UserSteppingAction.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
#include "g4std/vector"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
class G4Step;
|
||||
|
||||
class XrayTelSteppingAction : public G4UserSteppingAction
|
||||
{
|
||||
public:
|
||||
XrayTelSteppingAction(
|
||||
G4std::vector<G4double*> *enEnergy,
|
||||
G4std::vector<G4ThreeVector*> *enDirect,
|
||||
G4bool* dEvent,
|
||||
XrayTelAnalysisManager* = 0);
|
||||
|
||||
XrayTelSteppingAction();
|
||||
|
||||
virtual ~XrayTelSteppingAction();
|
||||
|
||||
virtual void UserSteppingAction(const G4Step*);
|
||||
virtual void UserSteppingAction(const G4Step* step);
|
||||
|
||||
private:
|
||||
G4bool* drawEvent;
|
||||
G4std::vector<G4double*>* enteringEnergy;
|
||||
G4std::vector<G4ThreeVector*>* enteringDirection;
|
||||
|
||||
XrayTelAnalysisManager* fAnalysisManager;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user