Import Geant4 5.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 16:57:27 +02:00
parent 330b82b769
commit 37fff30d2e
5733 changed files with 263867 additions and 74574 deletions
@@ -0,0 +1,148 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
///////////////////////////////////////////////////////////////////////////////
// File: CompositeCalorimeter.cc
// Description: Main function for Geant4 application HCAL Test-BEAM H2-96
///////////////////////////////////////////////////////////////////////////////
#include "CCalDetectorConstruction.hh"
#include "CCalEndOfEventAction.hh"
#include "CCalRunAction.hh"
#include "CCalPrimaryGeneratorAction.hh"
#include "CCalPhysicsList.hh"
#include "G4RunManager.hh"
#include "G4UIterminal.hh"
#ifdef G4UI_USE_XM
#include "G4UIXm.hh"
#endif
#ifdef G4VIS_USE
#include "CCalVisManager.hh"
#endif
int main(int argc,char** argv) {
#ifdef G4VIS_USE
CCalVisManager *visManager = new CCalVisManager;
visManager->Initialize();
#endif
G4RunManager * runManager = new G4RunManager;
runManager->SetUserInitialization(new CCalDetectorConstruction);
runManager->SetUserInitialization(new CCalPhysicsList);
////////////////////////////
// User action classes. //
// -------------------- //
////////////////////////////
//////////////////////////////////
// PRIMARY PARTICLEs GENERATION //
//////////////////////////////////
CCalPrimaryGeneratorAction* primaryGenerator = new CCalPrimaryGeneratorAction;
runManager->SetUserAction(primaryGenerator);
/////////
// RUN //
/////////
runManager->SetUserAction(new CCalRunAction);
///////////
// EVENT //
///////////
runManager->SetUserAction(new CCalEndOfEventAction(primaryGenerator));
G4UImanager * UI = G4UImanager::GetUIpointer();
UI->ApplyCommand("/CCal/generator/verbose 2");
UI->ApplyCommand("/gun/position -1380. 0. 0. mm");
UI->ApplyCommand("/gun/direction 1. 0. 0.");
UI->ApplyCommand("/gun/energy 100 GeV");
G4UIsession * session = 0;
// Define (G)UI terminal for interactive mode
if (argc==1) {
#ifdef G4UI_USE_XM
session = new G4UIXm(argc,argv);
#else // G4UIterminal is a (dumb) terminal.
session = new G4UIterminal;
#endif
G4cout <<" Run initializing ..."<<G4endl;
UI->ApplyCommand("/process/verbose 0");
UI->ApplyCommand("/run/verbose 2");
UI->ApplyCommand("/run/initialize");
#ifdef G4VIS_USE
// Create empty scene
G4String visCommand = "/vis/scene/create";
UI->ApplyCommand(visCommand);
// Choose one default viewer
// (the user can always change it later on)
// visCommand = "/vis/open DAWNFILE";
// visCommand = "/vis/open VRML2FILE";
visCommand = "/vis/open OGLIX";
UI->ApplyCommand(visCommand);
visCommand = "/vis/viewer/flush";
UI->ApplyCommand(visCommand);
visCommand = "/tracking/storeTrajectory 1";
UI->ApplyCommand(visCommand);
#endif
#ifdef G4UI_USE_XM
// Customize the G4UIXm menubar with a macro file :
UI->ApplyCommand("/control/execute gui.mac");
#else
G4cout <<"Now, please, apply beamOn command..."<<G4endl;
#endif
session->SessionStart();
delete session;
} else {
// Batch mode
G4String command = "/control/execute ";
G4String fileName = argv[1];
UI->ApplyCommand(command+fileName);
}
delete runManager;
#ifdef G4VIS_USE
delete visManager;
#endif
return 0;
}
@@ -0,0 +1,26 @@
# --------------------------------------------------------------
# $Id: GNUmakefile,v 1.5 2002/12/05 18:09:07 ribon Exp $
# --------------------------------------------------------------
# GNUmakefile for examples module. Gabriele Cosmo, 06/04/98.
# --------------------------------------------------------------
name := CompositeCalorimeter
G4TARGET := $(name)
G4EXLIB := true
ifndef G4INSTALL
G4INSTALL = ../../../
endif
.PHONY: all
all: lib bin
include $(G4INSTALL)/config/binmake.gmk
ifdef G4ANALYSIS_USE
CPPFLAGS += `aida-config --include`
LDFLAGS += `aida-config --lib`
LOADLIBS += `aida-config --lib`
endif
@@ -0,0 +1,37 @@
-------------------------------------------------------------------
$Id: History,v 1.8 2002/12/11 14:32:29 ribon Exp $
-------------------------------------------------------------------
=========================================================
Geant4 - Composite calorimeter example
=========================================================
Example History file
---------------------
11.12.2002 - A.Ribon (ccal-V04-01-04)
- Some clean up and fixes, but unfortunately not yet fixed
the problem of reading the material in the Sun platform
(it looks like a problem with file stream).
06.12.2002 - G.Cosmo (ccal-V04-01-03)
- Migrated messenger to new G4ApplicationState.
15.11.2002 - A.Ribon (ccal-V04-01-02)
- Fixed problem of Anaphe with c-shell, and tested with
geant4-04-01-ref-04
24.10.2002 - A.Ribon (ccal-V04-01-01)
- Changed default physics list to QGSC, with the possibility
of easily switching to either LHEP or QGSP.
24.10.2002 - A.Ribon (ccal-V04-01-00)
- Replaced physics list with ufficial LHEP one;
added visualization and GUI; written README file.
9.10.2002 - S.Banerjee
- Put the various classes in place, and rename them.
30.09.2002 - M.G.Pia
- Created directory
@@ -0,0 +1,603 @@
-------------------------------------------------------------------
$Id: README,v 1.6 2002/12/05 18:09:07 ribon Exp $
-------------------------------------------------------------------
=========================================================
Geant4 - Composite calorimeter example
=========================================================
README
---------------------
CompositeCalorimeter is an example of a test-beam simulation used
by the CMS Collaboration to validate Geant4 against real data taken
(in 1996) in a CMS Hadron calorimeter test-beam.
The name "Composite" for this example emphasizes that, although the
test-beam had the goal of study the hadronic calorimeter response,
part of the data was taken with the presence of the electromagnetic
crystal calorimeter in front of the hadronic calorimeter, to better
reproduce the situation as in the real CMS experiment.
The geometry of the simulation has been setup in such a way to allow
very easily, at run time (therefore without need of changing any code;
see below for the details) the inclusion or exclusion of the
electromagnetic calorimeter part.
Although some important aspects, for a detailed comparison between
test-beam data and simulation, like beam profile, noise, and digitization,
have been omitted here (to avoid too many technical details),
nevertheless, this example is able to reproduce the main features of
most of the relevant observables as measured in the real test-beam.
The output of this example, if the AIDA or Anaphe/Lizard environment
has been properly setup (see below), consists of a set of histograms
and one ntuple which are stored on a HBOOK file.
In our opinion, the most original "lesson" which is offered by this
advanced example for the Geant4 user is to show how the Geometry and
the Sensitive/Hit part of the simulation is treated in a big experiment.
Although the details of how this is done vary from experiment to
experiment (it is worth, for instance, to compare with the Atlas-based
advanced example lAr_calorimeter), the main driving needs and goals
are quite general: to have consistency, but avoiding duplication
and couplings as much as possibile, between Simulation, Reconstruction,
and Visualization. Notice that the solution offered in this example
by CMS could appear "overdone" for the sake of simulating only a
relatively simple test-beam setup; but it should be kept in mind
that the same approach is used also for the full CMS detector
simulation, as well as for any subdetector.
1. Setting up the environment variables
---------------------------------------
The user should first setup, as "usual", the Geant4 environmental
variables (in particular, the variable G4ANALYSIS_USE must be set
if you want to have the histograms and the ntuple).
Then the specific setup for this example should be run:
> source envExample.csh in the case of C-shell
or
> . envExample.sh in the case of bash-shell
The analysis part is based on:
*** AIDA version 3.0 & Anaphe version 5.0.1 ***
NB) Be careful that if you want to have this analysis part,
you have not only to set the variable G4ANALYSIS_USE but
also to edit the above script file (envExample.csh or envExample.sh)
and remove the comments "#" on the setup of AIDA/Anaphe,
because, by default, the analysis is not done (the reason being
that, in some platform, such AIDA/Anaphe setup does not work).
Please take a look to the Anaphe/Lizard web page
http://anaphe.web.cern.ch/anaphe
2. Sample run
-------------
Once the environmental variables are setup, you can get the executable
$G4WORKDIR/bin/$G4SYSTEM/CompositeCalorimeter
by typing "gmake" on this directory.
Then, you can execute it using the Geant4 macro command input file test.g4mac
as follows:
> $G4WORKDIR/bin/$G4SYSTEM/CompositeCalorimeter test.g4mac
which simulate 10 events, each being a 100 GeV pi- incident on the
electromagnetic crystal calorimeter followed by the hadronic calorimeter,
without magnetic field.
The output is the HBOOK file "ccal.his" , which can be seen either with
Lizard (or any other AIDA-compliant package) or with Paw or Root.
See part "8. Analysis / Histogramming" below for more details on the
content of that file.
If you run instead:
> $G4WORKDIR/bin/$G4SYSTEM/CompositeCalorimeter
after having setup the Geant4 visualization variables and the PATH,
you can visualize the geometry of the apparatus, and also see some
events. Similarly, you can get a very simple graphical user interface
that allows to select the particle type, its energy, and the number
of events (between a limited number of possibilities).
For more details, see part "9. Visualization / GUI".
3. Detector description
-----------------------
Let's start with a brief description of the test-beam setup.
There are two possible configurations:
i) HCAL only, that is only the hadronic calorimeter is present;
ii) ECAL+HCAL, that is the electromagnetic calorimeter (ECAL)
is placed in front of the hadronic calorimeter.
ECAL is made of 23 cm long PbWO4 crystals (corresponding to about
25.8 radiation lengths, and 1.1 interaction lengths); for the
test beam a 7 x 7 = 49 matrix of crystals is used.
HCAL is a sampling calorimeter, with plastic scintillator as sensitive
part and copper as absorber. 28 scintillator plates were used with
absorber of varying thickness in between, and also varying thickness
and type of scintillator. More precisely:
--- layer 1: 2 cm of Copper
--- layer 2 to 7: 4 cm of Copper
--- layer 8 to 21: 6 cm of Copper
--- layer 22 to 27: 8 cm of Copper
For the scintillators: 2 mm passive Plastic; 4 mm active Plastic;
1 mm passive Plastic.
The total length of HCAL consists of 152 cm of Copper plus 189 mm of Plastic.
The dimension orthogonal to the beam direction is 64 cm x 64 cm.
The ECAL and HCAL considered here are prototypes for the Central and
Endcap calorimeters of the CMS detector (which covers the rapidity
region |eta| < 3.0 ; CMS has also a Forward calorimeter, which covers
the region 3.0 < |eta| < 5.0, but this part was not considered in
this test-beam setup). Notice, however, that there are more layers
(28 instead of 19 in the Barrel or 18 in the Endcap) of HCAL in the
test-beam setup than in the real CMS detector, in order to study
energy containment. Therefore, the ECAL+HCAL in the test-beam amounts
to more than 11 radiation lengths as for the real CMS detector (the
19 layers of the Barrel have each 6 cm of absorber, whereas the
18 layers of the Endcap have each 6.6 cm of absorber, so that the
number of interaction lengths are rougly the same).
Five values of the magnetic field (parallel to the face of the scintillators)
have been considered in the test-beam: 0.0 , 0.375 , 0.75 , 1.50 , 3.0 Tesla.
In order to set the magnetic field, you have to edit the file
dataglobal/fmap.tb96
and change the first number (which appears in the third line of
that file, on the first column; the unit being Tesla):
#. Field map
*DO FLDM
0.0 9 652.0
for example, if you want a magnetic field of 3.0 Tesla the last
line must be set as follows:
3.0 9 652.0
In this test-beam setup, at the back of ECAL, there is also some
material for support and readout, which has been considered in the
simulation. For the HCAL, only the fibres are close to the test-beam,
and because they have the same composition as the scintillators
they are adequately represented in the simulation; the remaining
of the readout, including the photomultipliers, are in readout boxes
far away from the HCAL, and hence are not present in the simulation.
Let's summarizes now the geometry description of the simulation.
As said in the introduction, this part is the most original and
important of this example, but it is quite complex and can be fully
appreciated only in the context of the CMS software framework, in
particular in the relation between Simulation, Reconstruction, and
Visualization. Therefore we limit ourself to only few considerations,
pointing to the internal CMS documentation for more details.
--- In order to share the same geometrical and physical information
about CMS between Simulation, Reconstruction, and Visualization,
avoiding inconsistencies, duplications, and unnecessary dependecies,
all these information is store, once for all, in common databases
(typically in XML format), instead of putting them inside C++ classes,
as usually done in simpler detector descriptions (in most of the
the Geant4 examples, novice or advanced, the geometry information
is kept inside the concrete class which inherits from
G4VUserDetectorConstruction). For simplicity, in this example,
these "databases" are nothing more than ASCII files:
datageom/ : tbhcal96.geom, tbhcal96hcal.geom, tbhcal96xtal.geom
store the information about the experimental Hall,
the HCAL, and the ECAL, respectively.
dataconf/ : g4testbeamhcal96.conf, testbeamhcal96.conf
store the information about which configuration
(HCAL only, or ECAL+HACL) is considered, in the
Simulation and Reconstruction, respectively.
dataglobal/ : fmap.tb96, material.cms, rotation.cms
The first one is the magnetic field map (how the
intensity of the magnetic field, in the direction
orthogonal to the beam direction, varies along
the beam axis). The second one, material.cms,
keeps the full collection of all materials used in
the CMS detector (not only in the calorimeters,
although we are simulating only them in this example!).
The third one, rotation.cms, collects a set of useful
rotation parameters (angles).
datavis/ : tbhcal96.vis, tbhcal96hcal.vis, tbhcal96xtal.vis
visualization information for, respectively, the
experimental Hall, HCAL, and ECAL.
--- In order to allow an high degree of flexibility, at the geometry
level the user can choose which subsystem of the detector setup
should be simulated and can activate or deactivate the sensitive
parts, subsystem by subsystem. This can be done at run time,
by modifying one of the above database information, without need
of putting the hands on the code, recompiling, etc.
--- There are two "parallel geometry factories": one described by "core"
classes, which are independent from the Simulation (and therefore
can be used, for instance, by the Reconstruction); and one which
is specific of the Simulation. In the latter case (Geant4 side of
the geometry model), all the geometry factories are derived from the
base class CCalG4Albe. Furthermore, using double inheritance, each
of them derives also from the counterpart in the "core" hierarchy.
The design of the CCalG4Able class helps a modular approach and easy
interchanging at the level of subdetectors, allowing a straightforward
transition from the simulation of the entire CMS detector to that of
just a part of it, or to a test-beam geometry, as indeed in this example.
Of course this modular, flexible, and general approach does not come
for free: the price to pay here is its complexity, which would be
otherwise unjustified if we limited ourself to the pure simulation
of a relatively simple test-beam setup.
--- See "10. Classes Overview" below for a schematic summary of the
various classes involved in the Geometry description of this example.
4. Physics processes
--------------------
By the default, one of the ufficial High Energy Physics List for
Calorimetry, QGSC, is used in this example. However, it is
very easy to use instead either LHEP or QGSP. To do so, it is
enough to copy one file (and then, of course, rebuild the executable)
as follows:
> cp src/CCalPhysicsList.cc-LHEP src/CCalPhysicsList.cc
if you want to use LHEP, or
> cp src/CCalPhysicsList.cc-QGSP src/CCalPhysicsList.cc
if you want to use QGSP.
(The fact that by default QGSC is used means that the file
src/CCalPhysicsList.cc that you find in the Repository is
a copy of src/CCalPhysicsList.cc-QGSC)
Notice that, for most of the cases (and certainly also in this case
in which we don't even take into account the beam profile, noise
and digitization!) the faster LHEP Physics List would be good enough
for calorimetry studies. However, we prefer to use, as default, the
more sophisticated (but slower) QGSP Physics List for the learning
purposes of this example.
Please refer to the Web page:
http://cmsdoc.cern.ch/~hpw/GHAD/HomePage/index.html
for more information on these (and others) Physics Lists.
Please notice that, for the time being, some classes, which can be
downloaded from the above Web page, have to be included in the
include/ and src/ subdirectories of this example. However, soon
(probably with the next December release) these classes will be
distributed with Geant4 and therefore their explicit inclusion
in the example will no longer be necessary.
5. Particle Generator
---------------------
The 1996 test-beam has been taken with the following particles:
--- 225 GeV muons (for calibration)
--- 10 to 300 GeV pions
--- 10 to 300 GeV electrons
therefore the standard Geant4 Particle Gun has been used as primary
generator. Notice that, for the sake of keeping the example not too
complicated, the proper simulation of the beam profile and
beam contamination have been neglected.
6. Hits
-------
In CMS there are two groups of hits: Tracker-like and Calorimeter-like.
Only the latter one appears in this example.
For the same reasons, as seen for the Geometry, of consistency without
duplication of information and unnecessary coupling between Simulation,
Reconstruction, and Visualization, the simulation calorimeter hit class,
CCalG4Hit, doubly inherits from the common Geant4 abstract class for
all hits, G4VHit, and from the "core" (i.e. simulation independent)
CMS calorimeter hit class, CCalHit.
A new Hit object is created
- for each new particle entering the calorimeter;
- for each detector unit (i.e cristal or fiber or scintillator layer);
- for each nanosecond of the shower development;
The information stored in each CCalHit object is the following:
- Entry : local coordinates of the entrance point of the particle
in the unit where the shower starts;
- the TrackID : Identification number of the incident particle;
- the IncidentEnergy : kinetic energy of that incident particle;
- the UnitID : the identification number of the detector unit
(crystal, or fiber, or scintillator layer);
- the TimeSlice : the time interval, in nanoseconds, in which the
hit has been created;
- the EnergyDeposit : the energy deposit in this hit.
Notice that all hit objects created for a given shower have the same
values for the first three pieces of information.
No Noise and Digitization
--------------------------
In order to keep the complexity of this example to a reasonable
level, both noise and digitization effects have not been included.
7. User Actions
----------------
In this example. there have been used the following User Actions:
--- G4UserRunAction (the derived, concrete class is CCalRunAction):
it is used to invoke the Analysis object at the beginning of
the Run, to instantiate it and passing it the Run number, and
at the end of the Run, to inform it that the Run is finished
and therefore the histograms, ntuples, etc. must be closed.
--- G4UserEventAction (the derived, concrete class is CCalEndOfEventAction):
it is used to examine, at the end of the Event, all collected
(calorimeter) hits, extract the various observables which are
interesting (to the goal of understanding things like: the effect
of magnetic field on scintiallator; choice of the absorber
thickness by optimizing resolution versus containment; impact of
the absorber depth in the energy caontainment; electromagnetic
calorimeter contribution in the electron - pion separation; etc.)
and finally call the analysis object to store such selected
information on histograms and/or in the ntuple.
The name of the class "CCalEndOfEventAction" is motivated by the
fact that at the beginning of the Event nothing is done.
--- G4UserSteppingAction (the derived, concrete class is CCalSteppingAction):
it is used to extract some "unphysical" information (that is not
experimentally measurable, although interesting for a better
understanding of the shower development), namely the lateral profile
and the deposit as a function of the time (see "8.Analysis/Histogramming
for more details"), which is available only from simulation, and then,
at the end of Event, the analysis object is invoked to store such
information on histograms.
Please notice that the stepping action is not used to create hits.
--- G4UserStackingAction (the derived, concrete class is CCalStackingAction):
it is used to ensure that the same track ID of the particle
originating a shower appears in all hits (calorimeter hit objects
of class CCalHit) of the shower, in any calorimeter part.
8. Analysis / Histogramming
----------------------------
The analysis part of CompositeCalorimeter is kept in class CCalAnalysis,
and is based on the AIDA interfaces and their implementation in Anaphe:
*** AIDA version 3.0 & Anaphe version 5.0.1 ***
please look at their documentation for more details:
http://anaphe.web.cern.ch/anaphe
Both the histograms and the ntuple are saved at the end of the run in the
HBOOK file "ccal.his". You can than analyze offline the contents of such
a file, using Lizard (or any other AIDA-compliant package) or with
Paw or Root. Please note that in a multiple run session, the last run
always override the HBOOK file.
What the histograms and the variables of the ntuple represent is
explained below:
Histograms 100 - 127 : energy deposit (in GeV) in the sensitive part
(plastic scintillator layer) of one Hadronic
calorimeter module (there are 28 modules, numbered
from 0 to 27, and the corresponding histogram has
ID = 100 + number of module).
Ntuple variables hcal0 - hcal27 : provide the same information.
Histograms 200 - 248 : energy deposit (in GeV) in one crystal
electromagnetic towers (there are a matrix of
7 x 7 = 49 towers, numbered from 0 to 48, and
the corresponding histogram has
ID = 200 + number of tower).
Ntuple variables ecal0 - ecal48 : provide the same information.
Histograms 300 - 339 : total energy deposit (in GeV) in any
electromagnetic crystal tower or hadronic module
(either in a sensitive or insensitive layer)
in one of the 40 nanosecond time slices: in other
words, histogram 300+I , where I = 0 - 39,
contains the total deposit energy between
I and I+1 nanoseconds after the "collision".
(Notice that the time window considered,
40 nanoseconds, is larger than the LHC
bunch-crossing of 25 nanoseconds.)
Histograms 400 - 469 : energy profile (in GeV), summed over all layers
sensitive (plastic scintillator) and insensitive
(copper absorber), as a function of the radial
distance (in centimeter) from the beam axis
( ID histo = 400 + radial distance in cm ).
Histogram 4000 : total energy deposit (in GeV) in the sensitive parts
of either the electromagnetic or hadronic calorimeters.
Ntuple variable edep provides the same information.
Other ntuple variables are the following:
--- elab : energy (in GeV) of the incident particle.
--- xpos, ypos, zpos : position (in mm) from where the projectile
has been shot.
--- edec, edhc : total energy deposit (in GeV) in the sensitive
parts of, respectively, the electromagnetic
and hadronic calorimeters. Notice that their
sum edec+edhc coincides with edep
Notice that lateral profile (400-469) and time-slice (300-339)
histograms show purely Monte Carlo quantities, which cannot be
experimentally measured.
Please be careful that the range of the histograms has been chosen
in such a way to contain most of the entries, but only few histograms
fill a large fraction of that range, whereas the remaining majority
fill only the first few bins (corresponding to lower energy), and,
therefore, when plotted they look almost empty, but they are not,
and the results are sensible. We suggest to plot the ntuple's variables,
rather than the histograms, when the same information is available
from the ntuple.
9. Visualization / GUI
-----------------------
If you setup one of the following Geant4 environmental variables:
G4VIS_USE_DAWN
G4VIS_USE_VRML
G4VIS_USE_OPENGLX
which correspond to the use of DAWN, VRML, and OPENGLX, respectively,
as visualization engine of Geant4, and set properly the corresponding
PATH as well, it is then possible to visualize the detector and also
some events.
To do so, you have to run
> $G4WORKDIR/bin/$G4SYSTEM/CompositeCalorimeter
without input file: you then see the detector; after that,
you can select the particle gun and its energy, in the
case you want something different from the the default
(which is a 100 GeV pi-), for example:
Idle> /gun/particle e-
Idle> /gun/energy 200 GeV
and then run some events, for example:
Idle> /run/beamOn 3
Notice that, by default, OGLIX is used for the visualization,
because it is quite fast and it does not produce any files in
output. However, you can always choose something else, for example
VRML2FILE or DAWNFILE, either interactively as follows:
Idle> /vis/open DAWNFILE
or by changing the default, by editing the file (main program)
CompositeCalorimeter.cc and comment/uncomment the lines
in such a way to have, at the end:
visCommand = "/vis/open DAWNFILE";
// visCommand = "/vis/open VRML2FILE";
// visCommand = "/vis/open OGLIX";
The tracks that are shown include both charged and neutral particles
of any momentum: if you want instead only charged, or only neutral,
then you have simply to edit src/CCalEndOfEventAction.cc
at the end of the method EndOfEventAction and uncomment the line
where the condition on the charge is made (it should then be
straighforward to eventual add some other conditions, for example
if you want to see only those particles that satisfy certain
kinematic conditions).
Rather than to specify "by hand" the type of particle gun,
its energy, and the number of events, it is possible to have
a very simple GUI (graphical user interface) from which to make
such choices, between a limited set of possibilities, via menus.
Such GUI is based on Motif XmCommand widget, but it would be
straightforward, eventually, to make the necessary changes
in order to use a different one.
The only thing you need to do to get the GUI is to setup
the following Geant4 environmental variables:
G4UI_BUILD_XM_SESSION=1
G4UI_USE_XM=1
Then, if you run the executable without specifying a macro file
(like test.g4mac):
> $G4WORKDIR/bin/$G4SYSTEM/CompositeCalorimeter
a window automatically pops out, with the menus where you
can make your selection of particle type, energy, and number
of events to be run.
10. Classes Overview
---------------------
This is a schematic overview of the classes defined in this example:
CCalPrimaryGeneratorAction
CCalPrimaryGeneratorMessenger
User action for primaries generator.
CCalPhysicsList
EMPhysics
G4EMBuilder
G4ElectroNuclearBuilder
G4HadronQEDBuilder
G4LEPNeutronBuilder
G4LEPPiKBuilder
G4LEPProtonBuilder
G4LHEPNeutronBuilder
G4LHEPPiKBuilder
G4LHEPProtonBuilder
G4MiscLHEPBuilder
G4NeutronBuilder
G4NeutronHPBuilder
G4PiKBuilder
G4PrecoNeutronBuilder
G4PrecoProtonBuilder
G4ProtonBuilder
G4QGSCNeutronBuilder
G4QGSCPiKBuilder
G4QGSCProtonBuilder
G4QGSPNeutronBuilder
G4QGSPPiKBuilder
G4QGSPProtonBuilder
G4StoppingHadronBuilder
G4VNeutronBuilder
G4VPiKBuilder
G4VProtonBuilder
GeneralPhysics
HadronPhysicsLHEP
HadronPhysicsQGSC
HadronPhysicsQGSP
IonPhysics
MuonPhysics
Determination of particles and processes active in this example.
The following three major Physics Lists for High Energy
Calorimetry can been selected: LHEP, QGSC, QGSP.
Most of these classes will be soon moved in the Geant4 kernel.
Please refer to the Web page:
http://cmsdoc.cern.ch/~hpw/GHAD/HomePage/index.html
for more information of these (and others) Physics Lists,
and for eventual updated versions.
CCalDetectorConstruction
CCalAMaterial
CCalDataSet
CCalDetector
CCalEcal
CCalEcalOrganization
CCalG4Able
CCalG4Ecal
CCalG4Hall
CCalG4Hcal
CCalGeometryConfiguration
CCalHall
CCalHcal
CCalHcalOrganization
CCalMagneticField
CCalMaterial
CCalMaterialFactory
CCalRotationMatrixFactory
CCalVOrganization
CCalVisManager
CCalVisualisable
CCaloOrganization
CCalutils
Geometry and material definitions for the detector.
Notice in particular that:
CCalHall, CCalEcal, CCalHcal derive from CCalDetector;
CCalG4Hall, CCalG4Ecal, CCalG4Hcal derive from the above
corresponding classes and from CCalG4Able;
CCalEcalOrganization, CCalHcalOrganization derive from
CCalVOrganization : each sensitive cell has an unique
number for detector organization (this is a software
ID not an hardware/electronic one).
CCalHit
CCalG4Hit
CCalG4HitCollection
CCalSDList
CCalSensAssign
CCalSensitiveConfiguration
CCalSensitiveDetectors
CCaloSD
Hit and Sensitive Detectors.
Notice in particular that:
CCalG4Hit derives from G4VHit and CCalHit;
CCaloSD derives from G4VSensitiveDetector.
CCalAnalysis
Analysis manager class which uses Anaphe.
CCalRunAction
User run action class.
CCalEndOfEventAction
User event action class.
CCalStackingAction
User Stacking action class.
CCalSteppingAction
User Stepping action class.
@@ -0,0 +1,11 @@
#. Configuration file to select the G4 Geometry properties
#. Name Base Filename IsSensitive
"HcalTB96" "tbhcal96" 1
#.============= Hadron Calorimeter
"HadronCalorimeter" "tbhcal96hcal" 1
#.============= CrystalMatrixModule
"CrystalMatrixModule" "tbhcal96xtal" 1
@@ -0,0 +1,11 @@
#. Configuration file to select the Geometry
#. Name Base Filename Construct?
"HcalTB96" "tbhcal96" 1
#.============= Hadron Calorimeter
"HadronCalorimeter" "tbhcal96hcal" 1
#.============= CrystalMatrixModule
"CrystalMatrixModule" "tbhcal96xtal" 1
@@ -0,0 +1,6 @@
#. HCAL 96 Test beam description fil
*DO HcalTB96
#.Experimentall hall size
#. Material dy/2 dx/2
"Air" 375.0 1384.0
*ENDDO
@@ -0,0 +1,55 @@
#. HCAL 96 Test beam description file for HCAL part
*DO HCal
#. Mother volume of HCal
#. Material dy/2 dx/2 Xpos
"Air" 375.0 1013.0 361.0
#. Boxes
#. Material Number dy/2 dx/2 Wall_T Positions
"Aluminium" 2 375.0 490.0 4.0 -523.0 509.0
#. Scintillator Layers
#. Type_Name Number
#. Type Mother Xpos Type Mother Xpos
"ScintillatorLayer" 28
2 0 -427.0 1 0 -393.5
0 0 -351.5 0 0 -314.5
0 0 -277.5 0 0 -238.5
0 0 -201.5 0 0 -164.5
0 0 -95.5 0 0 -27.5
0 0 39.5 0 0 107.5
0 0 175.5 0 0 243.5
0 0 318.5 0 0 388.5
0 -1 -14.5 0 1 -412.5
0 1 -344.5 0 1 -274.5
0 1 -205.5 0 1 -136.5
2 1 -47.0 1 1 45.5
2 1 138.0 1 1 232.5
2 1 328.0 0 -1 1009.5
#. Absorber Layers
#. Type_Name Number
#. Type Mother Xpos Type Mother Xpos
"AbsorberLayer" 28
0 0 -410.0 1 0 -370.0
1 0 -333.0 1 0 -296.0
1 0 -257.0 1 0 -220.0
1 0 -183.0 3 0 -129.0
3 0 -61.0 3 0 6.0
3 0 74.0 3 0 142.0
3 0 210.0 3 0 285.0
3 0 355.0 3 0 429.0
3 1 -446.0 3 1 -378.0
3 1 -308.0 3 1 -239.0
3 1 -170.0 4 1 -92.0
4 1 -1.0 4 1 93.0
4 1 186.0 4 1 283.0
2 1 358.0 2 1 438.0
#. Absorber
#. Material Number dY/2 Half thicknesses
"Copper" 5 330.0 10.0 15.0 20.0 30.0 40.0
#. Scintillator
#. Material Wrapper Plastic Number
#. dY/2 dX/2(L) dX/2(W) dX/2(FP) dX/2(BP) dX/2(Sc)
"Scintillator" "Aluminium" "Polystyrene" 3
320.0 3.5 0.0 0.5 1.0 2.0
320.0 6.5 0.0 0.5 1.0 5.0
330.0 5.0 0.5 0.5 0.5 2.0
*ENDDO
@@ -0,0 +1,18 @@
#. HCAL 96 Test beam description file for crystal matrix
*DO CrystalMatrix
#. Envelope
#. Material Width Length Position in space and Rotation angles
"Air" 320.0 682.0
-1033.0 0.0 0.0 90.0 90.0 0.0 0.0 90.0 0.0
#. -1033.0 0.0 0.0 90.0 270.0 0.0 0.0 90.0 180.0
#. Layer
#. Material Number Radius Angle FrontLength Parameters
"Air" 7 1500.0 0.01386 100.0
10.5 11.9 73.5 85.0 115.5
#. Crystal
#. Material Number Length Toler. Parameters
"E_PbWO4" 7 232.0 0.5 10.25 11.90 10.25 11.90 115.0
#. Support
#. Material dX dY dZ dist
"Copper" 170.0 5.5 37.0 20.0
*ENDDO
@@ -0,0 +1,13 @@
#. Field map
*DO FLDM
0.0 9 652.0
-480.0 0.0012125 0.80
-240.0 0.0015625 0.93
80.0 0.0010 0.82
260.0 0.0003889 0.90
620.0 0.0 1.00
800.0 -0.0003333 1.20
1120.0 -0.0010 1.70
1360.0 -0.0015625 2.30
2026.0 -0.0012125 1.85
*ENDDO
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,112 @@
*.-- rotation.tz
*LOG OFF
*DO ROTM 0 -U -A4CW -C1/80 #.Title for CMS100 created on 940722 at 1159
#. Thet1 Phi1 Thet2 Phi2 Thet3 Phi3
:000D 90.0 0.0 90.0 90.0 0.0 0.0 #. (x,y,z) => ( x, y, z)
:YZXD -90.0 0.0 -90.0 90.0 0.0 0.0 #. (x,y,z) => (-x,-y, z)
:180X 90.0 0.0 90.0 -90.0 180.0 0.0 #. (x,y,z) => ( x,-y,-z)
:180D 90.0 180.0 90.0 90.0 180.0 0.0 #. (x,y,z) => (-x, y,-z)
:180Z 90.0 90.0 -90.0 0.0 0.0 0.0 #. (x,y,z) => ( y,-x, z)
:Z180 -90.0 90.0 90.0 0.0 0.0 0.0 #. (x,y,z) => (-y, x, z)
:90ZD -90.0 0.0 0.0 0.0 90.0 90.0 #. (x,y,z) => (-x, z, y)
:90XD 90.0 90.0 0.0 0.0 90.0 0.0 #. (x,y,z) => ( y, z, x)
:90DX -90.0 90.0 180.0 0.0 90.0 0.0 #. (x,y,z) => (-y,-z, x)
:20XD 90.0 70.0 0.0 0.0 90.0 -20.0 #. (x,y,z) => ( ?, z, ?)
:60XD 90.0 110.0 0.0 0.0 90.0 20.0 #. (x,y,z) => ( ?, z, ?)
:90YZ 90.0 -90.0 180.0 0.0 90.0 0.0 #. (x,y,z) => (-y,-z, x)
:90YD 0.0 0.0 90.0 0.0 90.0 90.0 #. (x,y,z) => ( z, x, y)
:90XY 0.0 0.0 90.0 -90.0 90.0 0.0 #. (x,y,z) => ( z,-y, x)
:90YX 180.0 0.0 90.0 90.0 90.0 0.0 #. (x,y,z) => (-z, y, x)
:YXZ2 90.0 90.0 0.0 90.0 90.0 0.0 #. (x,y,z) => ( y, z, x)
:YXZ4 90.0 -90.0 90.0 0.0 0.0 0.0 #. (x,y,z) => (-y, x, z)
:YXZ5 90.0 -90.0 90.0 180.0 180.0 0.0 #. (x,y,z) => (-y,-x,-z)
:R000 90.0 0.0 90.0 90.0 0.0 0.0 #. (x,y,z) => ( x, y, z)
:R005 90.0 5.0 90.0 95.0 0.0 0.0 #. (x,y,z) => ( ?, ?, z)
:R010 90.0 10.0 90.0 100.0 0.0 0.0 #. (x,y,z) => ( ?, ?, z)
:R015 90.0 15.0 90.0 105.0 0.0 0.0 #. (x,y,z) => ( ?, ?, z)
:R020 90.0 20.0 90.0 110.0 0.0 0.0 #. (x,y,z) => ( ?, ?, z)
:R025 90.0 25.0 90.0 115.0 0.0 0.0 #. (x,y,z) => ( ?, ?, z)
:R030 90.0 30.0 90.0 120.0 0.0 0.0 #. (x,y,z) => ( ?, ?, z)
:R035 90.0 35.0 90.0 125.0 0.0 0.0 #. (x,y,z) => ( ?, ?, z)
:R040 90.0 40.0 90.0 130.0 0.0 0.0 #. (x,y,z) => ( ?, ?, z)
:R045 90.0 45.0 90.0 135.0 0.0 0.0 #. (x,y,z) => ( ?, ?, z)
:R050 90.0 50.0 90.0 140.0 0.0 0.0 #. (x,y,z) => ( ?, ?, z)
:R055 90.0 55.0 90.0 145.0 0.0 0.0 #. (x,y,z) => ( ?, ?, z)
:R060 90.0 60.0 90.0 150.0 0.0 0.0 #. (x,y,z) => ( ?, ?, z)
:R065 90.0 65.0 90.0 155.0 0.0 0.0 #. (x,y,z) => ( ?, ?, z)
:R070 90.0 70.0 90.0 160.0 0.0 0.0 #. (x,y,z) => ( ?, ?, z)
:R075 90.0 75.0 90.0 165.0 0.0 0.0 #. (x,y,z) => ( ?, ?, z)
:R080 90.0 80.0 90.0 170.0 0.0 0.0 #. (x,y,z) => ( ?, ?, z)
:R085 90.0 85.0 90.0 175.0 0.0 0.0 #. (x,y,z) => ( ?, ?, z)
:R090 90.0 90.0 90.0 180.0 0.0 0.0 #. (x,y,z) => ( y,-x, z)
:R095 90.0 95.0 90.0 185.0 0.0 0.0 #. (x,y,z) => ( ?, ?, z)
:R100 90.0 100.0 90.0 190.0 0.0 0.0 #. (x,y,z) => ( ?, ?, z)
:R105 90.0 105.0 90.0 195.0 0.0 0.0 #. (x,y,z) => ( ?, ?, z)
:R110 90.0 110.0 90.0 200.0 0.0 0.0 #. (x,y,z) => ( ?, ?, z)
:R115 90.0 115.0 90.0 205.0 0.0 0.0 #. (x,y,z) => ( ?, ?, z)
:R120 90.0 120.0 90.0 210.0 0.0 0.0 #. (x,y,z) => ( ?, ?, z)
:R125 90.0 125.0 90.0 215.0 0.0 0.0 #. (x,y,z) => ( ?, ?, z)
:R130 90.0 130.0 90.0 220.0 0.0 0.0 #. (x,y,z) => ( ?, ?, z)
:R135 90.0 135.0 90.0 225.0 0.0 0.0 #. (x,y,z) => ( ?, ?, z)
:R140 90.0 140.0 90.0 230.0 0.0 0.0 #. (x,y,z) => ( ?, ?, z)
:R145 90.0 145.0 90.0 235.0 0.0 0.0 #. (x,y,z) => ( ?, ?, z)
:R150 90.0 150.0 90.0 240.0 0.0 0.0 #. (x,y,z) => ( ?, ?, z)
:R155 90.0 155.0 90.0 245.0 0.0 0.0 #. (x,y,z) => ( ?, ?, z)
:R160 90.0 160.0 90.0 250.0 0.0 0.0 #. (x,y,z) => ( ?, ?, z)
:R165 90.0 165.0 90.0 255.0 0.0 0.0 #. (x,y,z) => ( ?, ?, z)
:R170 90.0 170.0 90.0 260.0 0.0 0.0 #. (x,y,z) => ( ?, ?, z)
:R175 90.0 175.0 90.0 265.0 0.0 0.0 #. (x,y,z) => ( ?, ?, z)
:R180 90.0 180.0 90.0 270.0 0.0 0.0 #. (x,y,z) => (-x,-y, z)
:R185 90.0 185.0 90.0 275.0 0.0 0.0 #. (x,y,z) => ( ?, ?, z)
:R190 90.0 190.0 90.0 280.0 0.0 0.0 #. (x,y,z) => ( ?, ?, z)
:R195 90.0 195.0 90.0 285.0 0.0 0.0 #. (x,y,z) => ( ?, ?, z)
:R200 90.0 200.0 90.0 290.0 0.0 0.0 #. (x,y,z) => ( ?, ?, z)
:R205 90.0 205.0 90.0 295.0 0.0 0.0 #. (x,y,z) => ( ?, ?, z)
:R210 90.0 210.0 90.0 300.0 0.0 0.0 #. (x,y,z) => ( ?, ?, z)
:R215 90.0 215.0 90.0 305.0 0.0 0.0 #. (x,y,z) => ( ?, ?, z)
:R220 90.0 220.0 90.0 310.0 0.0 0.0 #. (x,y,z) => ( ?, ?, z)
:R225 90.0 225.0 90.0 315.0 0.0 0.0 #. (x,y,z) => ( ?, ?, z)
:R230 90.0 230.0 90.0 320.0 0.0 0.0 #. (x,y,z) => ( ?, ?, z)
:R235 90.0 235.0 90.0 325.0 0.0 0.0 #. (x,y,z) => ( ?, ?, z)
:R240 90.0 240.0 90.0 330.0 0.0 0.0 #. (x,y,z) => ( ?, ?, z)
:R245 90.0 245.0 90.0 335.0 0.0 0.0 #. (x,y,z) => ( ?, ?, z)
:R250 90.0 250.0 90.0 340.0 0.0 0.0 #. (x,y,z) => ( ?, ?, z)
:R255 90.0 255.0 90.0 345.0 0.0 0.0 #. (x,y,z) => ( ?, ?, z)
:R260 90.0 260.0 90.0 350.0 0.0 0.0 #. (x,y,z) => ( ?, ?, z)
:R265 90.0 265.0 90.0 355.0 0.0 0.0 #. (x,y,z) => ( ?, ?, z)
:R270 90.0 270.0 90.0 0.0 0.0 0.0 #. (x,y,z) => (-y, x, z)
:R275 90.0 275.0 90.0 5.0 0.0 0.0 #. (x,y,z) => ( ?, ?, z)
:R280 90.0 280.0 90.0 10.0 0.0 0.0 #. (x,y,z) => ( ?, ?, z)
:R285 90.0 285.0 90.0 15.0 0.0 0.0 #. (x,y,z) => ( ?, ?, z)
:R290 90.0 290.0 90.0 20.0 0.0 0.0 #. (x,y,z) => ( ?, ?, z)
:R295 90.0 295.0 90.0 25.0 0.0 0.0 #. (x,y,z) => ( ?, ?, z)
:R300 90.0 300.0 90.0 30.0 0.0 0.0 #. (x,y,z) => ( ?, ?, z)
:R305 90.0 305.0 90.0 35.0 0.0 0.0 #. (x,y,z) => ( ?, ?, z)
:R310 90.0 310.0 90.0 40.0 0.0 0.0 #. (x,y,z) => ( ?, ?, z)
:R315 90.0 315.0 90.0 45.0 0.0 0.0 #. (x,y,z) => ( ?, ?, z)
:R320 90.0 320.0 90.0 50.0 0.0 0.0 #. (x,y,z) => ( ?, ?, z)
:R325 90.0 325.0 90.0 55.0 0.0 0.0 #. (x,y,z) => ( ?, ?, z)
:R330 90.0 330.0 90.0 60.0 0.0 0.0 #. (x,y,z) => ( ?, ?, z)
:R335 90.0 335.0 90.0 65.0 0.0 0.0 #. (x,y,z) => ( ?, ?, z)
:R340 90.0 340.0 90.0 70.0 0.0 0.0 #. (x,y,z) => ( ?, ?, z)
:R345 90.0 345.0 90.0 75.0 0.0 0.0 #. (x,y,z) => ( ?, ?, z)
:R350 90.0 350.0 90.0 80.0 0.0 0.0 #. (x,y,z) => ( ?, ?, z)
:R355 90.0 355.0 90.0 85.0 0.0 0.0 #. (x,y,z) => ( ?, ?, z)
:R360 90.0 360.0 90.0 90.0 0.0 0.0 #. (x,y,z) => ( x, y, z)
:Z1YX 90.0 90.0 0.0 0.0 90.0 0.0 #. (x,y,z) => ( y, z, x)
:Z2XY 90.0 0.0 180.0 0.0 90.0 90.0 #. (x,y,z) => ( x,-z, y)
:Z3XY -90.0 0.0 0.0 0.0 90.0 90.0 #. (x,y,z) => (-x, z, y)
:Z4YX 90.0 90.0 180.0 0.0 -90.0 0.0 #. (x,y,z) => ( y,-z,-x)
:Z5YX -90.0 90.0 0.0 0.0 -90.0 0.0 #. (x,y,z) => (-y, z,-x)
:Z6XY -90.0 0.0 180.0 0.0 -90.0 90.0 #. (x,y,z) => (-x,-z,-y)
:Z7XY 90.0 0.0 0.0 0.0 -90.0 90.0 #. (x,y,z) => ( x, z,-y)
:Z8YX -90.0 90.0 180.0 0.0 90.0 0.0 #. (x,y,z) => (-y,-z, x)
:270Y 0.0 0.0 90.0 90.0 90.0 180.0 #. (x,y,z) => (-z, y, x)
:90XYZ 180.0 0.0 90.0 270.0 90.0 180.0 #. (x,y,z) => (-z,-y,-x)
:90ZX 180.0 0.0 90.0 0.0 90.0 270.0 #. (x,y,z) => (-z, x,-y)
:90ZXY 180.0 0.0 90.0 180.0 90.0 90.0 #. (x,y,z) => (-z,-x, y)
:270YX 0.0 0.0 90.0 180.0 90.0 270.0 #. (x,y,z) -> ( z,-x,-y)
:Y100 95.7296 0.0 90.0 90.0 5.7296 0.0 #. rotn by 100mr around y
:9NYX 0.0 0.0 90.0 90.0 -90.0 0.0 #. (x,y,z) => ( z, y,-x)
:F100 -95.7296 0.0 -90.0 90.0 -5.7296 0.0 #. flip z + rotn 100mr y
*ENDDO
@@ -0,0 +1,9 @@
#. 96 Hcal Test beamm visualisation attributtes
#. visType visualisable? R G B WireFrame
"Sensitive" 1 0.0 0.0 1.0 0
"Electronics" 0 0.0 0.0 0.0 1
"Support" 0 0.0 0.0 0.2 1
"Cable" 0 0.8 0.8 0.1 1
"Absorber" 1 0.3 0.3 0.0 0
"OtherServices" 0 0.2 0.4 0.2 1
"PseudoVolumes" 0 0.2 0.4 0.2 1
@@ -0,0 +1,9 @@
#. HCal visualisation attributtes
#. visType visualisable? R G B WireFrame
"Sensitive" 1 0.0 0.0 1.0 0
"Electronics" 0 0.0 0.0 0.0 1
"Support" 0 0.0 0.0 0.2 1
"Cable" 0 0.8 0.8 0.1 1
"Absorber" 1 0.6 0.1 0.1 0
"OtherServices" 0 0.2 0.4 0.2 1
"PseudoVolumes" 0 0.2 0.4 0.2 1
@@ -0,0 +1,9 @@
#. CrystalModule visualisation attributtes
#. visType visualisable? R G B WireFrame
"Sensitive" 1 1.0 0.0 0.0 0
"Electronics" 0 0.0 0.0 0.0 1
"Support" 1 0.0 0.5 0.0 1
"Cable" 0 0.8 0.8 0.1 1
"Absorber" 0 0.0 0.3 0.3 0
"OtherServices" 0 0.2 0.4 0.2 1
"PseudoVolumes" 0 0.2 0.4 0.2 1
+32
View File
@@ -0,0 +1,32 @@
#------------------------------------------------------------------
# C-shell script to be run before building/executing this example.
# It has two parts: one for the Aida setup (for the histograms,
# ntuples, and more in general for the data analysis); and one
# more specific for this test-beam example.
# Please notice that before running this script, you have to define
# the usual Geant4 variables (in particular, the variable
# G4ANALYSIS_USE must be set to 1).
#------------------------------------------------------------------
#
### # --- Aida 2.2 , Anaphe 4.0.5 ---
### setenv LHCXXTOP /afs/cern.ch/sw/lhcxx/
### setenv LHCXXVERS 4.0.5
### setenv PLATF redhat72/gcc-2.95.2/
### source $LHCXXTOP/share/LHCXX/$LHCXXVERS/install/sharedstart.csh
#
# --- Aida 3.0 , Anaphe 5.0.1 ---
#source /afs/cern.ch/sw/lhcxx/share/LHCXX/5.0.1/scripts/setupAnaphe.csh
#setenv PATH ${PATH}:/afs/cern.ch/sw/lhcxx/share/LHCXX/5.0.1/scripts/
#
# --- Specific setup for this test-beam example ---
setenv CCAL_CONFPATH ./dataconf
setenv CCAL_SENSITIVECONF g4testbeamhcal96.conf
setenv CCAL_GEOMETRYCONF testbeamhcal96.conf
setenv CCAL_GLOBALPATH ./dataglobal
setenv CCAL_GEOMPATH ./datageom
setenv CCAL_VISPATH ./datavis
# ---
+32
View File
@@ -0,0 +1,32 @@
#------------------------------------------------------------------
# Bash-shell script to be run before building/executing this example.
# It has two parts: one for the Aida setup (for the histograms,
# ntuples, and more in general for the data analysis); and one
# more specific for this test-beam example.
# Please notice that before running this script, you have to define
# the usual Geant4 variables (in particular, the variable
# G4ANALYSIS_USE must be set to 1).
#------------------------------------------------------------------
#
### # --- Aida 2.2 , Anaphe 4.0.5 ---
### export LHCXXTOP=/afs/cern.ch/sw/lhcxx/
### export LHCXXVERS=4.0.5
### export PLATF=redhat72/gcc-2.95.2/
### . $LHCXXTOP/share/LHCXX/$LHCXXVERS/install/sharedstart.sh
#
# --- Aida 3.0 , Anaphe 5.0.1 ---
#. /afs/cern.ch/sw/lhcxx/share/LHCXX/5.0.1/scripts/setupAnaphe
#export PATH=$PATH:/afs/cern.ch/sw/lhcxx/share/LHCXX/5.0.1/scripts/
#
# --- Specific setup for this test-beam example ---
export CCAL_CONFPATH=./dataconf
export CCAL_SENSITIVECONF=g4testbeamhcal96.conf
export CCAL_GEOMETRYCONF=testbeamhcal96.conf
export CCAL_GLOBALPATH=./dataglobal
export CCAL_GEOMPATH=./datageom
export CCAL_VISPATH=./datavis
# ---
@@ -0,0 +1,34 @@
#
# This file permits to customize, with commands,
# the menu bar of the G4UIXm sessions.
# It has no effect with G4UIterminal.
#
# --- File ---
/gui/addMenu file File
/gui/addButton file Continue continue
/gui/addButton file Exit "exit"
#
# --- Particle ---
/gui/addMenu particle Particle
/gui/addButton particle muon- "/gun/particle mu-"
/gui/addButton particle electron- "/gun/particle e-"
/gui/addButton particle pion- "/gun/particle pi-"
#
# --- Energy ---
/gui/addMenu energy Energy
/gui/addButton energy 50-GeV "/gun/energy 50 GeV"
/gui/addButton energy 100-GeV "/gun/energy 100 GeV"
/gui/addButton energy 150-GeV "/gun/energy 150 GeV"
/gui/addButton energy 200-GeV "/gun/energy 200 GeV"
/gui/addButton energy 250-GeV "/gun/energy 250 GeV"
/gui/addButton energy 300-GeV "/gun/energy 300 GeV"
#
# --- NumEvents ---
/gui/addMenu numEvents NumEvents
/gui/addButton numEvents 1 "/run/beamOn 1"
/gui/addButton numEvents 2 "/run/beamOn 2"
/gui/addButton numEvents 5 "/run/beamOn 5"
/gui/addButton numEvents 10 "/run/beamOn 10"
/gui/addButton numEvents 50 "/run/beamOn 50"
/gui/addButton numEvents 100 "/run/beamOn 100"
#
@@ -0,0 +1,60 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
///////////////////////////////////////////////////////////////////////////////
// File: CCalAMaterial.hh
// Description: CCalAMaterial holds the basic information needed to make a
// G4Material from atomic proportions.
///////////////////////////////////////////////////////////////////////////////
#ifndef CCalAMaterial_h
#define CCalAMaterial_h 1
#include "CCalMaterial.hh"
#include "G4Element.hh"
class CCalAMaterial : public CCalMaterial {
friend G4std::ostream& operator<<(G4std::ostream&, const CCalAMaterial&);
public:
//Construct from list of constituents
CCalAMaterial(G4String mat, double dens, int nelem,
CCalAMaterial** constituents, double* weights);
//Construct from one element
CCalAMaterial(G4String elemat, double Aeff, double dens);
//Copy constructor
CCalAMaterial(const CCalAMaterial&);
virtual ~CCalAMaterial();
G4double Aeff() const {return aEff;}
CCalAMaterial& operator= (const CCalAMaterial&); //Assignment
protected:
void computeAeff(G4int nconst, CCalAMaterial** constituents, double* weights);
protected:
double aEff; //Effective mass
};
#endif
@@ -0,0 +1,96 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
///////////////////////////////////////////////////////////////////////////////
// File: CCalAnalysis.hh
// Description: CCalAnalysis is a singleton class and interfaces all user
// analysis code
///////////////////////////////////////////////////////////////////////////////
#ifdef G4ANALYSIS_USE
#ifndef CCalAnalysis_h
#define CCalAnalysis_h 1
#include "globals.hh"
#include "g4std/vector"
#include "G4ThreeVector.hh"
namespace AIDA {
class IAnalysisFactory;
class IHistogramFactory;
class ITree;
class IHistogram1D;
class IHistogram2D;
class ITuple;
class IPlotter;
}
class CCalAnalysis {
public:
virtual ~CCalAnalysis();
public:
void BeginOfRun(G4int n);
void EndOfRun(G4int n);
void EndOfEvent(G4int flag);
void Init();
void Finish();
int maxbin() {return numberOfTimeSlices;}
void InsertEnergyHcal(float*);
void InsertEnergyEcal(float*);
void InsertEnergy(float v);
void InsertLateralProfile(float*);
void InsertTime(float*);
void setNtuple(float* hcalE, float* ecalE, float elab, float x, float y,
float z, float edep, float edec, float edhc);
static CCalAnalysis* getInstance();
private:
CCalAnalysis();
private:
static CCalAnalysis* instance;
AIDA::IAnalysisFactory* analysisFactory;
AIDA::ITree* tree;
AIDA::ITuple* tuple;
enum {numberOfTimeSlices = 40};
AIDA::IHistogram1D* energy;
AIDA::IHistogram1D* hcalE[28]; // 28 hadronic modules
AIDA::IHistogram1D* ecalE[49]; // 49 crystal towers
AIDA::IHistogram1D* timeHist[40]; // 40 nanoseconds time window
AIDA::IHistogram1D* lateralProfile[70]; // 70 centimeters lateral window
// (indeed 64 should be enough)
};
#endif
#endif
@@ -0,0 +1,88 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#ifndef CCalDataSet_h
#define CCalDataSet_h
#include "G4NeutronHPInterpolator.hh"
#include "g4std/vector"
// by JPW, working, but to be cleaned up. @@@@
class CCalDataSet
{
public:
void insert(double anEnergy, double aXsection)
{
pair<double, double> aPoint(anEnergy, aXsection);
theData.push_back(aPoint);
}
double getCrossSection(double anEnergy)
{
double result;
if(anEnergy < theData[0].first)
{
result = 0;
}
else
{
double x1,x2;
double y1,y2;
if(anEnergy > theData[theData.size()-1].second)
{
// extrapolation
int n=theData.size();
x1 = theData[n-1].first;
y1 = theData[n-1].second;
x2 = theData[n-2].first;
y2 = theData[n-2].second;
}
else
{
// linear search and interpolation
unsigned int i;
for(i=0; i<theData.size(); i++)
{
if(theData[i].first>anEnergy) break;
}
x1 = theData[i-1].first;
y1 = theData[i-1].second;
x2 = theData[i].first;
y2 = theData[i].second;
}
// interpolate logarithmic in energy and linear in cross-section
result = theInterpolator.Interpolate(LOGLIN, anEnergy, x1,x2,y1,y2);
}
return result*barn;
}
private:
G4NeutronHPInterpolator theInterpolator;
private:
vector<pair<double, double> > theData;
};
#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. *
// ********************************************************************
//
///////////////////////////////////////////////////////////////////////////////
// File: CCalDetector.hh
// Description: CCalDetector will provide the basic functionallity of a
// detector factory. It has a construct method that describes
// the construction sequence of the detector. It has a Name,
// a file associated with it, and a collection of other
// CCalDetectors that are supposed to be inside this one.
///////////////////////////////////////////////////////////////////////////////
#ifndef CCalDetector_h
#define CCalDetector_h 1
#include "g4std/iostream"
#include "g4std/vector"
#include "globals.hh"
//Forward declartion for the CCalDetectorTable typedef
class CCalDetector;
//A table to hold a list of pointers to CMS Detectors
typedef G4std::vector<CCalDetector*> CCalDetectorTable;
////////////////////
//At last the class
class CCalDetector {
friend G4std::ostream& operator<<(G4std::ostream&, const CCalDetector&);
public:
////////////////////////////////////////////////////////////////
//Constructor with a name and a filename.
CCalDetector(const G4String &name);
////////////////////////////////////////////////////////////////
//Destructor
virtual ~CCalDetector();
////////////////////////////////////////////////////////////////
// Construction related methods
//This starts the detector construction
void constructHierarchy() { construct();}
void construct();
////////////////////////////////////////////////////////////////
//A method that allows to add a new detector inside this one.
void addDetector(CCalDetector*);
////////////////////////////////////////////////////////////////
//Other get methods
G4String Name() const {return detectorName;}
G4String baseFileName() const {return fileName;}
G4String File() const {return fileName+".geom";}
CCalDetector* getDaughter(int i) const {return theDetectorsInside[i];}
int getNDaughters() const {return theDetectorsInside.size();}
////////////////////////////////////////////////////////////////
//Local operators
//Equality only checks name !!!
G4bool operator==(const CCalDetector& left) const {
return (detectorName==left.detectorName);
}
G4bool operator!=(const CCalDetector& left) const {
return (detectorName!=left.detectorName);
}
protected:
////////////////////////////////////////////////////////////////
//Pure Virtual methods
//Should read a file and store the information inside the concrete
//CCalDetector
virtual int readFile() = 0;
//Construct the daughters by calling the apropiate constructors
virtual void constructDaughters() = 0;
////////////////////////////////////////////////////////////////
//Building related methods
//Builds the detector from a file
int buildFromFile();
protected:
////////////////////////////////////////////////////////////////
//Data Members
G4String detectorName; //Detector name
G4String fileName; //File name from it will be read
static G4String pathName; //Path in which to look for files
CCalDetectorTable theDetectorsInside; //A collection of CCalDetectors inside
int constructFlag; //True if this detector is to be built
};
#endif
@@ -0,0 +1,43 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
///////////////////////////////////////////////////////////////////////////////
// File: CCalDetectorConstruction.hh
// Description: Constructs the 96 test beam configuration of HCAL
///////////////////////////////////////////////////////////////////////////////
#ifndef CCalDetectorConstruction_h
#define CCalDetectorConstruction_h 1
#include "G4VUserDetectorConstruction.hh"
#include "globals.hh"
class CCalDetectorConstruction : public G4VUserDetectorConstruction {
public:
CCalDetectorConstruction();
~CCalDetectorConstruction();
public:
G4VPhysicalVolume* Construct();
};
#endif
@@ -0,0 +1,110 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
///////////////////////////////////////////////////////////////////////////////
// File: CCalEcal.hh
// Description: CCalEcal Geometry factory class for crystal matrix
///////////////////////////////////////////////////////////////////////////////
#ifndef CCalEcal_h
#define CCalEcal_h 1
#include "CCalDetector.hh"
class CCalEcal: public CCalDetector {
public:
//Constructor and Destructor
CCalEcal(const G4String &name):
CCalDetector(name) {}
virtual ~CCalEcal();
//Get Methods
G4String getGenMat() const {return genMat;}
double getWidBox() const {return widBox;}
double getLengBox() const {return lengBox;}
double getXpos() const {return xpos;}
double getYpos() const {return ypos;}
double getZpos() const {return zpos;}
double getThetaX() const {return thetaX;}
double getPhiX() const {return phiX;}
double getThetaY() const {return thetaY;}
double getPhiY() const {return phiY;}
double getThetaZ() const {return thetaZ;}
double getPhiZ() const {return phiZ;}
G4String getLayMat() const {return layMat;}
int getLayNum() const {return layNum;}
double getLayRadius() const {return layRadius;}
double getLayAngle() const {return layAngle;}
double getLengFront() const {return lengFront;}
double getLayPar(unsigned int i) const {return layPar[i];}
G4String getCrystMat() const {return crystMat;}
int getCrystNum() const {return crystNum;}
double getCrystLength() const {return crystLength;}
double getCrystTol() const {return crystTol;}
double getCrystPar(unsigned int i) const {return crystPar[i];}
G4String getSuppMat() const {return suppMat;}
double getDxSupp() const {return dxSupp;}
double getDySupp() const {return dySupp;}
double getDzSupp() const {return dzSupp;}
double getDistSupp() const {return distSupp;}
protected:
virtual int readFile();
virtual void constructDaughters();
private:
G4String genMat; //General material
double widBox, lengBox; //Box parameters
double xpos, ypos, zpos; //Translation matrix definition
double thetaX,phiX,thetaY,phiY,thetaZ,phiZ; //Rotation matrix definition
G4String layMat; //Material for the layers
int layNum; //Layer numbers
double layRadius,layAngle; //Positioning parameters
double lengFront; //Distance from front
double layPar[5]; //Layer parameters
G4String crystMat; //Material for the crystals
int crystNum; //Crystal numbers
double crystLength; //Crystal length
double crystTol; //Tolerance for position
double crystPar[5]; //Crystal parameters
G4String suppMat; //Material of support system
double dxSupp, dySupp, dzSupp; //Dimension of support material
double distSupp; //Separation of support material
};
#endif
@@ -0,0 +1,42 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
///////////////////////////////////////////////////////////////////////////////
// File: CCalEcalOrganization.hh
// Description: Defines numbering schema for the Electromagnetic Calorimeter
///////////////////////////////////////////////////////////////////////////////
#ifndef CCalEcalOrganization_h
#define CCalEcalOrganization_h
#include "CCalVOrganization.hh"
class CCalEcalOrganization: public CCalVOrganization {
public:
CCalEcalOrganization(){};
~CCalEcalOrganization();
virtual unsigned int GetUnitID(const G4Step* aStep) const ;
};
#endif
@@ -0,0 +1,64 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
///////////////////////////////////////////////////////////////////////////////
// File: CCalEndOfEventAction.hh
// Description: CCalEndOfEventAction provides User actions at end of event
///////////////////////////////////////////////////////////////////////////////
#ifndef CCalEndOfEventAction_h
#define CCalEndOfEventAction_h
#include "G4UserEventAction.hh"
#include "globals.hh"
class CCaloOrganization;
class G4HCofThisEvent;
class CCalSteppingAction;
class CCalPrimaryGeneratorAction;
typedef G4String nameType;
class CCalEndOfEventAction: public G4UserEventAction{
public:
CCalEndOfEventAction(CCalPrimaryGeneratorAction*);
~CCalEndOfEventAction();
virtual void StartOfEventAction(const G4Event* evt);
virtual void EndOfEventAction(const G4Event* evt);
private:
void instanciateSteppingAction();
void initialize();
private:
G4bool isInitialized;
CCalPrimaryGeneratorAction* primaryGenerator;
CCalSteppingAction* theSteppingAction;
nameType* SDnames;
G4int numberOfSD;
CCaloOrganization* theOrg;
};
#endif
@@ -0,0 +1,109 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
///////////////////////////////////////////////////////////////////////////////
// File: CCalG4Able.hh
// Description: CCalG4Able will provide the basic functionallity of a CCal
// "detector" to become a Geant4 Detector.
///////////////////////////////////////////////////////////////////////////////
#ifndef CCalG4Able_h
#define CCalG4Able_h 1
#include "g4std/vector"
#include "G4VPhysicalVolume.hh"
#include "G4LogicalVolume.hh"
#include "globals.hh"
#include "CCalVisualisable.hh"
#include "g4std/iostream"
//Forward declartion for the CCalG4AbleTable typedef
class CCalG4Able;
//A table to hold a list of pointers to CMS Detectors
typedef G4std::vector<CCalG4Able*> CCalG4AbleTable;
////////////////////
//At last the class
class CCalG4Able {
friend G4std::ostream& operator<<(G4std::ostream&, const CCalG4Able&);
public:
//////////////////////////////////////////////////////////////////////////
//Constructor with a name
CCalG4Able(G4String name);
//////////////////////////////////////////////////////////////////////////
//Destructor
virtual ~CCalG4Able() {delete detPhysicalVolume;}
//////////////////////////////////////////////////////////////////////////
//Get/Set methods
//Method to retrieve the physical volume of the detector.
G4VPhysicalVolume* PhysicalVolume(G4VPhysicalVolume*);
//Set the type of a logical volume to select its vis parameters.
void setVisType(CCalVisualisable::visType, G4LogicalVolume*);
//Sensitivity related
void setSensitivity(G4bool sens=true) {sensitivity=sens;}
G4bool isSensitive() const {return sensitivity;}
//Name
G4String G4Name() const {return g4ableName;}
void setName(const G4String& name) {g4ableName = name;}
//Comparison operator needed for CCalG4AbleTable. Compares phys. volumes
G4bool operator==(const CCalG4Able& right) const;
protected:
//A method that allows to add a new CCalG4Able inside this one.
void AddCCalG4Able(CCalG4Able*);
//This method actually constructs the volume. Pure virtual.
virtual G4VPhysicalVolume* constructIn(G4VPhysicalVolume*) = 0;
//Constructs the sensitive detectors and associates them to the corresponding
//logical volumes
virtual void constructSensitive() {}
protected:
//////////////////////////////////////////////////////////////////////////
// Data Members
G4VPhysicalVolume *detPhysicalVolume; //The G4PhysVolume or 0 if not created
CCalG4AbleTable theG4DetectorsInside; //CCalG4Able* daughters of this det.
G4String g4ableName;
G4bool sensitivity; //true if sentive, false if not.
//Visualisation in G4 related Variables
CCalVisualisable visProperties; //Visualisation properties.
G4VisAttributes* g4VisAtt[CCalVisualisable::TotalVisTypes];
};
#endif
@@ -0,0 +1,88 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
///////////////////////////////////////////////////////////////////////////////
// File: CCalG4Ecal.hh
// Description: Equipped to describe crystal matrix for different testbeam run
///////////////////////////////////////////////////////////////////////////////
#ifndef CCalG4Ecal_h
#define CCalG4Ecal_h 1
#include "CCalEcal.hh"
#include "CCalG4Able.hh"
#include "g4std/vector"
typedef G4LogicalVolume* ptrG4Log;
class CCalG4Ecal: public CCalEcal, public CCalG4Able {
public:
//Backward or Forward type
enum CMType {module1, module2};
//Constructor and Destructor
CCalG4Ecal(const G4String &name);
virtual ~CCalG4Ecal();
void setType(CMType ty) {type = ty;}
//Prefix to all names in the Detector
static G4String idName;
protected:
//This methods actually constructs the volume.
virtual G4VPhysicalVolume* constructIn(G4VPhysicalVolume*);
//Constructs the sensitive detectors and associates them to the corresponding
//logical volumes
virtual void constructSensitive() ;
private:
//Methods to construct the different parts of the detector
G4LogicalVolume* constructGlobal();
private:
//Private data members
CMType type;
//Static logical volumes shared by forward and backward detectors.
static G4LogicalVolume* crystalmatrixLog;
// Logical volumes for sensitive detectors
G4std::vector<ptrG4Log> sensitiveLogs;
};
#endif
@@ -0,0 +1,45 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
///////////////////////////////////////////////////////////////////////////////
// File: CCalG4Hall.hh
// Description: Equipped to construct G4 geometry of the experimental hall
///////////////////////////////////////////////////////////////////////////////
#ifndef CCalG4Hall_h
#define CCalG4Hall_h 1
#include "CCalHall.hh"
#include "CCalG4Able.hh"
class CCalG4Hall: public CCalHall, public CCalG4Able {
public:
//Constructor and Destructor
CCalG4Hall(const G4String &name);
virtual ~CCalG4Hall();
protected:
//This methods actually constructs the volume.
virtual G4VPhysicalVolume* constructIn(G4VPhysicalVolume*);
virtual void constructDaughters();
};
#endif
@@ -0,0 +1,65 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
///////////////////////////////////////////////////////////////////////////////
// File: CCalG4Hcal.hh
// Description: Euipped to construct the G4 geometry of the hadron calorimeter
// in the 96 test beam run
///////////////////////////////////////////////////////////////////////////////
#ifndef CCalG4Hcal_h
#define CCalG4Hcal_h 1
#include "CCalHcal.hh"
#include "CCalG4Able.hh"
#include "g4std/vector"
typedef G4LogicalVolume* ptrG4Log;
class CCalG4Hcal: public CCalHcal, public CCalG4Able {
public:
//Constructor and Destructor
CCalG4Hcal(const G4String &name);
virtual ~CCalG4Hcal();
protected:
//This methods actually constructs the volume.
virtual G4VPhysicalVolume* constructIn(G4VPhysicalVolume*);
virtual void constructDaughters();
//Construct layer of scintillator or absorber
G4LogicalVolume* constructScintillatorLayer (G4int);
G4LogicalVolume* constructAbsorberLayer (G4int);
//Constructs the sensitive detectors and associates them to the corresponding
//logical volumes
virtual void constructSensitive() ;
private:
//Private data members
ptrG4Log* sclLog;
ptrG4Log* absLog;
// Logical volumes for sensitive detectors
G4std::vector<ptrG4Log> allSensitiveLogs;
};
#endif
@@ -0,0 +1,67 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
///////////////////////////////////////////////////////////////////////////////
// File: CCalG4Hit.hh
// Description: G4 Hit class for Calorimeters (Ecal, Hcal, ...)
///////////////////////////////////////////////////////////////////////////////
#ifndef CCalG4Hit_h
#define CCalG4Hit_h 1
#include "G4VHit.hh"
#include "CCalHit.hh"
class CCalG4Hit : public G4VHit, public CCalHit {
friend G4std::ostream& operator<< (G4std::ostream& os, const CCalG4Hit& hit);
public:
CCalG4Hit();
~CCalG4Hit();
CCalG4Hit(const CCalG4Hit & right);
const CCalG4Hit& operator=(const CCalG4Hit & right);
int operator==(const CCalG4Hit &right){return 0;}
public:
void Draw(){}
void Print();
double getEM() const;
void setEM (double e);
double getHadr() const;
void setHadr (double e);
void addEnergyDeposit(const CCalG4Hit& aHit);
void addEnergyDeposit(double em, double hd);
private:
double elem; // EnergyDeposit of EM particles
double hadr; // EnergyDeposit of HD particles
};
#endif
@@ -0,0 +1,38 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
///////////////////////////////////////////////////////////////////////////////
// File: CCalG4HitCollection.hh
// Description: Collection of calorimetric hits
///////////////////////////////////////////////////////////////////////////////
#ifndef CCalG4HitCollection_h
#define CCalG4HitCollection_h 1
#include "G4THitsCollection.hh"
#include "CCalG4Hit.hh"
typedef G4THitsCollection<CCalG4Hit> CCalG4HitCollection;
#endif
@@ -0,0 +1,65 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
///////////////////////////////////////////////////////////////////////////////
// File: CCalGeometryConfiguration.hh
// Description: This singleton holds the information in the file geometry.conf
// Use getInstance to retrieve it.
///////////////////////////////////////////////////////////////////////////////
#ifndef CCalGeometryConfiguration_h
#define CCalGeometryConfiguration_h 1
#include "g4std/map"
#include "CCalutils.hh"
class CCalGeometryConfiguration {
struct GCInfo {
G4String FileName;
int ConstructFlag;
};
typedef G4std::map<G4String, GCInfo, G4std::less<G4String> > CCalGeometryConfTable;
typedef G4std::map<G4String, GCInfo, G4std::less<G4String> >::iterator CCalGeometryConfIterator;
public:
~CCalGeometryConfiguration() {}
static CCalGeometryConfiguration* getInstance();
int getConstructFlag(const G4String& n) /*const*/;
G4String getFileName(const G4String& n) /*const*/;
CCalGeometryConfTable& getConfTable() {
return theConfiguration;
}
private:
CCalGeometryConfiguration();
private:
static CCalGeometryConfiguration* instance;
CCalGeometryConfTable theConfiguration;
};
#endif
@@ -0,0 +1,53 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
///////////////////////////////////////////////////////////////////////////////
// File: CCalHall.hh
// Description: Equipped to construct the geometry of the 96 Test Beam
///////////////////////////////////////////////////////////////////////////////
#ifndef CCalHall_h
#define CCalHall_h 1
#include "CCalDetector.hh"
class CCalHall: public CCalDetector {
public:
//Constructor and Destructor
CCalHall(const G4String &name);
virtual ~CCalHall();
//Get Methods
G4String getMaterial() const {return genMaterial;}
double getDy_2Hall() const {return dy_2Hall;}
double getDx_2Hall() const {return dx_2Hall;}
protected:
virtual int readFile();
virtual void constructDaughters();
private:
G4String genMaterial; //General material
double dy_2Hall; //Half width of the Experimental Hall
double dx_2Hall; //Half thickness of the Experimental Hall
};
#endif
@@ -0,0 +1,116 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
///////////////////////////////////////////////////////////////////////////////
// File: CCalHcal.hh
// Description: Equipped to construct the geometry of the hadron calorimeter
///////////////////////////////////////////////////////////////////////////////
#ifndef CCalHcal_h
#define CCalHcal_h 1
#include "CCalDetector.hh"
class CCalHcal: public CCalDetector {
public:
//Constructor and Destructor
CCalHcal(const G4String &name);
virtual ~CCalHcal();
//Get Methods
G4String getGenMat() const {return genMaterial;}
double getDy_2Cal() const {return dy_2Cal;}
double getDx_2Cal() const {return dx_2Cal;}
double getXposCal() const {return xposCal;}
G4String getBoxMat() const {return boxMaterial;}
int getNBox() const {return nBox;}
double getDy_2Box() const {return dy_2Box;}
double getDx_2Box() const {return dx_2Box;}
double getWallThickBox() const {return wallThickBox;}
double getXposBox(unsigned int i) const {return xposBox[i];}
int getNLayerScnt() const {return nLayerScnt;}
int getTypeScnt(unsigned int i) const {return typeLayerScnt[i];}
int getMotherScnt(unsigned int i) const {return mothLayerScnt[i];}
double getXposScnt(unsigned int i) const {return xposLayerScnt[i];}
int getNLayerAbs() const {return nLayerAbs;}
int getTypeAbs(unsigned int i) const {return typeLayerAbs[i];}
int getMotherAbs(unsigned int i) const {return mothLayerAbs[i];}
double getXposAbs(unsigned int i) const {return xposLayerAbs[i];}
G4String getAbsMat() const {return absMaterial;}
int getNAbsorber() const {return nAbsorber;}
double getDy_2Abs( ) const {return dy_2Absorber;}
double getDx_2Abs(unsigned int i) const {return dx_2Absorber[i];}
G4String getScntMat() const {return scntMaterial;}
G4String getWrapMat() const {return wrapMaterial;}
G4String getPlasMat() const {return plasMaterial;}
int getNScintillator() const {return nScintillator;}
double getDy_2ScntLay(unsigned int i) const {return dy_2ScntLayer[i];}
double getDx_2ScntLay(unsigned int i) const {return dx_2ScntLayer[i];}
double getDx_2Wrap(unsigned int i) const {return dx_2Wrapper[i];}
double getDx_2FrontP(unsigned int i) const {return dx_2FrontPlastic[i];}
double getDx_2BackP(unsigned int i) const {return dx_2BackPlastic[i];}
double getDx_2Scnt(unsigned int i) const {return dx_2Scintillator[i];}
protected:
virtual int readFile();
virtual void constructDaughters();
private:
G4String genMaterial; //General material
double dy_2Cal; //Half width of the Hcal
double dx_2Cal; //Half thickness of the Hcal
double xposCal; //Position in mother
G4String boxMaterial; //Material of boxes
int nBox; //Number of boxes
double dy_2Box; //Half width of the Boxes
double dx_2Box; //Half thickness of the Boxes
double wallThickBox; //Wall thickness of the boxes
double* xposBox; //Position in mother
int nLayerScnt; //Number of scintillator layers
int* typeLayerScnt; //Layer type
int* mothLayerScnt; //Mother type
double* xposLayerScnt; //Position in mother
int nLayerAbs; //Number of absorber layers
int* typeLayerAbs; //Layer type
int* mothLayerAbs; //Mother type
double* xposLayerAbs; //Position in mother
G4String absMaterial; //Material of absorbers
int nAbsorber; //Number of absorber types
double dy_2Absorber; //Half width of the absorbers
double* dx_2Absorber; //Half thickness of the absorbers
G4String scntMaterial; //Material of Scintillator
G4String wrapMaterial; //Material of Wrapper
G4String plasMaterial; //Material of plastic cover
int nScintillator; //Number of scintillator types
double* dy_2ScntLayer; //Half width of scintillator layers
double* dx_2ScntLayer; //Half thickness of scintillator layers
double* dx_2Wrapper; //Half thickness of wrappers
double* dx_2FrontPlastic; //Half thickness of front plastic
double* dx_2BackPlastic; //Half thickness of back plastic
double* dx_2Scintillator; //Half thickness of scintillators
};
#endif
@@ -0,0 +1,42 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
///////////////////////////////////////////////////////////////////////////////
// File: CCalHcalOrganization.hh
// Description: Defines numbering schema for the Hadron Calorimeter
///////////////////////////////////////////////////////////////////////////////
#ifndef CCalHcalOrganization_h
#define CCalHcalOrganization_h
#include "CCalVOrganization.hh"
class CCalHcalOrganization: public CCalVOrganization{
public:
CCalHcalOrganization(){};
~CCalHcalOrganization();
virtual unsigned int GetUnitID(const G4Step* aStep) const ;
};
#endif
@@ -0,0 +1,97 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
///////////////////////////////////////////////////////////////////////////////
// File: CCalHit.h
// Description: Hit class for Calorimeters (Ecal, Hcal, ...)
//
// One Hit object should be created
// -for each new particle entering the calorimeter
// -for each detector unit (= cristal or fiber or scintillator layer)
// -for each nanosecond of the shower development
//
// This implies that all hit objects created for a given shower
// have the same value for
// - Entry (= local coordinates of the entrance point of the particle
// in the unit where the shower starts)
// - the TrackID (= Identification number of the incident particle)
// - the IncidentEnergy (= energy of that particle)
//
///////////////////////////////////////////////////////////////////////////////
#ifndef CCalHit_h
#define CCalHit_h 1
#include "g4std/iostream"
#include "CLHEP/Vector/ThreeVector.h"
#include "globals.hh"
class CCalHit {
friend G4std::ostream& operator<< (G4std::ostream&, const CCalHit&);
public:
CCalHit();
~CCalHit();
CCalHit(const CCalHit &right);
const CCalHit& operator=(const CCalHit &right);
int operator==(const CCalHit &right){return 0;}
void print();
public:
Hep3Vector getEntry() const;
void setEntry(Hep3Vector xyz);
double getIncidentEnergy() const;
void setIncidentEnergy (double e);
int getTrackID() const;
void setTrackID (int i);
unsigned int getUnitID() const;
void setUnitID (unsigned int i);
double getTimeSlice() const;
void setTimeSlice(double d);
int getTimeSliceID() const;
double getEnergyDeposit() const;
void setEnergyDeposit(const double e);
void addEnergyDeposit(const CCalHit& aHit);
void addEnergyDeposit(const double e);
private:
Hep3Vector entry; // Entry point
double theIncidentEnergy; // Energy of the primary particle
int theTrackID; // Identification number of the primary particle
unsigned int theUnitID; // Calorimeter Unit Number
double theTimeSlice; // Time Slice Identification
double theEnergyDeposit; // Cumulated Energy deposit
};
#endif
@@ -0,0 +1,59 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
///////////////////////////////////////////////////////////////////////////////
// File: CCalMagneticField.hh
// Description: A class for control of the Magnetic Field of the detector.
// The field is assumed to be uniform.
///////////////////////////////////////////////////////////////////////////////
#ifndef CCalMagneticField_H
#define CCalMagneticField_H
#include "G4UniformMagField.hh"
#include "G4ThreeVector.hh"
class G4FieldManager;
class CCalMagneticField: public G4MagneticField {
public:
CCalMagneticField(const G4String &name);
~CCalMagneticField();
// Access functions
void MagneticField(const double Point[3], double Bfield[3]) const;
Hep3Vector MagneticField(const Hep3Vector Point) const;
virtual void GetFieldValue(const double Point[3], double* Bfield) const;
G4double GetConstantFieldvalue() const {return fval;}
protected:
// Find the global Field Manager
G4FieldManager* GetGlobalFieldManager();
private:
G4double fval; // Field value
G4int npts; // Number of poinst
G4double xoff; // Offset
G4double* pos; // Position
G4double* slope; // Slope
G4double* intercept; // Intercept
};
#endif
@@ -0,0 +1,73 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//////////////////////////////////////////////////////////////////////////////
// File: CCalMaterial.hh
// Description: CCalMaterial holds the basic information needed to make a
// G4Material.
///////////////////////////////////////////////////////////////////////////////
#ifndef CCalMaterial_h
#define CCalMaterial_h 1
#include "g4std/iostream"
#include "globals.hh"
class CCalMaterial {
friend G4std::ostream& operator<<(G4std::ostream&, const CCalMaterial&);
public:
enum FractionType {FTWeight, FTVolume};
//Constructors and destructors
CCalMaterial(G4String mat, double dens, int nelem,
CCalMaterial** constituents, double* weights,
FractionType=FTWeight);
CCalMaterial(const CCalMaterial&);
virtual ~CCalMaterial();
//Get methods
G4String Name() const {return name;} //Material name.
double Density() const {return density;} //Density in g/cm3.
int NElements() const {return nElem;} //Number of Elements.
G4String Element(int i) const {return theElements[i];} //Should be protected.
double Weight(int i) const {return theWeights[i];} //Should be protected.
//Operators
G4bool operator==(const CCalMaterial&) const; //Compares ONLY names
G4bool operator!=(const CCalMaterial&) const; //Compares ONLY names
CCalMaterial& operator= (const CCalMaterial&); //Assignment
protected:
CCalMaterial(){} //Default constructor
void computeDensity(int nconst,
CCalMaterial** constituents, double* weights,
FractionType ft);
void closeMaterial(); //Closes material construction.
protected:
G4String name; //Material name
double density; //Density in g/cm3
int nElem; //Number of constituents.
G4String* theElements; //Basic constituents
double* theWeights; //Elements' weight fractions
};
#endif
@@ -0,0 +1,97 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
///////////////////////////////////////////////////////////////////////////////
// File: CCalMaterialFactory.hh
// Description: CCalMaterialFactory is a singleton class to get from a file
// the information to build CMS Materials. A G4Material is built
// only if asked. A parallel structure with the file information
// is keeped in a CCalMaterial pointer vector (CCalMaterialTable).
///////////////////////////////////////////////////////////////////////////////
#ifndef CCalMaterialFactory_h
#define CCalMaterialFactory_h 1
#include "g4std/fstream"
#include "CCalMaterial.hh"
#include "CCalAMaterial.hh"
#include "G4MaterialTable.hh"
#include "G4ElementTable.hh"
typedef G4std::vector<CCalMaterial*> CCalMaterialTable;
typedef G4std::vector<CCalAMaterial*> CCalAMaterialTable;
class CCalMaterialFactory {
public:
enum MatDescription {byWeight, byVolume, byAtomic};
~CCalMaterialFactory();
static CCalMaterialFactory* getInstance(const G4String&, const G4String&);
static CCalMaterialFactory* getInstance(const G4String&);
static CCalMaterialFactory* getInstance();
G4Material* findMaterial(const G4String& ) const;
G4Element* findElement (const G4String& ) const;
//Adds a new CCal Material to the list and returns a G4Material.
G4Element* addElement (const G4String&, const G4String&, G4double,
G4double, G4double );
//Adds a new CCal Material to the list and returns a G4Material.
G4Material* addMaterial(const G4String& nam, G4double density,
G4int nconst, G4String mats[], G4double prop[],
MatDescription md=byWeight);
void readElements (const G4String&);
void readMaterials(const G4String&);
protected:
void readElements(G4std::ifstream&);
void readMaterials(G4std::ifstream&);
private:
//Constructor
CCalMaterialFactory();
G4Material* findG4Material (const G4String& ) const;
CCalMaterial* findCCalMaterial (const G4String& ) const;
CCalAMaterial* findCCalAMaterial(const G4String& ) const;
//Adds a CCalMaterial to the list. Used by readMaterials and addMaterial.
CCalMaterial* addCCalMaterial(const G4String& nam, G4double density,
G4int nconst, G4String mats[], G4double prop[],
MatDescription md=byWeight);
private:
static CCalMaterialFactory* instance;
static G4String elementfile; //File with the elements.
static G4String mixturefile; //File with the materials.
CCalMaterialTable theCCalMaterials; //Where the CCalMaterials are stored
CCalAMaterialTable theCCalAMaterials; //Where the CCalAMaterials are stored
};
#endif
@@ -0,0 +1,51 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//-----------------------------------------------------------
// Renamed of the ufficial Physics List.
//-----------------------------------------------------------
#ifndef CCalPhysicsList_h
#define CCalPhysicsList_h 1
#include "G4VModularPhysicsList.hh"
#include "globals.hh"
#define kNuCut 5*m
class CCalPhysicsList: public G4VModularPhysicsList
{
public:
CCalPhysicsList();
virtual ~CCalPhysicsList();
public:
// SetCuts()
virtual void SetCuts();
};
// 2002 by J.P. Wellisch
#endif
@@ -0,0 +1,120 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
///////////////////////////////////////////////////////////////////////////////
// File: CCalPrimaryGeneratorAction.hh
// Description: Sets up particle beam
//
// By default 1 pi+ is shot from (0,0,0)
// in (1,1,0.1) direction at 100 GeV
// Use /gun/... commands to modify energy,origin,direction at run time.
// or/and
// /CCal/generator/random true/false to have random direction
// /CCal/generator/scan true/false to scan in eta/phi
// Use
// /CCal/generator/minEnergy
// /CCal/generator/maxEnergy
// /CCal/generator/minPhi
// /CCal/generator/maxPhi
// /CCal/generator/minEta
// /CCal/generator/maxEta
// to set the range in energy and direction of particles shot at random.
// Use
// /CCal/generator/stepsPhi
// /CCal/generator/stepsEta
// to set number of steps in Phi and Eta for the scan
//
///////////////////////////////////////////////////////////////////////////////
#ifndef CCalPrimaryGeneratorAction_h
#define CCalPrimaryGeneratorAction_h 1
#include "G4VUserPrimaryGeneratorAction.hh"
#include "G4ParticleGun.hh"
#include "G4ThreeVector.hh"
#include "G4ios.hh"
#include "G4Event.hh"
#include "G4VPrimaryGenerator.hh"
#include "CCalPrimaryGeneratorMessenger.hh"
enum generatorInputType {singleFixed, singleRandom, singleScan};
class CCalPrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction {
public:
CCalPrimaryGeneratorAction();
~CCalPrimaryGeneratorAction();
public:
void GeneratePrimaries(G4Event* anEvent);
public:
void SetVerboseLevel(G4int val);
void SetRandom(G4String val);
void SetScan(G4String val);
void SetMinimumEnergy(G4double p);
void SetMaximumEnergy(G4double p);
void SetMinimumPhi(G4double p);
void SetMaximumPhi(G4double p);
void SetStepsPhi(G4int val);
void SetMinimumEta(G4double p);
void SetMaximumEta(G4double p);
void SetStepsEta(G4int val);
void SetGunPosition(const G4ThreeVector & pos) const;
void SetRunNo(G4int val);
public:
G4ThreeVector GetParticlePosition() {return particleGun->GetParticlePosition();}
G4double GetParticleEnergy() {return particleGun->GetParticleEnergy();}
private:
CCalPrimaryGeneratorMessenger* gunMessenger;
G4ParticleGun* particleGun;
generatorInputType generatorInput;
G4int verboseLevel;
G4int n_particle;
G4String particleName;
G4double particleEnergy;
G4ThreeVector particlePosition;
G4ThreeVector particleDir;
G4double energyMin,energyMax;
G4double etaMin,etaMax;
G4double phiMin,phiMax;
G4int etaSteps,phiSteps;
G4int isInitialized;
G4double etaValue, phiValue;
G4int scanSteps;
private:
void initialize();
void print(G4int val);
};
#endif
@@ -0,0 +1,66 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
///////////////////////////////////////////////////////////////////////////////
// File: CCalPrimaryGeneratorMessenger.hh
// Description: Adds a new command to (un)select random shooting.
///////////////////////////////////////////////////////////////////////////////
#ifndef CCalPrimaryGeneratorMessenger_h
#define CCalPrimaryGeneratorMessenger_h 1
#include "globals.hh"
#include "G4UImessenger.hh"
class CCalPrimaryGeneratorAction;
#include "G4UIcmdWithAString.hh"
#include "G4UIcmdWithADoubleAndUnit.hh"
#include "G4UIcmdWithADouble.hh"
#include "G4UIcmdWithAnInteger.hh"
class CCalPrimaryGeneratorMessenger: public G4UImessenger {
public:
CCalPrimaryGeneratorMessenger(CCalPrimaryGeneratorAction* myGun);
~CCalPrimaryGeneratorMessenger();
void SetNewValue(G4UIcommand * command,G4String newValues);
private:
CCalPrimaryGeneratorAction* myAction;
G4UIcmdWithAnInteger* verboseCmd;
G4UIcmdWithAString* rndmCmd;
G4UIcmdWithAString* scanCmd;
G4UIcmdWithADoubleAndUnit* minEnergyCmd;
G4UIcmdWithADoubleAndUnit* maxEnergyCmd;
G4UIcmdWithADoubleAndUnit* minPhiCmd;
G4UIcmdWithADoubleAndUnit* maxPhiCmd;
G4UIcmdWithADouble* minEtaCmd;
G4UIcmdWithADouble* maxEtaCmd;
G4UIcmdWithAnInteger* stepsPhiCmd;
G4UIcmdWithAnInteger* stepsEtaCmd;
G4UIcmdWithAnInteger* runNoCmd;
};
#endif
@@ -0,0 +1,67 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
///////////////////////////////////////////////////////////////////////////////
// File: CCalRotationMatrixFactory.hh
// Description: CCalRotationFactory is a singleton class to get from a file
// the information to build CCal Rotation matrices.
///////////////////////////////////////////////////////////////////////////////
#ifndef CCalRotationMatrixFactory_h
#define CCalRotationMatrixFactory_h 1
#include "g4std/map"
#include "G4RotationMatrix.hh"
typedef G4RotationMatrix* G4RotationMatrixPtr;
typedef G4std::map<G4String, G4RotationMatrixPtr, G4std::less<G4String> > G4RotationMatrixTable;
typedef G4std::map<G4String, G4RotationMatrixPtr, G4std::less<G4String> >::iterator G4RotationMatrixTableIterator;
//typedef RWTPtrOrderedVector<G4RotationMatrix> G4RotationMatrixTable;
// Is an instantiation of the template class RWTPtrOrderedVector.
class CCalRotationMatrixFactory {
public:
~CCalRotationMatrixFactory();
static CCalRotationMatrixFactory* getInstance();
static CCalRotationMatrixFactory* getInstance(const G4String& rotfile);
static void setFileName(const G4String& rotfile);
G4RotationMatrix* findMatrix(const G4String&);
G4RotationMatrix* AddMatrix(const G4String& name,
G4double th1, G4double phi1, //Axis angles
G4double th2, G4double phi2, //in rads
G4double th3, G4double phi3); //
private:
CCalRotationMatrixFactory();
private:
static CCalRotationMatrixFactory* instance;
static G4String file;
G4RotationMatrixTable theMatrices; //Where the matrices are stored.
};
G4std::ostream& operator<<(G4std::ostream&, const G4RotationMatrix &);
#endif
@@ -0,0 +1,46 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
///////////////////////////////////////////////////////////////////////////////
// File: CCalRunAction.hh
// Description: A class for providing user actions at begin and end of run
///////////////////////////////////////////////////////////////////////////////
#ifndef CCalRunAction_h
#define CCalRunAction_h
#include "G4UserRunAction.hh"
class G4Run;
class CCalRunAction: public G4UserRunAction{
public:
CCalRunAction(){};
virtual ~CCalRunAction(){};
public:
virtual void BeginOfRunAction(const G4Run* aRun);
virtual void EndOfRunAction(const G4Run* aRun);
};
#endif
@@ -0,0 +1,66 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
///////////////////////////////////////////////////////////////////////////////
// File: CCalSDList.hh
// Description: Records name of all SD objects and classify them into
// CALO and Tracker SD
// Singleton class
///////////////////////////////////////////////////////////////////////////////
#ifndef CCalSDList_h
#define CCalSDList_h 1
#include "g4std/vector"
#include "globals.hh"
typedef G4String nameType;
class CCalSDList{
private:
CCalSDList();
~CCalSDList();
public:
static CCalSDList* getInstance();
public:
void addCalo(nameType name);
void addTracker(nameType name);
nameType getCaloSDName(int i);
nameType getTrackerSDName(int i);
int getNumberOfCaloSD();
int getNumberOfTrackerSD();
private:
static CCalSDList* theList;
G4std::vector<nameType> caloSD;
G4std::vector<nameType> trackerSD;
private:
CCalSDList& operator=(CCalSDList&);
};
#endif
@@ -0,0 +1,53 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
///////////////////////////////////////////////////////////////////////////////
// File: CCalSensAssign.hh
// Description: CCalSenAssign creates and assigns the sensitive detetctors
// from the map of logical volumes which are potentially sensitive
///////////////////////////////////////////////////////////////////////////////
#ifndef CCalSensAssign_h
#define CCalSensAssign_h
#include "CCalVOrganization.hh"
#include "g4std/map"
#include "globals.hh"
#include "G4VSensitiveDetector.hh"
class CCalSensAssign {
public:
~CCalSensAssign(){};
static CCalSensAssign* getInstance();
bool assign();
bool stackingAction();
bool addCaloSD(G4String name, CCalVOrganization* numberingScheme);
private:
CCalSensAssign();
static CCalSensAssign* theInstance;
G4std::map<G4String,G4VSensitiveDetector*> sens_;
};
#endif
@@ -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. *
// ********************************************************************
//
///////////////////////////////////////////////////////////////////////////////
// File: CCalSensitiveConfiguration.h
// Description: This singleton holds the information given in the file
// g4geometry.conf
// Use getInstance to retrieve it.
///////////////////////////////////////////////////////////////////////////////
#ifndef CCalSensitiveConfiguration_h
#define CCalSensitiveConfiguration_h 1
#include "g4std/map"
#include "CCalutils.hh"
class CCalSensitiveConfiguration {
struct GCInfo {
G4String FileName;
int SensitiveFlag;
};
typedef G4std::map<G4String, GCInfo, G4std::less<G4String> > CCalSensitiveConfTable;
typedef G4std::map<G4String, GCInfo, G4std::less<G4String> >::iterator CCalSensitiveConfIterator;
public:
~CCalSensitiveConfiguration() {}
static CCalSensitiveConfiguration* getInstance();
int getSensitiveFlag(const G4String& n) /*const*/;
G4String getFileName(const G4String& n) /*const*/;
private:
CCalSensitiveConfiguration();
private:
static CCalSensitiveConfiguration* instance;
CCalSensitiveConfTable theConfiguration;
};
#endif
@@ -0,0 +1,54 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
///////////////////////////////////////////////////////////////////////////////
// File: CCalSensitiveDetectors.hh
// Description: Container of logical volume pointers which can be sensitive
// detectors
///////////////////////////////////////////////////////////////////////////////
#ifndef CCalSensitiveDetectors_h
#define CCalSensitiveDetectors_h 1
#include "g4std/vector"
#include "g4std/map"
#include "G4VSensitiveDetector.hh"
#include "G4LogicalVolume.hh"
typedef G4std::multimap< G4String, G4LogicalVolume*, G4std::less<G4String> > mmslv;
class CCalSensitiveDetectors {
public:
~CCalSensitiveDetectors(){};
G4std::vector<G4LogicalVolume*> getVolumes (const G4String& name, bool exists = 0);
void registerVolume (const G4String& name, G4LogicalVolume*);
bool setSensitive(const G4String& string, G4VSensitiveDetector* sens);
static CCalSensitiveDetectors* getInstance();
private:
CCalSensitiveDetectors(){};
static CCalSensitiveDetectors* theInstance;
// logical volume container: name, G4LogicalVolume*
mmslv theLVs;
};
#endif
@@ -0,0 +1,70 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
///////////////////////////////////////////////////////////////////////////////
// File: CCalStackingAction.hh
// Description: Action needed to keep track of the ID of particle generating
// showers in any calorimeter part.
// For the moment it is requested only by CCalSensAssign
///////////////////////////////////////////////////////////////////////////////
#ifndef CCalStackingAction_h
#define CCalStackingAction_h 1
#include "globals.hh"
#include "G4UserStackingAction.hh"
class CCaloSD;
class CCalStackingAction : public G4UserStackingAction {
friend class CCalSensAssign;
private:
CCalStackingAction();
public:
~CCalStackingAction();
public:
virtual G4ClassificationOfNewTrack ClassifyNewTrack(const G4Track* aTrack);
virtual void NewStage();
virtual void PrepareNewEvent();
public:
enum stageLevel {firstStage, end} ;
enum {maxNumberOfSD = 30};
private:
stageLevel stage;
int numberOfSD;
G4String SDName[maxNumberOfSD];
int nurgent;
int acceptSecondaries;
CCaloSD* theCaloSD[maxNumberOfSD];
G4bool isInitialized;
private:
void initialize();
G4bool trackStartsInCalo(const G4Track* atrack);
void setPrimaryID(G4int id);
};
#endif
@@ -0,0 +1,56 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
///////////////////////////////////////////////////////////////////////////////
// File: CCalSeppingAction.hh
// Description: Stepping action needed for analysis
///////////////////////////////////////////////////////////////////////////////
#ifndef CCalSteppingAction_h
#define CCalSteppingAction_h
#include "G4UserSteppingAction.hh"
#include "globals.hh"
class G4Step;
class CCalSteppingAction : public G4UserSteppingAction {
friend class CCalEndOfEventAction;
private:
CCalSteppingAction();
public:
~CCalSteppingAction();
public:
virtual void UserSteppingAction(const G4Step* aStep);
private:
float LateralProfile[70];
float timeDeposit[40];
int timeHistoMaxBin;
private:
void endOfEvent();
};
#endif
@@ -0,0 +1,47 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
///////////////////////////////////////////////////////////////////////////////
// File: CCalVOrganization.hh
// Description: Base class for definition of sensitive unit numbering schema
///////////////////////////////////////////////////////////////////////////////
#ifndef CCalVOrganization_h
#define CCalVOrganization_h
#include "G4Step.hh"
#include "CCaloOrganization.hh"
class CCalVOrganization {
public:
CCalVOrganization(){};
virtual ~CCalVOrganization(){};
virtual unsigned int GetUnitID(const G4Step* aStep) const = 0;
virtual int Levels(const G4Step*) const;
virtual void DetectorLevel(const G4Step*, int&, int*, G4String*) const;
protected:
CCaloOrganization theOrg;
};
#endif
@@ -0,0 +1,60 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
///////////////////////////////////////////////////////////////////////////////
// File: CCalVisManager.hh
// Description: Example Visualization Manager implementing virtual function
// RegisterGraphicsSystems. Exploits C-pre-processor variables
// G4VIS_USE_DAWN, etc., which are set by the GNUmakefiles if
// environment variables of the same name are set.
//
// So all you have to do is set environment variables and compile
// and instantiate this in your main().
//
// Alternatively, you can implement an empty function here and
// just register the systems you want in your main(), e.g.:
// G4VisManager* myVisManager = new CCalVisManager;
// myVisManager -> RegisterGraphicsSystem (new MyGraphicsSystem);
///////////////////////////////////////////////////////////////////////////////
#ifndef CCalEXAMPLEVISMANAGER_HH
#define CCalEXAMPLEVISMANAGER_HH
#ifdef G4VIS_USE
#include "G4VisManager.hh"
class CCalVisManager: public G4VisManager {
public:
CCalVisManager (G4int verboseLevel = 0);
// Controls initial verbose level of VisManager and VisMessenger.
// Can be changed by /vis/set/verbose.
private:
virtual void RegisterGraphicsSystems ();
};
#endif
#endif
@@ -0,0 +1,109 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
///////////////////////////////////////////////////////////////////////////////
// File: CCalVisualisable.hh
// Description: Sets visualisable attributes from the information in flat file
///////////////////////////////////////////////////////////////////////////////
#ifndef CCalVisualisable_hh
#define CCalVisualisable_hh 1
#include "globals.hh"
#if __SUNPRO_CC==0x420
typedef G4bool bool;
#endif
class CCalVisualisable {
public:
//Here we define the different type of volumes we consider.
enum visType {Sensitive=0,
Electronics=1,
Support=2,
Cable=3,
Absorber=4,
OtherServices=5,
PseudoVolumes=6,
TotalVisTypes=7,
Undefined=-1};
private:
//This class groups the important visualization parameters.
class visParameters {
public:
visParameters(bool v=false, double r=1,double g=1,double b=1, bool w=true):
visibility(v),rColor(r),gColor(g),bColor(b),wireframe(w) {}
bool visibility;
double rColor;
double gColor;
double bColor;
bool wireframe;
};
public:
//Constructs this object from this file
CCalVisualisable(G4String file);
virtual ~CCalVisualisable() {}
//Reads this object from file
bool readFile(G4String file);
//Sets visibility to true for Sensitive and to false otherwise.
void setDefault();
//Get & Set methods.
bool isVisible (visType v) const {return theParameters[v].visibility;}
void setVisible(visType v, bool flag=true){theParameters[v].visibility=flag;}
double colorRed (visType v) const {return theParameters[v].rColor;}
double colorGreen(visType v) const {return theParameters[v].gColor;}
double colorBlue (visType v) const {return theParameters[v].bColor;}
void setColorRed (visType v, double r) {theParameters[v].rColor=r;}
void setColorGreen(visType v, double g) {theParameters[v].gColor=g;}
void setColorBlue (visType v, double b) {theParameters[v].bColor=b;}
void setColor(visType v, double r, double g, double b);
bool isWireFrame (visType v) const {return theParameters[v].wireframe;}
void setWireFrame(visType v, bool wf=true){theParameters[v].wireframe=wf;}
protected:
//Read this object from visFile
static void setPath();
bool readFile();
private:
static const char* pathName; //Path in which to look for files
G4String visFile; //File with visualization info
visParameters theParameters[TotalVisTypes]; //Visualisation parameters
double checkColorRange(double color, char type) const;
};
#endif
@@ -0,0 +1,59 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
///////////////////////////////////////////////////////////////////////////////
// File: CCaloOrganization.hh
// Description: Packing, unpacking and other related utilities for
// calorimetric numbering schema
///////////////////////////////////////////////////////////////////////////////
#ifndef CCaloOrganization_h
#define CCaloOrganization_h
#include "g4std/map"
#include "globals.hh"
class CCaloOrganization{
public:
CCaloOrganization(){};
virtual ~CCaloOrganization(){};
public:
unsigned int packindex(int det, int z, int eta, int phi) const;
unsigned int packindex(int det, int depth, int z, int eta, int phi) const;
void unpackindex(const unsigned int& idx, int& det, int& z, int& eta, int& phi) const;
void unpackindex(const unsigned int& idx, int& det, int& depth, int& z, int& eta, int& phi) const;
public:
// additional tool:
int getUnitWithMaxEnergy(G4std::map<int,float,G4std::less<int> >& themap);
float energyInMatrix(int nCellInEta, int nCellInPhi,
int crystalWithMaxEnergy,
G4std::map<int,float,G4std::less<int> >& themap);
};
#endif
@@ -0,0 +1,128 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
///////////////////////////////////////////////////////////////////////////////
// File: CCaloSD.hh
// Description: Stores hits of calorimetric type in appropriate container
//
// Use in your geometry routine:
// CCaloSD* caloSD = new CCaloSD(SDname, new CalorimeterOrganization);
// G4SDManager::GetSDMpointer()->AddNewDetector(caloSD);
// and then for every Logical Volume to be declared as sensitive
// logVolume->SetSensitiveDetector(caloSD);
//
///////////////////////////////////////////////////////////////////////////////
#ifndef CCaloSD_h
#define CCaloSD_h 1
#include "CCalG4HitCollection.hh"
#include "CCalG4Hit.hh"
#include "G4VPhysicalVolume.hh"
#include "G4LogicalVolume.hh"
#include "G4Track.hh"
#include "G4ParticleDefinition.hh"
#include "G4Step.hh"
#include "G4TransportationManager.hh"
#include "G4VSensitiveDetector.hh"
#include "g4std/iostream"
#include "g4std/fstream"
class CCalVOrganization;
//#define debug
class CCaloSD : public G4VSensitiveDetector {
public:
CCaloSD(G4String aSDname, CCalVOrganization* numberingScheme);
virtual ~CCaloSD();
void Initialize(G4HCofThisEvent*HCE);
G4bool ProcessHits(G4Step*aStep,G4TouchableHistory*ROhist);
void EndOfEvent(G4HCofThisEvent*HCE);
void clear();
void DrawAll();
void PrintAll();
public:
void SetPrimaryID(int i) {PrimaryID = i;
#ifdef debug
cout<<"CCaloSD SetPrimaryID primID ="<<i<<endl;
#endif
}
int GetPrimaryID( ) {return PrimaryID;}
void SetOrganization(CCalVOrganization* org);
private:
// Data relative to primary particle (the one which triggers a shower)
// These data are common to all Hits of a given shower.
// One shower is made of several hits which differ by the
// unit ID (cristal/fiber/scintillator) and the Time slice ID.
G4ThreeVector EntrancePoint;
float IncidentEnergy;
G4int PrimID ; //@@ ID of the primary particle.
private:
G4int HCID;
G4String SDname;
CCalG4HitCollection* theHC;
G4int TSID;
CCalG4Hit* CurrentHit;
G4Track* theTrack;
G4VPhysicalVolume* CurrentPV;
G4VPhysicalVolume* PreviousPV;
unsigned int UnitID, PreviousUnitID;
G4int PrimaryID, TSliceID;
G4double TSlice;
G4StepPoint* PreStepPoint ;
G4StepPoint* PostStepPoint ;
float EdepositEM, EdepositEHAD ;
G4ThreeVector HitPoint ;
private:
G4ThreeVector SetToLocal(G4ThreeVector globalPoint);
void getStepInfo(G4Step* aStep);
G4bool hitExists();
void createNewHit();
void updateHit();
void StoreHit(CCalG4Hit* ahit);
void ResetForNewPrimary();
void summarize();
private:
CCalVOrganization* theDescription;
};
#endif
@@ -0,0 +1,57 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
///////////////////////////////////////////////////////////////////////////////
// File: CCalutils.hh
// Description: General utilities.
///////////////////////////////////////////////////////////////////////////////
#ifndef CCalutils_hh
#define CCalutils_hh 1
#include "g4std/iostream"
#include "g4std/fstream"
#include "globals.hh"
G4String operator+(const G4String&, const int);
G4String operator+(const G4String&, const double);
// "number " + i = "number i"
G4std::ifstream& readName(G4std::ifstream&, G4String&);
// It reads a name into G4String between quotes and skips lines
// beginning with #. and if found *ENDDO returns.
G4std::ifstream& findDO(G4std::ifstream&, const G4String&);
// It reads until a *DO str is found.
G4std::ostream& tab(G4std::ostream&);
// It add a tab.
G4std::istream& jump(G4std::istream&);
// It ignores character until the end of line.
bool openGeomFile(G4std::ifstream& is, const G4String& pathname,
const G4String& filename);
// It opens the geometry file, either locally (if it exists) or "remotely".
#endif
@@ -0,0 +1,53 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
#ifndef EMPhysics_h
#define EMPhysics_h 1
#include "globals.hh"
#include "G4ios.hh"
#include "G4VPhysicsConstructor.hh"
#include "G4EMBuilder.hh"
class EMPhysics : public G4VPhysicsConstructor
{
public:
EMPhysics(const G4String& name ="EM");
virtual ~EMPhysics();
public:
virtual void ConstructParticle();
virtual void ConstructProcess();
private:
G4EMBuilder theEMPhysics;
};
// 2002 by J.P. Wellisch
#endif
@@ -0,0 +1,66 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#ifndef G4EMBuilder_h
#define G4EMBuilder_h 1
#include "globals.hh"
#include "G4ios.hh"
#include "G4PhotoElectricEffect.hh"
#include "G4ComptonScattering.hh"
#include "G4GammaConversion.hh"
#include "G4MultipleScattering.hh"
#include "G4eIonisation.hh"
#include "G4eBremsstrahlung.hh"
#include "G4eplusAnnihilation.hh"
class G4EMBuilder
{
public:
G4EMBuilder();
virtual ~G4EMBuilder();
public:
void Build();
protected:
G4PhotoElectricEffect thePhotoEffect;
G4ComptonScattering theComptonEffect;
G4GammaConversion thePairProduction;
G4MultipleScattering theElectronMultipleScattering;
G4eIonisation theElectronIonisation;
G4eBremsstrahlung theElectronBremsStrahlung;
G4MultipleScattering thePositronMultipleScattering;
G4eIonisation thePositronIonisation;
G4eBremsstrahlung thePositronBremsStrahlung;
G4eplusAnnihilation theAnnihilation;
};
// 2002 by J.P. Wellisch
#endif
@@ -0,0 +1,72 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
#ifndef G4ElectroNuclearBuilder_h
#define G4ElectroNuclearBuilder_h 1
#include "globals.hh"
#include "G4ios.hh"
#include "G4TheoFSGenerator.hh"
#include "G4StringChipsParticleLevelInterface.hh"
#include "G4QGSModel.hh"
#include "G4GammaParticipants.hh"
#include "G4QGSMFragmentation.hh"
#include "G4ExcitedStringDecay.hh"
#include "G4GammaNuclearReaction.hh"
#include "G4ElectroNuclearReaction.hh"
#include "G4PhotoNuclearProcess.hh"
#include "G4ElectronNuclearProcess.hh"
#include "G4PositronNuclearProcess.hh"
class G4ElectroNuclearBuilder
{
public:
G4ElectroNuclearBuilder();
virtual ~G4ElectroNuclearBuilder();
public:
virtual void Build();
protected:
G4PhotoNuclearProcess thePhotoNuclearProcess;
G4ElectronNuclearProcess theElectronNuclearProcess;
G4PositronNuclearProcess thePositronNuclearProcess;
G4ElectroNuclearReaction * theElectroReaction;
G4GammaNuclearReaction * theGammaReaction;
G4TheoFSGenerator * theModel;
G4StringChipsParticleLevelInterface * theCascade;
G4QGSModel< G4GammaParticipants > theStringModel;
G4QGSMFragmentation theFragmentation;
G4ExcitedStringDecay * theStringDecay;
};
// 2002 by J.P. Wellisch
#endif
@@ -0,0 +1,110 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
#ifndef G4HadronQEDBuilder_h
#define G4HadronQEDBuilder_h 1
#include "globals.hh"
#include "G4ios.hh"
#include "g4std/vector"
#include "G4MultipleScattering.hh"
#include "G4hIonisation.hh"
#include "G4ProcessManager.hh"
class G4HadronQEDBuilder
{
public:
G4HadronQEDBuilder();
virtual ~G4HadronQEDBuilder();
public:
virtual void Build();
private:
void RegisterOne(G4ProcessManager* aP, G4MultipleScattering * aM, G4hIonisation* aI);
private:
// Pi +
G4MultipleScattering thePionPlusMult;
G4hIonisation thePionPlusIonisation;
// Pi -
G4MultipleScattering thePionMinusMult;
G4hIonisation thePionMinusIonisation;
// K +
G4MultipleScattering theKaonPlusMult;
G4hIonisation theKaonPlusIonisation;
// K -
G4MultipleScattering theKaonMinusMult;
G4hIonisation theKaonMinusIonisation;
// Proton
G4MultipleScattering theProtonMult;
G4hIonisation theProtonIonisation;
// anti-proton
G4MultipleScattering theAntiProtonMult;
G4hIonisation theAntiProtonIonisation;
// SigmaMinus
G4MultipleScattering theSigmaMinusMult;
G4hIonisation theSigmaMinusIonisation;
// AntiSigmaMinus
G4MultipleScattering theAntiSigmaMinusMult;
G4hIonisation theAntiSigmaMinusIonisation;
// SigmaPlus
G4MultipleScattering theSigmaPlusMult;
G4hIonisation theSigmaPlusIonisation;
// AntiSigmaPlus
G4MultipleScattering theAntiSigmaPlusMult;
G4hIonisation theAntiSigmaPlusIonisation;
// XiMinus
G4MultipleScattering theXiMinusMult;
G4hIonisation theXiMinusIonisation;
// AntiXiMinus
G4MultipleScattering theAntiXiMinusMult;
G4hIonisation theAntiXiMinusIonisation;
// OmegaMinus
G4MultipleScattering theOmegaMinusMult;
G4hIonisation theOmegaMinusIonisation;
// AntiOmegaMinus
G4MultipleScattering theAntiOmegaMinusMult;
G4hIonisation theAntiOmegaMinusIonisation;
};
// 2002 by J.P. Wellisch
#endif
@@ -0,0 +1,79 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#ifndef G4LEPNeutronBuilder_h
#define G4LEPNeutronBuilder_h 1
#include "globals.hh"
#include "G4HadronElasticProcess.hh"
#include "G4HadronFissionProcess.hh"
#include "G4HadronCaptureProcess.hh"
#include "G4NeutronInelasticProcess.hh"
#include "G4VNeutronBuilder.hh"
#include "G4LElastic.hh"
#include "G4LFission.hh"
#include "G4LCapture.hh"
#include "G4LENeutronInelastic.hh"
class G4LEPNeutronBuilder : public G4VNeutronBuilder
{
public:
G4LEPNeutronBuilder();
virtual ~G4LEPNeutronBuilder();
public:
virtual void Build(G4HadronElasticProcess & aP);
virtual void Build(G4HadronFissionProcess & aP);
virtual void Build(G4HadronCaptureProcess & aP);
virtual void Build(G4NeutronInelasticProcess & aP);
void SetMinEnergy(G4double aM)
{
theMin=aM;
theIMin = theMin;
}
void SetMinInelasticEnergy(G4double aM)
{
theIMin=aM;
}
void SetMaxEnergy(G4double aM)
{
theMax=aM;
}
private:
G4double theMin;
G4double theIMin;
G4double theMax;
G4LElastic * theElasticModel;
G4LENeutronInelastic * theLENeutronModel;
G4LFission * theNeutronFissionModel;
G4LCapture * theNeutronCaptureModel;
};
// 2002 by J.P. Wellisch
#endif
@@ -0,0 +1,80 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
#ifndef G4LEPPiKBuilder_h
#define G4LEPPiKBuilder_h
#include "globals.hh"
#include "G4ios.hh"
#include "G4VPiKBuilder.hh"
#include "G4LElastic.hh"
#include "G4LEPionPlusInelastic.hh"
#include "G4LEPionMinusInelastic.hh"
#include "G4LEKaonPlusInelastic.hh"
#include "G4LEKaonZeroSInelastic.hh"
#include "G4LEKaonZeroLInelastic.hh"
#include "G4LEKaonMinusInelastic.hh"
class G4LEPPiKBuilder : public G4VPiKBuilder
{
public:
G4LEPPiKBuilder();
virtual ~G4LEPPiKBuilder();
public:
virtual void Build(G4HadronElasticProcess & aP);
virtual void Build(G4PionPlusInelasticProcess & aP);
virtual void Build(G4PionMinusInelasticProcess & aP);
virtual void Build(G4KaonPlusInelasticProcess & aP);
virtual void Build(G4KaonMinusInelasticProcess & aP);
virtual void Build(G4KaonZeroLInelasticProcess & aP);
virtual void Build(G4KaonZeroSInelasticProcess & aP);
void SetMinEnergy(G4double aM)
{
theMin=aM;
}
void SetMaxEnergy(G4double aM)
{
theMax=aM;
}
private:
G4double theMin;
G4double theMax;
G4LElastic * theElasticModel;
G4LEPionPlusInelastic* theLEPionPlusModel;
G4LEPionMinusInelastic* theLEPionMinusModel;
G4LEKaonPlusInelastic* theLEKaonPlusModel;
G4LEKaonMinusInelastic* theLEKaonMinusModel;
G4LEKaonZeroLInelastic* theLEKaonZeroLModel;
G4LEKaonZeroSInelastic* theLEKaonZeroSModel;
};
// 2002 by J.P. Wellisch
#endif
@@ -0,0 +1,65 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#ifndef G4LEPProtonBuilder_h
#define G4LEPProtonBuilder_h 1
#include "globals.hh"
#include "G4HadronElasticProcess.hh"
#include "G4ProtonInelasticProcess.hh"
#include "G4VProtonBuilder.hh"
#include "G4LElastic.hh"
#include "G4LEProtonInelastic.hh"
class G4LEPProtonBuilder : public G4VProtonBuilder
{
public:
G4LEPProtonBuilder();
virtual ~G4LEPProtonBuilder();
public:
virtual void Build(G4ProtonInelasticProcess & aP);
virtual void Build(G4HadronElasticProcess & aP);
void SetMinEnergy(G4double aM)
{
theMin=aM;
}
void SetMaxEnergy(G4double aM)
{
theMax=aM;
}
private:
G4double theMin;
G4double theMax;
G4LElastic * theElasticModel;
G4LEProtonInelastic * theLEProtonModel;
};
// 2002 by J.P. Wellisch
#endif
@@ -0,0 +1,77 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
#ifndef G4LHEPNeutronBuilder_h
#define G4LHEPNeutronBuilder_h 1
#include "globals.hh"
#include "G4HadronElasticProcess.hh"
#include "G4HadronFissionProcess.hh"
#include "G4HadronCaptureProcess.hh"
#include "G4NeutronInelasticProcess.hh"
#include "G4VNeutronBuilder.hh"
#include "G4LElastic.hh"
#include "G4LFission.hh"
#include "G4LCapture.hh"
#include "G4LENeutronInelastic.hh"
#include "G4HENeutronInelastic.hh"
class G4LHEPNeutronBuilder : public G4VNeutronBuilder
{
public:
G4LHEPNeutronBuilder();
virtual ~G4LHEPNeutronBuilder();
public:
virtual void Build(G4HadronElasticProcess & aP);
virtual void Build(G4HadronFissionProcess & aP);
virtual void Build(G4HadronCaptureProcess & aP);
virtual void Build(G4NeutronInelasticProcess & aP);
void SetMinEnergy(G4double aM)
{
theMin = aM;
theIMin = aM;
}
void SetMinInelasticEnergy(G4double aM)
{
theIMin = aM;
}
private:
G4LElastic * theElasticModel;
G4LENeutronInelastic * theLENeutronModel;
G4HENeutronInelastic * theHENeutronModel;
G4LFission * theNeutronFissionModel;
G4LCapture * theNeutronCaptureModel;
G4double theMin;
G4double theIMin;
};
// 2002 by J.P. Wellisch
#endif
@@ -0,0 +1,98 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#ifndef G4LHEPPiKBuilder_h
#define G4LHEPPiKBuilder_h 1
#include "globals.hh"
#include "G4ios.hh"
#include "G4LElastic.hh"
#include "G4VPiKBuilder.hh"
#include "G4LEPionPlusInelastic.hh"
#include "G4LEPionMinusInelastic.hh"
#include "G4LEKaonPlusInelastic.hh"
#include "G4LEKaonZeroSInelastic.hh"
#include "G4LEKaonZeroLInelastic.hh"
#include "G4LEKaonMinusInelastic.hh"
#include "G4HEPionPlusInelastic.hh"
#include "G4HEPionMinusInelastic.hh"
#include "G4HEKaonPlusInelastic.hh"
#include "G4HEKaonZeroInelastic.hh"
#include "G4HEKaonZeroInelastic.hh"
#include "G4HEKaonMinusInelastic.hh"
class G4LHEPPiKBuilder : public G4VPiKBuilder
{
public:
G4LHEPPiKBuilder();
virtual ~G4LHEPPiKBuilder();
public:
virtual void Build(G4HadronElasticProcess & aP);
virtual void Build(G4PionPlusInelasticProcess & aP);
virtual void Build(G4PionMinusInelasticProcess & aP);
virtual void Build(G4KaonPlusInelasticProcess & aP);
virtual void Build(G4KaonMinusInelasticProcess & aP);
virtual void Build(G4KaonZeroLInelasticProcess & aP);
virtual void Build(G4KaonZeroSInelasticProcess & aP);
void SetMinEnergy(G4double aM)
{
theM=aM;
}
private:
G4double theM;
G4LElastic * theElasticModel;
// Pi +
G4LEPionPlusInelastic* theLEPionPlusModel;
G4HEPionPlusInelastic* theHEPionPlusModel;
// Pi -
G4LEPionMinusInelastic* theLEPionMinusModel;
G4HEPionMinusInelastic* theHEPionMinusModel;
// K +
G4LEKaonPlusInelastic* theLEKaonPlusModel;
G4HEKaonPlusInelastic* theHEKaonPlusModel;
// K -
G4LEKaonMinusInelastic* theLEKaonMinusModel;
G4HEKaonMinusInelastic* theHEKaonMinusModel;
// K0L
G4LEKaonZeroLInelastic* theLEKaonZeroLModel;
G4HEKaonZeroInelastic* theHEKaonZeroLModel;
// K0S
G4LEKaonZeroSInelastic* theLEKaonZeroSModel;
G4HEKaonZeroInelastic* theHEKaonZeroSModel;
};
// 2002 by J.P. Wellisch
#endif
@@ -0,0 +1,63 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
#ifndef G4LHEPProtonBuilder_h
#define G4LHEPProtonBuilder_h 1
#include "globals.hh"
#include "G4HadronElasticProcess.hh"
#include "G4ProtonInelasticProcess.hh"
#include "G4VProtonBuilder.hh"
#include "G4LElastic.hh"
#include "G4LEProtonInelastic.hh"
#include "G4HEProtonInelastic.hh"
class G4LHEPProtonBuilder : public G4VProtonBuilder
{
public:
G4LHEPProtonBuilder();
virtual ~G4LHEPProtonBuilder();
public:
virtual void Build(G4ProtonInelasticProcess & aP);
virtual void Build(G4HadronElasticProcess & aP);
void SetMinEnergy(G4double aM)
{
theMin = aM;
}
private:
G4LElastic * theElasticModel;
G4LEProtonInelastic * theLEProtonModel;
G4HEProtonInelastic * theHEProtonModel;
G4double theMin;
};
// 2002 by J.P. Wellisch
#endif
@@ -0,0 +1,177 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
#ifndef G4MiscLHEPBuilder_h
#define G4MiscLHEPBuilder_h 1
#include "globals.hh"
#include "G4LElastic.hh"
#include "G4HadronElasticProcess.hh"
#include "G4AntiProtonInelasticProcess.hh"
#include "G4AntiNeutronInelasticProcess.hh"
#include "G4LambdaInelasticProcess.hh"
#include "G4AntiLambdaInelasticProcess.hh"
#include "G4SigmaPlusInelasticProcess.hh"
#include "G4SigmaMinusInelasticProcess.hh"
#include "G4AntiSigmaPlusInelasticProcess.hh"
#include "G4AntiSigmaMinusInelasticProcess.hh"
#include "G4XiZeroInelasticProcess.hh"
#include "G4XiMinusInelasticProcess.hh"
#include "G4AntiXiZeroInelasticProcess.hh"
#include "G4AntiXiMinusInelasticProcess.hh"
#include "G4OmegaMinusInelasticProcess.hh"
#include "G4AntiOmegaMinusInelasticProcess.hh"
#include "G4LEAntiProtonInelastic.hh"
#include "G4LEAntiNeutronInelastic.hh"
#include "G4LELambdaInelastic.hh"
#include "G4LEAntiLambdaInelastic.hh"
#include "G4LESigmaPlusInelastic.hh"
#include "G4LESigmaMinusInelastic.hh"
#include "G4LEAntiSigmaPlusInelastic.hh"
#include "G4LEAntiSigmaMinusInelastic.hh"
#include "G4LEXiZeroInelastic.hh"
#include "G4LEXiMinusInelastic.hh"
#include "G4LEAntiXiZeroInelastic.hh"
#include "G4LEAntiXiMinusInelastic.hh"
#include "G4LEOmegaMinusInelastic.hh"
#include "G4LEAntiOmegaMinusInelastic.hh"
// High-energy Models
#include "G4HEAntiProtonInelastic.hh"
#include "G4HEAntiNeutronInelastic.hh"
#include "G4HELambdaInelastic.hh"
#include "G4HEAntiLambdaInelastic.hh"
#include "G4HESigmaPlusInelastic.hh"
#include "G4HESigmaMinusInelastic.hh"
#include "G4HEAntiSigmaPlusInelastic.hh"
#include "G4HEAntiSigmaMinusInelastic.hh"
#include "G4HEXiZeroInelastic.hh"
#include "G4HEXiMinusInelastic.hh"
#include "G4HEAntiXiZeroInelastic.hh"
#include "G4HEAntiXiMinusInelastic.hh"
#include "G4HEOmegaMinusInelastic.hh"
#include "G4HEAntiOmegaMinusInelastic.hh"
class G4MiscLHEPBuilder
{
public:
G4MiscLHEPBuilder();
virtual ~G4MiscLHEPBuilder();
public:
void Build();
private:
G4LElastic* theElasticModel;
// anti-proton
G4HadronElasticProcess theAntiProtonElasticProcess;
G4AntiProtonInelasticProcess theAntiProtonInelastic;
G4LEAntiProtonInelastic* theLEAntiProtonModel;
G4HEAntiProtonInelastic* theHEAntiProtonModel;
// anti-neutron
G4HadronElasticProcess theAntiNeutronElasticProcess;
G4AntiNeutronInelasticProcess theAntiNeutronInelastic;
G4LEAntiNeutronInelastic* theLEAntiNeutronModel;
G4HEAntiNeutronInelastic* theHEAntiNeutronModel;
// Lambda
G4HadronElasticProcess theLambdaElasticProcess;
G4LambdaInelasticProcess theLambdaInelastic;
G4LELambdaInelastic* theLELambdaModel;
G4HELambdaInelastic* theHELambdaModel;
// AntiLambda
G4HadronElasticProcess theAntiLambdaElasticProcess;
G4AntiLambdaInelasticProcess theAntiLambdaInelastic;
G4LEAntiLambdaInelastic* theLEAntiLambdaModel;
G4HEAntiLambdaInelastic* theHEAntiLambdaModel;
// SigmaMinus
G4HadronElasticProcess theSigmaMinusElasticProcess;
G4SigmaMinusInelasticProcess theSigmaMinusInelastic;
G4LESigmaMinusInelastic* theLESigmaMinusModel;
G4HESigmaMinusInelastic* theHESigmaMinusModel;
// AntiSigmaMinus
G4HadronElasticProcess theAntiSigmaMinusElasticProcess;
G4AntiSigmaMinusInelasticProcess theAntiSigmaMinusInelastic;
G4LEAntiSigmaMinusInelastic* theLEAntiSigmaMinusModel;
G4HEAntiSigmaMinusInelastic* theHEAntiSigmaMinusModel;
// SigmaPlus
G4HadronElasticProcess theSigmaPlusElasticProcess;
G4SigmaPlusInelasticProcess theSigmaPlusInelastic;
G4LESigmaPlusInelastic* theLESigmaPlusModel;
G4HESigmaPlusInelastic* theHESigmaPlusModel;
// AntiSigmaPlus
G4HadronElasticProcess theAntiSigmaPlusElasticProcess;
G4AntiSigmaPlusInelasticProcess theAntiSigmaPlusInelastic;
G4LEAntiSigmaPlusInelastic* theLEAntiSigmaPlusModel;
G4HEAntiSigmaPlusInelastic* theHEAntiSigmaPlusModel;
// XiZero
G4HadronElasticProcess theXiZeroElasticProcess;
G4XiZeroInelasticProcess theXiZeroInelastic;
G4LEXiZeroInelastic* theLEXiZeroModel;
G4HEXiZeroInelastic* theHEXiZeroModel;
// AntiXiZero
G4HadronElasticProcess theAntiXiZeroElasticProcess;
G4AntiXiZeroInelasticProcess theAntiXiZeroInelastic;
G4LEAntiXiZeroInelastic* theLEAntiXiZeroModel;
G4HEAntiXiZeroInelastic* theHEAntiXiZeroModel;
// XiMinus
G4HadronElasticProcess theXiMinusElasticProcess;
G4XiMinusInelasticProcess theXiMinusInelastic;
G4LEXiMinusInelastic* theLEXiMinusModel;
G4HEXiMinusInelastic* theHEXiMinusModel;
// AntiXiMinus
G4HadronElasticProcess theAntiXiMinusElasticProcess;
G4AntiXiMinusInelasticProcess theAntiXiMinusInelastic;
G4LEAntiXiMinusInelastic* theLEAntiXiMinusModel;
G4HEAntiXiMinusInelastic* theHEAntiXiMinusModel;
// OmegaMinus
G4HadronElasticProcess theOmegaMinusElasticProcess;
G4OmegaMinusInelasticProcess theOmegaMinusInelastic;
G4LEOmegaMinusInelastic* theLEOmegaMinusModel;
G4HEOmegaMinusInelastic* theHEOmegaMinusModel;
// AntiOmegaMinus
G4HadronElasticProcess theAntiOmegaMinusElasticProcess;
G4AntiOmegaMinusInelasticProcess theAntiOmegaMinusInelastic;
G4LEAntiOmegaMinusInelastic* theLEAntiOmegaMinusModel;
G4HEAntiOmegaMinusInelastic* theHEAntiOmegaMinusModel;
};
// 2002 by J.P. Wellisch
#endif
@@ -0,0 +1,59 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#ifndef G4NeutronBuilder_h
#define G4NeutronBuilder_h 1
#include "globals.hh"
#include "G4HadronElasticProcess.hh"
#include "G4HadronFissionProcess.hh"
#include "G4HadronCaptureProcess.hh"
#include "G4NeutronInelasticProcess.hh"
#include "G4VNeutronBuilder.hh"
#include "g4std/vector"
class G4NeutronBuilder
{
public:
G4NeutronBuilder();
virtual ~G4NeutronBuilder();
public:
void Build();
void RegisterMe(G4VNeutronBuilder * aB) {theModelCollections.push_back(aB);}
private:
G4HadronElasticProcess theNeutronElasticProcess;
G4NeutronInelasticProcess theNeutronInelastic;
G4HadronFissionProcess theNeutronFission;
G4HadronCaptureProcess theNeutronCapture;
G4std::vector<G4VNeutronBuilder *> theModelCollections;
};
// 2002 by J.P. Wellisch
#endif
@@ -0,0 +1,70 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
#ifndef G4NeutronHPBuilder_h
#define G4NeutronHPBuilder_h 1
#include "globals.hh"
#include "G4HadronElasticProcess.hh"
#include "G4HadronFissionProcess.hh"
#include "G4HadronCaptureProcess.hh"
#include "G4NeutronInelasticProcess.hh"
#include "G4VNeutronBuilder.hh"
#include "G4NeutronHPElasticData.hh"
#include "G4NeutronHPElastic.hh"
#include "G4NeutronHPInelastic.hh"
#include "G4NeutronHPInelasticData.hh"
#include "G4NeutronHPFission.hh"
#include "G4NeutronHPFissionData.hh"
#include "G4NeutronHPCapture.hh"
#include "G4NeutronHPCaptureData.hh"
class G4NeutronHPBuilder : public G4VNeutronBuilder
{
public:
G4NeutronHPBuilder();
virtual ~G4NeutronHPBuilder();
public:
virtual void Build(G4HadronElasticProcess & aP);
virtual void Build(G4HadronFissionProcess & aP);
virtual void Build(G4HadronCaptureProcess & aP);
virtual void Build(G4NeutronInelasticProcess & aP);
private:
G4NeutronHPElastic * theHPElastic;
G4NeutronHPElasticData * theHPElasticData;
G4NeutronHPInelastic * theHPInelastic;
G4NeutronHPInelasticData * theHPInelasticData;
G4NeutronHPFission * theHPFission;
G4NeutronHPFissionData * theHPFissionData;
G4NeutronHPCapture * theHPCapture;
G4NeutronHPCaptureData * theHPCaptureData;
};
// 2002 by J.P. Wellisch
#endif
@@ -0,0 +1,66 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#ifndef G4PiKBuilder_h
#define G4PiKBuilder_h 1
#include "globals.hh"
#include "G4HadronElasticProcess.hh"
#include "G4ProtonInelasticProcess.hh"
#include "G4VPiKBuilder.hh"
#include "g4std/vector"
class G4PiKBuilder
{
public:
G4PiKBuilder();
virtual ~G4PiKBuilder();
public:
void Build();
void RegisterMe(G4VPiKBuilder * aB) {theModelCollections.push_back(aB);}
private:
G4HadronElasticProcess thePionPlusElasticProcess;
G4HadronElasticProcess thePionMinusElasticProcess;
G4HadronElasticProcess theKaonPlusElasticProcess;
G4HadronElasticProcess theKaonMinusElasticProcess;
G4HadronElasticProcess theKaonZeroLElasticProcess;
G4HadronElasticProcess theKaonZeroSElasticProcess;
G4PionPlusInelasticProcess thePionPlusInelastic;
G4PionMinusInelasticProcess thePionMinusInelastic;
G4KaonPlusInelasticProcess theKaonPlusInelastic;
G4KaonMinusInelasticProcess theKaonMinusInelastic;
G4KaonZeroLInelasticProcess theKaonZeroLInelastic;
G4KaonZeroSInelasticProcess theKaonZeroSInelastic;
G4std::vector<G4VPiKBuilder *> theModelCollections;
};
// 2002 by J.P. Wellisch
#endif
@@ -0,0 +1,64 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
#ifndef G4PrecoNeutronBuilder_h
#define G4PrecoNeutronBuilder_h 1
#include "globals.hh"
#include "G4HadronElasticProcess.hh"
#include "G4HadronFissionProcess.hh"
#include "G4HadronCaptureProcess.hh"
#include "G4NeutronInelasticProcess.hh"
#include "G4VNeutronBuilder.hh"
#include "G4PreCompoundModel.hh"
#include "G4ExcitationHandler.hh"
#include "G4NeutronInelasticCrossSection.hh"
class G4PrecoNeutronBuilder : public G4VNeutronBuilder
{
public:
G4PrecoNeutronBuilder();
virtual ~G4PrecoNeutronBuilder();
public:
virtual void Build(G4HadronElasticProcess & aP);
virtual void Build(G4HadronFissionProcess & aP);
virtual void Build(G4HadronCaptureProcess & aP);
virtual void Build(G4NeutronInelasticProcess & aP);
void SetMinEnergy(G4double aM) {theMin = aM;}
private:
G4PreCompoundModel * theModel;
G4ExcitationHandler theHandler;
G4NeutronInelasticCrossSection theXSec;
G4double theMin;
G4double theMax;
};
// 2002 by J.P. Wellisch
#endif
@@ -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. *
// ********************************************************************
//
#ifndef G4PrecoProtonBuilder_h
#define G4PrecoProtonBuilder_h
#include "globals.hh"
#include "G4HadronElasticProcess.hh"
#include "G4HadronFissionProcess.hh"
#include "G4HadronCaptureProcess.hh"
#include "G4ProtonInelasticProcess.hh"
#include "G4VProtonBuilder.hh"
#include "G4ExcitationHandler.hh"
#include "G4PreCompoundModel.hh"
#include "G4ProtonInelasticCrossSection.hh"
class G4PrecoProtonBuilder : public G4VProtonBuilder
{
public:
G4PrecoProtonBuilder();
virtual ~G4PrecoProtonBuilder();
public:
virtual void Build(G4HadronElasticProcess & aP);
virtual void Build(G4ProtonInelasticProcess & aP);
void SetMinEnergy(G4double aM) {theMin = aM;}
private:
G4ProtonInelasticCrossSection theXSec;
G4ExcitationHandler theHandler;
G4PreCompoundModel * theModel;
G4double theMin;
G4double theMax;
};
// 2002 by J.P. Wellisch
#endif
@@ -0,0 +1,55 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
#ifndef G4ProtonBuilder_h
#define G4ProtonBuilder_h 1
#include "globals.hh"
#include "G4HadronElasticProcess.hh"
#include "G4ProtonInelasticProcess.hh"
#include "G4VProtonBuilder.hh"
#include "g4std/vector"
class G4ProtonBuilder
{
public:
G4ProtonBuilder();
virtual ~G4ProtonBuilder();
public:
void Build();
void RegisterMe(G4VProtonBuilder * aB) {theModelCollections.push_back(aB);}
private:
G4HadronElasticProcess theProtonElasticProcess;
G4ProtonInelasticProcess theProtonInelastic;
G4std::vector<G4VProtonBuilder *> theModelCollections;
};
// 2002 by J.P. Wellisch
#endif
@@ -0,0 +1,71 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
#ifndef G4QGSCNeutronBuilder_h
#define G4QGSCNeutronBuilder_h 1
#include "globals.hh"
#include "G4HadronElasticProcess.hh"
#include "G4HadronFissionProcess.hh"
#include "G4HadronCaptureProcess.hh"
#include "G4NeutronInelasticProcess.hh"
#include "G4VNeutronBuilder.hh"
#include "G4NeutronInelasticCrossSection.hh"
#include "G4TheoFSGenerator.hh"
#include "G4StringChipsParticleLevelInterface.hh"
#include "G4QGSModel.hh"
#include "G4QGSParticipants.hh"
#include "G4QGSMFragmentation.hh"
#include "G4ExcitedStringDecay.hh"
class G4QGSCNeutronBuilder : public G4VNeutronBuilder
{
public:
G4QGSCNeutronBuilder();
virtual ~G4QGSCNeutronBuilder();
public:
virtual void Build(G4HadronElasticProcess & aP);
virtual void Build(G4HadronFissionProcess & aP);
virtual void Build(G4HadronCaptureProcess & aP);
virtual void Build(G4NeutronInelasticProcess & aP);
void SetMinEnergy(G4double aM) {theMin = aM;}
private:
G4TheoFSGenerator * theModel;
G4StringChipsParticleLevelInterface * theCascade;
G4QGSModel< G4QGSParticipants > theStringModel;
G4QGSMFragmentation theFragmentation;
G4ExcitedStringDecay * theStringDecay;
G4NeutronInelasticCrossSection theXSec;
G4double theMin;
};
// 2002 by J.P. Wellisch
#endif
@@ -0,0 +1,71 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
#ifndef G4QGSCPiKBuilder_h
#define G4QGSCPiKBuilder_h 1
#include "globals.hh"
#include "G4HadronElasticProcess.hh"
#include "G4HadronFissionProcess.hh"
#include "G4HadronCaptureProcess.hh"
#include "G4NeutronInelasticProcess.hh"
#include "G4VPiKBuilder.hh"
#include "G4TheoFSGenerator.hh"
#include "G4StringChipsParticleLevelInterface.hh"
#include "G4QGSModel.hh"
#include "G4QGSParticipants.hh"
#include "G4QGSMFragmentation.hh"
#include "G4ExcitedStringDecay.hh"
class G4QGSCPiKBuilder : public G4VPiKBuilder
{
public:
G4QGSCPiKBuilder();
virtual ~G4QGSCPiKBuilder();
public:
virtual void Build(G4HadronElasticProcess & aP);
virtual void Build(G4PionPlusInelasticProcess & aP);
virtual void Build(G4PionMinusInelasticProcess & aP);
virtual void Build(G4KaonPlusInelasticProcess & aP);
virtual void Build(G4KaonMinusInelasticProcess & aP);
virtual void Build(G4KaonZeroLInelasticProcess & aP);
virtual void Build(G4KaonZeroSInelasticProcess & aP);
void SetMinEnergy(G4double aM) {theMin = aM;}
private:
G4TheoFSGenerator * theModel;
G4StringChipsParticleLevelInterface * theCascade;
G4QGSModel< G4QGSParticipants > theStringModel;
G4QGSMFragmentation theFragmentation;
G4ExcitedStringDecay * theStringDecay;
G4double theMin;
};
// 2002 by J.P. Wellisch
#endif
@@ -0,0 +1,70 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
#ifndef G4QGSCProtonBuilder_h
#define G4QGSCProtonBuilder_h
#include "globals.hh"
#include "G4HadronElasticProcess.hh"
#include "G4HadronFissionProcess.hh"
#include "G4HadronCaptureProcess.hh"
#include "G4ProtonInelasticProcess.hh"
#include "G4VProtonBuilder.hh"
#include "G4NeutronInelasticCrossSection.hh"
#include "G4TheoFSGenerator.hh"
#include "G4StringChipsParticleLevelInterface.hh"
#include "G4QGSModel.hh"
#include "G4QGSParticipants.hh"
#include "G4QGSMFragmentation.hh"
#include "G4ExcitedStringDecay.hh"
#include "G4ProtonInelasticCrossSection.hh"
class G4QGSCProtonBuilder : public G4VProtonBuilder
{
public:
G4QGSCProtonBuilder();
virtual ~G4QGSCProtonBuilder();
public:
virtual void Build(G4HadronElasticProcess & aP);
virtual void Build(G4ProtonInelasticProcess & aP);
void SetMinEnergy(G4double aM) {theMin = aM;}
private:
G4ProtonInelasticCrossSection theXSec;
G4TheoFSGenerator * theModel;
G4StringChipsParticleLevelInterface * theCascade;
G4QGSModel< G4QGSParticipants > theStringModel;
G4QGSMFragmentation theFragmentation;
G4ExcitedStringDecay * theStringDecay;
G4double theMin;
};
// 2002 by J.P. Wellisch
#endif
@@ -0,0 +1,75 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
#ifndef G4QGSPNeutronBuilder_h
#define G4QGSPNeutronBuilder_h 1
#include "globals.hh"
#include "G4HadronElasticProcess.hh"
#include "G4HadronFissionProcess.hh"
#include "G4HadronCaptureProcess.hh"
#include "G4NeutronInelasticProcess.hh"
#include "G4VNeutronBuilder.hh"
#include "G4NeutronInelasticCrossSection.hh"
#include "G4TheoFSGenerator.hh"
#include "G4ExcitationHandler.hh"
#include "G4PreCompoundModel.hh"
#include "G4GeneratorPrecompoundInterface.hh"
#include "G4QGSModel.hh"
#include "G4QGSParticipants.hh"
#include "G4QGSMFragmentation.hh"
#include "G4ExcitedStringDecay.hh"
class G4QGSPNeutronBuilder : public G4VNeutronBuilder
{
public:
G4QGSPNeutronBuilder();
virtual ~G4QGSPNeutronBuilder();
public:
virtual void Build(G4HadronElasticProcess & aP);
virtual void Build(G4HadronFissionProcess & aP);
virtual void Build(G4HadronCaptureProcess & aP);
virtual void Build(G4NeutronInelasticProcess & aP);
void SetMinEnergy(G4double aM) {theMin = aM;}
private:
G4TheoFSGenerator * theModel;
G4ExcitationHandler theHandler;
G4PreCompoundModel * thePreEquilib;
G4GeneratorPrecompoundInterface * theCascade;
G4QGSModel< G4QGSParticipants > theStringModel;
G4QGSMFragmentation theFragmentation;
G4ExcitedStringDecay * theStringDecay;
G4NeutronInelasticCrossSection theXSec;
G4double theMin;
};
// 2002 by J.P. Wellisch
#endif
@@ -0,0 +1,75 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
#ifndef G4QGSPPiKBuilder_h
#define G4QGSPPiKBuilder_h 1
#include "globals.hh"
#include "G4HadronElasticProcess.hh"
#include "G4HadronFissionProcess.hh"
#include "G4HadronCaptureProcess.hh"
#include "G4NeutronInelasticProcess.hh"
#include "G4VPiKBuilder.hh"
#include "G4TheoFSGenerator.hh"
#include "G4ExcitationHandler.hh"
#include "G4PreCompoundModel.hh"
#include "G4GeneratorPrecompoundInterface.hh"
#include "G4QGSModel.hh"
#include "G4QGSParticipants.hh"
#include "G4QGSMFragmentation.hh"
#include "G4ExcitedStringDecay.hh"
class G4QGSPPiKBuilder : public G4VPiKBuilder
{
public:
G4QGSPPiKBuilder();
virtual ~G4QGSPPiKBuilder();
public:
virtual void Build(G4HadronElasticProcess & aP);
virtual void Build(G4PionPlusInelasticProcess & aP);
virtual void Build(G4PionMinusInelasticProcess & aP);
virtual void Build(G4KaonPlusInelasticProcess & aP);
virtual void Build(G4KaonMinusInelasticProcess & aP);
virtual void Build(G4KaonZeroLInelasticProcess & aP);
virtual void Build(G4KaonZeroSInelasticProcess & aP);
void SetMinEnergy(G4double aM) {theMin = aM;}
private:
G4TheoFSGenerator * theModel;
G4ExcitationHandler theHandler;
G4PreCompoundModel * thePreEquilib;
G4GeneratorPrecompoundInterface * theCascade;
G4QGSModel< G4QGSParticipants > theStringModel;
G4QGSMFragmentation theFragmentation;
G4ExcitedStringDecay * theStringDecay;
G4double theMin;
};
// 2002 by J.P. Wellisch
#endif
@@ -0,0 +1,74 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
#ifndef G4QGSPProtonBuilder_h
#define G4QGSPProtonBuilder_h
#include "globals.hh"
#include "G4HadronElasticProcess.hh"
#include "G4HadronFissionProcess.hh"
#include "G4HadronCaptureProcess.hh"
#include "G4ProtonInelasticProcess.hh"
#include "G4VProtonBuilder.hh"
#include "G4NeutronInelasticCrossSection.hh"
#include "G4TheoFSGenerator.hh"
#include "G4ExcitationHandler.hh"
#include "G4PreCompoundModel.hh"
#include "G4GeneratorPrecompoundInterface.hh"
#include "G4QGSModel.hh"
#include "G4QGSParticipants.hh"
#include "G4QGSMFragmentation.hh"
#include "G4ExcitedStringDecay.hh"
#include "G4ProtonInelasticCrossSection.hh"
class G4QGSPProtonBuilder : public G4VProtonBuilder
{
public:
G4QGSPProtonBuilder();
virtual ~G4QGSPProtonBuilder();
public:
virtual void Build(G4HadronElasticProcess & aP);
virtual void Build(G4ProtonInelasticProcess & aP);
void SetMinEnergy(G4double aM) {theMin = aM;}
private:
G4ProtonInelasticCrossSection theXSec;
G4TheoFSGenerator * theModel;
G4ExcitationHandler theHandler;
G4PreCompoundModel * thePreEquilib;
G4GeneratorPrecompoundInterface * theCascade;
G4QGSModel< G4QGSParticipants > theStringModel;
G4QGSMFragmentation theFragmentation;
G4ExcitedStringDecay * theStringDecay;
G4double theMin;
};
// 2002 by J.P. Wellisch
#endif
@@ -0,0 +1,65 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#ifndef G4StoppingHadronBuilder_h
#define G4StoppingHadronBuilder_h 1
#include "globals.hh"
#include "G4ios.hh"
#include "g4std/vector"
// At rest processes
#include "G4AntiProtonAnnihilationAtRest.hh"
#include "G4AntiNeutronAnnihilationAtRest.hh"
#include "G4PionMinusAbsorptionAtRest.hh"
#include "G4KaonMinusAbsorption.hh"
class G4StoppingHadronBuilder
{
public:
G4StoppingHadronBuilder();
virtual ~G4StoppingHadronBuilder();
public:
virtual void Build();
private:
// Pi -
G4PionMinusAbsorptionAtRest thePionMinusAbsorption;
// K -
G4KaonMinusAbsorption theKaonMinusAbsorption;
// anti-proton
G4AntiProtonAnnihilationAtRest theAntiProtonAnnihilation;
// anti-neutron
G4AntiNeutronAnnihilationAtRest theAntiNeutronAnnihilation;
};
// 2002 by J.P. Wellisch
#endif
@@ -0,0 +1,43 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
#ifndef G4VNeutronBuilder_h
#define G4VNeutronBuilder_h
class G4HadronElasticProcess;
class G4HadronFissionProcess;
class G4HadronCaptureProcess;
class G4NeutronInelasticProcess;
class G4VNeutronBuilder
{
public:
G4VNeutronBuilder() {}
virtual ~G4VNeutronBuilder() {}
virtual void Build(G4HadronElasticProcess & aP) = 0;
virtual void Build(G4HadronFissionProcess & aP) = 0;
virtual void Build(G4HadronCaptureProcess & aP) = 0;
virtual void Build(G4NeutronInelasticProcess & aP) = 0;
};
// 2002 by J.P. Wellisch
#endif
@@ -0,0 +1,49 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
#ifndef G4VPiKBuilder_h
#define G4VPiKBuilder_h
#include "G4HadronElasticProcess.hh"
#include "G4PionPlusInelasticProcess.hh"
#include "G4PionMinusInelasticProcess.hh"
#include "G4KaonPlusInelasticProcess.hh"
#include "G4KaonMinusInelasticProcess.hh"
#include "G4KaonZeroLInelasticProcess.hh"
#include "G4KaonZeroSInelasticProcess.hh"
class G4VPiKBuilder
{
public:
G4VPiKBuilder() {}
virtual ~G4VPiKBuilder() {}
virtual void Build(G4HadronElasticProcess & aP) = 0;
virtual void Build(G4PionPlusInelasticProcess & aP) = 0;
virtual void Build(G4PionMinusInelasticProcess & aP) = 0;
virtual void Build(G4KaonPlusInelasticProcess & aP) = 0;
virtual void Build(G4KaonMinusInelasticProcess & aP) = 0;
virtual void Build(G4KaonZeroLInelasticProcess & aP) = 0;
virtual void Build(G4KaonZeroSInelasticProcess & aP) = 0;
};
// 2002 by J.P. Wellisch
#endif
@@ -0,0 +1,38 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
#ifndef G4VProtonBuilder_h
#define G4VProtonBuilder_h
class G4ProtonInelasticProcess;
class G4VProtonBuilder
{
public:
G4VProtonBuilder() {}
virtual ~G4VProtonBuilder() {}
virtual void Build(G4HadronElasticProcess & aP) = 0;
virtual void Build(G4ProtonInelasticProcess & aP) = 0;
};
// 2002 by J.P. Wellisch
#endif
@@ -0,0 +1,64 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
#ifndef GeneralPhysics_h
#define GeneralPhysics_h 1
#include "globals.hh"
#include "G4ios.hh"
#include "G4VPhysicsConstructor.hh"
#include "G4Decay.hh"
class GeneralPhysics : public G4VPhysicsConstructor
{
public:
GeneralPhysics(const G4String& name = "general");
virtual ~GeneralPhysics();
public:
// This method will be invoked in the Construct() method.
// each particle type will be instantiated
virtual void ConstructParticle();
// This method will be invoked in the Construct() method.
// each physics process will be instantiated and
// registered to the process manager of each particle type
virtual void ConstructProcess();
protected:
G4Decay fDecayProcess;
};
// 2002 by J.P. Wellisch
#endif
@@ -0,0 +1,71 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
#ifndef HadronPhysicsLHEP_h
#define HadronPhysicsLHEP_h 1
#include "globals.hh"
#include "G4ios.hh"
#include "G4VPhysicsConstructor.hh"
#include "G4HadronQEDBuilder.hh"
#include "G4StoppingHadronBuilder.hh"
#include "G4MiscLHEPBuilder.hh"
#include "G4LHEPPiKBuilder.hh"
#include "G4PiKBuilder.hh"
#include "G4ProtonBuilder.hh"
#include "G4LHEPProtonBuilder.hh"
#include "G4NeutronBuilder.hh"
#include "G4LHEPNeutronBuilder.hh"
class HadronPhysicsLHEP : public G4VPhysicsConstructor
{
public:
HadronPhysicsLHEP(const G4String& name ="hadron");
virtual ~HadronPhysicsLHEP();
public:
virtual void ConstructParticle();
virtual void ConstructProcess();
private:
G4NeutronBuilder theNeutrons;
G4LHEPNeutronBuilder theLHEPNeutron;
G4PiKBuilder thePiK;
G4LHEPPiKBuilder theLHEPPiK;
G4ProtonBuilder thePro;
G4LHEPProtonBuilder theLHEPPro;
G4MiscLHEPBuilder theMiscLHEP;
G4StoppingHadronBuilder theStoppingHadron;
G4HadronQEDBuilder theHadronQED;
};
// 2002 by J.P. Wellisch
#endif
@@ -0,0 +1,77 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
#ifndef HadronPhysicsQGSC_h
#define HadronPhysicsQGSC_h 1
#include "globals.hh"
#include "G4ios.hh"
#include "G4VPhysicsConstructor.hh"
#include "G4HadronQEDBuilder.hh"
#include "G4StoppingHadronBuilder.hh"
#include "G4MiscLHEPBuilder.hh"
#include "G4PiKBuilder.hh"
#include "G4LEPPiKBuilder.hh"
#include "G4QGSCPiKBuilder.hh"
#include "G4ProtonBuilder.hh"
#include "G4LEPProtonBuilder.hh"
#include "G4QGSCProtonBuilder.hh"
#include "G4NeutronBuilder.hh"
#include "G4LEPNeutronBuilder.hh"
#include "G4QGSCNeutronBuilder.hh"
class HadronPhysicsQGSC : public G4VPhysicsConstructor
{
public:
HadronPhysicsQGSC(const G4String& name ="hadron");
virtual ~HadronPhysicsQGSC();
public:
virtual void ConstructParticle();
virtual void ConstructProcess();
private:
G4NeutronBuilder theNeutrons;
G4LEPNeutronBuilder theLEPNeutron;
G4QGSCNeutronBuilder theQGSCNeutron;
G4PiKBuilder thePiK;
G4LEPPiKBuilder theLEPPiK;
G4QGSCPiKBuilder theQGSCPiK;
G4ProtonBuilder thePro;
G4LEPProtonBuilder theLEPPro;
G4QGSCProtonBuilder theQGSCPro;
G4MiscLHEPBuilder theMiscLHEP;
G4StoppingHadronBuilder theStoppingHadron;
G4HadronQEDBuilder theHadronQED;
};
// 2002 by J.P. Wellisch
#endif
@@ -0,0 +1,77 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
#ifndef HadronPhysicsQGSP_h
#define HadronPhysicsQGSP_h 1
#include "globals.hh"
#include "G4ios.hh"
#include "G4VPhysicsConstructor.hh"
#include "G4HadronQEDBuilder.hh"
#include "G4StoppingHadronBuilder.hh"
#include "G4MiscLHEPBuilder.hh"
#include "G4PiKBuilder.hh"
#include "G4LEPPiKBuilder.hh"
#include "G4QGSPPiKBuilder.hh"
#include "G4ProtonBuilder.hh"
#include "G4LEPProtonBuilder.hh"
#include "G4QGSPProtonBuilder.hh"
#include "G4NeutronBuilder.hh"
#include "G4LEPNeutronBuilder.hh"
#include "G4QGSPNeutronBuilder.hh"
class HadronPhysicsQGSP : public G4VPhysicsConstructor
{
public:
HadronPhysicsQGSP(const G4String& name ="hadron");
virtual ~HadronPhysicsQGSP();
public:
virtual void ConstructParticle();
virtual void ConstructProcess();
private:
G4NeutronBuilder theNeutrons;
G4LEPNeutronBuilder theLEPNeutron;
G4QGSPNeutronBuilder theQGSPNeutron;
G4PiKBuilder thePiK;
G4LEPPiKBuilder theLEPPiK;
G4QGSPPiKBuilder theQGSPPiK;
G4ProtonBuilder thePro;
G4LEPProtonBuilder theLEPPro;
G4QGSPProtonBuilder theQGSPPro;
G4MiscLHEPBuilder theMiscLHEP;
G4StoppingHadronBuilder theStoppingHadron;
G4HadronQEDBuilder theHadronQED;
};
// 2002 by J.P. Wellisch
#endif
@@ -0,0 +1,105 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//========================
// taken from example N04 of G4 distribution
//========================
#ifndef IonPhysics_h
#define IonPhysics_h 1
#include "globals.hh"
#include "G4ios.hh"
#include "G4VPhysicsConstructor.hh"
#include "G4HadronElasticProcess.hh"
#include "G4LElastic.hh"
#include "G4DeuteronInelasticProcess.hh"
#include "G4LEDeuteronInelastic.hh"
#include "G4TritonInelasticProcess.hh"
#include "G4LETritonInelastic.hh"
#include "G4AlphaInelasticProcess.hh"
#include "G4LEAlphaInelastic.hh"
#include "G4hIonisation.hh"
#include "G4MultipleScattering.hh"
class IonPhysics : public G4VPhysicsConstructor
{
public:
IonPhysics(const G4String& name="ion");
virtual ~IonPhysics();
public:
// This method will be invoked in the Construct() method.
// each particle type will be instantiated
virtual void ConstructParticle();
// This method will be invoked in the Construct() method.
// each physics process will be instantiated and
// registered to the process manager of each particle type
virtual void ConstructProcess();
protected:
// Elastic Process
G4LElastic* theElasticModel;
// Generic Ion physics
G4HadronElasticProcess theIonElasticProcess;
G4MultipleScattering fIonMultipleScattering;
G4hIonisation fIonIonisation;
// Deuteron physics
G4HadronElasticProcess theDElasticProcess;
G4MultipleScattering fDeuteronMultipleScattering;
G4hIonisation fDeuteronIonisation;
G4DeuteronInelasticProcess fDeuteronProcess;
G4LEDeuteronInelastic* fDeuteronModel;
// Triton physics
G4HadronElasticProcess theTElasticProcess;
G4MultipleScattering fTritonMultipleScattering;
G4hIonisation fTritonIonisation;
G4TritonInelasticProcess fTritonProcess;
G4LETritonInelastic* fTritonModel;
// Alpha physics
G4HadronElasticProcess theAElasticProcess;
G4MultipleScattering fAlphaMultipleScattering;
G4hIonisation fAlphaIonisation;
G4AlphaInelasticProcess fAlphaProcess;
G4LEAlphaInelastic* fAlphaModel;
// He3 physics
G4HadronElasticProcess theHe3ElasticProcess;
G4MultipleScattering fHe3MultipleScattering;
G4hIonisation fHe3Ionisation;
};
// 2002 by J.P. Wellisch
#endif
@@ -0,0 +1,80 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
#ifndef MuonPhysics_h
#define MuonPhysics_h 1
#include "globals.hh"
#include "G4ios.hh"
#include "G4VPhysicsConstructor.hh"
#include "G4MultipleScattering.hh"
#include "G4MuBremsstrahlung.hh"
#include "G4MuPairProduction.hh"
#include "G4MuIonisation.hh"
#include "G4hIonisation.hh"
#include "G4MuonMinusCaptureAtRest.hh"
class MuonPhysics : public G4VPhysicsConstructor
{
public:
MuonPhysics(const G4String& name="muon");
virtual ~MuonPhysics();
public:
// This method will be invoked in the Construct() method.
// each particle type will be instantiated
virtual void ConstructParticle();
// This method will be invoked in the Construct() method.
// each physics process will be instantiated and
// registered to the process manager of each particle type
virtual void ConstructProcess();
protected:
// Muon physics
G4MultipleScattering fMuPlusMultipleScattering;
G4MuBremsstrahlung fMuPlusBremsstrahlung ;
G4MuPairProduction fMuPlusPairProduction;
G4MuIonisation fMuPlusIonisation;
G4MultipleScattering fMuMinusMultipleScattering;
G4MuBremsstrahlung fMuMinusBremsstrahlung ;
G4MuPairProduction fMuMinusPairProduction;
G4MuIonisation fMuMinusIonisation;
G4MuonMinusCaptureAtRest fMuMinusCaptureAtRest;
// Tau physics
G4MultipleScattering fTauPlusMultipleScattering;
G4hIonisation fTauPlusIonisation;
G4MultipleScattering fTauMinusMultipleScattering;
G4hIonisation fTauMinusIonisation;
};
// 2002 by J.P. Wellisch
#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. *
// ********************************************************************
//
///////////////////////////////////////////////////////////////////////////////
// File: CCalAMaterial.cc
// Description: Specialised class to store information to make G4Material
// from atomic proportion
///////////////////////////////////////////////////////////////////////////////
#include "CCalAMaterial.hh"
CCalAMaterial::CCalAMaterial(G4String mat, G4double dens, int nconst,
CCalAMaterial** constituents, G4double* weights) {
name=mat;
nElem=0;
int i=0;
for (i=0; i<nconst; i++)
nElem += (constituents[i]->NElements());
theElements = new G4String[nElem];
theWeights = new double[nElem];
double factor;
int nelem=0;
for (i=0; i<nconst; i++) {
factor=constituents[i]->Aeff();
for (int j=0; j<constituents[i]->NElements(); j++) {
theElements[nelem] = constituents[i]->Element(j);
theWeights[nelem] = constituents[i]->Weight(j)* weights[i] * factor;
nelem++;
}
}
if (dens>0)
density=dens;
else //Let's compute density
computeDensity(nconst,(CCalMaterial**)constituents, weights, FTVolume);
computeAeff(nconst, constituents, weights);
closeMaterial();
}
CCalAMaterial::CCalAMaterial(G4String elemat, double Aeff, double dens) {
name=elemat;
density=dens;
nElem=1;
theElements = new G4String[nElem];
theWeights = new double[nElem];
theElements[0] = elemat;
theWeights[0] = 1;
aEff=Aeff;
}
CCalAMaterial::~CCalAMaterial() {
//The base class destructor is called?
}
CCalAMaterial::CCalAMaterial(const CCalAMaterial& mat){
name = mat.name;
density = mat.density;
nElem = mat.nElem;
theElements = new G4String[nElem];
theWeights = new double[nElem];
for (int i=0; i<nElem; i++){
theElements[i]=mat.theElements[i];
theWeights[i]=mat.theWeights[i];
}
}
CCalAMaterial& CCalAMaterial::operator=(const CCalAMaterial& mat){
if(theElements)
delete[] theElements;
if(theWeights)
delete[] theWeights;
name=mat.name;
density=mat.density;
nElem=mat.nElem;
aEff=mat.aEff;
theElements = new G4String[nElem];
theWeights = new double[nElem];
for (int i=0; i<nElem; i++){
theElements[i]=mat.theElements[i];
theWeights[i]=mat.theWeights[i];
}
return *this;
}
void CCalAMaterial::computeAeff(int nconst,
CCalAMaterial** constituents,
double* weights){
aEff=0;
for (int i=0; i<nconst; i++)
aEff += weights[i] * constituents[i]->Aeff();
}
G4std::ostream& operator<<(G4std::ostream& os, const CCalAMaterial& mat) {
os << mat.name << G4endl;
os << "Density= " << mat.density << " g/cm3. Number of Elements: "
<< mat.nElem
<< ". Aeff= " << mat.aEff << G4endl;
for (int i=0; i<mat.nElem; i++)
os << '\t' << mat.theElements[i] << '\t' << mat.theWeights[i] << G4endl;
return os;
}
@@ -0,0 +1,387 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
///////////////////////////////////////////////////////////////////////////////
// File: CCalAnalysis.cc
// Description: CCalAnalysis interfaces all user analysis code
///////////////////////////////////////////////////////////////////////////////
#ifdef G4ANALYSIS_USE
#include "G4RunManager.hh"
#include "CCalAnalysis.hh"
#include "CCalutils.hh"
#include <AIDA/AIDA.h>
//#define debug
CCalAnalysis* CCalAnalysis::instance = 0;
CCalAnalysis::CCalAnalysis() :analysisFactory(0), tree(0), tuple(0), energy(0) {
int i=0;
for (i=0; i<28; i++) {
hcalE[i] = 0;
}
for (i=0; i<70; i++) {
lateralProfile[i] = 0;
}
for (i=0; i<49; i++) {ecalE[i] = 0;}
for (i=0; i<numberOfTimeSlices; i++) {timeHist[i] = 0;}
analysisFactory = AIDA_createAnalysisFactory();
if (analysisFactory) {
AIDA::ITreeFactory* treeFactory = analysisFactory->createTreeFactory();
if (treeFactory) {
// Tree in memory :
// Create a "tree" associated to an hbook
const char* opFileptr = getenv("CCAL_FILENAME");
G4String opFilestr = "ccal.his";
if (opFileptr) opFilestr = opFileptr;
cout << "********************************************" << endl
<< "* o/p file on " << opFilestr << endl
<< "********************************************" << endl << endl;
bool readOnly = false; // we want to write.
bool createNew = true; // create file if it doesn't exist.
tree = treeFactory->create(opFilestr, "hbook", readOnly,createNew);
if (tree) {
// Get a tuple factory :
AIDA::ITupleFactory* tupleFactory = analysisFactory->createTupleFactory(*tree);
if (tupleFactory) {
// Create a tuple :
G4String tag2, tag = "float";
for (i=0; i<28; i++) {
tag2 = tag + " hcal" + i + ",";
tag = tag2;
}
for (i=0; i<49; i++) {
tag2 = tag + " ecal" + i + ",";
tag = tag2;
}
tag2 = tag + " ELAB, XPOS, YPOS, ZPOS";
tag = tag2 + ", EDEP, EDEC, EDHC";
//tuple = tupleFactory->create("1","Event info", tag); // Column wise (default)
tuple = tupleFactory->create("1","Event info", tag, "--preferRWN"); // Row wise
assert(tuple);
delete tupleFactory;
}
AIDA::IHistogramFactory* histoFactory =
analysisFactory->createHistogramFactory(*tree);
if (histoFactory) {
// Create histos :
char id[4], ntupletag[50];
//Energy deposit in Hcal layers
for (int i = 0; i<28; i++) {
sprintf(id, "%d",i+100);
sprintf(ntupletag, "Energy Deposit in Hcal Layer%d in GeV",i);
hcalE[i] = histoFactory->createHistogram1D(id, ntupletag, 100, 0., 1.0);
}
// Energy deposits in Ecal towers
for (i = 0; i<49; i++) {
sprintf(id, "%d",i+200);
sprintf(ntupletag, "Energy Deposit in Ecal Tower%d in GeV",i);
ecalE[i] = histoFactory->createHistogram1D(id, ntupletag, 100, 0., 100.0);
}
// Total energy deposit
energy = histoFactory->createHistogram1D("4000", "Total energy deposited in GeV",
100, 0., 100.0);
// Time slices
for (i=0; i<numberOfTimeSlices; i++){
sprintf(id, "%d",i+300);
sprintf(ntupletag, "Time slice %d nsec energy profile in GeV",i);
timeHist[i] = histoFactory->createHistogram1D(id, ntupletag, 100, 0., 100.0);
}
// Profile of lateral energy deposit in Hcal
for (i = 0; i<70; i++) {
sprintf(id, "%d",i+400);
sprintf(ntupletag, "Lateral energy profile at %d cm in GeV",i);
lateralProfile[i] = histoFactory->createHistogram1D(id, ntupletag, 100, 0., 10.0);
}
delete histoFactory;
}
}
delete treeFactory; // Will not delete the ITree.
}
}
}
CCalAnalysis::~CCalAnalysis() {
Finish();
}
void CCalAnalysis::Init() {
}
void CCalAnalysis::Finish() {
if (tree) {
delete tree;
tree = 0;
}
if (analysisFactory) {
delete analysisFactory; // Will delete tree and histos.
analysisFactory = 0;
}
}
CCalAnalysis* CCalAnalysis::getInstance() {
if (instance == 0) instance = new CCalAnalysis();
return instance;
}
// This function fill the 1d histogram of the energies in HCal layers
void CCalAnalysis::InsertEnergyHcal(float* v) {
double totalFilledEnergyHcal = 0.0;
for (int i=0; i<28; i++) {
if (hcalE[i]) {
double x = v[i];
hcalE[i]->fill(x);
#ifdef debug
cout << "Fill Hcal histo " << i << " with " << x << endl;
totalFilledEnergyHcal += x;
#endif
}
}
#ifdef debug
cout << "\t total filled Energy Hcal histo " << totalFilledEnergyHcal << endl;
#endif
}
// This function fill the 1d histogram of the energies in ECal layers
void CCalAnalysis::InsertEnergyEcal(float* v) {
double totalFilledEnergyEcal = 0.0;
for (int i=0; i<49; i++) {
if (ecalE[i]) {
double x = v[i];
ecalE[i]->fill(x);
#ifdef debug
cout << "Fill Ecal histo " << i << " with " << x << endl;
totalFilledEnergyEcal += x;
#endif
}
}
#ifdef debug
cout << "\t total filled Energy Ecal histo " << totalFilledEnergyEcal << endl;
#endif
}
// This function fill the 1d histogram of the lateral profile
void CCalAnalysis::InsertLateralProfile(float* v) {
double totalFilledProfileHcal = 0.0;
for (int i=0; i<70; i++) {
if (lateralProfile[i]) {
double x = v[i];
lateralProfile[i]->fill(x);
#ifdef debug
cout << "Fill Profile Hcal histo " << i << " with " << x << endl;
totalFilledProfileHcal += x;
#endif
}
}
#ifdef debug
cout << "\t total filled Profile Hcal histo " << totalFilledProfileHcal << endl;
#endif
}
// This function fill the 1d histogram of the energy
void CCalAnalysis::InsertEnergy(float v) {
if (energy) {
double x = v;
energy->fill(x);
#ifdef debug
cout << "Fill Total energy Hcal histo with " << x << endl;
#endif
}
}
// This function fill the 1d histograms of time profiles
void CCalAnalysis::InsertTime(float* v) {
double totalFilledTimeProfile = 0.0;
for (int j=0; j<numberOfTimeSlices; j++) {
if (timeHist[j]) {
double x = v[j];
timeHist[j]->fill(x);
#ifdef debug
cout << "Fill Time profile histo " << j << " with " << x << endl;
totalFilledTimeProfile += x;
#endif
}
}
#ifdef debug
cout << "\t total filled Time profile histo " << totalFilledTimeProfile << endl;
#endif
}
void CCalAnalysis::setNtuple(float* hcalE, float* ecalE, float elab,
float x, float y, float z, float edep,
float edec, float edhc) {
AIDA::ITuple * ntuple = dynamic_cast<AIDA::ITuple *> ( tree->find("1") );
if (ntuple) {
char tag[10];
int i=0;
for (i=0; i<28; i++) {
sprintf (tag, "hcal%d", i);
ntuple->fill(tuple->findColumn(tag),hcalE[i]);
}
for (i=0; i<49; i++) {
sprintf (tag, "ecal%d", i);
ntuple->fill(tuple->findColumn(tag),ecalE[i]);
}
ntuple->fill(tuple->findColumn("ELAB"),elab);
ntuple->fill(tuple->findColumn("XPOS"),x);
ntuple->fill(tuple->findColumn("YPOS"),y);
ntuple->fill(tuple->findColumn("ZPOS"),z);
ntuple->fill(tuple->findColumn("EDEP"),edep);
ntuple->fill(tuple->findColumn("EDEC"),edec);
ntuple->fill(tuple->findColumn("EDHC"),edhc);
ntuple->addRow();
}
}
/*
This member reset the histograms and it is called at the begin
of each run; here we put the inizialization so that the histograms have
always the right dimensions depending from the detector geometry
*/
void CCalAnalysis::BeginOfRun(G4int n) {
int i=0;
/*
if (energy) energy->reset();
for (i=0; i<28; i++) {
if (hcalE[i]) hcalE[i]->reset();
}
for (i=0; i<70; i++) {
if (lateralProfile[i]) lateralProfile[i]->reset();
}
for (i=0; i<49; i++) {
if (ecalE[i]) ecalE[i]->reset();
}
*/
for (i=0; i<numberOfTimeSlices; i++) {
if (timeHist[i]) timeHist[i]->reset();
}
}
// This member is called at the end of each run
void CCalAnalysis::EndOfRun(G4int n) {
if (tree) {
tree->commit();
tree->close();
}
}
// This member is called at the end of every event
void CCalAnalysis::EndOfEvent(G4int flag) {
#ifdef debug
cout << " Check if empty histograms " << endl;
int i=0;
if ( energy ) {
if ( energy->allEntries() == 0 ) {
cout << "EMPTY HISTO energy " << endl;
} else if ( energy->allEntries() == energy->extraEntries() ) {
cout << "EXTRA entries only HISTO energy " << endl;
}
} else {
cout << "UNDEFINED HISTO energy " << endl;
}
for (i=0; i<28; i++) {
if ( hcalE[i] ) {
if ( hcalE[i]->allEntries() == 0 ) {
cout << "EMPTY HISTO hcal " << i << endl;
} else if ( hcalE[i]->allEntries() == hcalE[i]->extraEntries() ) {
cout << "EXTRA entries only HISTO hcal " << i << endl;
}
} else {
cout << "UNDEFINED HISTO hcal " << i << endl;
}
}
for (i=0; i<70; i++) {
if ( lateralProfile[i] ) {
if ( lateralProfile[i]->allEntries() == 0 ) {
cout << "EMPTY HISTO lateralProfile " << i << endl;
} else if ( lateralProfile[i]->allEntries() ==
lateralProfile[i]->extraEntries() ) {
cout << "EXTRA entries only HISTO lateralProfile " << i << endl;
}
} else {
cout << "UNDEFINED HISTO lateralProfile " << i << endl;
}
}
for (i=0; i<49; i++) {
if ( ecalE[i] ) {
if ( ecalE[i]->allEntries() == 0 ) {
cout << "EMPTY HISTO ecalE " << i << endl;
} else if ( ecalE[i]->allEntries() == ecalE[i]->extraEntries() ) {
cout << "EXTRA entries only HISTO ecal " << i << endl;
}
} else {
cout << "UNDEFINED HISTO hcal " << i << endl;
}
}
for (i=0; i<numberOfTimeSlices; i++) {
if ( timeHist[i] ) {
if ( timeHist[i]->allEntries() == 0 ) {
cout << "EMPTY HISTO timeHist " << i << endl;
} else if ( timeHist[i]->allEntries() == timeHist[i]->extraEntries() ) {
cout << "EXTRA entries only HISTO timeHist " << i << endl;
}
} else {
cout << "UNDEFINED HISTO timeHist " << i << endl;
}
}
#endif
// The plotter is updated only if there is some
// hits in the event
if (!flag) return;
}
#endif
@@ -0,0 +1,122 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
///////////////////////////////////////////////////////////////////////////////
// File: CCalDetector.cc
// Description: CCalDetector is a detector factory class
///////////////////////////////////////////////////////////////////////////////
#include "CCalDetector.hh"
#include "g4std/fstream"
#include "CCalGeometryConfiguration.hh"
#include "CCalutils.hh"
//Comment/Uncomment to hide/show some debug information
//#define debug
//Comment/Uncomment to hide/show some more debug information
//#define ddebug
G4String CCalDetector::pathName = getenv("CCAL_GEOMPATH");
CCalDetector::CCalDetector(const G4String &name):
detectorName(name) {
#ifdef ddebug
cout << "CCAL_GEOMPATH=" << pathName << endl;
#endif
fileName =
CCalGeometryConfiguration::getInstance()->getFileName(name);
constructFlag =
CCalGeometryConfiguration::getInstance()->getConstructFlag(name);
}
CCalDetector::~CCalDetector() {
CCalDetectorTable::iterator ite;
for( ite = theDetectorsInside.begin(); ite != theDetectorsInside.end(); ite++ ) {
delete *ite;
}
theDetectorsInside.clear();
}
void CCalDetector::construct() {
#ifdef debug
cout << "===> Entering CCalDetector::construct() for " << CCalDetectorName << endl;
#endif
int isgood = 0;
//If constructFlag is unset we don't go into all this bussines
if (constructFlag!=0) {
if (!isgood)
isgood = buildFromFile();
if (isgood) {
constructDaughters();
for (unsigned int i=0; i < theDetectorsInside.size(); i++) {
theDetectorsInside[i]->constructHierarchy();
}
}
}
#ifdef debug
cout << "===> Exiting CCalDetector::construct() for " << detectorName
<< endl;
#endif
}
void CCalDetector::addDetector(CCalDetector* det) {
theDetectorsInside.push_back(det);
}
//========================================================================
//Protected and private methods.
int CCalDetector::buildFromFile() {
return readFile();
}
//========================================================================
//Global operators
G4std::ostream& operator<<(G4std::ostream& os, const CCalDetector& det) {
os << "Detector \"" << det.detectorName
<< "\" read from " << det.fileName << "." << G4endl;
os << "With " << det.theDetectorsInside.size()
<< " detectors inside { "<< G4endl;
for (unsigned int i=0; i<det.theDetectorsInside.size(); i++)
os << det.theDetectorsInside[i] << G4endl;
os << "}" << G4endl;
return os;
}
@@ -0,0 +1,138 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
///////////////////////////////////////////////////////////////////////////////
// File: CCalDetectorConstruction.cc
// Description: CCalDetectorConstruction user action class to construct
// detector geometry
///////////////////////////////////////////////////////////////////////////////
#include "CCalDetectorConstruction.hh"
//#define debug
#ifdef debug
#include "G4Timer.hh"
#endif
#include "CCalMaterialFactory.hh"
#include "CCalRotationMatrixFactory.hh"
#include "CCalSensAssign.hh"
#include "CCalMagneticField.hh"
#include "CCalG4Hall.hh"
#include "CCalutils.hh"
#include "CCalEcalOrganization.hh"
#include "CCalHcalOrganization.hh"
#include "G4SDManager.hh"
#include "G4FieldManager.hh"
#include "G4ChordFinder.hh"
#include "G4Mag_UsualEqRhs.hh"
#include "G4SimpleRunge.hh"
#include "G4TransportationManager.hh"
CCalDetectorConstruction::CCalDetectorConstruction() {}
CCalDetectorConstruction::~CCalDetectorConstruction() {}
G4VPhysicalVolume* CCalDetectorConstruction::Construct() {
/////////
//Instantiate for the first time the materials and rotations
#ifdef debug
G4cout << "Retrieving materials...." << G4endl;
#endif
CCalMaterialFactory::getInstance("material.cms");
#ifdef debug
G4cout << "Retrieving rotation matrices....." << G4endl;
#endif
CCalRotationMatrixFactory::getInstance("rotation.cms");
//-------------------------------------------------------------------------
// Magnetic field
//-------------------------------------------------------------------------
static G4bool fieldIsInitialized = false;
//And finally that it was not initialized previously
if (!fieldIsInitialized) {
CCalMagneticField* ccalField=new CCalMagneticField("fmap.tb96");
G4double field = ccalField->GetConstantFieldvalue();
if (field == 0) {
ccalField = NULL;
G4cout << "***************************" << G4endl
<< "* *" << G4endl
<< "* Magnetic Field is off *" << G4endl
<< "* *" << G4endl
<< "***************************" << G4endl;
} else {
G4cout << "***************************" << G4endl
<< "* *" << G4endl
<< "* Magnetic Field is on *" << G4endl
<< "* *" << G4endl
<< "***************************" << G4endl << G4endl
<< " Field Value " << tab << field << G4endl;
}
G4FieldManager* fieldMgr
= G4TransportationManager::GetTransportationManager()->GetFieldManager();
fieldMgr->SetDetectorField(ccalField);
G4Mag_UsualEqRhs *fEquation = new G4Mag_UsualEqRhs(ccalField);
G4MagIntegratorStepper *pStepper = new G4SimpleRunge (fEquation);
G4ChordFinder *pChordFinder = new G4ChordFinder(ccalField,
1.0e-2*mm, pStepper);
fieldMgr->SetChordFinder(pChordFinder);
fieldIsInitialized = true;
}
#ifdef debug
G4cout << tab << "CCalDetectorConstruction: Starting timer!!!"
<< G4endl;
G4Timer timer;
timer.Start();
#endif
//HCAL Test Beam 96
CCalG4Hall* testBeamHCal96 = new CCalG4Hall("HcalTB96");
testBeamHCal96->constructHierarchy();
#ifdef debug
timer.Stop();
G4cout << tab << "CCalDetectorConstruction: Total time to "
<< "construct the geometry: " << timer << G4endl;
#endif //debug
G4VPhysicalVolume* volume = testBeamHCal96->PhysicalVolume(0);
//Addsenistive detector types
bool result;
result = CCalSensAssign::getInstance()->addCaloSD("HadronCalorimeter",
new CCalHcalOrganization);
result = CCalSensAssign::getInstance()->addCaloSD("CrystalMatrix",
new CCalEcalOrganization);
//Assign the sensitive detectors
result = CCalSensAssign::getInstance()->assign();
//Create the stacking manager required by Calorimeter
result = CCalSensAssign::getInstance()->stackingAction();
return volume;
}
@@ -0,0 +1,108 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
///////////////////////////////////////////////////////////////////////////////
// File: CCalEcal.cc
// Description: CCalEcal Geometry factory class for crystal matrix
///////////////////////////////////////////////////////////////////////////////
#include "CCalEcal.hh"
#include "g4std/fstream"
#include "CCalutils.hh"
//#define debug
CCalEcal::~CCalEcal() {}
int CCalEcal::readFile() {
///////////////////////////////////////////////////////////////
//Let's open the file
G4cout << " ==> Opening file " << File() << " to read elements..."
<< G4endl;
G4std::ifstream is;
bool ok = openGeomFile(is, pathName, File());
if (!ok)
return 0;
// Find *DO CrystalMatrix
findDO(is, G4String("CrystalMatrix"));
//Let's read overall box dimensions and positions
readName(is,genMat);
is >> widBox >> lengBox >> xpos >> ypos >> zpos >> thetaX >> phiX
>> thetaY >> phiY >> thetaZ >> phiZ >> jump;
#ifdef debug
G4cout << tab << "General material: " << genMat << "\tBox dimensions "
<< widBox << ", " << lengBox << G4endl;
G4cout << tab << "Positioned at (" << xpos << ", " << ypos << ", " << zpos
<< ") with rotation (" << thetaX << ", " << phiX << ", " << thetaY
<< ", " << phiY << ", " << thetaZ << ", " << phiZ << ")" << G4endl;
#endif
//Then the layer positions
int i=0;
readName(is,layMat);
is >> layNum >> layRadius >> layAngle >> lengFront;
for (i=0; i<5; i++)
is >> layPar[i];
#ifdef debug
G4cout << tab << "Layer material: " << layMat << " Number " << layNum
<< " Radius " << layRadius << " Angle " << layAngle/deg
<< " front dist " << lengFront << " Parameters ";
for (i=0; i<5; i++)
G4cout << layPar[i] << " ";
G4cout << G4endl;
#endif
//Then the crystal positions
readName(is,crystMat);
is >> crystNum >> crystLength >> crystTol;
for (i=0; i<5; i++)
is >> crystPar[i];
#ifdef debug
G4cout << tab << "Crystal material: " << crystMat << " Number " << crystNum
<< " Length " << crystLength << " Tolerance " << crystTol
<< " Parameters ";
for (i=0; i<5; i++)
G4cout << crystPar[i] << " ";
G4cout << G4endl;
#endif
//Then the support material
readName(is,suppMat);
is >> dxSupp >> dySupp >> dzSupp >> distSupp >> jump;
#ifdef debug
G4cout << tab << "Support material: " << suppMat << " Dimensions " << dxSupp
<< ", " << dySupp << ", " << dzSupp << " Distance " << distSupp << G4endl;
#endif
///////////////////////////////////////////////////////////////
// Close the file
G4cout << " ==> Closing file " << File() << G4endl;
is.close();
return 1;
}
void CCalEcal::constructDaughters() {}
@@ -0,0 +1,55 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
///////////////////////////////////////////////////////////////////////////////
// File: CCalEcalOrganization.cc
// Description: Defines numbering schema for the Electromagnetic Calorimeter
///////////////////////////////////////////////////////////////////////////////
#include "CCalEcalOrganization.hh"
#include "G4VPhysicalVolume.hh"
#include "G4Step.hh"
#include "G4StepPoint.hh"
#include "SystemOfUnits.h"
CCalEcalOrganization::~CCalEcalOrganization(){
G4cout << " Deleting CCalEcalOrganization" << G4endl;
}
unsigned int CCalEcalOrganization::GetUnitID(const G4Step* aStep) const {
G4VPhysicalVolume* pv = aStep->GetPreStepPoint()->GetPhysicalVolume();
int idx=0, idl=0, idn=0;
if (pv > 0) {
idx = pv->GetCopyNo() - 1;
pv = pv->GetMother();
if (pv > 0) {
idl = pv->GetCopyNo() - 1;
pv = pv->GetMother();
if (pv > 0)
idn = pv->GetCopyNo();
}
}
unsigned int idunit = idn*4096 + idl*64 + idx;
return idunit;
}
@@ -0,0 +1,248 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
///////////////////////////////////////////////////////////////////////////////
// File: CCalEndOfEventAction.cc
// Description: CCalEndOfEventAction provides User actions at end of event
///////////////////////////////////////////////////////////////////////////////
#include "CCalEndOfEventAction.hh"
#include "CCaloSD.hh"
#include "CCalPrimaryGeneratorAction.hh"
#include "CCalG4HitCollection.hh"
#include "CCalG4Hit.hh"
#include "CCaloOrganization.hh"
#include "CCalSDList.hh"
#include "CCalSteppingAction.hh"
#include "G4ios.hh"
#include "G4Event.hh"
#include "G4SDManager.hh"
#include "G4HCofThisEvent.hh"
#include "g4std/iostream"
#include "g4std/map"
#include "G4RunManager.hh"
#include "G4UserSteppingAction.hh"
#include "G4TrajectoryContainer.hh"
#include "G4Trajectory.hh"
#include "G4VVisManager.hh"
#ifdef G4ANALYSIS_USE
#include "CCalAnalysis.hh"
#endif
//#define debug
//#define ddebug
CCalEndOfEventAction::CCalEndOfEventAction (CCalPrimaryGeneratorAction* pg):
isInitialized(false),SDnames(0),numberOfSD(0) {
primaryGenerator = pg;
#ifdef debug
G4cout << "Instantiate CCalEndOfEventAction" << G4endl;
#endif
G4cout << "Now Instantiate stepping action" << G4endl;
instanciateSteppingAction();
G4cout << "Get Calorimter organisation" << G4endl;
theOrg = new CCaloOrganization;
G4cout << "end of instantiation of EndofEventAction" << G4endl;
}
CCalEndOfEventAction::~CCalEndOfEventAction() {
if (theOrg)
delete theOrg;
if (SDnames)
delete SDnames;
G4cout << "Deleting CCalEndOfEventAction" << G4endl;
}
void CCalEndOfEventAction::initialize() {
isInitialized = true;
numberOfSD = CCalSDList::getInstance()->getNumberOfCaloSD();
#ifdef debug
G4cout << "CCalEndOfEventAction look for " << numberOfSD
<< " calorimeter-like SD" << G4endl;
#endif
if (numberOfSD > 0)
SDnames = new nameType[numberOfSD];
for (int i=0; i<numberOfSD; i++) {
SDnames[i] = G4String(CCalSDList::getInstance()->getCaloSDName(i));
#ifdef debug
G4cout << "CCalEndOfEventAction: found SD " << i << " name "
<< SDnames[i] << G4endl;
#endif
}
}
void CCalEndOfEventAction::StartOfEventAction(const G4Event* evt) {
G4cout << "\n---> Begin of event: " << evt->GetEventID() << G4endl;
}
void CCalEndOfEventAction::EndOfEventAction(const G4Event* evt){
#ifdef debug
G4cout << G4endl << "=== Begin of EndOfEventAction === " << G4endl;
#endif
if (!isInitialized) initialize();
theSteppingAction->endOfEvent();
//
// Look for the Hit Collection
//
G4HCofThisEvent* allHC = evt->GetHCofThisEvent();
if (allHC == 0) {
#ifdef debug
G4cout << "CCalEndOfEventAction: No Hit Collection in this event"
<< G4endl;
#endif
return;
}
//
// hits info
//
//Now make summary
float hcalE[28], ecalE[49], fullE=0.;
int i = 0;
for (i = 0; i < 28; i++) {hcalE[i]=0.;}
for (i = 0; i < 49; i++) {ecalE[i]=0.;}
float* edep = new float[numberOfSD];
int nhit=0;
for (i = 0; i < numberOfSD; i++){
//
// Look for the Hit Collection
//
edep[i] = 0;
int caloHCid = G4SDManager::GetSDMpointer()->GetCollectionID(SDnames[i]);
CCalG4HitCollection* theHC =
(CCalG4HitCollection*) allHC->GetHC(caloHCid);
if (theHC != 0) {
G4int nentries = theHC->entries();
#ifdef debug
G4cout << " There are " << nentries << " hits in " << SDnames[i] << " :"
<< G4endl;
#endif
if (nentries > 0) {
int j;
for (j=0; j<nentries; j++){
#ifdef ddebug
G4cout << "Considering hit " << j << G4endl;
#endif
CCalG4Hit* aHit = (*theHC)[j];
float En = aHit->getEnergyDeposit();
int unitID = aHit->getUnitID();
int id=-1;
if (unitID > 0 && unitID < 29) {
id = unitID - 1; // HCal
hcalE[id] += En/GeV;
} else {
int i0 = unitID/4096;
int i1 = (unitID/64)%64;
int i2 = unitID%64;
if (i0 == 1 && i1 < 8 && i2 < 8) {
id = i1*7 + i2; // ECal
ecalE[id] += En/GeV;
}
}
#ifdef ddebug
G4cout << "Seeing Energy = " << En/MeV << " MeV in Unit " << unitID
<< " " << id << G4endl;
#endif
fullE += En/GeV;
edep[i] += En/GeV;
nhit++;
}
#ifdef ddebug
G4cout << " ===> Total Energy Deposit in this Calorimeter = "
<< edep[i]*1000.0 << " MeV " << G4endl;
#endif
}
}
}
G4ThreeVector pos = primaryGenerator->GetParticlePosition();
float ener = primaryGenerator->GetParticleEnergy()/GeV;
float x = pos.x()/mm;
float y = pos.y()/mm;
float z = pos.z()/mm;
float edec = edep[1];
float edhc = edep[0];
delete[] edep;
#ifdef G4ANALYSIS_USE
CCalAnalysis* analysis = CCalAnalysis::getInstance();
analysis->InsertEnergy(fullE);
analysis->InsertEnergyHcal(hcalE);
analysis->InsertEnergyEcal(ecalE);
analysis->setNtuple(hcalE, ecalE, ener, x, y, z, fullE, edec, edhc);
analysis->EndOfEvent(nhit);
#endif
//A.R. Add to visualize tracks
// extract the trajectories and draw them
if (G4VVisManager::GetConcreteInstance()) {
G4TrajectoryContainer* trajectoryContainer = evt->GetTrajectoryContainer();
G4int n_trajectories = 0;
if (trajectoryContainer) n_trajectories = trajectoryContainer->entries();
for (G4int i=0; i<n_trajectories; i++) {
G4Trajectory* trj = (G4Trajectory*) ((*(evt->GetTrajectoryContainer()))[i]);
trj->DrawTrajectory(50); // Draw all tracks
// if ( trj->GetCharge() != 0. ) trj->DrawTrajectory(50); // Draw only charged tracks
// if ( trj->GetCharge() == 0. ) trj->DrawTrajectory(50); // Draw only neutral tracks
}
}
}
void CCalEndOfEventAction::instanciateSteppingAction(){
G4UserSteppingAction* theUA = const_cast<G4UserSteppingAction*>(G4RunManager::GetRunManager()->GetUserSteppingAction());
if (theUA == 0) {
#ifdef debug
G4cout << " CCalEndOfEventAction::instanciateSteppingAction creates"
<< " CCalSteppingAction" << G4endl;
#endif
theSteppingAction = new CCalSteppingAction;
G4RunManager::GetRunManager()->SetUserAction(theSteppingAction);
}
}
@@ -0,0 +1,148 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
///////////////////////////////////////////////////////////////////////////////
// File: CCalG4Able.cc
// Description: CCalG4Able is the base class of a Geant4 geometry factory
///////////////////////////////////////////////////////////////////////////////
//Comment/Uncomment next line to unset/set debug information printing
//#define debug
//#define ddebug
#ifdef ddebug
#include "G4Timer.hh"
#endif
#ifdef debug
#include "CCalutils.hh"
#endif
#include "CCalGeometryConfiguration.hh"
#include "CCalG4Able.hh"
#include "CCalSensitiveConfiguration.hh"
#include "G4Color.hh"
#include "G4VisAttributes.hh"
CCalG4Able::CCalG4Able(G4String name):
detPhysicalVolume(0), g4ableName(name), sensitivity(false),
visProperties(CCalSensitiveConfiguration::getInstance()->getFileName(name)+".vis") {
//Initialize g4VisAtt pointers
for (int i=0; i<CCalVisualisable::TotalVisTypes; i++) {
g4VisAtt[i]=0;
}
sensitivity =
CCalSensitiveConfiguration::getInstance()->getSensitiveFlag(name);
}
G4VPhysicalVolume* CCalG4Able::PhysicalVolume(G4VPhysicalVolume* pv) {
//If detPhysicalVolume is not (nil) the volume has already been built
//so return it. In other case, construct it and its daughters, then
//check for sensitivity and build it if set.
#ifdef ddebug
G4Timer timer;
timer.Start();
#endif
if (CCalGeometryConfiguration::getInstance()->getConstructFlag(G4Name())!=0){
if (!detPhysicalVolume) {
detPhysicalVolume = constructIn(pv);
for (unsigned int i = 0; i < theG4DetectorsInside.size(); i++) {
theG4DetectorsInside[i]->PhysicalVolume(detPhysicalVolume);
}
if (sensitivity) {
#ifdef debug
G4cout << "==> Making " << detPhysicalVolume->GetName() << " sensitive..."
<< G4endl;
#endif
constructSensitive();
} //if sensitivity
} //if sensitive
} //if construct
else {
G4cout << "NOTE: You decided to skip the construction of "
<< G4Name() << G4endl;
}
#ifdef ddebug
timer.Stop();
G4cout << tab << "CCalG4Able::PhysicalVolume(...) --> time spent: "
<< timer << G4endl;
#endif
return detPhysicalVolume;
}
void CCalG4Able::AddCCalG4Able(CCalG4Able* det) {
theG4DetectorsInside.push_back(det);
}
void CCalG4Able::setVisType(CCalVisualisable::visType vt, G4LogicalVolume* log) {
if (!g4VisAtt[vt]) {
#ifdef debug
G4cout << "CCalG4Able::setVisType: Constructing G4VisAttributes for "
<< log->GetName() << " as " << vt << G4endl;
#endif
G4Color col(visProperties.colorRed(vt),
visProperties.colorGreen(vt),
visProperties.colorBlue(vt));
G4bool wf = visProperties.isWireFrame(vt);
G4bool visible = visProperties.isVisible(vt);
#ifdef debug
G4cout << "Color: "
<< visProperties.colorRed(vt) << ", "
<< visProperties.colorGreen(vt) << ", "
<< visProperties.colorBlue(vt) << tab
<< "Wireframe: " << wf << tab
<< "Visible: " << visible << G4endl;
#endif
g4VisAtt[vt] = new G4VisAttributes(col);
g4VisAtt[vt]->SetForceWireframe(wf);
g4VisAtt[vt]->SetVisibility(visible);
}
log->SetVisAttributes(g4VisAtt[vt]);
}
G4bool CCalG4Able::operator==(const CCalG4Able& right) const {
return detPhysicalVolume==right.detPhysicalVolume;
}
//========================================================================
//Protected and private methods.
//========================================================================
//Global operators
G4std::ostream& operator<<(G4std::ostream& os, const CCalG4Able& det) {
if (det.detPhysicalVolume)
os << "Physical volume already constructed." << G4endl;
else
os << "Physical volume still not constructed." << G4endl;
if (det.isSensitive())
os << "and it is Sensitive" << G4endl;
else
os << "and it is not Sensitive" << G4endl;
return os;
}
@@ -0,0 +1,291 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
///////////////////////////////////////////////////////////////////////////////
// File: CCalG4Ecal.cc
// Description: CCalG4Ecal Factory class to construct the G4 geometry of the
// electromagnetic calorimeter
///////////////////////////////////////////////////////////////////////////////
#include "CCalG4Ecal.hh"
#include "CCalMaterialFactory.hh"
#include "CCalRotationMatrixFactory.hh"
#include "CCalSensitiveDetectors.hh"
#include "CCalutils.hh"
#include <math.h>
#include "G4ThreeVector.hh"
#include "G4Box.hh"
#include "G4Trd.hh"
#include "G4LogicalVolume.hh"
#include "G4PVPlacement.hh"
//#define debug
//#define ddebug
//#define pdebug
//#define sdebug
//Initialize static logical volumes
G4LogicalVolume* CCalG4Ecal::crystalmatrixLog = 0;
//Initialize static prefix name
G4String CCalG4Ecal::idName = "CrystalMatrix";
////////////////////////////////////////////////////////////////////
// CCalG4Ecal constructor & destructor...
////////////////////////////////////////////////////////////////////
CCalG4Ecal::CCalG4Ecal(const G4String &name):
CCalEcal(name), CCalG4Able(name), type(module1) {}
CCalG4Ecal::~CCalG4Ecal() {}
////////////////////////////////////////////////////////////////////
// CCalG4Ecal methods...
////////////////////////////////////////////////////////////////////
G4VPhysicalVolume* CCalG4Ecal::constructIn(G4VPhysicalVolume* mother) {
G4cout << "==>> Constructing CCalG4Ecal..." << G4endl;
///////////////////////////////////////////////////////////////
// Construction of global volume as a Box
if (!crystalmatrixLog) {
crystalmatrixLog = constructGlobal();
}
CCalRotationMatrixFactory* rotfact = CCalRotationMatrixFactory::getInstance();
G4double x, y, z;
if (mother != 0) {
x = getXpos()*mm;
y = getYpos()*mm;
z = getZpos()*mm;
} else {
x = y = z = 0;
}
int num;
if (type == module2) {
num = 2;
} else {
num = 1;
}
#ifdef pdebug
G4String name("Null");
if (mother != 0) name = mother->GetName();
G4cout << crystalmatrixLog->GetName() << " Number " << num << " positioned in "
<< name << " at (" << x << ", " << y << ", " << z << ")";
#endif
G4RotationMatrix* cmrot = 0;
if (mother != 0) {
G4String rotstr = idName + num;
cmrot = rotfact->findMatrix(rotstr);
if (!cmrot) {
#ifdef ddebug
G4cout << "Creating a new rotation: " << rotstr << tab
<< getThetaX()*deg << "," << getPhiX()*deg << ","
<< getThetaY()*deg << "," << getPhiY()*deg << ","
<< getThetaZ()*deg << "," << getPhiZ()*deg << G4endl;
#endif
cmrot = rotfact->AddMatrix(rotstr, getThetaX()*deg, getPhiX()*deg,
getThetaY()*deg, getPhiY()*deg,
getThetaZ()*deg, getPhiZ()*deg);
} // if !cmrot
#ifdef pdebug
G4cout << " rotation by (" << getThetaX() << ", " << getPhiX() << ", "
<< getThetaY() << "," << getPhiY() << ", " << getThetaZ() << ", "
<< getPhiZ() << ")" << G4endl;
#endif
} else {
#ifdef pdebug
G4cout << " without rotation..." << G4endl;
#endif
}
G4PVPlacement* crystalmatrix;
if (mother != 0) {
crystalmatrix = new G4PVPlacement(cmrot, G4ThreeVector(x,y,z),
crystalmatrixLog, idName,
mother->GetLogicalVolume(), false, num);
} else {
crystalmatrix = new G4PVPlacement(cmrot, G4ThreeVector(x,y,z),
idName, crystalmatrixLog,
mother, false, num);
}
G4cout << "<<== End of CCalG4Ecal construction ..." << G4endl;
return crystalmatrix;
}
G4LogicalVolume* CCalG4Ecal::constructGlobal() {
//Pointers to the Materials and Rotation Matrix factory
CCalMaterialFactory* matfact = CCalMaterialFactory::getInstance();
CCalRotationMatrixFactory* rotfact = CCalRotationMatrixFactory::getInstance();
G4Material* matter = matfact->findMaterial(getGenMat());
G4VSolid* solid = new G4Box (idName, 0.5*getWidBox()*mm, 0.5*getWidBox()*mm,
0.5*getLengBox()*mm);
#ifdef debug
G4cout << tab << idName << " Box made of " << getGenMat() << " of dimension "
<< 0.5*getWidBox()*mm << ", " << 0.5*getWidBox()*mm << ", "
<< 0.5*getLengBox()*mm << G4endl;
#endif
G4LogicalVolume* glog = new G4LogicalVolume (solid, matter, idName);
setVisType(CCalVisualisable::PseudoVolumes,glog);
//Now the layers
G4String name = idName + "Layer";
matter = matfact->findMaterial(getLayMat());
solid = new G4Trd(name, getLayPar(0)*mm, getLayPar(1)*mm, getLayPar(2)*mm,
getLayPar(3)*mm, getLayPar(4)*mm);
#ifdef debug
G4cout << tab << name << " Trd made of " << getLayMat() << " of dimension "
<< getLayPar(0)*mm << ", " << getLayPar(1)*mm << ", " << getLayPar(2)*mm
<< ", " << getLayPar(3)*mm << ", " << getLayPar(4)*mm << G4endl;
#endif
G4LogicalVolume* laylog = new G4LogicalVolume (solid, matter, name);
setVisType(CCalVisualisable::OtherServices,laylog);
G4int i = 0;
G4String rotstr;
G4double xp, yp, zp, angle;
G4double zshift = -0.5 * (getLengBox() - getCrystLength()) + getLengFront();
G4RotationMatrix* rot = 0;
for (i = 0; i < getLayNum(); i++) {
angle = 0.5 * getLayAngle() * (2*i + 1 - getLayNum());
xp = angle * (getLayPar(4) + getLayRadius()) * mm;
zp = (zshift + getLayPar(0)*abs(sin(angle))) * mm;
rotstr = idName + "Layer" + i;
rot = rotfact->findMatrix(rotstr);
if (!rot) {
#ifdef ddebug
G4cout << "Creating a new rotation: " << rotstr << tab
<< (90.0*deg+angle) << "," << 0.0*deg << "," << 90.0*deg << ","
<< 90.0*deg << "," << angle << "," << 0.0*deg << G4endl;
#endif
rot = rotfact->AddMatrix(rotstr, (90.0*deg+angle), 0.0*deg, 90.0*deg,
90.0*deg, angle, 0.0*deg);
}
new G4PVPlacement(rot, G4ThreeVector(xp,0.,zp), laylog, name, glog,
false, i+1);
#ifdef pdebug
G4cout << laylog->GetName() << " number " << i+1 << " positioned in "
<< glog->GetName() << " at (" << xp << ", 0," << zp
<< ") with rotation angle " << angle/deg << G4endl;
#endif
}
//Now the crystals
name = idName + "Crystal";
matter = matfact->findMaterial(getCrystMat());
solid = new G4Trd(name, getCrystPar(0)*mm, getCrystPar(1)*mm,
getCrystPar(2)*mm, getCrystPar(3)*mm, getCrystPar(4)*mm);
#ifdef debug
G4cout << tab << name << " Trd made of " << getCrystMat() << " of dimension "
<< getCrystPar(0)*mm << ", " << getCrystPar(1)*mm << ", "
<< getCrystPar(2)*mm << ", " << getCrystPar(3)*mm << ", "
<< getCrystPar(4)*mm << G4endl;
#endif
G4LogicalVolume* detLog = new G4LogicalVolume (solid, matter, name);
setVisType(CCalVisualisable::Sensitive,detLog);
sensitiveLogs.push_back(detLog);
for (i = 0; i < getCrystNum(); i++) {
angle = 0.5 * getLayAngle() * (2*i + 1 - getCrystNum());
yp = angle * (getCrystPar(4) + getLayRadius()) * mm;
zp = (getCrystPar(0)*abs(sin(angle)) - getCrystTol()) * mm;
rotstr = idName + "Crystal" + i;
rot = rotfact->findMatrix(rotstr);
if (!rot) {
#ifdef ddebug
G4cout << "Creating a new rotation: " << rotstr << tab << 90.0*deg << ","
<< 0.0*deg << "," << (90.0*deg+angle) << "," << 0.0*deg << ","
<< angle << "," << 90.0*deg << G4endl;
#endif
rot = rotfact->AddMatrix(rotstr, 90.0*deg, 0.0*deg, (90.0*deg+angle),
90.0*deg, angle, 90.0*deg);
}
new G4PVPlacement(rot, G4ThreeVector(0,yp,zp), detLog, name, laylog,
false, i+1);
#ifdef pdebug
G4cout << detLog->GetName() << " number " << i+1 << " positioned in "
<< laylog->GetName() << " at (0," << yp << "," << zp
<< ") with rotation angle " << angle/deg << G4endl;
#endif
}
//Support boxes
name = idName + "Support";
matter = matfact->findMaterial(getSuppMat());
solid = new G4Box (name, 0.5*getDxSupp()*mm, 0.5*getDySupp()*mm,
0.5*getDzSupp()*mm);
#ifdef debug
G4cout << tab << name << " Box made of " << getSuppMat() << " of dimension "
<< 0.5*getDxSupp()*mm << ", " << 0.5*getDySupp()*mm << ", "
<< 0.5*getDzSupp()*mm << G4endl;
#endif
G4LogicalVolume* slog = new G4LogicalVolume (solid, matter, name);
setVisType(CCalVisualisable::Support,slog);
zp = (-0.5 * getLengBox() + getCrystLength() + getLengFront() +
0.5 * getDzSupp() + getDistSupp()) * mm;
for (i = 0; i < getCrystNum(); i++) {
yp = getLayPar(1) * (2*i + 1 - getCrystNum()) * mm;
new G4PVPlacement(0, G4ThreeVector(0,yp,zp), slog, name, glog,
false, i+1);
#ifdef pdebug
G4cout << slog->GetName() << " number " << i+1 << " positioned in "
<< glog->GetName() << " at (0," << yp << "," << zp
<< ") with no rotation" << G4endl;
#endif
}
return glog;
}
void CCalG4Ecal::constructSensitive() {
#ifdef debug
G4cout << "Now registering CrystalMatrix LogicalVolume's to SD's:" << G4endl;
#endif
if (sensitiveLogs.size()>0) {
CCalSensitiveDetectors* sensDets = CCalSensitiveDetectors::getInstance();
G4String SDname = idName;
for(G4std::vector<ptrG4Log>::iterator iter=sensitiveLogs.begin();
iter<sensitiveLogs.end(); iter++) {
sensDets->registerVolume(SDname, (*iter));
#ifdef sdebug
G4cout << "Register volume " << (*iter)->GetName() << " for" << SDname
<< G4endl;
#endif
}
}
}
@@ -0,0 +1,108 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
///////////////////////////////////////////////////////////////////////////////
// File: CCalG4Hall.cc
// Description: CCalG4Hall Geometry factory class to construct G4 geometry
// of the experimental hall
///////////////////////////////////////////////////////////////////////////////
#include "CCalG4Hall.hh"
#include "CCalMaterialFactory.hh"
#include "CCalG4Hcal.hh"
#include "CCalG4Ecal.hh"
#include "CCalutils.hh"
#include "G4LogicalVolume.hh"
#include "G4ThreeVector.hh"
#include "G4PVPlacement.hh"
#include "G4Box.hh"
//#define debug
//#define pdebug
////////////////////////////////////////////////////////////////////
// CCalG4Hall constructor & destructor...
////////////////////////////////////////////////////////////////////
CCalG4Hall::CCalG4Hall(const G4String &name):
CCalHall(name),CCalG4Able(name) {}
CCalG4Hall::~CCalG4Hall() {}
////////////////////////////////////////////////////////////////////
// CCalG4Hall methods...
////////////////////////////////////////////////////////////////////
G4VPhysicalVolume* CCalG4Hall::constructIn(G4VPhysicalVolume* mother) {
G4cout << "==>> Constructing CCalG4Hall..." << G4endl;
///////////////////////////////////////////////////////////////
//Pointers to the Rotation Matrices and to the Materials
CCalMaterialFactory* matfact = CCalMaterialFactory::getInstance();
//Experimental Hall. The mother volume....
#ifdef debug
G4cout << tab << "Building experimental Hall geometry...." << G4endl;
#endif
G4Box* solid = new G4Box(Name(), getDx_2Hall()*mm, getDy_2Hall()*mm,
getDy_2Hall()*mm);
#ifdef debug
G4cout << solid->GetName() << " made of " << getMaterial() << " of dimension "
<< getDx_2Hall()*mm << " " << getDy_2Hall()*mm << " "
<< getDy_2Hall()*mm << " (all in mm)" << G4endl;
#endif
G4Material* matter = matfact->findMaterial(getMaterial());
G4LogicalVolume* glog = new G4LogicalVolume (solid, matter, Name(), 0, 0, 0);
setVisType(CCalVisualisable::PseudoVolumes,glog);
G4VPhysicalVolume* volume = new G4PVPlacement(0,G4ThreeVector(),Name(),
glog,mother,false,0);
#ifdef pdebug
G4String name("Null");
if (mother != 0) name = mother->GetName();
G4cout << glog->GetName() << " number 1 positioned in " << name
<< " at (0,0,0) with no rotation" << G4endl;
#endif
G4cout << "<<== End of CCalG4Hall construction ..." << G4endl;
return volume;
}
void CCalG4Hall::constructDaughters(){
//Hadron Calorimeter
CCalG4Hcal* hcal = new CCalG4Hcal("HadronCalorimeter");
addDetector(hcal);
AddCCalG4Able(hcal);
//Crystal matrix
CCalG4Ecal* ecal = new CCalG4Ecal("CrystalMatrixModule");
ecal->setType(CCalG4Ecal::module1);
addDetector(ecal);
AddCCalG4Able(ecal);
}

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