31 static std::unique_ptr<TrackstersCache> initializeGlobalCache(
const edm::ParameterSet &);
39 void energyRegressionAndID(
const std::vector<reco::CaloCluster> &layerClusters, std::vector<Trackster> &
result)
const;
40 void printTrackstersDebug(
const std::vector<Trackster> &,
const char *
label)
const;
41 void assignTimeToCandidates(std::vector<TICLCandidate> &resultCandidates)
const;
42 void dumpTrackster(
const Trackster &)
const;
81 static constexpr
int eidNFeatures_ = 3;
90 clusters_token_(consumes<std::
vector<
reco::CaloCluster>>(ps.getParameter<edm::
InputTag>(
"layer_clusters"))),
92 consumes<edm::ValueMap<std::pair<float, float>>>(ps.getParameter<edm::
InputTag>(
"layer_clustersTime"))),
93 tracks_token_(consumes<std::
vector<
reco::Track>>(ps.getParameter<edm::
InputTag>(
"tracks"))),
95 optimiseAcrossTracksters_(ps.getParameter<bool>(
"optimiseAcrossTracksters")),
96 eta_bin_window_(ps.getParameter<int>(
"eta_bin_window")),
97 phi_bin_window_(ps.getParameter<int>(
"phi_bin_window")),
98 pt_sigma_high_(ps.getParameter<double>(
"pt_sigma_high")),
99 pt_sigma_low_(ps.getParameter<double>(
"pt_sigma_low")),
100 halo_max_distance2_(ps.getParameter<double>(
"halo_max_distance2")),
101 track_min_pt_(ps.getParameter<double>(
"track_min_pt")),
102 track_min_eta_(ps.getParameter<double>(
"track_min_eta")),
103 track_max_eta_(ps.getParameter<double>(
"track_max_eta")),
104 track_max_missing_outerhits_(ps.getParameter<int>(
"track_max_missing_outerhits")),
105 cosangle_align_(ps.getParameter<double>(
"cosangle_align")),
106 e_over_h_threshold_(ps.getParameter<double>(
"e_over_h_threshold")),
107 pt_neutral_threshold_(ps.getParameter<double>(
"pt_neutral_threshold")),
108 resol_calo_offset_had_(ps.getParameter<double>(
"resol_calo_offset_had")),
109 resol_calo_scale_had_(ps.getParameter<double>(
"resol_calo_scale_had")),
110 resol_calo_offset_em_(ps.getParameter<double>(
"resol_calo_offset_em")),
111 resol_calo_scale_em_(ps.getParameter<double>(
"resol_calo_scale_em")),
112 debug_(ps.getParameter<bool>(
"debug")),
113 eidInputName_(ps.getParameter<std::
string>(
"eid_input_name")),
114 eidOutputNameEnergy_(ps.getParameter<std::
string>(
"eid_output_name_energy")),
115 eidOutputNameId_(ps.getParameter<std::
string>(
"eid_output_name_id")),
116 eidMinClusterEnergy_(ps.getParameter<double>(
"eid_min_cluster_energy")),
117 eidNLayers_(ps.getParameter<int>(
"eid_n_layers")),
118 eidNClusters_(ps.getParameter<int>(
"eid_n_clusters")),
119 eidSession_(nullptr) {
122 if (trackstersCache ==
nullptr || trackstersCache->
eidGraphDef ==
nullptr) {
124 <<
"TrackstersMergeProducer received an empty graph definition from the global cache";
128 produces<std::vector<Trackster>>();
129 produces<std::vector<TICLCandidate>>();
133 const std::vector<Trackster> &tracksters,
136 for (
auto const &
t : tracksters) {
137 tracksterTile.
fill(tracksterIteration,
t.barycenter().eta(),
t.barycenter().phi(), tracksterId);
138 LogDebug(
"TrackstersMergeProducer") <<
"Adding tracksterId: " << tracksterId <<
" into bin [eta,phi]: [ "
139 << tracksterTile[tracksterIteration].etaBin(
t.barycenter().eta()) <<
", "
140 << tracksterTile[tracksterIteration].phiBin(
t.barycenter().phi())
141 <<
"] for iteration: " << tracksterIteration << std::endl;
148 auto e_over_h = (t.raw_em_pt() / ((t.raw_pt() - t.raw_em_pt()) != 0. ? (t.raw_pt() - t.raw_em_pt()) : 1.));
150 <<
"\nTrackster raw_pt: " << t.raw_pt() <<
" raw_em_pt: " << t.raw_em_pt() <<
" eoh: " << e_over_h
151 <<
" barycenter: " << t.barycenter() <<
" eta,phi (baricenter): " << t.barycenter().eta() <<
", "
152 << t.barycenter().phi() <<
" eta,phi (eigen): " << t.eigenvectors(0).eta() <<
", " << t.eigenvectors(0).phi()
153 <<
" pt(eigen): " <<
std::sqrt(t.eigenvectors(0).Unit().perp2()) * t.raw_energy() <<
" seedID: " << t.seedID()
154 <<
" seedIndex: " << t.seedIndex() <<
" size: " << t.vertices().size() <<
" average usage: "
155 << (std::accumulate(
std::begin(t.vertex_multiplicity()),
std::end(t.vertex_multiplicity()), 0.) /
156 (float)t.vertex_multiplicity().size())
157 <<
" raw_energy: " << t.raw_energy() <<
" regressed energy: " << t.regressed_energy()
158 <<
" probs(ga/e/mu/np/cp/nh/am/unk): ";
159 for (
auto const &
p : t.id_probabilities()) {
160 LogDebug(
"TrackstersMergeProducer") << std::fixed <<
p <<
" ";
162 LogDebug(
"TrackstersMergeProducer") <<
" sigmas: ";
163 for (
auto const &
s : t.sigmas()) {
164 LogDebug(
"TrackstersMergeProducer") <<
s <<
" ";
166 LogDebug(
"TrackstersMergeProducer") << std::endl;
172 auto resultTrackstersMerged = std::make_unique<std::vector<Trackster>>();
173 auto resultCandidates = std::make_unique<std::vector<TICLCandidate>>();
176 std::vector<bool> usedTrackstersMerged;
177 std::vector<int> indexInMergedCollTRKEM;
178 std::vector<int> indexInMergedCollEM;
179 std::vector<int> indexInMergedCollTRK;
180 std::vector<int> indexInMergedCollHAD;
181 std::vector<bool> usedSeeds;
184 std::map<int, std::vector<std::pair<int, TracksterIterIndex>>> seedToTracksterAssociator;
187 const auto &
tracks = *track_h;
191 const auto &layerClusters = *cluster_h;
195 const auto &layerClustersTimes = *clustersTime_h;
199 const auto &trackstersEM = *trackstersem_h;
203 const auto &trackstersTRKEM = *tracksterstrkem_h;
207 const auto &trackstersTRK = *tracksterstrk_h;
211 const auto &trackstersHAD = *trackstershad_h;
215 const auto &seedingTrk = *seedingTrk_h;
216 usedSeeds.resize(
tracks.size(),
false);
218 fillTile(tracksterTile, trackstersTRKEM, TracksterIterIndex::TRKEM);
219 fillTile(tracksterTile, trackstersEM, TracksterIterIndex::EM);
220 fillTile(tracksterTile, trackstersTRK, TracksterIterIndex::TRKHAD);
221 fillTile(tracksterTile, trackstersHAD, TracksterIterIndex::HAD);
223 auto totalNumberOfTracksters =
224 trackstersTRKEM.size() + trackstersTRK.size() + trackstersEM.size() + trackstersHAD.size();
225 resultTrackstersMerged->reserve(totalNumberOfTracksters);
226 usedTrackstersMerged.resize(totalNumberOfTracksters,
false);
227 indexInMergedCollTRKEM.reserve(trackstersTRKEM.size());
228 indexInMergedCollEM.reserve(trackstersEM.size());
229 indexInMergedCollTRK.reserve(trackstersTRK.size());
230 indexInMergedCollHAD.reserve(trackstersHAD.size());
239 for (
auto const &
t : trackstersTRKEM) {
240 indexInMergedCollTRKEM.push_back(resultTrackstersMerged->size());
241 seedToTracksterAssociator[
t.seedIndex()].emplace_back(resultTrackstersMerged->size(), TracksterIterIndex::TRKEM);
242 resultTrackstersMerged->push_back(
t);
245 for (
auto const &
t : trackstersEM) {
246 indexInMergedCollEM.push_back(resultTrackstersMerged->size());
247 resultTrackstersMerged->push_back(
t);
250 for (
auto const &
t : trackstersTRK) {
251 indexInMergedCollTRK.push_back(resultTrackstersMerged->size());
252 seedToTracksterAssociator[
t.seedIndex()].emplace_back(resultTrackstersMerged->size(), TracksterIterIndex::TRKHAD);
253 resultTrackstersMerged->push_back(
t);
256 for (
auto const &
t : trackstersHAD) {
257 indexInMergedCollHAD.push_back(resultTrackstersMerged->size());
258 resultTrackstersMerged->push_back(
t);
269 auto trackstersMergedHandle = evt.
put(
std::move(resultTrackstersMerged));
275 for (
unsigned i = 0;
i < trackstersEM.size(); ++
i) {
276 auto mergedIdx = indexInMergedCollEM[
i];
277 usedTrackstersMerged[mergedIdx] =
true;
278 const auto &
t = trackstersEM[
i];
285 t.raw_energy() *
t.barycenter().unit().y(),
286 t.raw_energy() *
t.barycenter().unit().z(),
288 tmpCandidate.
setP4(p4);
289 resultCandidates->push_back(tmpCandidate);
293 constexpr
double mpion = 0.13957;
294 constexpr
float mpion2 = mpion * mpion;
295 for (
unsigned i = 0;
i < trackstersHAD.size(); ++
i) {
296 auto mergedIdx = indexInMergedCollHAD[
i];
297 usedTrackstersMerged[mergedIdx] =
true;
298 const auto &
t = trackstersHAD[
i];
304 float momentum =
std::sqrt(
t.raw_energy() *
t.raw_energy() - mpion2);
306 momentum *
t.barycenter().unit().y(),
307 momentum *
t.barycenter().unit().z(),
309 tmpCandidate.
setP4(p4);
310 resultCandidates->push_back(tmpCandidate);
314 for (
unsigned i = 0;
i < trackstersTRKEM.size(); ++
i) {
315 auto mergedIdx = indexInMergedCollTRKEM[
i];
316 if (!usedTrackstersMerged[mergedIdx]) {
317 const auto &
t = trackstersTRKEM[
i];
318 auto trackIdx =
t.seedIndex();
320 if (!usedSeeds[trackIdx] and
t.raw_energy() > 0) {
321 usedSeeds[trackIdx] =
true;
322 usedTrackstersMerged[mergedIdx] =
true;
324 std::vector<int> trackstersTRKwithSameSeed;
325 std::vector<int> trackstersTRKEMwithSameSeed;
327 for (
const auto &tracksterIterationPair : seedToTracksterAssociator[trackIdx]) {
328 if (tracksterIterationPair.first != mergedIdx and !usedTrackstersMerged[tracksterIterationPair.first] and
329 trackstersMergedHandle->at(tracksterIterationPair.first).raw_energy() > 0.) {
330 if (tracksterIterationPair.second == TracksterIterIndex::TRKEM) {
331 trackstersTRKEMwithSameSeed.push_back(tracksterIterationPair.first);
332 }
else if (tracksterIterationPair.second == TracksterIterIndex::TRKHAD) {
333 trackstersTRKwithSameSeed.push_back(tracksterIterationPair.first);
338 float tracksterTotalRawPt =
t.raw_pt();
339 std::vector<int> haloTrackstersTRKIdx;
340 bool foundCompatibleTRK =
false;
342 for (
auto otherTracksterIdx : trackstersTRKwithSameSeed) {
343 usedTrackstersMerged[otherTracksterIdx] =
true;
344 tracksterTotalRawPt += trackstersMergedHandle->at(otherTracksterIdx).raw_pt();
347 if ((
t.barycenter() - trackstersMergedHandle->at(otherTracksterIdx).barycenter()).
mag2() <
349 haloTrackstersTRKIdx.push_back(otherTracksterIdx);
352 foundCompatibleTRK =
true;
357 if (trackstersTRKEMwithSameSeed.empty()) {
358 if (foundCompatibleTRK) {
361 double raw_energy =
t.raw_energy();
366 for (
auto otherTracksterIdx : trackstersTRKwithSameSeed) {
368 raw_energy += trackstersMergedHandle->at(otherTracksterIdx).raw_energy();
372 raw_energy *
track.momentum().unit().y(),
373 raw_energy *
track.momentum().unit().z(),
375 tmpCandidate.
setP4(p4);
376 resultCandidates->push_back(tmpCandidate);
381 double raw_energy =
t.raw_energy();
384 for (
auto otherTracksterIdx : trackstersTRKwithSameSeed) {
386 raw_energy += trackstersMergedHandle->at(otherTracksterIdx).raw_energy();
392 raw_energy *
track.momentum().unit().y(),
393 raw_energy *
track.momentum().unit().z(),
395 tmpCandidate.
setP4(p4);
396 resultCandidates->push_back(tmpCandidate);
401 int closestTrackster = mergedIdx;
403 for (
auto otherTracksterIdx : trackstersTRKEMwithSameSeed) {
404 auto thisPt = tracksterTotalRawPt + trackstersMergedHandle->at(otherTracksterIdx).raw_pt() -
t.raw_pt();
405 closestTrackster =
std::abs(thisPt -
track.pt()) < minPtDiff ? otherTracksterIdx : closestTrackster;
407 usedTrackstersMerged[closestTrackster] =
true;
409 if (foundCompatibleTRK) {
412 double raw_energy = trackstersMergedHandle->at(closestTrackster).raw_energy();
417 for (
auto otherTracksterIdx : trackstersTRKwithSameSeed) {
419 raw_energy += trackstersMergedHandle->at(otherTracksterIdx).raw_energy();
422 float momentum =
std::sqrt(raw_energy * raw_energy - mpion2);
424 momentum *
track.momentum().unit().y(),
425 momentum *
track.momentum().unit().z(),
427 tmpCandidate.
setP4(p4);
428 resultCandidates->push_back(tmpCandidate);
433 double raw_energy = trackstersMergedHandle->at(closestTrackster).raw_energy();
437 for (
auto otherTracksterIdx : trackstersTRKwithSameSeed) {
439 raw_energy += trackstersMergedHandle->at(otherTracksterIdx).raw_energy();
444 raw_energy *
track.momentum().unit().y(),
445 raw_energy *
track.momentum().unit().z(),
447 tmpCandidate.
setP4(p4);
448 resultCandidates->push_back(tmpCandidate);
451 for (
auto otherTracksterIdx : trackstersTRKEMwithSameSeed) {
452 auto tmpIndex = (otherTracksterIdx != closestTrackster) ? otherTracksterIdx : mergedIdx;
454 const auto &otherTrackster = trackstersMergedHandle->at(tmpIndex);
455 auto gammaEnergy = otherTrackster.raw_energy();
460 gammaEnergy * otherTrackster.barycenter().unit().y(),
461 gammaEnergy * otherTrackster.barycenter().unit().z(),
463 photonCandidate.
setP4(gammaP4);
465 resultCandidates->push_back(photonCandidate);
472 for (
unsigned i = 0;
i < trackstersTRK.size(); ++
i) {
473 auto mergedIdx = indexInMergedCollTRK[
i];
474 const auto &
t = trackstersTRK[
i];
476 if (!usedTrackstersMerged[mergedIdx] and
t.raw_energy() > 0) {
477 auto trackIdx =
t.seedIndex();
479 if (!usedSeeds[trackIdx]) {
480 usedSeeds[trackIdx] =
true;
481 usedTrackstersMerged[mergedIdx] =
true;
488 float momentum =
std::sqrt(
t.raw_energy() *
t.raw_energy() - mpion2);
490 momentum *
track.momentum().unit().y(),
491 momentum *
track.momentum().unit().z(),
493 tmpCandidate.
setP4(p4);
494 resultCandidates->push_back(tmpCandidate);
499 for (
auto const &
s : seedingTrk) {
500 if (usedSeeds[
s.index] ==
false) {
510 tmpCandidate.
setP4(p4Polar);
511 resultCandidates->push_back(tmpCandidate);
512 usedSeeds[
s.index] =
true;
517 for (
unsigned i = 0;
i <
tracks.size(); ++
i) {
530 tmpCandidate.
setP4(p4Polar);
531 resultCandidates->push_back(tmpCandidate);
543 std::vector<Trackster> &tracksters)
const {
567 std::vector<int> tracksterIndices;
568 for (
int i = 0;
i < (int)tracksters.size();
i++) {
573 float sumClusterEnergy = 0.;
574 for (
const unsigned int &vertex : tracksters[
i].
vertices()) {
575 sumClusterEnergy += (float)layerClusters[vertex].
energy();
579 tracksters[
i].setRegressedEnergy(0.
f);
580 tracksters[
i].zeroProbabilities();
581 tracksterIndices.push_back(
i);
588 int batchSize = (int)tracksterIndices.size();
589 if (batchSize == 0) {
595 tensorflow::Tensor
input(tensorflow::DT_FLOAT, shape);
597 static constexpr
int inputDimension = 4;
599 std::vector<tensorflow::Tensor> outputs;
600 std::vector<std::string> outputNames;
609 for (
int i = 0;
i < batchSize;
i++) {
610 const Trackster &trackster = tracksters[tracksterIndices[
i]];
616 std::vector<int> clusterIndices(trackster.vertices().size());
617 for (
int k = 0;
k < (int)trackster.vertices().size();
k++) {
618 clusterIndices[
k] =
k;
620 sort(clusterIndices.begin(), clusterIndices.end(), [&layerClusters, &trackster](
const int &
a,
const int &
b) {
621 return layerClusters[trackster.vertices(a)].energy() > layerClusters[trackster.vertices(
b)].energy();
628 for (
const int &
k : clusterIndices) {
634 float *
features = &input.tensor<float, inputDimension>()(
i, j, seenClusters[j], 0);
637 *(features++) =
float(cluster.
energy() / float(trackster.vertex_multiplicity(
k)));
649 float *
features = &input.tensor<float, inputDimension>()(
i,
j,
k, 0);
663 float *
energy = outputs[0].flat<
float>().
data();
665 for (
const int &
i : tracksterIndices) {
666 tracksters[
i].setRegressedEnergy(*(energy++));
674 float *probs = outputs[probsIdx].flat<
float>().
data();
676 for (
const int &
i : tracksterIndices) {
677 tracksters[
i].setProbabilities(probs);
678 probs += tracksters[
i].id_probabilities().size();
684 for (
auto &cand : resultCandidates) {
685 if (cand.tracksters().size() > 1) {
688 for (
const auto &tr : cand.tracksters()) {
689 if (tr->timeError() > 0) {
690 auto invTimeESq =
pow(tr->timeError(), -2);
691 time += tr->time() * invTimeESq;
692 timeErr += invTimeESq;
696 timeErr = 1. / timeErr;
698 cand.setTime(time * timeErr);
699 cand.setTimeError(
sqrt(timeErr));
707 std::unique_ptr<TrackstersCache>
cache = std::make_unique<TrackstersCache>(
params);
711 if (!graphPath.empty()) {
729 for (
auto const &
t : tracksters) {
731 << counter++ <<
" TrackstersMergeProducer (" << label <<
") obj barycenter: " <<
t.barycenter()
732 <<
" eta,phi (baricenter): " <<
t.barycenter().eta() <<
", " <<
t.barycenter().phi()
733 <<
" eta,phi (eigen): " <<
t.eigenvectors(0).eta() <<
", " <<
t.eigenvectors(0).phi()
734 <<
" pt(eigen): " <<
std::sqrt(
t.eigenvectors(0).Unit().perp2()) *
t.raw_energy() <<
" seedID: " <<
t.seedID()
735 <<
" seedIndex: " <<
t.seedIndex() <<
" size: " <<
t.vertices().size() <<
" average usage: "
736 << (std::accumulate(
std::begin(
t.vertex_multiplicity()),
std::end(
t.vertex_multiplicity()), 0.) /
737 (float)
t.vertex_multiplicity().size())
738 <<
" raw_energy: " <<
t.raw_energy() <<
" regressed energy: " <<
t.regressed_energy()
739 <<
" probs(ga/e/mu/np/cp/nh/am/unk): ";
740 for (
auto const &
p :
t.id_probabilities()) {
741 LogDebug(
"TrackstersMergeProducer") << std::fixed <<
p <<
" ";
743 LogDebug(
"TrackstersMergeProducer") <<
" sigmas: ";
744 for (
auto const &
s :
t.sigmas()) {
745 LogDebug(
"TrackstersMergeProducer") <<
s <<
" ";
747 LogDebug(
"TrackstersMergeProducer") << std::endl;
761 desc.
add<
bool>(
"optimiseAcrossTracksters",
true);
762 desc.
add<
int>(
"eta_bin_window", 1);
763 desc.
add<
int>(
"phi_bin_window", 1);
764 desc.
add<
double>(
"pt_sigma_high", 2.);
765 desc.
add<
double>(
"pt_sigma_low", 2.);
766 desc.
add<
double>(
"halo_max_distance2", 4.);
767 desc.
add<
double>(
"track_min_pt", 1.);
768 desc.
add<
double>(
"track_min_eta", 1.48);
769 desc.
add<
double>(
"track_max_eta", 3.);
770 desc.
add<
int>(
"track_max_missing_outerhits", 5);
771 desc.
add<
double>(
"cosangle_align", 0.9945);
772 desc.
add<
double>(
"e_over_h_threshold", 1.);
773 desc.
add<
double>(
"pt_neutral_threshold", 2.);
774 desc.
add<
double>(
"resol_calo_offset_had", 1.5);
775 desc.
add<
double>(
"resol_calo_scale_had", 0.15);
776 desc.
add<
double>(
"resol_calo_offset_em", 1.5);
777 desc.
add<
double>(
"resol_calo_scale_em", 0.15);
778 desc.
add<
bool>(
"debug",
true);
779 desc.
add<
std::string>(
"eid_graph_path",
"RecoHGCal/TICL/data/tf_models/energy_id_v0.pb");
781 desc.
add<
std::string>(
"eid_output_name_energy",
"output/regressed_energy");
782 desc.
add<
std::string>(
"eid_output_name_id",
"output/id_probabilities");
783 desc.
add<
double>(
"eid_min_cluster_energy", 1.);
784 desc.
add<
int>(
"eid_n_layers", 50);
785 desc.
add<
int>(
"eid_n_clusters", 10);
786 descriptions.
add(
"trackstersMergeProducer", desc);
ticl::Trackster::IterationIndex TracksterIterIndex
Session * createSession(SessionOptions &sessionOptions)
std::vector< NamedTensor > NamedTensorList
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
const edm::EDGetTokenT< std::vector< Trackster > > trackstersem_token_
void fillTile(TICLTracksterTiles &, const std::vector< Trackster > &, TracksterIterIndex)
const double cosangle_align_
tensorflow::Session * eidSession_
const edm::EDGetTokenT< std::vector< TICLSeedingRegion > > seedingTrk_token_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
const double halo_max_distance2_
#define DEFINE_FWK_MODULE(type)
void assignTimeToCandidates(std::vector< TICLCandidate > &resultCandidates) const
GraphDef * loadGraphDef(const std::string &pbFile)
void produce(edm::Event &, const edm::EventSetup &) override
hgcal::RecHitTools rhtools_
auto const & tracks
cannot be loose
const edm::EDGetTokenT< std::vector< Trackster > > tracksterstrkem_token_
const edm::EDGetTokenT< std::vector< reco::CaloCluster > > clusters_token_
const double track_min_eta_
const edm::ESGetToken< CaloGeometry, CaloGeometryRecord > geometry_token_
void dumpTrackster(const Trackster &) const
double eta() const
pseudorapidity of cluster centroid
void energyRegressionAndID(const std::vector< reco::CaloCluster > &layerClusters, std::vector< Trackster > &result) const
static std::string const input
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
void assignPCAtoTracksters(std::vector< Trackster > &, const std::vector< reco::CaloCluster > &, const edm::ValueMap< std::pair< float, float >> &, double, bool energyWeight=true)
const float eidMinClusterEnergy_
void setCharge(Charge q) final
set electric charge
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
const std::string eidOutputNameId_
const double pt_sigma_low_
static constexpr int eidNFeatures_
const double pt_neutral_threshold_
const std::vector< std::pair< DetId, float > > & hitsAndFractions() const
const edm::EDGetTokenT< std::vector< Trackster > > tracksterstrk_token_
void setRawEnergy(float rawEnergy)
std::vector< float > features(const reco::PreId &ecal, const reco::PreId &hcal, double rho, const reco::BeamSpot &spot, noZS::EcalClusterLazyTools &ecalTools)
static std::unique_ptr< TrackstersCache > initializeGlobalCache(const edm::ParameterSet &)
const double e_over_h_threshold_
const double resol_calo_scale_had_
const bool optimiseAcrossTracksters_
const int phi_bin_window_
T mag2() const
The vector magnitude squared. Equivalent to vec.dot(vec)
void run(Session *session, const NamedTensorList &inputs, const std::vector< std::string > &outputNames, std::vector< Tensor > *outputs, const thread::ThreadPoolOptions &threadPoolOptions)
static void globalEndJob(TrackstersCache *)
Abs< T >::type abs(const T &t)
std::atomic< tensorflow::GraphDef * > eidGraphDef
const edm::EDGetTokenT< std::vector< Trackster > > trackstershad_token_
double energy() const
cluster energy
const double resol_calo_offset_em_
~TrackstersMergeProducer() override
const edm::EDGetTokenT< edm::ValueMap< std::pair< float, float > > > clustersTime_token_
ParameterDescriptionBase * add(U const &iLabel, T const &value)
const int track_max_missing_outerhits_
const edm::EDGetTokenT< std::vector< reco::Track > > tracks_token_
const std::string eidOutputNameEnergy_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
const std::string eidInputName_
T getParameter(std::string const &) const
void add(std::string const &label, ParameterSetDescription const &psetDescription)
const double pt_sigma_high_
const double track_max_eta_
TrackstersMergeProducer(const edm::ParameterSet &ps, const CacheBase *cache)
const double resol_calo_offset_had_
char data[epos_bytes_allocation]
void addTrackster(const edm::Ptr< ticl::Trackster > &trackster)
static std::atomic< unsigned int > counter
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
std::string fullPath() const
void fill(int index, double eta, double phi, unsigned int objectId)
const double track_min_pt_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
double phi() const
azimuthal angle of cluster centroid
void printTrackstersDebug(const std::vector< Trackster > &, const char *label) const
void setPdgId(int pdgId) final
const double resol_calo_scale_em_
void setTrackPtr(const edm::Ptr< reco::Track > &trackPtr)
void setP4(const LorentzVector &p4) final
set 4-momentum
Power< A, B >::type pow(const A &a, const B &b)
const int eta_bin_window_