|
ATLAS Offline Software
|
Go to the documentation of this file.
6 #include "AthLinks/ElementLink.h"
11 #include "GaudiKernel/MsgStream.h"
12 #include "GaudiKernel/DataSvc.h"
13 #include "GaudiKernel/PhysicalConstants.h"
34 return StatusCode::SUCCESS;
42 ATH_MSG_WARNING(
"xAOD Muon Truth Particles are already available in the event");
43 return StatusCode::SUCCESS;
51 xTruthParticleContainerMuon->setStore(xTruthParticleAuxContainerMuon);
59 return StatusCode::FAILURE;
63 for (itr = xTruthEventContainer->
begin(); itr!=xTruthEventContainer->
end(); ++itr) {
65 std::vector<int> uniqueID_list;
68 unsigned int nPart = (*itr)->nTruthParticles();
69 for (
unsigned int iPart = 0; iPart < nPart; ++iPart) {
78 if (uniqueID_list.size() > 0){
79 found = (
std::find(uniqueID_list.begin(), uniqueID_list.end(), my_uniqueID) != uniqueID_list.end());
84 uniqueID_list.push_back(my_uniqueID);
91 xTruthParticleContainerMuon->
push_back( xTruthParticle );
93 *xTruthParticle=*theParticle;
96 ATH_MSG_INFO(
"Found "<< zero_uniqueID <<
" uniqueID-zero partciles and " << dup_uniqueID <<
" duplicates");
99 return StatusCode::SUCCESS;
def retrieve(aClass, aKey=None)
Const iterator class for DataVector/DataList.
xAODTruthParticleSlimmerMuon(const std::string &name, ISvcLocator *svcLoc)
Regular algorithm constructor.
std::string m_xaodTruthParticleContainerName
std::string find(const std::string &s)
return a remapped string
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
std::string m_xaodTruthEventContainerName
Auxiliary store for the truth vertices.
TruthParticleAuxContainer_v1 TruthParticleAuxContainer
Declare the latest version of the truth particle auxiliary container.
::StatusCode StatusCode
StatusCode definition for legacy code.
Class describing a truth particle in the MC record.
TruthParticle_v1 TruthParticle
Typedef to implementation.
#define CHECK(...)
Evaluate an expression and check for errors.
constexpr int UNDEFINED_ID
Helpers for checking error return status codes and reporting errors.
virtual StatusCode initialize()
Function initialising the algorithm.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
virtual StatusCode execute()
Function executing the algorithm.
TruthParticleContainer_v1 TruthParticleContainer
Declare the latest version of the truth particle container.
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
bool isStable(const T &p)
Identify if the particle is stable, i.e. has not decayed.
#define ATH_MSG_WARNING(x)
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
std::string m_xaodTruthParticleContainerNameMuon
The key for the output xAOD truth containers.