diff --git a/Control/AthenaExamples/UserDataExamples/CMakeLists.txt b/Control/AthenaExamples/UserDataExamples/CMakeLists.txt index 49b694fbf1618e169b8abc7a092553846205872a..d38a56ded2f62349ee7d58eb8a4092b26a3dfde2 100644 --- a/Control/AthenaExamples/UserDataExamples/CMakeLists.txt +++ b/Control/AthenaExamples/UserDataExamples/CMakeLists.txt @@ -10,7 +10,7 @@ atlas_depends_on_subdirs( PRIVATE Calorimeter/CaloEvent Control/AthenaBaseComps Control/AthenaKernel - Control/DataModel + Control/AthContainers GaudiKernel TestPolicy ) @@ -22,7 +22,7 @@ atlas_add_component( UserDataExamples src/*.cxx src/components/*.cxx INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} CaloEvent AthenaBaseComps AthenaKernel DataModel GaudiKernel ) + LINK_LIBRARIES ${ROOT_LIBRARIES} CaloEvent AthenaBaseComps AthenaKernel AthContainers GaudiKernel ) # Install files from the package: atlas_install_headers( UserDataExamples ) diff --git a/Control/AthenaExamples/UserDataExamples/cmt/requirements b/Control/AthenaExamples/UserDataExamples/cmt/requirements index f9773f82b6ea3e33f4f1658bdbfb656c38a631fd..69ba40c4a3227b62871b3fc05b40b7cc0b13564f 100644 --- a/Control/AthenaExamples/UserDataExamples/cmt/requirements +++ b/Control/AthenaExamples/UserDataExamples/cmt/requirements @@ -10,8 +10,8 @@ private use GaudiInterface GaudiInterface-* External use AthenaKernel AthenaKernel-* Control use AthenaBaseComps AthenaBaseComps-* Control -use CaloEvent CaloEvent-* Calorimeter -use DataModel DataModel-* Control +use CaloEvent CaloEvent-* Calorimeter +use AthContainers AthContainers-* Control end_private library UserDataExamples *.cxx -s=components *.cxx diff --git a/Control/AthenaExamples/UserDataExamples/src/CreateDataWithUserData.cxx b/Control/AthenaExamples/UserDataExamples/src/CreateDataWithUserData.cxx index 0975dbe18dc7c94056cd4cb01ca134f111328551..618c55f6d6af4a8bfd1cdb23762bb10b7c6e8219 100644 --- a/Control/AthenaExamples/UserDataExamples/src/CreateDataWithUserData.cxx +++ b/Control/AthenaExamples/UserDataExamples/src/CreateDataWithUserData.cxx @@ -4,7 +4,7 @@ #include "CreateDataWithUserData.h" #include "CaloEvent/CaloClusterContainer.h" -#include "DataModel/UserDataStore.h" +#include "AthContainers/UserDataStore.h" #include "AthenaKernel/errorcheck.h" using namespace UserDataExamples; @@ -16,9 +16,9 @@ CreateDataWithUserData::CreateDataWithUserData( const std::string& name, declareProperty("UserDataSvc",m_userDataSvc); declareProperty("ContainerName",m_contName=""); declareProperty("VecSize",m_vecSize=10); - nEvents=0; - nClusters=0; - nAttributes=0; + m_nEvents=0; + m_nClusters=0; + m_nAttributes=0; } // Destructor @@ -32,7 +32,7 @@ StatusCode CreateDataWithUserData::initialize() { StatusCode sc=m_userDataSvc.retrieve(); if (sc.isFailure()) { - msg(MSG::ERROR) << "Failed to retrieve UserDataSvc " << m_userDataSvc << endreq; + msg(MSG::ERROR) << "Failed to retrieve UserDataSvc " << m_userDataSvc << endmsg; return sc; } @@ -42,7 +42,7 @@ StatusCode CreateDataWithUserData::initialize() { } StatusCode CreateDataWithUserData::finalize() { - msg(MSG::INFO) << "Counters: Events: " << nEvents << ", Clusters: " << nClusters << ", Attributes: " << nAttributes << endreq; + msg(MSG::INFO) << "Counters: Events: " << m_nEvents << ", Clusters: " << m_nClusters << ", Attributes: " << m_nAttributes << endmsg; return StatusCode::SUCCESS; } @@ -54,12 +54,12 @@ StatusCode CreateDataWithUserData::execute() { std::vector<float> vecf(m_vecSize,5.5); std::vector<double> vecd(m_vecSize,5.55); - ++nEvents; + ++m_nEvents; CaloClusterContainer* clusterContainer=new CaloClusterContainer(); StatusCode sc=evtStore()->record(clusterContainer,m_contName); if (sc.isFailure()) { - msg(MSG::ERROR) << "Failed to record CaloClusterContainer with name " << m_contName << endreq; + msg(MSG::ERROR) << "Failed to record CaloClusterContainer with name " << m_contName << endmsg; return sc; } std::string label; @@ -67,7 +67,7 @@ StatusCode CreateDataWithUserData::execute() { for(unsigned nClu=0;nClu<500;++nClu) { CaloCluster* cluster=new CaloCluster(1.0,1.0); clusterContainer->push_back(cluster); - ++nClusters; + ++m_nClusters; //Create 20 attributes for caloCluster: for (unsigned i=0;i<2;++i) { std::stringstream sLabel; @@ -75,12 +75,12 @@ StatusCode CreateDataWithUserData::execute() { label=sLabel.str(); sc=m_userDataSvc->decorateElement(*cluster,label,counter); if (sc.isFailure()) { - msg(MSG::ERROR) << "Failed to decorate CaloCluster with an attribute called " << label << endreq; + msg(MSG::ERROR) << "Failed to decorate CaloCluster with an attribute called " << label << endmsg; return sc; } else { ATH_MSG_DEBUG("Successfully decorate CaloCluster with an attribute called " << label); - ++nAttributes; + ++m_nAttributes; } int counterOut=0; @@ -92,12 +92,12 @@ StatusCode CreateDataWithUserData::execute() { label=sLabel.str()+"d"; sc=m_userDataSvc->decorateElement(*cluster,label,dbl); if (sc.isFailure()) { - msg(MSG::ERROR) << "Failed to decorate CaloCluster with an attribute called " << label << endreq; + msg(MSG::ERROR) << "Failed to decorate CaloCluster with an attribute called " << label << endmsg; return sc; } else { ATH_MSG_DEBUG("Successfully decorate CaloCluster with an attribute called " << label); - ++nAttributes; + ++m_nAttributes; } double dblOut=0; @@ -110,12 +110,12 @@ StatusCode CreateDataWithUserData::execute() { label=sLabel.str()+"u"; sc=m_userDataSvc->decorateElement(*cluster,label,cnt_u); if (sc.isFailure()) { - msg(MSG::ERROR) << "Failed to decorate CaloCluster with an attribute called " << label << endreq; + msg(MSG::ERROR) << "Failed to decorate CaloCluster with an attribute called " << label << endmsg; return sc; } else { ATH_MSG_DEBUG("Successfully decorate CaloCluster with an attribute called " << label); - ++nAttributes; + ++m_nAttributes; } @@ -129,12 +129,12 @@ StatusCode CreateDataWithUserData::execute() { label=sLabel.str()+"f"; sc=m_userDataSvc->decorateElement(*cluster,label,cnt_f); if (sc.isFailure()) { - msg(MSG::ERROR) << "Failed to decorate CaloCluster with an attribute called " << label << endreq; + msg(MSG::ERROR) << "Failed to decorate CaloCluster with an attribute called " << label << endmsg; return sc; } else { ATH_MSG_DEBUG("Successfully decorate CaloCluster with an attribute called " << label); - ++nAttributes; + ++m_nAttributes; } float cnt_fOut=0; @@ -147,12 +147,12 @@ StatusCode CreateDataWithUserData::execute() { label=sLabel.str()+"b"; sc=m_userDataSvc->decorateElement(*cluster,label,b); if (sc.isFailure()) { - msg(MSG::ERROR) << "Failed to decorate CaloCluster with an attribute called " << label << endreq; + msg(MSG::ERROR) << "Failed to decorate CaloCluster with an attribute called " << label << endmsg; return sc; } else { ATH_MSG_DEBUG("Successfully decorate CaloCluster with an attribute called " << label); - ++nAttributes; + ++m_nAttributes; } bool bout=false; CHECK(m_userDataSvc->getElementDecoration(*cluster,label,bout)); @@ -163,14 +163,14 @@ StatusCode CreateDataWithUserData::execute() { //std::string l=labelidx+"vVirt"; label=sLabel.str()+"vVirt"; if (m_userDataSvc->vdecorateElement(*cluster,label,typeid(std::vector<int32_t>),x)) { - msg(MSG::ERROR) << "vdecorateElement failed" << endreq; + msg(MSG::ERROR) << "vdecorateElement failed" << endmsg; return StatusCode::FAILURE; } void* vecOut=0; int stat=m_userDataSvc->vgetElementDecoration(*cluster,label,typeid(std::vector<int32_t>),vecOut); if (stat) { - msg(MSG::ERROR) << "vgetElementDecoration with label=" << label << " failed." << endreq; + msg(MSG::ERROR) << "vgetElementDecoration with label=" << label << " failed." << endmsg; return StatusCode::FAILURE; } @@ -181,12 +181,12 @@ StatusCode CreateDataWithUserData::execute() { label=sLabel.str()+"v"; sc=m_userDataSvc->decorateElement(*cluster,label,vec); if (sc.isFailure()) { - msg(MSG::ERROR) << "Failed to decorate CaloCluster with an attribute called " << label << endreq; + msg(MSG::ERROR) << "Failed to decorate CaloCluster with an attribute called " << label << endmsg; return sc; } else { ATH_MSG_DEBUG("Successfully decorate CaloCluster with an attribute called " << label); - ++nAttributes; + ++m_nAttributes; } @@ -198,12 +198,12 @@ StatusCode CreateDataWithUserData::execute() { label=sLabel.str()+"vu"; sc=m_userDataSvc->decorateElement(*cluster,label,vecu); if (sc.isFailure()) { - msg(MSG::ERROR) << "Failed to decorate CaloCluster with an attribute called " << label << endreq; + msg(MSG::ERROR) << "Failed to decorate CaloCluster with an attribute called " << label << endmsg; return sc; } else { ATH_MSG_DEBUG("Successfully decorate CaloCluster with an attribute called " << label); - ++nAttributes; + ++m_nAttributes; } std::vector<uint32_t> vecuOut; @@ -214,12 +214,12 @@ StatusCode CreateDataWithUserData::execute() { label=sLabel.str()+"vf"; sc=m_userDataSvc->decorateElement(*cluster,label,vecf); if (sc.isFailure()) { - msg(MSG::ERROR) << "Failed to decorate CaloCluster with an attribute called " << label << endreq; + msg(MSG::ERROR) << "Failed to decorate CaloCluster with an attribute called " << label << endmsg; return sc; } else { ATH_MSG_DEBUG("Successfully decorate CaloCluster with an attribute called " << label); - ++nAttributes; + ++m_nAttributes; } std::vector<float> vecfOut; @@ -230,12 +230,12 @@ StatusCode CreateDataWithUserData::execute() { label=sLabel.str()+"vd"; sc=m_userDataSvc->decorateElement(*cluster,label,vecd); if (sc.isFailure()) { - msg(MSG::ERROR) << "Failed to decorate CaloCluster with an attribute called " << label << endreq; + msg(MSG::ERROR) << "Failed to decorate CaloCluster with an attribute called " << label << endmsg; return sc; } else { ATH_MSG_DEBUG("Successfully decorate CaloCluster with an attribute called " << label); - ++nAttributes; + ++m_nAttributes; } std::vector<double> vecdOut; @@ -249,7 +249,7 @@ StatusCode CreateDataWithUserData::execute() { label="EventDeco"; sc=m_userDataSvc->decorateEvent(label,42.0); if (sc.isFailure()) { - msg(MSG::ERROR) << "Failed to record EventDecoration called " << label << endreq; + msg(MSG::ERROR) << "Failed to record EventDecoration called " << label << endmsg; } double fOut = 0; diff --git a/Control/AthenaExamples/UserDataExamples/src/CreateDataWithUserData.h b/Control/AthenaExamples/UserDataExamples/src/CreateDataWithUserData.h index 27df0b2106c5131c5d54cab5d0bf9874862668d1..c3d8a6691cb96c2df270d412dc915961dfa20d42 100644 --- a/Control/AthenaExamples/UserDataExamples/src/CreateDataWithUserData.h +++ b/Control/AthenaExamples/UserDataExamples/src/CreateDataWithUserData.h @@ -42,9 +42,9 @@ namespace UserDataExamples { unsigned m_vecSize; //counters: - unsigned nEvents; - unsigned nClusters; - unsigned nAttributes; + unsigned m_nEvents; + unsigned m_nClusters; + unsigned m_nAttributes; template<typename T> bool checkvalues(const T& a, const T& b, const std::string& label); @@ -56,7 +56,7 @@ namespace UserDataExamples { if (a==b) return true; else { - msg(MSG::ERROR) << "Values with label << " << label << " differ!" << endreq; + msg(MSG::ERROR) << "Values with label << " << label << " differ!" << endmsg; return false; } } diff --git a/Control/AthenaExamples/UserDataExamples/src/ReadDataWithUserData.cxx b/Control/AthenaExamples/UserDataExamples/src/ReadDataWithUserData.cxx index a0ccb481bdd0c6dc44fc958aa88f1a3131d6014d..183b9bf8194290e10e1867fc1ce8f5bf6e502a20 100644 --- a/Control/AthenaExamples/UserDataExamples/src/ReadDataWithUserData.cxx +++ b/Control/AthenaExamples/UserDataExamples/src/ReadDataWithUserData.cxx @@ -4,7 +4,7 @@ #include "ReadDataWithUserData.h" #include "CaloEvent/CaloClusterContainer.h" -#include "DataModel/UserDataStore.h" +#include "AthContainers/UserDataStore.h" #include "AthenaKernel/errorcheck.h" using namespace UserDataExamples; @@ -16,7 +16,7 @@ ReadDataWithUserData::ReadDataWithUserData( const std::string& name, declareProperty("UserDataSvc",m_userDataSvc); declareProperty("ContainerName",m_contName=""); m_events=0; - nAttributes=0; + m_nAttributes=0; } // Destructor @@ -30,7 +30,7 @@ StatusCode ReadDataWithUserData::initialize() { StatusCode sc=m_userDataSvc.retrieve(); if (sc.isFailure()) { - msg(MSG::ERROR) << "Failed to retrieve UserDataSvc " << m_userDataSvc << endreq; + msg(MSG::ERROR) << "Failed to retrieve UserDataSvc " << m_userDataSvc << endmsg; return sc; } @@ -40,7 +40,7 @@ StatusCode ReadDataWithUserData::initialize() { } StatusCode ReadDataWithUserData::finalize() { - //msg(MSG::INFO) << "Counters: Events: " << m_events << ", Clusters: " << nCluster << ", Attributes: " << nAttibutes << endreq; + //msg(MSG::INFO) << "Counters: Events: " << m_events << ", Clusters: " << nCluster << ", Attributes: " << nAttibutes << endmsg; return StatusCode::SUCCESS; } @@ -52,7 +52,7 @@ StatusCode ReadDataWithUserData::execute() { StatusCode sc=evtStore()->retrieve(clusterContainer,m_contName); if (sc.isFailure()) { - msg(MSG::ERROR) << "Failed to retrieve CaloClusterContainer with name " << m_contName << endreq; + msg(MSG::ERROR) << "Failed to retrieve CaloClusterContainer with name " << m_contName << endmsg; return sc; } @@ -72,70 +72,70 @@ StatusCode ReadDataWithUserData::execute() { label=sLabel.str(); int counterOut=0; CHECK(m_userDataSvc->retrieve(*cluster,label,counterOut)); - msg(MSG::DEBUG) << "Cluster #" << nCluster << ", label '" << label << "' value=" << counterOut << endreq; + msg(MSG::DEBUG) << "Cluster #" << nCluster << ", label '" << label << "' value=" << counterOut << endmsg; //Same with double; label=sLabel.str()+"d"; double dblOut=0; CHECK(m_userDataSvc->retrieve(*cluster,label,dblOut)); - msg(MSG::DEBUG) << "Cluster #" << nCluster << ", label '" << label << "' value=" << dblOut << endreq; + msg(MSG::DEBUG) << "Cluster #" << nCluster << ", label '" << label << "' value=" << dblOut << endmsg; //Same with unsigned: label=sLabel.str()+"u"; uint32_t cnt_uOut=0; CHECK(m_userDataSvc->retrieve(*cluster,label,cnt_uOut)); - msg(MSG::DEBUG) << "Cluster #" << nCluster << ", label '" << label << "' value=" << cnt_uOut << endreq; + msg(MSG::DEBUG) << "Cluster #" << nCluster << ", label '" << label << "' value=" << cnt_uOut << endmsg; //Same with float: label=sLabel.str()+"f"; float cnt_fOut=0; CHECK(m_userDataSvc->getElementDecoration(*cluster,label,cnt_fOut)); - msg(MSG::DEBUG) << "Cluster #" << nCluster << ", label '" << label << "' value=" << cnt_fOut << endreq; + msg(MSG::DEBUG) << "Cluster #" << nCluster << ", label '" << label << "' value=" << cnt_fOut << endmsg; label=sLabel.str()+"b"; bool bout=false; CHECK(m_userDataSvc->getElementDecoration(*cluster,label,bout)); - msg(MSG::DEBUG) << "Cluster #" << nCluster << ", label '" << label << "' value=" << bout << endreq; + msg(MSG::DEBUG) << "Cluster #" << nCluster << ", label '" << label << "' value=" << bout << endmsg; label=sLabel.str()+"vVirt"; void* vecOutvoid=0; if (m_userDataSvc->vgetElementDecoration(*cluster,label,typeid(std::vector<int32_t>),vecOutvoid)) { - msg(MSG::ERROR) << "vgetElementDecoration failed" << endreq; + msg(MSG::ERROR) << "vgetElementDecoration failed" << endmsg; return StatusCode::FAILURE; } std::vector<int32_t>* vptrOut=static_cast<std::vector<int32_t>* >(vecOutvoid); vidx=m_events%(vptrOut->size()-1); - msg(MSG::DEBUG) << "Cluster #" << nCluster << ", label '" << label << "' size=" << vptrOut->size() << "value[" << vidx << "]=" << vptrOut->at(vidx) << endreq; + msg(MSG::DEBUG) << "Cluster #" << nCluster << ", label '" << label << "' size=" << vptrOut->size() << "value[" << vidx << "]=" << vptrOut->at(vidx) << endmsg; label=sLabel.str()+"v"; std::vector<int32_t> vecOut1; CHECK(m_userDataSvc->retrieve(*cluster,label,vecOut1)); vidx=m_events%(vecOut1.size()-1); - msg(MSG::DEBUG) << "Cluster #" << nCluster << ", label '" << label << "' size=" << vecOut1.size() << "value[" << vidx << "]=" << vecOut1[vidx] << endreq; + msg(MSG::DEBUG) << "Cluster #" << nCluster << ", label '" << label << "' size=" << vecOut1.size() << "value[" << vidx << "]=" << vecOut1[vidx] << endmsg; label=sLabel.str()+"vu"; std::vector<uint32_t> vecuOut; CHECK(m_userDataSvc->retrieve(*cluster,label,vecuOut)); vidx=m_events%(vecuOut.size()-1); - msg(MSG::DEBUG) << "Cluster #" << nCluster << ", label '" << label << "' size=" << vecuOut.size() << "value[" << vidx << "]=" << vecuOut[vidx] << endreq; + msg(MSG::DEBUG) << "Cluster #" << nCluster << ", label '" << label << "' size=" << vecuOut.size() << "value[" << vidx << "]=" << vecuOut[vidx] << endmsg; label=sLabel.str()+"vf"; std::vector<float> vecfOut; CHECK(m_userDataSvc->retrieve(*cluster,label,vecfOut)); vidx=m_events%(vecfOut.size()-1); - msg(MSG::DEBUG) << "Cluster #" << nCluster << ", label '" << label << "' size=" << vecfOut.size() << "value[" << vidx << "]=" << vecfOut[vidx] << endreq; + msg(MSG::DEBUG) << "Cluster #" << nCluster << ", label '" << label << "' size=" << vecfOut.size() << "value[" << vidx << "]=" << vecfOut[vidx] << endmsg; label=sLabel.str()+"vd"; std::vector<double> vecdOut; CHECK(m_userDataSvc->retrieve(*cluster,label,vecdOut)); vidx=m_events%(vecfOut.size()-1); - msg(MSG::DEBUG) << "Cluster #" << nCluster << ", label '" << label << "' size=" << vecdOut.size() << "value[" << vidx << "]=" << vecdOut[vidx] << endreq; + msg(MSG::DEBUG) << "Cluster #" << nCluster << ", label '" << label << "' size=" << vecdOut.size() << "value[" << vidx << "]=" << vecdOut[vidx] << endmsg; } ++counter; } // loop over clusters @@ -143,7 +143,7 @@ StatusCode ReadDataWithUserData::execute() { label="EventDeco"; double fOut; CHECK(m_userDataSvc->retrieve(label,fOut)); - msg(MSG::DEBUG) << "EventDeco with label '" << label << "' value=" << fOut << endreq; + msg(MSG::DEBUG) << "EventDeco with label '" << label << "' value=" << fOut << endmsg; return StatusCode::SUCCESS; } diff --git a/Control/AthenaExamples/UserDataExamples/src/ReadDataWithUserData.h b/Control/AthenaExamples/UserDataExamples/src/ReadDataWithUserData.h index 7e954d3c4080dff538008a606ce30ba5406c8e7c..2923a05d1fccad3d9f9e20179b6cca2b7a31860b 100644 --- a/Control/AthenaExamples/UserDataExamples/src/ReadDataWithUserData.h +++ b/Control/AthenaExamples/UserDataExamples/src/ReadDataWithUserData.h @@ -42,7 +42,7 @@ namespace UserDataExamples { //counters: unsigned m_events; - unsigned nAttributes; + unsigned m_nAttributes; }; }