Go to the source code of this file.
◆ getElectrons()
StatusCode getElectrons |
( |
const std::vector< std::pair< double, double >> & |
pt_eta, |
|
|
int |
runNumber, |
|
|
xAOD::TStore & |
store |
|
) |
| |
Definition at line 73 of file CreateDummyEl.cxx.
77 using namespace asg::CreateDummyEl;
79 setMsgLevel(MSG::INFO);
83 std::unique_ptr<xAOD::EventInfo> eventInfo =
84 std::make_unique<xAOD::EventInfo>();
91 if (!
store.
record(std::move(eventInfo),
"EventInfo").isSuccess()) {
93 return StatusCode::FAILURE;
96 size_t numel = pt_eta.size();
98 std::unique_ptr<xAOD::CaloClusterContainer>
clusters =
99 std::make_unique<xAOD::CaloClusterContainer>();
100 std::unique_ptr<xAOD::CaloClusterAuxContainer> clAux =
101 std::make_unique<xAOD::CaloClusterAuxContainer>();
104 for (
const auto&
i : pt_eta) {
105 const double pt{
i.first };
106 const double eta{
i.second };
107 const double e{
pt * cosh(eta) };
110 fill_cluster(cluster, eta, 0.0,
e);
114 !
store.
record(std::move(clAux),
"MyClustersAux.").isSuccess()) {
116 return StatusCode::FAILURE;
119 std::vector<ElementLink<xAOD::CaloClusterContainer>>
links{};
120 std::unique_ptr<xAOD::ElectronContainer>
electrons =
121 std::make_unique<xAOD::ElectronContainer>();
122 std::unique_ptr<xAOD::ElectronAuxContainer> electronsAux =
123 std::make_unique<xAOD::ElectronAuxContainer>();
126 for (
const auto&
i : pt_eta) {
127 const double pt{
i.first };
128 const double eta{
i.second };
132 links.emplace_back(
"MyClusters",
el->index());
133 el->setCaloClusterLinks(
links);
140 !
store.
record(std::move(electronsAux),
"MyElectronAux.").isSuccess()) {
142 return StatusCode::FAILURE;
145 return StatusCode::SUCCESS;