53 return StatusCode::SUCCESS;
64 ATH_MSG_DEBUG(
"Retrieved " << truth_particles->size() <<
" truth_particles...");
67 std::vector<const xAOD::Jet*> sorted_jets;
68 for (
const auto jet : *jets) { sorted_jets.push_back(
jet); }
70 sorted_jets.begin(), sorted_jets.end(),
72 return j1->pt() > j2->pt();
85 std::vector<const xAOD::TruthParticle*> tps_vec;
86 for (
const auto tp : *truth_particles) {
87 if(acc_vertexId(*tp) < 0)
continue;
88 if(!acc_vertexValid(*tp))
continue;
89 tps_vec.push_back(tp);
105 for(
const auto jet : sorted_jets){
106 std::vector<const xAOD::TruthParticle*> searched;
112 int num_material_int = 0;
121 if (!tp->hasProdVtx() || !prod_vtx) {
122 searched.push_back(tp);
127 searched.push_back(tp);
135 searched.push_back(tp);
137 int simple_type_i = acc_vertexSimpleType(*tp);
153 std::unordered_set<const xAOD::TruthParticle*> searched_set(searched.begin(), searched.end());
158 decoNumBVerts(*
jet) = num_b;
159 decoNumCVerts(*
jet) = num_c;
160 decoNumTauVerts(*
jet) = num_tau;
161 decoNumStrangeVerts(*
jet) = num_strange;
162 decoNumPionVerts(*
jet) = num_pion;
163 decoNumMaterialIntVerts(*
jet) = num_material_int;
164 decoNumOtherVerts(*
jet) = num_other;
165 decoNumVerts(*
jet) = num_verts;
168 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
Handle class for reading a decoration on an object.
An algorithm that can be simultaneously executed in multiple threads.
SG::WriteDecorHandleKey< xAOD::IParticleContainer > m_decoNumStrangeVerts
SG::WriteDecorHandleKey< xAOD::IParticleContainer > m_decoNumBVerts
SG::ReadDecorHandleKey< xAOD::TruthParticleContainer > m_vertexSimpleDecayType
SG::ReadHandleKey< xAOD::JetContainer > m_JetContainerKey
virtual StatusCode initialize() override
SG::WriteDecorHandleKey< xAOD::IParticleContainer > m_decoNumVerts
virtual StatusCode execute(const EventContext &) const override
Gaudi::Property< float > m_lxyIDThreshold
Gaudi::Property< float > m_drThreshold
Gaudi::Property< bool > m_onlyID
SG::ReadDecorHandleKey< xAOD::TruthParticleContainer > m_vertexID
SG::ReadDecorHandleKey< xAOD::TruthParticleContainer > m_vertexValid
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_TruthContainerKey
SG::WriteDecorHandleKey< xAOD::IParticleContainer > m_decoNumMaterialIntVerts
SG::WriteDecorHandleKey< xAOD::IParticleContainer > m_decoNumOtherVerts
SG::WriteDecorHandleKey< xAOD::IParticleContainer > m_decoNumPionVerts
Gaudi::Property< float > m_zIDThreshold
SG::WriteDecorHandleKey< xAOD::IParticleContainer > m_decoNumTauVerts
JetTruthVertexSummaryDecoratorAlg(const std::string &name, ISvcLocator *loc)
SG::WriteDecorHandleKey< xAOD::IParticleContainer > m_decoNumCVerts
Handle class for reading a decoration on an object.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
Handle class for adding a decoration to an object.
float z() const
Vertex longitudinal distance along the beam line form the origin.
float perp() const
Vertex transverse distance from the beam line.
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
DataModel_detail::iterator< DVL > remove_if(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end, Predicate pred)
Specialization of remove_if for DataVector/List.
Jet_v1 Jet
Definition of the current "jet version".
TruthVertex_v1 TruthVertex
Typedef to implementation.
TruthParticle_v1 TruthParticle
Typedef to implementation.