BOSS 6.6.4.p01
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
8
10
11#include "G4Colour.hh"
12#include "globals.hh"
13#include <cstdlib>
14#include <fstream>
15#include "G4String.hh"
16
17#include "GDMLProcessor.hh"
18#include "GDMLExpressionEvaluator.hh"
19
20// Added here just to help resolve properly dependencies
21#include "G4BooleanSolid.hh"
22#include "G4Geo/BesG4Geo.h"
23
24
26{
27 if(bFieldOn) besField = new ExtBesMagneticField();
28 fWorld=0;
29 m_tofversion=tofversion;
30}
31
32
34{
35 if(besField)
36 delete besField;
37}
38
39
41{
42 BesG4Geo* aBesG4Geo = new BesG4Geo();
43
44 fWorld=(G4VPhysicalVolume *)GDMLProcessor::GetInstance()->GetWorldVolume();
45 if( fWorld == 0 ) {
46 G4Exception("World volume not set properly check your setup selection criteria or GDML input!");
47 }
48
49 delete aBesG4Geo;
50
51 G4LogicalVolume* logicalBes = const_cast<G4LogicalVolume*>( GDMLProcessor::GetInstance()->GetLogicalVolume("logicalWorld" ) );
52 Mdc.Construct(logicalBes);
53
54 if(m_tofversion==2)
55 {
56 std::cout << "ExBesDetectorConstruction: You are using the old Tofdetector " << std::endl;
57 Tof.Construct(logicalBes);
58 }
59 else if(m_tofversion==4)
60 {
61 std::cout << "ExBesDetectorConstruction: You are using the new (MRPC) Tofdetector " << std::endl;
62 Tof.Construct_mrpc(logicalBes);
63 }
64 else
65 {
66 std::cout << "ExBesDetectorConstruction: TofDetector is not well defined! \n " << std::endl;
67 std::cout << " Use in your jobOption script " << std::endl;
68 std::cout << " TrkExtAlg.Tof = 4; for the new Tof (MRPC Endcaps) " << std::endl;
69 std::cout << " TrkExtAlg.Tof = 2; for the old Tof. " << std::endl;
70 }
71
72
73 Emc.Construct(logicalBes);
74 Muc.Construct(logicalBes);
75
76 return fWorld;
77}
ExtBesDetectorConstruction(const bool bFieldOn, int tofversion)
void Construct(G4LogicalVolume *)
void Construct(G4LogicalVolume *)
void Construct(G4LogicalVolume *logicBes)
void Construct_mrpc(G4LogicalVolume *logicBes)
void Construct(G4LogicalVolume *logicBes)