BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
TofSimSvc Class Reference

#include <TofSimSvc.h>

Inheritance diagram for TofSimSvc:

Public Member Functions

 TofSimSvc (const std::string &name, ISvcLocator *svcloc)
 ~TofSimSvc ()
virtual StatusCode initialize ()
virtual StatusCode finalize ()
void handle (const Incident &)
const double BarLowThres ()
const double BarHighThres ()
const double EndLowThres ()
const double EndHighThres ()
const double BarPMTGain ()
const double EndPMTGain ()
const double BarConstant ()
const double EndConstant ()
const double EndNoiseSwitch ()
const double BarGain1 (unsigned int id)
const double BarGain2 (unsigned int id)
const double EndGain (unsigned int id)
const double BarAttenLength (unsigned int id)
const double EndAttenLength (unsigned int id)
const double EndNoiseSmear (unsigned int id)
void Dump ()

Detailed Description

Definition at line 15 of file TofSimSvc.h.

Constructor & Destructor Documentation

◆ TofSimSvc()

TofSimSvc::TofSimSvc ( const std::string & name,
ISvcLocator * svcloc )

Definition at line 29 of file TofSimSvc.cxx.

30 : base_class( name, svcloc ) {
31 declareProperty( "Run", m_run = 1 );
32}

Referenced by TofSimSvc().

◆ ~TofSimSvc()

TofSimSvc::~TofSimSvc ( )

Definition at line 81 of file TofSimSvc.cxx.

81 {
82 MsgStream log( msgSvc(), name() );
83 log << MSG::INFO << name() << ": Destructor function of TofSimSvc" << endmsg;
84
85 for ( vector<TofConst*>::iterator it1 = fTofConst.begin(); it1 != fTofConst.end(); it1++ )
86 { delete ( *it1 ); }
87 fTofConst.clear();
88 for ( vector<BTofSim*>::iterator it2 = fBTofSim.begin(); it2 != fBTofSim.end(); it2++ )
89 { delete ( *it2 ); }
90 fBTofSim.clear();
91 for ( vector<ETofSim*>::iterator it3 = fETofSim.begin(); it3 != fETofSim.end(); it3++ )
92 { delete ( *it3 ); }
93 fETofSim.clear();
94
95 return;
96}
IMessageSvc * msgSvc()

Member Function Documentation

◆ BarAttenLength()

const double TofSimSvc::BarAttenLength ( unsigned int id)

Definition at line 217 of file TofSimSvc.cxx.

217 {
218 if ( id < 176 ) { return fBTofSim[id]->getAttenLength(); }
219 else
220 {
221 std::cout << "TofSimSvc::BarAttenLength: bad id=" << id << std::endl;
222 return 0.0;
223 }
224}

◆ BarConstant()

const double TofSimSvc::BarConstant ( )

Definition at line 184 of file TofSimSvc.cxx.

184{ return fTofConst[0]->getBarConstant(); }

◆ BarGain1()

const double TofSimSvc::BarGain1 ( unsigned int id)

Definition at line 190 of file TofSimSvc.cxx.

190 {
191 if ( id < 176 ) { return fBTofSim[id]->getGain1(); }
192 else
193 {
194 std::cout << "TofSimSvc::BarGain1: bad id=" << id << std::endl;
195 return 0.0;
196 }
197}

◆ BarGain2()

const double TofSimSvc::BarGain2 ( unsigned int id)

Definition at line 199 of file TofSimSvc.cxx.

199 {
200 if ( id < 176 ) { return fBTofSim[id]->getGain2(); }
201 else
202 {
203 std::cout << "TofSimSvc::BarGain2: bad id=" << id << std::endl;
204 return 0.0;
205 }
206}

◆ BarHighThres()

const double TofSimSvc::BarHighThres ( )

Definition at line 174 of file TofSimSvc.cxx.

174{ return fTofConst[0]->getBarHighThres(); }

◆ BarLowThres()

const double TofSimSvc::BarLowThres ( )

Definition at line 172 of file TofSimSvc.cxx.

172{ return fTofConst[0]->getBarLowThres(); }

◆ BarPMTGain()

const double TofSimSvc::BarPMTGain ( )

Definition at line 180 of file TofSimSvc.cxx.

180{ return fTofConst[0]->getBarPMTGain(); }

◆ Dump()

void TofSimSvc::Dump ( )

Definition at line 154 of file TofSimSvc.cxx.

154 {
155 std::cout << "Now We can get the TOF Simulation Service" << std::endl;
156 return;
157}

◆ EndAttenLength()

const double TofSimSvc::EndAttenLength ( unsigned int id)

Definition at line 226 of file TofSimSvc.cxx.

226 {
227 if ( id < 96 ) { return fETofSim[id]->getAttenLength(); }
228 else
229 {
230 std::cout << "TofSimSvc::EndAttenLength: bad id=" << id << std::endl;
231 return 0.0;
232 }
233}

◆ EndConstant()

const double TofSimSvc::EndConstant ( )

Definition at line 186 of file TofSimSvc.cxx.

186{ return fTofConst[0]->getEndConstant(); }

◆ EndGain()

const double TofSimSvc::EndGain ( unsigned int id)

Definition at line 208 of file TofSimSvc.cxx.

208 {
209 if ( id < 96 ) { return fETofSim[id]->getGain(); }
210 else
211 {
212 std::cout << "TofSimSvc::EndGain: bad id=" << id << std::endl;
213 return 0.0;
214 }
215}

◆ EndHighThres()

const double TofSimSvc::EndHighThres ( )

Definition at line 178 of file TofSimSvc.cxx.

178{ return fTofConst[0]->getEndHighThres(); }

◆ EndLowThres()

const double TofSimSvc::EndLowThres ( )

Definition at line 176 of file TofSimSvc.cxx.

176{ return fTofConst[0]->getEndLowThres(); }

◆ EndNoiseSmear()

const double TofSimSvc::EndNoiseSmear ( unsigned int id)

Definition at line 235 of file TofSimSvc.cxx.

235 {
236 if ( id < 96 ) { return fETofSim[id]->getNoiseSmear(); }
237 else
238 {
239 std::cout << "TofSimSvc::EndNoiseSmear: bad id=" << id << std::endl;
240 return 0.0;
241 }
242}

◆ EndNoiseSwitch()

const double TofSimSvc::EndNoiseSwitch ( )

Definition at line 188 of file TofSimSvc.cxx.

188{ return fTofConst[0]->getEndNoiseSwitch(); }

◆ EndPMTGain()

const double TofSimSvc::EndPMTGain ( )

Definition at line 182 of file TofSimSvc.cxx.

182{ return fTofConst[0]->getEndPMTGain(); }

◆ finalize()

StatusCode TofSimSvc::finalize ( )
virtual

Definition at line 75 of file TofSimSvc.cxx.

75 {
76 MsgStream log( msgSvc(), name() );
77 log << MSG::INFO << name() << ": End of Run" << endmsg;
78 return StatusCode::SUCCESS;
79}

◆ handle()

void TofSimSvc::handle ( const Incident & inc)

Definition at line 159 of file TofSimSvc.cxx.

159 {
160 MsgStream log( msgSvc(), name() );
161 log << MSG::DEBUG << "handle: " << inc.type() << endmsg;
162
163 if ( inc.type() == "NewRun" )
164 {
165 log << MSG::DEBUG << "New Run" << endmsg;
166 StatusCode sc = FillfromDatabase();
167 if ( sc.isSuccess() ) { m_hasbeeninitialized = true; }
168 }
169 return;
170}

◆ initialize()

StatusCode TofSimSvc::initialize ( )
virtual

Definition at line 44 of file TofSimSvc.cxx.

44 {
45 m_hasbeeninitialized = false;
46
47 MsgStream log( msgSvc(), name() );
48 log << MSG::INFO << name() << ": Start of run initialisation" << endmsg;
49
50 StatusCode sc = Service::initialize();
51 if ( sc.isFailure() ) return sc;
52
53 IIncidentSvc* incsvc;
54 sc = service( "IncidentSvc", incsvc );
55 int priority = 100;
56 if ( sc.isSuccess() ) { incsvc->addListener( this, "NewRun", priority ); }
57
58 StatusCode scc;
59
60 log << MSG::INFO << "setProperties()" << endmsg;
61 scc = service( "CalibDataSvc", m_pSimDataSvc, true );
62 if ( !scc.isSuccess() )
63 {
64 log << MSG::ERROR << "Could not get IDataProviderSvc interface of SimXmlCnvSvc" << endmsg;
65 return scc;
66 }
67 else
68 { log << MSG::DEBUG << "Retrieved IDataProviderSvc interface of SimXmlCnvSvc" << endmsg; }
69 // Get properties from the JobOptionsSvc
70 // scc = setProperties();
71
72 return sc;
73}

The documentation for this class was generated from the following files: