Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
FCALEMModule.cc
이 파일의 문서화 페이지로 가기
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 // Author: Rachid Mazini
27 // Rachid.Mazini@cern.ch
28 // Language: C++
29 // Tested on : g++ (egcs.2.1.1, RH6.1)
30 // Prerequisites: None
31 // Purpose: Source file defining the geometry of EMModule 0 of the
32 // FCAL.
33 // Developped: 10-March-2000 R.M.
34 //
35 //
36 //-----------------------------------------------------------------------------
37 
38 #include <fstream>
39 #include <cstdlib>
40 
41 #include "FCALEMModule.hh"
42 
44 
45 #include "G4SDManager.hh"
46 #include "FCALEMModuleSD.hh"
47 
48 #include "G4PhysicalConstants.hh"
49 #include "G4SystemOfUnits.hh"
50 #include "G4Box.hh"
51 #include "G4Tubs.hh"
52 #include "G4LogicalVolume.hh"
53 #include "G4VPhysicalVolume.hh"
54 #include "G4PVPlacement.hh"
55 #include "G4SubtractionSolid.hh"
56 
57 #include "G4ThreeVector.hh"
58 #include "G4VisAttributes.hh"
59 #include "G4Colour.hh"
60 
62  FcalEmModuleSD(0)
63  {
64  F1LArGapID = new G4int[2400];
65  F1LArIX = new G4int[2400];
66  F1LArJY = new G4int[2400];
67  F1LArITile = new G4int[2400];
68  F1LArGapPosX = new G4double[2400];
69  F1LArGapPosY = new G4double[2400];
70 }
71 
72 
74  delete [] F1LArGapID;
75  delete [] F1LArGapPosX;
76  delete [] F1LArGapPosY;
77  delete [] F1LArIX;
78  delete [] F1LArJY;
79  delete [] F1LArITile;
80 }
81 
82 
84 #include "FCALEMModuleParameters.input"
85  std::ifstream File
86  ("geom_data/FCal1Electrodes.dat");
87 
88  if(!File) G4cerr << "Failed to open file FCal1Electrodes data file " << G4endl;
89  File.seekg(0);
90 
91  NF1LarGap = 0;
92  while(!(File.eof())) {
93  NF1LarGap++;
96  };
97  G4cout << "********" << " Number of Rods in FCAL1 : " << NF1LarGap-1 << G4endl;;
98 }
99 
100 
101 
103 {
104  //-----------------------------
105  // construction of materials
106  //-----------------------------
107  FCALMaterialConsultant *FCALMaterials =
109 
110  G4VisAttributes * ColorOfEMModule = new G4VisAttributes(G4Colour(1.,0.,0.5));
111 // G4VisAttributes * ColorOfLArg = new G4VisAttributes(G4Colour(0.,0.,1.));
112 
113  //----------------------------
114  // Read Parameters
115  //----------------------------
117 
118 //-----------------------------------------
119 // Logical to be returned (FCAL EM module)
120 //-----------------------------------------
121  G4Tubs * SolidEmModule =
122  new G4Tubs("EmModuleSold", EmModuleRMin, EmModuleRMax, EmModuleLenght,
124  G4LogicalVolume * LogicalEmModule =
125  new G4LogicalVolume(SolidEmModule, FCALMaterials->Material("Copper"),
126  "EmModuleLogical");
127 
128  LogicalEmModule->SetSmartless(FCALEmSmart);
129 
130  LogicalEmModule->SetVisAttributes(ColorOfEMModule);
131  // LogicalEmModule->SetVisAttributes(G4VisAttributes::GetInvisible());
132 
133 
134 //---------------------
135 // FCAL Cable Troff
136 //---------------------
137  G4Tubs * SolidF1CableTroff =
138  new G4Tubs("F1CableTroffSolid", F1CableTroffRMin, F1CableTroffRMax,
140  G4LogicalVolume * LogicalF1CableTroff =
141  new G4LogicalVolume(SolidF1CableTroff, FCALMaterials->Material("FCAL1CuArKap"),
142  "F1CableTroffLogical");
143 
144  G4ThreeVector F1CableTroffTrans(0.,0.,0.);
145  G4RotationMatrix F1CableTroffRot;
146 
147  G4int i=0;
148  for(i=0 ; i < NCableTroff ; i++)
149  {
150 // G4VPhysicalVolume * PhysicalF1CableTroff =
151  new G4PVPlacement(G4Transform3D(F1CableTroffRot,F1CableTroffTrans),
152  LogicalF1CableTroff,"F1CableTroffPhysical",
153  LogicalEmModule,0,i+1);
154 
155  F1CableTroffRot.rotateZ(F1CableTroffRotZ);
156  }
157 
158  LogicalF1CableTroff->SetVisAttributes(ColorOfEMModule);
159  // LogicalF1CableTroff->SetVisAttributes(G4VisAttributes::GetInvisible());
160 
161 
162  //----------------------
163  // LArg gaps
164  //----------------------
165 
166  G4Tubs * SolidF1LArGap =
167  new G4Tubs("F1LArGapSolid",F1LArGapRmin, F1LArGapRmax, F1LArGapLenght,
169 
170  G4LogicalVolume * LogicalF1LArGap =
171  new G4LogicalVolume(SolidF1LArGap, FCALMaterials->Material("LiquidArgon"),
172  "LArg Gap");
173 
174  for(i=1; i < NF1LarGap; i++){
175 // G4VPhysicalVolume * PhysicalF1LArGap =
177  LogicalF1LArGap,"F1LArGapPhysical", LogicalEmModule, 0, i);
178  };
179 
180  // LogicalF1LArGap->SetVisAttributes(ColorOfLArg);
182 
183 
184  // Sensitive Volumes
186 
187  if(!FcalEmModuleSD)
188  {
189  FcalEmModuleSD = new FCALEMModuleSD("FCALTB/EmModuleSD");
191  }
192  LogicalF1LArGap->SetSensitiveDetector(FcalEmModuleSD);
193 
194 
195 
196  return LogicalEmModule;
197 
198 }
199 
200 
202 { return F1LArITile[GapID]; }
203 
205 { return F1LArGapPosX[GapID]; }
206 
207 
G4double EmModuleRMin
Definition: FCALEMModule.hh:71
G4double EmModuleStartPhi
Definition: FCALEMModule.hh:71
G4double EmModuleDPhi
Definition: FCALEMModule.hh:71
G4int GetF1TileID(G4int)
G4double F1LArGapDPhi
Definition: FCALEMModule.hh:80
CLHEP::Hep3Vector G4ThreeVector
G4double GetF1LArGapPosX(G4int)
HepGeom::Transform3D G4Transform3D
G4double F1LArGapLenght
Definition: FCALEMModule.hh:80
Definition: G4Tubs.hh:85
void AddNewDetector(G4VSensitiveDetector *aSD)
Definition: G4SDManager.cc:71
#define G4endl
Definition: G4ios.hh:61
G4double F1CableTroffStartPhi
Definition: FCALEMModule.hh:76
G4int * F1LArITile
Definition: FCALEMModule.hh:65
G4double F1CableTroffLenght
Definition: FCALEMModule.hh:76
G4double F1LArGapRmin
Definition: FCALEMModule.hh:80
G4int * F1LArJY
Definition: FCALEMModule.hh:64
G4double F1CableTroffRMax
Definition: FCALEMModule.hh:76
G4double * F1LArGapPosX
Definition: FCALEMModule.hh:66
G4double EmModuleRMax
Definition: FCALEMModule.hh:71
static const G4VisAttributes & GetInvisible()
G4Material * Material(G4String)
FCALEMModuleSD * FcalEmModuleSD
Definition: FCALEMModule.hh:82
double G4double
Definition: G4Types.hh:76
G4double F1LArGapRmax
Definition: FCALEMModule.hh:80
G4int NCableTroff
Definition: FCALEMModule.hh:75
void SetSmartless(G4double s)
G4LogicalVolume * Construct()
G4double F1LArGapStartPhi
Definition: FCALEMModule.hh:80
G4double F1CableTroffRMin
Definition: FCALEMModule.hh:76
void SetVisAttributes(const G4VisAttributes *pVA)
G4double FCALEmSmart
Definition: FCALEMModule.hh:73
G4GLOB_DLL std::ostream G4cerr
static FCALMaterialConsultant * GetInstance()
static G4SDManager * GetSDMpointer()
Definition: G4SDManager.cc:40
int G4int
Definition: G4Types.hh:78
G4double EmModuleLenght
Definition: FCALEMModule.hh:71
G4double F1CableTroffDPhi
Definition: FCALEMModule.hh:76
HepRotation & rotateZ(double delta)
Definition: Rotation.cc:92
G4int * F1LArIX
Definition: FCALEMModule.hh:63
void InitializeGeometry()
Definition: FCALEMModule.cc:83
static constexpr double cm
Definition: G4SIunits.hh:119
G4GLOB_DLL std::ostream G4cout
G4int * F1LArGapID
Definition: FCALEMModule.hh:62
G4double * F1LArGapPosY
Definition: FCALEMModule.hh:67
G4double F1CableTroffRotZ
Definition: FCALEMModule.hh:78
void SetSensitiveDetector(G4VSensitiveDetector *pSDetector)