28 std::vector<edm::EDGetTokenT<HGCRecHitCollection>>
hitsTokens_;
40 for (
const auto&
tag :
pset.getParameter<std::vector<edm::InputTag>>(
"hits")) {
45 produces<ticl::AssociationMap<ticl::mapWithFraction>>(
"hitTo" + tracksterToken.first);
46 produces<ticl::AssociationMap<ticl::mapWithFraction>>(tracksterToken.first +
"ToHit");
70 auto hitToTracksterMap = std::make_unique<ticl::AssociationMap<ticl::mapWithFraction>>(rechitManager.
size());
73 for (
unsigned int tracksterId = 0; tracksterId <
tracksters->size(); ++tracksterId) {
74 const auto& trackster = (*tracksters)[tracksterId];
75 for (
unsigned int j = 0;
j < trackster.vertices().size(); ++
j) {
76 const auto& lc = (*layer_clusters)[trackster.vertices()[
j]];
77 float invMultiplicity = 1.0f / trackster.vertex_multiplicity()[
j];
79 for (
const auto& hitAndFraction : lc.hitsAndFractions()) {
80 auto hitMapIter = hitMap->find(hitAndFraction.first);
81 if (hitMapIter != hitMap->end()) {
82 unsigned int rechitIndex = hitMapIter->second;
83 float fraction = hitAndFraction.second * invMultiplicity;
98 desc.add<std::vector<edm::InputTag>>(
"tracksterCollections",
104 desc.add<std::vector<edm::InputTag>>(
"hits",
108 descriptions.
add(
"AllHitToTracksterAssociatorsProducer",
desc);
std::vector< edm::EDGetTokenT< HGCRecHitCollection > > hitsTokens_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
~AllHitToTracksterAssociatorsProducer() override=default
edm::EDGetTokenT< std::unordered_map< DetId, const unsigned int > > hitMapToken_
#define DEFINE_FWK_MODULE(type)
edm::EDGetTokenT< std::vector< reco::CaloCluster > > layerClustersToken_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void addVector(std::span< const T > vec)
AllHitToTracksterAssociatorsProducer(const edm::ParameterSet &)
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
std::vector< std::pair< std::string, edm::EDGetTokenT< std::vector< ticl::Trackster > > > > tracksterCollectionTokens_