ATLAS Offline Software
TrackAnalysisDefinitionSvc.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
13 
15 #include <algorithm>
16 #include <memory>
17 #include <unordered_map>
18 
21 
22 
27 {
28 
29  ATH_MSG_INFO( "Initialising using TEST = " << m_testTypeStr.value() <<
30  " and REFERENCE = " << m_refTypeStr.value() );
31 
33  m_isTestTrigger = m_testTypeStr.value().find("Trigger") != std::string::npos;
34  m_isTestEFTrigger = m_testTypeStr.value().find("EFTrigger") != std::string::npos;
35  m_isTestTruth = m_testTypeStr.value().find("Truth") != std::string::npos;
36  m_isTestOffline = m_testTypeStr.value().find("Offline") != std::string::npos;
37 
38  m_isRefTrigger = m_refTypeStr.value().find("Trigger") != std::string::npos;
39  m_isRefEFTrigger = m_refTypeStr.value().find("EFTrigger") != std::string::npos;
40  m_isRefTruth = m_refTypeStr.value().find("Truth") != std::string::npos;
41  m_isRefOffline = m_refTypeStr.value().find("Offline") != std::string::npos;
42 
45  m_useTruth = m_isTestTruth or m_isRefTruth or m_matchingType.value().find("EFTruthMatch") != std::string::npos;;
46  ATH_MSG_INFO("USE TRUTH? " << m_useTruth);
48 
50  if( m_useTrigger and not m_useEFTrigger) {
51  for( size_t ic=0 ; ic<m_chainNames.size() ; ic++ ) {
52  ATH_MSG_DEBUG( "Input chain : " << m_chainNames[ic] );
53  m_configuredChains.push_back( m_chainNames[ic] );
54  }
55  } else {
57  m_configuredChains.push_back( "Offline" );
58  }
59 
61  std::sort( m_configuredChains.begin(), m_configuredChains.end() );
62  m_configuredChains.erase( std::unique( m_configuredChains.begin(),
63  m_configuredChains.end() ),
64  m_configuredChains.end() );
65 
66  return StatusCode::SUCCESS;
67 }
68 
73  return StatusCode::SUCCESS;
74 }
75 
79 std::string TrackAnalysisDefinitionSvc::plotsFullDir( std::string chain ) const
80 {
82  std::string topDir( m_dirName );
83  if( not topDir.empty() ) topDir += "/";
84 
86  if( not chain.empty() ) chain += "/";
87 
89  std::string subDir( m_subFolder );
90  if( subDir.empty() ) {
91  ATH_MSG_WARNING( "Empty plots sub-directory" );
92  } else {
94  if( subDir[0] == '/' ) {
95  subDir.erase( subDir.begin() );
96  }
98  if( subDir.back() != '/' ) subDir += "/";
99  }
100 
101  return m_sortPlotsByChain.value() ?
102  topDir + chain + subDir :
103  topDir + subDir + chain;
104 }
105 
110 {
112  using methodMap_t = std::unordered_map<
113  std::string, IDPVM::ResolutionHelper::methods >;
114  methodMap_t methodMap = {
116  { "gaussFit" , IDPVM::ResolutionHelper::Gauss_fit },
118  };
119 
120  methodMap_t::const_iterator mitr = methodMap.find( m_resolMethod.value() );
121  if( mitr == methodMap.end() ) {
122  ATH_MSG_DEBUG( "Method " << m_resolMethod.value() <<
123  " not found. Using iterRMS by default." );
125  }
126  return mitr->second;
127 }
TrackAnalysisDefinitionSvc::m_resolMethod
StringProperty m_resolMethod
Definition: TrackAnalysisDefinitionSvc.h:130
TrackAnalysisDefinitionSvc::m_useTrigger
bool m_useTrigger
Definition: TrackAnalysisDefinitionSvc.h:96
IDPVM::ResolutionHelper::iterRMS_convergence
@ iterRMS_convergence
Definition: InnerDetector/InDetValidation/InDetPhysValMonitoring/InDetPhysValMonitoring/ResolutionHelper.h:36
runLayerRecalibration.chain
chain
Definition: runLayerRecalibration.py:175
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
TrackAnalysisDefinitionSvc::m_isTestTruth
bool m_isTestTruth
Definition: TrackAnalysisDefinitionSvc.h:97
TrackAnalysisDefinitionSvc::m_isRefTrigger
bool m_isRefTrigger
Definition: TrackAnalysisDefinitionSvc.h:98
TrackAnalysisDefinitionSvc::m_dirName
StringProperty m_dirName
Definition: TrackAnalysisDefinitionSvc.h:89
TrackAnalysisDefinitionSvc::m_isRefTruth
bool m_isRefTruth
Definition: TrackAnalysisDefinitionSvc.h:98
TrackAnalysisDefinitionSvc::finalize
virtual StatusCode finalize() override final
Definition: TrackAnalysisDefinitionSvc.cxx:72
TrackAnalysisDefinitionSvc::m_useOffline
bool m_useOffline
Definition: TrackAnalysisDefinitionSvc.h:96
TrackAnalysisDefinitionSvc::resolutionMethod
virtual unsigned int resolutionMethod() const override
Definition: TrackAnalysisDefinitionSvc.cxx:109
TrackAnalysisDefinitionSvc::m_matchingType
StringProperty m_matchingType
Definition: TrackAnalysisDefinitionSvc.h:103
TrackAnalysisDefinitionSvc::plotsFullDir
virtual std::string plotsFullDir(std::string chain="") const override
Definition: TrackAnalysisDefinitionSvc.cxx:79
TrackAnalysisDefinitionSvc::m_isRefEFTrigger
bool m_isRefEFTrigger
Definition: TrackAnalysisDefinitionSvc.h:98
TrackAnalysisDefinitionSvc.h
ResolutionHelper.h
IDPVM::ResolutionHelper::Gauss_fit
@ Gauss_fit
Definition: InnerDetector/InDetValidation/InDetPhysValMonitoring/InDetPhysValMonitoring/ResolutionHelper.h:36
TrackAnalysisDefinitionSvc::m_chainNames
StringArrayProperty m_chainNames
Definition: TrackAnalysisDefinitionSvc.h:88
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
TrackAnalysisDefinitionSvc::m_useEFTrigger
bool m_useEFTrigger
Definition: TrackAnalysisDefinitionSvc.h:96
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
TrackAnalysisDefinitionSvc::m_subFolder
StringProperty m_subFolder
Definition: TrackAnalysisDefinitionSvc.h:90
TrackAnalysisDefinitionSvc::m_isTestOffline
bool m_isTestOffline
Definition: TrackAnalysisDefinitionSvc.h:97
TrackAnalysisDefinitionSvc::m_isTestTrigger
bool m_isTestTrigger
Definition: TrackAnalysisDefinitionSvc.h:97
grepfile.ic
int ic
Definition: grepfile.py:33
TrackAnalysisDefinitionSvc::m_testTypeStr
StringProperty m_testTypeStr
Definition: TrackAnalysisDefinitionSvc.h:93
TrackAnalysisDefinitionSvc::m_isRefOffline
bool m_isRefOffline
Definition: TrackAnalysisDefinitionSvc.h:98
TrackAnalysisDefinitionSvc::m_isTestEFTrigger
bool m_isTestEFTrigger
Definition: TrackAnalysisDefinitionSvc.h:97
IDPVM::ResolutionHelper::methods
methods
methods acc to which mean&RMS can be evaluated
Definition: InnerDetector/InDetValidation/InDetPhysValMonitoring/InDetPhysValMonitoring/ResolutionHelper.h:36
TrackAnalysisDefinitionSvc::m_sortPlotsByChain
BooleanProperty m_sortPlotsByChain
histogram properties
Definition: TrackAnalysisDefinitionSvc.h:114
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
TrackAnalysisDefinitionSvc::m_useTruth
bool m_useTruth
Definition: TrackAnalysisDefinitionSvc.h:96
IDPVM::ResolutionHelper::fusion_iterRMS_Gaussfit
@ fusion_iterRMS_Gaussfit
Definition: InnerDetector/InDetValidation/InDetPhysValMonitoring/InDetPhysValMonitoring/ResolutionHelper.h:36
TrackAnalysisDefinitionSvc::m_configuredChains
std::vector< std::string > m_configuredChains
Definition: TrackAnalysisDefinitionSvc.h:106
TrackAnalysisDefinitionSvc::m_refTypeStr
StringProperty m_refTypeStr
Definition: TrackAnalysisDefinitionSvc.h:94
TrackAnalysisDefinitionSvc::initialize
virtual StatusCode initialize() override final
local includes
Definition: TrackAnalysisDefinitionSvc.cxx:26