BOSS 7.1.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 14 of file TofSimSvc.h.

Constructor & Destructor Documentation

◆ TofSimSvc()

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

Definition at line 29 of file TofSimSvc.cxx.

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

◆ ~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" << endreq;
84
85 for(vector<TofConst*>::iterator it1 = fTofConst.begin(); it1 != fTofConst.end(); it1++) { delete (*it1); }
86 fTofConst.clear();
87 for(vector<BTofSim*>::iterator it2 = fBTofSim.begin(); it2 != fBTofSim.end(); it2++) { delete (*it2); }
88 fBTofSim.clear();
89 for(vector<ETofSim*>::iterator it3 = fETofSim.begin(); it3 != fETofSim.end(); it3++) { delete (*it3); }
90 fETofSim.clear();
91
92 return;
93}
IMessageSvc * msgSvc()

Member Function Documentation

◆ BarAttenLength()

const double TofSimSvc::BarAttenLength ( unsigned int  id)

Definition at line 230 of file TofSimSvc.cxx.

230 {
231 if( id < 176 ) {
232 return fBTofSim[id]->getAttenLength();
233 }
234 else {
235 std::cout<<"TofSimSvc::BarAttenLength: bad id="<<id<<std::endl;
236 return 0.0;
237 }
238}

◆ BarConstant()

const double TofSimSvc::BarConstant ( )

Definition at line 188 of file TofSimSvc.cxx.

188 {
189 return fTofConst[0]->getBarConstant();
190}

◆ BarGain1()

const double TofSimSvc::BarGain1 ( unsigned int  id)

Definition at line 200 of file TofSimSvc.cxx.

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

◆ BarGain2()

const double TofSimSvc::BarGain2 ( unsigned int  id)

Definition at line 210 of file TofSimSvc.cxx.

210 {
211 if( id < 176 ) {
212 return fBTofSim[id]->getGain2();
213 }
214 else {
215 std::cout<<"TofSimSvc::BarGain2: bad id="<<id<<std::endl;
216 return 0.0;
217 }
218}

◆ BarHighThres()

const double TofSimSvc::BarHighThres ( )

Definition at line 168 of file TofSimSvc.cxx.

168 {
169 return fTofConst[0]->getBarHighThres();
170}

◆ BarLowThres()

const double TofSimSvc::BarLowThres ( )

Definition at line 164 of file TofSimSvc.cxx.

164 {
165 return fTofConst[0]->getBarLowThres();
166}

◆ BarPMTGain()

const double TofSimSvc::BarPMTGain ( )

Definition at line 180 of file TofSimSvc.cxx.

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

◆ Dump()

void TofSimSvc::Dump ( )

Definition at line 145 of file TofSimSvc.cxx.

145 {
146 std::cout<<"Now We can get the TOF Simulation Service"<<std::endl;
147 return;
148}

◆ EndAttenLength()

const double TofSimSvc::EndAttenLength ( unsigned int  id)

Definition at line 240 of file TofSimSvc.cxx.

240 {
241 if( id < 96 ) {
242 return fETofSim[id]->getAttenLength();
243 }
244 else {
245 std::cout<<"TofSimSvc::EndAttenLength: bad id="<<id<<std::endl;
246 return 0.0;
247 }
248}

◆ EndConstant()

const double TofSimSvc::EndConstant ( )

Definition at line 192 of file TofSimSvc.cxx.

192 {
193 return fTofConst[0]->getEndConstant();
194}

◆ EndGain()

const double TofSimSvc::EndGain ( unsigned int  id)

Definition at line 220 of file TofSimSvc.cxx.

220 {
221 if( id < 96 ) {
222 return fETofSim[id]->getGain();
223 }
224 else {
225 std::cout<<"TofSimSvc::EndGain: bad id="<<id<<std::endl;
226 return 0.0;
227 }
228}

◆ EndHighThres()

const double TofSimSvc::EndHighThres ( )

Definition at line 176 of file TofSimSvc.cxx.

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

◆ EndLowThres()

const double TofSimSvc::EndLowThres ( )

Definition at line 172 of file TofSimSvc.cxx.

172 {
173 return fTofConst[0]->getEndLowThres();
174}

◆ EndNoiseSmear()

const double TofSimSvc::EndNoiseSmear ( unsigned int  id)

Definition at line 250 of file TofSimSvc.cxx.

250 {
251 if( id < 96 ) {
252 return fETofSim[id]->getNoiseSmear();
253 }
254 else {
255 std::cout<<"TofSimSvc::EndNoiseSmear: bad id="<<id<<std::endl;
256 return 0.0;
257 }
258}

◆ EndNoiseSwitch()

const double TofSimSvc::EndNoiseSwitch ( )

Definition at line 196 of file TofSimSvc.cxx.

196 {
197 return fTofConst[0]->getEndNoiseSwitch();
198}

◆ EndPMTGain()

const double TofSimSvc::EndPMTGain ( )

Definition at line 184 of file TofSimSvc.cxx.

184 {
185 return fTofConst[0]->getEndPMTGain();
186}

◆ 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" << endreq;
78 return StatusCode::SUCCESS;
79}

◆ handle()

void TofSimSvc::handle ( const Incident &  inc)

Definition at line 150 of file TofSimSvc.cxx.

150 {
151 MsgStream log( messageService(), name() );
152 log << MSG::DEBUG << "handle: " << inc.type() << endreq;
153
154 if ( inc.type() == "NewRun" ){
155 log << MSG::DEBUG << "New Run" << endreq;
156 StatusCode sc= FillfromDatabase();
157 if(sc.isSuccess()){
158 m_hasbeeninitialized=true;
159 }
160 }
161 return;
162}

◆ initialize()

StatusCode TofSimSvc::initialize ( )
virtual

Definition at line 43 of file TofSimSvc.cxx.

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