CMS 3D CMS Logo

SimTrackstersProducer.cc
Go to the documentation of this file.
1 // Author: Felice Pantaleo, Leonardo Cristella - felice.pantaleo@cern.ch, leonardo.cristella@cern.ch
2 // Date: 09/2021
3 
4 // user include files
5 
15 
18 
24 
28 
34 
36 
39 
41 
43 
44 #include "TrackstersPCA.h"
45 #include <vector>
46 #include <map>
47 #include <iterator>
48 #include <algorithm>
49 #include <numeric>
50 
51 using namespace ticl;
52 
54 public:
56  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
57 
58  void produce(edm::Event&, const edm::EventSetup&) override;
59  void makePUTrackster(const std::vector<float>& inputClusterMask,
60  std::vector<float>& output_mask,
61  std::vector<Trackster>& result,
62  const edm::ProductID seed,
63  int loop_index);
64 
65  void addTrackster(const int index,
66  const std::vector<std::pair<edm::Ref<reco::CaloClusterCollection>, std::pair<float, float>>>& lcVec,
67  const std::vector<float>& inputClusterMask,
68  const float fractionCut_,
69  const float energy,
70  const int pdgId,
71  const int charge,
72  const float time,
73  const edm::ProductID seed,
74  const Trackster::IterationIndex iter,
75  std::vector<float>& output_mask,
76  std::vector<Trackster>& result,
77  int& loop_index,
78  const bool add = false);
79 
80 private:
82  const bool doNose_ = false;
83  const bool computeLocalTime_;
87 
91 
96  const float fractionCut_;
97  const float qualityCutTrack_;
100 
103 
107 };
108 
110 
112  : detector_(ps.getParameter<std::string>("detector")),
113  doNose_(detector_ == "HFNose"),
114  computeLocalTime_(ps.getParameter<bool>("computeLocalTime")),
115  clusters_token_(consumes(ps.getParameter<edm::InputTag>("layer_clusters"))),
116  clustersTime_token_(consumes(ps.getParameter<edm::InputTag>("time_layerclusters"))),
117  filtered_layerclusters_mask_token_(consumes(ps.getParameter<edm::InputTag>("filtered_mask"))),
118  simclusters_token_(consumes(ps.getParameter<edm::InputTag>("simclusters"))),
119  caloparticles_token_(consumes(ps.getParameter<edm::InputTag>("caloparticles"))),
120  MTDSimTrackstersToken_(consumes<MtdSimTracksterCollection>(ps.getParameter<edm::InputTag>("MtdSimTracksters"))),
121  associatorMapSimClusterToReco_token_(
122  consumes(ps.getParameter<edm::InputTag>("layerClusterSimClusterAssociator"))),
123  associatorMapCaloParticleToReco_token_(
124  consumes(ps.getParameter<edm::InputTag>("layerClusterCaloParticleAssociator"))),
125  geom_token_(esConsumes()),
126  fractionCut_(ps.getParameter<double>("fractionCut")),
127  qualityCutTrack_(ps.getParameter<double>("qualityCutTrack")),
128  trackingParticleToken_(
129  consumes<std::vector<TrackingParticle>>(ps.getParameter<edm::InputTag>("trackingParticles"))),
130  simVerticesToken_(consumes<std::vector<SimVertex>>(ps.getParameter<edm::InputTag>("simVertices"))),
131  recoTracksToken_(consumes<std::vector<reco::Track>>(ps.getParameter<edm::InputTag>("recoTracks"))),
132  cutTk_(ps.getParameter<std::string>("cutTk")),
133  associatormapStRsToken_(consumes(ps.getParameter<edm::InputTag>("tpToTrack"))),
134  associationSimTrackToTPToken_(consumes(ps.getParameter<edm::InputTag>("simTrackToTPMap"))) {
135  produces<TracksterCollection>();
136  produces<std::vector<float>>();
137  produces<TracksterCollection>("fromCPs");
138  produces<TracksterCollection>("PU");
139  produces<std::vector<float>>("fromCPs");
140  produces<std::map<uint, std::vector<uint>>>();
141  produces<std::vector<TICLCandidate>>();
142 }
143 
146  desc.add<std::string>("detector", "HGCAL");
147  desc.add<bool>("computeLocalTime", "false");
148  desc.add<edm::InputTag>("layer_clusters", edm::InputTag("hgcalMergeLayerClusters"));
149  desc.add<edm::InputTag>("time_layerclusters", edm::InputTag("hgcalMergeLayerClusters", "timeLayerCluster"));
150  desc.add<edm::InputTag>("filtered_mask", edm::InputTag("filteredLayerClustersSimTracksters", "ticlSimTracksters"));
151  desc.add<edm::InputTag>("simclusters", edm::InputTag("mix", "MergedCaloTruth"));
152  desc.add<edm::InputTag>("caloparticles", edm::InputTag("mix", "MergedCaloTruth"));
153  desc.add<edm::InputTag>("MtdSimTracksters", edm::InputTag("mix", "MergedMtdTruthST"));
154  desc.add<edm::InputTag>("layerClusterSimClusterAssociator",
155  edm::InputTag("layerClusterSimClusterAssociationProducer"));
156  desc.add<edm::InputTag>("layerClusterCaloParticleAssociator",
157  edm::InputTag("layerClusterCaloParticleAssociationProducer"));
158  desc.add<edm::InputTag>("recoTracks", edm::InputTag("generalTracks"));
159  desc.add<std::string>("cutTk",
160  "1.48 < abs(eta) < 3.0 && pt > 1. && quality(\"highPurity\") && "
161  "hitPattern().numberOfLostHits(\"MISSING_OUTER_HITS\") < 5");
162  desc.add<edm::InputTag>("tpToTrack", edm::InputTag("trackingParticleRecoTrackAsssociation"));
163 
164  desc.add<edm::InputTag>("trackingParticles", edm::InputTag("mix", "MergedTrackTruth"));
165  desc.add<edm::InputTag>("simVertices", edm::InputTag("g4SimHits"));
166 
167  desc.add<edm::InputTag>("simTrackToTPMap", edm::InputTag("simHitTPAssocProducer", "simTrackToTP"));
168  desc.add<double>("fractionCut", 0.);
169  desc.add<double>("qualityCutTrack", 0.75);
170 
171  descriptions.addWithDefaultLabel(desc);
172 }
173 void SimTrackstersProducer::makePUTrackster(const std::vector<float>& inputClusterMask,
174  std::vector<float>& output_mask,
175  std::vector<Trackster>& result,
176  const edm::ProductID seed,
177  int loop_index) {
178  Trackster tmpTrackster;
179  for (size_t i = 0; i < output_mask.size(); i++) {
180  const float remaining_fraction = output_mask[i];
181  if (remaining_fraction > std::numeric_limits<float>::epsilon()) {
182  tmpTrackster.vertices().push_back(i);
183  tmpTrackster.vertex_multiplicity().push_back(1. / remaining_fraction);
184  }
185  }
186  tmpTrackster.setSeed(seed, 0);
187  result.push_back(tmpTrackster);
188 }
189 
191  const int index,
192  const std::vector<std::pair<edm::Ref<reco::CaloClusterCollection>, std::pair<float, float>>>& lcVec,
193  const std::vector<float>& inputClusterMask,
194  const float fractionCut_,
195  const float energy,
196  const int pdgId,
197  const int charge,
198  const float time,
199  const edm::ProductID seed,
200  const Trackster::IterationIndex iter,
201  std::vector<float>& output_mask,
202  std::vector<Trackster>& result,
203  int& loop_index,
204  const bool add) {
205  Trackster tmpTrackster;
206  if (lcVec.empty()) {
207  result[index] = tmpTrackster;
208  return;
209  }
210 
211  tmpTrackster.vertices().reserve(lcVec.size());
212  tmpTrackster.vertex_multiplicity().reserve(lcVec.size());
213  for (auto const& [lc, energyScorePair] : lcVec) {
214  if (inputClusterMask[lc.index()] > 0) {
215  double fraction = energyScorePair.first / lc->energy();
216  if (fraction < fractionCut_)
217  continue;
218  tmpTrackster.vertices().push_back(lc.index());
219  output_mask[lc.index()] -= fraction;
220  tmpTrackster.vertex_multiplicity().push_back(1. / fraction);
221  }
222  }
223 
225  tmpTrackster.setRegressedEnergy(energy);
226  tmpTrackster.setIteration(iter);
227  tmpTrackster.setSeed(seed, index);
228  tmpTrackster.setBoundaryTime(time * 1e9);
229  if (add) {
230  result[index] = tmpTrackster;
231  loop_index += 1;
232  } else {
233  result.push_back(tmpTrackster);
234  }
235 }
236 
238  auto result = std::make_unique<TracksterCollection>();
239  auto output_mask = std::make_unique<std::vector<float>>();
240  auto result_fromCP = std::make_unique<TracksterCollection>();
241  auto resultPU = std::make_unique<TracksterCollection>();
242  auto output_mask_fromCP = std::make_unique<std::vector<float>>();
243  auto cpToSc_SimTrackstersMap = std::make_unique<std::map<uint, std::vector<uint>>>();
244  auto result_ticlCandidates = std::make_unique<std::vector<TICLCandidate>>();
245 
246  const auto& layerClusters = evt.get(clusters_token_);
247  const auto& layerClustersTimes = evt.get(clustersTime_token_);
248  const auto& inputClusterMask = evt.get(filtered_layerclusters_mask_token_);
249  output_mask->resize(layerClusters.size(), 1.f);
250  output_mask_fromCP->resize(layerClusters.size(), 1.f);
251 
252  const auto& simclusters = evt.get(simclusters_token_);
253  edm::Handle<std::vector<CaloParticle>> caloParticles_h;
254  evt.getByToken(caloparticles_token_, caloParticles_h);
255  const auto& caloparticles = *caloParticles_h;
256 
257  edm::Handle<MtdSimTracksterCollection> MTDSimTracksters_h;
258  evt.getByToken(MTDSimTrackstersToken_, MTDSimTracksters_h);
259 
260  const auto& simClustersToRecoColl = evt.get(associatorMapSimClusterToReco_token_);
261  const auto& caloParticlesToRecoColl = evt.get(associatorMapCaloParticleToReco_token_);
262  const auto& simVertices = evt.get(simVerticesToken_);
263 
264  edm::Handle<std::vector<TrackingParticle>> trackingParticles_h;
265  evt.getByToken(trackingParticleToken_, trackingParticles_h);
267  evt.getByToken(recoTracksToken_, recoTracks_h);
268  const auto& TPtoRecoTrackMap = evt.get(associatormapStRsToken_);
269  const auto& simTrackToTPMap = evt.get(associationSimTrackToTPToken_);
270  const auto& recoTracks = *recoTracks_h;
271 
272  const auto& geom = es.getData(geom_token_);
274  const auto num_simclusters = simclusters.size();
275  result->reserve(num_simclusters); // Conservative size, will call shrink_to_fit later
276  const auto num_caloparticles = caloparticles.size();
277  result_fromCP->resize(num_caloparticles);
278  std::map<uint, uint> SimClusterToCaloParticleMap;
279  int loop_index = 0;
280  for (const auto& [key, lcVec] : caloParticlesToRecoColl) {
281  auto const& cp = *(key);
282  auto cpIndex = &cp - &caloparticles[0];
283  for (const auto& scRef : cp.simClusters()) {
284  auto const& sc = *(scRef);
285  auto const scIndex = &sc - &simclusters[0];
286  SimClusterToCaloParticleMap[scIndex] = cpIndex;
287  }
288 
289  auto regr_energy = cp.energy();
290  std::vector<uint> scSimTracksterIdx;
291  scSimTracksterIdx.reserve(cp.simClusters().size());
292 
293  // Create a Trackster from the object entering HGCal
294  if (cp.g4Tracks()[0].crossedBoundary()) {
295  regr_energy = cp.g4Tracks()[0].getMomentumAtBoundary().energy();
296  float time = cp.g4Tracks()[0].getPositionAtBoundary().t();
297  addTrackster(cpIndex,
298  lcVec,
299  inputClusterMask,
300  fractionCut_,
301  regr_energy,
302  cp.pdgId(),
303  cp.charge(),
304  time,
305  key.id(),
307  *output_mask,
308  *result,
309  loop_index);
310  } else {
311  for (const auto& scRef : cp.simClusters()) {
312  const auto& it = simClustersToRecoColl.find(scRef);
313  if (it == simClustersToRecoColl.end())
314  continue;
315  const auto& lcVec = it->val;
316  auto const& sc = *(scRef);
317  auto const scIndex = &sc - &simclusters[0];
318 
319  addTrackster(scIndex,
320  lcVec,
321  inputClusterMask,
322  fractionCut_,
323  sc.g4Tracks()[0].getMomentumAtBoundary().energy(),
324  sc.pdgId(),
325  sc.charge(),
326  sc.g4Tracks()[0].getPositionAtBoundary().t(),
327  scRef.id(),
329  *output_mask,
330  *result,
331  loop_index);
332 
333  if (result->empty())
334  continue;
335  const auto index = result->size() - 1;
336  if (std::find(scSimTracksterIdx.begin(), scSimTracksterIdx.end(), index) == scSimTracksterIdx.end()) {
337  scSimTracksterIdx.emplace_back(index);
338  }
339  }
340  scSimTracksterIdx.shrink_to_fit();
341  }
342  float time = simVertices[cp.g4Tracks()[0].vertIndex()].position().t();
343  // Create a Trackster from any CP
344  addTrackster(cpIndex,
345  lcVec,
346  inputClusterMask,
347  fractionCut_,
348  regr_energy,
349  cp.pdgId(),
350  cp.charge(),
351  time,
352  key.id(),
354  *output_mask_fromCP,
355  *result_fromCP,
356  loop_index,
357  true);
358 
359  if (result_fromCP->empty())
360  continue;
361  const auto index = loop_index - 1;
362  if (cpToSc_SimTrackstersMap->find(index) == cpToSc_SimTrackstersMap->end()) {
363  (*cpToSc_SimTrackstersMap)[index] = scSimTracksterIdx;
364  }
365  }
366  // TODO: remove time computation from PCA calculation and
367  // store time from boundary position in simTracksters
370  layerClustersTimes,
372  rhtools_,
374  result->shrink_to_fit();
375  ticl::assignPCAtoTracksters(*result_fromCP,
377  layerClustersTimes,
379  rhtools_,
381 
382  makePUTrackster(inputClusterMask, *output_mask, *resultPU, caloParticles_h.id(), 0);
383 
384  auto simTrackToRecoTrack = [&](UniqueSimTrackId simTkId) -> std::pair<int, float> {
385  int trackIdx = -1;
386  float quality = 0.f;
387  auto ipos = simTrackToTPMap.mapping.find(simTkId);
388  if (ipos != simTrackToTPMap.mapping.end()) {
389  auto jpos = TPtoRecoTrackMap.find((ipos->second));
390  if (jpos != TPtoRecoTrackMap.end()) {
391  auto& associatedRecoTracks = jpos->val;
392  if (!associatedRecoTracks.empty()) {
393  // associated reco tracks are sorted by decreasing quality
394  if (associatedRecoTracks[0].second > qualityCutTrack_) {
395  trackIdx = &(*associatedRecoTracks[0].first) - &recoTracks[0];
396  quality = associatedRecoTracks[0].second;
397  }
398  }
399  }
400  }
401  return {trackIdx, quality};
402  };
403 
404  // Creating the map from TrackingParticle to SimTrackstersFromCP
405  auto& simTrackstersFromCP = *result_fromCP;
406  for (unsigned int i = 0; i < simTrackstersFromCP.size(); ++i) {
407  if (simTrackstersFromCP[i].vertices().empty())
408  continue;
409  const auto& simTrack = caloparticles[simTrackstersFromCP[i].seedIndex()].g4Tracks()[0];
410  UniqueSimTrackId simTkIds(simTrack.trackId(), simTrack.eventId());
411  auto bestAssociatedRecoTrack = simTrackToRecoTrack(simTkIds);
412  if (bestAssociatedRecoTrack.first != -1 and bestAssociatedRecoTrack.second > qualityCutTrack_) {
413  auto trackIndex = bestAssociatedRecoTrack.first;
414  simTrackstersFromCP[i].setTrackIdx(trackIndex);
415  }
416  }
417 
418  auto& simTracksters = *result;
419  // Creating the map from TrackingParticle to SimTrackster
420  std::unordered_map<unsigned int, std::vector<unsigned int>> TPtoSimTracksterMap;
421  for (unsigned int i = 0; i < simTracksters.size(); ++i) {
422  const auto& simTrack = (simTracksters[i].seedID() == caloParticles_h.id())
423  ? caloparticles[simTracksters[i].seedIndex()].g4Tracks()[0]
424  : simclusters[simTracksters[i].seedIndex()].g4Tracks()[0];
425  UniqueSimTrackId simTkIds(simTrack.trackId(), simTrack.eventId());
426  auto bestAssociatedRecoTrack = simTrackToRecoTrack(simTkIds);
427  if (bestAssociatedRecoTrack.first != -1 and bestAssociatedRecoTrack.second > qualityCutTrack_) {
428  auto trackIndex = bestAssociatedRecoTrack.first;
429  simTracksters[i].setTrackIdx(trackIndex);
430  }
431  }
432 
434 
435  // map between simTrack and Mtd SimTracksters to loop on them only one
436  std::unordered_map<unsigned int, const MtdSimTrackster*> SimTrackToMtdST;
437  for (unsigned int i = 0; i < MTDSimTracksters_h->size(); ++i) {
438  const auto& simTrack = (*MTDSimTracksters_h)[i].g4Tracks()[0];
439  SimTrackToMtdST[simTrack.trackId()] = &((*MTDSimTracksters_h)[i]);
440  }
441 
442  result_ticlCandidates->resize(result_fromCP->size());
443  std::vector<int> toKeep;
444  for (size_t i = 0; i < simTracksters_h->size(); ++i) {
445  const auto& simTrackster = (*simTracksters_h)[i];
446  int cp_index = (simTrackster.seedID() == caloParticles_h.id())
447  ? simTrackster.seedIndex()
448  : SimClusterToCaloParticleMap[simTrackster.seedIndex()];
449  auto const& tCP = (*result_fromCP)[cp_index];
450  if (!tCP.vertices().empty()) {
451  auto trackIndex = tCP.trackIdx();
452 
453  auto& cand = (*result_ticlCandidates)[cp_index];
454  cand.addTrackster(edm::Ptr<Trackster>(simTracksters_h, i));
455  if (trackIndex != -1 && caloparticles[cp_index].charge() != 0)
456  cand.setTrackPtr(edm::Ptr<reco::Track>(recoTracks_h, trackIndex));
457  toKeep.push_back(cp_index);
458  }
459  }
460 
461  auto isHad = [](int pdgId) {
462  pdgId = std::abs(pdgId);
463  if (pdgId == 111)
464  return false;
465  return (pdgId > 100 and pdgId < 900) or (pdgId > 1000 and pdgId < 9000);
466  };
467 
468  for (size_t i = 0; i < result_ticlCandidates->size(); ++i) {
469  auto cp_index = (*result_fromCP)[i].seedIndex();
470  if (cp_index < 0)
471  continue;
472  auto& cand = (*result_ticlCandidates)[i];
473  const auto& cp = caloparticles[cp_index];
474  float rawEnergy = 0.f;
475  float regressedEnergy = 0.f;
476 
477  const auto& simTrack = cp.g4Tracks()[0];
478  auto pos = SimTrackToMtdST.find(simTrack.trackId());
479  if (pos != SimTrackToMtdST.end()) {
480  auto MTDst = pos->second;
481  // TODO: once the associators have been implemented check if the MTDst is associated with a reco before adding the MTD time
482  cand.setMTDTime(MTDst->time(), 0);
483  }
484 
485  cand.setTime(simVertices[cp.g4Tracks()[0].vertIndex()].position().t() * pow(10, 9), 0);
486 
487  for (const auto& trackster : cand.tracksters()) {
488  rawEnergy += trackster->raw_energy();
489  regressedEnergy += trackster->regressed_energy();
490  }
491  cand.setRawEnergy(rawEnergy);
492 
493  auto pdgId = cp.pdgId();
494  auto charge = cp.charge();
495  if (cand.trackPtr().isNonnull()) {
496  auto const& track = cand.trackPtr().get();
497  if (std::abs(pdgId) == 13) {
498  cand.setPdgId(pdgId);
499  } else {
500  cand.setPdgId((isHad(pdgId) ? 211 : 11) * charge);
501  }
502  cand.setCharge(charge);
503  math::XYZTLorentzVector p4(regressedEnergy * track->momentum().unit().x(),
504  regressedEnergy * track->momentum().unit().y(),
505  regressedEnergy * track->momentum().unit().z(),
506  regressedEnergy);
507  cand.setP4(p4);
508  } else { // neutral candidates
509  // a neutral candidate with a charged CaloParticle is charged without a reco track associated with it
510  // set the charge = 0, but keep the real pdgId to keep track of that
511  if (charge != 0)
512  cand.setPdgId(isHad(pdgId) ? 211 : 11);
513  else if (pdgId == 111)
514  cand.setPdgId(pdgId);
515  else
516  cand.setPdgId(isHad(pdgId) ? 130 : 22);
517  cand.setCharge(0);
518 
520  cand.setIdProbability(particleType, 1.f);
521 
522  const auto& simTracksterFromCP = (*result_fromCP)[i];
523  float regressedEnergy = simTracksterFromCP.regressed_energy();
524  math::XYZTLorentzVector p4(regressedEnergy * simTracksterFromCP.barycenter().unit().x(),
525  regressedEnergy * simTracksterFromCP.barycenter().unit().y(),
526  regressedEnergy * simTracksterFromCP.barycenter().unit().z(),
527  regressedEnergy);
528  cand.setP4(p4);
529  }
530  }
531 
532  std::vector<int> all_nums(result_fromCP->size()); // vector containing all caloparticles indexes
533  std::iota(all_nums.begin(), all_nums.end(), 0); // fill the vector with consecutive numbers starting from 0
534 
535  std::vector<int> toRemove;
536  std::set_difference(all_nums.begin(), all_nums.end(), toKeep.begin(), toKeep.end(), std::back_inserter(toRemove));
537  std::sort(toRemove.begin(), toRemove.end(), [](int x, int y) { return x > y; });
538  for (auto const& r : toRemove) {
539  result_fromCP->erase(result_fromCP->begin() + r);
540  result_ticlCandidates->erase(result_ticlCandidates->begin() + r);
541  }
542  evt.put(std::move(result_ticlCandidates));
543  evt.put(std::move(output_mask));
544  evt.put(std::move(result_fromCP), "fromCPs");
545  evt.put(std::move(resultPU), "PU");
546  evt.put(std::move(output_mask_fromCP), "fromCPs");
547  evt.put(std::move(cpToSc_SimTrackstersMap));
548 }
void setSeed(edm::ProductID pid, int index)
Definition: Trackster.h:60
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
ProductID id() const
Definition: HandleBase.cc:29
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
void setRegressedEnergy(float value)
Definition: Trackster.h:68
bool get(ProductID const &oid, Handle< PROD > &result) const
Definition: Event.h:344
const edm::EDGetTokenT< reco::SimToRecoCollection > associatormapStRsToken_
std::pair< uint32_t, EncodedEventId > UniqueSimTrackId
const edm::EDGetTokenT< MtdSimTracksterCollection > MTDSimTrackstersToken_
const edm::EDGetTokenT< std::vector< SimVertex > > simVerticesToken_
const edm::EDGetTokenT< std::vector< float > > filtered_layerclusters_mask_token_
void assignPCAtoTracksters(std::vector< Trackster > &tracksters, const std::vector< reco::CaloCluster > &layerClusters, const edm::ValueMap< std::pair< float, float >> &layerClustersTime, double z_limit_em, hgcal::RecHitTools const &rhTools, bool computeLocalTime=false, bool energyWeight=true, bool clean=false, int minLayer=10, int maxLayer=10)
const edm::ESGetToken< CaloGeometry, CaloGeometryRecord > geom_token_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:526
const edm::EDGetTokenT< SimTrackToTPMap > associationSimTrackToTPToken_
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
U second(std::pair< T, U > const &p)
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
string quality
Trackster::ParticleType tracksterParticleTypeFromPdgId(int pdgId, int charge)
Definition: Common.h:44
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
void produce(edm::Event &, const edm::EventSetup &) override
void addTrackster(const int index, const std::vector< std::pair< edm::Ref< reco::CaloClusterCollection >, std::pair< float, float >>> &lcVec, const std::vector< float > &inputClusterMask, const float fractionCut_, const float energy, const int pdgId, const int charge, const float time, const edm::ProductID seed, const Trackster::IterationIndex iter, std::vector< float > &output_mask, std::vector< Trackster > &result, int &loop_index, const bool add=false)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
key
prepare the HTCondor submission files and eventually submit them
double f[11][100]
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
const edm::EDGetTokenT< std::vector< CaloParticle > > caloparticles_token_
const edm::EDGetTokenT< std::vector< reco::CaloCluster > > clusters_token_
const edm::EDGetTokenT< edm::ValueMap< std::pair< float, float > > > clustersTime_token_
const StringCutObjectSelector< reco::Track > cutTk_
const edm::EDGetTokenT< ticl::SimToRecoCollectionWithSimClusters > associatorMapSimClusterToReco_token_
SimTrackstersProducer(const edm::ParameterSet &)
std::vector< unsigned int > & vertices()
Definition: Trackster.h:57
const edm::EDGetTokenT< std::vector< SimCluster > > simclusters_token_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
hgcal::RecHitTools rhtools_
const edm::EDGetTokenT< std::vector< reco::Track > > recoTracksToken_
const edm::EDGetTokenT< ticl::SimToRecoCollection > associatorMapCaloParticleToReco_token_
std::vector< float > & vertex_multiplicity()
Definition: Trackster.h:58
const edm::EDGetTokenT< std::vector< TrackingParticle > > trackingParticleToken_
GlobalPoint getPositionLayer(int layer, bool nose=false) const
Definition: RecHitTools.cc:152
void setGeometry(CaloGeometry const &)
Definition: RecHitTools.cc:79
fixed size matrix
void add(std::map< std::string, TH1 *> &h, TH1 *hist)
HLT enums.
Definition: Common.h:10
Monte Carlo truth information used for tracking validation.
void setIteration(const Trackster::IterationIndex i)
Definition: Trackster.h:56
void setBoundaryTime(float t)
Definition: Trackster.h:141
void setIdProbability(ParticleType type, float value)
Definition: Trackster.h:139
const edm::EDGetTokenT< reco::RecoToSimCollection > associatormapRtSsToken_
std::vector< std::string > set_difference(std::vector< std::string > const &v1, std::vector< std::string > const &v2)
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
std::vector< MtdSimTrackster > MtdSimTracksterCollection
def move(src, dest)
Definition: eostools.py:511
unsigned int lastLayerEE(bool nose=false) const
Definition: RecHitTools.h:76
void makePUTrackster(const std::vector< float > &inputClusterMask, std::vector< float > &output_mask, std::vector< Trackster > &result, const edm::ProductID seed, int loop_index)