42 }
else if (
pdgId == 11) {
44 }
else if (
pdgId == 13) {
72 const bool doNose_ =
false;
91 : detector_(ps.getParameter<
std::
string>(
"detector")),
92 doNose_(detector_ ==
"HFNose"),
99 associatorLayerClusterSimCluster_(ps.getUntrackedParameter<
edm::
InputTag>(
"layerClusterSimClusterAssociator")),
100 associatorMapSimClusterToReco_token_(
102 associatorLayerClusterCaloParticle_(
103 ps.getUntrackedParameter<
edm::
InputTag>(
"layerClusterCaloParticleAssociator")),
106 fractionCut_(ps.getParameter<double>(
"fractionCut")) {
107 produces<std::vector<Trackster>>();
108 produces<std::vector<float>>();
123 edm::InputTag(
"layerClusterCaloParticleAssociationProducer"));
124 desc.add<
double>(
"fractionCut", 0.);
126 descriptions.
add(
"trackstersFromSimClustersProducer",
desc);
130 auto result = std::make_unique<std::vector<Trackster>>();
131 auto output_mask = std::make_unique<std::vector<float>>();
146 result->reserve(num_simclusters);
148 for (
const auto& [
key,
values] : caloParticlesToRecoColl) {
149 auto const&
cp = *(
key);
151 if (
cp.g4Tracks()[0].crossedBoundary()) {
158 for (
auto const& [lc, energyScorePair] :
values) {
159 if (inputClusterMask[lc.index()] > 0) {
160 double fraction = energyScorePair.first / lc->energy();
163 tmpTrackster.
vertices().push_back(lc.index());
164 (*output_mask)[lc.index()] -=
fraction;
169 float energyAtBoundary =
cp.g4Tracks()[0].getMomentumAtBoundary().energy();
172 result->emplace_back(tmpTrackster);
174 for (
const auto& scRef :
cp.simClusters()) {
175 const auto& it = simClustersToRecoColl.find(scRef);
176 if (it == simClustersToRecoColl.end())
178 const auto& lcVec = it->val;
181 auto const& sc = *(scRef);
186 tmpTrackster.
vertices().reserve(lcVec.size());
189 for (
auto const& [lc, energyScorePair] : lcVec) {
190 if (inputClusterMask[lc.index()] > 0) {
191 double fraction = energyScorePair.first / lc->energy();
194 tmpTrackster.
vertices().push_back(lc.index());
195 (*output_mask)[lc.index()] -=
fraction;
199 tmpTrackster.
setIdProbability(tracksterParticleTypeFromPdgId(sc.pdgId(), sc.charge()), 1.
f);
200 float energyAtBoundary = sc.g4Tracks()[0].getMomentumAtBoundary().energy();
202 tmpTrackster.
setSeed(scRef.id(), simClusterIndex);
203 result->emplace_back(tmpTrackster);