|
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"
26 , m_classif(
"MCTruthClassifier/DFCommonTruthClassifier")
40 return StatusCode::SUCCESS;
48 ATH_MSG_WARNING(
"xAOD Gen Truth Particles are already available in the event");
49 return StatusCode::SUCCESS;
57 xTruthParticleContainerGen->setStore(xTruthParticleAuxContainerGen);
65 return StatusCode::FAILURE;
72 return StatusCode::FAILURE;
77 for (itr = xTruthEventContainer->
begin(); itr!=xTruthEventContainer->
end(); ++itr) {
79 unsigned int nPart = (*itr)->nTruthParticles();
80 std::vector<int> uniqueID_list;
84 for (
unsigned int iPart = 0; iPart < nPart; ++iPart) {
93 if (uniqueID_list.size() > 0){
94 found = (
std::find(uniqueID_list.begin(), uniqueID_list.end(), my_uniqueID) != uniqueID_list.end());
99 uniqueID_list.push_back(my_uniqueID);
104 xTruthParticleContainerGen->
push_back( xTruthParticle );
106 *xTruthParticle=*theParticle;
109 if (zero_uniqueID != 0 || dup_uniqueID != 0)
ATH_MSG_INFO(
"Found " << zero_uniqueID <<
" uniqueID=0 particles and " << dup_uniqueID <<
" duplicated");
112 return StatusCode::SUCCESS;
def retrieve(aClass, aKey=None)
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 execute()
Function executing the algorithm.
virtual StatusCode initialize()
Function initialising the algorithm.
std::string m_xaodTruthParticleContainerName
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.
TruthParticle_v1 TruthParticle
Typedef to implementation.
std::string m_xaodTruthEventContainerName
ToolHandle< IMCTruthClassifier > m_classif
#define CHECK(...)
Evaluate an expression and check for errors.
constexpr int UNDEFINED_ID
xAODTruthParticleSlimmerGen(const std::string &name, ISvcLocator *svcLoc)
Regular algorithm constructor.
std::string m_xaodTruthParticleContainerNameGen
The key for the output xAOD truth containers.
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.
#define ATH_MSG_WARNING(x)
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.