Commit 43f0e223 authored by CI Runner's avatar CI Runner
Browse files

Add a NeutralBasics particle maker

parent 6f6e32b5
Pipeline #3287510 passed with stage
in 19 seconds
......@@ -14,6 +14,7 @@
#include "GaudiAlg/Transformer.h"
#include "Event/Particle.h"
#include "Event/Particle_v2.h"
#include "Event/ProtoParticle.h"
#include "Event/RecVertex.h"
......@@ -634,4 +635,46 @@ namespace LHCb::Phys::ParticleMakers {
debug() << " Skipped : " << m_SkipPi0sCounter << endmsg;
debug() << "--------------------" << endmsg;
}
using neutral_basics_maker_output_t =
std::tuple<LHCb::Event::NeutralBasics, std::unique_ptr<LHCb::Event::CaloHypothesesWithDirection>>;
/** @class NeutralBasicsMaker
*
* @brief Create a container of neutral objects from the output of the reconstruction sequence and a set of vertices
*
*
*/
class NeutralBasicsMaker : public Gaudi::Functional::Transformer<neutral_basics_maker_output_t(
LHCb::UniqueIDGenerator const&, LHCb::Event::Calo::v2::Hypotheses const&,
LHCb::Event::v2::RecVertices const& )> {
public:
NeutralBasicsMaker( const std::string& name, ISvcLocator* pSvcLocator )
: Transformer( name, pSvcLocator,
{KeyValue{"InputUniqueIDGenerator", LHCb::UniqueIDGeneratorLocation::Default},
KeyValue{"InputCaloObjects", LHCb::Event::Calo::v2::HypothesesLocation::Default},
KeyValue{"InputPrimaryVertices", LHCb::Event::v2::RecVertexLocation::Primary}},
{KeyValue{"OutputParticles", ""}} ) {}
neutral_basics_maker_output_t operator()( LHCb::UniqueIDGenerator const& unique_id_gen,
LHCb::Event::Calo::v2::Hypotheses const& calo_hypos,
LHCb::Event::v2::RecVertices const& primary_vertices ) const override {
auto zn = Zipping::generateZipIdentifier();
auto calo_hypos_with_direction = std::make_unique<LHCb::Event::CaloHypothesesWithDirection>( unique_id_gen, zn );
calo_hypos_with_direction->reserve( calo_hypos.size() * primary_vertices.size() );
// here we are creating one hypothesis per primary vertex
for ( auto const& ch : calo_hypos )
for ( auto const& vtx : primary_vertices ) calo_hypos_with_direction->emplace_back( unique_id_gen, ch, vtx );
return {LHCb::Pr::make_zip( std::as_const( *calo_hypos_with_direction ) ),
std::move( calo_hypos_with_direction )};
}
};
DECLARE_COMPONENT( NeutralBasicsMaker )
} // namespace LHCb::Phys::ParticleMakers
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment