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) {
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 static const SG::AuxElement::Accessor<float> time("time");
74 created.setTime(time(original));
75 static const SG::AuxElement::Accessor<float> timeRes("timeResolution");
76 created.setTimeResolution(timeRes(original));
77 }
78
79 if (toCopy.isRefitted) {
80 if (toCopy.doPix) {
81 // copy over dead sensors
82 copySummaryValue(original, created, xAOD::numberOfPixelDeadSensors);
83
84 // Figure the new number of holes
85 uint8_t nPixHolesRefitted =
91
92 created.setSummaryValue(nPixHolesRefitted, xAOD::numberOfPixelHoles);
93 }
94 if (toCopy.doSCT) {
95 // Copy over dead and double holes
96 copySummaryValue(original, created, xAOD::numberOfSCTDeadSensors);
97 copySummaryValue(original, created, xAOD::numberOfSCTDoubleHoles);
98
99 uint8_t nSCTHolesRefitted =
105
106 created.setSummaryValue(nSCTHolesRefitted, xAOD::numberOfSCTHoles);
107 }
108 if (toCopy.doTRT) {
109 uint8_t nTRTHolesRefitted =
115
116 created.setSummaryValue(nTRTHolesRefitted, xAOD::numberOfTRTHoles);
117 }
118 }
119}
SG::ConstAccessor< T, ALLOC > ConstAccessor
Definition AuxElement.h:570
SG::Accessor< T, ALLOC > Accessor
Definition AuxElement.h:573
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)
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].