![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
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"
27 , m_classif(
"MCTruthClassifier/DFCommonTruthClassifier")
41 return StatusCode::SUCCESS;
49 ATH_MSG_WARNING(
"xAOD MET Truth Particles are already available in the event");
50 return StatusCode::SUCCESS;
58 xTruthParticleContainerMET->setStore(xTruthParticleAuxContainerMET);
66 return StatusCode::FAILURE;
73 return StatusCode::FAILURE;
81 for (itr = xTruthEventContainer->
begin(); itr!=xTruthEventContainer->
end(); ++itr) {
83 unsigned int nPart = (*itr)->nTruthParticles();
84 std::vector<int> uniqueID_list;
88 for (
unsigned int iPart = 0; iPart < nPart; ++iPart) {
97 if (uniqueID_list.size() > 0){
98 found = (
std::find(uniqueID_list.begin(), uniqueID_list.end(), my_uniqueID) != uniqueID_list.end());
103 uniqueID_list.push_back(my_uniqueID);
116 xTruthParticleContainerMET->
push_back( xTruthParticle );
119 *xTruthParticle=*theParticle;
124 if(zero_uniqueID != 0 || dup_uniqueID !=0 )
ATH_MSG_INFO(
"Found " << zero_uniqueID <<
" uniqueID=0 particles and " <<dup_uniqueID <<
"duplicated");
127 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
std::string m_xaodTruthParticleContainerName
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
ToolHandle< IMCTruthClassifier > m_classif
bool isGenStable() const
Check if this is generator stable particle.
bool prompt(const xAOD::TruthParticle *part, ToolHandle< IMCTruthClassifier > &m_classif)
std::string m_xaodTruthParticleContainerNameMET
The key for the output xAOD truth containers.
std::string m_xaodTruthEventContainerName
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.
Helper class to provide type-safe access to aux data.
virtual StatusCode initialize()
Function initialising the algorithm.
::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.
virtual StatusCode execute()
Function executing the algorithm.
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.
int isPrompt(const unsigned int classify, bool allow_prompt_tau_decays=true)
#define ATH_MSG_WARNING(x)
xAODTruthParticleSlimmerMET(const std::string &name, ISvcLocator *svcLoc)
Regular algorithm constructor.
bool isInteracting(const T &p)
Identify if the particle with given PDG ID would not interact with the detector, i....
int pdgId() const
PDG ID code.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.