BOSS 7.0.1
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 ()
 
 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
 
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 ()
 
static const InterfaceID & interfaceID ()
 

Detailed Description

Constructor & Destructor Documentation

◆ TofSimSvc() [1/2]

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() [1/2]

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}

◆ TofSimSvc() [2/2]

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

◆ ~TofSimSvc() [2/2]

TofSimSvc::~TofSimSvc ( )

Member Function Documentation

◆ BarAttenLength() [1/2]

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}

◆ BarAttenLength() [2/2]

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

Implements ITofSimSvc.

◆ BarConstant() [1/2]

const double TofSimSvc::BarConstant ( )
virtual

Implements ITofSimSvc.

Definition at line 187 of file TofSimSvc.cxx.

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

◆ BarConstant() [2/2]

const double TofSimSvc::BarConstant ( )
virtual

Implements ITofSimSvc.

◆ BarGain1() [1/2]

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}

◆ BarGain1() [2/2]

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

Implements ITofSimSvc.

◆ BarGain2() [1/2]

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}

◆ BarGain2() [2/2]

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

Implements ITofSimSvc.

◆ BarHighThres() [1/2]

const double TofSimSvc::BarHighThres ( )
virtual

Implements ITofSimSvc.

Definition at line 167 of file TofSimSvc.cxx.

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

◆ BarHighThres() [2/2]

const double TofSimSvc::BarHighThres ( )
virtual

Implements ITofSimSvc.

◆ BarLowThres() [1/2]

const double TofSimSvc::BarLowThres ( )
virtual

Implements ITofSimSvc.

Definition at line 163 of file TofSimSvc.cxx.

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

◆ BarLowThres() [2/2]

const double TofSimSvc::BarLowThres ( )
virtual

Implements ITofSimSvc.

◆ BarPMTGain() [1/2]

const double TofSimSvc::BarPMTGain ( )
virtual

Implements ITofSimSvc.

Definition at line 179 of file TofSimSvc.cxx.

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

◆ BarPMTGain() [2/2]

const double TofSimSvc::BarPMTGain ( )
virtual

Implements ITofSimSvc.

◆ Dump() [1/2]

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}

◆ Dump() [2/2]

void TofSimSvc::Dump ( )
virtual

Implements ITofSimSvc.

◆ EndAttenLength() [1/2]

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}

◆ EndAttenLength() [2/2]

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

Implements ITofSimSvc.

◆ EndConstant() [1/2]

const double TofSimSvc::EndConstant ( )
virtual

Implements ITofSimSvc.

Definition at line 191 of file TofSimSvc.cxx.

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

◆ EndConstant() [2/2]

const double TofSimSvc::EndConstant ( )
virtual

Implements ITofSimSvc.

◆ EndGain() [1/2]

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}

◆ EndGain() [2/2]

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

Implements ITofSimSvc.

◆ EndHighThres() [1/2]

const double TofSimSvc::EndHighThres ( )
virtual

Implements ITofSimSvc.

Definition at line 175 of file TofSimSvc.cxx.

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

◆ EndHighThres() [2/2]

const double TofSimSvc::EndHighThres ( )
virtual

Implements ITofSimSvc.

◆ EndLowThres() [1/2]

const double TofSimSvc::EndLowThres ( )
virtual

Implements ITofSimSvc.

Definition at line 171 of file TofSimSvc.cxx.

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

◆ EndLowThres() [2/2]

const double TofSimSvc::EndLowThres ( )
virtual

Implements ITofSimSvc.

◆ EndNoiseSmear() [1/2]

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}

◆ EndNoiseSmear() [2/2]

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

Implements ITofSimSvc.

◆ EndNoiseSwitch() [1/2]

const double TofSimSvc::EndNoiseSwitch ( )
virtual

Implements ITofSimSvc.

Definition at line 195 of file TofSimSvc.cxx.

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

◆ EndNoiseSwitch() [2/2]

const double TofSimSvc::EndNoiseSwitch ( )
virtual

Implements ITofSimSvc.

◆ EndPMTGain() [1/2]

const double TofSimSvc::EndPMTGain ( )
virtual

Implements ITofSimSvc.

Definition at line 183 of file TofSimSvc.cxx.

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

◆ EndPMTGain() [2/2]

const double TofSimSvc::EndPMTGain ( )
virtual

Implements ITofSimSvc.

◆ finalize() [1/2]

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}

◆ finalize() [2/2]

virtual StatusCode TofSimSvc::finalize ( )
virtual

◆ handle() [1/2]

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}

◆ handle() [2/2]

void TofSimSvc::handle ( const Incident &  )

◆ initialize() [1/2]

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}

◆ initialize() [2/2]

virtual StatusCode TofSimSvc::initialize ( )
virtual

◆ queryInterface() [1/2]

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}

◆ queryInterface() [2/2]

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

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