ATLAS Offline Software
MuonTrkHitFillerTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 //
7 // Author : Alaettin Serhan Mete (serhan@iastate.edu)
8 // Date : 03 August 2009
9 //
11 #include "MuonTrkHitFillerTool.h"
14 
15 
16 namespace {
17 
18 const int ID = 1;
19 const int MS = 2;
20 
21 struct Var
22 {
23  const char* name;
25  int which;
26 };
27 const Var vars[] =
28 {
29  {"nOutliersOnTrack", xAOD::numberOfOutliersOnTrack, ID+MS},
30 
32  {"nPixHits", xAOD::numberOfPixelHits, ID},
33  {"nSCTHits", xAOD::numberOfSCTHits, ID},
34  {"nTRTHits", xAOD::numberOfTRTHits, ID},
35  {"nTRTHighTHits", xAOD::numberOfTRTHighThresholdHits, ID},
37  {"nPixSharedHits", xAOD::numberOfPixelSharedHits, ID},
38  {"nPixHoles", xAOD::numberOfPixelHoles, ID},
39  {"nSCTSharedHits", xAOD::numberOfSCTSharedHits, ID},
40  {"nSCTHoles", xAOD::numberOfSCTHoles, ID},
41  {"nTRTOutliers", xAOD::numberOfTRTOutliers, ID},
42  {"nTRTHighTOutliers", xAOD::numberOfTRTHighThresholdOutliers, ID},
43  {"nGangedPixels", xAOD::numberOfGangedPixels, ID},
44  {"nPixelDeadSensors", xAOD::numberOfPixelDeadSensors, ID},
45  {"nSCTDeadSensors", xAOD::numberOfSCTDeadSensors, ID},
46  {"nTRTDeadStraws", xAOD::numberOfTRTDeadStraws, ID},
47  {"expectInnermostPixelLayerHit", xAOD::expectInnermostPixelLayerHit, ID},
48 
49  {"nprecisionLayers", xAOD::numberOfPrecisionLayers, MS},
50  {"nprecisionHoleLayers", xAOD::numberOfPrecisionHoleLayers, MS},
51  {"nphiLayers", xAOD::numberOfPhiLayers, MS},
52  {"nphiHoleLayers", xAOD::numberOfPhiHoleLayers, MS},
53  {"ntrigEtaLayers", xAOD::numberOfTriggerEtaLayers, MS},
54  {"ntrigEtaHoleLayers", xAOD::numberOfTriggerEtaHoleLayers, MS},
55 };
56 
57 
58 }
59 
60 
61 namespace D3PD {
62 
63 
65  const std::string& name,
66  const IInterface* parent)
68 {
69  declareProperty ("SaveIDMuonHitSummary", m_saveIDMuonHitSummary = true);
70  declareProperty ("SaveMSMuonHitSummary", m_saveMSMuonHitSummary = true);
71 }
72 
73 
75 {
76  int mask = 0;
79 
80  m_vars.reserve (std::distance (std::begin (vars), std::end (vars)));
81  for (const Var& v : vars) {
82  if (v.which & mask) {
83  m_vars.emplace_back (v.type, nullptr);
84  CHECK( addVariable (v.name, m_vars.back().second) );
85  }
86  }
87  return StatusCode::SUCCESS;
88 }
89 
90 
92 {
93  for (auto& v : m_vars)
94  p.summaryValue (*v.second, v.first);
95  return StatusCode::SUCCESS;
96 }
97 
98 
99 } // namespace D3PD
xAOD::numberOfPixelHoles
@ numberOfPixelHoles
number of pixel layers on track with absence of hits [unit8_t].
Definition: TrackingPrimitives.h:261
xAOD::numberOfPrecisionHoleLayers
@ numberOfPrecisionHoleLayers
layers with holes AND no hits [unit8_t].
Definition: TrackingPrimitives.h:289
xAOD::numberOfSCTSharedHits
@ numberOfSCTSharedHits
number of SCT hits shared by several tracks [unit8_t].
Definition: TrackingPrimitives.h:272
ID
std::vector< Identifier > ID
Definition: CalibHitIDCheck.h:24
D3PD::MuonTrkHitFillerTool::m_saveMSMuonHitSummary
bool m_saveMSMuonHitSummary
Definition: MuonTrkHitFillerTool.h:36
xAOD::numberOfGangedPixels
@ numberOfGangedPixels
number of pixels which have a ganged ambiguity [unit8_t].
Definition: TrackingPrimitives.h:264
D3PD::MuonTrkHitFillerTool::book
virtual StatusCode book()
Declare tuple variables.
Definition: MuonTrkHitFillerTool.cxx:74
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
xAOD::numberOfPhiHoleLayers
@ numberOfPhiHoleLayers
layers with trigger phi holes but no hits [unit8_t].
Definition: TrackingPrimitives.h:291
D3PD::MuonTrkHitFillerTool::MuonTrkHitFillerTool
MuonTrkHitFillerTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: MuonTrkHitFillerTool.cxx:64
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition: ICaloAffectedTool.h:24
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
D3PD::AddVariable::addVariable
virtual StatusCode addVariable(const std::string &name, const std::type_info &ti, void *&ptr, const std::string &docstring="", const void *defval=0)
Add a variable to the tuple.
Definition: AddVariable.cxx:85
Muon
This class provides conversion from CSC RDO data to CSC Digits.
Definition: TrackSystemController.h:45
xAOD::Muon_v1
Class describing a Muon.
Definition: Muon_v1.h:38
python.utils.AtlRunQueryLookup.mask
string mask
Definition: AtlRunQueryLookup.py:460
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
xAOD::numberOfTRTHighThresholdHits
@ numberOfTRTHighThresholdHits
number of TRT hits which pass the high threshold (only xenon counted) [unit8_t].
Definition: TrackingPrimitives.h:278
xAOD::numberOfTRTHighThresholdOutliers
@ numberOfTRTHighThresholdOutliers
number of TRT high threshold outliers (only xenon counted) [unit8_t].
Definition: TrackingPrimitives.h:281
D3PD
Block filler tool for noisy FEB information.
Definition: CaloCellDetailsFillerTool.cxx:29
xAOD::numberOfPixelSharedHits
@ numberOfPixelSharedHits
number of Pixel all-layer hits shared by several tracks [unit8_t].
Definition: TrackingPrimitives.h:262
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
xAOD::SummaryType
SummaryType
Enumerates the different types of information stored in Summary.
Definition: TrackingPrimitives.h:228
xAOD::numberOfTriggerEtaLayers
@ numberOfTriggerEtaLayers
layers with trigger eta hits [unit8_t].
Definition: TrackingPrimitives.h:292
xAOD::numberOfTriggerEtaHoleLayers
@ numberOfTriggerEtaHoleLayers
layers with trigger eta holes but no hits [unit8_t].
Definition: TrackingPrimitives.h:293
D3PD::MuonTrkHitFillerTool::m_vars
std::vector< std::pair< xAOD::SummaryType, uint8_t * > > m_vars
Definition: MuonTrkHitFillerTool.h:32
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
test_pyathena.parent
parent
Definition: test_pyathena.py:15
D3PD::BlockFillerTool
Type-safe wrapper for block filler tools.
Definition: BlockFillerTool.h:68
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
TrackSummary.h
xAOD::numberOfSCTHoles
@ numberOfSCTHoles
number of SCT holes [unit8_t].
Definition: TrackingPrimitives.h:270
MCP::DetectorType::MS
@ MS
Definition: EnumDef.h:37
python.Utils.unixtools.which
def which(filename, env=os.environ)
UNIX-style which ---------------------------------------------------------—.
Definition: unixtools.py:39
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
errorcheck.h
Helpers for checking error return status codes and reporting errors.
D3PD::MuonTrkHitFillerTool::m_saveIDMuonHitSummary
bool m_saveIDMuonHitSummary
Definition: MuonTrkHitFillerTool.h:35
MuonTrkHitFillerTool.h
xAOD::numberOfTRTOutliers
@ numberOfTRTOutliers
number of TRT outliers [unit8_t].
Definition: TrackingPrimitives.h:276
python.PyAthena.v
v
Definition: PyAthena.py:154
xAOD::numberOfOutliersOnTrack
@ numberOfOutliersOnTrack
number of measurements flaged as outliers in TSOS [unit8_t].
Definition: TrackingPrimitives.h:297
xAOD::numberOfSCTDeadSensors
@ numberOfSCTDeadSensors
number of dead SCT sensors crossed [unit8_t].
Definition: TrackingPrimitives.h:273
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
xAOD::numberOfInnermostPixelLayerSharedHits
@ numberOfInnermostPixelLayerSharedHits
number of Pixel 0th layer barrel hits shared by several tracks.
Definition: TrackingPrimitives.h:239
xAOD::numberOfSCTHits
@ numberOfSCTHits
number of hits in SCT [unit8_t].
Definition: TrackingPrimitives.h:268
xAOD::numberOfPixelDeadSensors
@ numberOfPixelDeadSensors
number of dead pixel sensors crossed [unit8_t].
Definition: TrackingPrimitives.h:266
Prompt::Def::Var
Var
Definition: VarHolder.h:57
xAOD::numberOfPhiLayers
@ numberOfPhiLayers
layers with a trigger phi hit [unit8_t].
Definition: TrackingPrimitives.h:290
Amg::distance
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
Definition: GeoPrimitivesHelpers.h:54
xAOD::numberOfTRTDeadStraws
@ numberOfTRTDeadStraws
number of dead TRT straws crossed [unit8_t].
Definition: TrackingPrimitives.h:282
D3PD::MuonTrkHitFillerTool::fill
virtual StatusCode fill(const xAOD::Muon &p)
Fill one block — type-safe version.
Definition: MuonTrkHitFillerTool.cxx:91
xAOD::numberOfInnermostPixelLayerHits
@ numberOfInnermostPixelLayerHits
these are the hits in the 0th pixel barrel layer
Definition: TrackingPrimitives.h:237
xAOD::numberOfPrecisionLayers
@ numberOfPrecisionLayers
layers with at least 3 hits [unit8_t].
Definition: TrackingPrimitives.h:288