diff --git a/InnerDetector/InDetDigitization/FastSiDigitization/CMakeLists.txt b/InnerDetector/InDetDigitization/FastSiDigitization/CMakeLists.txt index c2d6e2ad3f54a7fbe7bfa3d16d7ac51d16740a9b..89bade7f6eeccf590b8a29f3809d1811fd80e2ec 100644 --- a/InnerDetector/InDetDigitization/FastSiDigitization/CMakeLists.txt +++ b/InnerDetector/InDetDigitization/FastSiDigitization/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( FastSiDigitization ) @@ -12,7 +12,7 @@ atlas_add_component( FastSiDigitization src/*.cxx src/components/*.cxx INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AtlasHepMCLib AthenaBaseComps AthenaKernel PileUpToolsLib EventPrimitives xAODEventInfo GaudiKernel GeoPrimitives InDetReadoutGeometry PixelCablingLib PixelConditionsData ReadoutGeometryBase PixelReadoutGeometry SCT_ReadoutGeometry InDetCondTools InDetSimData InDetPrepRawData SiClusterizationToolLib InDetSimEvent HitManagement ISF_FatrasDetDescrModel ISF_FatrasEvent TrkTruthData StoreGateLib Identifier GeneratorObjects InDetIdentifier TrkDetDescrInterfaces TrkDigEvent TrkDigInterfaces TrkGeometry TrkSurfaces TrkExUtils ) + LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AtlasHepMCLib AthenaBaseComps AthenaKernel PileUpToolsLib EventPrimitives xAODEventInfo GaudiKernel GeoPrimitives InDetReadoutGeometry PixelCablingLib PixelConditionsData ReadoutGeometryBase PixelReadoutGeometry SCT_ReadoutGeometry InDetCondTools InDetSimData InDetPrepRawData SiClusterizationToolLib InDetSimEvent HitManagement ISF_FatrasDetDescrModel ISF_FatrasEvent TrkTruthData StoreGateLib Identifier GeneratorObjects InDetIdentifier TrkDetDescrInterfaces TrkDigEvent TrkDigInterfaces TrkSurfaces TrkExUtils ) # Install files from the package: atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} ) diff --git a/InnerDetector/InDetDigitization/FastSiDigitization/FastSiDigitization/SiSmearedDigitizationTool.h b/InnerDetector/InDetDigitization/FastSiDigitization/FastSiDigitization/SiSmearedDigitizationTool.h index 995d8006de5524049b6736af17bc32be525cd56e..50c4639c33b918f58521c825e33bbc683ab52806 100644 --- a/InnerDetector/InDetDigitization/FastSiDigitization/FastSiDigitization/SiSmearedDigitizationTool.h +++ b/InnerDetector/InDetDigitization/FastSiDigitization/FastSiDigitization/SiSmearedDigitizationTool.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -36,7 +36,6 @@ #include "TrkTruthData/PRD_MultiTruthCollection.h" #include "ISF_FatrasDetDescrModel/IdHashDetElementCollection.h" -#include "TrkDetDescrInterfaces/ITrackingGeometrySvc.h" #include "GaudiKernel/ITHistSvc.h" #include "EventPrimitives/EventPrimitives.h" @@ -62,12 +61,6 @@ namespace InDet { class SiCluster; } -namespace Trk { - - class TrackingGeometry; - -} - class SiSmearedDigitizationTool : virtual public PileUpToolBase { @@ -214,9 +207,6 @@ public: double m_Err_x_SCT; double m_Err_y_SCT; - ServiceHandle<Trk::ITrackingGeometrySvc> m_trackingGeometrySvc; //!< Service handle for retrieving the TrackingGeometry - const Trk::TrackingGeometry* m_trackingGeometry; //!< The TrackingGeometry to be retrieved - std::string m_trackingGeometryName; //!< The Name of the TrackingGeometry bool m_useCustomGeometry; diff --git a/InnerDetector/InDetDigitization/FastSiDigitization/share/SiSmearing_jobOptions.py b/InnerDetector/InDetDigitization/FastSiDigitization/share/SiSmearing_jobOptions.py index 3d0cc9edd6683fbfbb942fed2bcbc6811b533789..1fe3862f77ddd000ac955ce25184d4249f34f564 100644 --- a/InnerDetector/InDetDigitization/FastSiDigitization/share/SiSmearing_jobOptions.py +++ b/InnerDetector/InDetDigitization/FastSiDigitization/share/SiSmearing_jobOptions.py @@ -41,10 +41,6 @@ from AthenaCommon.BeamFlags import jobproperties # sct_SiPropertiesToolSetup.setup() # sctSiPropertiesTool = sct_SiPropertiesToolSetup.getTool() -from PixelConditionsTools.PixelConditionsToolsConf import PixelRecoDbTool -ToolSvc += PixelRecoDbTool() -ToolSvc.PixelRecoDbTool.InputSource = 1 - from IOVDbSvc.CondDB import conddb conddb.addFolder("PIXEL_OFL","/PIXEL/PixCalib") diff --git a/InnerDetector/InDetDigitization/FastSiDigitization/share/SiSmearing_noPU.py b/InnerDetector/InDetDigitization/FastSiDigitization/share/SiSmearing_noPU.py index 71a90342993430488b7bd61175e334a77ab39e5a..96b4933d7c80908b08bbf27f233241ab9944ed0d 100644 --- a/InnerDetector/InDetDigitization/FastSiDigitization/share/SiSmearing_noPU.py +++ b/InnerDetector/InDetDigitization/FastSiDigitization/share/SiSmearing_noPU.py @@ -66,10 +66,6 @@ StoreGateSvc.Dump = True from InDetRecExample.InDetKeys import InDetKeys InDetKeys.PixelManager = "Pixel" -from PixelConditionsTools.PixelConditionsToolsConf import PixelRecoDbTool -ToolSvc += PixelRecoDbTool() -ToolSvc.PixelRecoDbTool.InputSource = 1 - from AthenaCommon.AppMgr import ServiceMgr ServiceMgr.MessageSvc.enableSuppression = False ServiceMgr.MessageSvc.Format = "% F%50W%S%7W%R%T %0W%M" @@ -86,47 +82,50 @@ from AthenaCommon.AlgSequence import AlgSequence from AthenaCommon.SystemOfUnits import * import math -from TrkDetDescrSvc.AtlasTrackingGeometrySvc import AtlasTrackingGeometrySvc - topSequence = AlgSequence() -topSequence.PixelSmearedDigitization.SiSmearedDigitizationTool.CheckSmear=True -topSequence.PixelSmearedDigitization.SiSmearedDigitizationTool.OutputLevel=VERBOSE -#topSequence.PixelSmearedDigitization.SiSmearedDigitizationTool.pitch_X=10.0*micrometer -#topSequence.PixelSmearedDigitization.SiSmearedDigitizationTool.pitch_X=0*micrometer -#topSequence.PixelSmearedDigitization.SiSmearedDigitizationTool.pitch_Y=55.0*micrometer -#topSequence.PixelSmearedDigitization.SiSmearedDigitizationTool.pitch_Y=0*micrometer -topSequence.PixelSmearedDigitization.SiSmearedDigitizationTool.TrackingGeometrySvc = AtlasTrackingGeometrySvc -topSequence.PixelSmearedDigitization.SiSmearedDigitizationTool.UseCustomGeometry = True -topSequence.PixelSmearedDigitization.SiSmearedDigitizationTool.DetectorElementMapName="Pixel_IdHashDetElementMap" -topSequence.PixelSmearedDigitization.SiSmearedDigitizationTool.MergeClusters = False -topSequence.PixelSmearedDigitization.SiSmearedDigitizationTool.PlanarClusterContainerName="Pixel_PlanarClusters" -topSequence.PixelSmearedDigitization.SiSmearedDigitizationTool.PRD_TruthPlanarContainerName="PRD_MultiTruthPlanarPixel" -#topSequence.PixelSmearedDigitization.SiSmearedDigitizationTool.Nsigma = 1.0 - -topSequence.SCTSmearedDigitization.SiSmearedDigitizationTool.CheckSmear=True -topSequence.SCTSmearedDigitization.SiSmearedDigitizationTool.SmearPixel = False -topSequence.SCTSmearedDigitization.SiSmearedDigitizationTool.OutputLevel=VERBOSE -#topSequence.SCTSmearedDigitization.SiSmearedDigitizationTool.pitch_X= 70.0*micrometer -#topSequence.SCTSmearedDigitization.SiSmearedDigitizationTool.pitch_X= 0*micrometer -topSequence.SCTSmearedDigitization.SiSmearedDigitizationTool.TrackingGeometrySvc = AtlasTrackingGeometrySvc -topSequence.SCTSmearedDigitization.SiSmearedDigitizationTool.UseCustomGeometry = True -topSequence.SCTSmearedDigitization.SiSmearedDigitizationTool.DetectorElementMapName="SCT_IdHashDetElementMap" -topSequence.SCTSmearedDigitization.SiSmearedDigitizationTool.MergeClusters = False -topSequence.SCTSmearedDigitization.SiSmearedDigitizationTool.PlanarClusterContainerName="SCT_PlanarClusters" -topSequence.SCTSmearedDigitization.SiSmearedDigitizationTool.PRD_TruthPlanarContainerName="PRD_MultiTruthPlanarSCT" -##topSequence.SCTSmearedDigitization.SiSmearedDigitizationTool.pitch_X= 0*micrometer - - -AlgSequence("Streams").StreamRDO.ItemList += ["iFatras::PlanarClusterContainer#Pixel_PlanarClusters"] -##AlgSequence("Streams").StreamRDO.ItemList += ["InDet::SiClusterContainer#PixelClusters"] -AlgSequence("Streams").StreamRDO.ItemList += ["iFatras::PlanarClusterContainer#SCT_PlanarClusters"] -#AlgSequence("Streams").StreamRDO.ItemList += ["InDet::SiClusterContainer#SCT_Clusters"] - -AlgSequence("Streams").StreamRDO.ItemList += ["PRD_MultiTruthCollection#PRD_MultiTruthPlanarPixel"] -AlgSequence("Streams").StreamRDO.ItemList += ["PRD_MultiTruthCollection#PRD_MultiTruthPlanarSCT"] -##AlgSequence("Streams").StreamRDO.ItemList += ["PRD_MultiTruthCollection#PRD_MultiTruthPixel"] -#AlgSequence("Streams").StreamRDO.ItemList += ["PRD_MultiTruthCollection#PRD_MultiTruthSCT"] +from AtlasGeoModel import InDetGM + +from FastSiDigitization.FastSiDigitizationConf import SiSmearedDigitizationTool +topSequence.PixelSmearedDigitization.DigitizationTool = SiSmearedDigitizationTool(CheckSmear=True, + OutputLevel=VERBOSE, + # pitch_X=10.0*micrometer, + # pitch_X=0*micrometer, + # pitch_Y=55.0*micrometer, + # pitch_Y=0*micrometer, + UseCustomGeometry = False, # @TODO was True, which causes many errors. Why ? + DetectorElementMapName="Pixel_IdHashDetElementMap", + MergeClusters = False, + PlanarClusterContainerName="Pixel_PlanarClusters", + PRD_TruthPlanarContainerName="PRD_MultiTruthPlanarPixel" + # , Nsigma = 1.0 + ) + + +topSequence.SCTSmearedDigitization.DigitizationTool = SiSmearedDigitizationTool(CheckSmear=True, + SmearPixel = False, + OutputLevel=VERBOSE, + # pitch_X= 70.0*micrometer, + # pitch_X= 0*micrometer, + # pitch_X= 0*micrometer, + UseCustomGeometry = False, # @TODO was True, which causes many errors. Why ? + DetectorElementMapName="SCT_IdHashDetElementMap", + MergeClusters = False, + PlanarClusterContainerName="SCT_PlanarClusters", + PRD_TruthPlanarContainerName="PRD_MultiTruthPlanarSCT") + +rdo_stream = theApp.getOutputStream( "StreamRDO" ) + +print (rdo_stream) +rdo_stream.ItemList += ["iFatras::PlanarClusterContainer#Pixel_PlanarClusters"] +##rdo_stream.ItemList += ["InDet::SiClusterContainer#PixelClusters"] +rdo_stream.ItemList += ["iFatras::PlanarClusterContainer#SCT_PlanarClusters"] +#rdo_stream.ItemList += ["InDet::SiClusterContainer#SCT_Clusters"] + +rdo_stream.ItemList += ["PRD_MultiTruthCollection#PRD_MultiTruthPlanarPixel"] +rdo_stream.ItemList += ["PRD_MultiTruthCollection#PRD_MultiTruthPlanarSCT"] +##rdo_stream.ItemList += ["PRD_MultiTruthCollection#PRD_MultiTruthPixel"] +#rdo_stream.ItemList += ["PRD_MultiTruthCollection#PRD_MultiTruthSCT"] #from VP1Algs.VP1AlgsConf import VP1Alg #topSequence += VP1Alg() diff --git a/InnerDetector/InDetDigitization/FastSiDigitization/src/SiSmearedDigitizationTool.cxx b/InnerDetector/InDetDigitization/FastSiDigitization/src/SiSmearedDigitizationTool.cxx index 1286ef76687950b6f127867af82bc67f68060d42..3faf33c8ad180bd82dae0bf02f8ffefc486c225f 100644 --- a/InnerDetector/InDetDigitization/FastSiDigitization/src/SiSmearedDigitizationTool.cxx +++ b/InnerDetector/InDetDigitization/FastSiDigitization/src/SiSmearedDigitizationTool.cxx @@ -51,9 +51,7 @@ #include "InDetPrepRawData/SiCluster.h" #include "EventPrimitives/EventPrimitivesHelpers.h" -// Trk includes -#include "TrkGeometry/TrackingGeometry.h" -#include "TrkDetDescrInterfaces/ITrackingGeometrySvc.h" +#include "TrkSurfaces/DiscSurface.h" // Root #include "TTree.h" @@ -122,9 +120,6 @@ SiSmearedDigitizationTool::SiSmearedDigitizationTool(const std::string &type, co m_Err_y_pixel(0), m_Err_x_SCT(0), m_Err_y_SCT(0), - m_trackingGeometrySvc("TrackingGeometrySvc","AtlasTrackingGeometrySvc"), - m_trackingGeometry(0), - m_trackingGeometryName("AtlasTrackingGeometry"), m_useCustomGeometry(false) { declareProperty("RndmSvc", m_rndmSvc, "Random Number Service used in SCT & Pixel digitization" ); @@ -142,8 +137,6 @@ SiSmearedDigitizationTool::SiSmearedDigitizationTool(const std::string &type, co declareProperty("DetectorElementMapName", m_detElementMapName="Pixel_IdHashDetElementMap"); declareProperty("CheckSmear", m_checkSmear); - // get the service handle for the TrackingGeometry - declareProperty("TrackingGeometrySvc" , m_trackingGeometrySvc); declareProperty("UseCustomGeometry", m_useCustomGeometry); declareProperty("HardScatterSplittingMode" , m_HardScatterSplittingMode, "Control pileup & signal splitting" ); @@ -204,17 +197,6 @@ StatusCode SiSmearedDigitizationTool::initialize() return StatusCode::FAILURE; } - if (m_SmearPixel && m_useCustomGeometry){ - - if (m_trackingGeometrySvc.retrieve().isFailure()) { - ATH_MSG_FATAL( "Cannot retrieve TrackingGeometrySvc. Abort job. " ); - return StatusCode::FAILURE; - } - - m_trackingGeometryName = m_trackingGeometrySvc->trackingGeometryName(); - - } - if (m_checkSmear){ // get THistSvc @@ -889,16 +871,6 @@ StatusCode SiSmearedDigitizationTool::mergeClusters(Planar_detElement_RIO_map * StatusCode SiSmearedDigitizationTool::digitize(const EventContext& ctx) { ATH_MSG_DEBUG( "--- SiSmearedDigitizationTool: in SiSmearedDigizationTool::digitize() ---" ); - - if(m_useCustomGeometry) { - if ((detStore()->retrieve(m_trackingGeometry, m_trackingGeometryName)).isFailure()) { - ATH_MSG_FATAL( "Could not retrieve TrackingGeometry '" << m_trackingGeometryName << "' from DetectorStore." ); - return StatusCode::FAILURE; - } - else - ATH_MSG_INFO( "TrackingGeometry '" << m_trackingGeometryName << "' successfully retrieved from DetectorStore." ); - } - m_detElementMap = new iFatras::IdHashDetElementCollection; //Retrieve and/or store the map with IdHash to DetElement if ((detStore()->contains<iFatras::IdHashDetElementCollection>(m_detElementMapName))){