ATLAS Offline Software
Loading...
Searching...
No Matches
egammaCopyTrackParticleInfo.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4
6
11namespace {
12void
13copySummaryValue(const xAOD::TrackParticle& src,
15 const xAOD::SummaryType& information) {
17 dest.setSummaryValue(value, information);
18}
19} // namespace
20
21void
23 const xAOD::TrackParticle& original,
25 // Add Truth decorations. Copy from the original.
26 if (toCopy.doTruth) {
29 ctPL("truthParticleLink");
30 static const SG::AuxElement::Accessor<
32 tPL("truthParticleLink");
33 if (ctPL.isAvailable(original)) {
34 tPL(created) = ctPL(original);
35 }
36 static const SG::AuxElement::ConstAccessor<float> ctMP("truthMatchProbability");
37 static const SG::AuxElement::Accessor<float> tMP("truthMatchProbability");
38 if (ctMP.isAvailable(original)) {
39 tMP(created) = ctMP(original);
40 }
41 static const SG::AuxElement::ConstAccessor<int> ctT("truthType");
42 static const SG::AuxElement::Accessor<int> tT("truthType");
43 if (ctT.isAvailable(original)) {
44 tT(created) = ctT(original);
45 }
46 static const SG::AuxElement::ConstAccessor<int> ctO("truthOrigin");
47 static const SG::AuxElement::Accessor<int> tO("truthOrigin");
48 if (ctO.isAvailable(original)) {
49 tO(created) = ctO(original);
50 }
51 static const SG::AuxElement::ConstAccessor<unsigned int> ctC("truthClassification");
52 static const SG::AuxElement::Accessor<unsigned int> tC("truthClassification");
53 if (ctC.isAvailable(original)) {
54 tC(created) = ctC(original);
55 }
56 }
57
58 copySummaryValue(original, created, xAOD::numberOfPixelSplitHits);
59 copySummaryValue(original, created,
61 copySummaryValue(original, created,
63 copySummaryValue(original, created, xAOD::numberOfPixelSharedHits);
64 copySummaryValue(original, created,
66 copySummaryValue(original, created,
68 copySummaryValue(original, created, xAOD::numberOfSCTSharedHits);
69 copySummaryValue(original, created, xAOD::numberOfTRTSharedHits);
70
71 if (toCopy.doHGTD) {
72 created.setHasValidTime(original.hasValidTime());
73 created.setTime(original.time());
74 }
75
76 if (toCopy.isRefitted) {
77 if (toCopy.doPix) {
78 // copy over dead sensors
79 copySummaryValue(original, created, xAOD::numberOfPixelDeadSensors);
80
81 // Figure the new number of holes
82 uint8_t nPixHolesRefitted =
88
89 created.setSummaryValue(nPixHolesRefitted, xAOD::numberOfPixelHoles);
90 }
91 if (toCopy.doSCT) {
92 // Copy over dead and double holes
93 copySummaryValue(original, created, xAOD::numberOfSCTDeadSensors);
94 copySummaryValue(original, created, xAOD::numberOfSCTDoubleHoles);
95
96 uint8_t nSCTHolesRefitted =
102
103 created.setSummaryValue(nSCTHolesRefitted, xAOD::numberOfSCTHoles);
104 }
105 if (toCopy.doTRT) {
106 uint8_t nTRTHolesRefitted =
112
113 created.setSummaryValue(nTRTHolesRefitted, xAOD::numberOfTRTHoles);
114 }
115 }
116}
117
SG::ConstAccessor< T, ALLOC > ConstAccessor
Definition AuxElement.h:570
SG::Accessor< T, ALLOC > Accessor
Definition AuxElement.h:573
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
float time() const
Returns the time.
uint8_t hasValidTime() const
Returns whether or not the track has a valid time.
void setSummaryValue(uint8_t &value, const SummaryType &information)
Set method for TrackSummary values.
void setTime(float time)
void setHasValidTime(uint8_t hasValidTime)
void copy(xAOD::TrackParticle &created, const xAOD::TrackParticle &original, const egammaCopyTrackParticleInfo::ToCopy &toCopy)
int summaryValueInt(const xAOD::TrackParticle &tp, const xAOD::SummaryType &info, int deflt=-999)
return the summary value for a TrackParticle or default value (-999) (to be used mostly in python whe...
TrackParticle_v1 TrackParticle
Reference the current persistent version:
SummaryType
Enumerates the different types of information stored in Summary.
@ numberOfPixelHoles
number of pixel layers on track with absence of hits [unit8_t].
@ numberOfNextToInnermostPixelLayerSharedHits
number of Pixel 1st layer barrel hits shared by several tracks.
@ numberOfNextToInnermostPixelLayerSplitHits
number of Pixel 1st layer barrel hits split by cluster splitting
@ numberOfPixelSplitHits
number of Pixel all-layer hits split by cluster splitting [unit8_t].
@ numberOfInnermostPixelLayerSharedHits
number of Pixel 0th layer barrel hits shared by several tracks.
@ numberOfPixelOutliers
these are the pixel outliers, including the b-layer [unit8_t].
@ numberOfTRTHits
number of TRT hits [unit8_t].
@ numberOfTRTHoles
number of TRT holes [unit8_t].
@ numberOfSCTDeadSensors
number of dead SCT sensors crossed [unit8_t].
@ numberOfInnermostPixelLayerSplitHits
number of Pixel 0th layer barrel hits split by cluster splitting
@ numberOfSCTHits
number of hits in SCT [unit8_t].
@ numberOfSCTDoubleHoles
number of Holes in both sides of a SCT module [unit8_t].
@ numberOfSCTOutliers
number of SCT outliers [unit8_t].
@ numberOfPixelHits
these are the pixel hits, including the b-layer [unit8_t].
@ numberOfPixelSharedHits
number of Pixel all-layer hits shared by several tracks [unit8_t].
@ numberOfSCTSharedHits
number of SCT hits shared by several tracks [unit8_t].
@ numberOfTRTSharedHits
number of TRT hits used by more than one track
@ numberOfTRTOutliers
number of TRT outliers [unit8_t].
@ numberOfPixelDeadSensors
number of dead pixel sensors crossed [unit8_t].
@ numberOfSCTHoles
number of SCT holes [unit8_t].