Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #include "Detector.h"
00019
00020 #include "Materials.h"
00021
00022 #include "Beam_Pipe.h"
00023 #include "Gem_Tracker.h"
00024 #include "Luminosity_Monitor.h"
00025 #include "Magnetic_Field.h"
00026 #include "MWPC.h"
00027 #include "Symmetric_Moeller.h"
00028 #include "Target_Chamber.h"
00029 #include "Time_of_Flight.h"
00030 #include "Toroid_Magnet.h"
00031 #include "Wire_Chamber.h"
00032
00033 #include "DET_Messenger.h"
00034
00035
00036
00037 #include "G4VPhysicalVolume.hh"
00038 #include "G4FieldManager.hh"
00039 #include "G4TransportationManager.hh"
00040
00041 #include "G4Box.hh"
00042 #include "G4LogicalVolume.hh"
00043 #include "G4Material.hh"
00044 #include "G4VisAttributes.hh"
00045 #include "G4Color.hh"
00046 #include "G4PVPlacement.hh"
00047 #include "G4ThreeVector.hh"
00048
00049
00050
00051
00052
00053
00054
00055 Detector::Detector() :
00056 pMF(0), pTC(0), pBP(0), pTM(0), pGT(0), pWC(0), pTF(0), pLM(0),
00057 pMW(0), pSM(0) {
00058
00059
00060
00061 DET_Messenger::Instance()->setDETptr( this );
00062
00063 }
00064
00065
00066
00067
00068
00069 Detector::~Detector() {
00070
00071 delete pMF;
00072 delete pTC;
00073 delete pBP;
00074 delete pTM;
00075 delete pGT;
00076 delete pWC;
00077 delete pTF;
00078 delete pLM;
00079 delete pMW;
00080 delete pSM;
00081
00082 }
00083
00084
00085
00086
00087
00088 G4VPhysicalVolume * Detector::Construct() {
00089
00090
00091
00092 Materials( false );
00093
00094
00095
00096 G4cout << "Initializing the magnetic field.\n" << flush;
00097
00098 pMF = new Magnetic_Field( "detector/magneticfield/OLYMPUS.grid", 1.0 );
00099
00100 G4FieldManager * FieldMgr =
00101 G4TransportationManager::GetTransportationManager()->GetFieldManager();
00102
00103 FieldMgr->SetDetectorField( pMF );
00104 FieldMgr->CreateChordFinder( pMF );
00105
00106 G4cout << " done.\n" << G4endl << flush;
00107
00108
00109
00110 G4cout << "Building the world volume.\n" << flush;
00111
00112 G4Box * World_solid = new G4Box( "World_solid", 5.0 * m, 5.0 * m, 5.0 * m );
00113
00114 G4LogicalVolume * World_log = new
00115 G4LogicalVolume( World_solid, G4Material::GetMaterial( "G4_AIR" ),
00116 "World_log", 0, 0, 0, false );
00117
00118 World_log->SetVisAttributes( G4VisAttributes( false, G4Color() ) );
00119
00120 G4PVPlacement * World_phys = new
00121 G4PVPlacement( 0, G4ThreeVector(), "World_phys",
00122 World_log, 0, false, 0, false );
00123
00124 G4cout << " done.\n" << endl << flush;
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136 if( pTC ) delete pTC;
00137 pTC = new Target_Chamber();
00138 pTC->Build( World_phys );
00139
00140
00141
00142 if( pBP ) delete pBP;
00143 pBP = new Beam_Pipe();
00144 pBP->Build( World_phys );
00145
00146
00147
00148 if( pTM ) delete pTM;
00149 pTM = new Toroid_Magnet();
00150 pTM->Build( World_phys );
00151
00152
00153
00154 if( pGT ) delete pGT;
00155 pGT = new Gem_Tracker();
00156 pGT->Build( World_phys );
00157
00158
00159
00160 if( pWC ) delete pWC;
00161 pWC = new Wire_Chamber();
00162 pWC->Build( World_phys );
00163
00164
00165
00166 if( pTF ) delete pTF;
00167 pTF = new Time_of_Flight();
00168 pTF->Build( World_phys );
00169
00170
00171
00172 if( pLM ) delete pLM;
00173 pLM = new Luminosity_Monitor();
00174 pLM->Build( World_phys );
00175
00176
00177
00178 if( pMW ) delete pMW;
00179 pMW = new MWPC();
00180 pMW->Build( World_phys );
00181
00182
00183
00184 if( pSM ) delete pSM;
00185 pSM = new Symmetric_Moeller();
00186 pSM->Build( World_phys );
00187
00188
00189
00190 return World_phys;
00191
00192
00193
00194 }