30 : layerClustersToken_(
35 if (
tag.instance() !=
"") {
43 produces<ticl::AssociationMap<ticl::mapWithFraction, std::vector<reco::CaloCluster>, std::vector<ticl::Trackster>>>(
44 tracksterToken.first);
61 auto lcToTracksterMap = std::make_unique<
66 for (
unsigned int tracksterId = 0; tracksterId <
tracksters->size(); ++tracksterId) {
67 const auto& trackster = (*tracksters)[tracksterId];
69 for (
unsigned int i = 0;
i < trackster.vertices().size(); ++
i) {
71 const auto& lc = (*layer_clusters)[trackster.vertices()[
i]];
72 float sharedEnergy = lc.energy() / trackster.vertex_multiplicity()[
i];
75 lcToTracksterMap->insert(lcRef, tracksterRef,
sharedEnergy);
85 desc.add<std::vector<edm::InputTag>>(
"tracksterCollections",
90 descriptions.
add(
"AllLayerClusterToTracksterAssociatorsProducer",
desc);
edm::EDGetTokenT< std::vector< reco::CaloCluster > > layerClustersToken_
std::vector< std::pair< std::string, edm::EDGetTokenT< std::vector< ticl::Trackster > > > > tracksterCollectionTokens_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
#define DEFINE_FWK_MODULE(type)
~AllLayerClusterToTracksterAssociatorsProducer() override=default
AllLayerClusterToTracksterAssociatorsProducer(const edm::ParameterSet &)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
float sharedEnergy(reco::CaloCluster const &clu1, reco::CaloCluster const &clu2, EcalRecHitCollection const &barrelRecHits, EcalRecHitCollection const &endcapRecHits)
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override