Skip to content
Snippets Groups Projects
Commit 13780f01 authored by John Kenneth Anders's avatar John Kenneth Anders
Browse files

Merge branch 'FixTRT_Corrections' into '21.0'

Update TRT overlay tuning and treat Argon tubes differently

See merge request atlas/athena!16624

Former-commit-id: 8d1169e63f31709158d34c5b681867831b7c07ae
parents 08e7262f b109e70e
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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 )
......
......@@ -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*/
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment