BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
ExtBesDetectorConstruction.cxx
Go to the documentation of this file.
1//
2// File: ExtBesDetectorConstruction.cxx
3// Author: L.L.Wang
4// Description: Constuction of BESIII detector using package GdmlToG4.
5// History: 2005.8.5 created by L.L.Wang
6//
7
9
10#include "G4Colour.hh"
11#include "G4String.hh"
12#include "globals.hh"
13#include <cstdlib>
14#include <fstream>
15
16#include "G4Evaluator/GDMLExpressionEvaluator.hh"
17#include "G4Processor/GDMLProcessor.hh"
18
19// Added here just to help resolve properly dependencies
20#include "G4BooleanSolid.hh"
21#include "G4Geo/BesG4Geo.h"
22
24 if ( bFieldOn ) besField = new ExtBesMagneticField();
25 fWorld = 0;
26 m_detVer = detVer;
27}
28
30 if ( besField ) delete besField;
31}
32
34 BesG4Geo* aBesG4Geo = new BesG4Geo();
35
36 fWorld = (G4VPhysicalVolume*)GDMLProcessor::GetInstance()->GetWorldVolume();
37 if ( fWorld == 0 )
38 {
39 G4cout
40 << "World volume not set properly check your setup selection criteria or GDML input!"
41 << G4endl;
42 exit( -1 );
43 }
44
45 delete aBesG4Geo;
46
47 G4LogicalVolume* logicalBes = const_cast<G4LogicalVolume*>(
48 GDMLProcessor::GetInstance()->GetLogicalVolume( "logicalWorld" ) );
49 Mdc.Construct( logicalBes );
50
51 if ( m_detVer == 1 || m_detVer == 2 )
52 {
53 std::cout << "ExBesDetectorConstruction: You are using the Sintillator Tof Detector!"
54 << std::endl;
55 Tof.Construct( logicalBes );
56 }
57 else if ( m_detVer == 3 )
58 {
59 std::cout
60 << "ExBesDetectorConstruction: You are using the upgraded (MRPC) Tof Detector!"
61 << std::endl;
62 Tof.ConstructETF( logicalBes );
63 }
64 else
65 {
66 std::cout << "ExBesDetectorConstruction: Detector Version is not well defined! "
67 << m_detVer << " \n " << std::endl;
68 std::cout << " Use in your jobOption script " << std::endl;
69 std::cout << " TrkExtAlg.Tof = 1; for the upgraded Tof "
70 "(MRPC Endcaps, double sided readout) "
71 << std::endl;
72 std::cout << " TrkExtAlg.Tof = 0; for the Sintillator Tof. "
73 << std::endl;
74 }
75
76 Emc.Construct( logicalBes );
77 Muc.Construct( logicalBes );
78
79 return fWorld;
80}
ExtBesDetectorConstruction(const bool bFieldOn, int tofversion)