ATLAS Offline Software
TrackParticleThinning.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // TrackParticleThinning.h, (c) ATLAS Detector software
8 
9 #ifndef DERIVATIONFRAMEWORK_TRACKPARTICLETHINNING_H
10 #define DERIVATIONFRAMEWORK_TRACKPARTICLETHINNING_H
11 
14 
21 
22 #include "GaudiKernel/ToolHandle.h"
23 
24 #include <string>
25 #include <atomic>
26 #include <vector>
27 
29 
30 namespace DerivationFramework {
31 
32  class TrackParticleThinning : public extends<ExpressionParserUser<AthAlgTool>, IThinningTool> {
33  public:
34  TrackParticleThinning(const std::string& t, const std::string& n, const IInterface* p);
36  virtual StatusCode initialize() override;
37  virtual StatusCode finalize() override;
38  virtual StatusCode doThinning() const override;
39 
40  private:
41  //Expression for object thinning selection
42  std::string m_selectionString;
43 
44  //Counters and keys for xAOD::TrackParticle container
45  mutable std::atomic<unsigned int> m_ntot, m_npass;
46  StringProperty m_streamName
47  { this, "StreamName", "", "Name of the stream being thinned" };
49  { this, "InDetTrackParticlesKey", "InDetTrackParticles", "" };
50 
51  //Counters and keys for xAOD::TrackStateValidation and xAOD::TrackMeasurementValidation containers
52  mutable std::atomic<unsigned int> m_ntot_pix_states, m_npass_pix_states;
54  { this, "InDetTrackStatesPixKey", "PixelMSOSs", "" };
55  mutable std::atomic<unsigned int> m_ntot_pix_measurements, m_npass_pix_measurements;
57  { this, "InDetTrackMeasurementsPixKey", "PixelClusters", "" };
58  mutable std::atomic<unsigned int> m_ntot_sct_states, m_npass_sct_states;
60  { this, "InDetTrackStatesSctKey", "SCT_MSOSs", "" };
61  mutable std::atomic<unsigned int> m_ntot_sct_measurements, m_npass_sct_measurements;
63  { this, "InDetTrackMeasurementsSctKey", "SCT_Clusters", "" };
64  mutable std::atomic<unsigned int> m_ntot_trt_states, m_npass_trt_states;
66  { this, "InDetTrackStatesTrtKey", "TRT_MSOSs", "" };
67  mutable std::atomic<unsigned int> m_ntot_trt_measurements, m_npass_trt_measurements;
69  { this, "InDetTrackMeasurementsTrtKey", "TRT_DriftCircles", "" };
70 
71  // For P->T converter of SCT_Clusters
72  SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> m_SCTDetEleCollKey{this, "SCTDetEleCollKey", "SCT_DetectorElementCollection", "Key of SiDetectorElementCollection for SCT"};
73 
74  //logic
76 
77  //Track state types
78  // Subset of enum MeasurementType from Athena: Tracking/TrkEvent/TrkEventPrimitives/TrkEventPrimitives/TrackStateDefs.h
88  };
89 
91  void selectTrackHits(const xAOD::TrackParticleContainer& inputTrackParticles,
92  const std::vector<bool>& inputMask,
93  MeasurementType detTypeToSelect,
94  std::vector<bool>& outputStatesMask, std::vector<bool>& outputMeasurementsMask) const;
95 
96  void filterTrackHits
97  (const EventContext& ctx,
98  MeasurementType detTypeToSelect,
99  const xAOD::TrackParticleContainer& inputTrackParticles,
100  const std::vector<bool>& inputMask,
103  std::atomic<unsigned int>& ntot_states,
104  std::atomic<unsigned int>& ntot_measurements,
105  std::atomic<unsigned int>& npass_states,
106  std::atomic<unsigned int>& npass_measurements) const;
107  };
108 }
109 
110 #endif // DERIVATIONFRAMEWORK_TRACKPARTICLETHINNING_H
DerivationFramework::TrackParticleThinning::m_npass_trt_measurements
std::atomic< unsigned int > m_npass_trt_measurements
Definition: TrackParticleThinning.h:67
DerivationFramework::TrackParticleThinning::m_measurementsPixSGKey
SG::ThinningHandleKey< xAOD::TrackMeasurementValidationContainer > m_measurementsPixSGKey
Definition: TrackParticleThinning.h:57
DerivationFramework::TrackParticleThinning::m_npass_pix_states
std::atomic< unsigned int > m_npass_pix_states
Definition: TrackParticleThinning.h:52
DerivationFramework::TrackParticleThinning::TrkState_SpacePoint
@ TrkState_SpacePoint
Definition: TrackParticleThinning.h:86
DerivationFramework::TrackParticleThinning::initialize
virtual StatusCode initialize() override
Definition: TrackParticleThinning.cxx:53
DerivationFramework::TrackParticleThinning::m_ntot_trt_measurements
std::atomic< unsigned int > m_ntot_trt_measurements
Definition: TrackParticleThinning.h:67
SG::ThinningHandleKey
HandleKey object for adding thinning to an object.
Definition: ThinningHandleKey.h:38
ExpressionParserUser.h
DerivationFramework::TrackParticleThinning::filterTrackHits
void filterTrackHits(const EventContext &ctx, MeasurementType detTypeToSelect, const xAOD::TrackParticleContainer &inputTrackParticles, const std::vector< bool > &inputMask, const SG::ThinningHandleKey< xAOD::TrackStateValidationContainer > &statesKey, const SG::ThinningHandleKey< xAOD::TrackMeasurementValidationContainer > &measurementsKey, std::atomic< unsigned int > &ntot_states, std::atomic< unsigned int > &ntot_measurements, std::atomic< unsigned int > &npass_states, std::atomic< unsigned int > &npass_measurements) const
Definition: TrackParticleThinning.cxx:194
IThinningTool.h
DerivationFramework::TrackParticleThinning::m_ntot_sct_measurements
std::atomic< unsigned int > m_ntot_sct_measurements
Definition: TrackParticleThinning.h:61
DerivationFramework::TrackParticleThinning::finalize
virtual StatusCode finalize() override
Definition: TrackParticleThinning.cxx:90
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
DerivationFramework::TrackParticleThinning::m_thinHitsOnTrack
bool m_thinHitsOnTrack
Definition: TrackParticleThinning.h:75
DerivationFramework::TrackParticleThinning::m_npass_sct_measurements
std::atomic< unsigned int > m_npass_sct_measurements
Definition: TrackParticleThinning.h:61
DerivationFramework::TrackParticleThinning::m_statesSctSGKey
SG::ThinningHandleKey< xAOD::TrackStateValidationContainer > m_statesSctSGKey
Definition: TrackParticleThinning.h:60
DerivationFramework::TrackParticleThinning::TrkState_unidentified
@ TrkState_unidentified
Definition: TrackParticleThinning.h:80
DerivationFramework::TrackParticleThinning::m_npass_pix_measurements
std::atomic< unsigned int > m_npass_pix_measurements
Definition: TrackParticleThinning.h:55
DerivationFramework::TrackParticleThinning::TrkState_SCT
@ TrkState_SCT
Definition: TrackParticleThinning.h:82
DerivationFramework::TrackParticleThinning::TrkState_Vertex
@ TrkState_Vertex
Definition: TrackParticleThinning.h:85
DerivationFramework::TrackParticleThinning::m_npass_sct_states
std::atomic< unsigned int > m_npass_sct_states
Definition: TrackParticleThinning.h:58
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
DerivationFramework::TrackParticleThinning::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: TrackParticleThinning.cxx:254
DerivationFramework::TrackParticleThinning::m_inDetSGKey
SG::ThinningHandleKey< xAOD::TrackParticleContainer > m_inDetSGKey
Definition: TrackParticleThinning.h:49
beamspotman.n
n
Definition: beamspotman.py:731
DerivationFramework::TrackParticleThinning::TrackParticleThinning
TrackParticleThinning(const std::string &t, const std::string &n, const IInterface *p)
Definition: TrackParticleThinning.cxx:23
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
DerivationFramework::TrackParticleThinning::m_ntot_trt_states
std::atomic< unsigned int > m_ntot_trt_states
Definition: TrackParticleThinning.h:64
AthAlgTool.h
DerivationFramework::TrackParticleThinning::m_statesTrtSGKey
SG::ThinningHandleKey< xAOD::TrackStateValidationContainer > m_statesTrtSGKey
Definition: TrackParticleThinning.h:66
DerivationFramework
THE reconstruction tool.
Definition: ParticleSortingAlg.h:24
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
DerivationFramework::TrackParticleThinning::TrkState_NumberOfMeasurementTypes
@ TrkState_NumberOfMeasurementTypes
Definition: TrackParticleThinning.h:87
DerivationFramework::TrackParticleThinning::m_selectionString
std::string m_selectionString
Definition: TrackParticleThinning.h:42
DerivationFramework::TrackParticleThinning::m_ntot_pix_measurements
std::atomic< unsigned int > m_ntot_pix_measurements
Definition: TrackParticleThinning.h:55
DerivationFramework::TrackParticleThinning::m_npass
std::atomic< unsigned int > m_npass
Definition: TrackParticleThinning.h:45
DerivationFramework::TrackParticleThinning::m_streamName
StringProperty m_streamName
Definition: TrackParticleThinning.h:47
ReadCondHandleKey.h
DerivationFramework::TrackParticleThinning::m_SCTDetEleCollKey
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_SCTDetEleCollKey
Definition: TrackParticleThinning.h:72
DerivationFramework::TrackParticleThinning::m_npass_trt_states
std::atomic< unsigned int > m_npass_trt_states
Definition: TrackParticleThinning.h:64
DerivationFramework::TrackParticleThinning::TrkState_TRT
@ TrkState_TRT
Definition: TrackParticleThinning.h:83
DerivationFramework::TrackParticleThinning::m_ntot_sct_states
std::atomic< unsigned int > m_ntot_sct_states
Definition: TrackParticleThinning.h:58
DerivationFramework::TrackParticleThinning::~TrackParticleThinning
virtual ~TrackParticleThinning()
DerivationFramework::TrackParticleThinning::m_measurementsSctSGKey
SG::ThinningHandleKey< xAOD::TrackMeasurementValidationContainer > m_measurementsSctSGKey
Definition: TrackParticleThinning.h:63
SiDetectorElementCollection.h
TrackStateValidationContainer.h
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection >
DerivationFramework::TrackParticleThinning::MeasurementType
MeasurementType
Definition: TrackParticleThinning.h:79
DerivationFramework::TrackParticleThinning::TrkState_Pixel
@ TrkState_Pixel
Definition: TrackParticleThinning.h:81
DerivationFramework::TrackParticleThinning::m_statesPixSGKey
SG::ThinningHandleKey< xAOD::TrackStateValidationContainer > m_statesPixSGKey
Definition: TrackParticleThinning.h:54
ThinningHandleKey.h
HandleKey object for adding thinning to an object.
DerivationFramework::TrackParticleThinning
Definition: TrackParticleThinning.h:32
DerivationFramework::TrackParticleThinning::m_ntot_pix_states
std::atomic< unsigned int > m_ntot_pix_states
Definition: TrackParticleThinning.h:52
TrackMeasurementValidationContainer.h
DerivationFramework::TrackParticleThinning::m_ntot
std::atomic< unsigned int > m_ntot
Definition: TrackParticleThinning.h:45
DerivationFramework::TrackParticleThinning::TrkState_Pseudo
@ TrkState_Pseudo
Definition: TrackParticleThinning.h:84
DerivationFramework::TrackParticleThinning::doThinning
virtual StatusCode doThinning() const override
Definition: TrackParticleThinning.cxx:119
TrackParticleContainer.h
DerivationFramework::TrackParticleThinning::m_measurementsTrtSGKey
SG::ThinningHandleKey< xAOD::TrackMeasurementValidationContainer > m_measurementsTrtSGKey
Definition: TrackParticleThinning.h:69