00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #include "Symmetric_Moeller.h"
00019 #include "SM_SD.h"
00020
00021
00022
00023 #include "G4VPhysicalVolume.hh"
00024 #include "G4LogicalVolume.hh"
00025 #include "G4PVPlacement.hh"
00026 #include "G4Box.hh"
00027 #include "G4Tubs.hh"
00028 #include "G4SubtractionSolid.hh"
00029 #include "G4Material.hh"
00030 #include "G4ThreeVector.hh"
00031 #include "G4RotationMatrix.hh"
00032 #include "G4VisAttributes.hh"
00033 #include "G4Colour.hh"
00034
00035 #include "G4SDManager.hh"
00036
00037
00038
00039 using namespace std;
00040
00041
00042
00043
00044
00045 Symmetric_Moeller::Symmetric_Moeller() {}
00046
00047
00048
00049 Symmetric_Moeller::~Symmetric_Moeller() {}
00050
00051
00052
00053 void Symmetric_Moeller::Build( G4VPhysicalVolume * World_phys ) {
00054
00055
00056
00057 G4cout << "Building the Symmetric_Moeller.\n" << flush;
00058
00059
00060
00061 G4double Width[N_SM] = {10.,
00062 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5,
00063 10.,
00064 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5};
00065
00066 G4double Height[N_SM] = {10.,
00067 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5,
00068 10.,
00069 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5};
00070
00071 G4double Length[N_SM] = {10.,
00072 16., 16., 16., 16., 16., 16., 16., 16., 16.,
00073 10.,
00074 16., 16., 16., 16., 16., 16., 16., 16., 16.};
00075
00076 G4double x[N_SM] = {3.8+5.,
00077 3.8+6.25, 3.8+3.75, 3.8+1.25 ,3.8+6.25, 3.8+3.75,
00078 3.8+1.25, 3.8+6.25, 3.8+3.75, 3.8+1.25,
00079 -(3.8+5.),
00080 -(3.8+1.25), -(3.8+3.75), -(3.8+6.25),-(3.8+1.25),
00081 -(3.8+3.75), -(3.8+6.25), -(3.8+1.25), -(3.8+3.75),
00082 -(3.8+6.25)};
00083
00084 G4double y[N_SM] = {0.,
00085 2.5, 2.5, 2.5, 0., 0., 0., -2.5, -2.5, -2.5,
00086 0.,
00087 2.5, 2.5, 2.5, 0., 0., 0., -2.5, -2.5, -2.5};
00088
00089 G4double z[N_SM] = {335.,
00090 345., 345, 345., 345., 345., 345., 345., 345., 345.,
00091 335.,
00092 345., 345, 345., 345., 345., 345., 345., 345., 345.};
00093
00094
00095
00096 for( int i = 0; i < N_SM; i++ ) {
00097 x[i] *= cm;
00098 y[i] *= cm;
00099 z[i] *= cm;
00100
00101 Width[i] *= cm;
00102 Height[i] *= cm;
00103 Length[i] *= cm;
00104
00105 z[i] = z[i] + Length[i] / 2.0;
00106 }
00107
00108 G4double Deg360 = 360.0 * degree;
00109
00110
00111
00112 SM_SD * SD = new SM_SD( "OLYMPUS/SM" );
00113
00114 G4SDManager::GetSDMpointer()->AddNewDetector( SD );
00115
00116
00117
00118 for( int i = 0; i < N_SM; i++ ) {
00119
00120
00121
00122 G4Box * SM_solid = new
00123 G4Box( "SM_solid", Width[i] / 2.0, Height[i] / 2.0, Length[i] / 2.0 );
00124
00125
00126
00127 if( i == 0 ) {
00128
00129 G4Tubs * Col_hole = new
00130 G4Tubs( "Col_hole", 0.0, 1.0 * cm, 10.0 * cm, 0.0, Deg360 );
00131
00132 G4ThreeVector xTrans( -1.0 * cm, 0.0 , 0.0 );
00133
00134 G4SubtractionSolid * SM_col =
00135 new G4SubtractionSolid( "SM_solid-Col_hole", SM_solid, Col_hole,
00136 0, xTrans );
00137
00138 G4LogicalVolume * SM_log = new
00139 G4LogicalVolume( SM_col, G4Material::GetMaterial( "G4_Pb" ),
00140 "SM_log", 0, 0, 0, true );
00141
00142 SM_log->SetVisAttributes(
00143 G4VisAttributes( true, G4Color( 1.0, 1.0, 1.0 ) ) );
00144
00145 new G4PVPlacement( 0, G4ThreeVector( x[i], y[i], z[i] ),
00146 "SM_phys", SM_log, World_phys, false, i, false );
00147
00148
00149
00150 SM_log->SetSensitiveDetector( SD );
00151 }
00152
00153
00154
00155 else if( i == 10 ) {
00156
00157 G4Tubs * Col_hole = new
00158 G4Tubs( "Col_hole", 0.0, 1.0 * cm, 10.0 * cm, 0.0, Deg360 );
00159
00160 G4ThreeVector xTrans( 1.0 * cm, 0.0, 0.0 );
00161
00162 G4SubtractionSolid* SM_col = new
00163 G4SubtractionSolid("SM_solid-Col_hole", SM_solid, Col_hole,
00164 0, xTrans );
00165
00166 G4LogicalVolume * SM_log = new
00167 G4LogicalVolume( SM_col, G4Material::GetMaterial( "G4_Pb" ),
00168 "SM_log", 0, 0, 0, true );
00169
00170 SM_log->SetVisAttributes( G4VisAttributes( true, G4Color().White() ) );
00171 new G4PVPlacement( 0, G4ThreeVector( x[i], y[i], z[i] ),
00172 "SM_phys", SM_log, World_phys, false, i, false );
00173
00174
00175
00176 SM_log->SetSensitiveDetector( SD );
00177 }
00178
00179
00180
00181 else {
00182
00183 G4LogicalVolume * SM_log = new
00184 G4LogicalVolume( SM_solid, G4Material::GetMaterial( "PbF2" ),
00185 "SM_log", 0, 0, 0, true );
00186
00187 SM_log->SetVisAttributes(
00188 G4VisAttributes( true, G4Color( 1.0, 1.0, 1.0 ) ) );
00189
00190 new G4PVPlacement( 0, G4ThreeVector( x[i], y[i], z[i] ),
00191 "SM_phys", SM_log, World_phys, false, i, false );
00192
00193
00194
00195 SM_log->SetSensitiveDetector( SD );
00196 }
00197
00198 }
00199
00200 G4cout << " Done.\n" << G4endl << flush;
00201
00202
00203
00204 return;
00205
00206 }