38 {
39
40 SG::ReadHandle<xAOD::EgammaContainer>
particles;
44 } else {
47 }
48
49
50 SG::WriteDecorHandle<xAOD::EgammaContainer, char> decoratorPass{
52 };
53 SG::WriteDecorHandle<xAOD::EgammaContainer, unsigned int> decoratorIsEM{
55 };
56
57 std::unique_ptr<SG::WriteDecorHandle<xAOD::EgammaContainer, float>>
58 decoratorResult = nullptr;
60 decoratorResult =
61 std::make_unique<SG::WriteDecorHandle<xAOD::EgammaContainer, float>>(
63 }
64 std::vector<SG::WriteDecorHandle<xAOD::EgammaContainer, float>> decoratorMultipleOutputs{};
67 }
68
69
70 for (const auto& egamma : *particles) {
71
72 asg::AcceptData theAccept(
m_tool->accept(ctx, egamma));
73
74
75 const unsigned int isEM =
76 static_cast<unsigned int>(theAccept.getCutResultInvertedBitSet()
77 .to_ulong());
78
79
83 const bool pass_selection = static_cast<bool>(theAccept);
84 decoratorPass(*original) = pass_selection ? 1 : 0;
85 } else {
86 decoratorPass(*original) = theAccept.getCutResult(
m_cut) ? 1 : 0;
87 }
88 decoratorIsEM(*original) = isEM;
89 if (decoratorResult) {
90 (*decoratorResult)(*original) =
91 static_cast<float>(
m_tool->calculate(ctx, egamma));
92 }
94
96 std::vector<float> toolOutput =
m_tool->calculateMultipleOutputs(ctx, eCopy);
97 for (
size_t i = 0;
i < toolOutput.size();
i++){
98 decoratorMultipleOutputs.at(i)(*original) = toolOutput.at(i);
99 }
100 }
101 }
102
103 return StatusCode::SUCCESS;
104 }
const IParticle * getOriginalObject(const IParticle ©)
This function can be used to conveniently get a pointer back to the original object from which a copy...
Electron_v1 Electron
Definition of the current "egamma version".