Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/examples/advanced/composite_calorimeter/README

Version: [ ReleaseNotes ] [ 1.0 ] [ 1.1 ] [ 2.0 ] [ 3.0 ] [ 3.1 ] [ 3.2 ] [ 4.0 ] [ 4.0.p1 ] [ 4.0.p2 ] [ 4.1 ] [ 4.1.p1 ] [ 5.0 ] [ 5.0.p1 ] [ 5.1 ] [ 5.1.p1 ] [ 5.2 ] [ 5.2.p1 ] [ 5.2.p2 ] [ 6.0 ] [ 6.0.p1 ] [ 6.1 ] [ 6.2 ] [ 6.2.p1 ] [ 6.2.p2 ] [ 7.0 ] [ 7.0.p1 ] [ 7.1 ] [ 7.1.p1 ] [ 8.0 ] [ 8.0.p1 ] [ 8.1 ] [ 8.1.p1 ] [ 8.1.p2 ] [ 8.2 ] [ 8.2.p1 ] [ 8.3 ] [ 8.3.p1 ] [ 8.3.p2 ] [ 9.0 ] [ 9.0.p1 ] [ 9.0.p2 ] [ 9.1 ] [ 9.1.p1 ] [ 9.1.p2 ] [ 9.1.p3 ] [ 9.2 ] [ 9.2.p1 ] [ 9.2.p2 ] [ 9.2.p3 ] [ 9.2.p4 ] [ 9.3 ] [ 9.3.p1 ] [ 9.3.p2 ] [ 9.4 ] [ 9.4.p1 ] [ 9.4.p2 ] [ 9.4.p3 ] [ 9.4.p4 ] [ 9.5 ] [ 9.5.p1 ] [ 9.5.p2 ] [ 9.6 ] [ 9.6.p1 ] [ 9.6.p2 ] [ 9.6.p3 ] [ 9.6.p4 ] [ 10.0 ] [ 10.0.p1 ] [ 10.0.p2 ] [ 10.0.p3 ] [ 10.0.p4 ] [ 10.1 ] [ 10.1.p1 ] [ 10.1.p2 ] [ 10.1.p3 ] [ 10.2 ] [ 10.2.p1 ] [ 10.2.p2 ] [ 10.2.p3 ] [ 10.3 ] [ 10.3.p1 ] [ 10.3.p2 ] [ 10.3.p3 ] [ 10.4 ] [ 10.4.p1 ] [ 10.4.p2 ] [ 10.4.p3 ] [ 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /examples/advanced/composite_calorimeter/README (Version 11.3.0) and /examples/advanced/composite_calorimeter/README (Version 7.1.p1)


  1 ----------------------------------------------      1 -------------------------------------------------------------------
                                                   >>   2 $Id: README,v 1.11 2004/05/18 14:57:48 ribon Exp $
  2 ----------------------------------------------      3 -------------------------------------------------------------------
  3                                                     4 
  4      =========================================      5      =========================================================
  5                       Geant4 - Composite calor      6                       Geant4 - Composite calorimeter example
  6      =========================================      7      =========================================================
  7                                                     8 
  8                              README                 9                              README
  9                       ---------------------        10                       ---------------------
 10                                                    11 
 11  CompositeCalorimeter is an example of a test-     12  CompositeCalorimeter is an example of a test-beam simulation used 
 12  by the CMS Collaboration to validate Geant4 a     13  by the CMS Collaboration to validate Geant4 against real data taken 
 13  (in 1996) in a CMS Hadron calorimeter test-be     14  (in 1996) in a CMS Hadron calorimeter test-beam.
 14  The name "Composite" for this example emphasi     15  The name "Composite" for this example emphasizes that, although the 
 15  test-beam had the goal of studying the hadron     16  test-beam had the goal of studying the hadronic calorimeter response, 
 16  part of the data was taken with the presence      17  part of the data was taken with the presence of the electromagnetic 
 17  crystal calorimeter in front of the hadronic      18  crystal calorimeter in front of the hadronic calorimeter, to better 
 18  reproduce the situation as in the real CMS ex     19  reproduce the situation as in the real CMS experiment. 
 19  The geometry of the simulation has been setup     20  The geometry of the simulation has been setup in such a way to allow
 20  very easily, at run time (therefore without n     21  very easily, at run time (therefore without need of changing any code; 
 21  see below for the details) the inclusion or e     22  see below for the details) the inclusion or exclusion of the 
 22  electromagnetic calorimeter part.                 23  electromagnetic calorimeter part. 
 23  Although some important aspects, for a detail     24  Although some important aspects, for a detailed comparison between 
 24  test-beam data and simulation, like beam prof     25  test-beam data and simulation, like beam profile, noise, and digitization, 
 25  have been omitted here (to avoid too many tec     26  have been omitted here (to avoid too many technical details),
 26  nevertheless, this example is able to reprodu     27  nevertheless, this example is able to reproduce the main features of
 27  most of the relevant observables as measured      28  most of the relevant observables as measured in the real test-beam. 
 28  The output of this example consists of a set  <<  29  The output of this example, if the AIDA or Anaphe/Lizard environment 
 29  and one ntuple which are stored on a ROOT fil <<  30  has been properly setup (see below), consists of a set of histograms 
                                                   >>  31  and one ntuple which are stored on a HBOOK file.
 30  In our opinion, the most original "lesson" wh     32  In our opinion, the most original "lesson" which is offered by this
 31  advanced example for the Geant4 user is to sh     33  advanced example for the Geant4 user is to show how the Geometry and
 32  the Sensitive/Hit part of the simulation is t     34  the Sensitive/Hit part of the simulation is treated in a big experiment.
 33  Although the details of how this is done vary     35  Although the details of how this is done vary from experiment to
 34  experiment (it is worth, for instance, to com     36  experiment (it is worth, for instance, to compare with the Atlas-based
 35  advanced example lAr_calorimeter), the main d     37  advanced example lAr_calorimeter), the main driving needs and goals 
 36  are quite general: to have consistency, but a     38  are quite general: to have consistency, but avoiding duplications
 37  and couplings as much as possibile, between S     39  and couplings as much as possibile, between Simulation, Reconstruction,
 38  and Visualization. Notice that the solution o     40  and Visualization. Notice that the solution offered in this example
 39  by CMS could appear "overdone" for the sake o     41  by CMS could appear "overdone" for the sake of simulating only a 
 40  relatively simple test-beam setup; but it sho     42  relatively simple test-beam setup; but it should be kept in mind
 41  that the same approach is used also for the f     43  that the same approach is used also for the full CMS detector 
 42  simulation, as well as for any subdetector.       44  simulation, as well as for any subdetector.  
 43                                                    45 
 44                                                    46   
 45 1. Setting up the environment variables            47 1. Setting up the environment variables
 46 ---------------------------------------            48 ---------------------------------------
 47                                                    49 
 48  The user should first setup, as "usual", the      50  The user should first setup, as "usual", the Geant4 environmental
 49  variables (e.g. the script produced by cmake) <<  51  variables (in particular, the variable G4ANALYSIS_USE must be set
 50  Then the specific setup for this example shou <<  52  if you want to have the histograms and the ntuple).
                                                   >>  53  Then the specific setup for this example, including the AIDA/PI part
                                                   >>  54  used in the analysis, should be run:
 51                                                    55  
 52      >  source envExample.csh      in the case     56      >  source envExample.csh      in the case of C-shell
 53  or                                                57  or
 54      >  . envExample.sh            in the case     58      >  . envExample.sh            in the case of bash-shell
 55                                                    59  
 56  The analysis part is based on the native g4an <<  60  The analysis part is based on AIDA/PI.
 57  the output is a ROOT file. This can be change <<  61  Please take a look to the web page:  http://www.cern.ch/PI .
 58                                                    62 
 59                                                    63 
 60 2. Sample run                                      64 2. Sample run
 61 -------------                                      65 -------------
 62                                                    66 
 63  Once the environmental variables are setup, y     67  Once the environmental variables are setup, you can get the executable
 64     CompositeCalorimeter                       <<  68     $G4WORKDIR/bin/$G4SYSTEM/CompositeCalorimeter
 65  by configuring with cmake and then running th <<  69  by typing "gmake" on this directory.
 66  Then, you can execute it using the Geant4 mac     70  Then, you can execute it using the Geant4 macro command input file test.g4mac
 67  as follows:                                       71  as follows:    
 68                                                    72  
 69     >  ./CompositeCalorimeter test.g4mac       <<  73     >  $G4WORKDIR/bin/$G4SYSTEM/CompositeCalorimeter test.g4mac
 70                                                    74  
 71  which simulate a few events, each being a 100 <<  75  which simulate 10 events, each being a 100 GeV pi- incident on the 
 72  electromagnetic crystal calorimeter followed      76  electromagnetic crystal calorimeter followed by the hadronic calorimeter,
 73  without magnetic field.                           77  without magnetic field.
 74  The output is the ROOT file "ccal.root" .     <<  78  The output is the HBOOK file "ccal.his" , which can be seen either with
                                                   >>  79  Lizard (or any other AIDA-compliant package) or with Paw or Root.
 75  See part "8. Analysis / Histogramming" below      80  See part "8. Analysis / Histogramming" below for more details on the
 76  content of that file.                             81  content of that file.
 77  If you run instead:                               82  If you run instead: 
 78                                                    83 
 79     >  ./CompositeCalorimeter                  <<  84     >  $G4WORKDIR/bin/$G4SYSTEM/CompositeCalorimeter
 80                                                    85 
 81  after having setup the Geant4 visualization v     86  after having setup the Geant4 visualization variables and the PATH,
 82  you can visualize the geometry of the apparat     87  you can visualize the geometry of the apparatus, and also see some
 83  events. Similarly, you can get a very simple      88  events. Similarly, you can get a very simple graphical user interface
 84  that allows to select the particle type, its      89  that allows to select the particle type, its energy, and the number
 85  of events (between a limited number of possib     90  of events (between a limited number of possibilities).
 86  For more details, see part "9. Visualization      91  For more details, see part "9. Visualization / GUI".
 87                                                    92  
 88                                                    93 
 89 3. Detector description                            94 3. Detector description
 90 -----------------------                            95 -----------------------
 91                                                    96  
 92  Let's start with a brief description of the t     97  Let's start with a brief description of the test-beam setup.
 93                                                    98 
 94  There are two possible configurations:            99  There are two possible configurations: 
 95    i)  HCAL only, that is only the hadronic ca    100    i)  HCAL only, that is only the hadronic calorimeter is present;
 96   ii)  ECAL+HCAL, that is the electromagnetic     101   ii)  ECAL+HCAL, that is the electromagnetic calorimeter (ECAL)
 97                   is placed in front of the ha    102                   is placed in front of the hadronic calorimeter.
 98  ECAL is made of 23 cm long PbWO4 crystals (co    103  ECAL is made of 23 cm long PbWO4 crystals (corresponding to about
 99  25.8 radiation lengths, and 1.1 interaction l    104  25.8 radiation lengths, and 1.1 interaction lengths); for the 
100  test beam a  7 x 7 = 49  matrix of crystals i    105  test beam a  7 x 7 = 49  matrix of crystals is used.
101  HCAL is a sampling calorimeter, with plastic     106  HCAL is a sampling calorimeter, with plastic scintillator as sensitive
102  part and copper as absorber. 28 scintillator     107  part and copper as absorber. 28 scintillator plates were used with
103  absorber of varying thickness in between, and    108  absorber of varying thickness in between, and also varying thickness
104  and type of scintillator. More precisely:        109  and type of scintillator. More precisely:
105    --- layer 1: 2 cm of Copper                    110    --- layer 1: 2 cm of Copper
106    --- layer 2 to 7: 4 cm of Copper               111    --- layer 2 to 7: 4 cm of Copper
107    --- layer 8 to 21: 6 cm of Copper              112    --- layer 8 to 21: 6 cm of Copper
108    --- layer 22 to 27: 8 cm of Copper             113    --- layer 22 to 27: 8 cm of Copper
109  For the scintillators: 2 mm passive Plastic;     114  For the scintillators: 2 mm passive Plastic; 4 mm active Plastic;
110  1 mm passive Plastic.                            115  1 mm passive Plastic. 
111  The total length of HCAL consists of 152 cm o    116  The total length of HCAL consists of 152 cm of Copper plus 189 mm of Plastic.
112  The dimension orthogonal to the beam directio    117  The dimension orthogonal to the beam direction is  64 cm x 64 cm.
113  The ECAL and HCAL considered here are prototy    118  The ECAL and HCAL considered here are prototypes for the Central and
114  Endcap calorimeters of the CMS detector (whic    119  Endcap calorimeters of the CMS detector (which covers the rapidity
115  region |eta| < 3.0 ; CMS has also a Forward c    120  region |eta| < 3.0 ; CMS has also a Forward calorimeter, which covers
116  the region 3.0 < |eta| < 5.0, but this part w    121  the region 3.0 < |eta| < 5.0, but this part was not considered in 
117  this test-beam setup). Notice, however, that     122  this test-beam setup). Notice, however, that there are more layers 
118  (28 instead of 19 in the Barrel or 18 in the     123  (28 instead of 19 in the Barrel or 18 in the Endcap) of HCAL in the 
119  test-beam setup than in the real CMS detector    124  test-beam setup than in the real CMS detector, in order to study 
120  energy containment. Therefore, the ECAL+HCAL     125  energy containment. Therefore, the ECAL+HCAL in the test-beam amounts 
121  to more than 11 radiation lengths as for the     126  to more than 11 radiation lengths as for the real CMS detector (the
122  19 layers of the Barrel have each 6 cm of abs    127  19 layers of the Barrel have each 6 cm of absorber, whereas the 
123  18 layers of the Endcap have each 6.6 cm of a    128  18 layers of the Endcap have each 6.6 cm of absorber, so that the
124  number of interaction lengths are rougly the     129  number of interaction lengths are rougly the same). 
125  Five values of the magnetic field (parallel t    130  Five values of the magnetic field (parallel to the face of the scintillators)
126  have been considered in the test-beam: 0.0 ,     131  have been considered in the test-beam: 0.0 , 0.375 , 0.75 , 1.50 , 3.0 Tesla.
127                                                   132 
128  In order to set the magnetic field, you have     133  In order to set the magnetic field, you have to edit the file
129        dataglobal/fmap.tb96                       134        dataglobal/fmap.tb96
130  and change the first number (which appears in    135  and change the first number (which appears in the third line of
131  that file, on the first column; the unit bein    136  that file, on the first column; the unit being Tesla): 
132    #. Field map                                   137    #. Field map
133    *DO FLDM                                       138    *DO FLDM
134      0.0   9               652.0                  139      0.0   9               652.0
135  for example, if you want a magnetic field of     140  for example, if you want a magnetic field of 3.0 Tesla the last
136  line must be set as follows (the magnetic fie    141  line must be set as follows (the magnetic field unity is kilo Gauss).
137      30.0   9               652.0                 142      30.0   9               652.0
138                                                   143 
                                                   >> 144  The default stepper in magnetic field is G4ClassicalRK4, but other
                                                   >> 145  possibilities can be selected by editing the file 
                                                   >> 146  src/CCalDetectorConstruction.cc  (look at the string "***STEPPER***").
                                                   >> 147 
139  In order to deactivate either the ECAL or the    148  In order to deactivate either the ECAL or the HCAL, it is enough
140  to comment out the corresponding line in the     149  to comment out the corresponding line in the file g4testbeamhcal96.conf, 
141  using "#" as the comment character. For insta    150  using "#" as the comment character. For instance, to have only the HCAL
142  without ECAL:                                    151  without ECAL:
143  "HcalTB96"                      "tbhcal96"       152  "HcalTB96"                      "tbhcal96"              1
144  #"CrystalMatrixModule"           "tbhcal96xta    153  #"CrystalMatrixModule"           "tbhcal96xtal"          1  
145                                                   154 
146                                                   155 
147  In this test-beam setup, at the back of ECAL,    156  In this test-beam setup, at the back of ECAL, there is also some 
148  material for support and readout, which has b    157  material for support and readout, which has been considered in the 
149  simulation. For the HCAL, only the fibres are    158  simulation. For the HCAL, only the fibres are close to the test-beam, 
150  and because they have the same composition as    159  and because they have the same composition as the scintillators
151  they are adequately represented in the simula    160  they are adequately represented in the simulation; the remaining
152  of the readout, including the photomultiplier    161  of the readout, including the photomultipliers, are in readout boxes
153  far away from the HCAL, and hence are not pre    162  far away from the HCAL, and hence are not present in the simulation.
154                                                   163 
155  Let's summarizes now the geometry description    164  Let's summarizes now the geometry description of the simulation.
156  As said in the introduction, this part is the    165  As said in the introduction, this part is the most original and
157  important of this example, but it is quite co    166  important of this example, but it is quite complex and can be fully
158  appreciated only in the context of the CMS so    167  appreciated only in the context of the CMS software framework, in 
159  particular in the relation between Simulation    168  particular in the relation between Simulation, Reconstruction, and
160  Visualization. Therefore we limit ourself to     169  Visualization. Therefore we limit ourself to only few considerations,
161  pointing to the internal CMS documentation fo    170  pointing to the internal CMS documentation for more details.
162                                                   171  
163  --- In order to share the same geometrical an    172  --- In order to share the same geometrical and physical information
164      about CMS between Simulation, Reconstruct    173      about CMS between Simulation, Reconstruction, and Visualization,
165      avoiding inconsistencies, duplications, a    174      avoiding inconsistencies, duplications, and unnecessary dependecies,
166      all these information is store, once for     175      all these information is store, once for all, in common databases
167      (typically in XML format), instead of put    176      (typically in XML format), instead of putting them inside C++ classes, 
168      as usually done in simpler detector descr    177      as usually done in simpler detector descriptions (in most of the
169      the Geant4 examples, novice or advanced,     178      the Geant4 examples, novice or advanced, the geometry information
170      is kept inside the concrete class which i    179      is kept inside the concrete class which inherits from 
171      G4VUserDetectorConstruction). For simplic    180      G4VUserDetectorConstruction). For simplicity, in this example,
172      these "databases" are nothing more than A    181      these "databases" are nothing more than ASCII files:
173                                                   182 
174         datageom/ : tbhcal96.geom, tbhcal96hca    183         datageom/ : tbhcal96.geom, tbhcal96hcal.geom, tbhcal96xtal.geom
175                     store the information abou    184                     store the information about the experimental Hall, 
176                     the HCAL, and the ECAL, re    185                     the HCAL, and the ECAL, respectively.
177                                                   186 
178         dataconf/ : g4testbeamhcal96.conf, tes    187         dataconf/ : g4testbeamhcal96.conf, testbeamhcal96.conf
179                     store the information abou    188                     store the information about which configuration
180                     (HCAL only, or ECAL+HACL)     189                     (HCAL only, or ECAL+HACL) is considered, in the
181                     Simulation and Reconstruct    190                     Simulation and Reconstruction, respectively.
182                                                   191                     
183         dataglobal/ : fmap.tb96, material.cms,    192         dataglobal/ : fmap.tb96, material.cms, rotation.cms
184                     The first one is the magne    193                     The first one is the magnetic field map (how the 
185                     intensity of the magnetic     194                     intensity of the magnetic field, in the direction
186                     orthogonal to the beam dir    195                     orthogonal to the beam direction, varies along
187                     the beam axis). The second    196                     the beam axis). The second one, material.cms, 
188                     keeps the full collection     197                     keeps the full collection of all materials used in 
189                     the CMS detector (not only    198                     the CMS detector (not only in the calorimeters, 
190                     although we are simulating    199                     although we are simulating only them in this example!).
191                     The third one, rotation.cm    200                     The third one, rotation.cms, collects a set of useful
192                     rotation parameters (angle    201                     rotation parameters (angles).  
193                                                   202    
194         datavis/ : tbhcal96.vis, tbhcal96hcal.    203         datavis/ : tbhcal96.vis, tbhcal96hcal.vis, tbhcal96xtal.vis
195              visualization information for, re    204              visualization information for, respectively, the
196                    experimental Hall, HCAL, an    205                    experimental Hall, HCAL, and ECAL.
197                                                   206 
198  --- In order to allow an high degree of flexi    207  --- In order to allow an high degree of flexibility, at the geometry
199      level the user can choose which subsystem    208      level the user can choose which subsystem of the detector setup
200      should be simulated and can activate or d    209      should be simulated and can activate or deactivate the sensitive
201      parts, subsystem by subsystem. This can b    210      parts, subsystem by subsystem. This can be done at run time, 
202      by modifying one of the above database in    211      by modifying one of the above database information, without need 
203      of putting the hands on the code, recompi    212      of putting the hands on the code, recompiling, etc.
204                                                   213 
205  --- There are two "parallel geometry factorie    214  --- There are two "parallel geometry factories": one described by "core" 
206      classes, which are independent from the S    215      classes, which are independent from the Simulation (and therefore
207      can be used, for instance, by the Reconst    216      can be used, for instance, by the Reconstruction); and one which 
208      is specific of the Simulation. In the lat    217      is specific of the Simulation. In the latter case (Geant4 side of
209      the geometry model), all the geometry fac    218      the geometry model), all the geometry factories are derived from the
210      base class CCalG4Albe. Furthermore, using    219      base class CCalG4Albe. Furthermore, using double inheritance, each
211      of them derives also from the counterpart    220      of them derives also from the counterpart in the "core" hierarchy.  
212      The design of the CCalG4Able class helps     221      The design of the CCalG4Able class helps a modular approach and easy
213      interchanging at the level of subdetector    222      interchanging at the level of subdetectors, allowing a straightforward
214      transition from the simulation of the ent    223      transition from the simulation of the entire CMS detector to that of
215      just a part of it, or to a test-beam geom    224      just a part of it, or to a test-beam geometry, as indeed in this example.
216      Of course this modular, flexible, and gen    225      Of course this modular, flexible, and general approach does not come
217      for free: the price to pay here is its co    226      for free: the price to pay here is its complexity, which would be 
218      otherwise unjustified if we limited ourse    227      otherwise unjustified if we limited ourself to the pure simulation
219      of a relatively simple test-beam setup.      228      of a relatively simple test-beam setup.
220                                                   229 
221  --- See "10. Classes Overview" below for a sc    230  --- See "10. Classes Overview" below for a schematic summary of the 
222      various classes involved in the Geometry     231      various classes involved in the Geometry description of this example.
223                                                   232 
224                                                   233 
225 4. Physics processes                              234 4. Physics processes
226 --------------------                              235 --------------------
227                                                   236  
228  The factory physics list is used, therefore t << 237  By the default, one of the ufficial High Energy Physics List for 
229  is steered by the environmental variable PHYS << 238  Calorimetry, QGSC, is used in this example. However, it is 
230  (Note: if this environmental variable is not  << 239  very easy to use instead either LHEP or QGSP. To do so, it is
231   which is used is FTFP_BERT).                 << 240  enough to comment/uncomment a line in the main CompositeCalorimeter.cc :
232                                                << 241  for example, if you want to use LHEP instead of the default QGSC
                                                   >> 242  you have to change it as follows:
                                                   >> 243 
                                                   >> 244   //***LOOKHERE*** CHOOSE THE PHYSICS LIST.
                                                   >> 245   runManager->SetUserInitialization(new LHEP);     // LHEP     
                                                   >> 246   // runManager->SetUserInitialization(new QGSP);     // QGSP   
                                                   >> 247   // runManager->SetUserInitialization(new QGSC);     // QGSC
                                                   >> 248   //***endLOOKHERE***
                                                   >> 249 
                                                   >> 250  Notice that, for most of the cases (and certainly also in this case
                                                   >> 251  in which we don't even take into account the beam profile, noise
                                                   >> 252  and digitization!) the faster LHEP Physics List would be good enough
                                                   >> 253  for calorimetry studies. However, we prefer to use, as default, the
                                                   >> 254  more sophisticated (but slower) QGSC Physics List for the learning 
                                                   >> 255  purposes of this example.
                                                   >> 256 
                                                   >> 257  Please refer to the Web page:
                                                   >> 258 
                                                   >> 259       http://cmsdoc.cern.ch/~hpw/GHAD/HomePage/index.html
                                                   >> 260 
                                                   >> 261  for more information on these (and others) Physics Lists.
                                                   >> 262  Please notice that, for the time being, some classes, which can be
                                                   >> 263  downloaded from the above Web page, have to be included in the 
                                                   >> 264  include/ and src/ subdirectories of this example. However, hopefully
                                                   >> 265  soon, these classes will be distributed with Geant4 and therefore their 
                                                   >> 266  explicit inclusion in the example will no longer be necessary.
                                                   >> 267 
233                                                   268 
234 5. Particle Generator                             269 5. Particle Generator
235 ---------------------                             270 ---------------------
236                                                   271   
237  The 1996 test-beam has been taken with the fo    272  The 1996 test-beam has been taken with the following particles:
238     --- 225 GeV muons (for calibration)           273     --- 225 GeV muons (for calibration)
239     --- 10 to 300 GeV pions                       274     --- 10 to 300 GeV pions
240     --- 10 to 300 GeV electrons                   275     --- 10 to 300 GeV electrons
241  therefore the standard Geant4 Particle Gun ha    276  therefore the standard Geant4 Particle Gun has been used as primary
242  generator. Notice that, for the sake of keepi    277  generator. Notice that, for the sake of keeping the example not too
243  complicated, the proper simulation of the bea    278  complicated, the proper simulation of the beam profile and 
244  beam contamination have been neglected.          279  beam contamination have been neglected.  
245                                                   280 
246                                                   281 
247 6. Hits                                           282 6. Hits 
248 -------                                           283 -------
249                                                   284  
250  In CMS there are two groups of hits: Tracker-    285  In CMS there are two groups of hits: Tracker-like and Calorimeter-like.
251  Only the latter one appears in this example.     286  Only the latter one appears in this example. 
252  For the same reasons, as seen for the Geometr    287  For the same reasons, as seen for the Geometry, of consistency without 
253  duplication of information and unnecessary co    288  duplication of information and unnecessary coupling between Simulation, 
254  Reconstruction, and Visualization, the simula    289  Reconstruction, and Visualization, the simulation calorimeter hit class,
255  CCalG4Hit, doubly inherits from the common Ge    290  CCalG4Hit, doubly inherits from the common Geant4 abstract class for
256  all hits, G4VHit, and from the "core" (i.e. s    291  all hits, G4VHit, and from the "core" (i.e. simulation independent)
257  CMS calorimeter hit class, CCalHit.              292  CMS calorimeter hit class, CCalHit.
258  A new Hit object is created                      293  A new Hit object is created
259    - for each new particle entering the calori    294    - for each new particle entering the calorimeter;
260    - for each detector unit (i.e cristal or fi    295    - for each detector unit (i.e cristal or fiber or scintillator layer);
261    - for each nanosecond of the shower develop    296    - for each nanosecond of the shower development;
262  The information stored in each CCalHit object    297  The information stored in each CCalHit object is the following:
263    - Entry  : local coordinates of the entranc    298    - Entry  : local coordinates of the entrance point of the particle
264               in the unit where the shower sta    299               in the unit where the shower starts; 
265    - the TrackID  : Identification number of t    300    - the TrackID  : Identification number of the incident particle;
266    - the IncidentEnergy  : kinetic energy of t    301    - the IncidentEnergy  : kinetic energy of that incident particle;    
267    - the UnitID : the identification number of    302    - the UnitID : the identification number of the detector unit
268                   (crystal, or fiber, or scint    303                   (crystal, or fiber, or scintillator layer); 
269    - the TimeSlice : the time interval, in nan    304    - the TimeSlice : the time interval, in nanoseconds, in which the 
270                      hit has been created;        305                      hit has been created;
271    - the EnergyDeposit : the energy deposit in    306    - the EnergyDeposit : the energy deposit in this hit.    
272  Notice that all hit objects created for a giv    307  Notice that all hit objects created for a given shower have the same 
273  values for the first three pieces of informat    308  values for the first three pieces of information.
274                                                   309 
275                                                   310 
276 No Noise and Digitization                         311 No Noise and Digitization 
277 --------------------------                        312 --------------------------
278                                                   313  
279  In order to keep the complexity of this examp    314  In order to keep the complexity of this example to a reasonable 
280  level, both noise and digitization effects ha    315  level, both noise and digitization effects have not been included.
281                                                   316  
282                                                   317 
283 7. User Actions                                   318 7. User Actions
284 ----------------                                  319 ----------------
285                                                   320  
286  In this example. there have been used the fol    321  In this example. there have been used the following User Actions:
287                                                   322 
288  --- G4UserRunAction (the derived, concrete cl    323  --- G4UserRunAction (the derived, concrete class is CCalRunAction):
289      it is used to invoke the Analysis object     324      it is used to invoke the Analysis object at the beginning of
290      the Run, to instantiate it and passing it    325      the Run, to instantiate it and passing it the Run number, and
291      at the end of the Run, to inform it that     326      at the end of the Run, to inform it that the Run is finished
292      and therefore the histograms, ntuples, et    327      and therefore the histograms, ntuples, etc. must be closed.
293                                                   328 
294  --- G4UserEventAction (the derived, concrete     329  --- G4UserEventAction (the derived, concrete class is CCalEndOfEventAction):
295      it is used to examine, at the end of the     330      it is used to examine, at the end of the Event, all collected
296      (calorimeter) hits, extract the various o    331      (calorimeter) hits, extract the various observables which are
297      interesting (to the goal of understanding    332      interesting (to the goal of understanding things like: the effect
298      of magnetic field on scintiallator; choic    333      of magnetic field on scintiallator; choice of the absorber
299      thickness by optimizing resolution versus    334      thickness by optimizing resolution versus containment; impact of
300      the absorber depth in the energy caontain    335      the absorber depth in the energy caontainment; electromagnetic
301      calorimeter contribution in the electron     336      calorimeter contribution in the electron - pion separation; etc.)
302      and finally call the analysis object to s    337      and finally call the analysis object to store such selected
303      information on histograms and/or in the n    338      information on histograms and/or in the ntuple.
304      The name of the class "CCalEndOfEventActi    339      The name of the class "CCalEndOfEventAction" is motivated by the
305      fact that at the beginning of the Event n    340      fact that at the beginning of the Event nothing is done. 
306                                                   341 
307  --- G4UserSteppingAction (the derived, concre    342  --- G4UserSteppingAction (the derived, concrete class is CCalSteppingAction):
308      it is used to extract some "unphysical" i    343      it is used to extract some "unphysical" information (that is not
309      experimentally measurable, although inter    344      experimentally measurable, although interesting for a better 
310      understanding of the shower development),    345      understanding of the shower development), namely the lateral profile 
311      and the deposit as a function of the time    346      and the deposit as a function of the time (see "8.Analysis/Histogramming 
312      for more details"), which is available on    347      for more details"), which is available only from simulation, and then, 
313      at the end of Event, the analysis object     348      at the end of Event, the analysis object is invoked to store such
314      information on histograms.                   349      information on histograms.      
315      Please notice that the stepping action is    350      Please notice that the stepping action is not used to create hits.
316                                                   351 
317  --- G4UserStackingAction (the derived, concre    352  --- G4UserStackingAction (the derived, concrete class is CCalStackingAction):
318      it is used to ensure that the same track     353      it is used to ensure that the same track ID of the particle 
319      originating a shower appears in all hits     354      originating a shower appears in all hits (calorimeter hit objects 
320      of class CCalHit) of the shower, in any c    355      of class CCalHit) of the shower, in any calorimeter part. 
321                                                   356 
322                                                   357 
323 8. Analysis / Histogramming                       358 8. Analysis / Histogramming
324 ----------------------------                      359 ----------------------------
325                                                   360 
326  The analysis part of CompositeCalorimeter is     361  The analysis part of CompositeCalorimeter is kept in class CCalAnalysis,
327  and is based on the g4tool interfaces.        << 362  and is based on the AIDA interfaces and their implementation in PI.
                                                   >> 363  Please take a look to the web page:  http://www.cern.ch/PI .    
328  Both the histograms and the ntuple are saved     364  Both the histograms and the ntuple are saved at the end of the run in the 
329  ROOT file "ccal.root" (default: this can be c << 365  HBOOK file "ccal.his". You can than analyze offline the contents of such 
330  formats supported by the g4analysis tools).   << 366  a file, using Lizard (or any other AIDA-compliant package) or with 
331  Please note that in a multiple run session, t << 367  Paw or Root. Please note that in a multiple run session, the last run 
332  the output file.                              << 368  always override the HBOOK file.
333  What the histograms and the variables of the     369  What the histograms and the variables of the ntuple represent is 
334  explained below:                                 370  explained below:
335                                                   371  
336   Histograms  h100 - h127 : energy deposit (in << 372   Histograms  100 - 127 : energy deposit (in GeV) in the sensitive part
337                           (plastic scintillato    373                           (plastic scintillator layer) of one Hadronic 
338                           calorimeter module (    374                           calorimeter module (there are 28 modules, numbered
339                           from 0 to 27, and th    375                           from 0 to 27, and the corresponding histogram has
340                           ID = 100 + number of    376                           ID = 100 + number of module).
341   Ntuple variables  hcal0 - hcal27 : provide t    377   Ntuple variables  hcal0 - hcal27 : provide the same information.
342                                                   378 
343   Histograms  h200 - h248 : energy deposit (in << 379   Histograms  200 - 248 : energy deposit (in GeV) in one crystal
344                           electromagnetic towe    380                           electromagnetic towers (there are a matrix of
345                           7 x 7 = 49 towers, n    381                           7 x 7 = 49 towers, numbered from 0 to 48, and 
346                           the corresponding hi    382                           the corresponding histogram has 
347                           ID = 200 + number of    383                           ID = 200 + number of tower).
348   Ntuple variables  ecal0 - ecal48 : provide t    384   Ntuple variables  ecal0 - ecal48 : provide the same information.
349                                                   385   
350   Histograms  h300 - h339 : total energy depos << 386   Histograms  300 - 339 : total energy deposit (in GeV) in any 
351                           electromagnetic crys    387                           electromagnetic crystal tower or hadronic module 
352                           (either in a sensiti    388                           (either in a sensitive or insensitive layer)
353                           in one of the 40 nan    389                           in one of the 40 nanosecond time slices: in other
354                           words, histogram  30    390                           words, histogram  300+I , where I = 0 - 39,
355                           contains the total d    391                           contains the total deposit energy between
356                           I and I+1 nanosecond    392                           I and I+1 nanoseconds after the "collision".  
357                           (Notice that the tim    393                           (Notice that the time window considered, 
358                            40 nanoseconds, is     394                            40 nanoseconds, is larger than the LHC 
359                            bunch-crossing of 2    395                            bunch-crossing of 25 nanoseconds.)
360                                                   396   
361   Histograms  h400 - h469 : energy profile (in << 397   Histograms  400 - 469 : energy profile (in GeV), summed over all layers
362                           sensitive (plastic s    398                           sensitive (plastic scintillator) and insensitive
363                           (copper absorber), a    399                           (copper absorber), as a function of the radial
364                           distance (in centime    400                           distance (in centimeter) from the beam axis 
365                           ( ID histo = 400 + r    401                           ( ID histo = 400 + radial distance in cm ).
366                                                   402 
367   Histogram  h4000 : total energy deposit (in  << 403   Histogram  4000 : total energy deposit (in GeV) in the sensitive parts
368                     of either the electromagne    404                     of either the electromagnetic or hadronic calorimeters. 
369   Ntuple variable  edep provides the same info    405   Ntuple variable  edep provides the same information.
370                                                   406 
371   Other ntuple variables are the following:       407   Other ntuple variables are the following:  
372        ---  elab : energy (in GeV) of the inci    408        ---  elab : energy (in GeV) of the incident particle.
373        ---  xpos, ypos, zpos : position (in mm    409        ---  xpos, ypos, zpos : position (in mm) from where the projectile
374                                has been shot.     410                                has been shot.
375        ---  edec, edhc : total energy deposit     411        ---  edec, edhc : total energy deposit (in GeV) in the sensitive
376                          parts of, respectivel    412                          parts of, respectively, the electromagnetic 
377                          and hadronic calorime    413                          and hadronic calorimeters. Notice that their
378                          sum  edec+edhc  coinc    414                          sum  edec+edhc  coincides with  edep
379                                                   415 
380   Notice that lateral profile (400-469) and ti    416   Notice that lateral profile (400-469) and time-slice (300-339) 
381   histograms show purely Monte Carlo quantitie    417   histograms show purely Monte Carlo quantities, which cannot be 
382   experimentally measured.                        418   experimentally measured. 
383   Please be careful that the range of the hist    419   Please be careful that the range of the histograms has been chosen
384   in such a way to contain most of the entries    420   in such a way to contain most of the entries, but only few histograms
385   fill a large fraction of that range, whereas    421   fill a large fraction of that range, whereas the remaining majority
386   fill only the first few bins (corresponding     422   fill only the first few bins (corresponding to lower energy), and,
387   therefore, when plotted they look almost emp    423   therefore, when plotted they look almost empty, but they are not,
388   and the results are sensible. We suggest to     424   and the results are sensible. We suggest to plot the ntuple's variables,
389   rather than the histograms, when the same in    425   rather than the histograms, when the same information is available
390   from the ntuple.                                426   from the ntuple.
391                                                   427 
392                                                   428 
393 9. Visualization / GUI                            429 9. Visualization / GUI
394 -----------------------                           430 -----------------------
395                                                   431   
396  If you setup one of the following Geant4 envi    432  If you setup one of the following Geant4 environmental variables:
397     G4VIS_USE_DAWN                                433     G4VIS_USE_DAWN
398     G4VIS_USE_VRML                                434     G4VIS_USE_VRML
399     G4VIS_USE_OPENGLX                             435     G4VIS_USE_OPENGLX
400  which correspond to the use of DAWN, VRML, an    436  which correspond to the use of DAWN, VRML, and OPENGLX, respectively, 
401  as visualization engine of Geant4, and set pr    437  as visualization engine of Geant4, and set properly the corresponding 
402   PATH  as well, it is then possible to visual    438   PATH  as well, it is then possible to visualize the detector and also 
403  some events.                                     439  some events. 
404  To do so, you have to run                        440  To do so, you have to run 
405      >  ./CompositeCalorimeter                 << 441      >  $G4WORKDIR/bin/$G4SYSTEM/CompositeCalorimeter
406  without input file: you then see the detector    442  without input file: you then see the detector; after that,
407  you can select the particle gun and its energ    443  you can select the particle gun and its energy, in the
408  case you want something different from the th    444  case you want something different from the the default 
409  (which is a 100 GeV pi-), for example:           445  (which is a 100 GeV pi-), for example:
410      Idle> /gun/particle e-                       446      Idle> /gun/particle e-
411      Idle> /gun/energy 200 GeV                    447      Idle> /gun/energy 200 GeV
412  and then run some events, for example:           448  and then run some events, for example:
413      Idle> /run/beamOn 3                          449      Idle> /run/beamOn 3
414                                                   450 
                                                   >> 451  Notice that, by default, OGLIX is used for the visualization,
                                                   >> 452  because it is quite fast and it does not produce any files in
                                                   >> 453  output. However, you can always choose something else, for example
                                                   >> 454  VRML2FILE or DAWNFILE, either interactively as follows:
                                                   >> 455     Idle> /vis/open DAWNFILE
                                                   >> 456  or by changing the default, by editing the file (main program)
                                                   >> 457  CompositeCalorimeter.cc and comment/uncomment the lines
                                                   >> 458  in such a way to have, at the end:
                                                   >> 459     visCommand = "/vis/open DAWNFILE";
                                                   >> 460     // visCommand = "/vis/open VRML2FILE";
                                                   >> 461     // visCommand = "/vis/open OGLIX";
                                                   >> 462 
415  The tracks that are shown include both charge    463  The tracks that are shown include both charged and neutral particles 
416  of any momentum: if you want instead only cha    464  of any momentum: if you want instead only charged, or only neutral, 
417  then you have simply to edit  src/CCalEndOfEv    465  then you have simply to edit  src/CCalEndOfEventAction.cc 
418  at the end of the method  EndOfEventAction  a    466  at the end of the method  EndOfEventAction  and uncomment the line 
419  where the condition on the charge is made (it    467  where the condition on the charge is made (it should then be 
420  straighforward to eventual add some other con    468  straighforward to eventual add some other conditions, for example 
421  if you want to see only those particles that     469  if you want to see only those particles that satisfy certain 
422  kinematic conditions).                           470  kinematic conditions). 
423                                                   471  
424  Rather than to specify "by hand" the type of     472  Rather than to specify "by hand" the type of particle gun,
425  its energy, and the number of events, it is p    473  its energy, and the number of events, it is possible to have
426  a very simple GUI (graphical user interface)     474  a very simple GUI (graphical user interface) from which to make 
427  such choices, between a limited set of possib    475  such choices, between a limited set of possibilities, via menus.
428  Such GUI is based on Motif XmCommand widget,     476  Such GUI is based on Motif XmCommand widget, but it would be 
429  straightforward, eventually, to make the nece    477  straightforward, eventually, to make the necessary changes 
430  in order to use a different one.                 478  in order to use a different one.
431  The only thing you need to do to get the GUI     479  The only thing you need to do to get the GUI is to setup 
432  the following Geant4 environmental variables:    480  the following Geant4 environmental variables:  
433    G4UI_BUILD_XM_SESSION=1                        481    G4UI_BUILD_XM_SESSION=1
434    G4UI_USE_XM=1                                  482    G4UI_USE_XM=1
435  Then, if you run the executable without speci    483  Then, if you run the executable without specifying a macro file
436  (like test.g4mac):                               484  (like test.g4mac):
437      >  $G4WORKDIR/bin/$G4SYSTEM/CompositeCalo    485      >  $G4WORKDIR/bin/$G4SYSTEM/CompositeCalorimeter
438  a window automatically pops out, with the men    486  a window automatically pops out, with the menus where you
439  can make your selection of particle type, ene    487  can make your selection of particle type, energy, and number 
440  of events to be run.                             488  of events to be run. 
441                                                   489 
442                                                   490 
443 10. Classes Overview                              491 10. Classes Overview
444 ---------------------                             492 ---------------------
445                                                   493 
446  This is a schematic overview of the classes d    494  This is a schematic overview of the classes defined in this example:
447                                                   495 
448   CCalPrimaryGeneratorAction                      496   CCalPrimaryGeneratorAction
449   CCalPrimaryGeneratorMessenger                   497   CCalPrimaryGeneratorMessenger
450   User action for primaries generator.            498   User action for primaries generator.   
451                                                   499 
452   CCalDetectorConstruction                        500   CCalDetectorConstruction
453   CCalAMaterial                                   501   CCalAMaterial
454   CCalDataSet                                     502   CCalDataSet
455   CCalDetector                                    503   CCalDetector
456   CCalEcal                                        504   CCalEcal
457   CCalEcalOrganization                            505   CCalEcalOrganization
458   CCalG4Able                                      506   CCalG4Able
459   CCalG4Ecal                                      507   CCalG4Ecal
460   CCalG4Hall                                      508   CCalG4Hall
461   CCalG4Hcal                                      509   CCalG4Hcal
462   CCalGeometryConfiguration                       510   CCalGeometryConfiguration
463   CCalHall                                        511   CCalHall
464   CCalHcal                                        512   CCalHcal
465   CCalHcalOrganization                            513   CCalHcalOrganization
466   CCalMagneticField                               514   CCalMagneticField
467   CCalMaterial                                    515   CCalMaterial
468   CCalMaterialFactory                             516   CCalMaterialFactory
469   CCalRotationMatrixFactory                       517   CCalRotationMatrixFactory
470   CCalVOrganization                               518   CCalVOrganization
471   CCalVisManager                                  519   CCalVisManager
472   CCalVisualisable                                520   CCalVisualisable
473   CCaloOrganization                               521   CCaloOrganization
474   CCalutils                                       522   CCalutils
475   Geometry and material definitions for the de    523   Geometry and material definitions for the detector.
476         Notice in particular that:                524         Notice in particular that:
477           CCalHall, CCalEcal, CCalHcal derive     525           CCalHall, CCalEcal, CCalHcal derive from CCalDetector;
478           CCalG4Hall, CCalG4Ecal, CCalG4Hcal d    526           CCalG4Hall, CCalG4Ecal, CCalG4Hcal derive from the above 
479              corresponding classes and from CC    527              corresponding classes and from CCalG4Able;
480           CCalEcalOrganization, CCalHcalOrgani    528           CCalEcalOrganization, CCalHcalOrganization derive from
481              CCalVOrganization : each sensitiv    529              CCalVOrganization : each sensitive cell has an unique
482              number for detector organization     530              number for detector organization (this is a software
483              ID not an hardware/electronic one    531              ID not an hardware/electronic one).
484                                                   532   
485   CCalHit                                         533   CCalHit
486   CCalG4Hit                                       534   CCalG4Hit
487   CCalG4HitCollection                             535   CCalG4HitCollection
488   CCalSDList                                      536   CCalSDList
489   CCalSensAssign                                  537   CCalSensAssign
490   CCalSensitiveConfiguration                      538   CCalSensitiveConfiguration
491   CCalSensitiveDetectors                          539   CCalSensitiveDetectors
492   CCaloSD                                         540   CCaloSD
493         Hit and Sensitive Detectors.              541         Hit and Sensitive Detectors. 
494         Notice in particular that:                542         Notice in particular that:
495           CCalG4Hit derives from G4VHit and CC    543           CCalG4Hit derives from G4VHit and CCalHit;
496           CCaloSD derives from G4VSensitiveDet    544           CCaloSD derives from G4VSensitiveDetector.          
497                                                   545 
498   CCalActionInitializer                        << 
499         User-action initialization.            << 
500                                                << 
501   CCalAnalysis                                    546   CCalAnalysis
502   Analysis manager class.                      << 547   Analysis manager class which uses Anaphe.
503                                                   548 
504   CCalRunAction                                   549   CCalRunAction
505   User run action class.                          550   User run action class.
506                                                   551 
507   CCalEndOfEventAction                            552   CCalEndOfEventAction
508   User event action class.                        553   User event action class.
509                                                   554 
510   CCalStackingAction                              555   CCalStackingAction
511         User Stacking action class.               556         User Stacking action class.
512                                                   557 
513   CCalSteppingAction                              558   CCalSteppingAction
514         User Stepping action class.               559         User Stepping action class.
515                                                   560