Skip to content
Snippets Groups Projects
Commit a599bfc6 authored by Robert Langenberg's avatar Robert Langenberg
Browse files

testAlg now uses dumper to dump both TGSvc and TGCondAlg geometries

parent 01cd7237
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,!37234Fix naming clash in config for GeometryBuilder and GeometryBuilderCond; TrkGeometryTestAlg now dumps TG
......@@ -43,7 +43,7 @@ class ConfiguredTrackingGeometryCondAlg( Trk__TrackingGeometryCondAlg ) :
# the geometry builder alg tool
from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__GeometryBuilderCond
AtlasGeometryBuilder = Trk__GeometryBuilderCond(name = 'AtlasGeometryBuilder')
AtlasGeometryBuilder = Trk__GeometryBuilderCond(name = 'AtlasGeometryBuilderCond')
# switch the building outputlevel on
AtlasGeometryBuilder.OutputLevel = TrkDetFlags.ConfigurationOutputLevel()
......@@ -67,7 +67,7 @@ class ConfiguredTrackingGeometryCondAlg( Trk__TrackingGeometryCondAlg ) :
from InDetTrackingGeometry.ConfiguredInDetTrackingGeometryBuilderCond import ConfiguredInDetTrackingGeometryBuilderCond as IDGeometryBuilder
else:
from InDetTrackingGeometry.ConfiguredStagedTrackingGeometryBuilderCond import ConfiguredStagedTrackingGeometryBuilderCond as IDGeometryBuilder
InDetTrackingGeometryBuilder = IDGeometryBuilder(name ='InDetTrackingGeometryBuilder')
InDetTrackingGeometryBuilder = IDGeometryBuilder(name ='InDetTrackingGeometryBuilderCond')
InDetTrackingGeometryBuilder.EnvelopeDefinitionSvc = AtlasEnvelopeSvc
InDetTrackingGeometryBuilder.OutputLevel = TrkDetFlags.InDetBuildingOutputLevel()
......@@ -82,7 +82,7 @@ class ConfiguredTrackingGeometryCondAlg( Trk__TrackingGeometryCondAlg ) :
ToolSvc += CaloVolumeCreator
from CaloTrackingGeometry.ConfiguredCaloTrackingGeometryBuilderCond import ConfiguredCaloTrackingGeometryBuilderCond as ConfiguredCaloGeo
CaloTrackingGeometryBuilder = ConfiguredCaloGeo(name='CaloTrackingGeometryBuilder');
CaloTrackingGeometryBuilder = ConfiguredCaloGeo(name='CaloTrackingGeometryBuilderCond');
CaloTrackingGeometryBuilder.TrackingVolumeCreator = CaloVolumeCreator
CaloTrackingGeometryBuilder.EnvelopeDefinitionSvc = AtlasEnvelopeSvc
CaloTrackingGeometryBuilder.OutputLevel = TrkDetFlags.CaloBuildingOutputLevel()
......
......@@ -2,14 +2,15 @@
* Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
#ifndef TRACKINGGEOMETRYCONDALG_H
#define TRACKINGGEOMETRYCONDALG_H
#ifndef TRACKINGGEOMETRYCONDALGTEST_H
#define TRACKINGGEOMETRYCONDALGTEST_H
#include "AthenaBaseComps/AthAlgorithm.h"
#include "AthenaBaseComps/AthReentrantAlgorithm.h"
#include "PersistentDataModel/AthenaAttributeList.h"
#include "StoreGate/ReadCondHandleKey.h"
#include "StoreGate/WriteCondHandleKey.h"
#include "GaudiKernel/ServiceHandle.h"
#include "TrkGeometry/TrackingGeometry.h"
#include "TrkDetDescrInterfaces/IGeometryBuilder.h"
......@@ -18,8 +19,11 @@
#include "GaudiKernel/ToolHandle.h"
#include "AthenaKernel/CLASS_DEF.h"
#include "TrkDetDescrInterfaces/ITrackingGeometrySvc.h"
namespace Trk{
class TrackingGeometryCondAlgTest : public AthReentrantAlgorithm
{
public:
......@@ -27,14 +31,17 @@ public:
virtual ~TrackingGeometryCondAlgTest() override = default;
virtual StatusCode initialize() override;
virtual StatusCode execute(const EventContext& ctx)const override;
virtual StatusCode execute(const EventContext& ctx) const override;
virtual StatusCode finalize() override {return StatusCode::SUCCESS;}
private:
/// Input conditions object.
SG::ReadCondHandleKey<TrackingGeometry> m_trackingGeometryReadKey{this, "TrackingGeometryReadKey", "AlignedTrackingGeometry", "Key of input TrackingGeometry"};
mutable std::vector<Amg::Vector3D> m_worldVolumeCenterCollection;
SG::ReadCondHandleKey<TrackingGeometry> m_trackingGeometryReadKey{this, "TrackingGeometryReadKey", "AlignedTrackingGeometry", "Key of input TrackingGeometry"};
mutable const TrackingGeometry* m_trackingGeometry; //!< the tracking geometry
ServiceHandle<Trk::ITrackingGeometrySvc> m_trackingGeometrySvc; //!< ToolHandle to the TrackingGeometrySvc
ToolHandleArray<Trk::IGeometryProcessor> m_trackingGeometryProcessors; //!< Tool to write out a Display format for external viewers
};
}
#endif //TRACKINGGEOMETRYCONDALG_H
#endif //TRACKINGGEOMETRYCONDALGTEST_H
......@@ -62,6 +62,8 @@ TrkDetFlags.TRT_BuildingOutputLevel = VERBOSE
TrkDetFlags.InDetBuildingOutputLevel = VERBOSE
TrkDetFlags.ConfigurationOutputLevel = VERBOSE
from TrkDetDescrSvc.AtlasTrackingGeometrySvc import AtlasTrackingGeometrySvc
# load the tracking geometry cond alg
from TrackingGeometryCondAlg.AtlasTrackingGeometryCondAlg import ConfiguredTrackingGeometryCondAlg
......@@ -70,8 +72,16 @@ from AthenaCommon.AlgSequence import AthSequencer
condSeq = AthSequencer("AthCondSeq")
condSeq+= TrkGeoCondAlg
# ----------------------
from TrkDetDescrTestTools.TrkDetDescrTestToolsConf import Trk__GeometryAsciiDumper
GeometryAsciiDumper = Trk__GeometryAsciiDumper(name= 'GeometryAsciiDumper')
ToolSvc += GeometryAsciiDumper
GeometryProcessors = [ GeometryAsciiDumper ]
from TrkCondTest.TrackingGeometryCondAlgTestConf import Trk__TrackingGeometryCondAlgTest
TrkGeomCondAlgTest = Trk__TrackingGeometryCondAlgTest(name = "TrkGeomTest")
TrkGeomCondAlgTest.GeometryProcessors = GeometryProcessors
job += TrkGeomCondAlgTest
#--------------------------------------------------------------
......@@ -88,7 +98,8 @@ job += TrkGeomCondAlgTest
# Event related parameters
#--------------------------------------------------------------
theApp.EvtMax = 22
theApp.EvtMax = 2
from AthenaCommon.AppMgr import ServiceMgr
# output level
......
......@@ -2,15 +2,22 @@
* Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
// Trk includes
#include "GaudiKernel/ISvcLocator.h"
#include "AthenaKernel/IOVSvcDefs.h"
// Trk includes
#include "TrkCondTest/TrackingGeometryCondAlgTest.h"
#include "TrkGeometry/Layer.h"
Trk::TrackingGeometryCondAlgTest::TrackingGeometryCondAlgTest(const std::string& name, ISvcLocator* pSvcLocator)
: AthReentrantAlgorithm(name, pSvcLocator)
: AthReentrantAlgorithm(name, pSvcLocator),
m_trackingGeometry(nullptr),
m_trackingGeometrySvc("AtlasTrackingGeometrySvc", name),
m_trackingGeometryProcessors()
{
declareProperty("GeometryProcessors", m_trackingGeometryProcessors);
}
StatusCode Trk::TrackingGeometryCondAlgTest::initialize()
......@@ -20,6 +27,19 @@ StatusCode Trk::TrackingGeometryCondAlgTest::initialize()
// Read Handle Key
ATH_CHECK(m_trackingGeometryReadKey.initialize());
if (m_trackingGeometrySvc.retrieve().isSuccess()) {
ATH_MSG_INFO("Successfully retrieved " << m_trackingGeometrySvc);
} else {
ATH_MSG_WARNING("Couldn't retrieve " << m_trackingGeometrySvc << ". ");
return StatusCode::FAILURE;
}
if ((m_trackingGeometryProcessors.retrieve()).isFailure()) {
ATH_MSG_FATAL( "Failed to retrieve tool(s) in " << m_trackingGeometryProcessors );
return StatusCode::FAILURE;
} else{
ATH_MSG_INFO( "Retrieved tools : " << m_trackingGeometryProcessors );
}
return StatusCode::SUCCESS;
}
......@@ -33,15 +53,34 @@ StatusCode Trk::TrackingGeometryCondAlgTest::execute(const EventContext& ctx) co
}
const Trk::TrackingGeometry* trkGeom = *readHandle;
ATH_MSG_INFO( "eventID: " << ctx.eventID());
m_trackingGeometry = m_trackingGeometrySvc->trackingGeometry();
if( m_trackingGeometry == nullptr){
std::cout << "TRACKING GEOMETRY NOT FOUND IN SVC" << std::endl;
return StatusCode::FAILURE;
}
Amg::Vector3D center = trkGeom->highestTrackingVolume()->center();
ATH_MSG_INFO("Center coordinates of highest tracking volume");
ATH_MSG_INFO(center);
if(m_worldVolumeCenterCollection.size()>=1 && m_worldVolumeCenterCollection.back() != center){
ATH_MSG_INFO("hooray, we have moved the world");
for (ToolHandle<Trk::IGeometryProcessor> proc : m_trackingGeometryProcessors) {
std::cout << "PRINT SVC TG" << std::endl;
if(proc->process(*m_trackingGeometry).isFailure()){
ATH_MSG_FATAL("Could not process the TrackingGeometry from SVC");
return StatusCode::FAILURE;
}
std::cout << "PRINT COND TG" << std::endl;
if(proc->process(*trkGeom).isFailure()){
ATH_MSG_FATAL("Could not process the TrackingGeometry from CONDALG");
return StatusCode::FAILURE;
}
}
m_worldVolumeCenterCollection.push_back(center);
ATH_MSG_INFO("TrackingGeometry retrieved");
// const std::vector<const Trk::Layer*>* layersCond = trkGeom->highestTrackingVolume()->confinedArbitraryLayers();
// const std::vector<const Trk::Layer*>* layersSvc = m_trackingGeometry->highestTrackingVolume()->confinedArbitraryLayers();
// std::cout << "Layers in highestTrackingVolume from condAlg and svc:" << std::endl;
// if(layersCond != nullptr){
// for (size_t i = 0; i<layersCond->size(); i++){
// std::cout << "Layer subsurface from CondAlg at 0,0:" << std::endl<< layersCond->at(i)->subSurface(Amg::Vector2D(0.,0.)) << std::endl;
// std::cout << "Layer subsurface from Svc at 0,0:" << std::endl<< layersSvc->at(i)->subSurface(Amg::Vector2D(0.,0.)) << std::endl;
// }
// }
// ATH_MSG_INFO("TrackingGeometry retrieved");
return StatusCode::SUCCESS;
}
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