39 base_class(name, svc), p_runMgr(0), p_uiMgr(0), p_visMgr(0),
40 _init(
false), m_beamTime(0)
44 declareProperty(
"Visualize", m_vis=
false);
47 declareProperty(
"RunVerbosity", m_runVerb=0);
48 declareProperty(
"EventVerbosity", m_eventVerb=0);
49 declareProperty(
"TrackingVerbosity", m_trackVerb=0);
51 declareProperty(
"FADSmacro",m_macroName=
"none" );
52 declareProperty(
"MdcNoiseFile", m_mdcNoiseFile=
"none");
56 declareProperty(
"LogLevel", m_logLevel=6);
58 declareProperty(
"InteractiveG4" , m_interactiveG4=
false);
60 declareProperty(
"BesGenAction", m_besGenAction=
false);
62 declareProperty(
"BeamPosX",m_beamPosX=0);
63 declareProperty(
"BeamPosY",m_beamPosY=0);
64 declareProperty(
"BeamPosZ",m_beamPosZ=0);
66 declareProperty(
"BeamSizeX", m_beamSizeX=10);
67 declareProperty(
"BeamSizeY", m_beamSizeY=20);
68 declareProperty(
"BeamSizeZ", m_beamSizeZ=30);
70 declareProperty(
"BeamStartTime",m_beamStartTime=0);
71 declareProperty(
"BeamDeltaTime",m_beamDeltaTime=0);
72 declareProperty(
"NBunch",m_nBunch=1);
74 declareProperty(
"BunchTimeSigma",m_bunchTimeSigma=0);
76 declareProperty(
"MdcDataInput",m_mdcDataInput=1);
77 declareProperty(
"MdcDedxFlag",m_mdcDedxFlag=1);
79 declareProperty(
"BoostLab",m_boostLab=
false);
80 declareProperty(
"BeamAngle",m_beamAngle=11);
82 declareProperty(
"SetBeamShift",m_setBeamShift=
false);
83 declareProperty(
"BeamShiftPx" ,m_beamShiftPx=39.45);
84 declareProperty(
"BeamShiftPy" ,m_beamShiftPy=-0.98);
85 declareProperty(
"BeamShiftPz" ,m_beamShiftPz=3.70);
87 declareProperty(
"MdcRootFlag",m_mdcRootFlag=
false);
88 declareProperty(
"TofRootFlag",m_tofRootFlag=
false);
89 declareProperty(
"EmcRootFlag",m_emcRootFlag=
false);
90 declareProperty(
"MucRootFlag",m_mucRootFlag=
false);
93 declareProperty(
"TofSaturationFlag",m_tofSaturationFlag=
true);
95 declareProperty(
"EmcLightOutput",m_emcLightOutput=
true);
96 declareProperty(
"EmcIncoherentNoise",m_emcIncoherentNoise=0.2);
97 declareProperty(
"EmcCoherentNoise",m_emcCoherentNoise=0.);
98 declareProperty(
"EmcNoiseMean",m_emcNoiseMean=1.16);
99 declareProperty(
"EmcNoiseSigma",m_emcNoiseSigma=0.23);
100 declareProperty(
"EmcNoiseThreshold",m_emcNoiseThreshold=0.5);
101 declareProperty(
"EmcNoiseLevel",m_emcNoiseLevel=3);
102 declareProperty(
"EmcTime",m_emcTime=20);
103 declareProperty(
"EmcELecSaturation",m_emcELecSaturation=1);
104 declareProperty(
"EmcELecSatuDead",m_emcELecSatuDead=0);
105 declareProperty(
"MucNoiseMode", m_mucNoiseMode=1);
305 MsgStream log(
msgSvc(), name() );
307 log << MSG::VERBOSE <<
"Attempting G4 Initialization" << endreq;
319 log << MSG::INFO <<
"Initializing G4SvcVisManager" << endreq;
321 p_visMgr =
new G4VisExecutive;
322 p_visMgr->Initialize();
329 log << MSG::INFO <<
"Not including Visualization" << endreq;
333 log << MSG::DEBUG <<
"Setting verbosity levels - "
334 <<
"run: " << m_runVerb <<
" event: " << m_eventVerb
335 <<
" track: " << m_trackVerb << endreq;
339 ost <<
"/run/verbose " << m_runVerb << std::ends;
340 uiMgr()->ApplyCommand(ost.str());
344 ost <<
"/event/verbose " << m_eventVerb << std::ends;
345 uiMgr()->ApplyCommand(ost.str());
349 ost <<
"/tracking/verbose " << m_trackVerb << std::ends;
350 uiMgr()->ApplyCommand(ost.str());
353 log << MSG::DEBUG <<
"Initializing G4 kernel" << endreq;
354 p_runMgr->Initialize();
357 if (m_macroName!=
"none"){
358 log << MSG::INFO <<
"Running G4 macro "<<m_macroName<< endreq;
359 uiMgr()->ApplyCommand(
"/control/execute "+m_macroName);
361 if (m_interactiveG4) {
366 log << MSG::ERROR <<
"G4 kernel already initialized" << endreq;