Loading [MathJax]/extensions/tex2jax.js
 |
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"
37 return StatusCode::SUCCESS;
45 ATH_MSG_WARNING(
"xAOD MET Truth Particles are already available in the event");
46 return StatusCode::SUCCESS;
51 ATH_CHECK(xTruthParticleContainerMET.
record(std::make_unique<xAOD::TruthParticleContainer>(), std::make_unique<xAOD::TruthParticleAuxContainer>()));
56 if ( !xTruthEventContainer.isValid() )
59 return StatusCode::FAILURE;
67 for (itr = xTruthEventContainer->begin(); itr!=xTruthEventContainer->end(); ++itr) {
69 unsigned int nPart = (*itr)->nTruthParticles();
70 std::vector<int> uniqueID_list;
74 for (
unsigned int iPart = 0; iPart < nPart; ++iPart) {
83 if (uniqueID_list.size() > 0){
84 found = (
std::find(uniqueID_list.begin(), uniqueID_list.end(), my_uniqueID) != uniqueID_list.end());
89 uniqueID_list.push_back(my_uniqueID);
102 xTruthParticleContainerMET->
push_back( xTruthParticle );
105 *xTruthParticle=*theParticle;
110 if(zero_uniqueID != 0 || dup_uniqueID !=0 )
ATH_MSG_INFO(
"Found " << zero_uniqueID <<
" uniqueID=0 particles and " <<dup_uniqueID <<
"duplicated");
113 return StatusCode::SUCCESS;
Const iterator class for DataVector/DataList.
std::string find(const std::string &s)
return a remapped string
bool isGenStable() const
Check if this is generator stable particle.
bool prompt(const xAOD::TruthParticle *part, ToolHandle< IMCTruthClassifier > &m_classif)
const std::string & key() const
Return the StoreGate ID for the referenced object.
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
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.
virtual StatusCode execute()
Function executing the algorithm.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
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.
SG::WriteHandleKey< xAOD::TruthParticleContainer > m_xaodTruthParticleContainerNameMET
The key for the output xAOD truth containers.
SG::ReadHandleKey< xAOD::TruthEventContainer > m_xaodTruthEventContainerName
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
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.
PublicToolHandle< IMCTruthClassifier > m_classif
bool isInteracting(const T &p)
Identify if the particle with given PDG ID would not interact with the detector, i....