Import Geant4 6.2.0 source tree
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
# $Id: GNUmakefile,v 1.6 2003/11/13 12:00:27 vnivanch Exp $
|
||||
# GEANT4 tag $Name: geant4-06-00-patch-01 $
|
||||
# $Id: GNUmakefile,v 1.7 2004/05/27 13:43:17 vnivanch Exp $
|
||||
# GEANT4 tag $Name: geant4-06-02 $
|
||||
# --------------------------------------------------------------
|
||||
# GNUmakefile for examples module with AIDA interface
|
||||
# --------------------------------------------------------------
|
||||
@@ -29,7 +29,7 @@ endif
|
||||
|
||||
include $(G4INSTALL)/config/binmake.gmk
|
||||
|
||||
analclean:
|
||||
histclean:
|
||||
rm -f $(G4WORKDIR)/tmp/$(G4SYSTEM)/$(G4TARGET)/Histo.o
|
||||
|
||||
visclean:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
$Id: History,v 1.16 2003/12/05 11:22:45 vnivanch Exp $
|
||||
$Id: History,v 1.17 2004/05/27 13:43:17 vnivanch Exp $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
@@ -16,6 +16,11 @@ track of all tags.
|
||||
|
||||
----------------------------------------------------------
|
||||
|
||||
05-12-03 V.Ivanchenko (testem9-V06-01-00)
|
||||
- Remove Clean of G4RegionStore, instead delete regions one by one
|
||||
- Add acceptance printout
|
||||
- Add histclean target into GNUmakefile
|
||||
|
||||
05-12-03 V.Ivanchenko (testem9-V05-02-10)
|
||||
- Update hadronic physics according to the hadronics_lists
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
$Id: README,v 1.5 2003/10/31 12:08:50 vnivanch Exp $
|
||||
$Id: README,v 1.6 2004/06/23 11:28:55 maire Exp $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
@@ -82,25 +82,48 @@ $Id: README,v 1.5 2003/10/31 12:08:50 vnivanch Exp $
|
||||
environment variable G4ANALYSIS_USE and setup local AIDA implementation.
|
||||
The example should be recompiled:
|
||||
|
||||
gmake analclean
|
||||
gmake histclean
|
||||
gmake
|
||||
|
||||
The macro file csi.mac can be used as exmple of macro for analysis. It
|
||||
can be executed in the following way:
|
||||
$G4WORKDIR/bin/$G4SYSTEM/TestEm9 csi.mac
|
||||
|
||||
7- Using the Anaphe implementation of the AIDA 3.0 histograms:
|
||||
|
||||
7- Using histograms
|
||||
-------------------
|
||||
|
||||
In order to use the Anaphe implementation of the AIDA 3.0 interfaces,
|
||||
the 'aida-config' command (which is used in the GNUmakefile) is
|
||||
available at:
|
||||
/afs/cern.ch/sw/lhcxx/share/LHCXX/latest/scripts/aida-config
|
||||
By default the histograms are not activated. To activate histograms
|
||||
the environment variable G4ANALYSIS_USE should be defined. For instance
|
||||
uncomment the flag G4ANALYSIS_USE in GNUmakefile.
|
||||
|
||||
In order to run the executable, you need to source the following
|
||||
script (once):
|
||||
$HOME/bin/setupAnaphe.csh (or $HOME/bin/setupAnaphe)
|
||||
To use histograms any of implementations of AIDA interfaces should
|
||||
be available (see http://aida.freehep.org).
|
||||
|
||||
At cern 'setupAnaphe' is available at:
|
||||
/afs/cern.ch/sw/lhcxx/share/LHCXX/latest/scripts/setupAnaphe.csh
|
||||
(or /afs/cern.ch/sw/lhcxx/share/LHCXX/latest/scripts/setupAnaphe)
|
||||
A package including AIDA and extended interfaces also using Python
|
||||
is PI, available from: http://cern.ch/pi .
|
||||
|
||||
Once installed PI or PI-Lite in a specified local area $MYPY, it is
|
||||
required to add the installation path to $PATH, i.e. for example,
|
||||
for release 1.2.1 of PI:
|
||||
|
||||
setenv PATH ${PATH}:$MYPI/1.2.1/app/releases/PI/PI_1_2_1/rh73_gcc32/bin
|
||||
|
||||
CERN users can use the PATH to the LCG area on AFS.
|
||||
|
||||
Before compilation of the example it is optimal to clean up old
|
||||
files:
|
||||
|
||||
gmake histclean
|
||||
gmake
|
||||
|
||||
Before running the example the command should be issued:
|
||||
|
||||
eval `aida-config --runtime csh`
|
||||
|
||||
It is possible to choose the format of the output file with
|
||||
histograms using UI command:
|
||||
|
||||
/testem/histo/setFileType type
|
||||
|
||||
The following types are available: hbook, root, xml.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# $Id: TestEm9.in,v 1.8 2003/11/26 14:44:43 vnivanch Exp $
|
||||
# GEANT4 tag $Name: geant4-06-00-patch-01 $
|
||||
# $Id: TestEm9.in,v 1.10 2004/05/27 13:43:17 vnivanch Exp $
|
||||
# GEANT4 tag $Name: geant4-06-02 $
|
||||
#
|
||||
# Macro file for TestEm9 - Crystal Calorimeter
|
||||
# V.Ivanchenko
|
||||
@@ -19,11 +19,16 @@
|
||||
/testem/phys/MuonCuts 10.0 mm
|
||||
/testem/stepMax 100 mm
|
||||
#
|
||||
/process/eLoss/preciseRange true
|
||||
/process/eLoss/integral true
|
||||
/testem/det/acceptance1 0.8380 0.0319 3.0
|
||||
/testem/det/acceptance9 0.9605 0.0146 3.0
|
||||
/testem/det/acceptance25 0.9805 0.0118 3.0
|
||||
#
|
||||
#/process/eLoss/preciseRange true
|
||||
#/process/eLoss/integral true
|
||||
/run/initialize
|
||||
#
|
||||
#/testem/histo/fileName e_pr.paw
|
||||
#/testem/histo/fileName e_pr.root
|
||||
#/testem/histo/fileType root
|
||||
/gun/particle e-
|
||||
/gun/energy 1 GeV
|
||||
/run/beamOn 100
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
|
||||
*************************************************************
|
||||
Geant4 version $Name: geant4-06-01 $ (25-March-2004)
|
||||
Geant4 version $Name: geant4-06-02 $ (25-June-2004)
|
||||
Copyright : Geant4 Collaboration
|
||||
Reference : NIM A 506 (2003), 250-303.
|
||||
Reference : NIM A 506 (2003), 250-303
|
||||
WWW : http://cern.ch/geant4
|
||||
*************************************************************
|
||||
|
||||
@@ -74,8 +74,12 @@ PhysicsList::AddPhysicsList: <standard>
|
||||
/testem/phys/MuonCuts 10.0 mm
|
||||
/testem/stepMax 100 mm
|
||||
#
|
||||
/process/eLoss/preciseRange true
|
||||
/process/eLoss/integral true
|
||||
/testem/det/acceptance1 0.8380 0.0319 3.0
|
||||
/testem/det/acceptance9 0.9605 0.0146 3.0
|
||||
/testem/det/acceptance25 0.9805 0.0118 3.0
|
||||
#
|
||||
#/process/eLoss/preciseRange true
|
||||
#/process/eLoss/integral true
|
||||
/run/initialize
|
||||
Ecal is 36 cm of CsI
|
||||
Absorber is 2 mm of Al
|
||||
@@ -86,7 +90,8 @@ world cuts are set
|
||||
Vertex cuts are set
|
||||
Muon cuts are set
|
||||
#
|
||||
#/testem/histo/fileName e_pr.paw
|
||||
#/testem/histo/fileName e_pr.root
|
||||
#/testem/histo/fileType root
|
||||
/gun/particle e-
|
||||
/gun/energy 1 GeV
|
||||
/run/beamOn 100
|
||||
@@ -107,7 +112,6 @@ eIoni: tables are built for e-
|
||||
dE/dx and range tables from 100 eV to 100 TeV in 120 bins.
|
||||
Lambda tables from threshold to 100 TeV in 120 bins.
|
||||
Step function: finalRange(mm)= 1, dRoverRange= 1, integral: 1
|
||||
Precise range table up to 1 GeV in 70 bins.
|
||||
Delta cross sections from Moller+Bhabha, good description from 1 KeV to 100 GeV.
|
||||
|
||||
eBrem: tables are built for e-
|
||||
@@ -120,7 +124,6 @@ eIoni: tables are built for e+
|
||||
dE/dx and range tables from 100 eV to 100 TeV in 120 bins.
|
||||
Lambda tables from threshold to 100 TeV in 120 bins.
|
||||
Step function: finalRange(mm)= 1, dRoverRange= 1, integral: 1
|
||||
Precise range table up to 1 GeV in 70 bins.
|
||||
Delta cross sections from Moller+Bhabha, good description from 1 KeV to 100 GeV.
|
||||
|
||||
eBrem: tables are built for e+
|
||||
@@ -140,8 +143,7 @@ msc: Model variant of multiple scattering for proton
|
||||
hIoni: tables are built for proton
|
||||
dE/dx and range tables from 100 eV to 100 TeV in 120 bins.
|
||||
Lambda tables from threshold to 100 TeV in 120 bins.
|
||||
Step function: finalRange(mm)= 1, dRoverRange= 1, integral: 1
|
||||
Precise range table up to 1 GeV in 70 bins.
|
||||
Step function: finalRange(mm)= 1, dRoverRange= 0.2, integral: 1
|
||||
Bether-Bloch model for Escaled > 2 MeV, parametrisation of Bragg peak below, Integral mode 1
|
||||
|
||||
msc: Model variant of multiple scattering for mu+
|
||||
@@ -151,8 +153,7 @@ msc: Model variant of multiple scattering for mu+
|
||||
MuIoni: tables are built for mu+
|
||||
dE/dx and range tables from 100 eV to 100 TeV in 120 bins.
|
||||
Lambda tables from threshold to 100 TeV in 120 bins.
|
||||
Step function: finalRange(mm)= 1, dRoverRange= 1, integral: 1
|
||||
Precise range table up to 1 GeV in 70 bins.
|
||||
Step function: finalRange(mm)= 1, dRoverRange= 0.2, integral: 1
|
||||
Bether-Bloch model for E > 0.2 MeV, parametrisation of Bragg peak below,
|
||||
radiative corrections for E > 1 GeV
|
||||
|
||||
@@ -170,8 +171,7 @@ MuPairProd: tables are built for mu+
|
||||
MuIoni: tables are built for mu-
|
||||
dE/dx and range tables from 100 eV to 100 TeV in 120 bins.
|
||||
Lambda tables from threshold to 100 TeV in 120 bins.
|
||||
Step function: finalRange(mm)= 1, dRoverRange= 1, integral: 1
|
||||
Precise range table up to 1 GeV in 70 bins.
|
||||
Step function: finalRange(mm)= 1, dRoverRange= 0.2, integral: 1
|
||||
Bether-Bloch model for E > 0.2 MeV, parametrisation of Bragg peak below,
|
||||
radiative corrections for E > 1 GeV
|
||||
|
||||
@@ -245,17 +245,30 @@ Start Run processing.
|
||||
Run terminated.
|
||||
Run Summary
|
||||
Number of events processed : 100
|
||||
User=30.84s Real=34.11s Sys=3.27s
|
||||
User=31.48s Real=35.19s Sys=3.65s
|
||||
RunAction: End of run actions are started
|
||||
HistoManager: End of run actions are started
|
||||
========================================================
|
||||
Number of events 100
|
||||
Average number of e- 1295
|
||||
Average number of gamma 681.2
|
||||
Average number of e+ 48.45
|
||||
Average number of steps 3796
|
||||
Number of events 100
|
||||
Average number of e- 1306
|
||||
Average number of gamma 684.6
|
||||
Average number of e+ 48.98
|
||||
Average number of steps 3831
|
||||
Edep 1x1 = 0.8336 +- 0.002815
|
||||
Edep 3x3 = 0.9586 +- 0.001349
|
||||
Edep 5x5 = 0.979 +- 0.001047
|
||||
========================================================
|
||||
|
||||
|
||||
<<<<<ACCEPTANCE>>>>> 100 events for Crystal Calorimeter
|
||||
Edep1x1: 0.8336 delEdep1x1= -0.004382 nrms= -1.374
|
||||
Erms1x1: 0.02815 delErms1x1= -0.003748 nrms= -1.175
|
||||
Edep3x3: 0.9586 delEdep3x3= -0.001905 nrms= -1.305
|
||||
Erms3x3: 0.01349 delErms3x3= -0.001111 nrms= -0.7611
|
||||
Edep5x5: 0.979 delEdep5x5= -0.001528 nrms= -1.295
|
||||
Erms5x5: 0.01047 delErms5x5= -0.00133 nrms= -1.127
|
||||
<<<<<END>>>>> IS ACCEPTED
|
||||
|
||||
#
|
||||
Graphics systems deleted.
|
||||
Visualization Manager deleting...
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: DetectorConstruction.hh,v 1.2 2003/10/31 12:08:50 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00-patch-01 $
|
||||
// $Id: DetectorConstruction.hh,v 1.3 2004/05/27 13:43:17 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-06-02 $
|
||||
//
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
@@ -52,6 +52,7 @@ class G4Tubs;
|
||||
class G4LogicalVolume;
|
||||
class G4UniformMagField;
|
||||
class DetectorMessenger;
|
||||
class G4Region;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -106,6 +107,9 @@ private:
|
||||
G4LogicalVolume* logicA2;
|
||||
G4LogicalVolume* logicA3;
|
||||
G4LogicalVolume* logicA4;
|
||||
|
||||
G4Region* vertexRegion;
|
||||
G4Region* muonRegion;
|
||||
|
||||
DetectorMessenger* detectorMessenger; //pointer to the Messenger
|
||||
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: DetectorMessenger.hh,v 1.2 2003/10/31 12:08:50 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00-patch-01 $
|
||||
// $Id: DetectorMessenger.hh,v 1.3 2004/05/27 13:43:17 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-06-02 $
|
||||
//
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
@@ -75,6 +75,9 @@ private:
|
||||
G4UIcmdWithADoubleAndUnit* l5Cmd;
|
||||
G4UIcmdWithADoubleAndUnit* l6Cmd;
|
||||
G4UIcmdWithoutParameter* UpdateCmd;
|
||||
G4UIcmdWith3Vector* accCmd1;
|
||||
G4UIcmdWith3Vector* accCmd2;
|
||||
G4UIcmdWith3Vector* accCmd3;
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: EmAcceptance.hh,v 1.1 2004/05/27 13:43:57 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-06-02 $
|
||||
//
|
||||
//
|
||||
|
||||
#ifndef EmAcceptance_h
|
||||
#define EmAcceptance_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
class EmAcceptance
|
||||
{
|
||||
|
||||
public:
|
||||
EmAcceptance();
|
||||
~EmAcceptance();
|
||||
|
||||
void BeginOfAcceptance(const G4String& title, G4int stat);
|
||||
void EndOfAcceptance();
|
||||
|
||||
void EmAcceptanceGauss(const G4String& title, G4int stat,
|
||||
G4double avr, G4double avr0,
|
||||
G4double rms, G4double limit);
|
||||
|
||||
private:
|
||||
|
||||
// hide assignment operator
|
||||
EmAcceptance & operator=(const EmAcceptance &right);
|
||||
EmAcceptance(const EmAcceptance&);
|
||||
|
||||
G4bool isAccepted;
|
||||
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#endif
|
||||
@@ -20,8 +20,8 @@
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: Histo.hh,v 1.2 2003/11/03 19:19:46 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00-patch-01 $
|
||||
// $Id: Histo.hh,v 1.3 2004/04/02 15:13:44 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-06-02 $
|
||||
|
||||
#ifndef Histo_h
|
||||
#define Histo_h 1
|
||||
@@ -92,9 +92,9 @@ public:
|
||||
void addRow();
|
||||
// Save tuple event
|
||||
|
||||
void setFileName(const G4String& nam) {histName = nam;};
|
||||
void setFileName(const G4String&);
|
||||
|
||||
void setFileType(const G4String& nam) {if(nam == "XML") histType = "XML";};
|
||||
void setFileType(const G4String&);
|
||||
|
||||
private:
|
||||
|
||||
@@ -117,7 +117,7 @@ private:
|
||||
std::vector<G4double> xmax;
|
||||
std::vector<G4double> unit;
|
||||
std::vector<G4String> ids;
|
||||
std::vector<G4String> tittles;
|
||||
std::vector<G4String> titles;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: HistoManager.hh,v 1.4 2003/11/03 19:19:46 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00-patch-01 $
|
||||
// $Id: HistoManager.hh,v 1.6 2004/05/27 13:43:18 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-06-02 $
|
||||
|
||||
#ifndef HistoManager_h
|
||||
#define HistoManager_h 1
|
||||
@@ -50,10 +50,12 @@
|
||||
#include "G4VPhysicalVolume.hh"
|
||||
#include "G4DataVector.hh"
|
||||
#include "G4Track.hh"
|
||||
#include "Histo.hh"
|
||||
//#include "Histo.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
class Histo;
|
||||
|
||||
class HistoManager
|
||||
{
|
||||
|
||||
@@ -106,6 +108,9 @@ public: // Without description
|
||||
void SetThresholdZ(G4double val) {thPosZ = val;};
|
||||
void AddStep() {n_step++;};
|
||||
|
||||
// Acceptance parameters
|
||||
void SetEdepAndRMS(G4int, G4ThreeVector);
|
||||
void SetBeamEnergy(G4double val) {beamEnergy = val;};
|
||||
|
||||
private:
|
||||
|
||||
@@ -137,11 +142,21 @@ private:
|
||||
G4bool nTuple;
|
||||
|
||||
G4double Eabs1, Eabs2, Eabs3, Eabs4;
|
||||
G4double E[25];
|
||||
G4double E[25];
|
||||
G4DataVector Evertex;
|
||||
G4DataVector Nvertex;
|
||||
|
||||
Histo histo;
|
||||
G4DataVector edeptrue;
|
||||
G4DataVector rmstrue;
|
||||
G4DataVector limittrue;
|
||||
G4DataVector edep;
|
||||
G4DataVector erms;
|
||||
G4int nmax;
|
||||
|
||||
Histo* histo;
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
//
|
||||
|
||||
//
|
||||
// $Id: HistoMessenger.hh,v 1.1 2003/10/31 12:09:36 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00-patch-01 $
|
||||
// $Id: HistoMessenger.hh,v 1.2 2004/05/27 13:43:18 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-06-02 $
|
||||
//
|
||||
//
|
||||
|
||||
@@ -61,8 +61,8 @@ class HistoMessenger: public G4UImessenger
|
||||
G4UIdirectory* histoDir;
|
||||
G4UIcmdWithAString* factoryCmd;
|
||||
G4UIcmdWithAString* fileCmd;
|
||||
G4UIcommand* histoCmd;
|
||||
|
||||
G4UIcommand* histoCmd;
|
||||
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: DetectorConstruction.cc,v 1.4 2003/11/25 15:19:05 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00-patch-01 $
|
||||
// $Id: DetectorConstruction.cc,v 1.5 2004/05/27 13:43:18 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-06-02 $
|
||||
//
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
@@ -79,6 +79,8 @@ DetectorConstruction::DetectorConstruction()
|
||||
padLength = 0.1*mm;
|
||||
padWidth = 0.02*mm;
|
||||
absLength = 2.*mm;
|
||||
vertexRegion = 0;
|
||||
muonRegion = 0;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -221,7 +223,11 @@ G4VPhysicalVolume* DetectorConstruction::ConstructVolumes()
|
||||
G4PhysicalVolumeStore::GetInstance()->Clean();
|
||||
G4LogicalVolumeStore::GetInstance()->Clean();
|
||||
G4SolidStore::GetInstance()->Clean();
|
||||
// G4RegionStore::GetInstance()->Clean();
|
||||
|
||||
if(vertexRegion) delete vertexRegion;
|
||||
if(muonRegion) delete muonRegion;
|
||||
vertexRegion = new G4Region("VertexDetector");
|
||||
muonRegion = new G4Region("MuonDetector");
|
||||
|
||||
if(vertexLength < padLength*5.0) vertexLength = padLength*5.0;
|
||||
G4double gap = 0.01*mm;
|
||||
@@ -359,15 +365,12 @@ G4VPhysicalVolume* DetectorConstruction::ConstructVolumes()
|
||||
|
||||
// Define region for the vertex detector
|
||||
|
||||
G4Region* regionV = new G4Region("VertexDetector");
|
||||
regionV->AddRootLogicalVolume(logicVV);
|
||||
regionV->AddRootLogicalVolume(logicA3);
|
||||
|
||||
vertexRegion->AddRootLogicalVolume(logicVV);
|
||||
vertexRegion->AddRootLogicalVolume(logicA3);
|
||||
|
||||
// Define region for the muon detector
|
||||
|
||||
G4Region* regionM = new G4Region("MuonDetector");
|
||||
regionM->AddRootLogicalVolume(logicYV);
|
||||
muonRegion->AddRootLogicalVolume(logicYV);
|
||||
|
||||
// color regions
|
||||
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: DetectorMessenger.cc,v 1.1 2003/07/14 17:10:16 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00-patch-01 $
|
||||
// $Id: DetectorMessenger.cc,v 1.2 2004/05/27 13:43:18 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-06-02 $
|
||||
//
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
@@ -47,6 +47,7 @@
|
||||
#include "G4UIcmdWith3Vector.hh"
|
||||
#include "G4UIcmdWithADoubleAndUnit.hh"
|
||||
#include "G4UIcmdWithoutParameter.hh"
|
||||
#include "HistoManager.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -109,6 +110,28 @@ DetectorMessenger::DetectorMessenger(DetectorConstruction * Det)
|
||||
UpdateCmd->SetGuidance("if you changed geometrical value(s)");
|
||||
UpdateCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
|
||||
|
||||
accCmd1 = new G4UIcmdWith3Vector("/testem/det/acceptance1",this);
|
||||
accCmd1->SetGuidance("set Edep and RMS");
|
||||
accCmd1->SetGuidance("acceptance values for central cell");
|
||||
accCmd1->SetParameterName("edep","rms","limit",true);
|
||||
accCmd1->SetRange("edep>0 && edep<1 && rms>0");
|
||||
accCmd1->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
|
||||
accCmd2 = new G4UIcmdWith3Vector("/testem/det/acceptance9",this);
|
||||
accCmd2->SetGuidance("set Edep and RMS");
|
||||
accCmd2->SetGuidance("acceptance values for 3x3 matrix");
|
||||
accCmd2->SetParameterName("edep","rms","limit",true);
|
||||
accCmd2->SetRange("edep>0 && edep<1 && rms>0");
|
||||
accCmd2->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
|
||||
accCmd3 = new G4UIcmdWith3Vector("/testem/det/acceptance25",this);
|
||||
accCmd3->SetGuidance("set Edep and RMS");
|
||||
accCmd3->SetGuidance("acceptance values for 5x5 matrix");
|
||||
accCmd3->SetParameterName("edep","rms","limit",true);
|
||||
accCmd3->SetRange("edep>0 && edep<1 && rms>0");
|
||||
accCmd3->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -125,6 +148,9 @@ DetectorMessenger::~DetectorMessenger()
|
||||
delete l6Cmd;
|
||||
delete UpdateCmd;
|
||||
delete testemDir;
|
||||
delete accCmd1;
|
||||
delete accCmd2;
|
||||
delete accCmd3;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -157,6 +183,18 @@ void DetectorMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
|
||||
|
||||
if( command == UpdateCmd )
|
||||
{ Detector->UpdateGeometry();}
|
||||
|
||||
HistoManager* histo = HistoManager::GetPointer();
|
||||
if( command == accCmd1 )
|
||||
{ histo->SetEdepAndRMS(0,accCmd1->GetNew3VectorValue(newValue));}
|
||||
|
||||
if( command == accCmd2 )
|
||||
{ histo->SetEdepAndRMS(1,accCmd2->GetNew3VectorValue(newValue));}
|
||||
|
||||
if( command == accCmd3 )
|
||||
{ histo->SetEdepAndRMS(2,accCmd3->GetNew3VectorValue(newValue));}
|
||||
|
||||
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: EmAcceptance.cc,v 1.1 2004/05/27 13:43:57 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-06-02 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "EmAcceptance.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
EmAcceptance::EmAcceptance()
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
EmAcceptance::~EmAcceptance()
|
||||
{}
|
||||
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void EmAcceptance::BeginOfAcceptance(const G4String& title, G4int stat)
|
||||
{
|
||||
G4cout << G4endl;
|
||||
G4cout << "<<<<<ACCEPTANCE>>>>> " << stat << " events for " << title << G4endl;
|
||||
isAccepted = true;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void EmAcceptance::EndOfAcceptance()
|
||||
{
|
||||
G4String resume = "IS ACCEPTED";
|
||||
if(!isAccepted) resume = "IS NOT ACCEPTED";
|
||||
G4cout << "<<<<<END>>>>> " << resume << G4endl;
|
||||
G4cout << G4endl;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void EmAcceptance::EmAcceptanceGauss(const G4String& title, G4int stat,
|
||||
G4double avr, G4double avr0,
|
||||
G4double rms, G4double limit)
|
||||
{
|
||||
G4double x = sqrt((G4double)stat);
|
||||
G4double dde = avr - avr0;
|
||||
G4double de = dde*x/rms;
|
||||
|
||||
G4cout << title << ": " << avr << " del"<< title << "= " << dde << " nrms= " << de << G4endl;
|
||||
if(de > limit) isAccepted = false;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -36,12 +36,12 @@
|
||||
#include "Histo.hh"
|
||||
|
||||
#ifdef G4ANALYSIS_USE
|
||||
|
||||
#include <memory> // for the auto_ptr(T>
|
||||
#include "AIDA/AIDA.h"
|
||||
#include "HistoMessenger.hh"
|
||||
#endif
|
||||
|
||||
//#include <iomanip>
|
||||
#endif
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
@@ -84,14 +84,16 @@ void Histo::book()
|
||||
G4cout << "### Histo books " << nHisto << " histograms " << G4endl;
|
||||
// Creating the analysis factory
|
||||
std::auto_ptr< AIDA::IAnalysisFactory > af( AIDA_createAnalysisFactory() );
|
||||
|
||||
// Creating the tree factory
|
||||
std::auto_ptr< AIDA::ITreeFactory > tf( af->createTreeFactory() );
|
||||
|
||||
// Creating a tree mapped to a new hbook file.
|
||||
//tree = tf->create(histName,histType,false,false);
|
||||
tree = tf->create(histName,histType,false,false,"uncompress");
|
||||
G4cout << "Tree store : " << tree->storeName() << G4endl;
|
||||
|
||||
tree = tf->create(histName,histType,false,true,"uncompress");
|
||||
if(tree)
|
||||
G4cout << "Tree store : " << tree->storeName() << G4endl;
|
||||
else
|
||||
G4cout << "ERROR: Tree store " << histName << " is not created!" << G4endl;
|
||||
|
||||
// Creating a histogram factory, whose histograms will be handled by the tree
|
||||
std::auto_ptr< AIDA::IHistogramFactory > hf(af->createHistogramFactory( *tree ));
|
||||
@@ -100,7 +102,7 @@ void Histo::book()
|
||||
for(G4int i=0; i<nHisto; i++) {
|
||||
if(active[i]) {
|
||||
|
||||
histo[i] = hf->createHistogram1D(ids[i], tittles[i], bins[i], xmin[i], xmax[i]);
|
||||
histo[i] = hf->createHistogram1D(ids[i], titles[i], bins[i], xmin[i], xmax[i]);
|
||||
}
|
||||
}
|
||||
// Creating a tuple factory, whose tuples will be handled by the tree
|
||||
@@ -143,7 +145,7 @@ void Histo::add1D(const G4String& id, const G4String& name, G4int nb,
|
||||
xmax.push_back(x2);
|
||||
unit.push_back(u);
|
||||
ids.push_back(id);
|
||||
tittles.push_back(name);
|
||||
titles.push_back(name);
|
||||
histo.push_back(0);
|
||||
}
|
||||
|
||||
@@ -232,3 +234,17 @@ void Histo::addRow()
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void Histo::setFileName(const G4String& nam)
|
||||
{
|
||||
histName = nam;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void Histo::setFileType(const G4String& nam)
|
||||
{
|
||||
histType = nam;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
|
||||
@@ -35,6 +35,8 @@
|
||||
|
||||
#include "HistoManager.hh"
|
||||
#include "G4UnitsTable.hh"
|
||||
#include "Histo.hh"
|
||||
#include "EmAcceptance.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
@@ -55,15 +57,19 @@ HistoManager* HistoManager::GetPointer()
|
||||
HistoManager::HistoManager()
|
||||
{
|
||||
verbose = 1;
|
||||
nEvt1 = -1;
|
||||
nEvt2 = -1;
|
||||
nEvt1 = -1;
|
||||
nEvt2 = -1;
|
||||
nmax = 3;
|
||||
histo = new Histo();
|
||||
bookHisto();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
HistoManager::~HistoManager()
|
||||
{}
|
||||
{
|
||||
delete histo;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
@@ -79,38 +85,46 @@ void HistoManager::bookHisto()
|
||||
nTuple = false;
|
||||
nHisto = 10;
|
||||
|
||||
histo.add1D("10",
|
||||
for(G4int i=0; i<nmax; i++) {
|
||||
edep.push_back(0.0);
|
||||
erms.push_back(0.0);
|
||||
edeptrue.push_back(1.0);
|
||||
rmstrue.push_back(1.0);
|
||||
limittrue.push_back(DBL_MAX);
|
||||
}
|
||||
|
||||
histo->add1D("10",
|
||||
"Energy deposit (MeV) in central crystal",nBinsED,0.0,beamEnergy,MeV);
|
||||
|
||||
histo.add1D("11",
|
||||
histo->add1D("11",
|
||||
"Energy deposit (MeV) in 3x3",nBinsED,0.0,beamEnergy,MeV);
|
||||
|
||||
histo.add1D("12",
|
||||
histo->add1D("12",
|
||||
"Energy deposit (MeV) in 5x5",nBinsED,0.0,beamEnergy,MeV);
|
||||
|
||||
histo.add1D("13",
|
||||
histo->add1D("13",
|
||||
"Energy (MeV) of delta-electrons",nBinsE,0.0,maxEnergy,MeV);
|
||||
|
||||
histo.add1D("14",
|
||||
histo->add1D("14",
|
||||
"Energy (MeV) of gammas",nBinsE,0.0,maxEnergy,MeV);
|
||||
|
||||
histo.add1D("15",
|
||||
histo->add1D("15",
|
||||
"Energy (MeV) in abs1",nBinsEA,0.0,maxEnergyAbs,MeV);
|
||||
|
||||
histo.add1D("16",
|
||||
histo->add1D("16",
|
||||
"Energy (MeV) in abs2",nBinsEA,0.0,maxEnergyAbs,MeV);
|
||||
|
||||
histo.add1D("17",
|
||||
histo->add1D("17",
|
||||
"Energy (MeV) in abs3",nBinsEA,0.0,maxEnergyAbs,MeV);
|
||||
|
||||
histo.add1D("18",
|
||||
histo->add1D("18",
|
||||
"Energy (MeV) in abs4",nBinsEA,0.0,maxEnergyAbs,MeV);
|
||||
|
||||
histo.add1D("19",
|
||||
histo->add1D("19",
|
||||
"Number of vertex hits",20,-0.5,19.5,1.0);
|
||||
|
||||
if(nTuple) {
|
||||
histo.addTuple( "100", "Dose deposite","float r, z, e" );
|
||||
histo->addTuple( "100", "Dose deposite","float r, z, e" );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -123,7 +137,7 @@ void HistoManager::BeginOfRun()
|
||||
n_posit= 0;
|
||||
n_gam = 0;
|
||||
n_step = 0;
|
||||
histo.book();
|
||||
histo->book();
|
||||
|
||||
if(verbose > 0) {
|
||||
G4cout << "HistoManager: Histograms are booked and run has been started"
|
||||
@@ -137,30 +151,62 @@ void HistoManager::EndOfRun()
|
||||
{
|
||||
|
||||
G4cout << "HistoManager: End of run actions are started" << G4endl;
|
||||
G4String nam[3] = {"1x1", "3x3", "5x5"};
|
||||
|
||||
// average
|
||||
|
||||
G4cout<<"========================================================"<<G4endl;
|
||||
G4double x = (G4double)n_evt;
|
||||
if(n_evt > 0) x = 1.0/x;
|
||||
G4int j;
|
||||
for(j=0; j<nmax; j++) {
|
||||
edep[j] *= x/beamEnergy;
|
||||
G4double y = erms[j]*x/(beamEnergy*beamEnergy) - edep[j]*edep[j];
|
||||
if(y < 0.0) y = 0.0;
|
||||
erms[j] = sqrt(y);
|
||||
}
|
||||
G4double xe = x*(G4double)n_elec;
|
||||
G4double xg = x*(G4double)n_gam;
|
||||
G4double xp = x*(G4double)n_posit;
|
||||
G4double xs = x*(G4double)n_step;
|
||||
G4cout << "Number of events " << n_evt <<G4endl;
|
||||
G4cout << std::setprecision(4) << "Average number of e- " << xe << G4endl;
|
||||
G4cout << std::setprecision(4) << "Average number of gamma " << xg << G4endl;
|
||||
G4cout << std::setprecision(4) << "Average number of e+ " << xp << G4endl;
|
||||
G4cout << std::setprecision(4) << "Average number of steps " << xs << G4endl;
|
||||
|
||||
G4cout << "Number of events " << n_evt <<G4endl;
|
||||
G4cout << std::setprecision(4) << "Average number of e- " << xe << G4endl;
|
||||
G4cout << std::setprecision(4) << "Average number of gamma " << xg << G4endl;
|
||||
G4cout << std::setprecision(4) << "Average number of e+ " << xp << G4endl;
|
||||
G4cout << std::setprecision(4) << "Average number of steps " << xs << G4endl;
|
||||
for(j=0; j<3; j++) {
|
||||
G4cout << std::setprecision(4) << "Edep " << nam[j] << " = " << edep[j]
|
||||
<< " +- " << erms[j]*sqrt(x) << G4endl;
|
||||
}
|
||||
G4cout<<"========================================================"<<G4endl;
|
||||
G4cout<<G4endl;
|
||||
|
||||
// normalise histograms
|
||||
for(G4int i=0; i<nHisto; i++) {
|
||||
histo.scale(i,x);
|
||||
histo->scale(i,x);
|
||||
}
|
||||
|
||||
histo.save();
|
||||
histo->save();
|
||||
|
||||
// Acceptance
|
||||
EmAcceptance acc;
|
||||
G4bool isStarted = false;
|
||||
for (j=0; j<nmax; j++) {
|
||||
|
||||
G4double ltrue = limittrue[j];
|
||||
if (ltrue < DBL_MAX) {
|
||||
if (!isStarted) {
|
||||
acc.BeginOfAcceptance("Crystal Calorimeter",n_evt);
|
||||
isStarted = true;
|
||||
}
|
||||
G4double etrue = edeptrue[j];
|
||||
G4double rtrue = rmstrue[j];
|
||||
acc.EmAcceptanceGauss("Edep"+nam[j],n_evt,edep[j],etrue,rtrue,ltrue);
|
||||
acc.EmAcceptanceGauss("Erms"+nam[j],n_evt,erms[j],rtrue,rtrue,2.0*ltrue);
|
||||
}
|
||||
}
|
||||
if(isStarted) acc.EndOfAcceptance();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
@@ -190,17 +236,24 @@ void HistoManager::EndOfEvent()
|
||||
e25 += E[i];
|
||||
if( ( 6<=i && 8>=i) || (11<=i && 13>=i) || (16<=i && 18>=i)) e9 += E[i];
|
||||
}
|
||||
histo.fill(0,E[12],1.0);
|
||||
histo.fill(1,e9,1.0);
|
||||
histo.fill(2,e25,1.0);
|
||||
histo.fill(5,Eabs1,1.0);
|
||||
histo.fill(6,Eabs2,1.0);
|
||||
histo.fill(7,Eabs3,1.0);
|
||||
histo.fill(8,Eabs4,1.0);
|
||||
histo->fill(0,E[12],1.0);
|
||||
histo->fill(1,e9,1.0);
|
||||
histo->fill(2,e25,1.0);
|
||||
histo->fill(5,Eabs1,1.0);
|
||||
histo->fill(6,Eabs2,1.0);
|
||||
histo->fill(7,Eabs3,1.0);
|
||||
histo->fill(8,Eabs4,1.0);
|
||||
float nn = (double)(Nvertex.size());
|
||||
histo.fill(9,nn,1.0);
|
||||
histo->fill(9,nn,1.0);
|
||||
|
||||
if(nTuple) histo.addRow();
|
||||
edep[0] += E[12];
|
||||
erms[0] += E[12]*E[12];
|
||||
edep[1] += e9;
|
||||
erms[1] += e9*e9;
|
||||
edep[2] += e25;
|
||||
erms[2] += e25*e25;
|
||||
|
||||
if(nTuple) histo->addRow();
|
||||
|
||||
}
|
||||
|
||||
@@ -219,13 +272,13 @@ void HistoManager::ScoreNewTrack(const G4Track* aTrack)
|
||||
|
||||
if(0 == pid) {
|
||||
|
||||
histo.fillTuple("TKIN", kinE/MeV);
|
||||
histo->fillTuple("TKIN", kinE/MeV);
|
||||
|
||||
G4double mass = 0.0;
|
||||
if(particle) {
|
||||
mass = particle->GetPDGMass();
|
||||
histo.fillTuple("MASS", mass/MeV);
|
||||
histo.fillTuple("CHAR",(particle->GetPDGCharge())/eplus);
|
||||
histo->fillTuple("MASS", mass/MeV);
|
||||
histo->fillTuple("CHAR",(particle->GetPDGCharge())/eplus);
|
||||
G4double beta = 1.;
|
||||
if(mass > 0.) {
|
||||
G4double gamma = kinE/mass + 1.;
|
||||
@@ -268,9 +321,9 @@ void HistoManager::ScoreNewTrack(const G4Track* aTrack)
|
||||
void HistoManager::AddEnergy(G4double edep, G4int volIndex, G4int copyNo)
|
||||
{
|
||||
if(1 < verbose) {
|
||||
G4cout << "HistoManager::AddEnergy: e(keV)= " << edep/keV
|
||||
G4cout << "HistoManager::AddEnergy: e(keV)= " << edep/keV
|
||||
<< "; volIdx= " << volIndex
|
||||
<< "; copyNo= " << copyNo
|
||||
<< "; copyNo= " << copyNo
|
||||
<< G4endl;
|
||||
}
|
||||
if(0 == volIndex) {
|
||||
@@ -308,7 +361,7 @@ void HistoManager::AddDeltaElectron(const G4DynamicParticle* elec)
|
||||
{
|
||||
G4double e = elec->GetKineticEnergy()/MeV;
|
||||
if(e > 0.0) n_elec++;
|
||||
histo.fill(3,e,1.0);
|
||||
histo->fill(3,e,1.0);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
@@ -317,7 +370,18 @@ void HistoManager::AddPhoton(const G4DynamicParticle* ph)
|
||||
{
|
||||
G4double e = ph->GetKineticEnergy()/MeV;
|
||||
if(e > 0.0) n_gam++;
|
||||
histo.fill(4,e,1.0);
|
||||
histo->fill(4,e,1.0);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void HistoManager::SetEdepAndRMS(G4int i, G4ThreeVector val)
|
||||
{
|
||||
if(i<nmax && i>=0) {
|
||||
if(val[0] > 0.0) edeptrue[i] = val[0];
|
||||
if(val[1] > 0.0) rmstrue[i] = val[1];
|
||||
if(val[2] > 0.0) limittrue[i] = val[2];
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: HistoMessenger.cc,v 1.1 2003/10/31 12:09:37 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00-patch-01 $
|
||||
// $Id: HistoMessenger.cc,v 1.2 2004/05/27 13:43:18 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-06-02 $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -48,7 +48,7 @@ HistoMessenger::HistoMessenger(Histo* manager)
|
||||
|
||||
fileCmd = new G4UIcmdWithAString("/testem/histo/fileType",this);
|
||||
fileCmd->SetGuidance("set type (hbook, XML) for the histograms file");
|
||||
|
||||
|
||||
histoCmd = new G4UIcommand("/testem/histo/setHisto",this);
|
||||
histoCmd->SetGuidance("Set bining of the histo number ih :");
|
||||
histoCmd->SetGuidance(" nbBins; valMin; valMax; unit (of vmin and vmax)");
|
||||
@@ -61,20 +61,21 @@ HistoMessenger::HistoMessenger(Histo* manager)
|
||||
G4UIparameter* nbBins = new G4UIparameter("nbBins",'i',false);
|
||||
nbBins->SetGuidance("number of bins");
|
||||
nbBins->SetParameterRange("nbBins>0");
|
||||
histoCmd->SetParameter(nbBins);
|
||||
//
|
||||
histoCmd->SetParameter(nbBins);
|
||||
//
|
||||
G4UIparameter* valMin = new G4UIparameter("valMin",'d',false);
|
||||
valMin->SetGuidance("valMin, expressed in unit");
|
||||
histoCmd->SetParameter(valMin);
|
||||
//
|
||||
histoCmd->SetParameter(valMin);
|
||||
//
|
||||
G4UIparameter* valMax = new G4UIparameter("valMax",'d',false);
|
||||
valMax->SetGuidance("valMax, expressed in unit");
|
||||
histoCmd->SetParameter(valMax);
|
||||
//
|
||||
//
|
||||
G4UIparameter* unit = new G4UIparameter("unit",'s',true);
|
||||
unit->SetGuidance("if omitted, vmin and vmax are assumed dimensionless");
|
||||
unit->SetDefaultValue("none");
|
||||
histoCmd->SetParameter(unit);
|
||||
histoCmd->SetParameter(unit);
|
||||
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -84,7 +85,7 @@ HistoMessenger::~HistoMessenger()
|
||||
delete fileCmd;
|
||||
delete histoCmd;
|
||||
delete factoryCmd;
|
||||
delete histoDir;
|
||||
delete histoDir;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -106,7 +107,7 @@ void HistoMessenger::SetNewValue(G4UIcommand* command,G4String newValues)
|
||||
G4double vUnit = 1. ;
|
||||
if (unit != "none") vUnit = G4UIcommand::ValueOf(unit);
|
||||
histo->setHisto1D(ih,nbBins,vmin,vmax,vUnit);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: PrimaryGeneratorAction.cc,v 1.1 2003/07/14 17:10:18 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00-patch-01 $
|
||||
// $Id: PrimaryGeneratorAction.cc,v 1.2 2004/05/27 13:43:18 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-06-02 $
|
||||
//
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
@@ -46,6 +46,7 @@
|
||||
#include "G4Event.hh"
|
||||
#include "G4ParticleTable.hh"
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "HistoManager.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -74,7 +75,9 @@ PrimaryGeneratorAction::~PrimaryGeneratorAction()
|
||||
void PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
|
||||
{
|
||||
G4double zVertex = - (detector->GetWorldSizeZ());
|
||||
particleGun->SetParticlePosition(G4ThreeVector(0.,0.,zVertex));
|
||||
particleGun->SetParticlePosition(G4ThreeVector(0.,0.,zVertex));
|
||||
if(anEvent->GetEventID() == 1)
|
||||
(HistoManager::GetPointer())->SetBeamEnergy(particleGun->GetParticleEnergy());
|
||||
particleGun->GeneratePrimaryVertex(anEvent);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user