|
ATLAS Offline Software
|
Go to the documentation of this file.
7 #include "HepPDT/ParticleData.hh"
8 #include "HepPDT/ParticleDataTable.hh"
9 #include "GaudiKernel/SystemOfUnits.h"
40 return StatusCode::SUCCESS;
56 return StatusCode::SUCCESS;
60 return StatusCode::SUCCESS;
66 for ( ; McEvtCollItr != McEvtColl->
end(); ++McEvtCollItr)
67 NParticles += (*McEvtCollItr)->particles_size();
77 DataVect rhoVertex; rhoVertex.reserve(NParticles);
78 DataVect phiVertex; phiVertex.reserve(NParticles);
79 DataVect zVertex; zVertex.reserve(NParticles);
82 DataVect rhoEndVertex; rhoEndVertex.reserve(NParticles);
83 DataVect phiEndVertex; phiEndVertex.reserve(NParticles);
84 DataVect zEndVertex; zEndVertex.reserve(NParticles);
88 for ( McEvtCollItr = McEvtColl->
begin(); McEvtCollItr != McEvtColl->
end(); ++McEvtCollItr){
92 const auto &
barcodes = (*McEvtCollItr)->attribute<HepMC::GenEventBarcodes> (
"barcodes");
93 std::map<int,int> id_to_barcode_map;
96 for (
const auto&
particle: *(*McEvtCollItr) ) {
108 float thePhi =
particle->momentum().phi();
119 const auto& vertexprod =
particle->production_vertex();
121 const auto&
pos=vertexprod->position();
123 float vtxPhi =
pos.phi();
124 phiVertex.push_back(
DataType( (vtxPhi<0)? vtxPhi+=2*
M_PI : vtxPhi ));
127 rhoVertex.push_back(
DataType( 0. ));
128 phiVertex.push_back(
DataType( 0. ));
132 const auto& vertexend =
particle->end_vertex();
134 const auto&
pos=vertexend->position();
136 float vtxPhi =
pos.phi();
137 phiEndVertex.push_back(
DataType( (vtxPhi<0)? vtxPhi+=2*
M_PI : vtxPhi ));
140 rhoEndVertex.push_back(
DataType( 0. ));
141 phiEndVertex.push_back(
DataType( 0. ));
142 zEndVertex.push_back(
DataType( 0. ));
148 myDataMap[
"pt"] =
pt;
149 myDataMap[
"phi"] =
phi;
150 myDataMap[
"eta"] =
eta;
151 myDataMap[
"code"] =
code;
152 myDataMap[
"id"] =
id;
153 myDataMap[
"rhoVertex"] = rhoVertex;
154 myDataMap[
"phiVertex"] = phiVertex;
155 myDataMap[
"zVertex"] = zVertex;
156 myDataMap[
"rhoEndVertex"] = rhoEndVertex;
157 myDataMap[
"phiEndVertex"] = phiEndVertex;
158 myDataMap[
"zEndVertex"] = zEndVertex;
Const iterator class for DataVector/DataList.
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Scalar phi() const
phi method
std::string m_McEvtCollName
Storegate key for the McEventCollection (different between RDO/ESD and AOD)
Scalar eta() const
pseudorapidity method
std::vector< DataType > DataVect
Defines a map with a key and a vector of DataType objects e.g.
std::map< std::string, DataVect > DataMap
double m_MinPtCut
Minimum pT for a particle to get accepted.
def barcodes(beg, end, sz)
::StatusCode StatusCode
StatusCode definition for legacy code.
virtual std::string dataTypeName() const
Return the name of the data type.
This defines the McEventCollection, which is really just an ObjectVector of McEvent objects.
TruthTrackRetriever(const std::string &type, const std::string &name, const IInterface *parent)
Standard Constructor.
This header is shared inbetween the C-style server thread and the C++ Athena ServerSvc.
StatusCode initialize()
Default AthAlgTool methods.
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
double m_MinRhoCut
Minium radius of the end-vertex for the particle to get accepted.
virtual StatusCode retrieve(ToolHandle< IFormatTool > &FormatTool)
Retrieve all the data.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.