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,
373  result->shrink_to_fit();
374  ticl::assignPCAtoTracksters(*result_fromCP,
376  layerClustersTimes,
379 
380  makePUTrackster(inputClusterMask, *output_mask, *resultPU, caloParticles_h.id(), 0);
381 
382  auto simTrackToRecoTrack = [&](UniqueSimTrackId simTkId) -> std::pair<int, float> {
383  int trackIdx = -1;
384  float quality = 0.f;
385  auto ipos = simTrackToTPMap.mapping.find(simTkId);
386  if (ipos != simTrackToTPMap.mapping.end()) {
387  auto jpos = TPtoRecoTrackMap.find((ipos->second));
388  if (jpos != TPtoRecoTrackMap.end()) {
389  auto& associatedRecoTracks = jpos->val;
390  if (!associatedRecoTracks.empty()) {
391  // associated reco tracks are sorted by decreasing quality
392  if (associatedRecoTracks[0].second > qualityCutTrack_) {
393  trackIdx = &(*associatedRecoTracks[0].first) - &recoTracks[0];
394  quality = associatedRecoTracks[0].second;
395  }
396  }
397  }
398  }
399  return {trackIdx, quality};
400  };
401 
402  // Creating the map from TrackingParticle to SimTrackstersFromCP
403  auto& simTrackstersFromCP = *result_fromCP;
404  for (unsigned int i = 0; i < simTrackstersFromCP.size(); ++i) {
405  if (simTrackstersFromCP[i].vertices().empty())
406  continue;
407  const auto& simTrack = caloparticles[simTrackstersFromCP[i].seedIndex()].g4Tracks()[0];
408  UniqueSimTrackId simTkIds(simTrack.trackId(), simTrack.eventId());
409  auto bestAssociatedRecoTrack = simTrackToRecoTrack(simTkIds);
410  if (bestAssociatedRecoTrack.first != -1 and bestAssociatedRecoTrack.second > qualityCutTrack_) {
411  auto trackIndex = bestAssociatedRecoTrack.first;
412  simTrackstersFromCP[i].setTrackIdx(trackIndex);
413  }
414  }
415 
416  auto& simTracksters = *result;
417  // Creating the map from TrackingParticle to SimTrackster
418  std::unordered_map<unsigned int, std::vector<unsigned int>> TPtoSimTracksterMap;
419  for (unsigned int i = 0; i < simTracksters.size(); ++i) {
420  const auto& simTrack = (simTracksters[i].seedID() == caloParticles_h.id())
421  ? caloparticles[simTracksters[i].seedIndex()].g4Tracks()[0]
422  : simclusters[simTracksters[i].seedIndex()].g4Tracks()[0];
423  UniqueSimTrackId simTkIds(simTrack.trackId(), simTrack.eventId());
424  auto bestAssociatedRecoTrack = simTrackToRecoTrack(simTkIds);
425  if (bestAssociatedRecoTrack.first != -1 and bestAssociatedRecoTrack.second > qualityCutTrack_) {
426  auto trackIndex = bestAssociatedRecoTrack.first;
427  simTracksters[i].setTrackIdx(trackIndex);
428  }
429  }
430 
432 
433  // map between simTrack and Mtd SimTracksters to loop on them only one
434  std::unordered_map<unsigned int, const MtdSimTrackster*> SimTrackToMtdST;
435  for (unsigned int i = 0; i < MTDSimTracksters_h->size(); ++i) {
436  const auto& simTrack = (*MTDSimTracksters_h)[i].g4Tracks()[0];
437  SimTrackToMtdST[simTrack.trackId()] = &((*MTDSimTracksters_h)[i]);
438  }
439 
440  result_ticlCandidates->resize(result_fromCP->size());
441  std::vector<int> toKeep;
442  for (size_t i = 0; i < simTracksters_h->size(); ++i) {
443  const auto& simTrackster = (*simTracksters_h)[i];
444  int cp_index = (simTrackster.seedID() == caloParticles_h.id())
445  ? simTrackster.seedIndex()
446  : SimClusterToCaloParticleMap[simTrackster.seedIndex()];
447  auto const& tCP = (*result_fromCP)[cp_index];
448  if (!tCP.vertices().empty()) {
449  auto trackIndex = tCP.trackIdx();
450 
451  auto& cand = (*result_ticlCandidates)[cp_index];
452  cand.addTrackster(edm::Ptr<Trackster>(simTracksters_h, i));
453  if (trackIndex != -1 && caloparticles[cp_index].charge() != 0)
454  cand.setTrackPtr(edm::Ptr<reco::Track>(recoTracks_h, trackIndex));
455  toKeep.push_back(cp_index);
456  }
457  }
458 
459  auto isHad = [](int pdgId) {
460  pdgId = std::abs(pdgId);
461  if (pdgId == 111)
462  return false;
463  return (pdgId > 100 and pdgId < 900) or (pdgId > 1000 and pdgId < 9000);
464  };
465 
466  for (size_t i = 0; i < result_ticlCandidates->size(); ++i) {
467  auto cp_index = (*result_fromCP)[i].seedIndex();
468  if (cp_index < 0)
469  continue;
470  auto& cand = (*result_ticlCandidates)[i];
471  const auto& cp = caloparticles[cp_index];
472  float rawEnergy = 0.f;
473  float regressedEnergy = 0.f;
474 
475  const auto& simTrack = cp.g4Tracks()[0];
476  auto pos = SimTrackToMtdST.find(simTrack.trackId());
477  if (pos != SimTrackToMtdST.end()) {
478  auto MTDst = pos->second;
479  // TODO: once the associators have been implemented check if the MTDst is associated with a reco before adding the MTD time
480  cand.setMTDTime(MTDst->time(), 0);
481  }
482 
483  cand.setTime(simVertices[cp.g4Tracks()[0].vertIndex()].position().t() * pow(10, 9), 0);
484 
485  for (const auto& trackster : cand.tracksters()) {
486  rawEnergy += trackster->raw_energy();
487  regressedEnergy += trackster->regressed_energy();
488  }
489  cand.setRawEnergy(rawEnergy);
490 
491  auto pdgId = cp.pdgId();
492  auto charge = cp.charge();
493  if (cand.trackPtr().isNonnull()) {
494  auto const& track = cand.trackPtr().get();
495  if (std::abs(pdgId) == 13) {
496  cand.setPdgId(pdgId);
497  } else {
498  cand.setPdgId((isHad(pdgId) ? 211 : 11) * charge);
499  }
500  cand.setCharge(charge);
501  math::XYZTLorentzVector p4(regressedEnergy * track->momentum().unit().x(),
502  regressedEnergy * track->momentum().unit().y(),
503  regressedEnergy * track->momentum().unit().z(),
504  regressedEnergy);
505  cand.setP4(p4);
506  } else { // neutral candidates
507  // a neutral candidate with a charged CaloParticle is charged without a reco track associated with it
508  // set the charge = 0, but keep the real pdgId to keep track of that
509  if (charge != 0)
510  cand.setPdgId(isHad(pdgId) ? 211 : 11);
511  else if (pdgId == 111)
512  cand.setPdgId(pdgId);
513  else
514  cand.setPdgId(isHad(pdgId) ? 130 : 22);
515  cand.setCharge(0);
516 
518  cand.setIdProbability(particleType, 1.f);
519 
520  const auto& simTracksterFromCP = (*result_fromCP)[i];
521  float regressedEnergy = simTracksterFromCP.regressed_energy();
522  math::XYZTLorentzVector p4(regressedEnergy * simTracksterFromCP.barycenter().unit().x(),
523  regressedEnergy * simTracksterFromCP.barycenter().unit().y(),
524  regressedEnergy * simTracksterFromCP.barycenter().unit().z(),
525  regressedEnergy);
526  cand.setP4(p4);
527  }
528  }
529 
530  std::vector<int> all_nums(result_fromCP->size()); // vector containing all caloparticles indexes
531  std::iota(all_nums.begin(), all_nums.end(), 0); // fill the vector with consecutive numbers starting from 0
532 
533  std::vector<int> toRemove;
534  std::set_difference(all_nums.begin(), all_nums.end(), toKeep.begin(), toKeep.end(), std::back_inserter(toRemove));
535  std::sort(toRemove.begin(), toRemove.end(), [](int x, int y) { return x > y; });
536  for (auto const& r : toRemove) {
537  result_fromCP->erase(result_fromCP->begin() + r);
538  result_ticlCandidates->erase(result_ticlCandidates->begin() + r);
539  }
540  evt.put(std::move(result_ticlCandidates));
541  evt.put(std::move(output_mask));
542  evt.put(std::move(result_fromCP), "fromCPs");
543  evt.put(std::move(resultPU), "PU");
544  evt.put(std::move(output_mask_fromCP), "fromCPs");
545  evt.put(std::move(cpToSc_SimTrackstersMap));
546 }
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_
const edm::ESGetToken< CaloGeometry, CaloGeometryRecord > geom_token_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:528
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 assignPCAtoTracksters(std::vector< Trackster > &, const std::vector< reco::CaloCluster > &, const edm::ValueMap< std::pair< float, float >> &, double, bool computeLocalTime=false, bool energyWeight=true)
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)