42 {
43
45
46
47
48
49
50
51
52
53
59
67 } else {
71 pCopy = ph;
72 }
75 Error(
"addBranches()",
76 "Error applying fudge factors to current photon");
78 Warning(
79 "addBranches()",
80 "Current object has no valid fudge factors due to out-of-range");
81 } else {
82 Warning(
83 "addBranches()",
84 "Unknown correction code %d from ElectronPhotonShowerShapeFudgeTool",
85 (int)correctionCode);
86 }
87 pCopies.push_back (pCopy);
88 }
89 }
90 else {
92 }
93
94
95 SG::WriteDecorHandle<xAOD::EgammaContainer, char> decoratorPass{
97 };
98 SG::WriteDecorHandle<xAOD::EgammaContainer, unsigned int> decoratorIsEM{
100 };
101
102 std::unique_ptr<SG::WriteDecorHandle<xAOD::EgammaContainer, float>>
103 decoratorResult = nullptr;
105 decoratorResult =
106 std::make_unique<SG::WriteDecorHandle<xAOD::EgammaContainer, float>>(
108 }
109 std::vector<SG::WriteDecorHandle<xAOD::EgammaContainer, float>> decoratorMultipleOutputs{};
112 }
113
114
117 if (!pCopy) pCopy =
par;
118
119 asg::AcceptData theAccept(
m_tool->accept(ctx, pCopy));
120 const unsigned int isEM =
121 (
unsigned int)theAccept.getCutResultInvertedBitSet()
122 .to_ulong();
123
124
125
127 const bool pass_selection = (
bool)theAccept;
128 if (pass_selection) {
129 decoratorPass(*par) = 1;
130 } else {
131 decoratorPass(*par) = 0;
132 }
133 decoratorIsEM(*par) = isEM;
134 if (decoratorResult) {
135 (*decoratorResult)(*par) =
136 static_cast<float>(
m_tool->calculate(ctx, pCopy));
137 }
139
141 std::vector<float> toolOutput =
m_tool->calculateMultipleOutputs(ctx, eCopy);
142 for (
size_t i = 0;
i < toolOutput.size();
i++){
143 decoratorMultipleOutputs.at(i)(*par) = toolOutput.at(i);
144 }
145 }
146 } else {
147 if (theAccept.getCutResult(
m_cut)) {
148 decoratorPass(*par) = 1;
149 } else {
150 decoratorPass(*par) = 0;
151 }
152 decoratorIsEM(*par) = isEM;
153 if (decoratorResult) {
154 (*decoratorResult)(*par) =
155 static_cast<float>(
m_tool->calculate(ctx, pCopy));
156 }
158
160 std::vector<float> toolOutput =
m_tool->calculateMultipleOutputs(ctx, eCopy);
161 for (
size_t i = 0;
i < toolOutput.size();
i++){
162 decoratorMultipleOutputs.at(i)(*par) = toolOutput.at(i);
163 }
164 }
165 }
166 }
167
168 return StatusCode::SUCCESS;
169 }
@ Error
Some error happened during the object correction.
@ OutOfValidityRange
Input object is out of validity range.
@ Ok
The correction was done successfully.
Error
The different types of error that can be flagged in the L1TopoRDO.
@ NEVER_TRACK_INDICES
Never track indices, regardless of the setting of the ownership policy.
@ OWN_ELEMENTS
this data object owns its elements
ObjectType
Type of objects that have a representation in the xAOD EDM.
@ Electron
The object is an electron.
Egamma_v1 Egamma
Definition of the current "egamma version".
Photon_v1 Photon
Definition of the current "egamma version".
setBGCode setTAP setLVL2ErrorBits bool
EgammaContainer_v1 EgammaContainer
Definition of the current "egamma container version".
Electron_v1 Electron
Definition of the current "egamma version".