Skip to content
Snippets Groups Projects
Commit b5c4d9c4 authored by Susumu Oda's avatar Susumu Oda
Browse files

Update with working codes

parent 119f7261
No related branches found
No related tags found
No related merge requests found
......@@ -38,6 +38,7 @@ public:
virtual void getSensorsData(std::vector<std::string> & userVector)=0;
//virtual std::string getManufacturer(const IdentifierHash &hashId)=0;
virtual std::string getManufacturer(unsigned int i)=0;
virtual void printManufacturers()=0;
};
......
......@@ -39,6 +39,7 @@ from IOVDbSvc.CondDB import conddb
conddb.dbdata="COMP200"
conddb.addFolderWithTag("SCT_OFL","/SCT/Sensors","SctSensors-Sep03-14")
# Not clear why these tags are not resolved from global tag
conddb.blockFolder("/Indet/Align")
conddb.addFolderWithTag("INDET_OFL","/Indet/Align","InDetAlign-BLK-UPD4-09")
conddb.blockFolder("/Indet/PixelDist")
......@@ -75,17 +76,15 @@ DetFlags.writeRIOPool.all_setOff()
import AtlasGeoModel.SetGeometryVersion
import AtlasGeoModel.GeoModelInit
from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_SensorsSvc
ServiceMgr +=SCT_SensorsSvc()
from AthenaCommon.AlgSequence import AlgSequence
job = AlgSequence()
from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_SensorsTestAlg
job+= SCT_SensorsTestAlg()
from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_SensorsSvc
ServiceMgr +=SCT_SensorsSvc()
#SCT_SensorsSvc.AttrListCollFolders=["/SCT/Sensors"]
import AthenaCommon.AtlasUnixGeneratorJob
......
......@@ -31,7 +31,7 @@ StatusCode SCT_SensorsSvc::initialize(){
if (m_detStore->regFcn(&SCT_SensorsSvc::fillSensorsData, this,
m_sensorsData,sensorsFolderName).isFailure()) {
return msg(MSG::FATAL) << "Failed to register callback function for sensors" << endmsg, StatusCode::FAILURE;
}
}
return StatusCode::SUCCESS;
}
......@@ -53,23 +53,29 @@ StatusCode SCT_SensorsSvc::queryInterface(const InterfaceID& riid, void** ppvInt
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
void SCT_SensorsSvc::getSensorsData(std::vector<std::string> & /*userVector*/){
//for (unsigned int i(0);i!=m_sensorsValues.size();++i){
//userVector.push_back(m_sensorsValues[i]);
//}
void SCT_SensorsSvc::getSensorsData(std::vector<std::string> & userVector){
for (unsigned int i(0);i!=m_sensorsValues.size();++i){
userVector.push_back(m_sensorsValues[i]);
}
}
//std::string SCT_SensorsSvc::getManufacturer(const IdentifierHash &hashId){
std::string SCT_SensorsSvc::getManufacturer(unsigned int i){
std::string manufacturer="";
manufacturer = (*m_sensorsManufacturer)[i];
return manufacturer;
}
void SCT_SensorsSvc::printManufacturers() {
for(auto it: *m_sensorsManufacturer) {
ATH_MSG_INFO("channel " << it.first << " manufacturer " << it.second);
}
}
StatusCode SCT_SensorsSvc::fillSensorsData(int& /* i */ , std::list<std::string>& /*keys*/){
if (m_detStore->retrieve(m_sensorsData,sensorsFolderName).isFailure()) return msg(MSG:: ERROR)<< "Could not fill sensors data" << endmsg, StatusCode::FAILURE;
if (m_detStore->retrieve(m_sensorsData,sensorsFolderName).isFailure()) {
msg(MSG:: ERROR)<< "Could not fill sensors data" << endmsg;
return StatusCode::FAILURE;
}
CondAttrListCollection::const_iterator sensorsData_itr;
for(sensorsData_itr = m_sensorsData->begin(); sensorsData_itr!= m_sensorsData->end(); ++sensorsData_itr)
......
......@@ -56,9 +56,8 @@ public:
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
virtual void getSensorsData(std::vector<std::string> & userVector);
//virtual std::string getManufacturer(const IdentifierHash &hashId);
virtual std::string getManufacturer(unsigned int i);
virtual void printManufacturers();
///Callback for fill from database
virtual StatusCode fillSensorsData(int& i , std::list<std::string>& keys);
......
......@@ -27,7 +27,6 @@
#include <string>
//for o/p to file
#include <iostream>
#include <fstream>
#include <cstdlib>
using namespace std;
......@@ -65,7 +64,8 @@ StatusCode SCT_SensorsTestAlg::execute(){
m_SensorsSvc->getSensorsData(values);
for (std::vector<std::string>::const_iterator i=values.begin();i!=values.end();++i){
cout<< "------------" << *i << "------------" <<endl;
}
}
m_SensorsSvc->printManufacturers();
return sc;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment