diff --git a/Event/EventOverlay/EventOverlayJobTransforms/share/InnerDetectorOverlay_jobOptions.py b/Event/EventOverlay/EventOverlayJobTransforms/share/InnerDetectorOverlay_jobOptions.py index 6f1959b77055f21a7bc1618147cd9a9a8ea224d7..3d8bd34c5da4aa3ff1efff69c1fa9d3ae27744d9 100644 --- a/Event/EventOverlay/EventOverlayJobTransforms/share/InnerDetectorOverlay_jobOptions.py +++ b/Event/EventOverlay/EventOverlayJobTransforms/share/InnerDetectorOverlay_jobOptions.py @@ -95,9 +95,15 @@ if DetFlags.overlay.pixel_on() or DetFlags.overlay.SCT_on() or DetFlags.overlay. ToolSvc += TRT_LocalOccupancy indetovl.TRT_LocalOccupancyTool = TRT_LocalOccupancy + from InDetTrigRecExample.InDetTrigConditionsAccess import TRT_ConditionsSetup + indetovl.TRTStrawSummarySvc=TRT_ConditionsSetup.instanceName('InDetTRTStrawStatusSummarySvc') + + #HT hit correction fraction - indetovl.TRT_HT_OccupancyCorrectionBarrel = 0.160 - indetovl.TRT_HT_OccupancyCorrectionEndcap = 0.130 + indetovl.TRT_HT_OccupancyCorrectionBarrel = 0.110 + indetovl.TRT_HT_OccupancyCorrectionEndcap = 0.090 + indetovl.TRT_HT_OccupancyCorrectionBarrelNoE = 0.060 + indetovl.TRT_HT_OccupancyCorrectionEndcapNoE = 0.050 from InDetRecExample.InDetJobProperties import InDetFlags diff --git a/InnerDetector/InDetRawAlgs/InDetOverlay/CMakeLists.txt b/InnerDetector/InDetRawAlgs/InDetOverlay/CMakeLists.txt index 821d946bb8610dbd2cefa943a27897150387e2c9..9aeaf23b0bcaadfd456f7a65f39f784f22c4e390 100644 --- a/InnerDetector/InDetRawAlgs/InDetOverlay/CMakeLists.txt +++ b/InnerDetector/InDetRawAlgs/InDetOverlay/CMakeLists.txt @@ -18,6 +18,7 @@ atlas_depends_on_subdirs( PUBLIC InnerDetector/InDetDetDescr/InDetIdentifier InnerDetector/InDetRawEvent/InDetSimData InnerDetector/InDetRecTools/TRT_ElectronPidTools + InnerDetector/InDetConditions/TRT_ConditionsServices Tracking/TrkEvent/TrkTrack ) @@ -28,7 +29,7 @@ atlas_add_component( InDetOverlay src/*.cxx src/components/*.cxx INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} - LINK_LIBRARIES ${CLHEP_LIBRARIES} AthenaBaseComps IDC_OverlayBase GaudiKernel InDetRawData StoreGateLib SGtests CxxUtils GeneratorObjects InDetIdentifier InDetSimData TrkTrack ) + LINK_LIBRARIES ${CLHEP_LIBRARIES} AthenaBaseComps IDC_OverlayBase GaudiKernel InDetRawData StoreGateLib SGtests CxxUtils GeneratorObjects InDetIdentifier InDetSimData TrkTrack TRT_ConditionsServicesLib) # Install files from the package: atlas_install_headers( InDetOverlay ) diff --git a/InnerDetector/InDetRawAlgs/InDetOverlay/InDetOverlay/InDetOverlay.h b/InnerDetector/InDetRawAlgs/InDetOverlay/InDetOverlay/InDetOverlay.h index 42a1a82a17c0dd0f13f73ca4cafac26c67b3d33c..9a0516c183cb64af09060f505a54f57b095d2fd4 100755 --- a/InnerDetector/InDetRawAlgs/InDetOverlay/InDetOverlay/InDetOverlay.h +++ b/InnerDetector/InDetRawAlgs/InDetOverlay/InDetOverlay/InDetOverlay.h @@ -33,6 +33,7 @@ class StoreGateSvc; class SCT_ID; class TRT_ID; class IAtRndmGenSvc; +class ITRT_StrawStatusSummarySvc; namespace CLHEP { class HepRandomEngine; @@ -104,6 +105,7 @@ private: double m_HTOccupancyCorrectionB_noE; double m_HTOccupancyCorrectionEC_noE; ToolHandle< InDet::ITRT_LocalOccupancy > m_TRT_LocalOccupancyTool; + ServiceHandle<ITRT_StrawStatusSummarySvc> m_TRTStrawSummarySvc; }; #endif/*INDETOVERLAY_H*/ diff --git a/InnerDetector/InDetRawAlgs/InDetOverlay/src/InDetOverlay.cxx b/InnerDetector/InDetRawAlgs/InDetOverlay/src/InDetOverlay.cxx index 12d0add9538a8563542068e8695bcbda76a3cc8b..ea1d320917cef3dc131d3590ab88d6008d191fd8 100755 --- a/InnerDetector/InDetRawAlgs/InDetOverlay/src/InDetOverlay.cxx +++ b/InnerDetector/InDetRawAlgs/InDetOverlay/src/InDetOverlay.cxx @@ -34,6 +34,8 @@ #include "InDetIdentifier/SCT_ID.h" #include "InDetIdentifier/TRT_ID.h" +#include "TRT_ConditionsServices/ITRT_StrawStatusSummarySvc.h" + #include <iostream> #include <sstream> #include <typeinfo> @@ -280,7 +282,8 @@ InDetOverlay::InDetOverlay(const std::string &name, ISvcLocator *pSvcLocator) : m_rndmSvc("AtRndmGenSvc",name), m_rndmEngineName("InDetOverlay"), m_rndmEngine(nullptr), - m_TRT_LocalOccupancyTool("TRT_LocalOccupancy") + m_TRT_LocalOccupancyTool("TRT_LocalOccupancy"), + m_TRTStrawSummarySvc("InDetTRTStrawStatusSummarySvc",name) { //change via postExec indetovl.do_XXX=True @@ -302,16 +305,16 @@ InDetOverlay::InDetOverlay(const std::string &name, ISvcLocator *pSvcLocator) : declareProperty("TRTinputSDO_Name", m_TRTinputSDO_Name="TRT_SDO_Map"); - declareProperty("TRT_HT_OccupancyCorrectionBarrel",m_HTOccupancyCorrectionB=0.160); - declareProperty("TRT_HT_OccupancyCorrectionEndcap",m_HTOccupancyCorrectionEC=0.130); - declareProperty("TRT_HT_OccupancyCorrectionBarrelNoE",m_HTOccupancyCorrectionB_noE=0.105); - declareProperty("TRT_HT_OccupancyCorrectionEndcapNoE",m_HTOccupancyCorrectionEC_noE=0.080); + declareProperty("TRT_HT_OccupancyCorrectionBarrel",m_HTOccupancyCorrectionB=0.110); + declareProperty("TRT_HT_OccupancyCorrectionEndcap",m_HTOccupancyCorrectionEC=0.090); + declareProperty("TRT_HT_OccupancyCorrectionBarrelNoE",m_HTOccupancyCorrectionB_noE=0.06); + declareProperty("TRT_HT_OccupancyCorrectionEndcapNoE",m_HTOccupancyCorrectionEC_noE=0.05); declareProperty("RndmSvc", m_rndmSvc, "Random Number Service"); declareProperty("RndmEngine", m_rndmEngineName,"Random engine name"); declareProperty("TRT_LocalOccupancyTool", m_TRT_LocalOccupancyTool); - + declareProperty("TRTStrawSummarySvc", m_TRTStrawSummarySvc); } //================================================================ @@ -345,6 +348,18 @@ StatusCode InDetOverlay::overlayInitialize() CHECK( m_TRT_LocalOccupancyTool.retrieve() ); + + if (!m_TRTStrawSummarySvc.empty() && m_TRTStrawSummarySvc.retrieve().isFailure() ) { + ATH_MSG_ERROR ("Failed to retrieve StrawStatus Summary " << m_TRTStrawSummarySvc); + ATH_MSG_ERROR ("configure as 'None' to avoid its loading."); + return StatusCode::FAILURE; + } else { + if ( !m_TRTStrawSummarySvc.empty()) + ATH_MSG_INFO( "Retrieved tool " << m_TRTStrawSummarySvc ); + } + + + } return StatusCode::SUCCESS; } @@ -633,12 +648,23 @@ void InDetOverlay::mergeTRTCollections(TRT_RDO_Collection *mc_coll, // the actual merging pr1->merge(*pr2); + //If the hit is not already a high level hit - if( !(pr1->getWord() & 0x04020100) ) { + if( !(pr1->getWord() & 0x04020100) ) { + + bool isXenonStraw = false; + + Identifier rdoId = p_rdo->identify(); + if (!m_TRTStrawSummarySvc.empty()) { + if (m_TRTStrawSummarySvc->getStatusHT(rdoId) == TRTCond::StrawStatus::Good) { + isXenonStraw = true; + } + } + + //Determine if the hit is from an electron or not bool isElectron = false; - Identifier rdoId = p_rdo->identify(); InDetSimDataCollection::const_iterator sdoIter(SDO_Map.find(rdoId)); if( sdoIter != SDO_Map.end() ){ const std::vector< InDetSimData::Deposit >& deposits = sdoIter->second.getdeposits(); @@ -663,7 +689,7 @@ void InDetOverlay::mergeTRTCollections(TRT_RDO_Collection *mc_coll, HTOccupancyCorrection = abs(det) > 1 ? m_HTOccupancyCorrectionEC_noE : m_HTOccupancyCorrectionB_noE; } - if( occupancy * HTOccupancyCorrection > CLHEP::RandFlat::shoot( m_rndmEngine, 0, 1) ) + if( isXenonStraw && ( occupancy * HTOccupancyCorrection > CLHEP::RandFlat::shoot( m_rndmEngine, 0, 1) ) ) newword += 1 << (26-9); // TRT_LoLumRawData newrdo( pr1->identify(), newword);