9#include "CLHEP/Units/SystemOfUnits.h"
24 declareInterface<IDataRetriever>(
this);
26 "Collection to be first in output, shown in Atlantis without switching");
40 if (
sc.isFailure() ) {
66 return StatusCode::SUCCESS;
77 const auto nParticles = cpcont->
size();
81 DataVect mass; mass.reserve(nParticles);
82 DataVect energy; energy.reserve(nParticles);
86 DataVect pdgId; pdgId.reserve(nParticles);
87 DataVect typeEV; typeEV.reserve(nParticles);
89 DataVect dataType; dataType.reserve(nParticles);
95 std::string typeLabel =
"n_a";
97 for (; compPartItr != compPartItrE; ++compPartItr) {
98 const auto & pCompPart = *compPartItr;
99 phi.emplace_back(pCompPart->phi());
100 eta.emplace_back(pCompPart->eta());
101 et.emplace_back(pCompPart->et()/CLHEP::GeV);
102 mass.emplace_back(pCompPart->m()/CLHEP::GeV);
103 energy.emplace_back( pCompPart->e()/CLHEP::GeV );
104 px.emplace_back( pCompPart->px()/CLHEP::GeV );
105 py.emplace_back( pCompPart->py()/CLHEP::GeV );
106 pz.emplace_back( pCompPart->pz()/CLHEP::GeV );
108 charge.emplace_back( pCompPart->charge() );
109 dataType.emplace_back( pCompPart->dataType() );
110 pdgId2 = pCompPart->pdgId();
111 pdgId.emplace_back(pdgId2);
112 const auto absId = std::abs(pdgId2);
115 typeLabel =
"EV_Electron";
118 typeLabel =
"EV_NeutrinoElectron";
121 typeLabel =
"EV_Muon";
124 typeLabel =
"EV_NeutrinoMuon";
127 typeLabel =
"EV_Tau";
130 typeLabel =
"EV_NeutrinoTau";
133 typeLabel =
"EV_Top";
136 typeLabel =
"EV_Bottom";
139 typeLabel =
"EV_Photon";
145 typeLabel = ( pdgId2 == 24) ?
"EV_Wplus":
"EV_Wminus";
152 typeEV.emplace_back(typeLabel);
153 label.emplace_back(
"none" );
156 const auto nEntries =
phi.size();
160 DataMap[
"energy"] = std::move(energy);
161 DataMap[
"mass"] = std::move(mass);
165 DataMap[
"pdgId"] = std::move(pdgId);
166 DataMap[
"typeEV"] = std::move(typeEV);
168 DataMap[
"dataType"] = std::move(dataType);
171 ATH_MSG_DEBUG(
" retrieved with " << nEntries <<
" entries");
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_MSG_WARNING(x)
double charge(const T &p)
char data[hepevt_bytes_allocation_ATLAS]
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
ServiceHandle< StoreGateSvc > & evtStore()
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 std::string m_typeName
The data type that is generated by this retriever.
const DataMap getData(const CompositeParticleContainer *)
Retrieve basic parameters, mainly four-vectors, for each collection.
virtual std::string dataTypeName() const
Return the name of the data type.
virtual StatusCode retrieve(ToolHandle< IFormatTool > &FormatTool)
Retrieve all the data.
CompositeParticleRetriever(const std::string &type, const std::string &name, const IInterface *parent)
Standard Constructor.
a const_iterator facade to DataHandle.
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.
Extra patterns decribing particle interation process.