Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/examples/extended/persistency/P01/src/ExP01DetectorConstruction.cc

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/extended/persistency/P01/src/ExP01DetectorConstruction.cc (Version 11.3.0) and /examples/extended/persistency/P01/src/ExP01DetectorConstruction.cc (Version 11.2)


  1 //                                                  1 //
  2 // *******************************************      2 // ********************************************************************
  3 // * License and Disclaimer                         3 // * License and Disclaimer                                           *
  4 // *                                                4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of th      5 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
  6 // * the Geant4 Collaboration.  It is provided      6 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
  7 // * conditions of the Geant4 Software License      7 // * conditions of the Geant4 Software License,  included in the file *
  8 // * LICENSE and available at  http://cern.ch/      8 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
  9 // * include a list of copyright holders.           9 // * include a list of copyright holders.                             *
 10 // *                                               10 // *                                                                  *
 11 // * Neither the authors of this software syst     11 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing fin     12 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warran     13 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assum     14 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file      15 // * use.  Please see the license in the file  LICENSE  and URL above *
 16 // * for the full disclaimer and the limitatio     16 // * for the full disclaimer and the limitation of liability.         *
 17 // *                                               17 // *                                                                  *
 18 // * This  code  implementation is the result      18 // * This  code  implementation is the result of  the  scientific and *
 19 // * technical work of the GEANT4 collaboratio     19 // * technical work of the GEANT4 collaboration.                      *
 20 // * By using,  copying,  modifying or  distri     20 // * By using,  copying,  modifying or  distributing the software (or *
 21 // * any work based  on the software)  you  ag     21 // * any work based  on the software)  you  agree  to acknowledge its *
 22 // * use  in  resulting  scientific  publicati     22 // * use  in  resulting  scientific  publications,  and indicate your *
 23 // * acceptance of all terms of the Geant4 Sof     23 // * acceptance of all terms of the Geant4 Software license.          *
 24 // *******************************************     24 // ********************************************************************
 25 //                                                 25 //
 26 /// \file persistency/P01/src/ExP01DetectorCon     26 /// \file persistency/P01/src/ExP01DetectorConstruction.cc
 27 /// \brief Implementation of the ExP01Detector     27 /// \brief Implementation of the ExP01DetectorConstruction class
 28 //                                                 28 //
 29 //                                                 29 //
 30 //                                                 30 //
                                                   >>  31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 
 31 //....oooOO0OOooo........oooOO0OOooo........oo     32 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 32 //....oooOO0OOooo........oooOO0OOooo........oo <<  33  
 33                                                << 
 34 #include "ExP01DetectorConstruction.hh"            34 #include "ExP01DetectorConstruction.hh"
 35                                                << 
 36 #include "ExP01ChamberParameterisation.hh"     << 
 37 #include "ExP01DetectorMessenger.hh"               35 #include "ExP01DetectorMessenger.hh"
                                                   >>  36 #include "ExP01ChamberParameterisation.hh"
 38 #include "ExP01MagneticField.hh"                   37 #include "ExP01MagneticField.hh"
 39 #include "ExP01TrackerSD.hh"                       38 #include "ExP01TrackerSD.hh"
 40                                                    39 
                                                   >>  40 #include "G4Material.hh"
 41 #include "G4Box.hh"                                41 #include "G4Box.hh"
 42 #include "G4Colour.hh"                         << 
 43 #include "G4LogicalVolume.hh"                      42 #include "G4LogicalVolume.hh"
 44 #include "G4Material.hh"                       << 
 45 #include "G4PVParameterised.hh"                << 
 46 #include "G4PVPlacement.hh"                        43 #include "G4PVPlacement.hh"
                                                   >>  44 #include "G4PVParameterised.hh"
 47 #include "G4SDManager.hh"                          45 #include "G4SDManager.hh"
 48 #include "G4SystemOfUnits.hh"                  <<  46 
 49 #include "G4UserLimits.hh"                         47 #include "G4UserLimits.hh"
                                                   >>  48 
 50 #include "G4VisAttributes.hh"                      49 #include "G4VisAttributes.hh"
                                                   >>  50 #include "G4Colour.hh"
                                                   >>  51 
                                                   >>  52 #include "G4SystemOfUnits.hh"
 51 #include "G4ios.hh"                                53 #include "G4ios.hh"
 52                                                    54 
 53 //....oooOO0OOooo........oooOO0OOooo........oo     55 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 54                                                <<  56  
 55 ExP01DetectorConstruction::ExP01DetectorConstr     57 ExP01DetectorConstruction::ExP01DetectorConstruction()
 56   : G4VUserDetectorConstruction(),             <<  58 :G4VUserDetectorConstruction(),
 57     fSolidWorld(0),                            <<  59  fSolidWorld(0), fLogicWorld(0), fPhysiWorld(0),
 58     fLogicWorld(0),                            <<  60  fSolidTarget(0), fLogicTarget(0), fPhysiTarget(0), 
 59     fPhysiWorld(0),                            <<  61  fSolidTracker(0), fLogicTracker(0), fPhysiTracker(0), 
 60     fSolidTarget(0),                           <<  62  fSolidChamber(0), fLogicChamber(0), fPhysiChamber(0), 
 61     fLogicTarget(0),                           <<  63  fTargetMater(0), fChamberMater(0), fPMagField(0), fDetectorMessenger(0),
 62     fPhysiTarget(0),                           <<  64  fWorldLength(0.), fTargetLength(0.), fTrackerLength(0.),
 63     fSolidTracker(0),                          <<  65  fNbOfChambers(0), fChamberWidth(0.), fChamberSpacing(0.)
 64     fLogicTracker(0),                          << 
 65     fPhysiTracker(0),                          << 
 66     fSolidChamber(0),                          << 
 67     fLogicChamber(0),                          << 
 68     fPhysiChamber(0),                          << 
 69     fTargetMater(0),                           << 
 70     fChamberMater(0),                          << 
 71     fPMagField(0),                             << 
 72     fDetectorMessenger(0),                     << 
 73     fWorldLength(0.),                          << 
 74     fTargetLength(0.),                         << 
 75     fTrackerLength(0.),                        << 
 76     fNbOfChambers(0),                          << 
 77     fChamberWidth(0.),                         << 
 78     fChamberSpacing(0.)                        << 
 79 {                                                  66 {
 80   fPMagField = new ExP01MagneticField();           67   fPMagField = new ExP01MagneticField();
 81   fDetectorMessenger = new ExP01DetectorMessen     68   fDetectorMessenger = new ExP01DetectorMessenger(this);
 82 }                                                  69 }
 83                                                    70 
 84 //....oooOO0OOooo........oooOO0OOooo........oo     71 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 85                                                <<  72  
 86 ExP01DetectorConstruction::~ExP01DetectorConst     73 ExP01DetectorConstruction::~ExP01DetectorConstruction()
 87 {                                                  74 {
 88   delete fPMagField;                               75   delete fPMagField;
 89   delete fDetectorMessenger;                   <<  76   delete fDetectorMessenger;             
 90 }                                                  77 }
 91                                                    78 
 92 //....oooOO0OOooo........oooOO0OOooo........oo     79 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 93                                                <<  80  
 94 G4VPhysicalVolume* ExP01DetectorConstruction::     81 G4VPhysicalVolume* ExP01DetectorConstruction::Construct()
 95 {                                                  82 {
 96   //--------- Material definition ---------    <<  83 //--------- Material definition ---------
 97                                                    84 
 98   G4double a, z;                                   85   G4double a, z;
 99   G4double density, temperature, pressure;         86   G4double density, temperature, pressure;
100   G4int nel;                                       87   G4int nel;
101                                                    88 
102   // Air                                       <<  89   //Air
103   G4Element* N = new G4Element("Nitrogen", "N" <<  90   G4Element* N = new G4Element("Nitrogen", "N", z=7., a= 14.01*g/mole);
104   G4Element* O = new G4Element("Oxygen", "O",  <<  91   G4Element* O = new G4Element("Oxygen"  , "O", z=8., a= 16.00*g/mole);
105                                                <<  92    
106   G4Material* Air = new G4Material("Air", dens <<  93   G4Material* Air = new G4Material("Air", density= 1.29*mg/cm3, nel=2);
107   Air->AddElement(N, 70 * perCent);            <<  94   Air->AddElement(N, 70*perCent);
108   Air->AddElement(O, 30 * perCent);            <<  95   Air->AddElement(O, 30*perCent);
109                                                <<  96 
110   // Lead                                      <<  97   //Lead
111   G4Material* Pb =                             <<  98   G4Material* Pb = 
112     new G4Material("Lead", z = 82., a = 207.19 <<  99   new G4Material("Lead", z=82., a= 207.19*g/mole, density= 11.35*g/cm3);
113                                                << 100     
114   // Xenon gas                                 << 101   //Xenon gas
115   G4Material* Xenon =                          << 102   G4Material* Xenon = 
116     new G4Material("XenonGas", z = 54., a = 13 << 103   new G4Material("XenonGas", z=54., a=131.29*g/mole, density= 5.458*mg/cm3,
117                    kStateGas, temperature = 29 << 104    kStateGas, temperature= 293.15*kelvin, pressure= 1*atmosphere);
118                                                   105 
119   // Print all the materials defined.             106   // Print all the materials defined.
120   //                                              107   //
121   G4cout << G4endl << "The materials defined a    108   G4cout << G4endl << "The materials defined are : " << G4endl << G4endl;
122   G4cout << *(G4Material::GetMaterialTable())     109   G4cout << *(G4Material::GetMaterialTable()) << G4endl;
123                                                   110 
124   //--------- Sizes of the principal geometric << 111 //--------- Sizes of the principal geometrical components (solids)  ---------
125                                                << 112   
126   fNbOfChambers = 5;                              113   fNbOfChambers = 5;
127   fChamberWidth = 20 * cm;                     << 114   fChamberWidth = 20*cm;
128   fChamberSpacing = 80 * cm;                   << 115   fChamberSpacing = 80*cm;
129                                                << 116   
130   fTrackerLength = (fNbOfChambers + 1) * fCham << 117   fTrackerLength = (fNbOfChambers+1)*fChamberSpacing; // Full length of Tracker
131   fTargetLength = 5.0 * cm;  // Full length of << 118   fTargetLength  = 5.0 * cm;                        // Full length of Target
132                                                << 119   
133   fTargetMater = Pb;                           << 120   fTargetMater  = Pb;
134   fChamberMater = Xenon;                          121   fChamberMater = Xenon;
135                                                << 122   
136   fWorldLength = 1.2 * (fTargetLength + fTrack << 123   fWorldLength= 1.2 *(fTargetLength+fTrackerLength);
137                                                << 124    
138   G4double targetSize = 0.5 * fTargetLength;   << 125   G4double targetSize  = 0.5*fTargetLength;    // Half length of the Target  
139   G4double trackerSize = 0.5 * fTrackerLength; << 126   G4double trackerSize = 0.5*fTrackerLength;   // Half length of the Tracker
140                                                << 127       
141   //--------- Definitions of Solids, Logical V << 128 //--------- Definitions of Solids, Logical Volumes, Physical Volumes ---------
142                                                << 129   
143   //------------------------------             << 130   //------------------------------ 
144   // World                                        131   // World
145   //------------------------------             << 132   //------------------------------ 
146                                                << 
147   G4double HalfWorldLength = 0.5 * fWorldLengt << 
148                                                << 
149   fSolidWorld = new G4Box("world", HalfWorldLe << 
150   fLogicWorld = new G4LogicalVolume(fSolidWorl << 
151                                                   133 
                                                   >> 134   G4double HalfWorldLength = 0.5*fWorldLength;
                                                   >> 135   
                                                   >> 136  fSolidWorld= new G4Box("world",HalfWorldLength,HalfWorldLength,HalfWorldLength);
                                                   >> 137  fLogicWorld= new G4LogicalVolume( fSolidWorld, Air, "World", 0, 0, 0);
                                                   >> 138   
152   //  Must place the World Physical volume unr    139   //  Must place the World Physical volume unrotated at (0,0,0).
153   //                                           << 140   // 
154   fPhysiWorld = new G4PVPlacement(0,  // no ro << 141   fPhysiWorld = new G4PVPlacement(0,               // no rotation
155                                   G4ThreeVecto << 142                                  G4ThreeVector(), // at (0,0,0)
156                                   fLogicWorld, << 143                                  fLogicWorld,      // its logical volume
157                                   "World",  // << 144                                  "World",         // its name
158                                   0,  // its m << 145                                  0,               // its mother  volume
159                                   false,  // n << 146                                  false,           // no boolean operations
160                                   0);  // copy << 147                                  0);              // copy number
161                                                << 148                                  
162   //------------------------------             << 149   //------------------------------ 
163   // Target                                       150   // Target
164   //------------------------------                151   //------------------------------
                                                   >> 152   
                                                   >> 153   G4ThreeVector positionTarget = G4ThreeVector(0,0,-(targetSize+trackerSize));
                                                   >> 154    
                                                   >> 155   fSolidTarget = new G4Box("target",targetSize,targetSize,targetSize);
                                                   >> 156   fLogicTarget = new G4LogicalVolume(fSolidTarget,fTargetMater,"Target",0,0,0);
                                                   >> 157   fPhysiTarget = new G4PVPlacement(0,               // no rotation
                                                   >> 158                                   positionTarget,  // at (x,y,z)
                                                   >> 159                                   fLogicTarget,     // its logical volume
                                                   >> 160                                   "Target",        // its name
                                                   >> 161                                   fLogicWorld,      // its mother  volume
                                                   >> 162                                   false,           // no boolean operations
                                                   >> 163                                   0);              // copy number 
165                                                   164 
166   G4ThreeVector positionTarget = G4ThreeVector << 165   G4cout << "Target is " << fTargetLength/cm << " cm of " 
                                                   >> 166          << fTargetMater->GetName() << G4endl;
167                                                   167 
168   fSolidTarget = new G4Box("target", targetSiz << 168   //------------------------------ 
169   fLogicTarget = new G4LogicalVolume(fSolidTar << 
170   fPhysiTarget = new G4PVPlacement(0,  // no r << 
171                                    positionTar << 
172                                    fLogicTarge << 
173                                    "Target",   << 
174                                    fLogicWorld << 
175                                    false,  //  << 
176                                    0);  // cop << 
177                                                << 
178   G4cout << "Target is " << fTargetLength / cm << 
179                                                << 
180   //------------------------------             << 
181   // Tracker                                      169   // Tracker
182   //------------------------------                170   //------------------------------
                                                   >> 171   
                                                   >> 172   G4ThreeVector positionTracker = G4ThreeVector(0,0,0);
                                                   >> 173   
                                                   >> 174   fSolidTracker = new G4Box("tracker",trackerSize,trackerSize,trackerSize);
                                                   >> 175   fLogicTracker = new G4LogicalVolume(fSolidTracker , Air, "Tracker",0,0,0);  
                                                   >> 176   fPhysiTracker = new G4PVPlacement(0,              // no rotation
                                                   >> 177                                   positionTracker, // at (x,y,z)
                                                   >> 178                                   fLogicTracker,    // its logical volume
                                                   >> 179                                   "Tracker",       // its name
                                                   >> 180                                   fLogicWorld,      // its mother  volume
                                                   >> 181                                   false,           // no boolean operations
                                                   >> 182                                   0);              // copy number 
183                                                   183 
184   G4ThreeVector positionTracker = G4ThreeVecto << 184   //------------------------------ 
185                                                << 
186   fSolidTracker = new G4Box("tracker", tracker << 
187   fLogicTracker = new G4LogicalVolume(fSolidTr << 
188   fPhysiTracker = new G4PVPlacement(0,  // no  << 
189                                     positionTr << 
190                                     fLogicTrac << 
191                                     "Tracker", << 
192                                     fLogicWorl << 
193                                     false,  // << 
194                                     0);  // co << 
195                                                << 
196   //------------------------------             << 
197   // Tracker segments                             185   // Tracker segments
198   //------------------------------                186   //------------------------------
199   //                                           << 187   // 
200   // An example of Parameterised volumes          188   // An example of Parameterised volumes
201   // dummy values for G4Box -- modified by par    189   // dummy values for G4Box -- modified by parameterised volume
202                                                   190 
203   fSolidChamber = new G4Box("chamber", 100 * c << 191   fSolidChamber = new G4Box("chamber", 100*cm, 100*cm, 10*cm); 
204   fLogicChamber = new G4LogicalVolume(fSolidCh << 192   fLogicChamber = new G4LogicalVolume(fSolidChamber, fChamberMater,"Chamber",0,0,0);
205                                                << 193   
206   G4double firstPosition = -trackerSize + 0.5  << 194   G4double firstPosition = -trackerSize + 0.5*fChamberWidth;
207   G4double firstLength = fTrackerLength / 10;  << 195   G4double firstLength = fTrackerLength/10;
208   G4double lastLength = fTrackerLength;        << 196   G4double lastLength  = fTrackerLength;
209                                                << 197    
210   G4VPVParameterisation* chamberParam =        << 198   G4VPVParameterisation* chamberParam = new ExP01ChamberParameterisation(  
211     new ExP01ChamberParameterisation(fNbOfCham << 199                            fNbOfChambers,          // NoChambers 
212                                      firstPosi << 200                            firstPosition,         // Z of center of first 
213                                      fChamberS << 201                            fChamberSpacing,        // Z spacing of centers
214                                      fChamberW << 202                            fChamberWidth,          // Width Chamber 
215                                      firstLeng << 203                            firstLength,           // lengthInitial 
216                                      lastLengt << 204                            lastLength);           // lengthFinal
217                                                << 205                            
218   // dummy value : kZAxis -- modified by param    206   // dummy value : kZAxis -- modified by parameterised volume
219   //                                              207   //
220   fPhysiChamber = new G4PVParameterised("Chamb << 208   fPhysiChamber = new G4PVParameterised(
221                                         fLogic << 209                             "Chamber",       // their name
222                                         fLogic << 210                             fLogicChamber,    // their logical volume
223                                         kZAxis << 211                             fLogicTracker,    // Mother logical volume
224                                         fNbOfC << 212                             kZAxis,          // Are placed along this axis 
225                                         chambe << 213                             fNbOfChambers,    // Number of chambers
                                                   >> 214                             chamberParam);   // The parametrisation
226                                                   215 
227   G4cout << "There are " << fNbOfChambers << "    216   G4cout << "There are " << fNbOfChambers << " chambers in the tracker region. "
228          << "The chambers are " << fChamberWid << 217          << "The chambers are " << fChamberWidth/mm << " mm of " 
229          << "\n The distance between chamber i << 218          << fChamberMater->GetName() << "\n The distance between chamber is "
230                                                << 219          << fChamberSpacing/cm << " cm" << G4endl;
231   //------------------------------------------ << 220          
                                                   >> 221   //------------------------------------------------ 
232   // Sensitive detectors                          222   // Sensitive detectors
233   //------------------------------------------ << 223   //------------------------------------------------ 
234                                                   224 
235   G4SDManager* SDman = G4SDManager::GetSDMpoin    225   G4SDManager* SDman = G4SDManager::GetSDMpointer();
236                                                   226 
237   G4String trackerChamberSDname = "ExP01/Track    227   G4String trackerChamberSDname = "ExP01/TrackerChamberSD";
238   ExP01TrackerSD* aTrackerSD = new ExP01Tracke << 228   ExP01TrackerSD* aTrackerSD = new ExP01TrackerSD( trackerChamberSDname );
239   SDman->AddNewDetector(aTrackerSD);           << 229   SDman->AddNewDetector( aTrackerSD );
240   fLogicChamber->SetSensitiveDetector(aTracker << 230   fLogicChamber->SetSensitiveDetector( aTrackerSD );
241                                                << 231 
242   //--------- Visualization attributes ------- << 232 //--------- Visualization attributes -------------------------------
243                                                << 233 
244   G4VisAttributes* BoxVisAtt = new G4VisAttrib << 234   G4VisAttributes* BoxVisAtt= new G4VisAttributes(G4Colour(1.0,1.0,1.0));
245   fLogicWorld->SetVisAttributes(BoxVisAtt);    << 235   fLogicWorld  ->SetVisAttributes(BoxVisAtt);  
246   fLogicTarget->SetVisAttributes(BoxVisAtt);   << 236   fLogicTarget ->SetVisAttributes(BoxVisAtt);
247   fLogicTracker->SetVisAttributes(BoxVisAtt);     237   fLogicTracker->SetVisAttributes(BoxVisAtt);
248                                                << 238   
249   G4VisAttributes* ChamberVisAtt = new G4VisAt << 239   G4VisAttributes* ChamberVisAtt = new G4VisAttributes(G4Colour(1.0,1.0,0.0));
250   fLogicChamber->SetVisAttributes(ChamberVisAt    240   fLogicChamber->SetVisAttributes(ChamberVisAtt);
251                                                << 241   
252   //--------- example of User Limits --------- << 242 //--------- example of User Limits -------------------------------
253                                                   243 
254   // below is an example of how to set trackin    244   // below is an example of how to set tracking constraints in a given
255   // logical volume(see also in N02PhysicsList    245   // logical volume(see also in N02PhysicsList how to setup the processes
256   // G4StepLimiter or G4UserSpecialCuts).         246   // G4StepLimiter or G4UserSpecialCuts).
257                                                << 247     
258   // Sets a max Step length in the tracker reg    248   // Sets a max Step length in the tracker region, with G4StepLimiter
259   //                                              249   //
260   G4double maxStep = 0.5 * fChamberWidth;      << 250   G4double maxStep = 0.5*fChamberWidth; 
261   fLogicTracker->SetUserLimits(new G4UserLimit    251   fLogicTracker->SetUserLimits(new G4UserLimits(maxStep));
262                                                << 252   
263   // Set additional contraints on the track, w    253   // Set additional contraints on the track, with G4UserSpecialCuts
264   //                                              254   //
265   // G4double maxLength = 2*fTrackerLength, ma    255   // G4double maxLength = 2*fTrackerLength, maxTime = 0.1*ns, minEkin = 10*MeV;
266   // logicTracker->SetUserLimits(new G4UserLim    256   // logicTracker->SetUserLimits(new G4UserLimits(maxStep,maxLength,maxTime,
267   //                                              257   //                                               minEkin));
268                                                << 258   
269   return fPhysiWorld;                             259   return fPhysiWorld;
270 }                                                 260 }
271                                                   261 
272 //....oooOO0OOooo........oooOO0OOooo........oo    262 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
273                                                << 263  
274 void ExP01DetectorConstruction::SetTargetMater    264 void ExP01DetectorConstruction::SetTargetMaterial(G4String materialName)
275 {                                                 265 {
276   // search the material by its name           << 266   // search the material by its name 
277   G4Material* pttoMaterial = G4Material::GetMa << 267   G4Material* pttoMaterial = G4Material::GetMaterial(materialName);  
278   if (pttoMaterial) {                          << 268   if (pttoMaterial)
279     fTargetMater = pttoMaterial;               << 269      {fTargetMater = pttoMaterial;
280     fLogicTarget->SetMaterial(pttoMaterial);   << 270       fLogicTarget->SetMaterial(pttoMaterial); 
281     G4cout << "\n----> The target is " << fTar << 271       G4cout << "\n----> The target is " << fTargetLength/cm << " cm of "
282   }                                            << 272              << materialName << G4endl;
                                                   >> 273      }             
283 }                                                 274 }
284                                                << 275  
285 //....oooOO0OOooo........oooOO0OOooo........oo    276 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
286                                                   277 
287 void ExP01DetectorConstruction::SetChamberMate    278 void ExP01DetectorConstruction::SetChamberMaterial(G4String materialName)
288 {                                                 279 {
289   // search the material by its name           << 280   // search the material by its name 
290   G4Material* pttoMaterial = G4Material::GetMa << 281   G4Material* pttoMaterial = G4Material::GetMaterial(materialName);  
291   if (pttoMaterial) {                          << 282   if (pttoMaterial)
292     fChamberMater = pttoMaterial;              << 283      {fChamberMater = pttoMaterial;
293     fLogicChamber->SetMaterial(pttoMaterial);  << 284       fLogicChamber->SetMaterial(pttoMaterial); 
294     G4cout << "\n----> The chambers are " << f << 285       G4cout << "\n----> The chambers are " << fChamberWidth/cm << " cm of "
295            << G4endl;                          << 286              << materialName << G4endl;
296   }                                            << 287      }             
297 }                                                 288 }
298                                                << 289  
299 //....oooOO0OOooo........oooOO0OOooo........oo    290 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
300                                                << 291  
301 void ExP01DetectorConstruction::SetMagField(G4    292 void ExP01DetectorConstruction::SetMagField(G4double fieldValue)
302 {                                                 293 {
303   fPMagField->SetFieldValue(fieldValue);          294   fPMagField->SetFieldValue(fieldValue);
304 }                                                 295 }
305                                                   296 
306 //....oooOO0OOooo........oooOO0OOooo........oo    297 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
307                                                   298