ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
HistFamily Struct Reference
Collaboration diagram for HistFamily:

Public Member Functions

 HistFamily (const string &)
 
void fill (const xAOD::TrackParticle &, const xAOD::Vertex *)
 
 HistFamily (const HistFamily &)=delete
 
HistFamilyoperator= (const HistFamily &)=delete
 

Private Member Functions

uint8_t getSum (const xAOD::TrackParticle &, xAOD::SummaryType) const
 

Private Attributes

TH2 * h_pt = nullptr
 
TH2 * h_si_hits_phys = nullptr
 
TH2 * h_si_hits = nullptr
 
TH2 * h_si_holes = nullptr
 
TH2 * h_si_shared = nullptr
 
TH2 * h_ibl_hits = nullptr
 
TH2 * h_bl_hits = nullptr
 
TH2 * h_ibl_expected = nullptr
 
TH2 * h_bl_expected = nullptr
 
TH2 * h_pix_hits_phys = nullptr
 
TH2 * h_pix_hits = nullptr
 
TH2 * h_pix_holes = nullptr
 
TH2 * h_pix_shared = nullptr
 
TH2 * h_sct_hits_phys = nullptr
 
TH2 * h_sct_hits = nullptr
 
TH2 * h_sct_holes = nullptr
 
TH2 * h_sct_shared = nullptr
 
TH2 * h_trt_hits = nullptr
 
TH2 * h_trt_outlier_fraction = nullptr
 
TH2 * h_d0 = nullptr
 
TH2 * h_z0sintheta = nullptr
 

Detailed Description

Definition at line 30 of file InDetTrackSelectionToolTester.cxx.

Constructor & Destructor Documentation

◆ HistFamily() [1/2]

HistFamily::HistFamily ( const string &  cut_name)

Definition at line 184 of file InDetTrackSelectionToolTester.cxx.

185 {
186  auto* currentFile = TFile::CurrentFile();
187  currentFile->mkdir(cut_name.data())->cd(); // create a directory for this cut type and cd into it
188 #define HIST_INIT( NAME, AXIS_LABEL, AXIS_N, AXIS_XL, AXIS_XH ) \
189  do{ \
190  h_##NAME = new TH2F(#NAME, #NAME ";#eta;" AXIS_LABEL, 50,-2.5,2.5, \
191  AXIS_N, AXIS_XL, AXIS_XH); \
192  } while (false)
193 
194  HIST_INIT( pt, "p_{T} [GeV]", 100, 0, 20 );
195  HIST_INIT( si_hits_phys, "Si physical hits", 24, 0, 24 );
196  HIST_INIT( si_hits, "Si hits", 24, 0, 24 );
197  HIST_INIT( si_holes, "Si holes", 6, 0, 6 );
198  HIST_INIT( si_shared, "Si shared hits", 6, 0, 6 );
199  HIST_INIT( pix_hits_phys, "Pixel physical hits", 10, 0, 10 );
200  HIST_INIT( pix_hits, "Pixel hits", 10, 0, 10 );
201  HIST_INIT( pix_holes, "Pixel holes", 4, 0, 4 );
202  HIST_INIT( pix_shared, "Pixel shared hits", 4, 0, 4 );
203  HIST_INIT( sct_hits_phys, "SCT physical hits", 16, 0, 16 );
204  HIST_INIT( sct_hits, "SCT hits", 16, 0, 16 );
205  HIST_INIT( sct_holes, "SCT holes", 4, 0, 4 );
206  HIST_INIT( sct_shared, "SCT shared hits", 4, 0, 4 );
207  HIST_INIT( ibl_hits, "IBL hits", 4, 0, 4 );
208  HIST_INIT( ibl_expected, "expect IBL hit", 2, 0, 2 );
209  HIST_INIT( bl_hits, "BLayer hits", 4, 0, 4 );
210  HIST_INIT( bl_expected, "expect BLayer hit", 2, 0, 2 );
211  HIST_INIT( trt_hits, "TRT hits + outliers", 60, 0, 60 );
212  HIST_INIT( trt_outlier_fraction, "TRT outlier fraction", 25, 0., 1. );
213 
214  h_d0 = new TH2F( "d0", "d_{0}^{BL};d_{0}^{BL} [mm];#sigma_{d_{0}} [mm]", 60, -3., 3., 60, 0., 3. );
215  h_z0sintheta = new TH2F( "z0sintheta", "z_{0}^{PV} sin #theta;z_{0}^{PV} sin #theta [mm];#sigma_{z_{0} sin #theta} [mm]", 100, -5., 5., 50, 0., 5. );
216 
217 #undef HIST_INIT
218 
219  currentFile->cd(); // move back to the parent directory
220 }

◆ HistFamily() [2/2]

HistFamily::HistFamily ( const HistFamily )
delete

Member Function Documentation

◆ fill()

void HistFamily::fill ( const xAOD::TrackParticle trk,
const xAOD::Vertex vtx 
)

Definition at line 222 of file InDetTrackSelectionToolTester.cxx.

223 {
224  uint8_t nPixHits = getSum(trk, xAOD::numberOfPixelHits);
226  uint8_t nPixShared = getSum(trk, xAOD::numberOfPixelSharedHits);
227  uint8_t nPixHoles = getSum(trk, xAOD::numberOfPixelHoles);
228  uint8_t nSctHits = getSum(trk, xAOD::numberOfSCTHits);
230  uint8_t nSctShared = getSum(trk, xAOD::numberOfSCTSharedHits);
231  uint8_t nSctHoles = getSum(trk, xAOD::numberOfSCTHoles);
236  uint8_t nTrtHits = getSum(trk, xAOD::numberOfTRTHits);
237  uint8_t nTrtOutliers = getSum(trk, xAOD::numberOfTRTOutliers);
238 
239  double eta = trk.eta();
240  h_pt->Fill(eta, trk.pt()*1e-3);
241  h_ibl_hits->Fill(eta, nIblHits);
242  h_ibl_expected->Fill(eta, expectIbl);
243  h_bl_hits->Fill(eta, nBlHits);
244  h_bl_expected->Fill(eta, expectBl);
245  h_pix_hits_phys->Fill(eta, nPixHits);
246  h_pix_hits->Fill(eta, nPixHits + nPixDead);
247  h_pix_holes->Fill(eta, nPixHoles);
248  h_pix_shared->Fill(eta, nPixShared);
249  h_sct_hits_phys->Fill(eta, nSctHits);
250  h_sct_hits->Fill(eta, nSctHits + nSctDead);
251  h_sct_holes->Fill(eta, nSctHoles);
252  h_sct_shared->Fill(eta, nSctShared);
253  h_si_hits_phys->Fill(eta, nPixHits + nSctHits);
254  h_si_hits->Fill(eta, nPixHits + nPixDead + nSctHits + nSctDead);
255  h_si_holes->Fill(eta, nPixHoles + nSctHoles);
256  h_si_shared->Fill(eta, nPixShared + nSctShared);
257  h_trt_hits->Fill(eta, nTrtHits + nTrtOutliers);
258  h_trt_outlier_fraction->Fill(eta, nTrtOutliers / static_cast<double>(nTrtHits + nTrtOutliers));
259 
260  const auto& covMatrix = trk.definingParametersCovMatrix();
261  h_d0->Fill(trk.d0(), std::sqrt(covMatrix(0,0)) );
262  double z0 = trk.z0();
263  if (vtx != nullptr) {
264  z0 += trk.vz() - vtx->z();
265  }
266  double sinTheta = std::sin(trk.theta());
267  double cosTheta = std::cos(trk.theta());
268  double varZ0SinTheta = 0.;
269  varZ0SinTheta += covMatrix(1,1)*sinTheta*sinTheta;
270  varZ0SinTheta += 2*covMatrix(1,3)*z0*sinTheta*cosTheta;
271  varZ0SinTheta += covMatrix(3,3)*z0*z0*cosTheta*cosTheta;
272  h_z0sintheta->Fill(z0*sinTheta, std::sqrt(varZ0SinTheta));
273 
274  return;
275 }

◆ getSum()

uint8_t HistFamily::getSum ( const xAOD::TrackParticle trk,
xAOD::SummaryType  sum_type 
) const
private

Definition at line 277 of file InDetTrackSelectionToolTester.cxx.

278 {
279  uint8_t sum_val = 0;
280  if (!trk.summaryValue(sum_val, sum_type)) {
281  Error( "HistFamily::getSum()", "Could not get summary type %i", sum_type );
282  }
283  return sum_val;
284 }

◆ operator=()

HistFamily& HistFamily::operator= ( const HistFamily )
delete

Member Data Documentation

◆ h_bl_expected

TH2* HistFamily::h_bl_expected = nullptr
private

Definition at line 46 of file InDetTrackSelectionToolTester.cxx.

◆ h_bl_hits

TH2* HistFamily::h_bl_hits = nullptr
private

Definition at line 44 of file InDetTrackSelectionToolTester.cxx.

◆ h_d0

TH2* HistFamily::h_d0 = nullptr
private

Definition at line 58 of file InDetTrackSelectionToolTester.cxx.

◆ h_ibl_expected

TH2* HistFamily::h_ibl_expected = nullptr
private

Definition at line 45 of file InDetTrackSelectionToolTester.cxx.

◆ h_ibl_hits

TH2* HistFamily::h_ibl_hits = nullptr
private

Definition at line 43 of file InDetTrackSelectionToolTester.cxx.

◆ h_pix_hits

TH2* HistFamily::h_pix_hits = nullptr
private

Definition at line 48 of file InDetTrackSelectionToolTester.cxx.

◆ h_pix_hits_phys

TH2* HistFamily::h_pix_hits_phys = nullptr
private

Definition at line 47 of file InDetTrackSelectionToolTester.cxx.

◆ h_pix_holes

TH2* HistFamily::h_pix_holes = nullptr
private

Definition at line 49 of file InDetTrackSelectionToolTester.cxx.

◆ h_pix_shared

TH2* HistFamily::h_pix_shared = nullptr
private

Definition at line 50 of file InDetTrackSelectionToolTester.cxx.

◆ h_pt

TH2* HistFamily::h_pt = nullptr
private

Definition at line 38 of file InDetTrackSelectionToolTester.cxx.

◆ h_sct_hits

TH2* HistFamily::h_sct_hits = nullptr
private

Definition at line 52 of file InDetTrackSelectionToolTester.cxx.

◆ h_sct_hits_phys

TH2* HistFamily::h_sct_hits_phys = nullptr
private

Definition at line 51 of file InDetTrackSelectionToolTester.cxx.

◆ h_sct_holes

TH2* HistFamily::h_sct_holes = nullptr
private

Definition at line 53 of file InDetTrackSelectionToolTester.cxx.

◆ h_sct_shared

TH2* HistFamily::h_sct_shared = nullptr
private

Definition at line 54 of file InDetTrackSelectionToolTester.cxx.

◆ h_si_hits

TH2* HistFamily::h_si_hits = nullptr
private

Definition at line 40 of file InDetTrackSelectionToolTester.cxx.

◆ h_si_hits_phys

TH2* HistFamily::h_si_hits_phys = nullptr
private

Definition at line 39 of file InDetTrackSelectionToolTester.cxx.

◆ h_si_holes

TH2* HistFamily::h_si_holes = nullptr
private

Definition at line 41 of file InDetTrackSelectionToolTester.cxx.

◆ h_si_shared

TH2* HistFamily::h_si_shared = nullptr
private

Definition at line 42 of file InDetTrackSelectionToolTester.cxx.

◆ h_trt_hits

TH2* HistFamily::h_trt_hits = nullptr
private

Definition at line 55 of file InDetTrackSelectionToolTester.cxx.

◆ h_trt_outlier_fraction

TH2* HistFamily::h_trt_outlier_fraction = nullptr
private

Definition at line 56 of file InDetTrackSelectionToolTester.cxx.

◆ h_z0sintheta

TH2* HistFamily::h_z0sintheta = nullptr
private

Definition at line 59 of file InDetTrackSelectionToolTester.cxx.


The documentation for this struct was generated from the following file:
xAOD::TrackParticle_v1::pt
virtual double pt() const override final
The transverse momentum ( ) of the particle.
Definition: TrackParticle_v1.cxx:73
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
xAOD::numberOfPixelHoles
@ numberOfPixelHoles
number of pixel layers on track with absence of hits [unit8_t].
Definition: TrackingPrimitives.h:261
HistFamily::h_pix_hits
TH2 * h_pix_hits
Definition: InDetTrackSelectionToolTester.cxx:48
HistFamily::h_si_shared
TH2 * h_si_shared
Definition: InDetTrackSelectionToolTester.cxx:42
xAOD::numberOfSCTSharedHits
@ numberOfSCTSharedHits
number of SCT hits shared by several tracks [unit8_t].
Definition: TrackingPrimitives.h:272
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:557
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
HistFamily::h_bl_hits
TH2 * h_bl_hits
Definition: InDetTrackSelectionToolTester.cxx:44
xAOD::TrackParticle_v1::eta
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
Definition: TrackParticle_v1.cxx:77
HistFamily::h_sct_hits
TH2 * h_sct_hits
Definition: InDetTrackSelectionToolTester.cxx:52
xAOD::TrackParticle_v1::summaryValue
bool summaryValue(uint8_t &value, const SummaryType &information) const
Accessor for TrackSummary values.
Definition: TrackParticle_v1.cxx:736
xAOD::TrackParticle_v1::vz
float vz() const
The z origin for the parameters.
test_pyathena.pt
pt
Definition: test_pyathena.py:11
HistFamily::h_ibl_hits
TH2 * h_ibl_hits
Definition: InDetTrackSelectionToolTester.cxx:43
xAOD::TrackParticle_v1::z0
float z0() const
Returns the parameter.
xAOD::numberOfPixelHits
@ numberOfPixelHits
these are the pixel hits, including the b-layer [unit8_t].
Definition: TrackingPrimitives.h:259
xAOD::expectInnermostPixelLayerHit
@ expectInnermostPixelLayerHit
Do we expect a 0th-layer barrel hit for this track?
Definition: TrackingPrimitives.h:236
xAOD::numberOfTRTHits
@ numberOfTRTHits
number of TRT hits [unit8_t].
Definition: TrackingPrimitives.h:275
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
HIST_INIT
#define HIST_INIT(NAME, AXIS_LABEL, AXIS_N, AXIS_XL, AXIS_XH)
python.TrigEgammaMonitorHelper.TH2F
def TH2F(name, title, nxbins, bins_par2, bins_par3, bins_par4, bins_par5=None, bins_par6=None, path='', **kwargs)
Definition: TrigEgammaMonitorHelper.py:45
xAOD::TrackParticle_v1::d0
float d0() const
Returns the parameter.
HistFamily::h_ibl_expected
TH2 * h_ibl_expected
Definition: InDetTrackSelectionToolTester.cxx:45
HistFamily::h_trt_hits
TH2 * h_trt_hits
Definition: InDetTrackSelectionToolTester.cxx:55
HistFamily::h_si_hits_phys
TH2 * h_si_hits_phys
Definition: InDetTrackSelectionToolTester.cxx:39
xAOD::numberOfPixelSharedHits
@ numberOfPixelSharedHits
number of Pixel all-layer hits shared by several tracks [unit8_t].
Definition: TrackingPrimitives.h:262
HistFamily::h_pt
TH2 * h_pt
Definition: InDetTrackSelectionToolTester.cxx:38
xAOD::expectNextToInnermostPixelLayerHit
@ expectNextToInnermostPixelLayerHit
Do we expect a 1st-layer barrel hit for this track?
Definition: TrackingPrimitives.h:247
HistFamily::h_sct_hits_phys
TH2 * h_sct_hits_phys
Definition: InDetTrackSelectionToolTester.cxx:51
HistFamily::h_si_holes
TH2 * h_si_holes
Definition: InDetTrackSelectionToolTester.cxx:41
xAOD::covMatrix
covMatrix
Definition: TrackMeasurement_v1.cxx:19
HistFamily::h_pix_shared
TH2 * h_pix_shared
Definition: InDetTrackSelectionToolTester.cxx:50
HistFamily::h_d0
TH2 * h_d0
Definition: InDetTrackSelectionToolTester.cxx:58
HistFamily::h_z0sintheta
TH2 * h_z0sintheta
Definition: InDetTrackSelectionToolTester.cxx:59
HistFamily::h_trt_outlier_fraction
TH2 * h_trt_outlier_fraction
Definition: InDetTrackSelectionToolTester.cxx:56
xAOD::Vertex_v1::z
float z() const
Returns the z position.
TRT::Track::z0
@ z0
Definition: InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h:63
xAOD::numberOfSCTHoles
@ numberOfSCTHoles
number of SCT holes [unit8_t].
Definition: TrackingPrimitives.h:270
cut_name
const char * cut_name[]
Definition: SUSYToolsTester.cxx:83
xAOD::numberOfNextToInnermostPixelLayerHits
@ numberOfNextToInnermostPixelLayerHits
these are the hits in the 1st pixel barrel layer
Definition: TrackingPrimitives.h:248
HistFamily::h_si_hits
TH2 * h_si_hits
Definition: InDetTrackSelectionToolTester.cxx:40
xAOD::TrackParticle_v1::definingParametersCovMatrix
const ParametersCovMatrix_t definingParametersCovMatrix() const
Returns the 5x5 symmetric matrix containing the defining parameters covariance matrix.
Definition: TrackParticle_v1.cxx:246
HistFamily::h_pix_holes
TH2 * h_pix_holes
Definition: InDetTrackSelectionToolTester.cxx:49
xAOD::numberOfTRTOutliers
@ numberOfTRTOutliers
number of TRT outliers [unit8_t].
Definition: TrackingPrimitives.h:276
xAOD::numberOfSCTDeadSensors
@ numberOfSCTDeadSensors
number of dead SCT sensors crossed [unit8_t].
Definition: TrackingPrimitives.h:273
HistFamily::h_pix_hits_phys
TH2 * h_pix_hits_phys
Definition: InDetTrackSelectionToolTester.cxx:47
HistFamily::getSum
uint8_t getSum(const xAOD::TrackParticle &, xAOD::SummaryType) const
Definition: InDetTrackSelectionToolTester.cxx:277
xAOD::numberOfSCTHits
@ numberOfSCTHits
number of hits in SCT [unit8_t].
Definition: TrackingPrimitives.h:268
L1Topo::Error
Error
The different types of error that can be flagged in the L1TopoRDO.
Definition: Error.h:16
xAOD::numberOfPixelDeadSensors
@ numberOfPixelDeadSensors
number of dead pixel sensors crossed [unit8_t].
Definition: TrackingPrimitives.h:266
HistFamily::h_sct_shared
TH2 * h_sct_shared
Definition: InDetTrackSelectionToolTester.cxx:54
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
HistFamily::h_sct_holes
TH2 * h_sct_holes
Definition: InDetTrackSelectionToolTester.cxx:53
xAOD::TrackParticle_v1::theta
float theta() const
Returns the parameter, which has range 0 to .
xAOD::numberOfInnermostPixelLayerHits
@ numberOfInnermostPixelLayerHits
these are the hits in the 0th pixel barrel layer
Definition: TrackingPrimitives.h:237
HistFamily::h_bl_expected
TH2 * h_bl_expected
Definition: InDetTrackSelectionToolTester.cxx:46