00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #include "Gem_Tracker.h"
00019 #include "GT_SD.h"
00020
00021
00022
00023 #include "G4VPhysicalVolume.hh"
00024 #include "G4LogicalVolume.hh"
00025 #include "G4PVPlacement.hh"
00026 #include "G4Box.hh"
00027 #include "G4SubtractionSolid.hh"
00028 #include "G4Material.hh"
00029 #include "G4ThreeVector.hh"
00030 #include "G4RotationMatrix.hh"
00031 #include "G4VisAttributes.hh"
00032 #include "G4Colour.hh"
00033
00034 #include "G4SDManager.hh"
00035
00036
00037
00038 using namespace std;
00039
00040
00041
00042
00043
00044
00045
00046 Gem_Tracker::Gem_Tracker() {}
00047
00048
00049
00050 Gem_Tracker::~Gem_Tracker() {}
00051
00052
00053
00054 void Gem_Tracker::Build( G4VPhysicalVolume * World_phys ) {
00055
00056
00057
00058 G4cout << "Building the Gem_Tracker.\n" << flush;
00059
00060
00061
00062 G4double R[N_GT] = { 50.00, 50.00 };
00063
00064 G4double Theta[N_GT] = { 41.00, 41.00 };
00065
00066 G4double Phi[N_GT] = { 0.00, 180.00 };
00067
00068 G4double Alpha[N_GT] = { -73.54, 73.54 };
00069
00070
00071
00072 for( int i = 0; i < N_GT; ++i ) {
00073 R[i] *= cm;
00074 Theta[i] *= degree;
00075 Phi[i] *= degree;
00076 Alpha[i] *= degree;
00077 }
00078
00079 G4double SizeX = 50.0 * 2.54 * cm;
00080 G4double SizeY = 20.5 * 2.54 * cm;
00081 G4double SizeZ = 1.5 * 2.54 * cm;
00082 G4double Frame = 1.0 * 2.54 * cm;
00083
00084
00085
00086 GT_SD * SD = new GT_SD( "OLYMPUS/GT" );
00087
00088 G4SDManager::GetSDMpointer()->AddNewDetector( SD );
00089
00090
00091
00092 for( int i = 0; i < N_GT; ++i ) {
00093
00094
00095
00096 G4Box * GT_solid = new
00097 G4Box( "GT_solid", SizeX / 2.0, SizeY/ 2.0, SizeZ/ 2.0 );
00098
00099 G4LogicalVolume * GT_log = new
00100 G4LogicalVolume( GT_solid, G4Material::GetMaterial( "WC_gas" ),
00101 "GT_log", 0, 0, 0, true );
00102
00103 GT_log->SetVisAttributes( G4VisAttributes( false, G4Color() ) );
00104
00105 G4double costheta = cos( Theta[i] );
00106 G4double sintheta = sin( Theta[i] );
00107 G4double cosphi = cos( Phi[i] );
00108 G4double sinphi = sin( Phi[i] );
00109
00110
00111
00112
00113 G4RotationMatrix * Rotation = new G4RotationMatrix;
00114 Rotation->rotateY( Alpha[i] );
00115 if( i == 1 ) Rotation->rotateZ( 180.0 * degree );
00116
00117 new G4PVPlacement( Rotation, G4ThreeVector( R[i] * sintheta * cosphi,
00118 R[i] * sintheta * sinphi,
00119 R[i] * costheta ),
00120 "GT_phys", GT_log, World_phys, false, i, false );
00121
00122
00123
00124 G4Box * GT_Gas_solid = new
00125 G4Box( "GT_Gas_solid", SizeX / 2.0 - Frame,
00126 SizeY / 2.0 - Frame, ( SizeZ + 0.01 * cm ) / 2.0 );
00127
00128 G4LogicalVolume * GT_Gas_log = new
00129 G4LogicalVolume( GT_Gas_solid, G4Material::GetMaterial( "WC_gas" ),
00130 "GT_Gas_log", 0, 0, 0, true );
00131
00132 GT_Gas_log->SetVisAttributes( G4VisAttributes( false, G4Color() ) );
00133
00134 new G4PVPlacement( 0, G4ThreeVector(),
00135 GT_Gas_log, "GT_Gas_phys", GT_log, false, i, false );
00136
00137
00138
00139 G4SubtractionSolid * GT_Frame_solid = new
00140 G4SubtractionSolid( "GT_Frame_solid", GT_solid, GT_Gas_solid );
00141
00142 G4LogicalVolume * GT_Frame_log = new
00143 G4LogicalVolume( GT_Frame_solid, G4Material::GetMaterial( "NemaG10" ),
00144 "GT_Frame_log", 0, 0, 0, true );
00145
00146 GT_Frame_log->SetVisAttributes(
00147 G4VisAttributes( true, G4Colour( 0, 0.8, 0.8) ) );
00148
00149 new G4PVPlacement( 0, G4ThreeVector(), GT_Frame_log, "GT_Frame_phys",
00150 GT_log, false, i, false );
00151
00152
00153
00154 G4Box * GT_Drift_solid = new
00155 G4Box( "GT_Drift_solid", SizeX / 2.0 - Frame,
00156 SizeY / 2.0 - Frame, 0.3 * cm / 2.0 );
00157
00158 G4LogicalVolume * GT_Drift_log = new
00159 G4LogicalVolume( GT_Drift_solid, G4Material::GetMaterial( "WC_gas" ),
00160 "GT_Drift_log", 0, 0, 0, true );
00161
00162 GT_Drift_log->SetVisAttributes( G4VisAttributes( false, G4Color() ) );
00163
00164 new G4PVPlacement( 0, G4ThreeVector( 0.0, 0.0,
00165 ( 0.3 * cm - SizeZ )/ 2.0 ),
00166 GT_Drift_log, "GT_Drift_phys",
00167 GT_Gas_log, false, i, false );
00168
00169
00170
00171 GT_Drift_log->SetSensitiveDetector( SD );
00172
00173 }
00174
00175 G4cout << " Done.\n" << endl << flush;
00176
00177
00178
00179 return;
00180
00181 }