Skip to content
Snippets Groups Projects
Commit 1cb47a7c authored by Vakhtang Tsulaia's avatar Vakhtang Tsulaia
Browse files

Code cleanup in the ReadAlignTrans algorithm

Dropped the dependency on IGeoModelSvc::align(). Also moved all headers into
src directory
parent b0a7f876
No related branches found
No related tags found
6 merge requests!58791DataQualityConfigurations: Modify L1Calo config for web display,!46784MuonCondInterface: Enable thread-safety checking.,!46776Updated LArMonitoring config file for WD to match new files produced using MT,!45405updated ART test cron job,!42417Draft: DIRE and VINCIA Base Fragments for Pythia 8.3,!38250Code cleanup in the ReadAlignTrans algorithm
Showing
with 18 additions and 57 deletions
...@@ -14,7 +14,7 @@ atlas_add_component( DetDescrCondExample ...@@ -14,7 +14,7 @@ atlas_add_component( DetDescrCondExample
src/CoolHistExample.cxx src/CoolHistExample.cxx
src/components/*.cxx src/components/*.cxx
INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaBaseComps AthenaKernel AthenaPoolUtilities DetDescrCondToolsLib DetDescrConditions GaudiKernel GeoModelInterfaces GeoPrimitives Identifier InDetReadoutGeometry ) LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaBaseComps AthenaKernel AthenaPoolUtilities DetDescrCondToolsLib DetDescrConditions GaudiKernel GeoPrimitives Identifier InDetReadoutGeometry )
# Install files from the package: # Install files from the package:
atlas_install_joboptions( share/*.py ) atlas_install_joboptions( share/*.py )
...@@ -7,12 +7,12 @@ ...@@ -7,12 +7,12 @@
// Richard Hawkings, started 09/2/07 // Richard Hawkings, started 09/2/07
// //
#include "CoolHistExample.h"
#include "GaudiKernel/ISvcLocator.h" #include "GaudiKernel/ISvcLocator.h"
#include "AthenaPoolUtilities/CondAttrListCollection.h" #include "AthenaPoolUtilities/CondAttrListCollection.h"
#include "DetDescrCondTools/ICoolHistSvc.h" #include "DetDescrCondTools/ICoolHistSvc.h"
#include "TH1.h" #include "TH1.h"
#include "TDirectory.h" #include "TDirectory.h"
#include "DetDescrCondExample/CoolHistExample.h"
CoolHistExample::CoolHistExample(const std::string& name, CoolHistExample::CoolHistExample(const std::string& name,
ISvcLocator* pSvcLocator) :AthAlgorithm(name,pSvcLocator), ISvcLocator* pSvcLocator) :AthAlgorithm(name,pSvcLocator),
......
/* /*
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/ */
// ReadAlignTrans - simple example of algorithm reading AlignableTransforms // ReadAlignTrans - simple example of algorithm reading AlignableTransforms
// Richard Hawkings, started 19/1/04 // Richard Hawkings, started 19/1/04
#include <list> #include "ReadAlignTrans.h"
#include "GaudiKernel/ISvcLocator.h" #include "GaudiKernel/ISvcLocator.h"
#include "Identifier/Identifier.h" #include "Identifier/Identifier.h"
#include "GeoModelInterfaces/IGeoModelSvc.h"
#include "InDetReadoutGeometry/SiDetectorManager.h" #include "InDetReadoutGeometry/SiDetectorManager.h"
#include "InDetReadoutGeometry/SiDetectorElement.h" #include "InDetReadoutGeometry/SiDetectorElement.h"
#include "InDetReadoutGeometry/SiDetectorElementCollection.h" #include "InDetReadoutGeometry/SiDetectorElementCollection.h"
#include <list>
#include "DetDescrCondExample/ReadAlignTrans.h" ReadAlignTrans::ReadAlignTrans(const std::string& name
, ISvcLocator* pSvcLocator)
ReadAlignTrans::ReadAlignTrans(const std::string& name, : AthAlgorithm(name,pSvcLocator)
ISvcLocator* pSvcLocator) :AthAlgorithm(name,pSvcLocator), , m_sidetman()
p_geomodelsvc(0),
m_sidetman()
{} {}
ReadAlignTrans::~ReadAlignTrans(void) ReadAlignTrans::~ReadAlignTrans(void)
...@@ -28,32 +26,10 @@ StatusCode ReadAlignTrans::initialize() ...@@ -28,32 +26,10 @@ StatusCode ReadAlignTrans::initialize()
{ {
ATH_MSG_INFO("ReadAlignTrans::initialize() called"); ATH_MSG_INFO("ReadAlignTrans::initialize() called");
// get ptr to GeoModelSvc to be able to register callback
if (StatusCode::SUCCESS!=service("GeoModelSvc",p_geomodelsvc)) {
ATH_MSG_ERROR("Cannot get ptr to GeoModelSvc");
return StatusCode::FAILURE;
}
// get SiDetectorManagers for checking module positions // get SiDetectorManagers for checking module positions
if (StatusCode::SUCCESS!=detStore()->retrieve(m_sidetman[0],"Pixel")) { ATH_CHECK(detStore()->retrieve(m_sidetman[0],"Pixel"));
ATH_MSG_ERROR("Cannot get Pixel SiDetectorManager"); ATH_CHECK(detStore()->retrieve(m_sidetman[1],"SCT"));
return StatusCode::FAILURE;
}
if (StatusCode::SUCCESS!=detStore()->retrieve(m_sidetman[1],"SCT")) {
ATH_MSG_ERROR("Cannot get SCT SiDetectorManager");
return StatusCode::FAILURE;
}
// register callbacks on IGeoModelSvc::align to be called back after
// alignment has been recalculated
if (StatusCode::SUCCESS==detStore()->regFcn(&IGeoModelSvc::align,
p_geomodelsvc,&ReadAlignTrans::testCallBack,this)) {
ATH_MSG_INFO("Registered callback for IGeoModelSvc");
} else {
ATH_MSG_ERROR("Register callback failed");
return StatusCode::FAILURE;
}
return StatusCode::SUCCESS; return StatusCode::SUCCESS;
} }
...@@ -98,17 +74,6 @@ StatusCode ReadAlignTrans::finalize() { ...@@ -98,17 +74,6 @@ StatusCode ReadAlignTrans::finalize() {
return StatusCode::SUCCESS; return StatusCode::SUCCESS;
} }
StatusCode ReadAlignTrans::testCallBack( IOVSVC_CALLBACK_ARGS_P( /* I */ ,
keys ) ) {
// print out the keys we were given (for info)
// could do nothing if key is not /Indet/Align to save time
std::string keylist;
for (std::list<std::string>::const_iterator itr=keys.begin();
itr!=keys.end(); ++itr) keylist+=" "+*itr;
ATH_MSG_INFO("ReadAlignTrans callback invoked for keys:"+keylist);
return readSiPositions(m_identcache,m_poscache);
}
StatusCode ReadAlignTrans::readSiPositions(std::vector<Identifier>& idvec, StatusCode ReadAlignTrans::readSiPositions(std::vector<Identifier>& idvec,
std::vector<Amg::Vector3D >& posvec) { std::vector<Amg::Vector3D >& posvec) {
// find the identifier and position of all the pixel and SCT modules // find the identifier and position of all the pixel and SCT modules
......
/* /*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/ */
#ifndef DETDESCRCONDEXAMPLE_READALIGNTRANS_H #ifndef DETDESCRCONDEXAMPLE_READALIGNTRANS_H
...@@ -15,8 +15,6 @@ ...@@ -15,8 +15,6 @@
#include "GeoPrimitives/GeoPrimitives.h" #include "GeoPrimitives/GeoPrimitives.h"
#include "AthenaKernel/IOVSvcDefs.h" #include "AthenaKernel/IOVSvcDefs.h"
class IGeoModelTool;
class IGeoModelSvc;
namespace InDetDD { namespace InDetDD {
class SiDetectorManager; class SiDetectorManager;
} }
...@@ -30,12 +28,10 @@ class ReadAlignTrans: public AthAlgorithm ...@@ -30,12 +28,10 @@ class ReadAlignTrans: public AthAlgorithm
StatusCode execute(void); StatusCode execute(void);
StatusCode finalize(void); StatusCode finalize(void);
StatusCode testCallBack( IOVSVC_CALLBACK_ARGS );
StatusCode readSiPositions(std::vector<Identifier>&, StatusCode readSiPositions(std::vector<Identifier>&,
std::vector<Amg::Vector3D >&); std::vector<Amg::Vector3D >&);
private: private:
IGeoModelSvc* p_geomodelsvc;
const InDetDD::SiDetectorManager* m_sidetman[2]; const InDetDD::SiDetectorManager* m_sidetman[2];
std::vector<Identifier> m_identcache; std::vector<Identifier> m_identcache;
std::vector<Amg::Vector3D> m_poscache; std::vector<Amg::Vector3D> m_poscache;
......
...@@ -12,10 +12,10 @@ ...@@ -12,10 +12,10 @@
// - BeginRun incident // - BeginRun incident
#include "ReadTopTrans.h"
#include "GaudiKernel/ISvcLocator.h" #include "GaudiKernel/ISvcLocator.h"
#include "GaudiKernel/IIncidentSvc.h" #include "GaudiKernel/IIncidentSvc.h"
#include "DetDescrConditions/DetCondKeyTrans.h" #include "DetDescrConditions/DetCondKeyTrans.h"
#include "DetDescrCondExample/ReadTopTrans.h"
ReadTopTrans::ReadTopTrans(const std::string& name, ReadTopTrans::ReadTopTrans(const std::string& name,
ISvcLocator* pSvcLocator) :AthAlgorithm(name,pSvcLocator) {} ISvcLocator* pSvcLocator) :AthAlgorithm(name,pSvcLocator) {}
......
...@@ -6,10 +6,10 @@ ...@@ -6,10 +6,10 @@
// read/write of CondStrFile // read/write of CondStrFile
// Richard Hawkings, started 14/11/05 // Richard Hawkings, started 14/11/05
#include "ReadWriteCoolStrFile.h"
#include "GaudiKernel/ISvcLocator.h" #include "GaudiKernel/ISvcLocator.h"
#include "DetDescrConditions/DetCondKeyTrans.h" #include "DetDescrConditions/DetCondKeyTrans.h"
#include "DetDescrCondTools/ICoolStrFileSvc.h" #include "DetDescrCondTools/ICoolStrFileSvc.h"
#include "DetDescrCondExample/ReadWriteCoolStrFile.h"
ReadWriteCoolStrFile::ReadWriteCoolStrFile(const std::string& name, ReadWriteCoolStrFile::ReadWriteCoolStrFile(const std::string& name,
ISvcLocator* pSvcLocator) :AthAlgorithm(name,pSvcLocator), ISvcLocator* pSvcLocator) :AthAlgorithm(name,pSvcLocator),
......
#include "DetDescrCondExample/ReadAlignTrans.h" #include "../ReadAlignTrans.h"
#include "DetDescrCondExample/ReadTopTrans.h" #include "../ReadTopTrans.h"
#include "DetDescrCondExample/ReadWriteCoolStrFile.h" #include "../ReadWriteCoolStrFile.h"
#include "DetDescrCondExample/CoolHistExample.h" #include "../CoolHistExample.h"
DECLARE_COMPONENT( ReadAlignTrans ) DECLARE_COMPONENT( ReadAlignTrans )
DECLARE_COMPONENT( ReadTopTrans ) DECLARE_COMPONENT( ReadTopTrans )
......
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