ATLAS Offline Software
TrackClusterAssValidation.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 
6 #ifndef TrackClusterAssValidation_H
7 #define TrackClusterAssValidation_H
8 
21 #include <string>
22 #include <map>
23 
24 namespace InDet {
25 
26  // Class-algorithm for track cluster association validation
27  //
29  {
30 
32  // Public methods:
34 
35  public:
36 
38  // Standard Algotithm methods
40 
41  TrackClusterAssValidation(const std::string &name, ISvcLocator *pSvcLocator);
44  StatusCode execute(const EventContext& ctx) const;
46 
47  protected:
48 
50  // Protected data
52 
53  bool m_usePIX{} ;
54  bool m_useSCT{} ;
55  bool m_useTRT{} ;
56  bool m_useOutliers{} ;
57  int m_pdg{} ;
58 
60  mutable std::vector<TrackCollectionStat_t> m_trackCollectionStat ATLAS_THREAD_SAFE; // Guarded by m_statMutex
61  mutable EventStat_t m_eventStat ATLAS_THREAD_SAFE; // Guarded by m_statMutex
62 
63  unsigned int m_clcut{} ;
64  unsigned int m_clcutTRT{} ;
65  unsigned int m_spcut{} ;
66  double m_ptcut{} ;
67  double m_ptcutmax{} ;
68  double m_rapcut{} ;
69  double m_tcut{} ;
70  double m_rmin{} ;
71  double m_rmax{} ;
82  // For P->T converter of PixelClusters
83  SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> m_pixelDetEleCollKey{this, "PixelDetEleCollKey", "PixelDetectorElementCollection", "Key of SiDetectorElementCollection for Pixel"};
84  // For P->T converter of SCT_Clusters
85  SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> m_SCTDetEleCollKey{this, "SCTDetEleCollKey", "SCT_DetectorElementCollection", "Key of SiDetectorElementCollection for SCT"};
86 
87  struct EventData_t {
88  public:
89 
90  EventData_t(unsigned int n_collections)
91  : m_nspacepoints(0),
92  m_nclusters(0),
93  m_nqtracks(0),
94  m_nclustersTRT(0),
95  m_truthPIX{},
96  m_truthSCT{},
97  m_truthTRT{}
98  {
99  m_particles.resize(n_collections);
100  m_difference.resize(n_collections);
101  m_tracks.resize(n_collections);
102  m_trackCollectionStat.resize(n_collections);
103  }
104 
106  int m_nclusters{} ;
107  int m_nqtracks{} ;
109 
110  std::vector<std::unique_ptr<SG::VarHandleBase> > m_clusterHandles;
111  std::vector<SG::ReadHandle<TrackCollection> > m_trackcontainer;
112  std::vector<SG::ReadHandle<SpacePointContainer> > m_spacePointContainer;
113  std::unique_ptr<SG::ReadHandle<SpacePointOverlapCollection> > m_spacepointsOverlap;
117  std::multimap<int,const Trk::PrepRawData*> m_kinecluster ;
118  std::multimap<int,const Trk::PrepRawData*> m_kineclusterTRT ;
119  std::multimap<int,const Trk::SpacePoint*> m_kinespacepoint ;
120  std::vector<std::list<PartPropCache> > m_particles ;
121  std::vector<std::list<int> > m_difference ;
122  std::vector<std::multimap<int,int> > m_tracks ;
123  std::vector<TrackCollectionStat_t> m_trackCollectionStat;
125  };
126 
128  // Protected methods
130 
131  void newSpacePointsEvent (const EventContext& ctx, InDet::TrackClusterAssValidation::EventData_t &event_data) const;
132  void newClustersEvent (const EventContext& ctx, InDet::TrackClusterAssValidation::EventData_t &event_data) const;
133  void tracksComparison (const EventContext& ctx, InDet::TrackClusterAssValidation::EventData_t &event_data) const;
136 
138  int kine(const InDet::TrackClusterAssValidation::EventData_t &event_data,const Trk::PrepRawData*,const Trk::PrepRawData*,int*,int) const;
139  int kine (const InDet::TrackClusterAssValidation::EventData_t &event_data,const Trk::PrepRawData*,int*,int) const;
140  static int kine0(const InDet::TrackClusterAssValidation::EventData_t &event_data,const Trk::PrepRawData*,int*,int) ;
142  static bool isTheSameDetElement(const InDet::TrackClusterAssValidation::EventData_t &event_data, int,const Trk::PrepRawData*) ;
143  static bool isTheSameDetElement(const InDet::TrackClusterAssValidation::EventData_t &event_data,int,const Trk::SpacePoint* ) ;
144 
145  static PRD_MultiTruthCollection::const_iterator findTruth
146  (const InDet::TrackClusterAssValidation::EventData_t &event_data,const Trk::PrepRawData*,PRD_MultiTruthCollection::const_iterator&) ;
147 
148  int charge(const InDet::TrackClusterAssValidation::EventData_t &event_data,std::pair<int,const Trk::PrepRawData*>,int&) const;
149 
150  MsgStream& dumptools(MsgStream& out, MSG::Level level) const;
151  static MsgStream& dumpevent(MsgStream& out, const InDet::TrackClusterAssValidation::EventData_t &event_data) ;
152 
153  };
154 
155 }
156 #endif // TrackClusterAssValidation_H
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
Trk::SpacePoint
Definition: Tracking/TrkEvent/TrkSpacePoint/TrkSpacePoint/SpacePoint.h:35
InDet::TrackClusterAssValidation::m_clcutTRT
unsigned int m_clcutTRT
Definition: TrackClusterAssValidation.h:64
InDet::TrackClusterAssValidation::m_useTRT
bool m_useTRT
Definition: TrackClusterAssValidation.h:55
InDet::TrackClusterAssValidation::initialize
StatusCode initialize()
Definition: TrackClusterAssValidation.cxx:84
InDet::TrackClusterAssValidation::m_spacepointsOverlapname
SG::ReadHandleKey< SpacePointOverlapCollection > m_spacepointsOverlapname
Definition: TrackClusterAssValidation.h:75
InDet::TrackClusterAssValidation::EventData_t::m_nqtracks
int m_nqtracks
Definition: TrackClusterAssValidation.h:107
InDet::TrackClusterAssValidation::EventData_t::EventData_t
EventData_t(unsigned int n_collections)
Definition: TrackClusterAssValidation.h:90
InDet::TrackClusterAssValidation::m_useOutliers
bool m_useOutliers
Definition: TrackClusterAssValidation.h:56
BeamSpot::mutex
std::mutex mutex
Definition: InDetBeamSpotVertex.cxx:18
InDet::TrackClusterAssValidation
Definition: TrackClusterAssValidation.h:29
InDet::TrackClusterAssValidation::EventData_t::m_nclusters
int m_nclusters
Definition: TrackClusterAssValidation.h:106
InDet
Primary Vertex Finder.
Definition: VP1ErrorUtils.h:36
PRD_MultiTruthCollection
A PRD is mapped onto all contributing particles.
Definition: PRD_MultiTruthCollection.h:24
InDet::TrackClusterAssValidation::EventData_t::m_particles
std::vector< std::list< PartPropCache > > m_particles
Definition: TrackClusterAssValidation.h:120
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
InDet::TrackClusterAssValidation::charge
int charge(const InDet::TrackClusterAssValidation::EventData_t &event_data, std::pair< int, const Trk::PrepRawData * >, int &) const
Definition: TrackClusterAssValidation.cxx:1497
SG::HandleKeyArray
Definition: StoreGate/StoreGate/HandleKeyArray.h:38
InDet::TrackClusterAssValidation::m_truth_locationSCT
SG::ReadHandleKey< PRD_MultiTruthCollection > m_truth_locationSCT
Definition: TrackClusterAssValidation.h:80
InDet::TrackClusterAssValidation::newSpacePointsEvent
void newSpacePointsEvent(const EventContext &ctx, InDet::TrackClusterAssValidation::EventData_t &event_data) const
Definition: TrackClusterAssValidation.cxx:859
InDet::TrackClusterAssValidation::m_clustersPixelname
SG::ReadHandleKey< SiClusterContainer > m_clustersPixelname
Definition: TrackClusterAssValidation.h:77
SG::ReadHandleKey< SpacePointContainer >
InDet::TrackClusterAssValidation::m_statMutex
std::mutex m_statMutex
Definition: TrackClusterAssValidation.h:59
InDet::TrackClusterAssValidation::m_spacepointsSCTname
SG::ReadHandleKey< SpacePointContainer > m_spacepointsSCTname
Definition: TrackClusterAssValidation.h:73
InDet::TrackClusterAssValidation::EventData_t::m_kineclusterTRT
std::multimap< int, const Trk::PrepRawData * > m_kineclusterTRT
Definition: TrackClusterAssValidation.h:118
InDet::TrackClusterAssValidation::EventData_t::m_tracks
std::vector< std::multimap< int, int > > m_tracks
Definition: TrackClusterAssValidation.h:122
SpacePointContainer.h
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
InDet::TrackClusterAssValidation::kine
int kine(const InDet::TrackClusterAssValidation::EventData_t &event_data, const Trk::PrepRawData *, const Trk::PrepRawData *, int *, int) const
Definition: TrackClusterAssValidation.cxx:1220
InDet::TrackClusterAssValidation::EventData_t::m_truthPIX
const PRD_MultiTruthCollection * m_truthPIX
Definition: TrackClusterAssValidation.h:114
InDet::TrackClusterAssValidation::EventData_t::m_nspacepoints
int m_nspacepoints
Definition: TrackClusterAssValidation.h:105
InDet::TrackClusterAssValidation::m_clcut
unsigned int m_clcut
Definition: TrackClusterAssValidation.h:63
InDet::TrackClusterAssValidation::m_spcut
unsigned int m_spcut
Definition: TrackClusterAssValidation.h:65
TrigConf::MSGTC::Level
Level
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:21
InDet::TrackClusterAssValidation::m_SCTDetEleCollKey
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_SCTDetEleCollKey
Definition: TrackClusterAssValidation.h:85
InDet::TrackClusterAssValidation::kine0
static int kine0(const InDet::TrackClusterAssValidation::EventData_t &event_data, const Trk::PrepRawData *, int *, int)
Definition: TrackClusterAssValidation.cxx:1292
InDet::TrackClusterAssValidation::m_truth_locationTRT
SG::ReadHandleKey< PRD_MultiTruthCollection > m_truth_locationTRT
Definition: TrackClusterAssValidation.h:81
InDet::TrackClusterAssValidation::m_truth_locationPixel
SG::ReadHandleKey< PRD_MultiTruthCollection > m_truth_locationPixel
Definition: TrackClusterAssValidation.h:79
InDet::TrackClusterAssValidation::noReconstructedParticles
bool noReconstructedParticles(const InDet::TrackClusterAssValidation::EventData_t &event_data) const
Definition: TrackClusterAssValidation.cxx:1385
InDet::TrackClusterAssValidation::EventData_t::m_trackCollectionStat
std::vector< TrackCollectionStat_t > m_trackCollectionStat
Definition: TrackClusterAssValidation.h:123
InDet::TrackClusterAssValidation::dumptools
MsgStream & dumptools(MsgStream &out, MSG::Level level) const
Definition: TrackClusterAssValidation.cxx:646
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
InDet::TrackClusterAssValidation::~TrackClusterAssValidation
virtual ~TrackClusterAssValidation()
TrackClusterAssValidationUtils.h
InDet::TrackClusterAssValidation::m_useSCT
bool m_useSCT
Definition: TrackClusterAssValidation.h:54
TrackCollection.h
InDet::TrackClusterAssValidation::m_spacepointsPixelname
SG::ReadHandleKey< SpacePointContainer > m_spacepointsPixelname
Definition: TrackClusterAssValidation.h:74
SpacePointOverlapCollection.h
InDet::TrackClusterAssValidation::EventData_t::m_eventStat
EventStat_t m_eventStat
Definition: TrackClusterAssValidation.h:124
InDet::TrackClusterAssValidation::EventData_t::m_clusterHandles
std::vector< std::unique_ptr< SG::VarHandleBase > > m_clusterHandles
Definition: TrackClusterAssValidation.h:110
InDet::TrackClusterAssValidation::m_pdg
int m_pdg
Definition: TrackClusterAssValidation.h:57
InDet::TrackClusterAssValidation::isTruth
static bool isTruth(const InDet::TrackClusterAssValidation::EventData_t &, const Trk::PrepRawData *)
Definition: TrackClusterAssValidation.cxx:1316
InDet::TrackClusterAssValidation::EventData_t::m_truthSCT
const PRD_MultiTruthCollection * m_truthSCT
Definition: TrackClusterAssValidation.h:115
InDet::TrackClusterAssValidation::m_ptcutmax
double m_ptcutmax
Definition: TrackClusterAssValidation.h:67
InDet::TrackClusterAssValidation::EventData_t::m_difference
std::vector< std::list< int > > m_difference
Definition: TrackClusterAssValidation.h:121
InDet::TrackClusterAssValidation::findTruth
static PRD_MultiTruthCollection::const_iterator findTruth(const InDet::TrackClusterAssValidation::EventData_t &event_data, const Trk::PrepRawData *, PRD_MultiTruthCollection::const_iterator &)
Definition: TrackClusterAssValidation.cxx:1467
InDet::TrackClusterAssValidation::tracksComparison
void tracksComparison(const EventContext &ctx, InDet::TrackClusterAssValidation::EventData_t &event_data) const
Definition: TrackClusterAssValidation.cxx:1061
ReadCondHandleKey.h
AthReentrantAlgorithm.h
Trk::PrepRawData
Definition: PrepRawData.h:62
InDet::TrackClusterAssValidation::m_tracklocation
SG::ReadHandleKeyArray< TrackCollection > m_tracklocation
Definition: TrackClusterAssValidation.h:72
TRT_DriftCircleContainer.h
InDet::TrackClusterAssValidation::EventData_t::m_trackcontainer
std::vector< SG::ReadHandle< TrackCollection > > m_trackcontainer
Definition: TrackClusterAssValidation.h:111
InDet::TrackClusterAssValidation::EventData_t::m_truthTRT
const PRD_MultiTruthCollection * m_truthTRT
Definition: TrackClusterAssValidation.h:116
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
InDet::TrackClusterAssValidation::m_tcut
double m_tcut
Definition: TrackClusterAssValidation.h:69
InDet::TrackClusterAssValidation::EventData_t
Definition: TrackClusterAssValidation.h:87
InDet::TrackClusterAssValidation::m_clustersTRTname
SG::ReadHandleKey< TRT_DriftCircleContainer > m_clustersTRTname
Definition: TrackClusterAssValidation.h:78
SiDetectorElementCollection.h
InDet::TrackClusterAssValidation::TrackClusterAssValidation
TrackClusterAssValidation(const std::string &name, ISvcLocator *pSvcLocator)
Definition: TrackClusterAssValidation.cxx:22
InDet::TrackClusterAssValidation::m_pixelDetEleCollKey
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_pixelDetEleCollKey
Definition: TrackClusterAssValidation.h:83
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection >
InDet::TrackClusterAssValidation::efficiencyReconstruction
void efficiencyReconstruction(InDet::TrackClusterAssValidation::EventData_t &event_data) const
Definition: TrackClusterAssValidation.cxx:1172
SiClusterContainer.h
InDet::TrackClusterAssValidation::isTheSameDetElement
static bool isTheSameDetElement(const InDet::TrackClusterAssValidation::EventData_t &event_data, int, const Trk::PrepRawData *)
Definition: TrackClusterAssValidation.cxx:1328
InDet::TrackClusterAssValidation::m_rapcut
double m_rapcut
Definition: TrackClusterAssValidation.h:68
InDet::EventStat_t
Definition: TrackClusterAssValidationUtils.h:96
InDet::TrackClusterAssValidation::finalize
StatusCode finalize()
Definition: TrackClusterAssValidation.cxx:210
InDet::TrackClusterAssValidation::ATLAS_THREAD_SAFE
std::vector< TrackCollectionStat_t > m_trackCollectionStat ATLAS_THREAD_SAFE
Definition: TrackClusterAssValidation.h:60
InDet::TrackClusterAssValidation::EventData_t::m_nclustersTRT
int m_nclustersTRT
Definition: TrackClusterAssValidation.h:108
InDet::TrackClusterAssValidation::m_usePIX
bool m_usePIX
Definition: TrackClusterAssValidation.h:53
InDet::TrackClusterAssValidation::ATLAS_THREAD_SAFE
EventStat_t m_eventStat ATLAS_THREAD_SAFE
Definition: TrackClusterAssValidation.h:61
InDet::TrackClusterAssValidation::EventData_t::m_spacepointsOverlap
std::unique_ptr< SG::ReadHandle< SpacePointOverlapCollection > > m_spacepointsOverlap
Definition: TrackClusterAssValidation.h:113
PRD_MultiTruthCollection.h
InDet::TrackClusterAssValidation::qualityTracksSelection
int qualityTracksSelection(InDet::TrackClusterAssValidation::EventData_t &event_data) const
Definition: TrackClusterAssValidation.cxx:948
InDet::TrackClusterAssValidation::execute
StatusCode execute(const EventContext &ctx) const
Definition: TrackClusterAssValidation.cxx:144
InDet::TrackClusterAssValidation::dumpevent
static MsgStream & dumpevent(MsgStream &out, const InDet::TrackClusterAssValidation::EventData_t &event_data)
Definition: TrackClusterAssValidation.cxx:716
InDet::TrackClusterAssValidation::m_rmax
double m_rmax
Definition: TrackClusterAssValidation.h:71
checker_macros.h
Define macros for attributes used to control the static checker.
InDet::TrackClusterAssValidation::EventData_t::m_kinespacepoint
std::multimap< int, const Trk::SpacePoint * > m_kinespacepoint
Definition: TrackClusterAssValidation.h:119
InDet::TrackClusterAssValidation::EventData_t::m_kinecluster
std::multimap< int, const Trk::PrepRawData * > m_kinecluster
Definition: TrackClusterAssValidation.h:117
InDet::TrackClusterAssValidation::m_rmin
double m_rmin
Definition: TrackClusterAssValidation.h:70
InDet::TrackClusterAssValidation::m_ptcut
double m_ptcut
Definition: TrackClusterAssValidation.h:66
InDet::TrackClusterAssValidation::newClustersEvent
void newClustersEvent(const EventContext &ctx, InDet::TrackClusterAssValidation::EventData_t &event_data) const
Definition: TrackClusterAssValidation.cxx:745
InDet::TrackClusterAssValidation::m_clustersSCTname
SG::ReadHandleKey< SiClusterContainer > m_clustersSCTname
Definition: TrackClusterAssValidation.h:76
InDet::TrackClusterAssValidation::EventData_t::m_spacePointContainer
std::vector< SG::ReadHandle< SpacePointContainer > > m_spacePointContainer
Definition: TrackClusterAssValidation.h:112