TRT_TrackExtensionAlg.h 3.45 KB
Newer Older
1
/*
2
  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
*/

////////////////////////////////////////////////////////////////////////////////
//  Header file for class TRT_TrackExtensionAlg
/////////////////////////////////////////////////////////////////////////////////
// (c) ATLAS Detector software
/////////////////////////////////////////////////////////////////////////////////
// Class for extension trackS reconstructed in Pxels and SCT to TRT
/////////////////////////////////////////////////////////////////////////////////
// Version 1.0 22/08/2005 I.Gavrilenko
/////////////////////////////////////////////////////////////////////////////////

#ifndef TRT_TrackExtensionAlg_H
#define TRT_TrackExtensionAlg_H

#include <string>
19
#include "AthenaBaseComps/AthReentrantAlgorithm.h"
20
21
22
#include "GaudiKernel/ToolHandle.h"
#include "InDetRecToolInterfaces/ITRT_TrackExtensionTool.h"

23
24
25
26
27
28
29
// Store Gate handle keys
#include "StoreGate/ReadHandleKey.h"
#include "StoreGate/WriteHandleKey.h"

#include "TrkTrack/TrackExtensionMap.h"
#include "TrkTrack/TrackCollection.h"

30
31
32
#include "CxxUtils/checker_macros.h"
#include <atomic>

33
34
namespace InDet {

35
	class TRT_TrackExtensionAlg : public AthReentrantAlgorithm {
36
37
38
39
40
41
42
43
44
45
46
47
48
49

		///////////////////////////////////////////////////////////////////
		// Public methods:
		///////////////////////////////////////////////////////////////////
  
	public:

		///////////////////////////////////////////////////////////////////
		// Standard Algotithm methods
		///////////////////////////////////////////////////////////////////

		TRT_TrackExtensionAlg(const std::string &name, ISvcLocator *pSvcLocator);
		virtual ~TRT_TrackExtensionAlg() {}
		StatusCode initialize();
50
		StatusCode execute(const EventContext& ctx) const;
51
52
53
54
55
56
57
58
59
60
61
		StatusCode finalize();

		///////////////////////////////////////////////////////////////////
		// Print internal algorithm parameters and status
		///////////////////////////////////////////////////////////////////

	protected:
		///////////////////////////////////////////////////////////////////
		// Protected data 
		///////////////////////////////////////////////////////////////////

62
63
64
65
66
67
68
69
70
71
72
73
                struct Counter_t {
                   int m_nTracks = 0 ;  // Number input  tracks
                   int m_nTracksExtended = 0;  // Number output tracks
                   Counter_t &operator += (const Counter_t &a) {
                      m_nTracks         +=a.m_nTracks;
                      m_nTracksExtended +=a.m_nTracksExtended;
                      return *this;
                   }
                };
                mutable std::mutex m_counterMutex ATLAS_THREAD_SAFE;
                mutable Counter_t  m_totalCounts  ATLAS_THREAD_SAFE;

74
		ToolHandle<ITRT_TrackExtensionTool> m_trtExtension{this, "TrackExtensionTool", "InDet::TRT_TrackExtensionTool_xk", "TRT track extension tool"};
75
76
77
78
79
80
81
82
83
84

		// Data handle keys
		SG::ReadHandleKey<TrackCollection> m_inputTracksKey	{ this, "InputTracksLocation", "SiSPSeededTracks", "Input tracks container name" };
		SG::WriteHandleKey<TrackExtensionMap> m_outputTracksKey { this, "ExtendedTracksLocation", "ExtendedTracksMapPhase", "Output tracks container name" };

		///////////////////////////////////////////////////////////////////
		// Protected methods
		///////////////////////////////////////////////////////////////////

		MsgStream& dumpConditions(MsgStream& out) const;
85
                MsgStream& dumpEvent(MsgStream& out, const Counter_t &counter) const;
86
87

	};
88
89
}
#endif // TRT_TrackExtensionAlg_H