BOSS 7.0.5
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
 
double getCrystalEmaxData (int Index) const
 
void Dump ()
 
 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
 
double getCrystalEmaxData (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 double getCrystalEmaxData (int Index) const =0
 
virtual void Dump ()=0
 
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 double getCrystalEmaxData (int Index) const =0
 
virtual void Dump ()=0
 

Public Attributes

IDataProviderSvc * m_calDataSvc
 
EmcStructurem_theEmcStruc
 
double m_CrystalEmaxData [6240]
 
- Public Attributes inherited from IEmcCalibConstSvc
EmcStructurem_theEmcStruc
 
double m_CrystalEmaxData [6240]
 

Additional Inherited Members

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

Detailed Description

Constructor & Destructor Documentation

◆ EmcCalibConstSvc() [1/2]

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

Definition at line 24 of file EmcCalibConstSvc.cxx.

24 :
25 Service (name, svcloc) {
26
27
28 for(int i=0;i<6240;i++){
30 }
31
32
33 string paraPath = getenv("EMCCALIBCONSTSVCROOT");
34 paraPath += "/share/emax_data.dat";
35
36 ifstream in;
37 in.open(paraPath.c_str());
38 assert(in);
39 int ixtal;
40 double emaxData;
41 int Nixt=0;
42 while (in.peek() != EOF)
43 {
44
45 in >> ixtal>>emaxData;
46
47 m_CrystalEmaxData[ixtal]=emaxData;
48 Nixt++;
49 }
50
51 in.close();
52
53
54}

◆ ~EmcCalibConstSvc() [1/2]

EmcCalibConstSvc::~EmcCalibConstSvc ( )

Definition at line 56 of file EmcCalibConstSvc.cxx.

56 {
57
58}

◆ EmcCalibConstSvc() [2/2]

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

◆ ~EmcCalibConstSvc() [2/2]

EmcCalibConstSvc::~EmcCalibConstSvc ( )

Member Function Documentation

◆ Dump() [1/2]

void EmcCalibConstSvc::Dump ( )
virtual

Implements IEmcCalibConstSvc.

Definition at line 208 of file EmcCalibConstSvc.cxx.

209{
210 /*
211 for(int iNo=0;iNo<6;iNo++){
212 cout<<"getDigiCalibConst "<<getDigiCalibConst(iNo)<<endl;
213 }
214
215 cout<<"getDigiCalibConstNo "<<getDigiCalibConstNo()<<endl;
216
217
218 cout<<"ind"<<" "<<"getThetaIndex(ind)"<<" "
219 <<"getPhiIndex(ind)"<<"getPartID"<<endl;
220
221 for(int ind=0; ind<6240;ind++){
222
223 cout<<ind<<" "<<getThetaIndex(ind)<<" "
224 <<getPhiIndex(ind)<<" "<<getPartID(ind)<<endl;
225
226 }
227
228 cout<<"getIndex(0,5,95)="<<getIndex(0,5,95)<<endl;
229 cout<<"getIndex(1,43,119)="<<getIndex(1,43,119)<<endl;
230 cout<<"getIndex(2,5,95)="<<getIndex(2,5,95)<<endl;
231 cout<<"getIndex(0,5,96)="<<getIndex(0,5,96)<<endl;
232 cout<<"getIndex(1,43,120)="<<getIndex(1,43,120)<<endl;
233 cout<<"getIndex(2,5,96)="<<getIndex(2,5,96)<<endl;
234
235 for(int i=0;i<6240;i++){
236 cout<<i<<"\t"<<getCrystalEmaxData(i) <<endl;
237 }
238 */
239
240}

◆ Dump() [2/2]

void EmcCalibConstSvc::Dump ( )
virtual

Implements IEmcCalibConstSvc.

◆ finalize() [1/2]

StatusCode EmcCalibConstSvc::finalize ( )
virtual

Definition at line 96 of file EmcCalibConstSvc.cxx.

96 {
97
98 delete m_theEmcStruc;
99
100 MsgStream log(messageService(), name());
101 log << MSG::INFO << "EmcCalibConstSvc::finalize()" << endreq;
102 return StatusCode::SUCCESS;
103
104}

◆ finalize() [2/2]

virtual StatusCode EmcCalibConstSvc::finalize ( )
virtual

◆ getCrystalEmaxData() [1/2]

double EmcCalibConstSvc::getCrystalEmaxData ( int  Index) const
virtual

Implements IEmcCalibConstSvc.

Definition at line 201 of file EmcCalibConstSvc.cxx.

202{
203 return m_CrystalEmaxData[Index];
204}

◆ getCrystalEmaxData() [2/2]

double EmcCalibConstSvc::getCrystalEmaxData ( int  Index) const
virtual

Implements IEmcCalibConstSvc.

◆ getDigiCalibConst() [1/2]

double EmcCalibConstSvc::getDigiCalibConst ( int  No) const
virtual

Implements IEmcCalibConstSvc.

Definition at line 106 of file EmcCalibConstSvc.cxx.

107 {
108 double digiCalibConst = 0.0;
109 MsgStream log(messageService(), name());
110
111 std::string fullPath = "/Calib/EmcCal";
112 SmartDataPtr<CalibData::EmcCalibData> calConst(m_calDataSvc, fullPath);
113 if( ! calConst ){
114 log << MSG::ERROR << "can not access to EmcDigi CalibData via SmartPtr"
115 << endreq;
116 }else {
117 digiCalibConst = calConst->getDigiCalibConst(No);
118 }
119
120 return digiCalibConst;
121}

◆ getDigiCalibConst() [2/2]

double EmcCalibConstSvc::getDigiCalibConst ( int  No) const
virtual

Implements IEmcCalibConstSvc.

◆ getDigiCalibConstNo() [1/2]

int EmcCalibConstSvc::getDigiCalibConstNo ( ) const
virtual

Implements IEmcCalibConstSvc.

Definition at line 140 of file EmcCalibConstSvc.cxx.

141 {
142 int digiCalibConstNo = 0;
143 MsgStream log(messageService(), name());
144
145 std::string fullPath = "/Calib/EmcCal";
146 SmartDataPtr<CalibData::EmcCalibData> calConst(m_calDataSvc, fullPath);
147 if( ! calConst ){
148 log << MSG::ERROR << "can not access to EmcDigiNo CalibData via SmartPtr"
149 << endreq;
150 }else {
151 digiCalibConstNo = calConst->getDigiCalibConstNo();
152 }
153
154 return digiCalibConstNo;
155}

◆ getDigiCalibConstNo() [2/2]

int EmcCalibConstSvc::getDigiCalibConstNo ( ) const
virtual

Implements IEmcCalibConstSvc.

◆ getIndex() [1/2]

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

Implements IEmcCalibConstSvc.

Definition at line 176 of file EmcCalibConstSvc.cxx.

179{
180 return m_theEmcStruc->getGeomIndex(PartId, ThetaIndex, PhiIndex);
181}
int getGeomIndex(unsigned int PartId, unsigned int ThetaIndex, unsigned int PhiIndex) const

◆ getIndex() [2/2]

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

Implements IEmcCalibConstSvc.

◆ getIxtalNumber() [1/2]

int EmcCalibConstSvc::getIxtalNumber ( int  No) const
virtual

Implements IEmcCalibConstSvc.

Definition at line 123 of file EmcCalibConstSvc.cxx.

124 {
125 int IxtalNumber = 999999;
126 MsgStream log(messageService(), name());
127
128 std::string fullPath = "/Calib/EmcCal";
129 SmartDataPtr<CalibData::EmcCalibData> calConst(m_calDataSvc, fullPath);
130 if( ! calConst ){
131 log << MSG::ERROR << "can not access to EmcDigi CalibData via SmartPtr"
132 << endreq;
133 }else {
134 IxtalNumber = calConst->getIxtalNumber(No);
135 }
136
137 return IxtalNumber;
138}

◆ getIxtalNumber() [2/2]

int EmcCalibConstSvc::getIxtalNumber ( int  No) const
virtual

Implements IEmcCalibConstSvc.

◆ getIxtalNumberNo() [1/2]

int EmcCalibConstSvc::getIxtalNumberNo ( ) const
virtual

Implements IEmcCalibConstSvc.

Definition at line 157 of file EmcCalibConstSvc.cxx.

158 {
159 int IxtalNumberNo = 0;
160 MsgStream log(messageService(), name());
161
162 std::string fullPath = "/Calib/EmcCal";
163 SmartDataPtr<CalibData::EmcCalibData> calConst(m_calDataSvc, fullPath);
164 if( ! calConst ){
165 log << MSG::ERROR << "can not access to EmcDigiNo CalibData via SmartPtr"
166 << endreq;
167 }else {
168 IxtalNumberNo = calConst->getIxtalNumberNo();
169 }
170
171 return IxtalNumberNo;
172}

◆ getIxtalNumberNo() [2/2]

int EmcCalibConstSvc::getIxtalNumberNo ( ) const
virtual

Implements IEmcCalibConstSvc.

◆ getPartID() [1/2]

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

Implements IEmcCalibConstSvc.

Definition at line 184 of file EmcCalibConstSvc.cxx.

185{
186 return m_theEmcStruc->getPartId(Index);
187}

◆ getPartID() [2/2]

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

Implements IEmcCalibConstSvc.

◆ getPhiIndex() [1/2]

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

Implements IEmcCalibConstSvc.

Definition at line 194 of file EmcCalibConstSvc.cxx.

195{
196 return m_theEmcStruc->getPhi(Index);
197}

◆ getPhiIndex() [2/2]

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

Implements IEmcCalibConstSvc.

◆ getThetaIndex() [1/2]

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

Implements IEmcCalibConstSvc.

Definition at line 189 of file EmcCalibConstSvc.cxx.

190{
191 return m_theEmcStruc->getTheta(Index);
192}

◆ getThetaIndex() [2/2]

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

Implements IEmcCalibConstSvc.

◆ initialize() [1/2]

StatusCode EmcCalibConstSvc::initialize ( )
virtual

Definition at line 69 of file EmcCalibConstSvc.cxx.

69 {
70 MsgStream log(messageService(), name());
71 log << MSG::INFO << "EmcCalibConstSvc::initialize()" << endreq;
72
73 StatusCode sc = Service::initialize();
74 if( sc.isFailure() ) return sc;
75
76 sc = service("CalibDataSvc", m_calDataSvc, true);
77 if( sc == StatusCode::SUCCESS ){
78 log << MSG::INFO << "Retrieve IDataProviderSvc" << endreq;
79 }else{
80 log << MSG::FATAL << "can not get IDataProviderSvc" << endreq;
81 }
82
83 // sc = service("EmcRecGeoSvc", m_emcGeomSvc);
84 // if( sc != StatusCode::SUCCESS ){
85 // log << MSG::ERROR << "can not use EmcRecGeoSvc" << endreq;
86 // }
87
90
91 // Dump();
92
93 return StatusCode::SUCCESS;
94}
void setEmcStruc()

◆ initialize() [2/2]

virtual StatusCode EmcCalibConstSvc::initialize ( )
virtual

◆ queryInterface() [1/2]

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

Definition at line 60 of file EmcCalibConstSvc.cxx.

60 {
61 if( IID_IEmcCalibConstSvc.versionMatch(riid) ){
62 *ppvInterface = static_cast<IEmcCalibConstSvc*> (this);
63 } else{
64 return Service::queryInterface(riid, ppvInterface);
65 }
66 return StatusCode::SUCCESS;
67}

◆ queryInterface() [2/2]

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

Member Data Documentation

◆ m_calDataSvc

◆ m_CrystalEmaxData

double EmcCalibConstSvc::m_CrystalEmaxData

◆ m_theEmcStruc


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