#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 () |
Static Public Member Functions | |
static const InterfaceID & | interfaceID () |
Public Attributes | |
IDataProviderSvc * | m_calDataSvc |
EmcStructure * | m_theEmcStruc |
double | m_CrystalEmaxData [6240] |
Definition at line 12 of file EmcCalibConstSvc.h.
EmcCalibConstSvc::EmcCalibConstSvc | ( | const std::string & | name, | |
ISvcLocator * | svcloc | |||
) |
Definition at line 24 of file EmcCalibConstSvc.cxx.
References genRecEmupikp::i, m_CrystalEmaxData, and deljobs::string.
00024 : 00025 Service (name, svcloc) { 00026 00027 00028 for(int i=0;i<6240;i++){ 00029 m_CrystalEmaxData[i]=0; 00030 } 00031 00032 00033 string paraPath = getenv("EMCCALIBCONSTSVCROOT"); 00034 paraPath += "/share/emax_data.dat"; 00035 00036 ifstream in; 00037 in.open(paraPath.c_str()); 00038 assert(in); 00039 int ixtal; 00040 double emaxData; 00041 int Nixt=0; 00042 while (in.peek() != EOF) 00043 { 00044 00045 in >> ixtal>>emaxData; 00046 00047 m_CrystalEmaxData[ixtal]=emaxData; 00048 Nixt++; 00049 } 00050 00051 in.close(); 00052 00053 00054 }
EmcCalibConstSvc::~EmcCalibConstSvc | ( | ) |
void EmcCalibConstSvc::Dump | ( | ) | [virtual] |
Implements IEmcCalibConstSvc.
Definition at line 208 of file EmcCalibConstSvc.cxx.
00209 { 00210 /* 00211 for(int iNo=0;iNo<6;iNo++){ 00212 cout<<"getDigiCalibConst "<<getDigiCalibConst(iNo)<<endl; 00213 } 00214 00215 cout<<"getDigiCalibConstNo "<<getDigiCalibConstNo()<<endl; 00216 00217 00218 cout<<"ind"<<" "<<"getThetaIndex(ind)"<<" " 00219 <<"getPhiIndex(ind)"<<"getPartID"<<endl; 00220 00221 for(int ind=0; ind<6240;ind++){ 00222 00223 cout<<ind<<" "<<getThetaIndex(ind)<<" " 00224 <<getPhiIndex(ind)<<" "<<getPartID(ind)<<endl; 00225 00226 } 00227 00228 cout<<"getIndex(0,5,95)="<<getIndex(0,5,95)<<endl; 00229 cout<<"getIndex(1,43,119)="<<getIndex(1,43,119)<<endl; 00230 cout<<"getIndex(2,5,95)="<<getIndex(2,5,95)<<endl; 00231 cout<<"getIndex(0,5,96)="<<getIndex(0,5,96)<<endl; 00232 cout<<"getIndex(1,43,120)="<<getIndex(1,43,120)<<endl; 00233 cout<<"getIndex(2,5,96)="<<getIndex(2,5,96)<<endl; 00234 00235 for(int i=0;i<6240;i++){ 00236 cout<<i<<"\t"<<getCrystalEmaxData(i) <<endl; 00237 } 00238 */ 00239 00240 }
StatusCode EmcCalibConstSvc::finalize | ( | ) | [virtual] |
Definition at line 96 of file EmcCalibConstSvc.cxx.
References Bes_Common::INFO, and m_theEmcStruc.
00096 { 00097 00098 delete m_theEmcStruc; 00099 00100 MsgStream log(messageService(), name()); 00101 log << MSG::INFO << "EmcCalibConstSvc::finalize()" << endreq; 00102 return StatusCode::SUCCESS; 00103 00104 }
double EmcCalibConstSvc::getCrystalEmaxData | ( | int | Index | ) | const [virtual] |
Implements IEmcCalibConstSvc.
Definition at line 201 of file EmcCalibConstSvc.cxx.
References m_CrystalEmaxData.
00202 { 00203 return m_CrystalEmaxData[Index]; 00204 }
double EmcCalibConstSvc::getDigiCalibConst | ( | int | No | ) | const [virtual] |
Implements IEmcCalibConstSvc.
Definition at line 106 of file EmcCalibConstSvc.cxx.
References calibUtil::ERROR, m_calDataSvc, and deljobs::string.
00107 { 00108 double digiCalibConst = 0.0; 00109 MsgStream log(messageService(), name()); 00110 00111 std::string fullPath = "/Calib/EmcCal"; 00112 SmartDataPtr<CalibData::EmcCalibData> calConst(m_calDataSvc, fullPath); 00113 if( ! calConst ){ 00114 log << MSG::ERROR << "can not access to EmcDigi CalibData via SmartPtr" 00115 << endreq; 00116 }else { 00117 digiCalibConst = calConst->getDigiCalibConst(No); 00118 } 00119 00120 return digiCalibConst; 00121 }
int EmcCalibConstSvc::getDigiCalibConstNo | ( | ) | const [virtual] |
Implements IEmcCalibConstSvc.
Definition at line 140 of file EmcCalibConstSvc.cxx.
References calibUtil::ERROR, m_calDataSvc, and deljobs::string.
00141 { 00142 int digiCalibConstNo = 0; 00143 MsgStream log(messageService(), name()); 00144 00145 std::string fullPath = "/Calib/EmcCal"; 00146 SmartDataPtr<CalibData::EmcCalibData> calConst(m_calDataSvc, fullPath); 00147 if( ! calConst ){ 00148 log << MSG::ERROR << "can not access to EmcDigiNo CalibData via SmartPtr" 00149 << endreq; 00150 }else { 00151 digiCalibConstNo = calConst->getDigiCalibConstNo(); 00152 } 00153 00154 return digiCalibConstNo; 00155 }
int EmcCalibConstSvc::getIndex | ( | unsigned int | PartId, | |
unsigned int | ThetaIndex, | |||
unsigned int | PhiIndex | |||
) | const [virtual] |
Implements IEmcCalibConstSvc.
Definition at line 176 of file EmcCalibConstSvc.cxx.
References EmcStructure::getGeomIndex(), and m_theEmcStruc.
00179 { 00180 return m_theEmcStruc->getGeomIndex(PartId, ThetaIndex, PhiIndex); 00181 }
int EmcCalibConstSvc::getIxtalNumber | ( | int | No | ) | const [virtual] |
Implements IEmcCalibConstSvc.
Definition at line 123 of file EmcCalibConstSvc.cxx.
References calibUtil::ERROR, m_calDataSvc, and deljobs::string.
00124 { 00125 int IxtalNumber = 999999; 00126 MsgStream log(messageService(), name()); 00127 00128 std::string fullPath = "/Calib/EmcCal"; 00129 SmartDataPtr<CalibData::EmcCalibData> calConst(m_calDataSvc, fullPath); 00130 if( ! calConst ){ 00131 log << MSG::ERROR << "can not access to EmcDigi CalibData via SmartPtr" 00132 << endreq; 00133 }else { 00134 IxtalNumber = calConst->getIxtalNumber(No); 00135 } 00136 00137 return IxtalNumber; 00138 }
int EmcCalibConstSvc::getIxtalNumberNo | ( | ) | const [virtual] |
Implements IEmcCalibConstSvc.
Definition at line 157 of file EmcCalibConstSvc.cxx.
References calibUtil::ERROR, m_calDataSvc, and deljobs::string.
00158 { 00159 int IxtalNumberNo = 0; 00160 MsgStream log(messageService(), name()); 00161 00162 std::string fullPath = "/Calib/EmcCal"; 00163 SmartDataPtr<CalibData::EmcCalibData> calConst(m_calDataSvc, fullPath); 00164 if( ! calConst ){ 00165 log << MSG::ERROR << "can not access to EmcDigiNo CalibData via SmartPtr" 00166 << endreq; 00167 }else { 00168 IxtalNumberNo = calConst->getIxtalNumberNo(); 00169 } 00170 00171 return IxtalNumberNo; 00172 }
unsigned int EmcCalibConstSvc::getPartID | ( | int | Index | ) | const [virtual] |
Implements IEmcCalibConstSvc.
Definition at line 184 of file EmcCalibConstSvc.cxx.
References EmcStructure::getPartId(), and m_theEmcStruc.
00185 { 00186 return m_theEmcStruc->getPartId(Index); 00187 }
unsigned int EmcCalibConstSvc::getPhiIndex | ( | int | Index | ) | const [virtual] |
Implements IEmcCalibConstSvc.
Definition at line 194 of file EmcCalibConstSvc.cxx.
References EmcStructure::getPhi(), and m_theEmcStruc.
00195 { 00196 return m_theEmcStruc->getPhi(Index); 00197 }
unsigned int EmcCalibConstSvc::getThetaIndex | ( | int | Index | ) | const [virtual] |
Implements IEmcCalibConstSvc.
Definition at line 189 of file EmcCalibConstSvc.cxx.
References EmcStructure::getTheta(), and m_theEmcStruc.
00190 { 00191 return m_theEmcStruc->getTheta(Index); 00192 }
StatusCode EmcCalibConstSvc::initialize | ( | ) | [virtual] |
Definition at line 69 of file EmcCalibConstSvc.cxx.
References Bes_Common::FATAL, Bes_Common::INFO, m_calDataSvc, m_theEmcStruc, and EmcStructure::setEmcStruc().
00069 { 00070 MsgStream log(messageService(), name()); 00071 log << MSG::INFO << "EmcCalibConstSvc::initialize()" << endreq; 00072 00073 StatusCode sc = Service::initialize(); 00074 if( sc.isFailure() ) return sc; 00075 00076 sc = service("CalibDataSvc", m_calDataSvc, true); 00077 if( sc == StatusCode::SUCCESS ){ 00078 log << MSG::INFO << "Retrieve IDataProviderSvc" << endreq; 00079 }else{ 00080 log << MSG::FATAL << "can not get IDataProviderSvc" << endreq; 00081 } 00082 00083 // sc = service("EmcRecGeoSvc", m_emcGeomSvc); 00084 // if( sc != StatusCode::SUCCESS ){ 00085 // log << MSG::ERROR << "can not use EmcRecGeoSvc" << endreq; 00086 // } 00087 00088 m_theEmcStruc= new EmcStructure() ; 00089 m_theEmcStruc->setEmcStruc(); 00090 00091 // Dump(); 00092 00093 return StatusCode::SUCCESS; 00094 }
static const InterfaceID& IEmcCalibConstSvc::interfaceID | ( | ) | [inline, static, inherited] |
Definition at line 15 of file IEmcCalibConstSvc.h.
References IID_IEmcCalibConstSvc().
00015 { return IID_IEmcCalibConstSvc; }
StatusCode EmcCalibConstSvc::queryInterface | ( | const InterfaceID & | riid, | |
void ** | ppvUnknown | |||
) | [virtual] |
Definition at line 60 of file EmcCalibConstSvc.cxx.
References IID_IEmcCalibConstSvc().
00060 { 00061 if( IID_IEmcCalibConstSvc.versionMatch(riid) ){ 00062 *ppvInterface = static_cast<IEmcCalibConstSvc*> (this); 00063 } else{ 00064 return Service::queryInterface(riid, ppvInterface); 00065 } 00066 return StatusCode::SUCCESS; 00067 }
IDataProviderSvc* EmcCalibConstSvc::m_calDataSvc |
Definition at line 21 of file EmcCalibConstSvc.h.
Referenced by getDigiCalibConst(), getDigiCalibConstNo(), getIxtalNumber(), getIxtalNumberNo(), and initialize().
double EmcCalibConstSvc::m_CrystalEmaxData[6240] |
Reimplemented from IEmcCalibConstSvc.
Definition at line 44 of file EmcCalibConstSvc.h.
Referenced by EmcCalibConstSvc(), and getCrystalEmaxData().
Reimplemented from IEmcCalibConstSvc.
Definition at line 43 of file EmcCalibConstSvc.h.
Referenced by finalize(), getIndex(), getPartID(), getPhiIndex(), getThetaIndex(), and initialize().