source: trunk/examples/extended/analysis/AnaEx01/include/AnaEx01DetectorConstruction.hh @ 1320

Last change on this file since 1320 was 1230, checked in by garnier, 15 years ago

update to geant4.9.3

File size: 6.0 KB
Line 
1//
2// ********************************************************************
3// * License and Disclaimer                                           *
4// *                                                                  *
5// * The  Geant4 software  is  copyright of the Copyright Holders  of *
6// * the Geant4 Collaboration.  It is provided  under  the terms  and *
7// * conditions of the Geant4 Software License,  included in the file *
8// * LICENSE and available at  http://cern.ch/geant4/license .  These *
9// * include a list of copyright holders.                             *
10// *                                                                  *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work  make  any representation or  warranty, express or implied, *
14// * regarding  this  software system or assume any liability for its *
15// * use.  Please see the license in the file  LICENSE  and URL above *
16// * for the full disclaimer and the limitation of liability.         *
17// *                                                                  *
18// * This  code  implementation is the result of  the  scientific and *
19// * technical work of the GEANT4 collaboration.                      *
20// * By using,  copying,  modifying or  distributing the software (or *
21// * any work based  on the software)  you  agree  to acknowledge its *
22// * use  in  resulting  scientific  publications,  and indicate your *
23// * acceptance of all terms of the Geant4 Software license.          *
24// ********************************************************************
25//
26//
27// $Id: AnaEx01DetectorConstruction.hh,v 1.4 2006/06/29 16:33:22 gunter Exp $
28// GEANT4 tag $Name: geant4-09-03-cand-01 $
29//
30//
31
32//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
33//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
34
35#ifndef AnaEx01DetectorConstruction_h
36#define AnaEx01DetectorConstruction_h 1
37
38#include "G4VUserDetectorConstruction.hh"
39#include "globals.hh"
40
41class G4Box;
42class G4LogicalVolume;
43class G4VPhysicalVolume;
44class G4Material;
45class G4UniformMagField;
46class AnaEx01DetectorMessenger;
47class AnaEx01CalorimeterSD;
48
49//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
50
51class AnaEx01DetectorConstruction : public G4VUserDetectorConstruction
52{
53  public:
54 
55    AnaEx01DetectorConstruction();
56   ~AnaEx01DetectorConstruction();
57
58  public:
59     
60     void SetAbsorberMaterial (G4String);     
61     void SetAbsorberThickness(G4double);     
62
63     void SetGapMaterial (G4String);     
64     void SetGapThickness(G4double);
65     
66     void SetCalorSizeYZ(G4double);         
67     void SetNbOfLayers (G4int);   
68     
69     void SetMagField(G4double);
70     
71     G4VPhysicalVolume* Construct();
72
73     void UpdateGeometry();
74     
75  public:
76 
77     void PrintCalorParameters(); 
78                   
79     G4double GetWorldSizeX()           {return WorldSizeX;}; 
80     G4double GetWorldSizeYZ()          {return WorldSizeYZ;};
81     
82     G4double GetCalorThickness()       {return CalorThickness;}; 
83     G4double GetCalorSizeYZ()          {return CalorSizeYZ;};
84     
85     G4int GetNbOfLayers()              {return NbOfLayers;}; 
86     
87     G4Material* GetAbsorberMaterial()  {return AbsorberMaterial;};
88     G4double    GetAbsorberThickness() {return AbsorberThickness;};     
89     
90     G4Material* GetGapMaterial()       {return GapMaterial;};
91     G4double    GetGapThickness()      {return GapThickness;};
92     
93     const G4VPhysicalVolume* GetphysiWorld() {return physiWorld;};           
94     const G4VPhysicalVolume* GetAbsorber()   {return physiAbsorber;};
95     const G4VPhysicalVolume* GetGap()        {return physiGap;};
96                 
97  private:
98     
99     G4Material*        AbsorberMaterial;
100     G4double           AbsorberThickness;
101     
102     G4Material*        GapMaterial;
103     G4double           GapThickness;
104     
105     G4int              NbOfLayers;
106     G4double           LayerThickness;
107         
108     G4double           CalorSizeYZ;
109     G4double           CalorThickness;
110     
111     G4Material*        defaultMaterial;
112     G4double           WorldSizeYZ;
113     G4double           WorldSizeX;
114           
115     G4Box*             solidWorld;    //pointer to the solid World
116     G4LogicalVolume*   logicWorld;    //pointer to the logical World
117     G4VPhysicalVolume* physiWorld;    //pointer to the physical World
118
119     G4Box*             solidCalor;    //pointer to the solid Calor
120     G4LogicalVolume*   logicCalor;    //pointer to the logical Calor
121     G4VPhysicalVolume* physiCalor;    //pointer to the physical Calor
122     
123     G4Box*             solidLayer;    //pointer to the solid Layer
124     G4LogicalVolume*   logicLayer;    //pointer to the logical Layer
125     G4VPhysicalVolume* physiLayer;    //pointer to the physical Layer
126         
127     G4Box*             solidAbsorber; //pointer to the solid Absorber
128     G4LogicalVolume*   logicAbsorber; //pointer to the logical Absorber
129     G4VPhysicalVolume* physiAbsorber; //pointer to the physical Absorber
130     
131     G4Box*             solidGap;      //pointer to the solid Gap
132     G4LogicalVolume*   logicGap;      //pointer to the logical Gap
133     G4VPhysicalVolume* physiGap;      //pointer to the physical Gap
134     
135     G4UniformMagField* magField;      //pointer to the magnetic field
136     
137     AnaEx01DetectorMessenger* detectorMessenger;  //pointer to the Messenger
138     AnaEx01CalorimeterSD* calorimeterSD;  //pointer to the sensitive detector
139     
140  private:
141   
142     void DefineMaterials();
143     void ComputeCalorParameters();
144     G4VPhysicalVolume* ConstructCalorimeter();     
145};
146
147//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
148
149inline void AnaEx01DetectorConstruction::ComputeCalorParameters()
150{
151  // Compute derived parameters of the calorimeter
152     LayerThickness = AbsorberThickness + GapThickness;
153     CalorThickness = NbOfLayers*LayerThickness;
154     
155     WorldSizeX = 1.2*CalorThickness; WorldSizeYZ = 1.2*CalorSizeYZ;
156}
157
158#endif
159
Note: See TracBrowser for help on using the repository browser.