ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
Muon::MuonHitTimingTool Class Reference

#include <MuonHitTimingTool.h>

Inheritance diagram for Muon::MuonHitTimingTool:
Collaboration diagram for Muon::MuonHitTimingTool:

Public Member Functions

 MuonHitTimingTool (const std::string &, const std::string &, const IInterface *)
 
virtual ~MuonHitTimingTool ()=default
 default destructor More...
 
virtual StatusCode initialize () override final
 standard initialization method More...
 
virtual TimingResult calculateTimingResult (const std::vector< const MuonClusterOnTrack * > &hits) const override final
 Calculate the time offset of a given set of hits wrt to the current bunch. More...
 

Private Attributes

ServiceHandle< Muon::IMuonIdHelperSvcm_idHelperSvc {this,"MuonIdHelperSvc","Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
 
ToolHandleArray< IMuonHitTimingToolm_hitTimingTools
 

Detailed Description

Definition at line 27 of file MuonHitTimingTool.h.

Constructor & Destructor Documentation

◆ MuonHitTimingTool()

MuonHitTimingTool::MuonHitTimingTool ( const std::string &  t,
const std::string &  n,
const IInterface *  p 
)

Definition at line 12 of file MuonHitTimingTool.cxx.

12  :
13  base_class(t,n,p),
14  m_hitTimingTools(this) {
15 
16  for( unsigned int tech = 0;tech<MuonStationIndex::TechnologyIndexMax;++tech ){
17  if( tech == static_cast<unsigned int>(MuonStationIndex::RPC) ) m_hitTimingTools.push_back(ToolHandle<IMuonHitTimingTool>("Muon::RPC_TimingTool/RPC_TimingTool"));
18  else m_hitTimingTools.push_back(ToolHandle<IMuonHitTimingTool>(""));
19  }
20 
21  }

◆ ~MuonHitTimingTool()

virtual Muon::MuonHitTimingTool::~MuonHitTimingTool ( )
virtualdefault

default destructor

Member Function Documentation

◆ calculateTimingResult()

IMuonHitTimingTool::TimingResult MuonHitTimingTool::calculateTimingResult ( const std::vector< const MuonClusterOnTrack * > &  hits) const
finaloverridevirtual

Calculate the time offset of a given set of hits wrt to the current bunch.

Definition at line 45 of file MuonHitTimingTool.cxx.

45  {
46 
47  // treat case of no hits and the case the first pointer is zero (should not happen)
48  if( hits.empty() || !hits.front()) return {};
49 
50  // for now assume that all hits are of the same technolgy
51  Identifier id = hits.front()->identify();
52  MuonStationIndex::TechnologyIndex tech = m_idHelperSvc->technologyIndex(id);
53 
54  // get handle and use it if it is not empty
55  const ToolHandle<IMuonHitTimingTool>& toolHandle = m_hitTimingTools[tech];
56  if( toolHandle.empty() ) {
57  ATH_MSG_VERBOSE("Unable to fill timing, timing tool missing. Tech = " << MuonStationIndex::technologyName(tech) );
58  return {};
59  }
60  return toolHandle->calculateTimingResult(hits);
61  }

◆ initialize()

StatusCode MuonHitTimingTool::initialize ( )
finaloverridevirtual

standard initialization method

Definition at line 23 of file MuonHitTimingTool.cxx.

23  {
24 
25  ATH_CHECK(m_idHelperSvc.retrieve());
26 
27  // ensure that the number of tool handles corresponds to the number of technologies
28  if( m_hitTimingTools.size() != MuonStationIndex::TechnologyIndex::TechnologyIndexMax ){
29  ATH_MSG_ERROR(" The MuonHitTimingTool ToolHandleArray SHOULD contain exactly " << MuonStationIndex::TechnologyIndex::TechnologyIndexMax
30  << " ToolHandles (they can be empty). ");
31  return StatusCode::FAILURE;
32  }
33 
34  // loop over timing tool handles and check that they handle the technology they are supposed to, if not return a FAILURE
35  for( unsigned int tech = 0;tech<MuonStationIndex::TechnologyIndexMax;++tech ){
36  // get handle, accept empty handles
37  auto& toolHandle = m_hitTimingTools[tech];
39  if( toolHandle.empty() ) continue;
40  ATH_CHECK(toolHandle.retrieve());
41  }
42  return StatusCode::SUCCESS;
43  }

Member Data Documentation

◆ m_hitTimingTools

ToolHandleArray<IMuonHitTimingTool> Muon::MuonHitTimingTool::m_hitTimingTools
private

Definition at line 42 of file MuonHitTimingTool.h.

◆ m_idHelperSvc

ServiceHandle<Muon::IMuonIdHelperSvc> Muon::MuonHitTimingTool::m_idHelperSvc {this,"MuonIdHelperSvc","Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
private

Definition at line 41 of file MuonHitTimingTool.h.


The documentation for this class was generated from the following files:
TRTCalib_Extractor.hits
hits
Definition: TRTCalib_Extractor.py:35
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
beamspotman.n
n
Definition: beamspotman.py:731
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
Muon::MuonHitTimingTool::m_hitTimingTools
ToolHandleArray< IMuonHitTimingTool > m_hitTimingTools
Definition: MuonHitTimingTool.h:42
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
Muon::MuonHitTimingTool::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: MuonHitTimingTool.h:41
Muon::MuonStationIndex::TechnologyIndexMax
@ TechnologyIndexMax
Definition: MuonStationIndex.h:57
Muon::MuonStationIndex::RPC
@ RPC
Definition: MuonStationIndex.h:56
Muon::MuonStationIndex::TechnologyIndex
TechnologyIndex
enum to classify the different layers in the muon spectrometer
Definition: MuonStationIndex.h:54
Identifier
Definition: IdentifierFieldParser.cxx:14
Muon::MuonStationIndex::technologyName
static const std::string & technologyName(TechnologyIndex index)
convert LayerIndex into a string
Definition: MuonStationIndex.cxx:209