![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
26 const std::set<CaloSampling::CaloSample> samplings{
35 unsigned sampling_pattern = 0;
36 for (
auto sample : samplings) {
37 sampling_pattern |= 0x1U <<
sample;
41 for (
auto sample : samplings) {
46 if (std::abs(
eta) < 1.45) {
75 using namespace asg::CreateDummyEl;
77 setMsgLevel(MSG::INFO);
81 std::unique_ptr<xAOD::EventInfo> eventInfo =
82 std::make_unique<xAOD::EventInfo>();
89 if (!
store.
record(std::move(eventInfo),
"EventInfo").isSuccess()) {
91 return StatusCode::FAILURE;
94 size_t numel = pt_eta.size();
96 std::unique_ptr<xAOD::CaloClusterContainer>
clusters =
97 std::make_unique<xAOD::CaloClusterContainer>();
98 std::unique_ptr<xAOD::CaloClusterAuxContainer> clAux =
99 std::make_unique<xAOD::CaloClusterAuxContainer>();
102 for (
const auto&
i : pt_eta) {
103 const double pt{
i.first };
104 const double eta{
i.second };
105 const double e{
pt * cosh(
eta) };
108 fill_cluster(cluster,
eta, 0.0,
e);
112 !
store.
record(std::move(clAux),
"MyClustersAux.").isSuccess()) {
114 return StatusCode::FAILURE;
117 std::vector<ElementLink<xAOD::CaloClusterContainer>>
links{};
118 std::unique_ptr<xAOD::ElectronContainer>
electrons =
119 std::make_unique<xAOD::ElectronContainer>();
120 std::unique_ptr<xAOD::ElectronAuxContainer> electronsAux =
121 std::make_unique<xAOD::ElectronAuxContainer>();
124 for (
const auto&
i : pt_eta) {
125 const double pt{
i.first };
126 const double eta{
i.second };
130 links.emplace_back(
"MyClusters",
el->index());
131 el->setCaloClusterLinks(
links);
138 !
store.
record(std::move(electronsAux),
"MyElectronAux.").isSuccess()) {
140 return StatusCode::FAILURE;
143 return StatusCode::SUCCESS;
StatusCode record(T *p2BRegistered, const TKEY &key)
Record an object with a key.
Electron_v1 Electron
Definition of the current "egamma version".
void setEventNumber(uint64_t value)
Set the current event's event number.
Scalar phi() const
phi method
Scalar eta() const
pseudorapidity method
void insertMoment(MomentType type, double value)
void setSamplingPattern(const unsigned sp, const bool clearSamplingVars=false)
Set sampling pattern (one bit per sampling.
bool setEnergy(const CaloSample sampling, const float e)
Set energy for a given sampling. Returns false if the sample isn't part of the cluster.
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
Description of a calorimeter cluster.
Helper class to provide type-safe access to aux data.
::StatusCode StatusCode
StatusCode definition for legacy code.
ANA_MSG_HEADER(msgSTT) ANA_MSG_SOURCE(msgSTT
StatusCode getElectrons(const std::vector< std::pair< double, double >> &pt_eta, int runNumber, xAOD::TStore &store)
void makePrivateStore()
Create a new (empty) private store for this object.
@ PHICALOFRAME
Phi in the calo frame (for egamma)
A relatively simple transient store for objects created in analysis.
void setRunNumber(uint32_t value)
Set the current event's run number.
T & auxdata(const std::string &name, const std::string &clsname="")
Fetch an aux data variable, as a non-const reference.
bool setPhi(const CaloSample sampling, const float phi)
Set in a given sampling. Returns false if the sample isn't part of the cluster.
bool setEta(const CaloSample sampling, const float eta)
Set in a given sampling. Returns false if the sample isn't part of the cluster.
@ ETACALOFRAME
Eta in the calo frame (for egamma)