3#include "SimCore/Event/SimParticle.h"
9 inputTrackCollName_ = ps.
getParameter<std::string>(
"inputTrackCollName");
10 outputTrackCollName_ = ps.
getParameter<std::string>(
"outputTrackCollName");
15 return sqrt(pow(pxyz[0], 2) + pow(pxyz[1], 2) + pow(pxyz[2], 2));
19 if (!event.
exists(inputTrackCollName_)) {
20 ldmx_log(fatal) <<
"Input track collection not found";
23 const auto ecalSpHits =
26 std::vector<ldmx::SimTrackerHit> pfTracks;
28 for (
const auto& spHit : ecalSpHits) {
29 if (spHit.getTrackID() != 1 || fabs(240 - spHit.getPosition()[2]) > 0.1 ||
30 spHit.getMomentum()[2] <= 0)
32 if (spHit.getPdgID() == 22 || spHit.getPdgID() == 2112)
continue;
33 pfTracks.push_back(spHit);
37 std::sort(pfTracks.begin(), pfTracks.end(),
39 return getP(a) > getP(b);
41 event.add(outputTrackCollName_, pfTracks);
#define DECLARE_PRODUCER_NS(NS, CLASS)
Macro which allows the framework to construct a producer given its name during configuration.
Track selection skeleton for PFlow Reco.
Class which encapsulates information from a hit in a simulated tracking detector.
Implements an event buffer system for storing event data.
bool exists(const std::string &name, const std::string &passName="", bool unique=true) const
Check for the existence of an object or collection with the given name and pass name in the event.
Class encapsulating parameters for configuring a processor.
T getParameter(const std::string &name) const
Retrieve the parameter of the given name.
Represents a simulated tracker hit in the simulation.
std::vector< double > getMomentum() const
Get the XYZ momentum of the particle at the position at which the hit took place [MeV].
virtual void produce(framework::Event &event)
Process the event and put new data products into it.
virtual void configure(framework::config::Parameters &ps)
Callback for the EventProcessor to configure itself from the given set of parameters.