Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
Go to the documentation of this file.
22 #ifndef XAOD_STANDALONE
42 return StatusCode::SUCCESS;
48 std::vector<const xAOD::TruthParticle*>& promptLeptons,
49 std::map<const xAOD::TruthParticle*,unsigned int>& tc_results)
const {
54 int pdgid =
tp->pdgId();
86 if (abs(
tp->pdgId()) <= 4900101)
return false;
87 if (
tp->hasDecayVtx()) {
88 size_t good_hadrons = 0;
89 for (
size_t p = 0;
p <
tp->end_vertex()->nOutgoingParticles(); ++
p) {
94 if (good_hadrons == 0)
return false;
119 std::vector<int> used_vertices;
121 used_vertices.clear();
122 if (
comesFrom(
tp,anID,used_vertices))
return false;
132 std::map<const xAOD::TruthParticle*,unsigned int>& tc_results)
const
134 if(tc_results.find(
tp) == tc_results.end()) {
138 return tc_results[
tp];
144 #ifndef XAOD_STANDALONE
148 int barcodeOffset_tmp(0);
149 ATH_MSG_INFO(
"Look for barcode offset in metadata ... ");
154 ATH_MSG_DEBUG(
" Could not retrieve barcode offset in metadata : "<<
e.what());
159 #else // standalone :
186 static std::once_flag metaDataFlag;
189 std::vector<const xAOD::TruthParticle*> promptLeptons;
190 promptLeptons.reserve(10);
194 if ( !truthEvents.isValid() ) {
201 std::map<const xAOD::TruthParticle*,unsigned int> tc_results;
203 size_t numCopied = 0;
206 ATH_MSG_ERROR(
"Null pointer received for first truth event!");
220 promptLeptons.push_back(
tp);
232 ptruth->push_back(
tp);
243 if (!truthParticles_out.put(std::move(ptruth))) {
244 ATH_MSG_ERROR(
"Unable to write new TruthParticleContainer to event store: "
247 ATH_MSG_DEBUG(
"Created new TruthParticleContainer in event store: "
257 if (!
tp)
return false;
259 if (!
tp->prodVtx() ||
tp->nParents()==0)
return false;
267 if (!
tp->parent(
par))
continue;
269 if (
tp->parent(
par)->absPdgId()==pdgID)
return true;
271 if (
comesFrom(
tp->parent(
par), pdgID, used_vertices))
return true;
constexpr int SIM_BARCODE_THRESHOLD
Constant defining the barcode threshold for simulated particles, eg. can be used to separate generato...
std::string find(const std::string &s)
return a remapped string
Gaudi::Property< bool > m_includeSM
bool comesFrom(const xAOD::TruthParticle *tp, const int pdgID, std::vector< int > &used_vertices) const
Helper class to provide type-safe access to aux data.
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
bool isHiddenValley(const T &p)
PDG rule 11k Hidden Valley particles have n = 4 and n_r = 9, and trailing numbers in agreement with t...
DataVector adapter that acts like it holds const pointers.
const TruthParticle * truthParticle(size_t index) const
Get a pointer to one of the truth particles.
bool isNeutrino(const T &p)
APID: the fourth generation neutrinos are neutrinos.
Gaudi::Property< float > m_maxAbsEta
Maximum allowed eta for particles in jets.
std::tuple< unsigned int, T > defOrigOfParticle(T thePart)
Gaudi::Property< bool > m_includeDark
#define ATH_MSG_VERBOSE(x)
Gaudi::Property< bool > m_includeMu
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
SG::WriteHandleKey< ConstDataVector< xAOD::TruthParticleContainer > > m_outTruthPartKey
Key for output truth particles.
bool is_simulation_particle(const T &p)
Method to establish if a particle (or barcode) was created during the simulation (TODO update to be s...
::StatusCode StatusCode
StatusCode definition for legacy code.
bool isElectron(const xAOD::Egamma *eg)
is the object an electron (not Fwd)
Class describing a truth particle in the MC record.
int setBarCodeFromMetaDataCheck() const
Class describing a signal truth event in the MC record.
SG::ReadHandleKey< xAOD::TruthEventContainer > m_truthEventKey
Key for input truth event.
Gaudi::Property< bool > m_includePromptLeptons
Gaudi::Property< std::string > m_dressingName
Name of the decoration to be used for identifying FSR (dressing) photons.
virtual int execute() const
redefine execute so we can call our own classify() with the barcode offset for the current event.
Gaudi::Property< bool > m_includePromptPhotons
Gaudi::Property< bool > m_includeBSMNonInt
size_t nTruthParticles() const
Get the number of truth particles.
ToolHandle< IMCTruthClassifier > m_classif
Handle on MCTruthClassifier for finding prompt leptons.
bool isStable(const T &p)
Identify if the particle is stable, i.e. has not decayed.
bool classifyJetInput(const xAOD::TruthParticle *tp, std::vector< const xAOD::TruthParticle * > &promptLeptons, std::map< const xAOD::TruthParticle *, unsigned int > &tc_results) const
Redefine our own Classifier function(s)
int isPrompt(const unsigned int classify, bool allow_prompt_tau_decays=true)
#define ATH_MSG_WARNING(x)
DataVector adapter that acts like it holds const pointers.
Gaudi::Property< float > m_ptmin
Minimum pT for particle selection (in MeV)
bool isPhoton(const xAOD::Egamma *eg)
is the object a photon
Gaudi::Property< std::vector< int > > m_vetoPDG_IDs
virtual StatusCode initialize()
Function initialising the tool.
bool isInteracting(const T &p)
Identify if the particle with given PDG ID would not interact with the detector, i....
unsigned int getTCresult(const xAOD::TruthParticle *tp, std::map< const xAOD::TruthParticle *, unsigned int > &tc_results) const
bool isZeroEnergyPhoton(const T &p)
Identify a photon with zero energy. Probably a workaround for a generator bug.
Gaudi::Property< bool > m_includeNu
Define macros for attributes used to control the static checker.
static std::string retrieveMetadata(const std::string &folder, const std::string &key, const ServiceHandle< StoreGateSvc > &inputMetaStore)
method that always returns as a string you can use from, e.g, pyROOT with evt = ROOT....
CopyTruthJetParticles(const std::string &name)
Constructor.