BOSS 7.0.9
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 queryInterface (const InterfaceID &riid, void **ppvUnknown)
 
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 ()
 
virtual const double BarLowThres ()=0
 
virtual const double BarHighThres ()=0
 
virtual const double EndLowThres ()=0
 
virtual const double EndHighThres ()=0
 
virtual const double BarPMTGain ()=0
 
virtual const double EndPMTGain ()=0
 
virtual const double BarConstant ()=0
 
virtual const double EndConstant ()=0
 
virtual const double EndNoiseSwitch ()=0
 
virtual const double BarGain1 (unsigned int id)=0
 
virtual const double BarGain2 (unsigned int id)=0
 
virtual const double EndGain (unsigned int id)=0
 
virtual const double BarAttenLength (unsigned int id)=0
 
virtual const double EndAttenLength (unsigned int id)=0
 
virtual const double EndNoiseSmear (unsigned int id)=0
 
virtual void Dump ()=0
 

Additional Inherited Members

- Static Public Member Functions inherited from ITofSimSvc
static const InterfaceID & interfaceID ()
 

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 28 of file TofSimSvc.cxx.

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

◆ ~TofSimSvc()

TofSimSvc::~TofSimSvc ( )

Definition at line 80 of file TofSimSvc.cxx.

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

Member Function Documentation

◆ BarAttenLength()

const double TofSimSvc::BarAttenLength ( unsigned int  id)
virtual

Implements ITofSimSvc.

Definition at line 229 of file TofSimSvc.cxx.

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

◆ BarConstant()

const double TofSimSvc::BarConstant ( )
virtual

Implements ITofSimSvc.

Definition at line 187 of file TofSimSvc.cxx.

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

◆ BarGain1()

const double TofSimSvc::BarGain1 ( unsigned int  id)
virtual

Implements ITofSimSvc.

Definition at line 199 of file TofSimSvc.cxx.

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

◆ BarGain2()

const double TofSimSvc::BarGain2 ( unsigned int  id)
virtual

Implements ITofSimSvc.

Definition at line 209 of file TofSimSvc.cxx.

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

◆ BarHighThres()

const double TofSimSvc::BarHighThres ( )
virtual

Implements ITofSimSvc.

Definition at line 167 of file TofSimSvc.cxx.

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

◆ BarLowThres()

const double TofSimSvc::BarLowThres ( )
virtual

Implements ITofSimSvc.

Definition at line 163 of file TofSimSvc.cxx.

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

◆ BarPMTGain()

const double TofSimSvc::BarPMTGain ( )
virtual

Implements ITofSimSvc.

Definition at line 179 of file TofSimSvc.cxx.

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

◆ Dump()

void TofSimSvc::Dump ( )
virtual

Implements ITofSimSvc.

Definition at line 144 of file TofSimSvc.cxx.

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

◆ EndAttenLength()

const double TofSimSvc::EndAttenLength ( unsigned int  id)
virtual

Implements ITofSimSvc.

Definition at line 239 of file TofSimSvc.cxx.

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

◆ EndConstant()

const double TofSimSvc::EndConstant ( )
virtual

Implements ITofSimSvc.

Definition at line 191 of file TofSimSvc.cxx.

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

◆ EndGain()

const double TofSimSvc::EndGain ( unsigned int  id)
virtual

Implements ITofSimSvc.

Definition at line 219 of file TofSimSvc.cxx.

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

◆ EndHighThres()

const double TofSimSvc::EndHighThres ( )
virtual

Implements ITofSimSvc.

Definition at line 175 of file TofSimSvc.cxx.

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

◆ EndLowThres()

const double TofSimSvc::EndLowThres ( )
virtual

Implements ITofSimSvc.

Definition at line 171 of file TofSimSvc.cxx.

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

◆ EndNoiseSmear()

const double TofSimSvc::EndNoiseSmear ( unsigned int  id)
virtual

Implements ITofSimSvc.

Definition at line 249 of file TofSimSvc.cxx.

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

◆ EndNoiseSwitch()

const double TofSimSvc::EndNoiseSwitch ( )
virtual

Implements ITofSimSvc.

Definition at line 195 of file TofSimSvc.cxx.

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

◆ EndPMTGain()

const double TofSimSvc::EndPMTGain ( )
virtual

Implements ITofSimSvc.

Definition at line 183 of file TofSimSvc.cxx.

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

◆ finalize()

StatusCode TofSimSvc::finalize ( )
virtual

Definition at line 74 of file TofSimSvc.cxx.

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

◆ handle()

void TofSimSvc::handle ( const Incident &  inc)

Definition at line 149 of file TofSimSvc.cxx.

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

◆ initialize()

StatusCode TofSimSvc::initialize ( )
virtual

Definition at line 42 of file TofSimSvc.cxx.

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

◆ queryInterface()

StatusCode TofSimSvc::queryInterface ( const InterfaceID &  riid,
void **  ppvUnknown 
)
virtual

Definition at line 32 of file TofSimSvc.cxx.

32 {
33
34 if ( IID_ITofSimSvc.versionMatch(riid) ) {
35 *ppvInterface = static_cast<ITofSimSvc*> (this);
36 } else {
37 return Service::queryInterface(riid, ppvInterface) ;
38 }
39 return StatusCode::SUCCESS;
40}

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