BOSS 7.0.4
BESIII Offline Software System
Loading...
Searching...
No Matches
EstTofCaliSvc Class Reference

#include <EstTofCaliSvc.h>

+ Inheritance diagram for EstTofCaliSvc:

Public Member Functions

 EstTofCaliSvc (const std::string &name, ISvcLocator *svcloc)
 
 ~EstTofCaliSvc ()
 
virtual StatusCode queryInterface (const InterfaceID &riid, void **ppvUnknown)
 
virtual StatusCode initialize ()
 
virtual StatusCode finalize ()
 
void handle (const Incident &)
 
BTofCalBTof (unsigned id) const
 
BTofCommonCalBTofCommon () const
 
ETofCalETof (unsigned id) const
 
EtfCalEtfTof (unsigned int id) const
 
const double BTCorr1 (double ADC, double zHit, unsigned int id)
 
const double BTCorr2 (double ADC, double zHit, unsigned int id)
 
const double TOffset ()
 
const double BTime1 (double ADC, double TDC, double zHit, unsigned id)
 
const double BTime2 (double ADC, double TDC, double zHit, unsigned id)
 
const double ETime (double ADC, double TDC, double rHit, unsigned int id)
 
const double EtfTime (double ADC1, double ADC2, double TDC1, double TDC2, unsigned int id, unsigned int strip)
 
const double EtfTime1 (double ADC, double TDC, double zHit, unsigned int id, unsigned int strip)
 
const double EtfTime2 (double ADC, double TDC, double zHit, unsigned int id, unsigned int strip)
 
const double EtfTime (double TDC1, double TDC2, unsigned int id, unsigned int strip)
 
const bool ValidInfo ()
 
void Dump ()
 
 EstTofCaliSvc (const std::string &name, ISvcLocator *svcloc)
 
 ~EstTofCaliSvc ()
 
virtual StatusCode queryInterface (const InterfaceID &riid, void **ppvUnknown)
 
virtual StatusCode initialize ()
 
virtual StatusCode finalize ()
 
void handle (const Incident &)
 
BTofCalBTof (unsigned id) const
 
BTofCommonCalBTofCommon () const
 
ETofCalETof (unsigned id) const
 
EtfCalEtfTof (unsigned int id) const
 
const double BTCorr1 (double ADC, double zHit, unsigned int id)
 
const double BTCorr2 (double ADC, double zHit, unsigned int id)
 
const double TOffset ()
 
const double BTime1 (double ADC, double TDC, double zHit, unsigned id)
 
const double BTime2 (double ADC, double TDC, double zHit, unsigned id)
 
const double ETime (double ADC, double TDC, double rHit, unsigned int id)
 
const double EtfTime (double ADC1, double ADC2, double TDC1, double TDC2, unsigned int id, unsigned int strip)
 
const double EtfTime1 (double ADC, double TDC, double zHit, unsigned int id, unsigned int strip)
 
const double EtfTime2 (double ADC, double TDC, double zHit, unsigned int id, unsigned int strip)
 
const double EtfTime (double TDC1, double TDC2, unsigned int id, unsigned int strip)
 
const bool ValidInfo ()
 
void Dump ()
 
- Public Member Functions inherited from IEstTofCaliSvc
virtual BTofCalBTof (unsigned id) const =0
 
virtual BTofCommonCalBTofCommon () const =0
 
virtual ETofCalETof (unsigned id) const =0
 
virtual EtfCalEtfTof (unsigned id) const =0
 
virtual const double BTCorr1 (double ADC, double zHit, unsigned int id)=0
 
virtual const double BTCorr2 (double ADC, double zHit, unsigned int id)=0
 
virtual const double TOffset ()=0
 
virtual const double BTime1 (double ADC, double TDC, double zHit, unsigned id)=0
 
virtual const double BTime2 (double ADC, double TDC, double zHit, unsigned id)=0
 
virtual const double ETime (double ADC, double TDC, double rHit, unsigned id)=0
 
virtual const double EtfTime (double ADC1, double ADC2, double TDC1, double TDC2, unsigned int id, unsigned int strip)=0
 
virtual const double EtfTime1 (double ADC, double TDC, double zHit, unsigned id, unsigned strip)=0
 
virtual const double EtfTime2 (double ADC, double TDC, double zHit, unsigned id, unsigned strip)=0
 
virtual const double EtfTime (double TDC1, double TDC2, unsigned int id, unsigned int strip)=0
 
virtual const bool ValidInfo ()=0
 
virtual void Dump ()=0
 
virtual BTofCalBTof (unsigned id) const =0
 
virtual BTofCommonCalBTofCommon () const =0
 
virtual ETofCalETof (unsigned id) const =0
 
virtual EtfCalEtfTof (unsigned id) const =0
 
virtual const double BTCorr1 (double ADC, double zHit, unsigned int id)=0
 
virtual const double BTCorr2 (double ADC, double zHit, unsigned int id)=0
 
virtual const double TOffset ()=0
 
virtual const double BTime1 (double ADC, double TDC, double zHit, unsigned id)=0
 
virtual const double BTime2 (double ADC, double TDC, double zHit, unsigned id)=0
 
virtual const double ETime (double ADC, double TDC, double rHit, unsigned id)=0
 
virtual const double EtfTime (double ADC1, double ADC2, double TDC1, double TDC2, unsigned int id, unsigned int strip)=0
 
virtual const double EtfTime1 (double ADC, double TDC, double zHit, unsigned id, unsigned strip)=0
 
virtual const double EtfTime2 (double ADC, double TDC, double zHit, unsigned id, unsigned strip)=0
 
virtual const double EtfTime (double TDC1, double TDC2, unsigned int id, unsigned int strip)=0
 
virtual const bool ValidInfo ()=0
 
virtual void Dump ()=0
 

Additional Inherited Members

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

Detailed Description

Constructor & Destructor Documentation

◆ EstTofCaliSvc() [1/2]

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

Definition at line 42 of file EstTofCaliSvc.cxx.

42 : Service(name, svcloc) {
43 declareProperty("Run",m_run=1);
44}

◆ ~EstTofCaliSvc() [1/2]

EstTofCaliSvc::~EstTofCaliSvc ( )

Definition at line 95 of file EstTofCaliSvc.cxx.

95 {
96 for(vector<BTofCal*>::iterator it1 = fBTofCal.begin(); it1 != fBTofCal.end(); it1++) { delete (*it1); }
97 fBTofCal.clear();
98 for(vector<ETofCal*>::iterator it2 = fETofCal.begin(); it2 != fETofCal.end(); it2++) { delete (*it2); }
99 fETofCal.clear();
100 if( fEtfCal.size()!=0 ) {
101 for(vector<EtfCal*>::iterator it5 = fEtfCal.begin(); it5 != fEtfCal.end(); it5++) { delete (*it5); }
102 fEtfCal.clear();
103 }
104 for(vector<BTofCommonCal*>::iterator it3 = fBTofCommonCal.begin(); it3 != fBTofCommonCal.end(); it3++) { delete (*it3); }
105 fBTofCommonCal.clear();
106 return;
107}

◆ EstTofCaliSvc() [2/2]

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

◆ ~EstTofCaliSvc() [2/2]

EstTofCaliSvc::~EstTofCaliSvc ( )

Member Function Documentation

◆ BTCorr1() [1/2]

const double EstTofCaliSvc::BTCorr1 ( double  ADC,
double  zHit,
unsigned int  id 
)
virtual

Implements IEstTofCaliSvc.

Referenced by BTime1().

◆ BTCorr1() [2/2]

const double EstTofCaliSvc::BTCorr1 ( double  ADC,
double  zHit,
unsigned int  id 
)
virtual

Implements IEstTofCaliSvc.

◆ BTCorr2() [1/2]

const double EstTofCaliSvc::BTCorr2 ( double  ADC,
double  zHit,
unsigned int  id 
)
virtual

Implements IEstTofCaliSvc.

Referenced by BTime2().

◆ BTCorr2() [2/2]

const double EstTofCaliSvc::BTCorr2 ( double  ADC,
double  zHit,
unsigned int  id 
)
virtual

Implements IEstTofCaliSvc.

◆ BTime1() [1/2]

const double EstTofCaliSvc::BTime1 ( double  ADC,
double  TDC,
double  zHit,
unsigned  id 
)
virtual

Implements IEstTofCaliSvc.

Definition at line 211 of file EstTofCaliSvc.cxx.

211 {
212 MsgStream log(msgSvc(), name());
213
214 double tcorr1 = BTCorr1( ADC, z, id );
215 double tcorr3 = fBTofCommonCal[0]->getOffset(0);
216
217 log << MSG::DEBUG << "BTime1 id =" << id << " tcorr=" << tcorr1 << " total offset=" << tcorr3 << endreq;
218
219 double time = TDC - tcorr1 - tcorr3;
220
221 if(time<0.) {
222 log<<MSG::WARNING<<"TofCaliSvc::BTime1() -- A minus time is given : "<< time <<" [Input] ADC = "<<ADC<<" TDC = "<<TDC<<" z = "<<z<<" ID = "<<id<<endreq;
223 }
224 return time;
225}
Double_t time
const double BTCorr1(double ADC, double zHit, unsigned int id)

◆ BTime1() [2/2]

const double EstTofCaliSvc::BTime1 ( double  ADC,
double  TDC,
double  zHit,
unsigned  id 
)
virtual

Implements IEstTofCaliSvc.

◆ BTime2() [1/2]

const double EstTofCaliSvc::BTime2 ( double  ADC,
double  TDC,
double  zHit,
unsigned  id 
)
virtual

Implements IEstTofCaliSvc.

Definition at line 228 of file EstTofCaliSvc.cxx.

228 {
229 MsgStream log(msgSvc(), name());
230
231 double tcorr1 = BTCorr2( ADC, z, id );
232 double tcorr3 = fBTofCommonCal[0]->getOffset(0);
233
234 log << MSG::DEBUG << "BTime2 id =" << id << " tcorr=" << tcorr1 << " total offset=" << tcorr3 << endreq;
235
236 double time = TDC - tcorr1 - tcorr3;
237
238 if(time<0.) {
239 log<<MSG::WARNING<<"TofCaliSvc::BTime2() -- A minus time is given : "<< time <<" [Input] ADC = "<<ADC<<" TDC = "<<TDC<<" z = "<<z<<" ID = "<<id<<endreq;
240 }
241 return time;
242}
const double BTCorr2(double ADC, double zHit, unsigned int id)

◆ BTime2() [2/2]

const double EstTofCaliSvc::BTime2 ( double  ADC,
double  TDC,
double  zHit,
unsigned  id 
)
virtual

Implements IEstTofCaliSvc.

◆ BTof() [1/2]

BTofCal * EstTofCaliSvc::BTof ( unsigned  id) const
virtual

Implements IEstTofCaliSvc.

Definition at line 391 of file EstTofCaliSvc.cxx.

391 {
392 return fBTofCal[id];
393}

Referenced by Dump().

◆ BTof() [2/2]

BTofCal * EstTofCaliSvc::BTof ( unsigned  id) const
virtual

Implements IEstTofCaliSvc.

◆ BTofCommon() [1/2]

BTofCommonCal * EstTofCaliSvc::BTofCommon ( ) const
virtual

Implements IEstTofCaliSvc.

Definition at line 403 of file EstTofCaliSvc.cxx.

403 {
404 return fBTofCommonCal[0];
405}

◆ BTofCommon() [2/2]

BTofCommonCal * EstTofCaliSvc::BTofCommon ( ) const
virtual

Implements IEstTofCaliSvc.

◆ Dump() [1/2]

void EstTofCaliSvc::Dump ( )
virtual

Implements IEstTofCaliSvc.

Definition at line 407 of file EstTofCaliSvc.cxx.

407 {
408 std::cout<<"Now We can get the TOF Calibtration Service"<<std::endl;
409 std::cout<<"Barrel TOF Counter Number = "<<fBTofCal.size()<<std::endl;
410 std::cout<<"Endcap TOF Counter Number = "<<fETofCal.size()<<std::endl;
411
412 cout<<"The O Barrel TOF PMT1 p1[0] is"<<" "<<BTof(0)->getP1(0)<<endl;
413 cout<<"The 0 Barrel TOF PMT1 p1[1] is"<<" "<<BTof(0)->getP1(1)<<endl;
414}
BTofCal * BTof(unsigned id) const

Referenced by main().

◆ Dump() [2/2]

void EstTofCaliSvc::Dump ( )
virtual

Implements IEstTofCaliSvc.

◆ EtfTime() [1/4]

const double EstTofCaliSvc::EtfTime ( double  ADC1,
double  ADC2,
double  TDC1,
double  TDC2,
unsigned int  id,
unsigned int  strip 
)
virtual

Implements IEstTofCaliSvc.

◆ EtfTime() [2/4]

const double EstTofCaliSvc::EtfTime ( double  ADC1,
double  ADC2,
double  TDC1,
double  TDC2,
unsigned int  id,
unsigned int  strip 
)
virtual

Implements IEstTofCaliSvc.

◆ EtfTime() [3/4]

const double EstTofCaliSvc::EtfTime ( double  TDC1,
double  TDC2,
unsigned int  id,
unsigned int  strip 
)
virtual

Implements IEstTofCaliSvc.

◆ EtfTime() [4/4]

const double EstTofCaliSvc::EtfTime ( double  TDC1,
double  TDC2,
unsigned int  id,
unsigned int  strip 
)
virtual

Implements IEstTofCaliSvc.

◆ EtfTime1() [1/2]

const double EstTofCaliSvc::EtfTime1 ( double  ADC,
double  TDC,
double  zHit,
unsigned int  id,
unsigned int  strip 
)

◆ EtfTime1() [2/2]

const double EstTofCaliSvc::EtfTime1 ( double  ADC,
double  TDC,
double  zHit,
unsigned int  id,
unsigned int  strip 
)

◆ EtfTime2() [1/2]

const double EstTofCaliSvc::EtfTime2 ( double  ADC,
double  TDC,
double  zHit,
unsigned int  id,
unsigned int  strip 
)

◆ EtfTime2() [2/2]

const double EstTofCaliSvc::EtfTime2 ( double  ADC,
double  TDC,
double  zHit,
unsigned int  id,
unsigned int  strip 
)

◆ EtfTof() [1/2]

EtfCal * EstTofCaliSvc::EtfTof ( unsigned int  id) const

◆ EtfTof() [2/2]

EtfCal * EstTofCaliSvc::EtfTof ( unsigned int  id) const

◆ ETime() [1/2]

const double EstTofCaliSvc::ETime ( double  ADC,
double  TDC,
double  rHit,
unsigned int  id 
)

◆ ETime() [2/2]

const double EstTofCaliSvc::ETime ( double  ADC,
double  TDC,
double  rHit,
unsigned int  id 
)

◆ ETof() [1/2]

ETofCal * EstTofCaliSvc::ETof ( unsigned  id) const
virtual

Implements IEstTofCaliSvc.

Definition at line 395 of file EstTofCaliSvc.cxx.

395 {
396 return fETofCal[id];
397}

◆ ETof() [2/2]

ETofCal * EstTofCaliSvc::ETof ( unsigned  id) const
virtual

Implements IEstTofCaliSvc.

◆ finalize() [1/2]

StatusCode EstTofCaliSvc::finalize ( )
virtual

Definition at line 89 of file EstTofCaliSvc.cxx.

89 {
90 MsgStream log(msgSvc(), name());
91 log << MSG::INFO << name() << ": End of Run" << endreq;
92 return StatusCode::SUCCESS;
93}

◆ finalize() [2/2]

virtual StatusCode EstTofCaliSvc::finalize ( )
virtual

◆ handle() [1/2]

void EstTofCaliSvc::handle ( const Incident &  inc)

Definition at line 416 of file EstTofCaliSvc.cxx.

416 {
417 MsgStream log( messageService(), name() );
418 log << MSG::DEBUG << "handle: " << inc.type() << endreq;
419
420 if ( inc.type() == "NewRun" ){
421 log << MSG::DEBUG << "New Run" << endreq;
422 // if(!m_hasbeeninitialized){
423 StatusCode sc= FillfromDatabase();
424 if(sc.isSuccess()){
425 m_hasbeeninitialized=true;
426 }
427 // }
428 }
429}

◆ handle() [2/2]

void EstTofCaliSvc::handle ( const Incident &  )

◆ initialize() [1/2]

StatusCode EstTofCaliSvc::initialize ( )
virtual

Definition at line 56 of file EstTofCaliSvc.cxx.

56 {
57 m_hasbeeninitialized=false;
58 m_st=false;
59
60 MsgStream log(msgSvc(), name());
61 log << MSG::INFO << name() << ": Start of run initialisation" << endreq;
62
63 StatusCode sc = Service::initialize();
64 if ( sc.isFailure() ) return sc;
65
66 IIncidentSvc* incsvc;
67 sc = service("IncidentSvc", incsvc);
68 int priority = 100;
69 if( sc.isSuccess() ){
70 incsvc -> addListener(this, "NewRun", priority);
71 }
72
73 StatusCode scc;
74
75 log<<MSG::INFO << "setProperties()" << endreq;
76 scc = service("CalibDataSvc", m_pCalibDataSvc, true);
77 if ( !scc.isSuccess() ) {
78 log<<MSG::ERROR<<"Could not get IDataProviderSvc interface of CalibXmlCnvSvc"<<endreq;
79 return scc;
80 } else {
81 log << MSG::DEBUG<< "Retrieved IDataProviderSvc interface of CalibXmlCnvSvc"<<endreq;
82 }
83 // Get properties from the JobOptionsSvc
84 scc = setProperties();
85
86 return sc;
87}

Referenced by main().

◆ initialize() [2/2]

virtual StatusCode EstTofCaliSvc::initialize ( )
virtual

◆ queryInterface() [1/2]

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

Definition at line 46 of file EstTofCaliSvc.cxx.

46 {
47
48 if ( IID_IEstTofCaliSvc.versionMatch(riid) ) {
49 *ppvInterface = static_cast<IEstTofCaliSvc*> (this);
50 } else {
51 return Service::queryInterface(riid, ppvInterface) ;
52 }
53 return StatusCode::SUCCESS;
54}

◆ queryInterface() [2/2]

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

◆ TOffset() [1/2]

const double EstTofCaliSvc::TOffset ( )
virtual

Implements IEstTofCaliSvc.

Definition at line 205 of file EstTofCaliSvc.cxx.

205 {
206 double toffset = fBTofCommonCal[0]->getOffset(0);
207 return toffset;
208}

◆ TOffset() [2/2]

const double EstTofCaliSvc::TOffset ( )
virtual

Implements IEstTofCaliSvc.

◆ ValidInfo() [1/2]

const bool EstTofCaliSvc::ValidInfo ( )
inlinevirtual

Implements IEstTofCaliSvc.

Definition at line 52 of file InstallArea/include/EstTofCaliSvc/EstTofCaliSvc/EstTofCaliSvc.h.

52{return m_st;};

◆ ValidInfo() [2/2]

const bool EstTofCaliSvc::ValidInfo ( )
inlinevirtual

Implements IEstTofCaliSvc.

Definition at line 52 of file Tof/EstTofCaliSvc/EstTofCaliSvc-00-00-10/EstTofCaliSvc/EstTofCaliSvc.h.

52{return m_st;};

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