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();
135 if (pdg_id == -11 || pdg_id == -13 || pdg_id == 211) {
136 if (ticl_cand.trackPtr().isNonnull()) {
137 auto charge = ticl_cand.trackPtr()->charge();
138 ticl_cand.setCharge(
charge);
139 ticl_cand.setPdgId(pdg_id *
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);
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
std::unique_ptr< TracksterTrackPluginBase > track_algo_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
std::unique_ptr< TracksterMomentumPluginBase > momentum_algo_
std::vector< edm::EDGetTokenT< std::vector< Trackster > > > trackster_tokens_
size_t max_index(const std::vector< T > &v)