 |
ATLAS Offline Software
|
Go to the documentation of this file.
27 const std::set<CaloSampling::CaloSample> samplings{
36 unsigned sampling_pattern = 0;
37 for (
auto sample : samplings) {
38 sampling_pattern |= 0x1U <<
sample;
42 for (
auto sample : samplings) {
47 if (std::abs(
eta) < 1.45) {
63 etaCaloDecor(*cluster) =
eta;
64 phiCaloDecor(*cluster) =
phi;
78 using namespace asg::CreateDummyEl;
84 std::unique_ptr<xAOD::EventInfo> eventInfo =
85 std::make_unique<xAOD::EventInfo>();
92 if (!
store.
record(std::move(eventInfo),
"EventInfo").isSuccess()) {
94 return StatusCode::FAILURE;
97 size_t numel = pt_eta.size();
99 std::unique_ptr<xAOD::CaloClusterContainer>
clusters =
100 std::make_unique<xAOD::CaloClusterContainer>();
101 std::unique_ptr<xAOD::CaloClusterAuxContainer> clAux =
102 std::make_unique<xAOD::CaloClusterAuxContainer>();
105 for (
const auto&
i : pt_eta) {
106 const double pt{
i.first };
107 const double eta{
i.second };
108 const double e{
pt * cosh(eta) };
111 fill_cluster(cluster, eta, 0.0,
e);
115 !
store.
record(std::move(clAux),
"MyClustersAux.").isSuccess()) {
117 return StatusCode::FAILURE;
120 std::vector<ElementLink<xAOD::CaloClusterContainer>>
links{};
121 std::unique_ptr<xAOD::ElectronContainer>
electrons =
122 std::make_unique<xAOD::ElectronContainer>();
123 std::unique_ptr<xAOD::ElectronAuxContainer> electronsAux =
124 std::make_unique<xAOD::ElectronAuxContainer>();
127 for (
const auto&
i : pt_eta) {
128 const double pt{
i.first };
129 const double eta{
i.second };
133 links.emplace_back(
"MyClusters",
el->index());
134 el->setCaloClusterLinks(
links);
141 !
store.
record(std::move(electronsAux),
"MyElectronAux.").isSuccess()) {
143 return StatusCode::FAILURE;
146 return StatusCode::SUCCESS;
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.
::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.
void record(const T *p, const std::string &key)
@ 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.
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)
constexpr double electronMassInMeV
the mass of the electron (in MeV)