ATLAS Offline Software
ThinInDetClustersAlg.h
Go to the documentation of this file.
1 
3 /*
4  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 #ifndef THINNINGUTILS_ThinInDetClustersAlg_H
8 #define THINNINGUTILS_ThinInDetClustersAlg_H 1
9 
14 // FrameWork includes
17 #include "GaudiKernel/ServiceHandle.h"
18 #include "GaudiKernel/ToolHandle.h"
26 
27 // STL includes
28 #include <atomic>
29 #include <string>
30 #include <vector>
31 
32 class ThinInDetClustersAlg final : public ExpressionParserUser<::AthAlgorithm>
33 {
34  public:
36  ThinInDetClustersAlg(const std::string& name, ISvcLocator* pSvcLocator);
37 
39  virtual ~ThinInDetClustersAlg() = default;
40 
42  virtual StatusCode initialize() override;
43 
45  virtual StatusCode execute() override;
46 
48  virtual StatusCode finalize() override;
49 
50  private:
52  unsigned int m_ntot = 0;
53  unsigned int m_npass = 0;
55  BooleanProperty m_thinPixelHitsOnTrack
56  { this, "ThinPixelHitsOnTrack", false, ""};
57  BooleanProperty m_thinSCTHitsOnTrack
58  { this, "ThinSCTHitsOnTrack", false, ""};
59  BooleanProperty m_thinTRTHitsOnTrack
60  { this, "ThinTRTHitsOnTrack", false, ""};
61 
63  StringProperty m_streamName
64  { this, "StreamName", "", "Name of the stream being thinned" };
65 
68 
69  StringProperty m_selectionString
70  { this, "SelectionString", "InDetTrackParticles.pt>10*GeV", "Selection string for each TrackParticle container" };
71 
74  { this, "InDetTrackParticlesKey", "InDetTrackParticles", "" };
75 
77  unsigned int m_ntot_pix_states = 0;
78  unsigned int m_npass_pix_states = 0;
80  { this, "InDetTrackStatesPixKey", "PixelMSOSs", "" }; // original
81 
82  unsigned int m_ntot_pix_measurements = 0;
83  unsigned int m_npass_pix_measurements = 0;
85  { this, "InDetTrackMeasurementsPixKey", "PixelClusters", "" };
86 
87  unsigned int m_ntot_sct_states = 0;
88  unsigned int m_npass_sct_states = 0;
90  { this, "InDetTrackStatesSctKey", "SCT_MSOSs", "" };
91 
92  unsigned int m_ntot_sct_measurements = 0;
93  unsigned int m_npass_sct_measurements = 0;
95  { this, "InDetTrackMeasurementsSctKey", "SCT_Clusters", "" };
96 
97  unsigned int m_ntot_trt_states = 0;
98  unsigned int m_npass_trt_states = 0;
100  { this, "InDetTrackStatesTrtKey", "TRT_MSOSs", "" };
101 
102  unsigned int m_ntot_trt_measurements = 0;
103  unsigned int m_npass_trt_measurements = 0;
105  { this, "InDetTrackMeasurementsTrtKey", "TRT_DriftCircles", "" };
106 
108  SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> m_SCTDetEleCollKey{this, "SCTDetEleCollKey", "SCT_DetectorElementCollection", "Key of SiDetectorElementCollection for SCT"};
109 
121  };
122 
124  void selectTrackHits(const xAOD::TrackParticleContainer& inputTrackParticles,
125  const std::vector<bool>& inputMask,
126  MeasurementType detTypeToSelect,
127  std::vector<bool>& outputStatesMask, std::vector<bool>& outputMeasurementsMask) const;
128 
130  (MeasurementType detTypeToSelect,
131  const xAOD::TrackParticleContainer& inputTrackParticles,
132  const std::vector<bool>& inputMask,
135  unsigned int& ntot_states,
136  unsigned int& npass_states,
137  unsigned int& npass_measurements) const;
138 };
139 
140 #endif //> !THINNINGUTILS_ThinInDetClustersAlg_H
141 
ReadHandleKeyArray.h
ThinInDetClustersAlg::TrkState_Vertex
@ TrkState_Vertex
Definition: ThinInDetClustersAlg.h:118
ThinInDetClustersAlg::m_statesSctSGKey
SG::ThinningHandleKey< xAOD::TrackStateValidationContainer > m_statesSctSGKey
Definition: ThinInDetClustersAlg.h:90
ThinInDetClustersAlg::m_ntot_pix_measurements
unsigned int m_ntot_pix_measurements
Definition: ThinInDetClustersAlg.h:82
SG::ThinningHandleKey
HandleKey object for adding thinning to an object.
Definition: ThinningHandleKey.h:38
ExpressionParserUser.h
ThinInDetClustersAlg::m_selectionString
StringProperty m_selectionString
Expressions for object thinning selections Default InDetTrackParticles (also accomplished through fla...
Definition: ThinInDetClustersAlg.h:70
ThinInDetClustersAlg::m_npass_sct_states
unsigned int m_npass_sct_states
Definition: ThinInDetClustersAlg.h:88
ThinInDetClustersAlg::MeasurementType
MeasurementType
Track state types Subset of enum MeasurementType from Athena: Tracking/TrkEvent/TrkEventPrimitives/Tr...
Definition: ThinInDetClustersAlg.h:112
ThinInDetClustersAlg::m_thinTRTHitsOnTrack
BooleanProperty m_thinTRTHitsOnTrack
Definition: ThinInDetClustersAlg.h:60
ThinInDetClustersAlg::TrkState_SpacePoint
@ TrkState_SpacePoint
Definition: ThinInDetClustersAlg.h:119
ThinInDetClustersAlg::TrkState_Pseudo
@ TrkState_Pseudo
Definition: ThinInDetClustersAlg.h:117
ThinInDetClustersAlg::m_ntot_pix_states
unsigned int m_ntot_pix_states
Counters and keys for xAOD::TrackStateValidation and xAOD::TrackMeasurementValidation containers.
Definition: ThinInDetClustersAlg.h:77
ThinInDetClustersAlg::execute
virtual StatusCode execute() override
Athena algorithm's execute hook.
Definition: ThinInDetClustersAlg.cxx:117
ThinInDetClustersAlg
Definition: ThinInDetClustersAlg.h:33
ThinInDetClustersAlg::selectTrackHits
void selectTrackHits(const xAOD::TrackParticleContainer &inputTrackParticles, const std::vector< bool > &inputMask, MeasurementType detTypeToSelect, std::vector< bool > &outputStatesMask, std::vector< bool > &outputMeasurementsMask) const
Select TrackStateValidation and TrackMeasurementValidation objects that are used in the (thinned) tra...
Definition: ThinInDetClustersAlg.cxx:268
ThinInDetClustersAlg::finalize
virtual StatusCode finalize() override
Athena algorithm's finalize hook.
Definition: ThinInDetClustersAlg.cxx:85
ThinInDetClustersAlg::m_ntot
unsigned int m_ntot
Counters and keys for xAOD::TrackParticle container.
Definition: ThinInDetClustersAlg.h:52
ThinInDetClustersAlg::m_ntot_trt_states
unsigned int m_ntot_trt_states
Definition: ThinInDetClustersAlg.h:97
ThinInDetClustersAlg::~ThinInDetClustersAlg
virtual ~ThinInDetClustersAlg()=default
Destructor:
ThinInDetClustersAlg::m_npass_trt_states
unsigned int m_npass_trt_states
Definition: ThinInDetClustersAlg.h:98
AthAlgorithm.h
ThinInDetClustersAlg::m_statesPixSGKey
SG::ThinningHandleKey< xAOD::TrackStateValidationContainer > m_statesPixSGKey
Definition: ThinInDetClustersAlg.h:80
ThinInDetClustersAlg::initialize
virtual StatusCode initialize() override
Athena algorithm's initalize hook.
Definition: ThinInDetClustersAlg.cxx:43
ThinInDetClustersAlg::TrkState_TRT
@ TrkState_TRT
Definition: ThinInDetClustersAlg.h:116
ThinInDetClustersAlg::m_npass_pix_states
unsigned int m_npass_pix_states
Definition: ThinInDetClustersAlg.h:78
ThinInDetClustersAlg::ThinInDetClustersAlg
ThinInDetClustersAlg(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Definition: ThinInDetClustersAlg.cxx:33
ThinInDetClustersAlg::m_ntot_sct_states
unsigned int m_ntot_sct_states
Definition: ThinInDetClustersAlg.h:87
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ThinInDetClustersAlg::m_measurementsPixSGKey
SG::ThinningHandleKey< xAOD::TrackMeasurementValidationContainer > m_measurementsPixSGKey
Definition: ThinInDetClustersAlg.h:85
ThinInDetClustersAlg::m_thinSCTHitsOnTrack
BooleanProperty m_thinSCTHitsOnTrack
Definition: ThinInDetClustersAlg.h:58
ThinInDetClustersAlg::filterTrackHits
StatusCode filterTrackHits(MeasurementType detTypeToSelect, const xAOD::TrackParticleContainer &inputTrackParticles, const std::vector< bool > &inputMask, const SG::ThinningHandleKey< xAOD::TrackStateValidationContainer > &statesKey, const SG::ThinningHandleKey< xAOD::TrackMeasurementValidationContainer > &measurementsKey, unsigned int &ntot_states, unsigned int &npass_states, unsigned int &npass_measurements) const
Definition: ThinInDetClustersAlg.cxx:210
ThinInDetClustersAlg::m_ntot_sct_measurements
unsigned int m_ntot_sct_measurements
Definition: ThinInDetClustersAlg.h:92
ThinInDetClustersAlg::m_streamName
StringProperty m_streamName
Stream for object thinning selections.
Definition: ThinInDetClustersAlg.h:64
ThinInDetClustersAlg::TrkState_SCT
@ TrkState_SCT
Definition: ThinInDetClustersAlg.h:115
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
ThinInDetClustersAlg::m_inDetSGKey
SG::ThinningHandleKey< xAOD::TrackParticleContainer > m_inDetSGKey
SGKey for TrackParticleContainer.
Definition: ThinInDetClustersAlg.h:74
ThinInDetClustersAlg::m_statesTrtSGKey
SG::ThinningHandleKey< xAOD::TrackStateValidationContainer > m_statesTrtSGKey
Definition: ThinInDetClustersAlg.h:100
ExpressionParserUser
Definition: ExpressionParserUser.h:107
ThinInDetClustersAlg::m_npass_sct_measurements
unsigned int m_npass_sct_measurements
Definition: ThinInDetClustersAlg.h:93
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
ThinInDetClustersAlg::m_measurementsTrtSGKey
SG::ThinningHandleKey< xAOD::TrackMeasurementValidationContainer > m_measurementsTrtSGKey
Definition: ThinInDetClustersAlg.h:105
SiDetectorElementCollection.h
TrackStateValidationContainer.h
ThinInDetClustersAlg::TrkState_Pixel
@ TrkState_Pixel
Definition: ThinInDetClustersAlg.h:114
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection >
ThinInDetClustersAlg::TrkState_NumberOfMeasurementTypes
@ TrkState_NumberOfMeasurementTypes
Definition: ThinInDetClustersAlg.h:120
ThinInDetClustersAlg::m_ntot_trt_measurements
unsigned int m_ntot_trt_measurements
Definition: ThinInDetClustersAlg.h:102
ThinningHandleKey.h
HandleKey object for adding thinning to an object.
ThinInDetClustersAlg::m_npass_trt_measurements
unsigned int m_npass_trt_measurements
Definition: ThinInDetClustersAlg.h:103
ThinInDetClustersAlg::m_thinPixelHitsOnTrack
BooleanProperty m_thinPixelHitsOnTrack
Thinning logic.
Definition: ThinInDetClustersAlg.h:56
TrackMeasurementValidationContainer.h
ThinInDetClustersAlg::TrkState_unidentified
@ TrkState_unidentified
Definition: ThinInDetClustersAlg.h:113
ThinInDetClustersAlg::m_npass
unsigned int m_npass
Definition: ThinInDetClustersAlg.h:53
ThinInDetClustersAlg::m_SCTDetEleCollKey
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_SCTDetEleCollKey
For P->T converter of SCT_Clusters.
Definition: ThinInDetClustersAlg.h:108
ThinInDetClustersAlg::m_measurementsSctSGKey
SG::ThinningHandleKey< xAOD::TrackMeasurementValidationContainer > m_measurementsSctSGKey
Definition: ThinInDetClustersAlg.h:95
TrackParticleContainer.h
ThinInDetClustersAlg::m_npass_pix_measurements
unsigned int m_npass_pix_measurements
Definition: ThinInDetClustersAlg.h:83