ATLAS Offline Software
TRTStrawEfficiency.h
Go to the documentation of this file.
1 // this is c++ file -*- c++ -*-
2 /*
3  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
4 */
5 
6 // TRTStrawEfficiency.h
7 // author: Ryan D. Reece <ryan.reece@cern.ch>
8 // created: Nov 2009
9 
10 #ifndef TRT_TrackHoleSearch_TRTStrawEfficiency_h
11 #define TRT_TrackHoleSearch_TRTStrawEfficiency_h
12 
14 #include "GaudiKernel/ToolHandle.h"
15 #include "GaudiKernel/ServiceHandle.h"
16 #include "GaudiKernel/ITHistSvc.h"
20 
24 
26 
27 #include "CLHEP/Units/SystemOfUnits.h"
28 
29 #include <string>
30 #include <vector>
31 
32 namespace Trk
33 {
34  class ITrackHoleSearchTool;
35  class TrackStateOnSurface;
36 }
37 
38 class TRT_ID;
39 
40 class TTree;
41 
43 {
44  public:
45  TRTStrawEfficiency(const std::string& name, ISvcLocator* pSvcLocator);
46 
50 
51  private:
52  // configurables
53  //----------------------------------
54  ToolHandle<Trk::ITrackHoleSearchTool> m_trt_hole_finder
55  {this, "trt_hole_finder","TRTTrackHoleSearchTool"};
56  FloatProperty m_max_abs_d0{this, "max_abs_d0", 600*CLHEP::mm};
57  FloatProperty m_max_abs_z0{this, "max_abs_z0", 600*CLHEP::mm};
58  FloatProperty m_min_pT{this, "min_pT", 1.0*CLHEP::GeV};
59  FloatProperty m_min_p{this, "min_p", 2.0*CLHEP::GeV};
60  FloatProperty m_max_abs_eta{this, "max_abs_eta", 2.5};
61  IntegerProperty m_min_pixel_hits{this, "min_pixel_hits", 0};
62  IntegerProperty m_min_sct_hits{this, "min_sct_hits", 2};
63  IntegerProperty m_min_trt_hits{this, "min_trt_hits", 15};
64  ServiceHandle<ITHistSvc> m_hist_svc{this, "hist_svc", "THistSvc"};
66  {this, "straw_neighbour_svc", "TRT_StrawNeighbourSvc"};
67  StringProperty m_tree_name{this, "tree_name", "trt_eff"};
68  StringProperty m_stream_name{this, "stream_name", "TRTEffStream"};
69  StringProperty m_required_trigger{this, "required_trigger", ""};
70 
71  // private data
72  //----------------------------------
73  TTree* m_tree{nullptr};
74  const TRT_ID* m_TRT_ID{nullptr};
75  PublicToolHandle<Trk::IUpdator> m_updator
76  {this,"KalmanUpdator","Trk::KalmanUpdator/TrkKalmanUpdator",""};
77  PublicToolHandle<Trig::ITrigDecisionTool> m_trigDec
78  {this,"ITrigDecisionTool","Trig::ITrigDecisionTool/TrigDecisionTool",""};
79 
80  // Data handles
81  SG::ReadHandleKey<TrackCollection> m_tracksKey{this, "track_collection", "CombinedInDetTracks", "Tracks container key"};
82  SG::ReadHandleKey<xAOD::EventInfo> m_eventInfoKey{this, "event_info_key", "EventInfo", "Event info key"};
83  SG::ReadHandleKey<xAOD::VertexContainer> m_vertexContainerKey{this, "VertexContainerName", "PrimaryVertices", "Vertex container key"};
84 
85  unsigned int m_num_events{0};
86  unsigned int m_num_tracks{0};
87  unsigned int m_num_preselected_tracks{0};
88 
89  // ntuple branches
90  unsigned int m_event_number{0};
91  unsigned int m_run_number{0};
92  unsigned int m_lumi_block{0};
93  float m_track_pt{0.};
94  float m_track_eta{0.};
95  float m_track_phi{0.};
96  float m_track_d0{0.};
97  float m_track_z0{0.};
99  int m_n_sct_hits{0};
100  int m_n_trt_hits{0};
101  std::vector<int> m_hit_bec;
102  std::vector<int> m_hit_phi;
103  std::vector<int> m_hit_layer;
104  std::vector<int> m_hit_strawlayer;
105  std::vector<int> m_hit_straw;
106  std::vector<int> m_hit_chip;
107  std::vector<int> m_hit_pad;
108  std::vector<float> m_hit_x;
109  std::vector<float> m_hit_y;
110  std::vector<float> m_hit_z;
111  std::vector<float> m_hit_center_x;
112  std::vector<float> m_hit_center_y;
113  std::vector<float> m_hit_center_z;
114  std::vector<float> m_hit_R;
115  std::vector<float> m_hit_locR;
116  std::vector<int> m_hit_HL;
117  std::vector<int> m_hit_det;
118  std::vector<float> m_hit_ub_locR;
119  std::vector<float> m_hit_ub_x;
120  std::vector<float> m_hit_ub_y;
121  std::vector<float> m_hit_ub_z;
125  std::vector<int> m_hole_bec;
126  std::vector<int> m_hole_phi;
127  std::vector<int> m_hole_layer;
128  std::vector<int> m_hole_strawlayer;
129  std::vector<int> m_hole_straw;
130  std::vector<int> m_hole_chip;
131  std::vector<int> m_hole_pad;
132  std::vector<float> m_hole_x;
133  std::vector<float> m_hole_y;
134  std::vector<float> m_hole_z;
135  std::vector<float> m_hole_center_x;
136  std::vector<float> m_hole_center_y;
137  std::vector<float> m_hole_center_z;
138  std::vector<float> m_hole_locR;
139  std::vector<float> m_hole_locR_error;
140  std::vector<int> m_hole_det;
141 
142  //---- branches added by dan -------
143  std::vector<int> m_hit_tube_hit;
146 
147  // private methods
148  //----------------------------------
149  void make_branches();
150  void clear_branches();
151  int fill_hit_data(const Trk::TrackStateOnSurface& hit);
153 };
154 
155 #endif // TRT_TrackHoleSearch_TRTStrawEfficiency_h
TRTStrawEfficiency::m_track_phi
float m_track_phi
Definition: TRTStrawEfficiency.h:95
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
TRTStrawEfficiency::m_updator
PublicToolHandle< Trk::IUpdator > m_updator
Definition: TRTStrawEfficiency.h:76
TRTStrawEfficiency::m_n_sct_hits
int m_n_sct_hits
Definition: TRTStrawEfficiency.h:99
GeV
#define GeV
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:17
TRTStrawEfficiency::m_max_abs_d0
FloatProperty m_max_abs_d0
Definition: TRTStrawEfficiency.h:56
TRTStrawEfficiency::m_hole_pad
std::vector< int > m_hole_pad
Definition: TRTStrawEfficiency.h:131
TRTStrawEfficiency::m_hit_center_x
std::vector< float > m_hit_center_x
Definition: TRTStrawEfficiency.h:111
TRTStrawEfficiency::m_hit_ub_z
std::vector< float > m_hit_ub_z
Definition: TRTStrawEfficiency.h:121
TRTStrawEfficiency::m_tree_name
StringProperty m_tree_name
Definition: TRTStrawEfficiency.h:67
TRTStrawEfficiency::m_hit_bec
std::vector< int > m_hit_bec
Definition: TRTStrawEfficiency.h:101
TRTStrawEfficiency::m_n_pixel_holes
int m_n_pixel_holes
Definition: TRTStrawEfficiency.h:122
TRTStrawEfficiency::m_hole_z
std::vector< float > m_hole_z
Definition: TRTStrawEfficiency.h:134
TRTStrawEfficiency::m_hist_svc
ServiceHandle< ITHistSvc > m_hist_svc
Definition: TRTStrawEfficiency.h:64
TRTStrawEfficiency::m_hit_phi
std::vector< int > m_hit_phi
Definition: TRTStrawEfficiency.h:102
TRTStrawEfficiency::m_min_pT
FloatProperty m_min_pT
Definition: TRTStrawEfficiency.h:58
TRTStrawEfficiency::m_num_preselected_tracks
unsigned int m_num_preselected_tracks
Definition: TRTStrawEfficiency.h:87
TRTStrawEfficiency::m_hit_layer
std::vector< int > m_hit_layer
Definition: TRTStrawEfficiency.h:103
TRTStrawEfficiency::m_hit_chip
std::vector< int > m_hit_chip
Definition: TRTStrawEfficiency.h:106
TRTStrawEfficiency::m_event_number
unsigned int m_event_number
Definition: TRTStrawEfficiency.h:90
TRTStrawEfficiency::make_branches
void make_branches()
Definition: TRTStrawEfficiency.cxx:270
TRTStrawEfficiency
Definition: TRTStrawEfficiency.h:43
TRTStrawEfficiency::initialize
StatusCode initialize()
Definition: TRTStrawEfficiency.cxx:38
TRTStrawEfficiency::m_n_pixel_hits
int m_n_pixel_hits
Definition: TRTStrawEfficiency.h:98
TRTStrawEfficiency::m_track_d0
float m_track_d0
Definition: TRTStrawEfficiency.h:96
TRTStrawEfficiency::m_min_pixel_hits
IntegerProperty m_min_pixel_hits
Definition: TRTStrawEfficiency.h:61
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
TRTStrawEfficiency::m_hole_chip
std::vector< int > m_hole_chip
Definition: TRTStrawEfficiency.h:130
TRTStrawEfficiency::m_trigDec
PublicToolHandle< Trig::ITrigDecisionTool > m_trigDec
Definition: TRTStrawEfficiency.h:78
TRTStrawEfficiency::m_TRTStrawNeighbourSvc
ServiceHandle< ITRT_StrawNeighbourSvc > m_TRTStrawNeighbourSvc
Definition: TRTStrawEfficiency.h:66
TRTStrawEfficiency::m_TRT_ID
const TRT_ID * m_TRT_ID
Definition: TRTStrawEfficiency.h:74
TRTStrawEfficiency::m_n_trt_hits
int m_n_trt_hits
Definition: TRTStrawEfficiency.h:100
TRTStrawEfficiency::m_hole_straw
std::vector< int > m_hole_straw
Definition: TRTStrawEfficiency.h:129
TRTStrawEfficiency::m_hole_det
std::vector< int > m_hole_det
Definition: TRTStrawEfficiency.h:140
TRTStrawEfficiency::m_hole_locR
std::vector< float > m_hole_locR
Definition: TRTStrawEfficiency.h:138
IUpdator.h
TRTStrawEfficiency::execute
StatusCode execute()
Definition: TRTStrawEfficiency.cxx:81
TRTStrawEfficiency::m_hit_locR
std::vector< float > m_hit_locR
Definition: TRTStrawEfficiency.h:115
TRTStrawEfficiency::m_hit_HL
std::vector< int > m_hit_HL
Definition: TRTStrawEfficiency.h:116
TRTStrawEfficiency::m_n_primary_vertex
int m_n_primary_vertex
Definition: TRTStrawEfficiency.h:144
TRTStrawEfficiency::m_hole_center_x
std::vector< float > m_hole_center_x
Definition: TRTStrawEfficiency.h:135
TRTStrawEfficiency::m_hit_center_y
std::vector< float > m_hit_center_y
Definition: TRTStrawEfficiency.h:112
TRTStrawEfficiency::m_min_trt_hits
IntegerProperty m_min_trt_hits
Definition: TRTStrawEfficiency.h:63
TRTStrawEfficiency::m_vertexContainerKey
SG::ReadHandleKey< xAOD::VertexContainer > m_vertexContainerKey
Definition: TRTStrawEfficiency.h:83
TRTStrawEfficiency::m_hit_R
std::vector< float > m_hit_R
Definition: TRTStrawEfficiency.h:114
TRTStrawEfficiency::m_tree
TTree * m_tree
Definition: TRTStrawEfficiency.h:73
AthAlgorithm.h
TRTStrawEfficiency::m_hole_layer
std::vector< int > m_hole_layer
Definition: TRTStrawEfficiency.h:127
TRTStrawEfficiency::m_track_pt
float m_track_pt
Definition: TRTStrawEfficiency.h:93
TRTStrawEfficiency::m_hole_center_y
std::vector< float > m_hole_center_y
Definition: TRTStrawEfficiency.h:136
TRTStrawEfficiency::m_hole_y
std::vector< float > m_hole_y
Definition: TRTStrawEfficiency.h:133
TRTStrawEfficiency::m_hit_ub_locR
std::vector< float > m_hit_ub_locR
Definition: TRTStrawEfficiency.h:118
TRTStrawEfficiency::m_stream_name
StringProperty m_stream_name
Definition: TRTStrawEfficiency.h:68
TRTStrawEfficiency::m_hit_pad
std::vector< int > m_hit_pad
Definition: TRTStrawEfficiency.h:107
TRTStrawEfficiency::m_trt_hole_finder
ToolHandle< Trk::ITrackHoleSearchTool > m_trt_hole_finder
Definition: TRTStrawEfficiency.h:55
TRTStrawEfficiency::m_num_tracks
unsigned int m_num_tracks
Definition: TRTStrawEfficiency.h:86
ITrigDecisionTool.h
TRTStrawEfficiency::m_n_sct_holes
int m_n_sct_holes
Definition: TRTStrawEfficiency.h:123
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
TRTStrawEfficiency::m_hit_center_z
std::vector< float > m_hit_center_z
Definition: TRTStrawEfficiency.h:113
TRTStrawEfficiency::m_hit_x
std::vector< float > m_hit_x
Definition: TRTStrawEfficiency.h:108
TRTStrawEfficiency::m_hole_x
std::vector< float > m_hole_x
Definition: TRTStrawEfficiency.h:132
TRTStrawEfficiency::m_eventInfoKey
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
Definition: TRTStrawEfficiency.h:82
TrackCollection.h
TRTStrawEfficiency::m_min_p
FloatProperty m_min_p
Definition: TRTStrawEfficiency.h:59
TRTStrawEfficiency::m_hit_strawlayer
std::vector< int > m_hit_strawlayer
Definition: TRTStrawEfficiency.h:104
TRTStrawEfficiency::m_tracksKey
SG::ReadHandleKey< TrackCollection > m_tracksKey
Definition: TRTStrawEfficiency.h:81
TRTStrawEfficiency::m_max_abs_eta
FloatProperty m_max_abs_eta
Definition: TRTStrawEfficiency.h:60
AthAlgorithm
Definition: AthAlgorithm.h:47
TRTStrawEfficiency::fill_hit_data
int fill_hit_data(const Trk::TrackStateOnSurface &hit)
Definition: TRTStrawEfficiency.cxx:392
TRTStrawEfficiency::m_track_z0
float m_track_z0
Definition: TRTStrawEfficiency.h:97
TRTStrawEfficiency::m_max_abs_z0
FloatProperty m_max_abs_z0
Definition: TRTStrawEfficiency.h:57
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Trk::TrackStateOnSurface
represents the track state (measurement, material, fit parameters and quality) at a surface.
Definition: TrackStateOnSurface.h:71
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
TRTStrawEfficiency::m_hit_tube_hit
std::vector< int > m_hit_tube_hit
Definition: TRTStrawEfficiency.h:143
TRTStrawEfficiency::fill_hole_data
int fill_hole_data(const Trk::TrackStateOnSurface &hole)
Definition: TRTStrawEfficiency.cxx:483
TRTStrawEfficiency::m_hole_phi
std::vector< int > m_hole_phi
Definition: TRTStrawEfficiency.h:126
TRTStrawEfficiency::m_n_tube_hits
int m_n_tube_hits
Definition: TRTStrawEfficiency.h:145
EventInfo.h
ITRT_StrawNeighbourSvc.h
Abstract interface to information on straws electronic grouping.
python.SystemOfUnits.mm
int mm
Definition: SystemOfUnits.py:83
TRTStrawEfficiency::m_run_number
unsigned int m_run_number
Definition: TRTStrawEfficiency.h:91
TRT_ID
Definition: TRT_ID.h:84
TRTStrawEfficiency::m_hit_det
std::vector< int > m_hit_det
Definition: TRTStrawEfficiency.h:117
VertexContainer.h
TRTStrawEfficiency::m_hit_ub_x
std::vector< float > m_hit_ub_x
Definition: TRTStrawEfficiency.h:119
TRTStrawEfficiency::m_n_trt_holes
int m_n_trt_holes
Definition: TRTStrawEfficiency.h:124
TRTStrawEfficiency::m_required_trigger
StringProperty m_required_trigger
Definition: TRTStrawEfficiency.h:69
TRTStrawEfficiency::m_hit_ub_y
std::vector< float > m_hit_ub_y
Definition: TRTStrawEfficiency.h:120
TRTStrawEfficiency::m_hole_bec
std::vector< int > m_hole_bec
Definition: TRTStrawEfficiency.h:125
TRTStrawEfficiency::m_hole_center_z
std::vector< float > m_hole_center_z
Definition: TRTStrawEfficiency.h:137
TRTStrawEfficiency::m_lumi_block
unsigned int m_lumi_block
Definition: TRTStrawEfficiency.h:92
Trk::hole
@ hole
Definition: MeasurementType.h:36
TRTStrawEfficiency::m_hole_strawlayer
std::vector< int > m_hole_strawlayer
Definition: TRTStrawEfficiency.h:128
TRTStrawEfficiency::TRTStrawEfficiency
TRTStrawEfficiency(const std::string &name, ISvcLocator *pSvcLocator)
Definition: TRTStrawEfficiency.cxx:34
TRTStrawEfficiency::m_num_events
unsigned int m_num_events
Definition: TRTStrawEfficiency.h:85
TRTStrawEfficiency::clear_branches
void clear_branches()
Definition: TRTStrawEfficiency.cxx:332
TRTStrawEfficiency::m_hole_locR_error
std::vector< float > m_hole_locR_error
Definition: TRTStrawEfficiency.h:139
TRTStrawEfficiency::m_min_sct_hits
IntegerProperty m_min_sct_hits
Definition: TRTStrawEfficiency.h:62
TRTStrawEfficiency::m_track_eta
float m_track_eta
Definition: TRTStrawEfficiency.h:94
TRTStrawEfficiency::finalize
StatusCode finalize()
Definition: TRTStrawEfficiency.cxx:252
TRTStrawEfficiency::m_hit_z
std::vector< float > m_hit_z
Definition: TRTStrawEfficiency.h:110
TRTStrawEfficiency::m_hit_straw
std::vector< int > m_hit_straw
Definition: TRTStrawEfficiency.h:105
ServiceHandle< ITHistSvc >
TRTStrawEfficiency::m_hit_y
std::vector< float > m_hit_y
Definition: TRTStrawEfficiency.h:109