From bd16bda675d6c1456301265ede08ebe8a7465760 Mon Sep 17 00:00:00 2001 From: Tobias Boeckh <tobias.boeckh@cern.ch> Date: Tue, 19 Jan 2021 23:43:28 +0100 Subject: [PATCH 1/3] use Athena 22.0.19 --- .gitlab-ci.yml | 6 +- .../RDOReadExample/src/RDOReadAlg.cxx | 6 +- .../DetDescrCnvSvc/src/DetDescrCnvSvc.cxx | 2 +- .../GeoAdaptors/GeoAdaptors/GeoFaserSiHit.icc | 3 +- .../GeoAdaptors/GeoAdaptors/GeoScintHit.icc | 3 +- .../GeoModelSvc/src/RDBMaterialManager.cxx | 2 +- .../src/FaserIDDetDescrCnv.cxx | 2 +- .../src/IdDictDetDescrCnv.cxx | 2 +- .../src/FaserByteStreamCnvSvc.cxx | 2 +- .../src/FaserEventSelectorByteStream.cxx | 2 +- .../src/FaserByteStreamAddressProviderSvc.cxx | 2 +- .../src/FaserByteStreamCnvSvcBase.cxx | 2 +- README.md | 2 +- .../src/DistortedMaterialManager.cxx | 2 +- .../ScintIdCnv/src/PreshowerIDDetDescrCnv.cxx | 2 +- .../ScintIdCnv/src/TriggerIDDetDescrCnv.cxx | 2 +- .../ScintIdCnv/src/VetoIDDetDescrCnv.cxx | 2 +- .../ScintSimEvent/src/ScintHitIdHelper.cxx | 7 +- .../G4Utilities/Geo2G4/src/Geo2G4Builder.cxx | 1 - .../src/DistortedMaterialManager.cxx | 2 +- .../src/FaserSCT_IDDetDescrCnv.cxx | 2 +- .../src/FaserSiHitIdHelper.cxx | 7 +- .../FaserActsExtrapolationAlg.h | 2 +- .../FaserActsExtrapolationTool.h | 25 +- .../src/CuboidVolumeBuilder.cxx | 15 +- .../src/FaserActsExtrapolationAlg.cxx | 3 +- .../src/FaserActsExtrapolationTool.cxx | 56 ++-- .../src/FaserActsLayerBuilder.cxx | 9 +- .../src/FaserActsPropStepRootWriterSvc.cxx | 16 +- .../src/util/ObjSurfaceWriter.cxx | 6 +- .../IFaserActsExtrapolationTool.h | 12 +- .../FaserActsKalmanFilterAlg.h | 8 +- .../FaserActsRecMultiTrajectory.h | 4 +- .../FaserActsRecSourceLink.h | 2 +- .../src/FaserActsKalmanFilterAlg.cxx | 289 +++++++++--------- .../VTI12Utils/VTI12Utils/VP1SGAccessHelper.h | 2 +- version.txt | 2 +- 37 files changed, 239 insertions(+), 275 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2ea66e119..34c38be18 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -25,7 +25,7 @@ build_image: - mkdir build - cd build - set +e && source ${ATLAS_LOCAL_ROOT_BASE}/user/atlasLocalSetup.sh; set -e - - set +e && asetup --input=../../calypso/asetup.faser Athena,22.0.18; set -e + - set +e && asetup --input=../../calypso/asetup.faser Athena,22.0.19; set -e - cmake ../../calypso - make -j 3 artifacts: @@ -41,8 +41,8 @@ test_unittest: - yum -y install man - cd build - set +e && source ${ATLAS_LOCAL_ROOT_BASE}/user/atlasLocalSetup.sh; set -e - - set +e && asetup --input=../../calypso/asetup.faser Athena,22.0.18; set -e + - set +e && asetup --input=../../calypso/asetup.faser Athena,22.0.19; set -e - set +e && source `find . -name 'setup.sh'`; set -e - ctest -j12 dependencies: - - build_image \ No newline at end of file + - build_image diff --git a/Control/CalypsoExample/RDOReadExample/src/RDOReadAlg.cxx b/Control/CalypsoExample/RDOReadExample/src/RDOReadAlg.cxx index 7231e919a..9d57031ff 100644 --- a/Control/CalypsoExample/RDOReadExample/src/RDOReadAlg.cxx +++ b/Control/CalypsoExample/RDOReadExample/src/RDOReadAlg.cxx @@ -1,7 +1,6 @@ #include "RDOReadAlg.h" #include "TrackerSimEvent/FaserSiHitIdHelper.h" #include "StoreGate/StoreGateSvc.h" -#include "StoreGate/StoreGate.h" #include "TrackerIdentifier/FaserSCT_ID.h" @@ -98,9 +97,8 @@ StatusCode RDOReadAlg::execute() //Helper function to get hit location information from RDO identifier const FaserSCT_ID* pix; - StoreGateSvc* detStore(nullptr); - { - detStore = StoreGate::pointer("DetectorStore"); + ServiceHandle<StoreGateSvc> detStore ("DetectorStore", "SiHitIdHelper"); + if (detStore.retrieve().isSuccess()) { if (detStore->retrieve(pix, "FaserSCT_ID").isFailure()) { pix = 0; } } int station = pix->station(identifier); diff --git a/DetectorDescription/DetDescrCnvSvc/src/DetDescrCnvSvc.cxx b/DetectorDescription/DetDescrCnvSvc/src/DetDescrCnvSvc.cxx index 3db58a375..49c8ef99e 100644 --- a/DetectorDescription/DetDescrCnvSvc/src/DetDescrCnvSvc.cxx +++ b/DetectorDescription/DetDescrCnvSvc/src/DetDescrCnvSvc.cxx @@ -16,7 +16,7 @@ #include "GaudiKernel/IDataSelector.h" #include "GaudiKernel/IOpaqueAddress.h" -#include "StoreGate/StoreGate.h" +#include "StoreGate/StoreGateSvc.h" // #include "SGTools/TransientAddress.h" //External definitions diff --git a/DetectorDescription/GeoModel/GeoAdaptors/GeoAdaptors/GeoFaserSiHit.icc b/DetectorDescription/GeoModel/GeoAdaptors/GeoAdaptors/GeoFaserSiHit.icc index c0cf0a7c0..43fe515b2 100644 --- a/DetectorDescription/GeoModel/GeoAdaptors/GeoAdaptors/GeoFaserSiHit.icc +++ b/DetectorDescription/GeoModel/GeoAdaptors/GeoAdaptors/GeoFaserSiHit.icc @@ -6,13 +6,12 @@ #include "TrackerReadoutGeometry/SiDetectorElement.h" #include "TrackerReadoutGeometry/SCT_DetectorManager.h" #include "StoreGate/StoreGateSvc.h" -#include "StoreGate/StoreGate.h" #include "TrackerIdentifier/FaserSCT_ID.h" #include "GeoPrimitives/CLHEPtoEigenConverter.h" inline void GeoFaserSiHit::init() { - StoreGateSvc *detStore = StoreGate::pointer("DetectorStore"); + ServiceHandle<StoreGateSvc> detStore ("DetectorStore", "GeoFaserSiHit"); if(detStore->retrieve(s_sct,"SCT").isFailure()) s_sct = 0; if(detStore->retrieve(s_sID,"FaserSCT_ID").isFailure()) diff --git a/DetectorDescription/GeoModel/GeoAdaptors/GeoAdaptors/GeoScintHit.icc b/DetectorDescription/GeoModel/GeoAdaptors/GeoAdaptors/GeoScintHit.icc index 9626a59a8..464c6b0fc 100644 --- a/DetectorDescription/GeoModel/GeoAdaptors/GeoAdaptors/GeoScintHit.icc +++ b/DetectorDescription/GeoModel/GeoAdaptors/GeoAdaptors/GeoScintHit.icc @@ -8,7 +8,6 @@ #include "ScintReadoutGeometry/TriggerDetectorManager.h" #include "ScintReadoutGeometry/PreshowerDetectorManager.h" #include "StoreGate/StoreGateSvc.h" -#include "StoreGate/StoreGate.h" #include "ScintIdentifier/VetoID.h" #include "ScintIdentifier/TriggerID.h" #include "ScintIdentifier/PreshowerID.h" @@ -16,7 +15,7 @@ inline void GeoScintHit::init() { - StoreGateSvc *detStore = StoreGate::pointer("DetectorStore"); + ServiceHandle<StoreGateSvc> detStore ("DetectorStore", "GeoScintHit"); if(detStore->retrieve(s_veto,"Veto").isFailure()) s_veto = 0; if(detStore->retrieve(s_trigger,"Trigger").isFailure()) diff --git a/DetectorDescription/GeoModel/GeoModelSvc/src/RDBMaterialManager.cxx b/DetectorDescription/GeoModel/GeoModelSvc/src/RDBMaterialManager.cxx index 3746cfac2..f48cc362c 100644 --- a/DetectorDescription/GeoModel/GeoModelSvc/src/RDBMaterialManager.cxx +++ b/DetectorDescription/GeoModel/GeoModelSvc/src/RDBMaterialManager.cxx @@ -10,7 +10,7 @@ #include "GeoModelKernel/GeoElement.h" #include "GeoModelKernel/Units.h" -#include "StoreGate/StoreGate.h" +#include "StoreGate/StoreGateSvc.h" #include "StoreGate/DataHandle.h" #include "RDBAccessSvc/IRDBAccessSvc.h" diff --git a/DetectorDescription/IdDictDetDescrCnv/src/FaserIDDetDescrCnv.cxx b/DetectorDescription/IdDictDetDescrCnv/src/FaserIDDetDescrCnv.cxx index c2468e6b7..91d0ffa1a 100644 --- a/DetectorDescription/IdDictDetDescrCnv/src/FaserIDDetDescrCnv.cxx +++ b/DetectorDescription/IdDictDetDescrCnv/src/FaserIDDetDescrCnv.cxx @@ -14,7 +14,7 @@ #include "DetDescrCnvSvc/DetDescrConverter.h" #include "DetDescrCnvSvc/DetDescrAddress.h" #include "GaudiKernel/MsgStream.h" -#include "StoreGate/StoreGate.h" +#include "StoreGate/StoreGateSvc.h" #include "AthenaKernel/StorableConversions.h" #include "IdDictDetDescr/IdDictManager.h" diff --git a/DetectorDescription/IdDictDetDescrCnv/src/IdDictDetDescrCnv.cxx b/DetectorDescription/IdDictDetDescrCnv/src/IdDictDetDescrCnv.cxx index 2d3ced326..1814bbbcc 100644 --- a/DetectorDescription/IdDictDetDescrCnv/src/IdDictDetDescrCnv.cxx +++ b/DetectorDescription/IdDictDetDescrCnv/src/IdDictDetDescrCnv.cxx @@ -28,7 +28,7 @@ #include "GaudiKernel/MsgStream.h" -#include "StoreGate/StoreGate.h" +#include "StoreGate/StoreGateSvc.h" #include "AthenaKernel/StorableConversions.h" //<<<<<< PRIVATE DEFINES >>>>>> diff --git a/Event/FaserByteStreamCnvSvc/src/FaserByteStreamCnvSvc.cxx b/Event/FaserByteStreamCnvSvc/src/FaserByteStreamCnvSvc.cxx index a28f22ff8..c35ddacbb 100644 --- a/Event/FaserByteStreamCnvSvc/src/FaserByteStreamCnvSvc.cxx +++ b/Event/FaserByteStreamCnvSvc/src/FaserByteStreamCnvSvc.cxx @@ -7,7 +7,7 @@ //#include "ByteStreamCnvSvcBase/FullEventAssembler.h" //#include "FaserByteStreamCnvSvcBase/FaserByteStreamAddress.h" -#include "StoreGate/StoreGate.h" +#include "StoreGate/StoreGateSvc.h" #include "xAODEventInfo/EventInfo.h" #include "xAODTrigger/TrigDecision.h" diff --git a/Event/FaserByteStreamCnvSvc/src/FaserEventSelectorByteStream.cxx b/Event/FaserByteStreamCnvSvc/src/FaserEventSelectorByteStream.cxx index e78b40257..a53bc53c9 100644 --- a/Event/FaserByteStreamCnvSvc/src/FaserEventSelectorByteStream.cxx +++ b/Event/FaserByteStreamCnvSvc/src/FaserEventSelectorByteStream.cxx @@ -22,7 +22,7 @@ #include "AthenaKernel/IAthenaIPCTool.h" #include "EventInfo/EventInfo.h" -#include "StoreGate/StoreGate.h" +#include "StoreGate/StoreGateSvc.h" // EventInfoAttributeList includes #include "AthenaPoolUtilities/AthenaAttributeList.h" diff --git a/Event/FaserByteStreamCnvSvcBase/src/FaserByteStreamAddressProviderSvc.cxx b/Event/FaserByteStreamCnvSvcBase/src/FaserByteStreamAddressProviderSvc.cxx index 9bbea53e0..e5b16c854 100644 --- a/Event/FaserByteStreamCnvSvcBase/src/FaserByteStreamAddressProviderSvc.cxx +++ b/Event/FaserByteStreamCnvSvcBase/src/FaserByteStreamAddressProviderSvc.cxx @@ -7,7 +7,7 @@ #include "FaserByteStreamCnvSvcBase/FaserByteStreamAddress.h" #include "FaserByteStreamCnvSvcBase/IFaserROBDataProviderSvc.h" -#include "StoreGate/StoreGate.h" +#include "StoreGate/StoreGateSvc.h" #include "SGTools/TransientAddress.h" #include "GaudiKernel/ListItem.h" diff --git a/Event/FaserByteStreamCnvSvcBase/src/FaserByteStreamCnvSvcBase.cxx b/Event/FaserByteStreamCnvSvcBase/src/FaserByteStreamCnvSvcBase.cxx index 2c7bff28f..a250c8597 100644 --- a/Event/FaserByteStreamCnvSvcBase/src/FaserByteStreamCnvSvcBase.cxx +++ b/Event/FaserByteStreamCnvSvcBase/src/FaserByteStreamCnvSvcBase.cxx @@ -12,7 +12,7 @@ #include "GaudiKernel/IIncidentSvc.h" #include "AthenaKernel/IClassIDSvc.h" -#include "StoreGate/StoreGate.h" +#include "StoreGate/StoreGateSvc.h" //______________________________________________________________________________ FaserByteStreamCnvSvcBase::FaserByteStreamCnvSvcBase(const std::string& name, ISvcLocator* pSvcLocator) : diff --git a/README.md b/README.md index d0d619756..2d30f8a00 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ git clone --recursive https://:@gitlab.cern.ch:8443/$USERNAME/calypso.git #The next three lines are used to setup the ATLAS release environment export ATLAS_LOCAL_ROOT_BASE=/cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase source ${ATLAS_LOCAL_ROOT_BASE}/user/atlasLocalSetup.sh -asetup --input=calypso/asetup.faser Athena,22.0.18 +asetup --input=calypso/asetup.faser Athena,22.0.19 #create build directory mkdir build diff --git a/Scintillator/ScintDetDescr/ScintGeoModelUtils/src/DistortedMaterialManager.cxx b/Scintillator/ScintDetDescr/ScintGeoModelUtils/src/DistortedMaterialManager.cxx index 541b16736..c3a4677f4 100644 --- a/Scintillator/ScintDetDescr/ScintGeoModelUtils/src/DistortedMaterialManager.cxx +++ b/Scintillator/ScintDetDescr/ScintGeoModelUtils/src/DistortedMaterialManager.cxx @@ -7,7 +7,7 @@ #include "GeoModelInterfaces/StoredMaterialManager.h" #include "GeoModelFaserUtilities/DecodeFaserVersionKey.h" #include "AthenaKernel/MsgStreamMember.h" -#include "StoreGate/StoreGate.h" +#include "StoreGate/StoreGateSvc.h" #include "RDBAccessSvc/IRDBAccessSvc.h" #include "GaudiKernel/ISvcLocator.h" #include "GaudiKernel/Bootstrap.h" diff --git a/Scintillator/ScintDetDescrCnv/ScintIdCnv/src/PreshowerIDDetDescrCnv.cxx b/Scintillator/ScintDetDescrCnv/ScintIdCnv/src/PreshowerIDDetDescrCnv.cxx index 1be3c20e6..2840f5bcf 100644 --- a/Scintillator/ScintDetDescrCnv/ScintIdCnv/src/PreshowerIDDetDescrCnv.cxx +++ b/Scintillator/ScintDetDescrCnv/ScintIdCnv/src/PreshowerIDDetDescrCnv.cxx @@ -14,7 +14,7 @@ #include "DetDescrCnvSvc/DetDescrConverter.h" #include "DetDescrCnvSvc/DetDescrAddress.h" #include "GaudiKernel/MsgStream.h" -#include "StoreGate/StoreGate.h" +#include "StoreGate/StoreGateSvc.h" #include "IdDictDetDescr/IdDictManager.h" #include "ScintIdentifier/PreshowerID.h" diff --git a/Scintillator/ScintDetDescrCnv/ScintIdCnv/src/TriggerIDDetDescrCnv.cxx b/Scintillator/ScintDetDescrCnv/ScintIdCnv/src/TriggerIDDetDescrCnv.cxx index 73c89f76f..17a737dd6 100644 --- a/Scintillator/ScintDetDescrCnv/ScintIdCnv/src/TriggerIDDetDescrCnv.cxx +++ b/Scintillator/ScintDetDescrCnv/ScintIdCnv/src/TriggerIDDetDescrCnv.cxx @@ -14,7 +14,7 @@ #include "DetDescrCnvSvc/DetDescrConverter.h" #include "DetDescrCnvSvc/DetDescrAddress.h" #include "GaudiKernel/MsgStream.h" -#include "StoreGate/StoreGate.h" +#include "StoreGate/StoreGateSvc.h" #include "IdDictDetDescr/IdDictManager.h" #include "ScintIdentifier/TriggerID.h" diff --git a/Scintillator/ScintDetDescrCnv/ScintIdCnv/src/VetoIDDetDescrCnv.cxx b/Scintillator/ScintDetDescrCnv/ScintIdCnv/src/VetoIDDetDescrCnv.cxx index c467616e5..0b8ab0722 100644 --- a/Scintillator/ScintDetDescrCnv/ScintIdCnv/src/VetoIDDetDescrCnv.cxx +++ b/Scintillator/ScintDetDescrCnv/ScintIdCnv/src/VetoIDDetDescrCnv.cxx @@ -14,7 +14,7 @@ #include "DetDescrCnvSvc/DetDescrConverter.h" #include "DetDescrCnvSvc/DetDescrAddress.h" #include "GaudiKernel/MsgStream.h" -#include "StoreGate/StoreGate.h" +#include "StoreGate/StoreGateSvc.h" #include "IdDictDetDescr/IdDictManager.h" #include "ScintIdentifier/VetoID.h" diff --git a/Scintillator/ScintSimEvent/src/ScintHitIdHelper.cxx b/Scintillator/ScintSimEvent/src/ScintHitIdHelper.cxx index ad7abd151..cacdb5d72 100644 --- a/Scintillator/ScintSimEvent/src/ScintHitIdHelper.cxx +++ b/Scintillator/ScintSimEvent/src/ScintHitIdHelper.cxx @@ -6,7 +6,6 @@ #include "ScintSimEvent/ScintHitIdHelper.h" #include "StoreGate/StoreGateSvc.h" -#include "StoreGate/StoreGate.h" #include "ScintIdentifier/VetoID.h" #include "G4Types.hh" @@ -43,10 +42,8 @@ void ScintHitIdHelper::Initialize() { // in which case eta module field is expanded. // Need to lock this thread-unsafe retrieval const VetoID* pix; - StoreGateSvc* detStore(nullptr); - { - std::lock_guard<std::mutex> lock(sgMutex); - detStore = StoreGate::pointer("DetectorStore"); + ServiceHandle<StoreGateSvc> detStore ("DetectorStore", "ScitHitIdHelper"); + if (detStore.retrieve().isSuccess()) { if (detStore->retrieve(pix, "VetoID").isFailure()) { pix = 0; } } diff --git a/Simulation/G4Utilities/Geo2G4/src/Geo2G4Builder.cxx b/Simulation/G4Utilities/Geo2G4/src/Geo2G4Builder.cxx index c0bafadb0..61e392854 100644 --- a/Simulation/G4Utilities/Geo2G4/src/Geo2G4Builder.cxx +++ b/Simulation/G4Utilities/Geo2G4/src/Geo2G4Builder.cxx @@ -23,7 +23,6 @@ #include "GaudiKernel/ISvcLocator.h" #include "GaudiKernel/Bootstrap.h" #include "StoreGate/StoreGateSvc.h" -#include "StoreGate/StoreGate.h" #include "G4ReflectionFactory.hh" #include "G4LogicalBorderSurface.hh" diff --git a/Tracker/TrackerDetDescr/TrackerGeoModelUtils/src/DistortedMaterialManager.cxx b/Tracker/TrackerDetDescr/TrackerGeoModelUtils/src/DistortedMaterialManager.cxx index 329f28e07..0b3c6118a 100755 --- a/Tracker/TrackerDetDescr/TrackerGeoModelUtils/src/DistortedMaterialManager.cxx +++ b/Tracker/TrackerDetDescr/TrackerGeoModelUtils/src/DistortedMaterialManager.cxx @@ -7,7 +7,7 @@ #include "GeoModelInterfaces/StoredMaterialManager.h" #include "GeoModelFaserUtilities/DecodeFaserVersionKey.h" #include "AthenaKernel/MsgStreamMember.h" -#include "StoreGate/StoreGate.h" +#include "StoreGate/StoreGateSvc.h" #include "RDBAccessSvc/IRDBAccessSvc.h" #include "GaudiKernel/ISvcLocator.h" #include "GaudiKernel/Bootstrap.h" diff --git a/Tracker/TrackerDetDescrCnv/TrackerIdCnv/src/FaserSCT_IDDetDescrCnv.cxx b/Tracker/TrackerDetDescrCnv/TrackerIdCnv/src/FaserSCT_IDDetDescrCnv.cxx index 192e8ce07..95447c912 100644 --- a/Tracker/TrackerDetDescrCnv/TrackerIdCnv/src/FaserSCT_IDDetDescrCnv.cxx +++ b/Tracker/TrackerDetDescrCnv/TrackerIdCnv/src/FaserSCT_IDDetDescrCnv.cxx @@ -17,7 +17,7 @@ #include "DetDescrCnvSvc/DetDescrConverter.h" #include "DetDescrCnvSvc/DetDescrAddress.h" #include "GaudiKernel/MsgStream.h" -#include "StoreGate/StoreGate.h" +#include "StoreGate/StoreGateSvc.h" #include "IdDictDetDescr/IdDictManager.h" #include "TrackerIdentifier/FaserSCT_ID.h" diff --git a/Tracker/TrackerSimEvent/src/FaserSiHitIdHelper.cxx b/Tracker/TrackerSimEvent/src/FaserSiHitIdHelper.cxx index b0e4b84a8..149466cf7 100644 --- a/Tracker/TrackerSimEvent/src/FaserSiHitIdHelper.cxx +++ b/Tracker/TrackerSimEvent/src/FaserSiHitIdHelper.cxx @@ -6,7 +6,6 @@ #include "TrackerSimEvent/FaserSiHitIdHelper.h" #include "StoreGate/StoreGateSvc.h" -#include "StoreGate/StoreGate.h" #include "TrackerIdentifier/FaserSCT_ID.h" #include "G4Types.hh" @@ -42,10 +41,8 @@ void FaserSiHitIdHelper::Initialize() { // in which case eta module field is expanded. // Need to lock this thread-unsafe retrieval const FaserSCT_ID* pix; - StoreGateSvc* detStore(nullptr); - { - std::lock_guard<std::mutex> lock(sgMutex); - detStore = StoreGate::pointer("DetectorStore"); + ServiceHandle<StoreGateSvc> detStore ("DetectorStore", "SiHitIdHelper"); + if (detStore.retrieve().isSuccess()) { if (detStore->retrieve(pix, "FaserSCT_ID").isFailure()) { pix = 0; } } diff --git a/Tracking/Acts/FaserActsGeometry/FaserActsGeometry/FaserActsExtrapolationAlg.h b/Tracking/Acts/FaserActsGeometry/FaserActsGeometry/FaserActsExtrapolationAlg.h index 56c903c07..96bbda658 100755 --- a/Tracking/Acts/FaserActsGeometry/FaserActsGeometry/FaserActsExtrapolationAlg.h +++ b/Tracking/Acts/FaserActsGeometry/FaserActsGeometry/FaserActsExtrapolationAlg.h @@ -13,7 +13,7 @@ // ACTS #include "Acts/EventData/TrackParameters.hpp" -#include "Acts/Geometry/GeometryID.hpp" +#include "Acts/Geometry/GeometryIdentifier.hpp" #include "Acts/Utilities/Helpers.hpp" // PACKAGE diff --git a/Tracking/Acts/FaserActsGeometry/FaserActsGeometry/FaserActsExtrapolationTool.h b/Tracking/Acts/FaserActsGeometry/FaserActsGeometry/FaserActsExtrapolationTool.h index 24498ac80..bb8e780b6 100644 --- a/Tracking/Acts/FaserActsGeometry/FaserActsGeometry/FaserActsExtrapolationTool.h +++ b/Tracking/Acts/FaserActsGeometry/FaserActsGeometry/FaserActsExtrapolationTool.h @@ -30,13 +30,14 @@ #include "Acts/Propagator/EigenStepper.hpp" #include "Acts/Propagator/detail/SteppingLogger.hpp" #include "Acts/Propagator/Navigator.hpp" -#include "Acts/Propagator/DebugOutputActor.hpp" #include "Acts/Propagator/StandardAborters.hpp" +#include "Acts/Propagator/SurfaceCollector.hpp" #include "Acts/MagneticField/ConstantBField.hpp" #include "Acts/MagneticField/MagneticFieldContext.hpp" #include "Acts/Utilities/Result.hpp" #include "Acts/Utilities/Units.hpp" #include "Acts/Utilities/Helpers.hpp" +#include "Acts/Utilities/Logger.hpp" namespace Acts { class Surface; @@ -64,38 +65,36 @@ public: private: // set up options for propagation using SteppingLogger = Acts::detail::SteppingLogger; - using DebugOutput = Acts::DebugOutputActor; using EndOfWorld = Acts::EndOfWorldReached; - using ResultType = Acts::Result<std::pair<ActsPropagationOutput, - DebugOutput::result_type>>; + using ResultType = Acts::Result<ActsPropagationOutput>; public: virtual - ActsPropagationOutput + ActsPropagationOutput propagationSteps(const EventContext& ctx, - const Acts::BoundParameters& startParameters, - Acts::NavigationDirection navDir = Acts::forward, - double pathLimit = std::numeric_limits<double>::max()) const override; + const Acts::BoundTrackParameters& startParameters, + Acts::NavigationDirection navDir = Acts::forward, + double pathLimit = std::numeric_limits<double>::max()) const override; virtual - std::unique_ptr<const Acts::CurvilinearParameters> + std::unique_ptr<const Acts::CurvilinearTrackParameters> propagate(const EventContext& ctx, - const Acts::BoundParameters& startParameters, + const Acts::BoundTrackParameters& startParameters, Acts::NavigationDirection navDir = Acts::forward, double pathLimit = std::numeric_limits<double>::max()) const override; virtual ActsPropagationOutput propagationSteps(const EventContext& ctx, - const Acts::BoundParameters& startParameters, + const Acts::BoundTrackParameters& startParameters, const Acts::Surface& target, Acts::NavigationDirection navDir = Acts::forward, double pathLimit = std::numeric_limits<double>::max()) const override; virtual - std::unique_ptr<const Acts::BoundParameters> + std::unique_ptr<const Acts::BoundTrackParameters> propagate(const EventContext& ctx, - const Acts::BoundParameters& startParameters, + const Acts::BoundTrackParameters& startParameters, const Acts::Surface& target, Acts::NavigationDirection navDir = Acts::forward, double pathLimit = std::numeric_limits<double>::max()) const override; diff --git a/Tracking/Acts/FaserActsGeometry/src/CuboidVolumeBuilder.cxx b/Tracking/Acts/FaserActsGeometry/src/CuboidVolumeBuilder.cxx index 2ded998d6..1f93d658f 100644 --- a/Tracking/Acts/FaserActsGeometry/src/CuboidVolumeBuilder.cxx +++ b/Tracking/Acts/FaserActsGeometry/src/CuboidVolumeBuilder.cxx @@ -18,7 +18,7 @@ #include "Acts/Geometry/detail/DefaultDetectorElementBase.hpp" #include "Acts/Geometry/ApproachDescriptor.hpp" #include "Acts/Material/HomogeneousSurfaceMaterial.hpp" -#include "Acts/Material/MaterialProperties.hpp" +#include "Acts/Material/Material.hpp" #include "Acts/Surfaces/PlaneSurface.hpp" #include "Acts/Surfaces/RectangleBounds.hpp" #include "Acts/Surfaces/SurfaceArray.hpp" @@ -46,7 +46,7 @@ CuboidVolumeBuilder::buildSurface( cfg.rBounds, cfg.thickness))); } else { surface = Acts::Surface::makeShared<Acts::PlaneSurface>( - std::make_shared<const Acts::Transform3D>(trafo), cfg.rBounds); + trafo, cfg.rBounds); } surface->assignSurfaceMaterial(cfg.surMat); return surface; @@ -71,13 +71,11 @@ std::shared_ptr<const Acts::Layer> CuboidVolumeBuilder::buildLayer( if ( !cfg.surfaces.empty() ) { return layerCreator.planeLayer(gctx, cfg.surfaces, cfg.binsX, cfg.binsY, - Acts::BinningValue::binZ, std::nullopt, - std::make_shared<const Acts::Transform3D>(trafo), + Acts::BinningValue::binZ, std::nullopt, trafo, std::move(ap)); } else { return layerCreator.planeLayer(gctx, {cfg.surface}, cfg.binsX, cfg.binsY, - Acts::BinningValue::binZ, std::nullopt, - std::make_shared<const Acts::Transform3D>(trafo), + Acts::BinningValue::binZ, std::nullopt, trafo, std::move(ap)); } } @@ -169,8 +167,7 @@ std::shared_ptr<Acts::TrackingVolume> CuboidVolumeBuilder::buildVolume( // Build TrackingVolume auto trackVolume = Acts::TrackingVolume::create( - std::make_shared<const Acts::Transform3D>(trafo), bounds, cfg.volumeMaterial, - std::move(layArr), nullptr, cfg.trackingVolumes, cfg.name); + trafo, bounds, cfg.volumeMaterial, std::move(layArr), nullptr, cfg.trackingVolumes, cfg.name); return trackVolume; } @@ -229,7 +226,7 @@ Acts::MutableTrackingVolumePtr CuboidVolumeBuilder::trackingVolume( // Create world volume Acts::MutableTrackingVolumePtr mtvp(Acts::TrackingVolume::create( - std::make_shared<const Acts::Transform3D>(trafo), volume, trVolArr, "World")); + trafo, volume, trVolArr, "World")); return mtvp; } diff --git a/Tracking/Acts/FaserActsGeometry/src/FaserActsExtrapolationAlg.cxx b/Tracking/Acts/FaserActsGeometry/src/FaserActsExtrapolationAlg.cxx index 5130f68e0..a259675a4 100755 --- a/Tracking/Acts/FaserActsGeometry/src/FaserActsExtrapolationAlg.cxx +++ b/Tracking/Acts/FaserActsGeometry/src/FaserActsExtrapolationAlg.cxx @@ -111,8 +111,7 @@ StatusCode FaserActsExtrapolationAlg::execute(const EventContext& ctx) const FaserActsGeometryContext gctx = m_extrapolationTool->trackingGeometryTool()->getNominalGeometryContext(); auto anygctx = gctx.any(); - Acts::BoundParameters startParameters(anygctx, - std::move(cov), std::move(pars), std::move(surface)); + Acts::BoundTrackParameters startParameters(std::move(surface), std::move(pars), std::move(cov)); auto output = m_extrapolationTool->propagationSteps(ctx, startParameters); m_propStepWriterSvc->write(output.first); writeStepsObj(output.first); diff --git a/Tracking/Acts/FaserActsGeometry/src/FaserActsExtrapolationTool.cxx b/Tracking/Acts/FaserActsGeometry/src/FaserActsExtrapolationTool.cxx index d4b1b08db..e2235d1cd 100644 --- a/Tracking/Acts/FaserActsGeometry/src/FaserActsExtrapolationTool.cxx +++ b/Tracking/Acts/FaserActsGeometry/src/FaserActsExtrapolationTool.cxx @@ -110,7 +110,7 @@ FaserActsExtrapolationTool::initialize() ActsPropagationOutput FaserActsExtrapolationTool::propagationSteps(const EventContext& ctx, - const Acts::BoundParameters& startParameters, + const Acts::BoundTrackParameters& startParameters, Acts::NavigationDirection navDir /*= Acts::forward*/, double pathLimit /*= std::numeric_limits<double>::max()*/) const { @@ -125,15 +125,13 @@ FaserActsExtrapolationTool::propagationSteps(const EventContext& ctx, auto anygctx = gctx.any(); // Action list and abort list - using ActionList = Acts::ActionList<SteppingLogger, Acts::MaterialInteractor, DebugOutput>; + using ActionList = Acts::ActionList<SteppingLogger, Acts::MaterialInteractor>; using AbortConditions = Acts::AbortList<EndOfWorld>; using Options = Acts::PropagatorOptions<ActionList, AbortConditions>; Options options(anygctx, mctx, Acts::LoggerWrapper{*m_logger}); options.pathLimit = pathLimit; - bool debug = msg().level() == MSG::VERBOSE; - options.debug = debug; options.loopProtection = (Acts::VectorHelpers::perp(startParameters.momentum()) @@ -148,7 +146,6 @@ FaserActsExtrapolationTool::propagationSteps(const EventContext& ctx, mInteractor.recordInteractions = m_interactionRecord; ActsPropagationOutput output; - DebugOutput::result_type debugOutput; auto res = boost::apply_visitor([&](const auto& propagator) -> ResultType { auto result = propagator.propagate(startParameters, options); @@ -158,12 +155,11 @@ FaserActsExtrapolationTool::propagationSteps(const EventContext& ctx, auto& propRes = *result; auto steppingResults = propRes.template get<SteppingLogger::result_type>(); - auto debugOutput = propRes.template get<DebugOutput::result_type>(); - auto materialResult = propRes.template get<Acts::MaterialInteractor::result_type>(); - output.first = std::move(steppingResults.steps); - output.second = std::move(materialResult); + auto materialResult = propRes.template get<Acts::MaterialInteractor::result_type>(); + output.first = std::move(steppingResults.steps); + output.second = std::move(materialResult); // try to force return value optimization, not sure this is necessary - return std::make_pair(std::move(output), std::move(debugOutput)); + return std::move(output); }, *m_varProp); if (!res.ok()) { @@ -171,11 +167,6 @@ FaserActsExtrapolationTool::propagationSteps(const EventContext& ctx, << ". Returning empty step vector."); return {}; } - std::tie(output, debugOutput) = std::move(*res); - - if(debug) { - ATH_MSG_VERBOSE(debugOutput.debugString); - } ATH_MSG_VERBOSE("Collected " << output.first.size() << " steps"); if (output.first.size() == 0) { @@ -188,9 +179,9 @@ FaserActsExtrapolationTool::propagationSteps(const EventContext& ctx, } -std::unique_ptr<const Acts::CurvilinearParameters> +std::unique_ptr<const Acts::CurvilinearTrackParameters> FaserActsExtrapolationTool::propagate(const EventContext& ctx, - const Acts::BoundParameters& startParameters, + const Acts::BoundTrackParameters& startParameters, Acts::NavigationDirection navDir /*= Acts::forward*/, double pathLimit /*= std::numeric_limits<double>::max()*/) const { @@ -205,14 +196,12 @@ FaserActsExtrapolationTool::propagate(const EventContext& ctx, auto anygctx = gctx.any(); // Action list and abort list - using ActionList = Acts::ActionList<Acts::MaterialInteractor, DebugOutput>; + using ActionList = Acts::ActionList<Acts::MaterialInteractor>; using AbortConditions = Acts::AbortList<EndOfWorld>; using Options = Acts::PropagatorOptions<ActionList, AbortConditions>; Options options(anygctx, mctx, Acts::LoggerWrapper{*m_logger}); options.pathLimit = pathLimit; - bool debug = msg().level() == MSG::VERBOSE; - options.debug = debug; options.loopProtection = (Acts::VectorHelpers::perp(startParameters.momentum()) @@ -225,7 +214,7 @@ FaserActsExtrapolationTool::propagate(const EventContext& ctx, mInteractor.energyLoss = m_interactionEloss; mInteractor.recordInteractions = m_interactionRecord; - auto parameters = boost::apply_visitor([&](const auto& propagator) -> std::unique_ptr<const Acts::CurvilinearParameters> { + auto parameters = boost::apply_visitor([&](const auto& propagator) -> std::unique_ptr<const Acts::CurvilinearTrackParameters> { auto result = propagator.propagate(startParameters, options); if (!result.ok()) { ATH_MSG_ERROR("Got error during propagation:" << result.error() @@ -240,7 +229,7 @@ FaserActsExtrapolationTool::propagate(const EventContext& ctx, ActsPropagationOutput FaserActsExtrapolationTool::propagationSteps(const EventContext& ctx, - const Acts::BoundParameters& startParameters, + const Acts::BoundTrackParameters& startParameters, const Acts::Surface& target, Acts::NavigationDirection navDir /*= Acts::forward*/, double pathLimit /*= std::numeric_limits<double>::max()*/) const @@ -256,14 +245,12 @@ FaserActsExtrapolationTool::propagationSteps(const EventContext& ctx, auto anygctx = gctx.any(); // Action list and abort list - using ActionList = Acts::ActionList<SteppingLogger, Acts::MaterialInteractor, DebugOutput>; + using ActionList = Acts::ActionList<SteppingLogger, Acts::MaterialInteractor>; using AbortConditions = Acts::AbortList<EndOfWorld>; using Options = Acts::PropagatorOptions<ActionList, AbortConditions>; Options options(anygctx, mctx, Acts::LoggerWrapper{*m_logger}); options.pathLimit = pathLimit; - bool debug = msg().level() == MSG::VERBOSE; - options.debug = debug; options.loopProtection = (Acts::VectorHelpers::perp(startParameters.momentum()) @@ -277,7 +264,6 @@ FaserActsExtrapolationTool::propagationSteps(const EventContext& ctx, mInteractor.recordInteractions = m_interactionRecord; ActsPropagationOutput output; - DebugOutput::result_type debugOutput; auto res = boost::apply_visitor([&](const auto& propagator) -> ResultType { auto result = propagator.propagate(startParameters, target, options); @@ -287,11 +273,10 @@ FaserActsExtrapolationTool::propagationSteps(const EventContext& ctx, auto& propRes = *result; auto steppingResults = propRes.template get<SteppingLogger::result_type>(); - auto debugOutput = propRes.template get<DebugOutput::result_type>(); auto materialResult = propRes.template get<Acts::MaterialInteractor::result_type>(); output.first = std::move(steppingResults.steps); output.second = std::move(materialResult); - return std::make_pair(std::move(output), std::move(debugOutput)); + return std::move(output); }, *m_varProp); if (!res.ok()) { @@ -299,11 +284,6 @@ FaserActsExtrapolationTool::propagationSteps(const EventContext& ctx, << ". Returning empty step vector."); return {}; } - std::tie(output, debugOutput) = std::move(*res); - - if(debug) { - ATH_MSG_VERBOSE(debugOutput.debugString); - } ATH_MSG_VERBOSE("Collected " << output.first.size() << " steps"); if (output.first.size() == 0) { @@ -315,9 +295,9 @@ FaserActsExtrapolationTool::propagationSteps(const EventContext& ctx, return output; } -std::unique_ptr<const Acts::BoundParameters> +std::unique_ptr<const Acts::BoundTrackParameters> FaserActsExtrapolationTool::propagate(const EventContext& ctx, - const Acts::BoundParameters& startParameters, + const Acts::BoundTrackParameters& startParameters, const Acts::Surface& target, Acts::NavigationDirection navDir /*= Acts::forward*/, double pathLimit /*= std::numeric_limits<double>::max()*/) const @@ -333,14 +313,12 @@ FaserActsExtrapolationTool::propagate(const EventContext& ctx, auto anygctx = gctx.any(); // Action list and abort list - using ActionList = Acts::ActionList<Acts::MaterialInteractor, DebugOutput>; + using ActionList = Acts::ActionList<Acts::MaterialInteractor>; using AbortConditions = Acts::AbortList<EndOfWorld>; using Options = Acts::PropagatorOptions<ActionList, AbortConditions>; Options options(anygctx, mctx, Acts::LoggerWrapper{*m_logger}); options.pathLimit = pathLimit; - bool debug = msg().level() == MSG::VERBOSE; - options.debug = debug; options.loopProtection = (Acts::VectorHelpers::perp(startParameters.momentum()) @@ -353,7 +331,7 @@ FaserActsExtrapolationTool::propagate(const EventContext& ctx, mInteractor.energyLoss = m_interactionEloss; mInteractor.recordInteractions = m_interactionRecord; - auto parameters = boost::apply_visitor([&](const auto& propagator) -> std::unique_ptr<const Acts::BoundParameters> { + auto parameters = boost::apply_visitor([&](const auto& propagator) -> std::unique_ptr<const Acts::BoundTrackParameters> { auto result = propagator.propagate(startParameters, target, options); if (!result.ok()) { ATH_MSG_ERROR("Got error during propagation: " << result.error() diff --git a/Tracking/Acts/FaserActsGeometry/src/FaserActsLayerBuilder.cxx b/Tracking/Acts/FaserActsGeometry/src/FaserActsLayerBuilder.cxx index f71414894..4f21342cd 100644 --- a/Tracking/Acts/FaserActsGeometry/src/FaserActsLayerBuilder.cxx +++ b/Tracking/Acts/FaserActsGeometry/src/FaserActsLayerBuilder.cxx @@ -147,14 +147,11 @@ FaserActsLayerBuilder::buildLayers(const Acts::GeometryContext& gctx, auto rBounds = std::make_shared<const Acts::RectangleBounds>( 0.5*layercfg.binsY*m_ModuleWidth, 0.5*layercfg.binsX*m_ModuleLength ) ; - auto transformNominal - = std::make_shared<const Transform3D>(Translation3D(0., 0., layerZ)); + Transform3D transformNominal(Translation3D(0., 0., layerZ)); - auto transformInner - = std::make_shared<const Transform3D>(Translation3D(0., 0., layerZInner)); + Transform3D transformInner(Translation3D(0., 0., layerZInner)); - auto transformOuter - = std::make_shared<const Transform3D>(Translation3D(0., 0., layerZOuter)); + Transform3D transformOuter(Translation3D(0., 0., layerZOuter)); std::shared_ptr<Acts::PlaneSurface> innerBoundary = Acts::Surface::makeShared<Acts::PlaneSurface>(transformInner, rBounds); diff --git a/Tracking/Acts/FaserActsGeometry/src/FaserActsPropStepRootWriterSvc.cxx b/Tracking/Acts/FaserActsGeometry/src/FaserActsPropStepRootWriterSvc.cxx index 44e93ff0e..6d24eba82 100644 --- a/Tracking/Acts/FaserActsGeometry/src/FaserActsPropStepRootWriterSvc.cxx +++ b/Tracking/Acts/FaserActsGeometry/src/FaserActsPropStepRootWriterSvc.cxx @@ -125,7 +125,7 @@ FaserActsPropStepRootWriterSvc::writeThread() void FaserActsPropStepRootWriterSvc::doWrite(const StepVector& steps, size_t evtNum) { - using ag = Acts::GeometryID; + using ag = Acts::GeometryIdentifier; m_eventNum = evtNum; m_s_pX.clear(); @@ -139,14 +139,14 @@ FaserActsPropStepRootWriterSvc::doWrite(const StepVector& steps, size_t evtNum) m_s_sensitiveID.clear(); for(const auto& step : steps) { - Acts::GeometryID::Value volumeID = 0; - Acts::GeometryID::Value boundaryID = 0; - Acts::GeometryID::Value layerID = 0; - Acts::GeometryID::Value approachID = 0; - Acts::GeometryID::Value sensitiveID = 0; + Acts::GeometryIdentifier::Value volumeID = 0; + Acts::GeometryIdentifier::Value boundaryID = 0; + Acts::GeometryIdentifier::Value layerID = 0; + Acts::GeometryIdentifier::Value approachID = 0; + Acts::GeometryIdentifier::Value sensitiveID = 0; // get the identification from the surface first if (step.surface) { - auto geoID = step.surface->geoID(); + auto geoID = step.surface->geometryId(); sensitiveID = geoID.sensitive(); approachID = geoID.approach(); layerID = geoID.layer(); @@ -155,7 +155,7 @@ FaserActsPropStepRootWriterSvc::doWrite(const StepVector& steps, size_t evtNum) } // a current volume overwrites the surface tagged one if (step.volume) { - volumeID = step.volume->geoID().volume(); + volumeID = step.volume->geometryId().volume(); } // now fill m_s_sensitiveID.push_back(sensitiveID); diff --git a/Tracking/Acts/FaserActsGeometry/src/util/ObjSurfaceWriter.cxx b/Tracking/Acts/FaserActsGeometry/src/util/ObjSurfaceWriter.cxx index 162a34efc..4de54887c 100644 --- a/Tracking/Acts/FaserActsGeometry/src/util/ObjSurfaceWriter.cxx +++ b/Tracking/Acts/FaserActsGeometry/src/util/ObjSurfaceWriter.cxx @@ -15,7 +15,7 @@ #include "Acts/Surfaces/PlanarBounds.hpp" #include "Acts/Surfaces/RadialBounds.hpp" #include "Acts/Surfaces/SurfaceBounds.hpp" -#include "Acts/Geometry/GeometryID.hpp" +#include "Acts/Geometry/GeometryIdentifier.hpp" #include "Acts/Geometry/Polyhedron.hpp" #include "Acts/Surfaces/CylinderSurface.hpp" @@ -166,7 +166,7 @@ Acts::ObjSurfaceWriter::write(const Acts::GeometryContext &gctx, ACTS_VERBOSE(">>Obj: Writing out a CylinderSurface with r = " << cylinderBounds->get(Acts::CylinderBounds::eR)); // name the object - auto layerID = surface.geoID().layer(); + auto layerID = surface.geometryId().layer(); (*(m_cfg.outputStream)) << " o Cylinder_" << std::to_string(layerID) << '\n'; // output to the file @@ -188,7 +188,7 @@ Acts::ObjSurfaceWriter::write(const Acts::GeometryContext &gctx, ACTS_VERBOSE(">>Obj: Writing out a DiskSurface at z = " << sTransform.translation().z()); // name the object - auto layerID = surface.geoID().layer(); + auto layerID = surface.geometryId().layer(); (*(m_cfg.outputStream)) << "o Disk_" << std::to_string(layerID) << '\n'; // we use the tube writer in the other direction double rMin = radialBounds->rMin(); diff --git a/Tracking/Acts/FaserActsGeometryInterfaces/FaserActsGeometryInterfaces/IFaserActsExtrapolationTool.h b/Tracking/Acts/FaserActsGeometryInterfaces/FaserActsGeometryInterfaces/IFaserActsExtrapolationTool.h index 6f04868ee..89ec77aa9 100644 --- a/Tracking/Acts/FaserActsGeometryInterfaces/FaserActsGeometryInterfaces/IFaserActsExtrapolationTool.h +++ b/Tracking/Acts/FaserActsGeometryInterfaces/FaserActsGeometryInterfaces/IFaserActsExtrapolationTool.h @@ -39,29 +39,29 @@ class IFaserActsExtrapolationTool : virtual public IAlgTool { virtual ActsPropagationOutput propagationSteps(const EventContext& ctx, - const Acts::BoundParameters& startParameters, + const Acts::BoundTrackParameters& startParameters, Acts::NavigationDirection navDir = Acts::forward, double pathLimit = std::numeric_limits<double>::max()) const = 0; virtual - std::unique_ptr<const Acts::CurvilinearParameters> + std::unique_ptr<const Acts::CurvilinearTrackParameters> propagate(const EventContext& ctx, - const Acts::BoundParameters& startParameters, + const Acts::BoundTrackParameters& startParameters, Acts::NavigationDirection navDir = Acts::forward, double pathLimit = std::numeric_limits<double>::max()) const = 0; virtual ActsPropagationOutput propagationSteps(const EventContext& ctx, - const Acts::BoundParameters& startParameters, + const Acts::BoundTrackParameters& startParameters, const Acts::Surface& target, Acts::NavigationDirection navDir = Acts::forward, double pathLimit = std::numeric_limits<double>::max()) const = 0; virtual - std::unique_ptr<const Acts::BoundParameters> + std::unique_ptr<const Acts::BoundTrackParameters> propagate(const EventContext& ctx, - const Acts::BoundParameters& startParameters, + const Acts::BoundTrackParameters& startParameters, const Acts::Surface& target, Acts::NavigationDirection navDir = Acts::forward, double pathLimit = std::numeric_limits<double>::max()) const = 0; diff --git a/Tracking/Acts/FaserActsKalmanFilter/FaserActsKalmanFilter/FaserActsKalmanFilterAlg.h b/Tracking/Acts/FaserActsKalmanFilter/FaserActsKalmanFilter/FaserActsKalmanFilterAlg.h index da8f7995c..484774be9 100755 --- a/Tracking/Acts/FaserActsKalmanFilter/FaserActsKalmanFilter/FaserActsKalmanFilterAlg.h +++ b/Tracking/Acts/FaserActsKalmanFilter/FaserActsKalmanFilter/FaserActsKalmanFilterAlg.h @@ -31,10 +31,10 @@ #include "Acts/Propagator/EigenStepper.hpp" #include "Acts/Propagator/Propagator.hpp" #include "Acts/Propagator/detail/SteppingLogger.hpp" -#include "Acts/Fitter/KalmanFitter.hpp" +#include "Acts/TrackFitting/KalmanFitter.hpp" #include "Acts/Geometry/TrackingGeometry.hpp" #include "Acts/EventData/TrackParameters.hpp" -#include "Acts/Geometry/GeometryID.hpp" +#include "Acts/Geometry/GeometryIdentifier.hpp" #include "Acts/Utilities/Helpers.hpp" #include "Acts/Utilities/Definitions.hpp" @@ -81,7 +81,7 @@ public: // options and returns some fit-specific result. using FitterFunction = std::function<FitterResult( const std::vector<RecSourceLink>&, - const Acts::CurvilinearParameters&, + const Acts::CurvilinearTrackParameters&, const Acts::KalmanFitterOptions<Acts::VoidOutlierFinder>&)>; // Create the fitter function implementation. @@ -96,7 +96,7 @@ public: void initializeTree(); - void fillFitResult(const Acts::GeometryContext& geoctx, const TrajectoryContainer& trajectories, const Acts::BoundParameters& truthParam); + void fillFitResult(const Acts::GeometryContext& geoctx, const TrajectoryContainer& trajectories, const Acts::BoundTrackParameters& truthParam); void clearTrackVariables(); diff --git a/Tracking/Acts/FaserActsKalmanFilter/FaserActsKalmanFilter/FaserActsRecMultiTrajectory.h b/Tracking/Acts/FaserActsKalmanFilter/FaserActsKalmanFilter/FaserActsRecMultiTrajectory.h index bea0c1583..928261e6e 100644 --- a/Tracking/Acts/FaserActsKalmanFilter/FaserActsKalmanFilter/FaserActsRecMultiTrajectory.h +++ b/Tracking/Acts/FaserActsKalmanFilter/FaserActsKalmanFilter/FaserActsRecMultiTrajectory.h @@ -16,7 +16,7 @@ // PACKAGE #include "FaserActsKalmanFilter/FaserActsRecSourceLink.h" -using IndexedParams = std::unordered_map<size_t, Acts::BoundParameters>; +using IndexedParams = std::unordered_map<size_t, Acts::BoundTrackParameters>; struct FaserActsRecMultiTrajectory { @@ -69,7 +69,7 @@ struct FaserActsRecMultiTrajectory return std::make_pair(m_trackTips, m_multiTrajectory); } - const Acts::BoundParameters& trackParameters(const size_t& entryIndex) const { + const Acts::BoundTrackParameters& trackParameters(const size_t& entryIndex) const { auto it = m_trackParameters.find(entryIndex); if (it != m_trackParameters.end()) { return it->second; diff --git a/Tracking/Acts/FaserActsKalmanFilter/FaserActsKalmanFilter/FaserActsRecSourceLink.h b/Tracking/Acts/FaserActsKalmanFilter/FaserActsKalmanFilter/FaserActsRecSourceLink.h index def70b00d..fcf3b57b3 100644 --- a/Tracking/Acts/FaserActsKalmanFilter/FaserActsKalmanFilter/FaserActsRecSourceLink.h +++ b/Tracking/Acts/FaserActsKalmanFilter/FaserActsKalmanFilter/FaserActsRecSourceLink.h @@ -23,7 +23,7 @@ public: constexpr const Trk::SpacePoint& spacePoint() const { return *m_spacePoint; } Acts::FittableMeasurement<RecSourceLink> operator*() const { - return Acts::Measurement<RecSourceLink, Acts::BoundParametersIndices, Acts::ParDef::eLOC_0, Acts::ParDef::eLOC_1> { + return Acts::Measurement<RecSourceLink, Acts::BoundIndices, Acts::eBoundLoc0, Acts::eBoundLoc1> { m_surface->getSharedPtr(), *this, m_cov.topLeftCorner<2, 2>(), diff --git a/Tracking/Acts/FaserActsKalmanFilter/src/FaserActsKalmanFilterAlg.cxx b/Tracking/Acts/FaserActsKalmanFilter/src/FaserActsKalmanFilterAlg.cxx index 7edff9fcd..0c92d2530 100755 --- a/Tracking/Acts/FaserActsKalmanFilter/src/FaserActsKalmanFilterAlg.cxx +++ b/Tracking/Acts/FaserActsKalmanFilter/src/FaserActsKalmanFilterAlg.cxx @@ -18,9 +18,9 @@ #include "FaserDetDescr/FaserDetectorID.h" // ACTS -#include "Acts/Fitter/GainMatrixSmoother.hpp" -#include "Acts/Fitter/GainMatrixUpdater.hpp" -#include "Acts/Geometry/GeometryID.hpp" +#include "Acts/TrackFitting/GainMatrixSmoother.hpp" +#include "Acts/TrackFitting/GainMatrixUpdater.hpp" +#include "Acts/Geometry/GeometryIdentifier.hpp" #include "Acts/MagneticField/ConstantBField.hpp" #include "Acts/MagneticField/InterpolatedBFieldMap.hpp" #include "Acts/MagneticField/SharedBField.hpp" @@ -74,8 +74,8 @@ using Acts::VectorHelpers::eta; using Acts::VectorHelpers::perp; using Acts::VectorHelpers::phi; using Acts::VectorHelpers::theta; -using Measurement = Acts::Measurement<RecSourceLink, Acts::BoundParametersIndices, Acts::ParDef::eLOC_0, - Acts::ParDef::eLOC_1>; +using Measurement = Acts::Measurement<RecSourceLink, Acts::BoundIndices, Acts::eBoundLoc0, + Acts::eBoundLoc1>; namespace ActsExtrapolationDetail { using VariantPropagatorBase = boost::variant< @@ -241,8 +241,7 @@ StatusCode FaserActsKalmanFilterAlg::execute() auto rectangleBounds = std::make_shared<const Acts::RectangleBounds>(hlX, hlY); Amg::Transform3D g2l = siSpElement->getMaterialGeom()->getDefAbsoluteTransform() * Amg::CLHEPTransformToEigen(siSpElement->recoToHitTransform()); - pSurface = Acts::Surface::makeShared<Acts::PlaneSurface>( - std::make_shared<const Acts::Transform3D>( g2l ), rectangleBounds ); + pSurface = Acts::Surface::makeShared<Acts::PlaneSurface>( g2l, rectangleBounds ); } if (station==1 && plane==1) { @@ -332,14 +331,14 @@ StatusCode FaserActsKalmanFilterAlg::execute() double sigmaQOverP = 0.01*p / (p*p); double sigmaT0 = 1_ns; Acts::BoundSymMatrix cov = Acts::BoundSymMatrix::Zero(); - cov(Acts::eLOC_0, Acts::eLOC_0) = sigmaU * sigmaU; - cov(Acts::eLOC_1, Acts::eLOC_1) = sigmaV * sigmaV; - cov(Acts::ePHI, Acts::ePHI) = sigmaPhi * sigmaPhi; - cov(Acts::eTHETA, Acts::eTHETA) = sigmaTheta * sigmaTheta; - cov(Acts::eQOP, Acts::eQOP) = sigmaQOverP * sigmaQOverP; - cov(Acts::eT, Acts::eT) = sigmaT0 * sigmaT0; + cov(Acts::eBoundLoc0, Acts::eBoundLoc0) = sigmaU * sigmaU; + cov(Acts::eBoundLoc1, Acts::eBoundLoc1) = sigmaV * sigmaV; + cov(Acts::eBoundPhi, Acts::eBoundPhi) = sigmaPhi * sigmaPhi; + cov(Acts::eBoundTheta, Acts::eBoundTheta) = sigmaTheta * sigmaTheta; + cov(Acts::eBoundQOverP, Acts::eBoundQOverP) = sigmaQOverP * sigmaQOverP; + cov(Acts::eBoundTime, Acts::eBoundTime) = sigmaT0 * sigmaT0; double time =0; - //Acts::CurvilinearParameters InitTrackParam(std::make_optional(std::move(cov)), pos, mom, charge, time); // calculated initial parameters + //Acts::CurvilinearTrackParameters InitTrackParam(std::make_optional(std::move(cov)), pos, mom, charge, time); // calculated initial parameters // Smearing truth parameters as initial parameters Acts::Vector3D pPos(pv.x(), pv.y(), pv.z()); @@ -357,16 +356,23 @@ StatusCode FaserActsKalmanFilterAlg::execute() const Acts::Vector3D deltaMom = ( pMom.norm()*(1 + 0.01*norm(rng)) ) * dir - pMom; std::cout << "deltaPos: " << deltaPos << std::endl; std::cout << "deltaMom: " << deltaMom << std::endl; - Acts::CurvilinearParameters InitTrackParam(std::make_optional(std::move(cov)), pPos+deltaPos, pMom+deltaMom, charge, time); + const Acts::Vector4D posTime ((pPos+deltaPos).x(), (pPos+deltaPos).y(), (pPos+deltaPos).z(), time); + const Acts::Vector3D momentum = pMom+deltaMom; + const Acts::Vector3D momentum_dir = momentum.normalized(); + double momentum_abs = momentum.norm(); + Acts::CurvilinearTrackParameters InitTrackParam(posTime, momentum_dir, momentum_abs, charge, std::make_optional(std::move(cov))); // the surface which the production point is bound to Acts::Vector3D center(0, 0, pPos.z()); Acts::Vector3D normal(0, 0, 1); std::shared_ptr<const Acts::Surface> initSurface = Acts::Surface::makeShared<Acts::PlaneSurface>(center, normal); // extrapolate the particle from production point to the first layer - Acts::BoundParameters startParameters(geoctx, std::nullopt, pPos, pMom, charge, time, initSurface); + const Acts::Vector4D truthPosTime (pPos.x(), pPos.y(), pPos.z(), time); + const Acts::Vector3D truthMomentum_dir = pMom.normalized(); + double truthMomentum_abs = pMom.norm(); + Acts::BoundTrackParameters startParameters(initSurface, geoctx, truthPosTime, truthMomentum_dir, truthMomentum_abs, charge, std::nullopt); auto truthParam = m_extrapolationTool->propagate(Gaudi::Hive::currentContext(), startParameters, *pSurface); - std::cout << "truth pos on 1st layer: " << truthParam->position() << std::endl; + std::cout << "truth pos on 1st layer: " << truthParam->position(geoctx) << std::endl; std::cout << "truth mom on 1st layer: " << truthParam->momentum() << std::endl; std::cout << "truth parameters on 1st layer: " << truthParam->parameters() << std::endl; @@ -387,7 +393,8 @@ StatusCode FaserActsKalmanFilterAlg::execute() magctx, calctx, Acts::VoidOutlierFinder(), - Acts::LoggerWrapper{*logger}, + Acts::LoggerWrapper{*logger}, + Acts::PropagatorPlainOptions(), &(*pSurface), true, // scattering true, // energy loss @@ -447,7 +454,7 @@ StatusCode FaserActsKalmanFilterAlg::execute() const auto& params = fitOutput.fittedParameters.value(); ATH_MSG_VERBOSE("Fitted paramemeters for track " << itrack); ATH_MSG_VERBOSE(" parameters: " << params); - ATH_MSG_VERBOSE(" position: " << params.position().transpose()); + ATH_MSG_VERBOSE(" position: " << params.position(geoctx).transpose()); ATH_MSG_VERBOSE(" momentum: " << params.momentum().transpose()); // Push the fitted parameters to the container indexedParams.emplace(fitOutput.trackTip, std::move(params)); @@ -487,7 +494,7 @@ struct FitterFunctionImpl FaserActsKalmanFilterAlg::FitterResult operator()( const std::vector<RecSourceLink>& sourceLinks, - const Acts::CurvilinearParameters& initialParameters, + const Acts::CurvilinearTrackParameters& initialParameters, const Acts::KalmanFitterOptions<Acts::VoidOutlierFinder>& options) const { return fitter.fit(sourceLinks, initialParameters, options); @@ -674,18 +681,18 @@ void FaserActsKalmanFilterAlg::initializeTree() void FaserActsKalmanFilterAlg::fillFitResult( const Acts::GeometryContext& geoctx, const TrajectoryContainer& trajectories, - const Acts::BoundParameters& truthParam + const Acts::BoundTrackParameters& truthParam ) { - m_t_eLOC0 = truthParam.parameters()[Acts::ParDef::eLOC_0]; - m_t_eLOC1 = truthParam.parameters()[Acts::ParDef::eLOC_1]; - m_t_ePHI = truthParam.parameters()[Acts::ParDef::ePHI]; - m_t_eTHETA = truthParam.parameters()[Acts::ParDef::eTHETA]; - m_t_eQOP = truthParam.parameters()[Acts::ParDef::eQOP]; - m_t_eT = truthParam.parameters()[Acts::ParDef::eT]; - m_t_x = truthParam.position()(0); - m_t_y = truthParam.position()(1); - m_t_z = truthParam.position()(2); + m_t_eLOC0 = truthParam.parameters()[Acts::eBoundLoc0]; + m_t_eLOC1 = truthParam.parameters()[Acts::eBoundLoc1]; + m_t_ePHI = truthParam.parameters()[Acts::eBoundPhi]; + m_t_eTHETA = truthParam.parameters()[Acts::eBoundTheta]; + m_t_eQOP = truthParam.parameters()[Acts::eBoundQOverP]; + m_t_eT = truthParam.parameters()[Acts::eBoundTime]; + m_t_x = truthParam.position(geoctx)(0); + m_t_y = truthParam.position(geoctx)(1); + m_t_z = truthParam.position(geoctx)(2); m_t_px = truthParam.momentum()(0); m_t_py = truthParam.momentum()(1); m_t_pz = truthParam.momentum()(2); @@ -733,28 +740,28 @@ void FaserActsKalmanFilterAlg::fillFitResult( const auto ¶meter = boundParam.parameters(); const auto &covariance = *boundParam.covariance(); m_charge_fit = boundParam.charge(); - m_eLOC0_fit = parameter[Acts::ParDef::eLOC_0]; - m_eLOC1_fit = parameter[Acts::ParDef::eLOC_1]; - m_ePHI_fit = parameter[Acts::ParDef::ePHI]; - m_eTHETA_fit = parameter[Acts::ParDef::eTHETA]; - m_eQOP_fit = parameter[Acts::ParDef::eQOP]; - m_eT_fit = parameter[Acts::ParDef::eT]; + m_eLOC0_fit = parameter[Acts::eBoundLoc0]; + m_eLOC1_fit = parameter[Acts::eBoundLoc1]; + m_ePHI_fit = parameter[Acts::eBoundPhi]; + m_eTHETA_fit = parameter[Acts::eBoundTheta]; + m_eQOP_fit = parameter[Acts::eBoundQOverP]; + m_eT_fit = parameter[Acts::eBoundTime]; m_err_eLOC0_fit = - sqrt(covariance(Acts::ParDef::eLOC_0, Acts::ParDef::eLOC_0)); + sqrt(covariance(Acts::eBoundLoc0, Acts::eBoundLoc0)); m_err_eLOC1_fit = - sqrt(covariance(Acts::ParDef::eLOC_1, Acts::ParDef::eLOC_1)); - m_err_ePHI_fit = sqrt(covariance(Acts::ParDef::ePHI, Acts::ParDef::ePHI)); + sqrt(covariance(Acts::eBoundLoc1, Acts::eBoundLoc1)); + m_err_ePHI_fit = sqrt(covariance(Acts::eBoundPhi, Acts::eBoundPhi)); m_err_eTHETA_fit = - sqrt(covariance(Acts::ParDef::eTHETA, Acts::ParDef::eTHETA)); - m_err_eQOP_fit = sqrt(covariance(Acts::ParDef::eQOP, Acts::ParDef::eQOP)); - m_err_eT_fit = sqrt(covariance(Acts::ParDef::eT, Acts::ParDef::eT)); + sqrt(covariance(Acts::eBoundTheta, Acts::eBoundTheta)); + m_err_eQOP_fit = sqrt(covariance(Acts::eBoundQOverP, Acts::eBoundQOverP)); + m_err_eT_fit = sqrt(covariance(Acts::eBoundTime, Acts::eBoundTime)); m_px_fit = boundParam.momentum()(0); m_py_fit = boundParam.momentum()(1); m_pz_fit = boundParam.momentum()(2); - m_x_fit = boundParam.position()(0); - m_y_fit = boundParam.position()(1); - m_z_fit = boundParam.position()(2); + m_x_fit = boundParam.position(geoctx)(0); + m_y_fit = boundParam.position(geoctx)(1); + m_z_fit = boundParam.position(geoctx)(2); } m_nPredicted = 0; @@ -770,7 +777,7 @@ void FaserActsKalmanFilterAlg::fillFitResult( } /// Get the geometry ID - auto geoID = state.referenceSurface().geoID(); + auto geoID = state.referenceSurface().geometryId(); m_volumeID.push_back(geoID.volume()); m_layerID.push_back(geoID.layer()); m_moduleID.push_back(geoID.sensitive()); @@ -778,15 +785,14 @@ void FaserActsKalmanFilterAlg::fillFitResult( auto meas = std::get<Measurement>(*state.uncalibrated()); /// Get local position - Acts::Vector2D local(meas.parameters()[Acts::ParDef::eLOC_0], - meas.parameters()[Acts::ParDef::eLOC_1]); + Acts::Vector2D local(meas.parameters()[Acts::eBoundLoc0], + meas.parameters()[Acts::eBoundLoc1]); /// Get global position Acts::Vector3D global(0, 0, 0); /// This is an arbitrary vector. Doesn't matter in coordinate transformation /// in Acts code Acts::Vector3D mom(1, 1, 1); - meas.referenceObject().localToGlobal(geoctx, - local, mom, global); + global = meas.referenceObject().localToGlobal(geoctx, local, mom); /// Get measurement covariance auto cov = meas.covariance(); @@ -803,61 +809,60 @@ void FaserActsKalmanFilterAlg::fillFitResult( { predicted = true; m_nPredicted++; - Acts::BoundParameters parameter( - geoctx, - state.predictedCovariance(), + Acts::BoundTrackParameters parameter( + state.referenceSurface().getSharedPtr(), state.predicted(), - state.referenceSurface().getSharedPtr()); + state.predictedCovariance()); auto covariance = state.predictedCovariance(); /// Local hit residual info auto H = meas.projector(); auto resCov = cov + H * covariance * H.transpose(); - auto residual = meas.residual(parameter); + auto residual = meas.residual(state.predicted()); /// Predicted residual - m_res_eLOC0_prt.push_back(residual(Acts::ParDef::eLOC_0)); - m_res_eLOC1_prt.push_back(residual(Acts::ParDef::eLOC_1)); + m_res_eLOC0_prt.push_back(residual(Acts::eBoundLoc0)); + m_res_eLOC1_prt.push_back(residual(Acts::eBoundLoc1)); /// Predicted parameter pulls m_pull_eLOC0_prt.push_back( - residual(Acts::ParDef::eLOC_0) / - sqrt(resCov(Acts::ParDef::eLOC_0, Acts::ParDef::eLOC_0))); + residual(Acts::eBoundLoc0) / + sqrt(resCov(Acts::eBoundLoc0, Acts::eBoundLoc0))); m_pull_eLOC1_prt.push_back( - residual(Acts::ParDef::eLOC_1) / - sqrt(resCov(Acts::ParDef::eLOC_1, Acts::ParDef::eLOC_1))); + residual(Acts::eBoundLoc1) / + sqrt(resCov(Acts::eBoundLoc1, Acts::eBoundLoc1))); /// Predicted parameter - m_eLOC0_prt.push_back(parameter.parameters()[Acts::ParDef::eLOC_0]); - m_eLOC1_prt.push_back(parameter.parameters()[Acts::ParDef::eLOC_1]); - m_ePHI_prt.push_back(parameter.parameters()[Acts::ParDef::ePHI]); - m_eTHETA_prt.push_back(parameter.parameters()[Acts::ParDef::eTHETA]); - m_eQOP_prt.push_back(parameter.parameters()[Acts::ParDef::eQOP]); - m_eT_prt.push_back(parameter.parameters()[Acts::ParDef::eT]); + m_eLOC0_prt.push_back(parameter.parameters()[Acts::eBoundLoc0]); + m_eLOC1_prt.push_back(parameter.parameters()[Acts::eBoundLoc1]); + m_ePHI_prt.push_back(parameter.parameters()[Acts::eBoundPhi]); + m_eTHETA_prt.push_back(parameter.parameters()[Acts::eBoundTheta]); + m_eQOP_prt.push_back(parameter.parameters()[Acts::eBoundQOverP]); + m_eT_prt.push_back(parameter.parameters()[Acts::eBoundTime]); /// Predicted parameter Uncertainties m_err_eLOC0_prt.push_back( - sqrt(covariance(Acts::ParDef::eLOC_0, Acts::ParDef::eLOC_0))); + sqrt(covariance(Acts::eBoundLoc0, Acts::eBoundLoc0))); m_err_eLOC1_prt.push_back( - sqrt(covariance(Acts::ParDef::eLOC_1, Acts::ParDef::eLOC_1))); + sqrt(covariance(Acts::eBoundLoc1, Acts::eBoundLoc1))); m_err_ePHI_prt.push_back( - sqrt(covariance(Acts::ParDef::ePHI, Acts::ParDef::ePHI))); + sqrt(covariance(Acts::eBoundPhi, Acts::eBoundPhi))); m_err_eTHETA_prt.push_back( - sqrt(covariance(Acts::ParDef::eTHETA, Acts::ParDef::eTHETA))); + sqrt(covariance(Acts::eBoundTheta, Acts::eBoundTheta))); m_err_eQOP_prt.push_back( - sqrt(covariance(Acts::ParDef::eQOP, Acts::ParDef::eQOP))); + sqrt(covariance(Acts::eBoundQOverP, Acts::eBoundQOverP))); m_err_eT_prt.push_back( - sqrt(covariance(Acts::ParDef::eT, Acts::ParDef::eT))); + sqrt(covariance(Acts::eBoundTime, Acts::eBoundTime))); - m_x_prt.push_back(parameter.position().x()); - m_y_prt.push_back(parameter.position().y()); - m_z_prt.push_back(parameter.position().z()); + m_x_prt.push_back(parameter.position(geoctx).x()); + m_y_prt.push_back(parameter.position(geoctx).y()); + m_z_prt.push_back(parameter.position(geoctx).z()); m_px_prt.push_back(parameter.momentum().x()); m_py_prt.push_back(parameter.momentum().y()); m_pz_prt.push_back(parameter.momentum().z()); - m_pT_prt.push_back(parameter.pT()); - m_eta_prt.push_back(eta(parameter.position())); + m_pT_prt.push_back(parameter.transverseMomentum()); + m_eta_prt.push_back(eta(parameter.position(geoctx))); } else { @@ -893,60 +898,60 @@ void FaserActsKalmanFilterAlg::fillFitResult( { filtered = true; m_nFiltered++; - Acts::BoundParameters parameter( - geoctx, - state.filteredCovariance(), state.filtered(), - state.referenceSurface().getSharedPtr()); + Acts::BoundTrackParameters parameter( + state.referenceSurface().getSharedPtr(), + state.filtered(), + state.filteredCovariance()); auto covariance = state.filteredCovariance(); /// Local hit residual info auto H = meas.projector(); auto resCov = cov + H * covariance * H.transpose(); - auto residual = meas.residual(parameter); + auto residual = meas.residual(state.filtered()); /// Filtered residual - m_res_eLOC0_flt.push_back(residual(Acts::ParDef::eLOC_0)); - m_res_eLOC1_flt.push_back(residual(Acts::ParDef::eLOC_1)); + m_res_eLOC0_flt.push_back(residual(Acts::eBoundLoc0)); + m_res_eLOC1_flt.push_back(residual(Acts::eBoundLoc1)); /// Filtered parameter pulls m_pull_eLOC0_flt.push_back( - residual(Acts::ParDef::eLOC_0) / - sqrt(resCov(Acts::ParDef::eLOC_0, Acts::ParDef::eLOC_0))); + residual(Acts::eBoundLoc0) / + sqrt(resCov(Acts::eBoundLoc0, Acts::eBoundLoc0))); m_pull_eLOC1_flt.push_back( - residual(Acts::ParDef::eLOC_1) / - sqrt(resCov(Acts::ParDef::eLOC_1, Acts::ParDef::eLOC_1))); + residual(Acts::eBoundLoc1) / + sqrt(resCov(Acts::eBoundLoc1, Acts::eBoundLoc1))); /// Filtered parameter - m_eLOC0_flt.push_back(parameter.parameters()[Acts::ParDef::eLOC_0]); - m_eLOC1_flt.push_back(parameter.parameters()[Acts::ParDef::eLOC_1]); - m_ePHI_flt.push_back(parameter.parameters()[Acts::ParDef::ePHI]); - m_eTHETA_flt.push_back(parameter.parameters()[Acts::ParDef::eTHETA]); - m_eQOP_flt.push_back(parameter.parameters()[Acts::ParDef::eQOP]); - m_eT_flt.push_back(parameter.parameters()[Acts::ParDef::eT]); + m_eLOC0_flt.push_back(parameter.parameters()[Acts::eBoundLoc0]); + m_eLOC1_flt.push_back(parameter.parameters()[Acts::eBoundLoc1]); + m_ePHI_flt.push_back(parameter.parameters()[Acts::eBoundPhi]); + m_eTHETA_flt.push_back(parameter.parameters()[Acts::eBoundTheta]); + m_eQOP_flt.push_back(parameter.parameters()[Acts::eBoundQOverP]); + m_eT_flt.push_back(parameter.parameters()[Acts::eBoundTime]); /// Filtered parameter uncertainties m_err_eLOC0_flt.push_back( - sqrt(covariance(Acts::ParDef::eLOC_0, Acts::ParDef::eLOC_0))); + sqrt(covariance(Acts::eBoundLoc0, Acts::eBoundLoc0))); m_err_eLOC1_flt.push_back( - sqrt(covariance(Acts::ParDef::eLOC_1, Acts::ParDef::eLOC_1))); + sqrt(covariance(Acts::eBoundLoc1, Acts::eBoundLoc1))); m_err_ePHI_flt.push_back( - sqrt(covariance(Acts::ParDef::ePHI, Acts::ParDef::ePHI))); + sqrt(covariance(Acts::eBoundPhi, Acts::eBoundPhi))); m_err_eTHETA_flt.push_back( - sqrt(covariance(Acts::ParDef::eTHETA, Acts::ParDef::eTHETA))); + sqrt(covariance(Acts::eBoundTheta, Acts::eBoundTheta))); m_err_eQOP_flt.push_back( - sqrt(covariance(Acts::ParDef::eQOP, Acts::ParDef::eQOP))); + sqrt(covariance(Acts::eBoundQOverP, Acts::eBoundQOverP))); m_err_eT_flt.push_back( - sqrt(covariance(Acts::ParDef::eT, Acts::ParDef::eT))); + sqrt(covariance(Acts::eBoundTime, Acts::eBoundTime))); /// Other filtered parameter info - m_x_flt.push_back(parameter.position().x()); - m_y_flt.push_back(parameter.position().y()); - m_z_flt.push_back(parameter.position().z()); + m_x_flt.push_back(parameter.position(geoctx).x()); + m_y_flt.push_back(parameter.position(geoctx).y()); + m_z_flt.push_back(parameter.position(geoctx).z()); m_px_flt.push_back(parameter.momentum().x()); m_py_flt.push_back(parameter.momentum().y()); m_pz_flt.push_back(parameter.momentum().z()); - m_pT_flt.push_back(parameter.pT()); - m_eta_flt.push_back(eta(parameter.position())); + m_pT_flt.push_back(parameter.transverseMomentum()); + m_eta_flt.push_back(eta(parameter.position(geoctx))); m_chi2.push_back(state.chi2()); } @@ -984,73 +989,73 @@ void FaserActsKalmanFilterAlg::fillFitResult( { smoothed = true; m_nSmoothed++; - Acts::BoundParameters parameter( - geoctx, - state.smoothedCovariance(), state.smoothed(), - state.referenceSurface().getSharedPtr()); + Acts::BoundTrackParameters parameter( + state.referenceSurface().getSharedPtr(), + state.smoothed(), + state.smoothedCovariance()); auto covariance = state.smoothedCovariance(); /// Local hit residual info auto H = meas.projector(); auto resCov = cov + H * covariance * H.transpose(); - auto residual = meas.residual(parameter); + auto residual = meas.residual(state.smoothed()); - m_res_x_hit.push_back(residual(Acts::ParDef::eLOC_0)); - m_res_y_hit.push_back(residual(Acts::ParDef::eLOC_1)); + m_res_x_hit.push_back(residual(Acts::eBoundLoc0)); + m_res_y_hit.push_back(residual(Acts::eBoundLoc1)); m_err_x_hit.push_back( - sqrt(resCov(Acts::ParDef::eLOC_0, Acts::ParDef::eLOC_0))); + sqrt(resCov(Acts::eBoundLoc0, Acts::eBoundLoc0))); m_err_y_hit.push_back( - sqrt(resCov(Acts::ParDef::eLOC_1, Acts::ParDef::eLOC_1))); + sqrt(resCov(Acts::eBoundLoc1, Acts::eBoundLoc1))); m_pull_x_hit.push_back( - residual(Acts::ParDef::eLOC_0) / - sqrt(resCov(Acts::ParDef::eLOC_0, Acts::ParDef::eLOC_0))); + residual(Acts::eBoundLoc0) / + sqrt(resCov(Acts::eBoundLoc0, Acts::eBoundLoc0))); m_pull_y_hit.push_back( - residual(Acts::ParDef::eLOC_1) / - sqrt(resCov(Acts::ParDef::eLOC_1, Acts::ParDef::eLOC_1))); + residual(Acts::eBoundLoc1) / + sqrt(resCov(Acts::eBoundLoc1, Acts::eBoundLoc1))); m_dim_hit.push_back(state.calibratedSize()); /// Smoothed residual - m_res_eLOC0_smt.push_back(residual(Acts::ParDef::eLOC_0)); - m_res_eLOC1_smt.push_back(residual(Acts::ParDef::eLOC_1)); + m_res_eLOC0_smt.push_back(residual(Acts::eBoundLoc0)); + m_res_eLOC1_smt.push_back(residual(Acts::eBoundLoc1)); /// Smoothed parameter pulls m_pull_eLOC0_smt.push_back( - residual(Acts::ParDef::eLOC_0) / - sqrt(resCov(Acts::ParDef::eLOC_0, Acts::ParDef::eLOC_0))); + residual(Acts::eBoundLoc0) / + sqrt(resCov(Acts::eBoundLoc0, Acts::eBoundLoc0))); m_pull_eLOC1_smt.push_back( - residual(Acts::ParDef::eLOC_1) / - sqrt(resCov(Acts::ParDef::eLOC_1, Acts::ParDef::eLOC_1))); + residual(Acts::eBoundLoc1) / + sqrt(resCov(Acts::eBoundLoc1, Acts::eBoundLoc1))); /// Smoothed parameter - m_eLOC0_smt.push_back(parameter.parameters()[Acts::ParDef::eLOC_0]); - m_eLOC1_smt.push_back(parameter.parameters()[Acts::ParDef::eLOC_1]); - m_ePHI_smt.push_back(parameter.parameters()[Acts::ParDef::ePHI]); - m_eTHETA_smt.push_back(parameter.parameters()[Acts::ParDef::eTHETA]); - m_eQOP_smt.push_back(parameter.parameters()[Acts::ParDef::eQOP]); - m_eT_smt.push_back(parameter.parameters()[Acts::ParDef::eT]); + m_eLOC0_smt.push_back(parameter.parameters()[Acts::eBoundLoc0]); + m_eLOC1_smt.push_back(parameter.parameters()[Acts::eBoundLoc1]); + m_ePHI_smt.push_back(parameter.parameters()[Acts::eBoundPhi]); + m_eTHETA_smt.push_back(parameter.parameters()[Acts::eBoundTheta]); + m_eQOP_smt.push_back(parameter.parameters()[Acts::eBoundQOverP]); + m_eT_smt.push_back(parameter.parameters()[Acts::eBoundTime]); /// Smoothed parameter uncertainties m_err_eLOC0_smt.push_back( - sqrt(covariance(Acts::ParDef::eLOC_0, Acts::ParDef::eLOC_0))); + sqrt(covariance(Acts::eBoundLoc0, Acts::eBoundLoc0))); m_err_eLOC1_smt.push_back( - sqrt(covariance(Acts::ParDef::eLOC_1, Acts::ParDef::eLOC_1))); + sqrt(covariance(Acts::eBoundLoc1, Acts::eBoundLoc1))); m_err_ePHI_smt.push_back( - sqrt(covariance(Acts::ParDef::ePHI, Acts::ParDef::ePHI))); + sqrt(covariance(Acts::eBoundPhi, Acts::eBoundPhi))); m_err_eTHETA_smt.push_back( - sqrt(covariance(Acts::ParDef::eTHETA, Acts::ParDef::eTHETA))); + sqrt(covariance(Acts::eBoundTheta, Acts::eBoundTheta))); m_err_eQOP_smt.push_back( - sqrt(covariance(Acts::ParDef::eQOP, Acts::ParDef::eQOP))); + sqrt(covariance(Acts::eBoundQOverP, Acts::eBoundQOverP))); m_err_eT_smt.push_back( - sqrt(covariance(Acts::ParDef::eT, Acts::ParDef::eT))); + sqrt(covariance(Acts::eBoundTime, Acts::eBoundTime))); - m_x_smt.push_back(parameter.position().x()); - m_y_smt.push_back(parameter.position().y()); - m_z_smt.push_back(parameter.position().z()); + m_x_smt.push_back(parameter.position(geoctx).x()); + m_y_smt.push_back(parameter.position(geoctx).y()); + m_z_smt.push_back(parameter.position(geoctx).z()); m_px_smt.push_back(parameter.momentum().x()); m_py_smt.push_back(parameter.momentum().y()); m_pz_smt.push_back(parameter.momentum().z()); - m_pT_smt.push_back(parameter.pT()); - m_eta_smt.push_back(eta(parameter.position())); + m_pT_smt.push_back(parameter.transverseMomentum()); + m_eta_smt.push_back(eta(parameter.position(geoctx))); } else { diff --git a/graphics/VTI12/VTI12Utils/VTI12Utils/VP1SGAccessHelper.h b/graphics/VTI12/VTI12Utils/VTI12Utils/VP1SGAccessHelper.h index bba20771b..860872c8f 100644 --- a/graphics/VTI12/VTI12Utils/VTI12Utils/VP1SGAccessHelper.h +++ b/graphics/VTI12/VTI12Utils/VTI12Utils/VP1SGAccessHelper.h @@ -18,7 +18,7 @@ #define VTI12UTILS_VP1SGACCESSHELPER_H #include "VP1Base/VP1HelperClassBase.h" -#include "StoreGate/StoreGate.h" +#include "StoreGate/StoreGateSvc.h" #include <stdexcept> class VP1SGContentsHelper; diff --git a/version.txt b/version.txt index c0b885324..e7efe3421 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -22.0.18 +22.0.19 -- GitLab From 4524392db6db0388cca1dd9c50f448e5d8b1692b Mon Sep 17 00:00:00 2001 From: Tobias Boeckh <tobias.boeckh@cern.ch> Date: Wed, 20 Jan 2021 00:39:47 +0100 Subject: [PATCH 2/3] update faser-common --- Event/FaserByteStreamCnvSvc/src/DumpFrags.h | 4 ++-- .../FaserTriggerByteStream/src/FaserTriggerDecoderTool.cxx | 6 +++--- faser-common | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Event/FaserByteStreamCnvSvc/src/DumpFrags.h b/Event/FaserByteStreamCnvSvc/src/DumpFrags.h index 989f5b7c0..16d4a1eac 100644 --- a/Event/FaserByteStreamCnvSvc/src/DumpFrags.h +++ b/Event/FaserByteStreamCnvSvc/src/DumpFrags.h @@ -74,11 +74,11 @@ static void dump(const EventFull* re) case TriggerSourceID: if (re->event_tag() == PhysicsTag ) { std::cout<<"TLB data fragment:"<<std::endl; - TLBDataFragment tlb_data_frag = TLBDataFragment(frag->payload<const uint32_t*>(), frag->payload_size()); + TLBDataFormat::TLBDataFragment tlb_data_frag = TLBDataFormat::TLBDataFragment(frag->payload<const uint32_t*>(), frag->payload_size()); std::cout<<tlb_data_frag<<std::endl; } else if (re->event_tag() == TLBMonitoringTag ) { - TLBMonitoringFragment tlb_mon_frag = TLBMonitoringFragment(frag->payload<const uint32_t*>(), frag->payload_size()); + TLBMonFormat::TLBMonitoringFragment tlb_mon_frag = TLBMonFormat::TLBMonitoringFragment(frag->payload<const uint32_t*>(), frag->payload_size()); std::cout<<"TLB monitoring fragment:"<<std::endl; std::cout<<tlb_mon_frag<<std::endl; } diff --git a/Trigger/FaserTrigEventCnv/FaserTriggerByteStream/src/FaserTriggerDecoderTool.cxx b/Trigger/FaserTrigEventCnv/FaserTriggerByteStream/src/FaserTriggerDecoderTool.cxx index f5ac5dff5..96bb3a532 100644 --- a/Trigger/FaserTrigEventCnv/FaserTriggerByteStream/src/FaserTriggerDecoderTool.cxx +++ b/Trigger/FaserTrigEventCnv/FaserTriggerByteStream/src/FaserTriggerDecoderTool.cxx @@ -53,7 +53,7 @@ FaserTriggerDecoderTool::convert(const DAQFormats::EventFull* re, } // Find the TLB fragment - const TLBDataFragment* tlb = NULL; + const TLBDataFormat::TLBDataFragment* tlb = NULL; const DAQFormats::EventFragment* frag = NULL; for(const auto &id : re->getFragmentIDs()) { frag=re->find_fragment(id); @@ -61,7 +61,7 @@ FaserTriggerDecoderTool::convert(const DAQFormats::EventFull* re, if ((frag->source_id()&0xFFFF0000) != DAQFormats::SourceIDs::TriggerSourceID) continue; ATH_MSG_DEBUG("Fragment:\n" << *frag); - tlb = new TLBDataFragment(frag->payload<const uint32_t*>(), frag->payload_size()); + tlb = new TLBDataFormat::TLBDataFragment(frag->payload<const uint32_t*>(), frag->payload_size()); break; } @@ -82,7 +82,7 @@ FaserTriggerDecoderTool::convert(const DAQFormats::EventFull* re, xaod->setInputBitsNextClk( tlb->input_bits_next_clk() ); xaod->setTbp( tlb->tbp() ); xaod->setTap( tlb->tap() ); - } catch ( TLBDataException& e ) { + } catch ( TLBDataFormat::TLBDataException& e ) { ATH_MSG_WARNING("FaserTriggerDecoderTool:\n" << e.what() << "\nCorrupted TLB data!\n" diff --git a/faser-common b/faser-common index a14ae110b..7eb8e65e8 160000 --- a/faser-common +++ b/faser-common @@ -1 +1 @@ -Subproject commit a14ae110b8261e7e380858e03855e9d432ebcc01 +Subproject commit 7eb8e65e8342963e6f7e4d083c6b1128baa49fd1 -- GitLab From feea778c9d19b3271260d467d16b76f9cc59d451 Mon Sep 17 00:00:00 2001 From: Tobias Boeckh <tobias.boeckh@cern.ch> Date: Wed, 20 Jan 2021 01:07:17 +0100 Subject: [PATCH 3/3] cosmics --- .../python/TrackerDataAccessExampleConfig.py | 4 +- .../python/MagFieldServicesConfig.py | 9 +- .../src/TrackerDataDecoderTool.cxx | 2 +- .../FaserSpacePoints/CMakeLists.txt | 12 ++ .../python/FaserSpacePointsCosmics.py | 92 ++++++++++++++++ .../FaserSpacePoints/python/__init__.py | 0 .../FaserSpacePoints/src/FaserSpacePoints.cxx | 104 ++++++++++++++++++ .../FaserSpacePoints/src/FaserSpacePoints.h | 46 ++++++++ .../components/FaserSpacePoints_entries.cxx | 3 + .../test/FaserSCT_ClusterizationDbgCosmics.py | 66 +++++++++++ .../TrackerSpacePointFormationDbgCosmics.py | 66 +++++++++++ 11 files changed, 397 insertions(+), 7 deletions(-) create mode 100644 Tracker/TrackerRecAlgs/FaserSpacePoints/CMakeLists.txt create mode 100644 Tracker/TrackerRecAlgs/FaserSpacePoints/python/FaserSpacePointsCosmics.py create mode 100644 Tracker/TrackerRecAlgs/FaserSpacePoints/python/__init__.py create mode 100644 Tracker/TrackerRecAlgs/FaserSpacePoints/src/FaserSpacePoints.cxx create mode 100644 Tracker/TrackerRecAlgs/FaserSpacePoints/src/FaserSpacePoints.h create mode 100644 Tracker/TrackerRecAlgs/FaserSpacePoints/src/components/FaserSpacePoints_entries.cxx create mode 100644 Tracker/TrackerRecAlgs/TrackerPrepRawDataFormation/test/FaserSCT_ClusterizationDbgCosmics.py create mode 100644 Tracker/TrackerRecAlgs/TrackerSpacePointFormation/test/TrackerSpacePointFormationDbgCosmics.py diff --git a/Control/CalypsoExample/TrackerDataAccessExample/python/TrackerDataAccessExampleConfig.py b/Control/CalypsoExample/TrackerDataAccessExample/python/TrackerDataAccessExampleConfig.py index e54397f44..d420ec083 100644 --- a/Control/CalypsoExample/TrackerDataAccessExample/python/TrackerDataAccessExampleConfig.py +++ b/Control/CalypsoExample/TrackerDataAccessExample/python/TrackerDataAccessExampleConfig.py @@ -33,11 +33,11 @@ if __name__ == "__main__": ConfigFlags.Input.isMC = False # Needed to bypass autoconfig ConfigFlags.IOVDb.GlobalTag = "OFLCOND-XXXX-XXX-XX" # Needed to bypass autoconfig, only the "OFLCOND" matters at the moment ConfigFlags.IOVDb.DatabaseInstance = "OFLP200" # Use MC conditions for now - ConfigFlags.GeoModel.FaserVersion = "FASER-CR" # FASER cosmic ray geometry (station 2 only) + ConfigFlags.GeoModel.FaserVersion = "FASER-01" # FASER geometry ConfigFlags.Input.ProjectName = "data20" # Needed to bypass autoconfig ConfigFlags.GeoModel.Align.Dynamic = False ConfigFlags.Input.Files = ["cosmics.raw"] - ConfigFlags.Output.RDOFileName = "tracker.RDO.pool.root" + ConfigFlags.Output.RDOFileName = "my.RDO.pool.root" ConfigFlags.lock() # Configure components diff --git a/MagneticField/MagFieldServices/python/MagFieldServicesConfig.py b/MagneticField/MagFieldServices/python/MagFieldServicesConfig.py index eea0f453e..4ebac8a59 100644 --- a/MagneticField/MagFieldServices/python/MagFieldServicesConfig.py +++ b/MagneticField/MagFieldServices/python/MagFieldServicesConfig.py @@ -50,10 +50,11 @@ def MagneticFieldSvcCfg(flags, **kwargs): # This handles addFolderSplitMC https://gitlab.cern.ch/atlas/athena/blob/master/Database/IOVDbSvc/python/CondDB.py#L240 # i.e. replaces conddb.addFolderSplitMC('GLOBAL','/GLOBAL/BField/Maps <noover/>','/GLOBAL/BField/Maps <noover/>') # def addFolders(configFlags,folderstrings,detDb=None,className=None): - if flags.Input.isMC: - db='GLOBAL_OFL' - else: - db='GLOBAL' + db='GLOBAL_OFL' + # if flags.Input.isMC: + # db='GLOBAL_OFL' + # else: + # db='GLOBAL' result.merge(addFolders(flags,['/GLOBAL/BField/Maps <noover/>'],detDb=db, className="CondAttrListCollection") ) result.merge(addFolders(flags,['/GLOBAL/BField/Scales <noover/>'],detDb=db, className="CondAttrListCollection") ) diff --git a/Tracker/TrackerEventCnv/TrackerByteStream/src/TrackerDataDecoderTool.cxx b/Tracker/TrackerEventCnv/TrackerByteStream/src/TrackerDataDecoderTool.cxx index 7f7763b86..b84a5fd14 100644 --- a/Tracker/TrackerEventCnv/TrackerByteStream/src/TrackerDataDecoderTool.cxx +++ b/Tracker/TrackerEventCnv/TrackerByteStream/src/TrackerDataDecoderTool.cxx @@ -114,7 +114,7 @@ TrackerDataDecoderTool::convert(const DAQFormats::EventFull* re, ATH_MSG_DEBUG("Fragment:\n" << *frag); uint32_t trb = frag->source_id() & 0x0000FFFF; // FIXME: will need to be updated for interface detector - int station = 2 + trb / TrackerDataFragment::PLANES_PER_STATION; + int station = 1 + trb / TrackerDataFragment::PLANES_PER_STATION; int plane = trb % TrackerDataFragment::PLANES_PER_STATION; // Exceptions are a no-no in Athena/Calypso, so catch any thrown by faser-common diff --git a/Tracker/TrackerRecAlgs/FaserSpacePoints/CMakeLists.txt b/Tracker/TrackerRecAlgs/FaserSpacePoints/CMakeLists.txt new file mode 100644 index 000000000..4978495c3 --- /dev/null +++ b/Tracker/TrackerRecAlgs/FaserSpacePoints/CMakeLists.txt @@ -0,0 +1,12 @@ +################################################################################ +# Package: FaserSpacePoints +################################################################################ + +# Declare the package name: +atlas_subdir( FaserSpacePoints ) + +atlas_add_component( FaserSpacePoints + src/components/*.cxx src/*.cxx src/*.h + LINK_LIBRARIES AthenaBaseComps TrackerSpacePoint TrackerPrepRawData) + +atlas_install_python_modules( python/*.py ) \ No newline at end of file diff --git a/Tracker/TrackerRecAlgs/FaserSpacePoints/python/FaserSpacePointsCosmics.py b/Tracker/TrackerRecAlgs/FaserSpacePoints/python/FaserSpacePointsCosmics.py new file mode 100644 index 000000000..3285654cc --- /dev/null +++ b/Tracker/TrackerRecAlgs/FaserSpacePoints/python/FaserSpacePointsCosmics.py @@ -0,0 +1,92 @@ +# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + +import sys +from AthenaCommon.Logging import log, logging +from AthenaCommon.Constants import DEBUG, VERBOSE, INFO +from AthenaCommon.Configurable import Configurable +from CalypsoConfiguration.AllConfigFlags import ConfigFlags +from CalypsoConfiguration.MainServicesConfig import MainServicesCfg +from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg +# from AthenaPoolCnvSvc.PoolWriteConfig import PoolWriteCfg +from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg +# from Digitization.DigitizationParametersConfig import writeDigitizationMetadata +from TrackerPrepRawDataFormation.TrackerPrepRawDataFormationConfig import FaserSCT_ClusterizationCfg +from TrackerSpacePointFormation.TrackerSpacePointFormationConfig import TrackerSpacePointFinderCfg +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator +from AthenaConfiguration.ComponentFactory import CompFactory + +Tracker__TruthSeededTrackFinder, THistSvc=CompFactory.getComps("Tracker::FaserSpacePoints", "THistSvc") + + +def TruthSeededTrackFinderBasicCfg(flags, **kwargs): + """Return ComponentAccumulator for TruthSeededTrackFinder""" + acc = ComponentAccumulator() + kwargs.setdefault("SpacePointsSCTName", "SCT_SpacePointContainer") + acc.addEventAlgo(Tracker__TruthSeededTrackFinder(**kwargs)) + # attach ToolHandles + return acc + +def TruthSeededTrackFinder_OutputCfg(flags): + """Return ComponentAccumulator with Output for SCT. Not standalone.""" + acc = ComponentAccumulator() + acc.merge(OutputStreamCfg(flags, "ESD")) + ostream = acc.getEventAlgo("OutputStreamESD") + ostream.TakeItemsFromInput = True + return acc + +def FaserSpacePointsCfg(flags, **kwargs): + acc=TruthSeededTrackFinderBasicCfg(flags, **kwargs) + histSvc= THistSvc() + histSvc.Output += [ "TruthTrackSeeds DATAFILE='truthtrackseeds.root' OPT='RECREATE'" ] + acc.addService(histSvc) + acc.merge(TruthSeededTrackFinder_OutputCfg(flags)) + return acc + +if __name__ == "__main__": + log.setLevel(DEBUG) + Configurable.configurableRun3Behavior = True + + # Configure + ConfigFlags.Input.Files = ['my.RDO.pool.root'] + ConfigFlags.Output.ESDFileName = "mySeeds.ESD.pool.root" + ConfigFlags.IOVDb.GlobalTag = "OFLCOND-XXXX-XXX-XX" + ConfigFlags.IOVDb.DatabaseInstance = "OFLP200" # Use MC conditions for now + ConfigFlags.Input.ProjectName = "data20" # Needed to bypass autoconfig + ConfigFlags.Input.isMC = False # Needed to bypass autoconfig + ConfigFlags.GeoModel.FaserVersion = "FASER-01" # FASER cosmic ray geometry (station 2 only) + ConfigFlags.Common.isOnline = False + ConfigFlags.GeoModel.Align.Dynamic = False + ConfigFlags.Beam.NumberOfCollisions = 0. + + ConfigFlags.lock() + + # Core components + acc = MainServicesCfg(ConfigFlags) + acc.merge(PoolReadCfg(ConfigFlags)) + + #acc.merge(writeDigitizationMetadata(ConfigFlags)) + + # Inner Detector + acc.merge(FaserSCT_ClusterizationCfg(ConfigFlags)) + acc.merge(TrackerSpacePointFinderCfg(ConfigFlags)) + acc.merge(FaserSpacePointsCfg(ConfigFlags)) + + # Timing + #acc.merge(MergeRecoTimingObjCfg(ConfigFlags)) + + # Dump config + logging.getLogger('forcomps').setLevel(VERBOSE) + acc.foreach_component("*").OutputLevel = VERBOSE + acc.foreach_component("*ClassID*").OutputLevel = INFO + # acc.getCondAlgo("FaserSCT_AlignCondAlg").OutputLevel = VERBOSE + # acc.getCondAlgo("FaserSCT_DetectorElementCondAlg").OutputLevel = VERBOSE + acc.getService("StoreGateSvc").Dump = True + acc.getService("ConditionStore").Dump = True + acc.printConfig(withDetails=True) + ConfigFlags.dump() + + # Execute and finish + sc = acc.run(maxEvents=-1) + + # Success should be 0 + sys.exit(not sc.isSuccess()) diff --git a/Tracker/TrackerRecAlgs/FaserSpacePoints/python/__init__.py b/Tracker/TrackerRecAlgs/FaserSpacePoints/python/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/Tracker/TrackerRecAlgs/FaserSpacePoints/src/FaserSpacePoints.cxx b/Tracker/TrackerRecAlgs/FaserSpacePoints/src/FaserSpacePoints.cxx new file mode 100644 index 000000000..cda36287e --- /dev/null +++ b/Tracker/TrackerRecAlgs/FaserSpacePoints/src/FaserSpacePoints.cxx @@ -0,0 +1,104 @@ +#include "FaserSpacePoints.h" +#include "Identifier/Identifier.h" +#include "TrkSpacePoint/SpacePoint.h" +#include "TrackerPrepRawData/TrackerClusterCollection.h" + +namespace Tracker { + FaserSpacePoints::FaserSpacePoints(const std::string& name, ISvcLocator* pSvcLocator) + : AthReentrantAlgorithm(name, pSvcLocator) { } + + + StatusCode FaserSpacePoints::initialize() { + ATH_MSG_INFO(name() << "::" << __FUNCTION__); + + if ( m_sct_spcontainer.key().empty()) { + ATH_MSG_FATAL( "SCTs selected and no name set for SCT clusters"); + return StatusCode::FAILURE; + } + ATH_CHECK( m_sct_spcontainer.initialize() ); + + ATH_CHECK(detStore()->retrieve(m_idHelper, "FaserSCT_ID")); + + std::string filePath = m_filePath; + m_outputFile = TFile::Open(filePath.c_str(), "RECREATE"); + if (m_outputFile == nullptr) { + ATH_MSG_ERROR("Unable to open output file at " << m_filePath); + return StatusCode::FAILURE; + } + m_outputFile->cd(); + + std::string treeName = m_treeName; + m_outputTree = new TTree(treeName.c_str(), "tree"); + if (m_outputTree == nullptr) { + ATH_MSG_ERROR("Unable to create TTree"); + return StatusCode::FAILURE; + } + + FaserSpacePoints::initializeTree(); + return StatusCode::SUCCESS; + } + + + StatusCode FaserSpacePoints::finalize() { + ATH_MSG_INFO(name() << "::" << __FUNCTION__); + m_outputFile->cd(); + m_outputTree->Write(); + return StatusCode::SUCCESS; + } + + + StatusCode FaserSpacePoints::execute(const EventContext& ctx) const { + ATH_MSG_INFO(name() << "::" << __FUNCTION__); + + m_run = ctx.eventID().run_number(); + m_event = ctx.eventID().event_number(); + ATH_MSG_DEBUG("run = " << m_run); + ATH_MSG_DEBUG("event = " << m_event); + + SG::ReadHandle<SpacePointContainer> sct_spcontainer( m_sct_spcontainer, ctx ); + if (!sct_spcontainer.isValid()){ + ATH_MSG_FATAL("Could not find the data object " << sct_spcontainer.name()); + return StatusCode::RECOVERABLE; + } + + m_nCollections = sct_spcontainer->size(); + ATH_MSG_DEBUG("nCollections = " << m_nCollections); + SpacePointContainer::const_iterator it = sct_spcontainer->begin(); + SpacePointContainer::const_iterator it_end = sct_spcontainer->end(); + + for(; it != it_end; ++it) { + const SpacePointCollection* col = *it; + m_nSpacepoints = col->size(); + ATH_MSG_DEBUG("nSpacepoints = " << m_nSpacepoints); + + SpacePointCollection::const_iterator it_sp = col->begin(); + SpacePointCollection::const_iterator it_sp_end = col->end(); + for (; it_sp != it_sp_end; ++it_sp) { + const Trk::SpacePoint* sp = *it_sp; + const Identifier id = sp->clusterList().first->identify(); + int station = m_idHelper->station(id); + int plane = m_idHelper->layer(id); + m_layer = (station - 1) * 3 + plane; + + Amg::Vector3D position = sp->globalPosition(); + m_x = position.x(); + m_y = position.y(); + m_z = position.z(); + + m_outputTree->Fill(); + } + } + return StatusCode::SUCCESS; + } + + void FaserSpacePoints::initializeTree() { + m_outputTree->Branch("run", &m_run); + m_outputTree->Branch("event", &m_event); + m_outputTree->Branch("layer", &m_layer); + m_outputTree->Branch("n_collections", &m_nCollections); + m_outputTree->Branch("n_spacepoints", &m_nSpacepoints); + m_outputTree->Branch("x", &m_x); + m_outputTree->Branch("y", &m_y); + m_outputTree->Branch("z", &m_z); + } +} \ No newline at end of file diff --git a/Tracker/TrackerRecAlgs/FaserSpacePoints/src/FaserSpacePoints.h b/Tracker/TrackerRecAlgs/FaserSpacePoints/src/FaserSpacePoints.h new file mode 100644 index 000000000..067499291 --- /dev/null +++ b/Tracker/TrackerRecAlgs/FaserSpacePoints/src/FaserSpacePoints.h @@ -0,0 +1,46 @@ +#ifndef FASERSPACEPOINTS_H +#define FASERSPACEPOINTS_H + +#include "AthenaBaseComps/AthReentrantAlgorithm.h" +#include "TrackerIdentifier/FaserSCT_ID.h" +#include "TrkSpacePoint/SpacePointContainer.h" +#include <string> +#include <atomic> + +#include "TTree.h" +#include "TFile.h" + +namespace Tracker { + class FaserSpacePoints : public AthReentrantAlgorithm { + public: + FaserSpacePoints(const std::string& name, ISvcLocator* pSvcLocator); + virtual ~FaserSpacePoints() = default; + + virtual StatusCode initialize() override; + virtual StatusCode execute(const EventContext& ctx) const override; + virtual StatusCode finalize() override; + + private: + void initializeTree(); + + mutable int m_run{0}; + mutable int m_event{0}; + mutable int m_layer{0}; + mutable int m_nCollections{0}; + mutable int m_nSpacepoints{0}; + mutable float m_x{0}; + mutable float m_y{0}; + mutable float m_z{0}; + + const FaserSCT_ID* m_idHelper{nullptr}; + SG::ReadHandleKey<SpacePointContainer> m_sct_spcontainer{this, "SpacePointsSCTName", "SCT spacepoint container"}; + + Gaudi::Property<std::string> m_filePath{this, "FilePath", "spacepoints.root", "Output root file for spacepoints"}; + Gaudi::Property<std::string> m_treeName{this, "TreeName", "tree", ""}; + + TFile* m_outputFile; + TTree* m_outputTree; + }; +} + +#endif // FASERSPACEPOINTS_H \ No newline at end of file diff --git a/Tracker/TrackerRecAlgs/FaserSpacePoints/src/components/FaserSpacePoints_entries.cxx b/Tracker/TrackerRecAlgs/FaserSpacePoints/src/components/FaserSpacePoints_entries.cxx new file mode 100644 index 000000000..d8d0460aa --- /dev/null +++ b/Tracker/TrackerRecAlgs/FaserSpacePoints/src/components/FaserSpacePoints_entries.cxx @@ -0,0 +1,3 @@ +#include "../FaserSpacePoints.h" + +DECLARE_COMPONENT( Tracker::FaserSpacePoints ) \ No newline at end of file diff --git a/Tracker/TrackerRecAlgs/TrackerPrepRawDataFormation/test/FaserSCT_ClusterizationDbgCosmics.py b/Tracker/TrackerRecAlgs/TrackerPrepRawDataFormation/test/FaserSCT_ClusterizationDbgCosmics.py new file mode 100644 index 000000000..cbc4beec7 --- /dev/null +++ b/Tracker/TrackerRecAlgs/TrackerPrepRawDataFormation/test/FaserSCT_ClusterizationDbgCosmics.py @@ -0,0 +1,66 @@ +#!/usr/bin/env python +"""Test various ComponentAccumulator Digitization configuration modules + +Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +""" +import sys +from AthenaCommon.Logging import log, logging +from AthenaCommon.Constants import DEBUG, VERBOSE, INFO +from AthenaCommon.Configurable import Configurable +from CalypsoConfiguration.AllConfigFlags import ConfigFlags +from AthenaConfiguration.TestDefaults import defaultTestFiles +from CalypsoConfiguration.MainServicesConfig import MainServicesCfg +from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg +from AthenaPoolCnvSvc.PoolWriteConfig import PoolWriteCfg +from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg +#from Digitization.DigitizationParametersConfig import writeDigitizationMetadata +from TrackerPrepRawDataFormation.TrackerPrepRawDataFormationConfig import FaserSCT_ClusterizationCfg +#from MCTruthSimAlgs.RecoTimingConfig import MergeRecoTimingObjCfg + +# Set up logging and new style config +log.setLevel(DEBUG) +Configurable.configurableRun3Behavior = True + +# Configure +ConfigFlags.Input.Files = ['my.RDO.pool.root'] +ConfigFlags.Output.ESDFileName = "myClusters.ESD.pool.root" +ConfigFlags.IOVDb.GlobalTag = "OFLCOND-XXXX-XXX-XX" # Needed to bypass autoconfig, only the "OFLCOND" matters at the moment +ConfigFlags.IOVDb.DatabaseInstance = "OFLP200" # Use MC conditions for now +ConfigFlags.Input.ProjectName = "data20" # Needed to bypass autoconfig +ConfigFlags.Input.isMC = False # Needed to bypass autoconfig +ConfigFlags.GeoModel.FaserVersion = "FASER-01" # FASER cosmic ray geometry (station 2 only) +ConfigFlags.Common.isOnline = False +ConfigFlags.GeoModel.Align.Dynamic = False +ConfigFlags.Beam.NumberOfCollisions = 0. + +ConfigFlags.lock() + +# Core components +acc = MainServicesCfg(ConfigFlags) +acc.merge(PoolReadCfg(ConfigFlags)) +acc.merge(PoolWriteCfg(ConfigFlags)) + +#acc.merge(writeDigitizationMetadata(ConfigFlags)) + +# Inner Detector +acc.merge(FaserSCT_ClusterizationCfg(ConfigFlags)) + +# Timing +#acc.merge(MergeRecoTimingObjCfg(ConfigFlags)) + +# Dump config +# logging.getLogger('forcomps').setLevel(VERBOSE) +# acc.foreach_component("*").OutputLevel = VERBOSE +# acc.foreach_component("*ClassID*").OutputLevel = INFO +# acc.getCondAlgo("FaserSCT_AlignCondAlg").OutputLevel = VERBOSE +# acc.getCondAlgo("FaserSCT_DetectorElementCondAlg").OutputLevel = VERBOSE +# acc.getService("StoreGateSvc").Dump = True +# acc.getService("ConditionStore").Dump = True +# acc.printConfig(withDetails=True) +# ConfigFlags.dump() + +# Execute and finish +sc = acc.run(maxEvents=-1) + +# Success should be 0 +sys.exit(not sc.isSuccess()) \ No newline at end of file diff --git a/Tracker/TrackerRecAlgs/TrackerSpacePointFormation/test/TrackerSpacePointFormationDbgCosmics.py b/Tracker/TrackerRecAlgs/TrackerSpacePointFormation/test/TrackerSpacePointFormationDbgCosmics.py new file mode 100644 index 000000000..a02500c27 --- /dev/null +++ b/Tracker/TrackerRecAlgs/TrackerSpacePointFormation/test/TrackerSpacePointFormationDbgCosmics.py @@ -0,0 +1,66 @@ +#!/usr/bin/env python +"""Test various ComponentAccumulator Digitization configuration modules + +Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +""" +import sys +from AthenaCommon.Logging import log, logging +from AthenaCommon.Constants import DEBUG, VERBOSE, INFO +from AthenaCommon.Configurable import Configurable +from CalypsoConfiguration.AllConfigFlags import ConfigFlags +from AthenaConfiguration.TestDefaults import defaultTestFiles +from CalypsoConfiguration.MainServicesConfig import MainServicesCfg +from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg +from AthenaPoolCnvSvc.PoolWriteConfig import PoolWriteCfg +from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg +#from Digitization.DigitizationParametersConfig import writeDigitizationMetadata +from TrackerSpacePointFormation.TrackerSpacePointFormationConfig import TrackerSpacePointFinderCfg +from TrackerPrepRawDataFormation.TrackerPrepRawDataFormationConfig import FaserSCT_ClusterizationCfg +#from MCTruthSimAlgs.RecoTimingConfig import MergeRecoTimingObjCfg + +# Set up logging and new style config +log.setLevel(DEBUG) +Configurable.configurableRun3Behavior = True + +# Configure +ConfigFlags.Input.Files = ['my.RDO.pool.root'] +ConfigFlags.Output.ESDFileName = "mySpacePoints.ESD.pool.root" +ConfigFlags.IOVDb.GlobalTag = "OFLCOND-XXXX-XXX-XX" +ConfigFlags.IOVDb.DatabaseInstance = "OFLP200" # Use MC conditions for now +ConfigFlags.Input.ProjectName = "data20" # Needed to bypass autoconfig +ConfigFlags.Input.isMC = False # Needed to bypass autoconfig +ConfigFlags.Common.isOnline = False +ConfigFlags.GeoModel.FaserVersion = "FASER-01" # FASER cosmic ray geometry (station 2 only) +ConfigFlags.GeoModel.Align.Dynamic = False +ConfigFlags.Beam.NumberOfCollisions = 0. +ConfigFlags.lock() + +# Core components +acc = MainServicesCfg(ConfigFlags) +acc.merge(PoolReadCfg(ConfigFlags)) +acc.merge(PoolWriteCfg(ConfigFlags)) + +#acc.merge(writeDigitizationMetadata(ConfigFlags)) + +# Inner Detector +acc.merge(FaserSCT_ClusterizationCfg(ConfigFlags)) +acc.merge(TrackerSpacePointFinderCfg(ConfigFlags)) + +# Timing +#acc.merge(MergeRecoTimingObjCfg(ConfigFlags)) + +# Dump config +# logging.getLogger('forcomps').setLevel(VERBOSE) +# acc.foreach_component("*").OutputLevel = VERBOSE +# acc.foreach_component("*ClassID*").OutputLevel = INFO +# acc.getCondAlgo("FaserSCT_AlignCondAlg").OutputLevel = VERBOSE +# acc.getCondAlgo("FaserSCT_DetectorElementCondAlg").OutputLevel = VERBOSE +# acc.getService("StoreGateSvc").Dump = True +# acc.getService("ConditionStore").Dump = True +# acc.printConfig(withDetails=True) +# ConfigFlags.dump() + +# Execute and finish +sc = acc.run(maxEvents=-1) +# Success should be 0 +sys.exit(not sc.isSuccess()) -- GitLab