9using Athena::Units::GeV;
25 return StatusCode::SUCCESS;
38 for (
const auto& key :
m_keys) {
42 if (FormatTool->AddToEvent(
dataTypeName(), key.key() +
"_xAOD", &
data).isFailure()) {
52 return StatusCode::SUCCESS;
81 for (; phItr != phItrE; ++phItr) {
82 ATH_MSG_DEBUG(
" Photon #" << counter++ <<
" : eta = " << (*phItr)->eta() <<
", phi = "
85 std::string photonAuthor =
"";
86 std::string photonIsEMString =
"none";
87 std::string photonLabel =
"";
93 bool passesTight(
false);
94 bool passesMedium(
false);
95 bool passesLoose(
false);
96 const bool tightSelectionExists = (*phItr)->passSelection(passesTight,
"Tight");
98 <<
" and passes? " << passesTight);
99 const bool mediumSelectionExists = (*phItr)->passSelection(passesMedium,
"Medium");
101 <<
" and passes? " << passesMedium);
102 const bool looseSelectionExists = (*phItr)->passSelection(passesLoose,
"Loose");
104 <<
" and passes? " << passesLoose);
106 photonAuthor =
"author"+
DataType( (*phItr)->author() ).toString();
107 photonLabel = photonAuthor;
108 if (( (*phItr)->author()) == 0){ photonAuthor =
"unknown"; photonLabel +=
"_unknown"; }
109 if (( (*phItr)->author()) == 8){ photonAuthor =
"forward"; photonLabel +=
"_forward"; }
110 if (( (*phItr)->author()) == 2){ photonAuthor =
"softe"; photonLabel +=
"_softe"; }
111 if (( (*phItr)->author()) == 1){ photonAuthor =
"egamma"; photonLabel +=
"_egamma"; }
114 photonLabel +=
"_Loose";
115 photonIsEMString =
"Loose";
118 photonLabel +=
"_Medium";
119 photonIsEMString =
"Medium";
122 photonLabel +=
"_Tight";
123 photonIsEMString =
"Tight";
125 author.emplace_back(
DataType( photonAuthor ) );
127 isEMString.emplace_back(
DataType( photonIsEMString ) );
130 energy.emplace_back(
DataType((*phItr)->e()/
GeV ) );
139 DataMap[
"isEMString"] = isEMString;
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
char data[hepevt_bytes_allocation_ATLAS]
Wrapper to avoid constant divisions when using units.
DataModel_detail::const_iterator< DataVector > const_iterator
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
const DataMap getData(const xAOD::PhotonContainer *)
Puts the variables into a DataMap.
virtual std::string dataTypeName() const
Return the name of the data type that is generated by this retriever.
SG::ReadHandleKeyArray< xAOD::PhotonContainer > m_keys
xAODPhotonRetriever(const std::string &type, const std::string &name, const IInterface *parent)
Standard Constructor.
virtual StatusCode retrieve(ToolHandle< IFormatTool > &FormatTool)
For each photon collection retrieve basic parameters.
virtual StatusCode initialize()
virtual bool isValid() override final
Can the handle be successfully dereferenced?
std::string label(const std::string &format, int i)
This header is shared inbetween the C-style server thread and the C++ Athena ServerSvc.
std::map< std::string, DataVect > DataMap
std::vector< DataType > DataVect
Defines a map with a key and a vector of DataType objects e.g.
PhotonContainer_v1 PhotonContainer
Definition of the current "photon container version".