|
ATLAS Offline Software
|
Go to the documentation of this file.
6 #include "AthLinks/ElementLink.h"
10 #include "GaudiKernel/MsgStream.h"
11 #include "GaudiKernel/DataSvc.h"
12 #include "GaudiKernel/PhysicalConstants.h"
34 return StatusCode::SUCCESS;
42 ATH_MSG_WARNING(
"xAOD Photon Truth Particles are already available in the event");
43 return StatusCode::SUCCESS;
51 xTruthParticleContainerPhoton->setStore(xTruthParticleAuxContainerPhoton);
59 return StatusCode::FAILURE;
63 for (itr = xTruthEventContainer->
begin(); itr!=xTruthEventContainer->
end(); ++itr) {
65 std::vector<int> uniqueID_list;
69 unsigned int nPart = (*itr)->nTruthParticles();
71 for (
unsigned int iPart = 0; iPart < nPart; ++iPart) {
80 if (uniqueID_list.size() > 0){
81 found = (
std::find(uniqueID_list.begin(), uniqueID_list.end(), my_uniqueID) != uniqueID_list.end());
86 uniqueID_list.push_back(my_uniqueID);
93 xTruthParticleContainerPhoton->
push_back( xTruthParticle );
96 *xTruthParticle=*theParticle;
99 if (zero_uniqueID != 0 || dup_uniqueID != 0)
ATH_MSG_INFO(
"Found " << zero_uniqueID <<
" uniqueID zero particles and " <<dup_uniqueID<<
" duplicated");
102 return StatusCode::SUCCESS;
def retrieve(aClass, aKey=None)
std::string m_xaodTruthParticleContainerName
Const iterator class for DataVector/DataList.
std::string find(const std::string &s)
return a remapped string
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
virtual StatusCode initialize()
Function initialising the algorithm.
std::string m_xaodTruthParticleContainerNamePhoton
The key for the output xAOD truth containers.
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
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.
virtual StatusCode execute()
Function executing the algorithm.
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.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
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.
xAODTruthParticleSlimmerPhoton(const std::string &name, ISvcLocator *svcLoc)
Regular algorithm constructor.
bool isStable(const T &p)
Identify if the particle is stable, i.e. has not decayed.
#define ATH_MSG_WARNING(x)
bool isPhoton(const xAOD::Egamma *eg)
is the object a photon
std::string m_xaodTruthEventContainerName
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.