11using Athena::Units::GeV;
27 return StatusCode::SUCCESS;
40 for (
const auto& key :
m_keys) {
44 if (FormatTool->AddToEvent(
dataTypeName(), key.key() +
"_xAOD", &
data).isFailure()) {
53 return StatusCode::SUCCESS;
73 DataVect logLhRatio; logLhRatio.reserve(tauCont->
size());
77 DataVect trackLinkCount; trackLinkCount.reserve(tauCont->
size());
78 DataVect isTauString; isTauString.reserve(tauCont->
size());
88 for (; tauItr != tauItrE; ++tauItr) {
89 ATH_MSG_DEBUG(
" Tau #" << counter++ <<
" : eta = " << (*tauItr)->eta() <<
", phi = "
96 isolFrac.emplace_back(
DataType( 1. ));
97 logLhRatio.emplace_back(
DataType( 1. ));
100 isTauString.emplace_back(
DataType(
"xAOD_tauJet_withoutQuality" ));
103 energy.emplace_back(
DataType((*tauItr)->e()/
GeV ) );
109#ifndef XAODTAU_VERSIONS_TAUTRACK_V1_H
110 const std::vector< ElementLink< xAOD::TrackParticleContainer > > tpLinks = (*tauItr)->trackLinks();
116 unsigned int tp_size = tpLinks.size();
117 numTracks.emplace_back(
DataType( tp_size ));
118 trackLinkCount.emplace_back(
DataType( tp_size ));
120 for(
unsigned int tp = 0; tp<tp_size; ++tp)
128 <<
", collection : " << tpl.
key()
129 <<
", Tracks : " << tp <<
" out of " << tp_size <<
", own count: " << trkCnt++);
144 DataMap[
"numTracks"] = numTracks;
145 DataMap[
"isolFrac"] = isolFrac;
146 DataMap[
"logLhRatio"] = logLhRatio;
149 DataMap[
"trackLinkCount"] = trackLinkCount;
150 DataMap[
"isTauString"] = isTauString;
154 if ((numTracks.size()) != 0){
156 double NTracksPerVertex = tracks.size()*1./numTracks.size();
157 std::string tag =
"trackIndex multiple=\"" +
DataType(NTracksPerVertex).toString()+
"\"";
159 tag =
"trackKey multiple=\"" +
DataType(NTracksPerVertex).toString()+
"\"";
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
double charge(const T &p)
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.
index_type index() const
Get the index of the element inside of its container.
sgkey_t key() const
Get the key that we reference, as a hash.
SG::ReadHandleKeyArray< xAOD::TauJetContainer > m_keys
xAODTauRetriever(const std::string &type, const std::string &name, const IInterface *parent)
Standard Constructor.
const DataMap getData(const xAOD::TauJetContainer *)
Puts the variables into a DataMap.
Gaudi::Property< std::string > m_tracksName
virtual StatusCode initialize()
virtual StatusCode retrieve(ToolHandle< IFormatTool > &FormatTool)
For each Tau collections retrieve basic parameters.
virtual std::string dataTypeName() const
Return the name of the data type that is generated by this retriever.
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.
std::vector< ElementLink< xAOD::TrackParticleContainer > > trackParticleLinks(const xAOD::TauJet *tau, xAOD::TauJetParameters::TauTrackFlag flag=xAOD::TauJetParameters::TauTrackFlag::classifiedCharged)
TauJetContainer_v3 TauJetContainer
Definition of the current "taujet container version".