BOSS 6.6.4.p01
BESIII Offline Software System
Loading...
Searching...
No Matches
EmcCalibConstSvc Class Reference

#include <EmcCalibConstSvc.h>

+ Inheritance diagram for EmcCalibConstSvc:

Public Member Functions

 EmcCalibConstSvc (const std::string &name, ISvcLocator *svcloc)
 
 ~EmcCalibConstSvc ()
 
virtual StatusCode queryInterface (const InterfaceID &riid, void **ppvUnknown)
 
virtual StatusCode initialize ()
 
virtual StatusCode finalize ()
 
double getDigiCalibConst (int No) const
 
int getIxtalNumber (int No) const
 
int getDigiCalibConstNo () const
 
int getIxtalNumberNo () const
 
int getIndex (unsigned int PartId, unsigned int ThetaIndex, unsigned int PhiIndex) const
 
unsigned int getPartID (int Index) const
 
unsigned int getThetaIndex (int Index) const
 
unsigned int getPhiIndex (int Index) const
 
void Dump ()
 
virtual double getDigiCalibConst (int No) const =0
 
virtual int getIxtalNumber (int No) const =0
 
virtual int getDigiCalibConstNo () const =0
 
virtual int getIxtalNumberNo () const =0
 
virtual int getIndex (unsigned int PartId, unsigned int ThetaIndex, unsigned int PhiIndex) const =0
 
virtual unsigned int getPartID (int Index) const =0
 
virtual unsigned int getThetaIndex (int Index) const =0
 
virtual unsigned int getPhiIndex (int Index) const =0
 
virtual void Dump ()=0
 

Public Attributes

IDataProviderSvc * m_calDataSvc
 
EmcStructurem_theEmcStruc
 
- Public Attributes inherited from IEmcCalibConstSvc
EmcStructurem_theEmcStruc
 

Additional Inherited Members

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

Detailed Description

Definition at line 12 of file EmcCalibConstSvc.h.

Constructor & Destructor Documentation

◆ EmcCalibConstSvc()

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

Definition at line 23 of file EmcCalibConstSvc.cxx.

23 :
24 Service (name, svcloc) {
25}

◆ ~EmcCalibConstSvc()

EmcCalibConstSvc::~EmcCalibConstSvc ( )

Definition at line 27 of file EmcCalibConstSvc.cxx.

27 {
28
29}

Member Function Documentation

◆ Dump()

void EmcCalibConstSvc::Dump ( )
virtual

Implements IEmcCalibConstSvc.

Definition at line 171 of file EmcCalibConstSvc.cxx.

172{
173 for(int iNo=0;iNo<6;iNo++){
174 cout<<"getDigiCalibConst "<<getDigiCalibConst(iNo)<<endl;
175 }
176
177 cout<<"getDigiCalibConstNo "<<getDigiCalibConstNo()<<endl;
178
179
180 cout<<"ind"<<" "<<"getThetaIndex(ind)"<<" "
181 <<"getPhiIndex(ind)"<<"getPartID"<<endl;
182
183 for(int ind=0; ind<6240;ind++){
184
185 cout<<ind<<" "<<getThetaIndex(ind)<<" "
186 <<getPhiIndex(ind)<<" "<<getPartID(ind)<<endl;
187
188 }
189
190 cout<<"getIndex(0,5,95)="<<getIndex(0,5,95)<<endl;
191 cout<<"getIndex(1,43,119)="<<getIndex(1,43,119)<<endl;
192 cout<<"getIndex(2,5,95)="<<getIndex(2,5,95)<<endl;
193 cout<<"getIndex(0,5,96)="<<getIndex(0,5,96)<<endl;
194 cout<<"getIndex(1,43,120)="<<getIndex(1,43,120)<<endl;
195 cout<<"getIndex(2,5,96)="<<getIndex(2,5,96)<<endl;
196
197}
int getIndex(unsigned int PartId, unsigned int ThetaIndex, unsigned int PhiIndex) const
unsigned int getPartID(int Index) const
int getDigiCalibConstNo() const
unsigned int getPhiIndex(int Index) const
unsigned int getThetaIndex(int Index) const
double getDigiCalibConst(int No) const

◆ finalize()

StatusCode EmcCalibConstSvc::finalize ( )
virtual

Definition at line 67 of file EmcCalibConstSvc.cxx.

67 {
68
69 delete m_theEmcStruc;
70
71 MsgStream log(messageService(), name());
72 log << MSG::INFO << "EmcCalibConstSvc::finalize()" << endreq;
73 return StatusCode::SUCCESS;
74
75}
EmcStructure * m_theEmcStruc

◆ getDigiCalibConst()

double EmcCalibConstSvc::getDigiCalibConst ( int  No) const
virtual

Implements IEmcCalibConstSvc.

Definition at line 77 of file EmcCalibConstSvc.cxx.

78 {
79 double digiCalibConst = 0.0;
80 MsgStream log(messageService(), name());
81
82 std::string fullPath = "/Calib/EmcCal";
83 SmartDataPtr<CalibData::EmcCalibData> calConst(m_calDataSvc, fullPath);
84 if( ! calConst ){
85 log << MSG::ERROR << "can not access to EmcDigi CalibData via SmartPtr"
86 << endreq;
87 }else {
88 digiCalibConst = calConst->getDigiCalibConst(No);
89 }
90
91 return digiCalibConst;
92}
IDataProviderSvc * m_calDataSvc

Referenced by Dump().

◆ getDigiCalibConstNo()

int EmcCalibConstSvc::getDigiCalibConstNo ( ) const
virtual

Implements IEmcCalibConstSvc.

Definition at line 111 of file EmcCalibConstSvc.cxx.

112 {
113 int digiCalibConstNo = 0;
114 MsgStream log(messageService(), name());
115
116 std::string fullPath = "/Calib/EmcCal";
117 SmartDataPtr<CalibData::EmcCalibData> calConst(m_calDataSvc, fullPath);
118 if( ! calConst ){
119 log << MSG::ERROR << "can not access to EmcDigiNo CalibData via SmartPtr"
120 << endreq;
121 }else {
122 digiCalibConstNo = calConst->getDigiCalibConstNo();
123 }
124
125 return digiCalibConstNo;
126}

Referenced by Dump().

◆ getIndex()

int EmcCalibConstSvc::getIndex ( unsigned int  PartId,
unsigned int  ThetaIndex,
unsigned int  PhiIndex 
) const
virtual

Implements IEmcCalibConstSvc.

Definition at line 147 of file EmcCalibConstSvc.cxx.

150{
151 return m_theEmcStruc->getGeomIndex(PartId, ThetaIndex, PhiIndex);
152}
int getGeomIndex(unsigned int PartId, unsigned int ThetaIndex, unsigned int PhiIndex) const

Referenced by Dump().

◆ getIxtalNumber()

int EmcCalibConstSvc::getIxtalNumber ( int  No) const
virtual

Implements IEmcCalibConstSvc.

Definition at line 94 of file EmcCalibConstSvc.cxx.

95 {
96 int IxtalNumber = 999999;
97 MsgStream log(messageService(), name());
98
99 std::string fullPath = "/Calib/EmcCal";
100 SmartDataPtr<CalibData::EmcCalibData> calConst(m_calDataSvc, fullPath);
101 if( ! calConst ){
102 log << MSG::ERROR << "can not access to EmcDigi CalibData via SmartPtr"
103 << endreq;
104 }else {
105 IxtalNumber = calConst->getIxtalNumber(No);
106 }
107
108 return IxtalNumber;
109}

◆ getIxtalNumberNo()

int EmcCalibConstSvc::getIxtalNumberNo ( ) const
virtual

Implements IEmcCalibConstSvc.

Definition at line 128 of file EmcCalibConstSvc.cxx.

129 {
130 int IxtalNumberNo = 0;
131 MsgStream log(messageService(), name());
132
133 std::string fullPath = "/Calib/EmcCal";
134 SmartDataPtr<CalibData::EmcCalibData> calConst(m_calDataSvc, fullPath);
135 if( ! calConst ){
136 log << MSG::ERROR << "can not access to EmcDigiNo CalibData via SmartPtr"
137 << endreq;
138 }else {
139 IxtalNumberNo = calConst->getIxtalNumberNo();
140 }
141
142 return IxtalNumberNo;
143}

◆ getPartID()

unsigned int EmcCalibConstSvc::getPartID ( int  Index) const
virtual

Implements IEmcCalibConstSvc.

Definition at line 155 of file EmcCalibConstSvc.cxx.

156{
157 return m_theEmcStruc->getPartId(Index);
158}
unsigned int getPartId(long Index) const
Definition: EmcStructure.h:35

Referenced by Dump().

◆ getPhiIndex()

unsigned int EmcCalibConstSvc::getPhiIndex ( int  Index) const
virtual

Implements IEmcCalibConstSvc.

Definition at line 165 of file EmcCalibConstSvc.cxx.

166{
167 return m_theEmcStruc->getPhi(Index);
168}
unsigned int getPhi(long Index) const
Definition: EmcStructure.h:37

Referenced by Dump().

◆ getThetaIndex()

unsigned int EmcCalibConstSvc::getThetaIndex ( int  Index) const
virtual

Implements IEmcCalibConstSvc.

Definition at line 160 of file EmcCalibConstSvc.cxx.

161{
162 return m_theEmcStruc->getTheta(Index);
163}
unsigned int getTheta(long Index) const
Definition: EmcStructure.h:36

Referenced by Dump().

◆ initialize()

StatusCode EmcCalibConstSvc::initialize ( )
virtual

Definition at line 40 of file EmcCalibConstSvc.cxx.

40 {
41 MsgStream log(messageService(), name());
42 log << MSG::INFO << "EmcCalibConstSvc::initialize()" << endreq;
43
44 StatusCode sc = Service::initialize();
45 if( sc.isFailure() ) return sc;
46
47 sc = service("CalibDataSvc", m_calDataSvc, true);
48 if( sc == StatusCode::SUCCESS ){
49 log << MSG::INFO << "Retrieve IDataProviderSvc" << endreq;
50 }else{
51 log << MSG::FATAL << "can not get IDataProviderSvc" << endreq;
52 }
53
54 // sc = service("EmcRecGeoSvc", m_emcGeomSvc);
55 // if( sc != StatusCode::SUCCESS ){
56 // log << MSG::ERROR << "can not use EmcRecGeoSvc" << endreq;
57 // }
58
61
62 //Dump();
63
64 return StatusCode::SUCCESS;
65}
void setEmcStruc()

◆ queryInterface()

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

Definition at line 31 of file EmcCalibConstSvc.cxx.

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

Member Data Documentation

◆ m_calDataSvc

IDataProviderSvc* EmcCalibConstSvc::m_calDataSvc

◆ m_theEmcStruc

EmcStructure* EmcCalibConstSvc::m_theEmcStruc

Definition at line 42 of file EmcCalibConstSvc.h.

Referenced by finalize(), getIndex(), getPartID(), getPhiIndex(), getThetaIndex(), and initialize().


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