64 : min_particle_prob_(ps.getParameter<double>(
"minParticleProbability")) {
67 [
this](
edm::InputTag const&
tag) { return consumes<std::vector<Trackster>>(tag); });
68 produces<std::vector<TICLCandidate>>();
71 pset_momentum.getParameter<
std::string>(
"plugin"), pset_momentum, consumesCollector());
75 pset_track.getParameter<
std::string>(
"plugin"), pset_track, consumesCollector());
81 std::vector<edm::InputTag> source_vector{
edm::InputTag(
"trackstersTrk"),
85 desc.add<std::vector<edm::InputTag>>(
"tracksterCollections", source_vector);
86 desc.add<
double>(
"minParticleProbability", 0.);
89 desc_momentum.
add<
std::string>(
"plugin",
"TracksterP4FromEnergySum");
90 desc_momentum.
add<
bool>(
"energyFromRegression",
false);
100 descriptions.
add(
"ticlCandidateFromTrackstersProducer",
desc);
104 auto result = std::make_unique<std::vector<TICLCandidate>>();
106 std::vector<const Trackster*> trackster_ptrs;
112 for (
size_t i_trackster = 0; i_trackster < trackster_h->size(); ++i_trackster) {
113 auto const& trackster = trackster_h->at(i_trackster);
114 auto id_prob_begin = std::begin(trackster.id_probabilities());
115 auto max_id_prob_it = std::max_element(id_prob_begin,
std::end(trackster.id_probabilities()));
116 float max_id_prob = *max_id_prob_it;
120 trackster_ptrs.push_back(&trackster);
123 auto pdg_id = pdg_id_from_particle_type(static_cast<ticl::Trackster::ParticleType>(
max_index));
124 ticl_cand.setPdgId(
pdg_id);
132 for (
size_t i = 0;
i <
result->size(); ++
i) {
133 auto& ticl_cand =
result->at(
i);
134 auto pdg_id = ticl_cand.pdgId();
136 if (ticl_cand.trackPtr().isNonnull()) {
137 auto charge = ticl_cand.trackPtr()->charge();
138 ticl_cand.setCharge(
charge);
144 if (ticl_cand.rawEnergy() == 0.) {
145 auto const& three_mom = ticl_cand.trackPtr()->momentum();
146 constexpr
double mpion2 = 0.13957 * 0.13957;
149 ticl_cand.setP4(trk_p4);
150 ticl_cand.setRawEnergy(
energy);
154 ticl_cand.setCharge(0);
156 ticl_cand.setPdgId(22);
158 ticl_cand.setPdgId(130);