64 std::vector<float> trkChi2Map(nCand, 0);
67 for (
size_t i = 0;
i <
trks->size();
i++) {
69 const auto& lostTrack = (*tracks2LT)[trk];
70 if (lostTrack.isNonnull()) {
71 const float nChi2 = trk->normalizedChi2();
72 trkChi2Map.at(lostTrack.key()) = MiniFloatConverter::reduceMantissaToNbitsRounding<roundingPrecision>(nChi2);
76 for (
size_t i = 0;
i < nCand;
i++) {
80 if (
cand->charge() == 0 || !
cand->hasTrackDetails())
83 const auto& candTrack = (*candidate2PF)[
cand]->trackRef();
85 if (candTrack.isNonnull()) {
86 const float nChi2 = candTrack->normalizedChi2();
88 trkChi2Map.at(
i) = MiniFloatConverter::reduceMantissaToNbitsRounding<roundingPrecision>(nChi2);
94 std::unique_ptr<FloatMap> valueMap = std::make_unique<FloatMap>();
105 ->setComment(
"packed candidate input collection");
107 desc.add<
bool>(
"doLostTracks",
false);
108 descriptions.
add(
"packedPFCandidateTrackChi2",
desc);
T getParameter(std::string const &) const
std::vector< pat::PackedCandidate > PackedCandidateCollection
std::vector< Track > TrackCollection
collection of Tracks
const edm::EDGetTokenT< pat::PackedCandidateCollection > candidateToken_
edm::EDGetTokenT< edm::Association< pat::PackedCandidateCollection > > track2LostTrackToken_
edm::EDGetTokenT< edm::Association< reco::PFCandidateCollection > > candidate2PFToken_
static void fillDescriptions(edm::ConfigurationDescriptions &)
edm::Ref< pat::PackedCandidateCollection > PackedCandidateRef
#define DEFINE_FWK_MODULE(type)
edm::ValueMap< float > FloatMap
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
void add(std::string const &label, ParameterSetDescription const &psetDescription)
const edm::EDGetTokenT< reco::TrackCollection > trackToken_
static const uint8_t roundingPrecision
void produce(edm::Event &, const edm::EventSetup &) override
PackedCandidateTrackChi2Producer(const edm::ParameterSet &iConfig)