ATLAS Offline Software
Loading...
Searching...
No Matches
egammaCopyTrackParticleInfo Namespace Reference

Classes

struct  ToCopy

Functions

void copy (xAOD::TrackParticle &created, const xAOD::TrackParticle &original, const egammaCopyTrackParticleInfo::ToCopy &toCopy)

Function Documentation

◆ copy()

void egammaCopyTrackParticleInfo::copy ( xAOD::TrackParticle & created,
const xAOD::TrackParticle & original,
const egammaCopyTrackParticleInfo::ToCopy & toCopy )

Definition at line 22 of file egammaCopyTrackParticleInfo.cxx.

24 {
25 // Add Truth decorations. Copy from the original.
26 if (toCopy.doTruth) {
27 static const SG::ConstAccessor<
29 ctPL("truthParticleLink");
30 static const SG::Accessor<
32 tPL("truthParticleLink");
33 if (ctPL.isAvailable(original)) {
34 tPL(created) = ctPL(original);
35 }
36 static const SG::ConstAccessor<float> ctMP("truthMatchProbability");
37 static const SG::Accessor<float> tMP("truthMatchProbability");
38 if (ctMP.isAvailable(original)) {
39 tMP(created) = ctMP(original);
40 }
41 static const SG::ConstAccessor<int> ctT("truthType");
42 static const SG::Accessor<int> tT("truthType");
43 if (ctT.isAvailable(original)) {
44 tT(created) = ctT(original);
45 }
46 static const SG::ConstAccessor<int> ctO("truthOrigin");
47 static const SG::Accessor<int> tO("truthOrigin");
48 if (ctO.isAvailable(original)) {
49 tO(created) = ctO(original);
50 }
51 static const SG::ConstAccessor<unsigned int> ctC("truthClassification");
52 static const SG::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 // Use accessor instead of interface to bypass hasValidTime check
74 // and keep same value as original InDetTrackParticle
75 static const SG::Accessor<float> time("time");
76 created.setTime(time(original));
77 static const SG::Accessor<float> timeRes("timeResolution");
78 created.setTimeResolution(timeRes(original));
79 }
80
81 if (toCopy.isRefitted) {
82 if (toCopy.doPix) {
83 // copy over dead sensors
84 copySummaryValue(original, created, xAOD::numberOfPixelDeadSensors);
85
86 // Figure the new number of holes
87 uint8_t nPixHolesRefitted =
93
94 created.setSummaryValue(nPixHolesRefitted, xAOD::numberOfPixelHoles);
95 }
96 if (toCopy.doSCT) {
97 // Copy over dead and double holes
98 copySummaryValue(original, created, xAOD::numberOfSCTDeadSensors);
99 copySummaryValue(original, created, xAOD::numberOfSCTDoubleHoles);
100
101 uint8_t nSCTHolesRefitted =
107
108 created.setSummaryValue(nSCTHolesRefitted, xAOD::numberOfSCTHoles);
109 }
110 if (toCopy.doTRT) {
111 uint8_t nTRTHolesRefitted =
117
118 created.setSummaryValue(nTRTHolesRefitted, xAOD::numberOfTRTHoles);
119 }
120 }
121}
Helper class to provide type-safe access to aux data.
Helper class to provide constant type-safe access to aux data.
void setTimeResolution(float timeResolution)
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 setHasValidTime(uint8_t hasValidTime)
time(flags, cells_name, *args, **kw)
SG::Accessor< T, ALLOC > Accessor
Definition AuxElement.h:573
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...
@ 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].