9using Athena::Units::GeV;
26 return StatusCode::SUCCESS;
38 for (
const auto& key :
m_keys) {
42 if (FormatTool->AddToEvent(
dataTypeName(), key.key() +
"_xAOD", &
data).isFailure()) {
51 return StatusCode::SUCCESS;
81 for (; elItr != elItrE; ++elItr) {
83 std::string electronAuthor =
"";
84 std::string electronIsEMString =
"none";
85 std::string electronLabel =
"";
92 if ((*elItr)->trackParticle()){
93 pdgId.emplace_back(
DataType( -11.*(*elItr)->trackParticle()->charge() ));
98 ATH_MSG_DEBUG(
" Electron #" << counter++ <<
" : eta = " << (*elItr)->eta() <<
", phi = "
101 <<
", author = " << (*elItr)->author()
109 bool passesTight(
false);
110 bool passesMedium(
false);
111 bool passesLoose(
false);
112 const bool tightSelectionExists = (*elItr)->passSelection(passesTight,
"Tight");
114 <<
" and passes? " << passesTight);
115 const bool mediumSelectionExists = (*elItr)->passSelection(passesMedium,
"Medium");
117 <<
" and passes? " << passesMedium);
118 const bool looseSelectionExists = (*elItr)->passSelection(passesLoose,
"Loose");
120 <<
" and passes? " << passesLoose);
122 electronAuthor =
"author"+
DataType( (*elItr)->author() ).toString();
123 electronLabel = electronAuthor;
124 if (( (*elItr)->author()) == 0){ electronAuthor =
"unknown"; electronLabel +=
"_unknown"; }
125 if (( (*elItr)->author()) == 8){ electronAuthor =
"forward"; electronLabel +=
"_forward"; }
126 if (( (*elItr)->author()) == 2){ electronAuthor =
"softe"; electronLabel +=
"_softe"; }
127 if (( (*elItr)->author()) == 1){ electronAuthor =
"egamma"; electronLabel +=
"_egamma"; }
130 electronLabel +=
"_Loose";
131 electronIsEMString =
"Loose";
134 electronLabel +=
"_Medium";
135 electronIsEMString =
"Medium";
138 electronLabel +=
"_Tight";
139 electronIsEMString =
"Tight";
141 author.emplace_back(
DataType( electronAuthor ) );
143 isEMString.emplace_back(
DataType( electronIsEMString ) );
154 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.
virtual std::string dataTypeName() const
Return the name of the data type that is generated by this retriever.
xAODElectronRetriever(const std::string &type, const std::string &name, const IInterface *parent)
Standard Constructor.
virtual StatusCode initialize()
const DataMap getData(const xAOD::ElectronContainer *)
Puts the variables into a DataMap.
virtual StatusCode retrieve(ToolHandle< IFormatTool > &FormatTool)
For each electron collection retrieve basic parameters.
SG::ReadHandleKeyArray< xAOD::ElectronContainer > m_keys
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.
ElectronContainer_v1 ElectronContainer
Definition of the current "electron container version".