CMS 3D CMS Logo

TrackingNtuple.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: NtupleDump/TrackingNtuple
4 // Class: TrackingNtuple
5 //
13 //
14 // Original Author: Giuseppe Cerati
15 // Created: Tue, 25 Aug 2015 13:22:49 GMT
16 //
17 //
18 
19 // system include files
20 #include <memory>
21 
22 // user include files
25 
35 
38 
42 
46 
53 
56 
63 
68 
71 
82 
85 
87 #include "HepPDT/ParticleID.hh"
88 
90 
92 
93 #include <set>
94 #include <map>
95 #include <unordered_set>
96 #include <unordered_map>
97 #include <tuple>
98 #include <utility>
99 
100 #include "TTree.h"
101 
102 /*
103 todo:
104 add refitted hit position after track/seed fit
105 add local angle, path length!
106 */
107 
108 namespace {
109  // This pattern is copied from QuickTrackAssociatorByHitsImpl. If
110  // further needs arises, it wouldn't hurt to abstract it somehow.
111  using TrackingParticleRefKeyToIndex = std::unordered_map<reco::RecoToSimCollection::index_type, size_t>;
112  using TrackingVertexRefKeyToIndex = TrackingParticleRefKeyToIndex;
113  using SimHitFullKey = std::pair<TrackPSimHitRef::key_type, edm::ProductID>;
114  using SimHitRefKeyToIndex = std::map<SimHitFullKey, size_t>;
115  using TrackingParticleRefKeyToCount = TrackingParticleRefKeyToIndex;
116 
117  std::string subdetstring(int subdet) {
118  switch (subdet) {
120  return "- TIB";
122  return "- TOB";
124  return "- TEC";
126  return "- TID";
128  return "- PixBar";
130  return "- PixFwd";
131  default:
132  return "UNKNOWN TRACKER HIT TYPE";
133  }
134  }
135 
136  struct ProductIDSetPrinter {
137  ProductIDSetPrinter(const std::set<edm::ProductID>& set) : set_(set) {}
138 
139  void print(std::ostream& os) const {
140  for (const auto& item : set_) {
141  os << item << " ";
142  }
143  }
144 
145  const std::set<edm::ProductID>& set_;
146  };
147  std::ostream& operator<<(std::ostream& os, const ProductIDSetPrinter& o) {
148  o.print(os);
149  return os;
150  }
151  template <typename T>
152  struct ProductIDMapPrinter {
153  ProductIDMapPrinter(const std::map<edm::ProductID, T>& map) : map_(map) {}
154 
155  void print(std::ostream& os) const {
156  for (const auto& item : map_) {
157  os << item.first << " ";
158  }
159  }
160 
161  const std::map<edm::ProductID, T>& map_;
162  };
163  template <typename T>
164  auto make_ProductIDMapPrinter(const std::map<edm::ProductID, T>& map) {
165  return ProductIDMapPrinter<T>(map);
166  }
167  template <typename T>
168  std::ostream& operator<<(std::ostream& os, const ProductIDMapPrinter<T>& o) {
169  o.print(os);
170  return os;
171  }
172 
173  template <typename T>
174  struct VectorPrinter {
175  VectorPrinter(const std::vector<T>& vec) : vec_(vec) {}
176 
177  void print(std::ostream& os) const {
178  for (const auto& item : vec_) {
179  os << item << " ";
180  }
181  }
182 
183  const std::vector<T>& vec_;
184  };
185  template <typename T>
186  auto make_VectorPrinter(const std::vector<T>& vec) {
187  return VectorPrinter<T>(vec);
188  }
189  template <typename T>
190  std::ostream& operator<<(std::ostream& os, const VectorPrinter<T>& o) {
191  o.print(os);
192  return os;
193  }
194 
195  void checkProductID(const std::set<edm::ProductID>& set, const edm::ProductID& id, const char* name) {
196  if (set.find(id) == set.end())
197  throw cms::Exception("Configuration")
198  << "Got " << name << " with a hit with ProductID " << id
199  << " which does not match to the set of ProductID's for the hits: " << ProductIDSetPrinter(set)
200  << ". Usually this is caused by a wrong hit collection in the configuration.";
201  }
202 
203  template <typename SimLink, typename Func>
204  void forEachMatchedSimLink(const edm::DetSet<SimLink>& digiSimLinks, uint32_t channel, Func func) {
205  for (const auto& link : digiSimLinks) {
206  if (link.channel() == channel) {
207  func(link);
208  }
209  }
210  }
211 
213  template <typename... Args>
214  void call_nop(Args&&... args) {}
215 
216  template <typename... Types>
217  class CombineDetId {
218  public:
219  CombineDetId() {}
220 
223  unsigned int operator[](size_t i) const { return std::get<0>(content_)[i]; }
224 
225  template <typename... Args>
226  void book(Args&&... args) {
227  impl([&](auto& vec) { vec.book(std::forward<Args>(args)...); });
228  }
229 
230  template <typename... Args>
231  void push_back(Args&&... args) {
232  impl([&](auto& vec) { vec.push_back(std::forward<Args>(args)...); });
233  }
234 
235  template <typename... Args>
236  void resize(Args&&... args) {
237  impl([&](auto& vec) { vec.resize(std::forward<Args>(args)...); });
238  }
239 
240  template <typename... Args>
241  void set(Args&&... args) {
242  impl([&](auto& vec) { vec.set(std::forward<Args>(args)...); });
243  }
244 
245  void clear() {
246  impl([&](auto& vec) { vec.clear(); });
247  }
248 
249  private:
250  // Trick to not repeate std::index_sequence_for in each of the methods above
251  template <typename F>
252  void impl(F&& func) {
253  impl2(std::index_sequence_for<Types...>{}, std::forward<F>(func));
254  }
255 
256  // Trick to exploit parameter pack expansion in function call
257  // arguments to call a member function for each tuple element
258  // (with the same signature). The comma operator is needed to
259  // return a value from the expression as an argument for the
260  // call_nop.
261  template <std::size_t... Is, typename F>
262  void impl2(std::index_sequence<Is...>, F&& func) {
263  call_nop((func(std::get<Is>(content_)), 0)...);
264  }
265 
266  std::tuple<Types...> content_;
267  };
268 
269  std::map<unsigned int, double> chargeFraction(const SiPixelCluster& cluster,
270  const DetId& detId,
271  const edm::DetSetVector<PixelDigiSimLink>& digiSimLink) {
272  std::map<unsigned int, double> simTrackIdToAdc;
273 
274  auto idetset = digiSimLink.find(detId);
275  if (idetset == digiSimLink.end())
276  return simTrackIdToAdc;
277 
278  double adcSum = 0;
280  for (int iPix = 0; iPix != cluster.size(); ++iPix) {
281  const SiPixelCluster::Pixel& pixel = cluster.pixel(iPix);
282  adcSum += pixel.adc;
283  uint32_t channel = PixelChannelIdentifier::pixelToChannel(pixel.x, pixel.y);
284  forEachMatchedSimLink(*idetset, channel, [&](const PixelDigiSimLink& simLink) {
285  double& adc = simTrackIdToAdc[simLink.SimTrackId()];
286  adc += pixel.adc * simLink.fraction();
287  });
288  }
289 
290  for (auto& pair : simTrackIdToAdc) {
291  if (adcSum == 0.)
292  pair.second = 0.;
293  else
294  pair.second /= adcSum;
295  }
296 
297  return simTrackIdToAdc;
298  }
299 
300  std::map<unsigned int, double> chargeFraction(const SiStripCluster& cluster,
301  const DetId& detId,
302  const edm::DetSetVector<StripDigiSimLink>& digiSimLink) {
303  std::map<unsigned int, double> simTrackIdToAdc;
304 
305  auto idetset = digiSimLink.find(detId);
306  if (idetset == digiSimLink.end())
307  return simTrackIdToAdc;
308 
309  double adcSum = 0;
311  int first = cluster.firstStrip();
312  for (size_t i = 0; i < cluster.amplitudes().size(); ++i) {
313  adcSum += cluster.amplitudes()[i];
314  forEachMatchedSimLink(*idetset, first + i, [&](const StripDigiSimLink& simLink) {
315  double& adc = simTrackIdToAdc[simLink.SimTrackId()];
316  adc += cluster.amplitudes()[i] * simLink.fraction();
317  });
318 
319  for (const auto& pair : simTrackIdToAdc) {
320  simTrackIdToAdc[pair.first] = (adcSum != 0. ? pair.second / adcSum : 0.);
321  }
322  }
323  return simTrackIdToAdc;
324  }
325 
326  std::map<unsigned int, double> chargeFraction(const Phase2TrackerCluster1D& cluster,
327  const DetId& detId,
328  const edm::DetSetVector<StripDigiSimLink>& digiSimLink) {
329  std::map<unsigned int, double> simTrackIdToAdc;
330  throw cms::Exception("LogicError") << "Not possible to use StripDigiSimLink with Phase2TrackerCluster1D! ";
331  return simTrackIdToAdc;
332  }
333 
334  //In the OT, there is no measurement of the charge, so no ADC value.
335  //Only in the SSA chip (so in PSs) you have one "threshold" flag that tells you if the charge of at least one strip in the cluster exceeded 1.2 MIPs.
336  std::map<unsigned int, double> chargeFraction(const Phase2TrackerCluster1D& cluster,
337  const DetId& detId,
338  const edm::DetSetVector<PixelDigiSimLink>& digiSimLink) {
339  std::map<unsigned int, double> simTrackIdToAdc;
340  return simTrackIdToAdc;
341  }
342 
343  struct TrackTPMatch {
344  int key = -1;
345  int countClusters = 0;
346  };
347 
348  TrackTPMatch findBestMatchingTrackingParticle(const reco::Track& track,
349  const ClusterTPAssociation& clusterToTPMap,
350  const TrackingParticleRefKeyToIndex& tpKeyToIndex) {
351  struct Count {
352  int clusters = 0;
353  size_t innermostHit = std::numeric_limits<size_t>::max();
354  };
355 
356  std::vector<OmniClusterRef> clusters =
357  track_associator::hitsToClusterRefs(track.recHitsBegin(), track.recHitsEnd());
358 
359  std::unordered_map<int, Count> count;
360  for (size_t iCluster = 0, end = clusters.size(); iCluster < end; ++iCluster) {
361  const auto& clusterRef = clusters[iCluster];
362 
363  auto range = clusterToTPMap.equal_range(clusterRef);
364  for (auto ip = range.first; ip != range.second; ++ip) {
365  const auto tpKey = ip->second.key();
366  if (tpKeyToIndex.find(tpKey) == tpKeyToIndex.end()) // filter out TPs not given as an input
367  continue;
368 
369  auto& elem = count[tpKey];
370  ++elem.clusters;
371  elem.innermostHit = std::min(elem.innermostHit, iCluster);
372  }
373  }
374 
375  // In case there are many matches with the same number of clusters,
376  // select the one with innermost hit
377  TrackTPMatch best;
378  int bestCount = 2; // require >= 3 cluster for the best match
379  size_t bestInnermostHit = std::numeric_limits<size_t>::max();
380  for (auto& keyCount : count) {
381  if (keyCount.second.clusters > bestCount ||
382  (keyCount.second.clusters == bestCount && keyCount.second.innermostHit < bestInnermostHit)) {
383  best.key = keyCount.first;
384  best.countClusters = bestCount = keyCount.second.clusters;
385  bestInnermostHit = keyCount.second.innermostHit;
386  }
387  }
388 
389  LogTrace("TrackingNtuple") << "findBestMatchingTrackingParticle key " << best.key;
390 
391  return best;
392  }
393 
394  TrackTPMatch findMatchingTrackingParticleFromFirstHit(const reco::Track& track,
395  const ClusterTPAssociation& clusterToTPMap,
396  const TrackingParticleRefKeyToIndex& tpKeyToIndex) {
397  TrackTPMatch best;
398 
399  std::vector<OmniClusterRef> clusters =
400  track_associator::hitsToClusterRefs(track.recHitsBegin(), track.recHitsEnd());
401  if (clusters.empty()) {
402  return best;
403  }
404 
405  auto operateCluster = [&](const auto& clusterRef, const auto& func) {
406  auto range = clusterToTPMap.equal_range(clusterRef);
407  for (auto ip = range.first; ip != range.second; ++ip) {
408  const auto tpKey = ip->second.key();
409  if (tpKeyToIndex.find(tpKey) == tpKeyToIndex.end()) // filter out TPs not given as an input
410  continue;
411  func(tpKey);
412  }
413  };
414 
415  std::vector<unsigned int>
416  validTPs; // first cluster can be associated to multiple TPs, use vector as set as this should be small
417  auto iCluster = clusters.begin();
418  operateCluster(*iCluster, [&](unsigned int tpKey) { validTPs.push_back(tpKey); });
419  if (validTPs.empty()) {
420  return best;
421  }
422  ++iCluster;
423  ++best.countClusters;
424 
425  std::vector<bool> foundTPs(validTPs.size(), false);
426  for (auto iEnd = clusters.end(); iCluster != iEnd; ++iCluster) {
427  const auto& clusterRef = *iCluster;
428 
429  // find out to which first-cluster TPs this cluster is matched to
430  operateCluster(clusterRef, [&](unsigned int tpKey) {
431  auto found = std::find(cbegin(validTPs), cend(validTPs), tpKey);
432  if (found != cend(validTPs)) {
433  foundTPs[std::distance(cbegin(validTPs), found)] = true;
434  }
435  });
436 
437  // remove the non-found TPs
438  auto iTP = validTPs.size();
439  do {
440  --iTP;
441 
442  if (!foundTPs[iTP]) {
443  validTPs.erase(validTPs.begin() + iTP);
444  foundTPs.erase(foundTPs.begin() + iTP);
445  }
446  } while (iTP > 0);
447  if (!validTPs.empty()) {
448  // for multiple TPs the "first one" is a bit arbitrary, but
449  // I hope it is rare that a track would have many
450  // consecutive hits matched to two TPs
451  best.key = validTPs[0];
452  } else {
453  break;
454  }
455 
456  std::fill(begin(foundTPs), end(foundTPs), false);
457  ++best.countClusters;
458  }
459 
460  // Reqquire >= 3 clusters for a match
461  return best.countClusters >= 3 ? best : TrackTPMatch();
462  }
463 } // namespace
464 
465 //
466 // class declaration
467 //
468 
469 class TrackingNtuple : public edm::one::EDAnalyzer<edm::one::SharedResources> {
470 public:
471  explicit TrackingNtuple(const edm::ParameterSet&);
472  ~TrackingNtuple() override;
473 
474  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
475 
476 private:
477  void analyze(const edm::Event&, const edm::EventSetup&) override;
478 
479  void clearVariables();
480 
481  enum class HitType { Pixel = 0, Strip = 1, Glued = 2, Invalid = 3, Phase2OT = 4, Unknown = 99 };
482 
483  // This gives the "best" classification of a reco hit
484  // In case of reco hit mathing to multiple sim, smaller number is
485  // considered better
486  // To be kept in synch with class HitSimType in ntuple.py
487  enum class HitSimType { Signal = 0, ITPileup = 1, OOTPileup = 2, Noise = 3, Unknown = 99 };
488 
489  using MVACollection = std::vector<float>;
490  using QualityMaskCollection = std::vector<unsigned char>;
491 
492  struct TPHitIndex {
493  TPHitIndex(unsigned int tp = 0, unsigned int simHit = 0, float to = 0, unsigned int id = 0)
494  : tpKey(tp), simHitIdx(simHit), tof(to), detId(id) {}
495  unsigned int tpKey;
496  unsigned int simHitIdx;
497  float tof;
498  unsigned int detId;
499  };
500  static bool tpHitIndexListLess(const TPHitIndex& i, const TPHitIndex& j) { return (i.tpKey < j.tpKey); }
501  static bool tpHitIndexListLessSort(const TPHitIndex& i, const TPHitIndex& j) {
502  if (i.tpKey == j.tpKey) {
503  if (edm::isNotFinite(i.tof) && edm::isNotFinite(j.tof)) {
504  return i.detId < j.detId;
505  }
506  return i.tof < j.tof; // works as intended if either one is NaN
507  }
508  return i.tpKey < j.tpKey;
509  }
510 
511  void fillBeamSpot(const reco::BeamSpot& bs);
512  void fillPixelHits(const edm::Event& iEvent,
513  const ClusterTPAssociation& clusterToTPMap,
514  const TrackingParticleRefKeyToIndex& tpKeyToIndex,
516  const edm::DetSetVector<PixelDigiSimLink>& digiSimLink,
517  const TransientTrackingRecHitBuilder& theTTRHBuilder,
518  const TrackerTopology& tTopo,
519  const SimHitRefKeyToIndex& simHitRefKeyToIndex,
520  std::set<edm::ProductID>& hitProductIds);
521 
523  const ClusterTPAssociation& clusterToTPMap,
524  const TrackingParticleRefKeyToIndex& tpKeyToIndex,
526  const edm::DetSetVector<StripDigiSimLink>& digiSimLink,
527  const TransientTrackingRecHitBuilder& theTTRHBuilder,
528  const TrackerTopology& tTopo,
529  const SimHitRefKeyToIndex& simHitRefKeyToIndex,
530  std::set<edm::ProductID>& hitProductIds);
531 
533  const TransientTrackingRecHitBuilder& theTTRHBuilder,
534  const TrackerTopology& tTopo,
535  std::vector<std::pair<int, int>>& monoStereoClusterList);
536 
538  const TransientTrackingRecHitBuilder& theTTRHBuilder,
539  const TrackerTopology& tTopo,
540  std::vector<std::pair<int, int>>& monoStereoClusterList);
541 
542  void fillPhase2OTHits(const edm::Event& iEvent,
543  const ClusterTPAssociation& clusterToTPMap,
544  const TrackingParticleRefKeyToIndex& tpKeyToIndex,
546  const edm::DetSetVector<PixelDigiSimLink>& digiSimLink,
547  const TransientTrackingRecHitBuilder& theTTRHBuilder,
548  const TrackerTopology& tTopo,
549  const SimHitRefKeyToIndex& simHitRefKeyToIndex,
550  std::set<edm::ProductID>& hitProductIds);
551 
552  void fillSeeds(const edm::Event& iEvent,
553  const TrackingParticleRefVector& tpCollection,
554  const TrackingParticleRefKeyToIndex& tpKeyToIndex,
555  const reco::BeamSpot& bs,
556  const reco::TrackToTrackingParticleAssociator& associatorByHits,
557  const ClusterTPAssociation& clusterToTPMap,
558  const TransientTrackingRecHitBuilder& theTTRHBuilder,
559  const MagneticField& theMF,
560  const TrackerTopology& tTopo,
561  std::vector<std::pair<int, int>>& monoStereoClusterList,
562  const std::set<edm::ProductID>& hitProductIds,
563  std::map<edm::ProductID, size_t>& seedToCollIndex);
564 
566  const TrackingParticleRefVector& tpCollection,
567  const TrackingParticleRefKeyToIndex& tpKeyToIndex,
568  const TrackingParticleRefKeyToCount& tpKeyToClusterCount,
569  const MagneticField& mf,
570  const reco::BeamSpot& bs,
572  const reco::TrackToTrackingParticleAssociator& associatorByHits,
573  const ClusterTPAssociation& clusterToTPMap,
574  const TransientTrackingRecHitBuilder& theTTRHBuilder,
575  const TrackerTopology& tTopo,
576  const std::set<edm::ProductID>& hitProductIds,
577  const std::map<edm::ProductID, size_t>& seedToCollIndex,
578  const std::vector<const MVACollection*>& mvaColls,
579  const std::vector<const QualityMaskCollection*>& qualColls);
580 
581  void fillSimHits(const TrackerGeometry& tracker,
582  const TrackingParticleRefKeyToIndex& tpKeyToIndex,
584  const TrackerTopology& tTopo,
585  SimHitRefKeyToIndex& simHitRefKeyToIndex,
586  std::vector<TPHitIndex>& tpHitList);
587 
589  const edm::EventSetup& iSetup,
591  const reco::BeamSpot& bs,
592  const TrackingParticleRefVector& tpCollection,
593  const TrackingVertexRefKeyToIndex& tvKeyToIndex,
594  const reco::TrackToTrackingParticleAssociator& associatorByHits,
595  const std::vector<TPHitIndex>& tpHitList,
596  const TrackingParticleRefKeyToCount& tpKeyToClusterCount);
597 
599  const reco::SimToRecoCollection& simRecColl,
600  const TrackingParticleRefKeyToIndex& tpKeyToIndex,
601  const unsigned int seedOffset);
602 
604 
605  void fillTrackingVertices(const TrackingVertexRefVector& trackingVertices,
606  const TrackingParticleRefKeyToIndex& tpKeyToIndex);
607 
608  struct SimHitData {
609  std::vector<int> matchingSimHit;
610  std::vector<float> chargeFraction;
611  std::vector<int> bunchCrossing;
612  std::vector<int> event;
614  };
615 
616  template <typename SimLink>
617  SimHitData matchCluster(const OmniClusterRef& cluster,
618  DetId hitId,
619  int clusterKey,
621  const ClusterTPAssociation& clusterToTPMap,
622  const TrackingParticleRefKeyToIndex& tpKeyToIndex,
625  const SimHitRefKeyToIndex& simHitRefKeyToIndex,
626  HitType hitType);
627 
628  // ----------member data ---------------------------
629  std::vector<edm::EDGetTokenT<edm::View<reco::Track>>> seedTokens_;
630  std::vector<edm::EDGetTokenT<std::vector<SeedStopInfo>>> seedStopInfoTokens_;
632  std::vector<std::tuple<edm::EDGetTokenT<MVACollection>, edm::EDGetTokenT<QualityMaskCollection>>>
656  const bool includeSeeds_;
657  const bool includeAllHits_;
658  const bool includeMVA_;
660 
662 
663  TTree* t;
664 
665  // DetId branches
666 #define BOOK(name) tree->Branch((prefix + "_" + #name).c_str(), &name);
667  class DetIdCommon {
668  public:
670 
671  unsigned int operator[](size_t i) const { return detId[i]; }
672 
673  void book(const std::string& prefix, TTree* tree) {
674  BOOK(detId);
675  BOOK(subdet);
676  BOOK(layer);
677  BOOK(side);
678  BOOK(module);
679  }
680 
681  void push_back(const TrackerTopology& tTopo, const DetId& id) {
682  detId.push_back(id.rawId());
683  subdet.push_back(id.subdetId());
684  layer.push_back(tTopo.layer(id));
685  module.push_back(tTopo.module(id));
686 
687  unsigned short s = 0;
688  switch (id.subdetId()) {
690  s = tTopo.tibSide(id);
691  break;
693  s = tTopo.tobSide(id);
694  break;
695  default:
696  s = tTopo.side(id);
697  }
698  side.push_back(s);
699  }
700 
701  void resize(size_t size) {
702  detId.resize(size);
703  subdet.resize(size);
704  layer.resize(size);
705  side.resize(size);
706  module.resize(size);
707  }
708 
709  void set(size_t index, const TrackerTopology& tTopo, const DetId& id) {
710  detId[index] = id.rawId();
711  subdet[index] = id.subdetId();
712  layer[index] = tTopo.layer(id);
713  side[index] = tTopo.side(id);
714  module[index] = tTopo.module(id);
715  }
716 
717  void clear() {
718  detId.clear();
719  subdet.clear();
720  layer.clear();
721  side.clear();
722  module.clear();
723  }
724 
725  private:
726  std::vector<unsigned int> detId;
727  std::vector<unsigned short> subdet;
728  std::vector<unsigned short> layer; // or disk/wheel
729  std::vector<unsigned short> side;
730  std::vector<unsigned short> module;
731  };
732 
734  public:
736 
737  void book(const std::string& prefix, TTree* tree) {
738  BOOK(ladder);
739  BOOK(blade);
740  BOOK(panel);
741  }
742 
743  void push_back(const TrackerTopology& tTopo, const DetId& id) {
744  const bool isBarrel = id.subdetId() == PixelSubdetector::PixelBarrel;
745  ladder.push_back(isBarrel ? tTopo.pxbLadder(id) : 0);
746  blade.push_back(isBarrel ? 0 : tTopo.pxfBlade(id));
747  panel.push_back(isBarrel ? 0 : tTopo.pxfPanel(id));
748  }
749 
750  void clear() {
751  ladder.clear();
752  blade.clear();
753  panel.clear();
754  }
755 
756  private:
757  std::vector<unsigned short> ladder;
758  std::vector<unsigned short> blade;
759  std::vector<unsigned short> panel;
760  };
761 
763  public:
765 
766  void book(const std::string& prefix, TTree* tree) {
767  BOOK(order);
768  BOOK(ring);
769  BOOK(rod);
770  }
771 
772  void push_back(const TrackerTopology& tTopo, const DetId& id) {
773  const auto parsed = parse(tTopo, id);
774  order.push_back(parsed.order);
775  ring.push_back(parsed.ring);
776  rod.push_back(parsed.rod);
777  }
778 
779  void resize(size_t size) {
780  order.resize(size);
781  ring.resize(size);
782  rod.resize(size);
783  }
784 
785  void set(size_t index, const TrackerTopology& tTopo, const DetId& id) {
786  const auto parsed = parse(tTopo, id);
787  order[index] = parsed.order;
788  ring[index] = parsed.ring;
789  rod[index] = parsed.rod;
790  }
791 
792  void clear() {
793  order.clear();
794  ring.clear();
795  rod.clear();
796  }
797 
798  private:
799  struct Parsed {
800  // use int here instead of short to avoid compilation errors due
801  // to narrowing conversion (less boilerplate than explicit static_casts)
802  unsigned int order = 0;
803  unsigned int ring = 0;
804  unsigned int rod = 0;
805  };
806  Parsed parse(const TrackerTopology& tTopo, const DetId& id) const {
807  switch (id.subdetId()) {
809  return Parsed{tTopo.tibOrder(id), 0, 0};
811  return Parsed{tTopo.tidOrder(id), tTopo.tidRing(id), 0};
813  return Parsed{0, 0, tTopo.tobRod(id)};
815  return Parsed{tTopo.tecOrder(id), tTopo.tecRing(id), 0};
816  default:
817  return Parsed{};
818  };
819  }
820 
821  std::vector<unsigned short> order;
822  std::vector<unsigned short> ring;
823  std::vector<unsigned short> rod;
824  };
825 
827  public:
829 
830  void book(const std::string& prefix, TTree* tree) {
831  BOOK(string);
832  BOOK(petalNumber);
833  BOOK(isStereo);
834  BOOK(isRPhi);
835  BOOK(isGlued);
836  }
837 
838  void push_back(const TrackerTopology& tTopo, const DetId& id) {
839  const auto parsed = parse(tTopo, id);
840  string.push_back(parsed.string);
841  petalNumber.push_back(parsed.petalNumber);
842  isStereo.push_back(tTopo.isStereo(id));
843  isRPhi.push_back(tTopo.isRPhi(id));
844  isGlued.push_back(parsed.glued);
845  }
846 
847  void resize(size_t size) {
848  string.resize(size);
849  petalNumber.resize(size);
850  isStereo.resize(size);
851  isRPhi.resize(size);
852  isGlued.resize(size);
853  }
854 
855  void set(size_t index, const TrackerTopology& tTopo, const DetId& id) {
856  const auto parsed = parse(tTopo, id);
857  string[index] = parsed.string;
858  petalNumber[index] = parsed.petalNumber;
859  isStereo[index] = tTopo.isStereo(id);
860  isRPhi[index] = tTopo.isRPhi(id);
861  isGlued[index] = parsed.glued;
862  }
863 
864  void clear() {
865  string.clear();
866  isStereo.clear();
867  isRPhi.clear();
868  isGlued.clear();
869  petalNumber.clear();
870  }
871 
872  private:
873  struct Parsed {
874  // use int here instead of short to avoid compilation errors due
875  // to narrowing conversion (less boilerplate than explicit static_casts)
876  unsigned int string = 0;
877  unsigned int petalNumber = 0;
878  bool glued = false;
879  };
880  Parsed parse(const TrackerTopology& tTopo, const DetId& id) const {
881  switch (id.subdetId()) {
883  return Parsed{tTopo.tibString(id), 0, tTopo.tibIsDoubleSide(id)};
885  return Parsed{0, 0, tTopo.tidIsDoubleSide(id)};
887  return Parsed{0, 0, tTopo.tobIsDoubleSide(id)};
889  return Parsed{0, tTopo.tecPetalNumber(id), tTopo.tecIsDoubleSide(id)};
890  default:
891  return Parsed{};
892  }
893  }
894 
895  std::vector<unsigned short> string;
896  std::vector<unsigned short> petalNumber;
897  std::vector<unsigned short> isStereo;
898  std::vector<unsigned short> isRPhi;
899  std::vector<unsigned short> isGlued;
900  };
901 
903  public:
905 
906  void book(const std::string& prefix, TTree* tree) {
907  BOOK(isLower);
908  BOOK(isUpper);
909  BOOK(isStack);
910  }
911 
912  void push_back(const TrackerTopology& tTopo, const DetId& id) {
913  isLower.push_back(tTopo.isLower(id));
914  isUpper.push_back(tTopo.isUpper(id));
915  isStack.push_back(tTopo.stack(id) ==
916  0); // equivalent to *IsDoubleSide() but without the hardcoded layer+ring requirements
917  }
918 
919  void clear() {
920  isLower.clear();
921  isUpper.clear();
922  isStack.clear();
923  }
924 
925  private:
926  std::vector<unsigned short> isLower;
927  std::vector<unsigned short> isUpper;
928  std::vector<unsigned short> isStack;
929  };
930 #undef BOOK
931 
932  using DetIdPixel = CombineDetId<DetIdCommon, DetIdPixelOnly>;
933  using DetIdStrip = CombineDetId<DetIdCommon, DetIdOTCommon, DetIdStripOnly>;
934  using DetIdPhase2OT = CombineDetId<DetIdCommon, DetIdOTCommon, DetIdPhase2OTOnly>;
935  using DetIdAll = CombineDetId<DetIdCommon, DetIdPixelOnly, DetIdOTCommon, DetIdStripOnly>;
936  using DetIdAllPhase2 = CombineDetId<DetIdCommon, DetIdPixelOnly, DetIdOTCommon, DetIdPhase2OTOnly>;
937 
938  // event
942 
944  // tracks
945  // (first) index runs through tracks
946  std::vector<float> trk_px;
947  std::vector<float> trk_py;
948  std::vector<float> trk_pz;
949  std::vector<float> trk_pt;
950  std::vector<float> trk_inner_px;
951  std::vector<float> trk_inner_py;
952  std::vector<float> trk_inner_pz;
953  std::vector<float> trk_inner_pt;
954  std::vector<float> trk_outer_px;
955  std::vector<float> trk_outer_py;
956  std::vector<float> trk_outer_pz;
957  std::vector<float> trk_outer_pt;
958  std::vector<float> trk_eta;
959  std::vector<float> trk_lambda;
960  std::vector<float> trk_cotTheta;
961  std::vector<float> trk_phi;
962  std::vector<float> trk_dxy;
963  std::vector<float> trk_dz;
964  std::vector<float> trk_dxyPV;
965  std::vector<float> trk_dzPV;
966  std::vector<float> trk_dxyClosestPV;
967  std::vector<float> trk_dzClosestPV;
968  std::vector<float> trk_ptErr;
969  std::vector<float> trk_etaErr;
970  std::vector<float> trk_lambdaErr;
971  std::vector<float> trk_phiErr;
972  std::vector<float> trk_dxyErr;
973  std::vector<float> trk_dzErr;
974  std::vector<float> trk_refpoint_x;
975  std::vector<float> trk_refpoint_y;
976  std::vector<float> trk_refpoint_z;
977  std::vector<float> trk_nChi2;
978  std::vector<float> trk_nChi2_1Dmod;
979  std::vector<float> trk_ndof;
980  std::vector<std::vector<float>> trk_mvas;
981  std::vector<std::vector<unsigned short>> trk_qualityMasks;
982  std::vector<int> trk_q;
983  std::vector<unsigned int> trk_nValid;
984  std::vector<unsigned int> trk_nLost;
985  std::vector<unsigned int> trk_nInactive;
986  std::vector<unsigned int> trk_nPixel;
987  std::vector<unsigned int> trk_nStrip;
988  std::vector<unsigned int> trk_nOuterLost;
989  std::vector<unsigned int> trk_nInnerLost;
990  std::vector<unsigned int> trk_nOuterInactive;
991  std::vector<unsigned int> trk_nInnerInactive;
992  std::vector<unsigned int> trk_nPixelLay;
993  std::vector<unsigned int> trk_nStripLay;
994  std::vector<unsigned int> trk_n3DLay;
995  std::vector<unsigned int> trk_nLostLay;
996  std::vector<unsigned int> trk_nCluster;
997  std::vector<unsigned int> trk_algo;
998  std::vector<unsigned int> trk_originalAlgo;
999  std::vector<decltype(reco::TrackBase().algoMaskUL())> trk_algoMask;
1000  std::vector<unsigned short> trk_stopReason;
1001  std::vector<short> trk_isHP;
1002  std::vector<int> trk_seedIdx;
1003  std::vector<int> trk_vtxIdx;
1004  std::vector<short> trk_isTrue;
1005  std::vector<int> trk_bestSimTrkIdx;
1006  std::vector<float> trk_bestSimTrkShareFrac;
1009  std::vector<float> trk_bestSimTrkNChi2;
1015  std::vector<std::vector<float>> trk_simTrkShareFrac; // second index runs through matched TrackingParticles
1016  std::vector<std::vector<float>> trk_simTrkNChi2; // second index runs through matched TrackingParticles
1017  std::vector<std::vector<int>> trk_simTrkIdx; // second index runs through matched TrackingParticles
1018  std::vector<std::vector<int>> trk_hitIdx; // second index runs through hits
1019  std::vector<std::vector<int>> trk_hitType; // second index runs through hits
1021  // sim tracks
1022  // (first) index runs through TrackingParticles
1023  std::vector<int> sim_event;
1024  std::vector<int> sim_bunchCrossing;
1025  std::vector<int> sim_pdgId;
1026  std::vector<std::vector<int>> sim_genPdgIds;
1027  std::vector<int> sim_isFromBHadron;
1028  std::vector<float> sim_px;
1029  std::vector<float> sim_py;
1030  std::vector<float> sim_pz;
1031  std::vector<float> sim_pt;
1032  std::vector<float> sim_eta;
1033  std::vector<float> sim_phi;
1034  std::vector<float> sim_pca_pt;
1035  std::vector<float> sim_pca_eta;
1036  std::vector<float> sim_pca_lambda;
1037  std::vector<float> sim_pca_cotTheta;
1038  std::vector<float> sim_pca_phi;
1039  std::vector<float> sim_pca_dxy;
1040  std::vector<float> sim_pca_dz;
1041  std::vector<int> sim_q;
1042  // numbers of sim hits/layers
1043  std::vector<unsigned int> sim_nValid;
1044  std::vector<unsigned int> sim_nPixel;
1045  std::vector<unsigned int> sim_nStrip;
1046  std::vector<unsigned int> sim_nLay;
1047  std::vector<unsigned int> sim_nPixelLay;
1048  std::vector<unsigned int> sim_n3DLay;
1049  // number of sim hits as calculated in TrackingTruthAccumulator
1050  std::vector<unsigned int> sim_nTrackerHits;
1051  // number of clusters associated to TP
1052  std::vector<unsigned int> sim_nRecoClusters;
1053  // links to other objects
1054  std::vector<std::vector<int>> sim_trkIdx; // second index runs through matched tracks
1055  std::vector<std::vector<float>> sim_trkShareFrac; // second index runs through matched tracks
1056  std::vector<std::vector<int>> sim_seedIdx; // second index runs through matched seeds
1057  std::vector<int> sim_parentVtxIdx;
1058  std::vector<std::vector<int>> sim_decayVtxIdx; // second index runs through decay vertices
1059  std::vector<std::vector<int>> sim_simHitIdx; // second index runs through SimHits
1061  // pixel hits
1062  // (first) index runs through hits
1063  std::vector<short> pix_isBarrel;
1065  std::vector<std::vector<int>> pix_trkIdx; // second index runs through tracks containing this hit
1066  std::vector<std::vector<int>> pix_seeIdx; // second index runs through seeds containing this hit
1067  std::vector<std::vector<int>> pix_simHitIdx; // second index runs through SimHits inducing this hit
1068  std::vector<std::vector<float>> pix_chargeFraction; // second index runs through SimHits inducing this hit
1069  std::vector<unsigned short> pix_simType;
1070  std::vector<float> pix_x;
1071  std::vector<float> pix_y;
1072  std::vector<float> pix_z;
1073  std::vector<float> pix_xx;
1074  std::vector<float> pix_xy;
1075  std::vector<float> pix_yy;
1076  std::vector<float> pix_yz;
1077  std::vector<float> pix_zz;
1078  std::vector<float> pix_zx;
1079  std::vector<float>
1080  pix_radL; //http://cmslxr.fnal.gov/lxr/source/DataFormats/GeometrySurface/interface/MediumProperties.h
1081  std::vector<float> pix_bbxi;
1083  // strip hits
1084  // (first) index runs through hits
1085  std::vector<short> str_isBarrel;
1087  std::vector<std::vector<int>> str_trkIdx; // second index runs through tracks containing this hit
1088  std::vector<std::vector<int>> str_seeIdx; // second index runs through seeds containing this hit
1089  std::vector<std::vector<int>> str_simHitIdx; // second index runs through SimHits inducing this hit
1090  std::vector<std::vector<float>> str_chargeFraction; // second index runs through SimHits inducing this hit
1091  std::vector<unsigned short> str_simType;
1092  std::vector<float> str_x;
1093  std::vector<float> str_y;
1094  std::vector<float> str_z;
1095  std::vector<float> str_xx;
1096  std::vector<float> str_xy;
1097  std::vector<float> str_yy;
1098  std::vector<float> str_yz;
1099  std::vector<float> str_zz;
1100  std::vector<float> str_zx;
1101  std::vector<float>
1102  str_radL; //http://cmslxr.fnal.gov/lxr/source/DataFormats/GeometrySurface/interface/MediumProperties.h
1103  std::vector<float> str_bbxi;
1105  // strip matched hits
1106  // (first) index runs through hits
1107  std::vector<short> glu_isBarrel;
1109  std::vector<int> glu_monoIdx;
1110  std::vector<int> glu_stereoIdx;
1111  std::vector<std::vector<int>> glu_seeIdx; // second index runs through seeds containing this hit
1112  std::vector<float> glu_x;
1113  std::vector<float> glu_y;
1114  std::vector<float> glu_z;
1115  std::vector<float> glu_xx;
1116  std::vector<float> glu_xy;
1117  std::vector<float> glu_yy;
1118  std::vector<float> glu_yz;
1119  std::vector<float> glu_zz;
1120  std::vector<float> glu_zx;
1121  std::vector<float>
1122  glu_radL; //http://cmslxr.fnal.gov/lxr/source/DataFormats/GeometrySurface/interface/MediumProperties.h
1123  std::vector<float> glu_bbxi;
1125  // phase2 Outer Tracker hits
1126  // (first) index runs through hits
1127  std::vector<short> ph2_isBarrel;
1129  std::vector<std::vector<int>> ph2_trkIdx; // second index runs through tracks containing this hit
1130  std::vector<std::vector<int>> ph2_seeIdx; // second index runs through seeds containing this hit
1131  std::vector<std::vector<int>> ph2_simHitIdx; // second index runs through SimHits inducing this hit
1132  //std::vector<std::vector<float> > ph2_chargeFraction; // Not supported at the moment for Phase2
1133  std::vector<unsigned short> ph2_simType;
1134  std::vector<float> ph2_x;
1135  std::vector<float> ph2_y;
1136  std::vector<float> ph2_z;
1137  std::vector<float> ph2_xx;
1138  std::vector<float> ph2_xy;
1139  std::vector<float> ph2_yy;
1140  std::vector<float> ph2_yz;
1141  std::vector<float> ph2_zz;
1142  std::vector<float> ph2_zx;
1143  std::vector<float>
1144  ph2_radL; //http://cmslxr.fnal.gov/lxr/source/DataFormats/GeometrySurface/interface/MediumProperties.h
1145  std::vector<float> ph2_bbxi;
1146 
1148  // invalid (missing/inactive/etc) hits
1149  // (first) index runs through hits
1150  std::vector<short> inv_isBarrel;
1153  std::vector<unsigned short> inv_type;
1155  // sim hits
1156  // (first) index runs through hits
1159  std::vector<float> simhit_x;
1160  std::vector<float> simhit_y;
1161  std::vector<float> simhit_z;
1162  std::vector<int> simhit_particle;
1163  std::vector<short> simhit_process;
1164  std::vector<float> simhit_eloss;
1165  std::vector<float> simhit_tof;
1166  //std::vector<unsigned int> simhit_simTrackId; // can be useful for debugging, but not much of general interest
1167  std::vector<int> simhit_simTrkIdx;
1168  std::vector<std::vector<int>> simhit_hitIdx; // second index runs through induced reco hits
1169  std::vector<std::vector<int>> simhit_hitType; // second index runs through induced reco hits
1171  // beam spot
1172  float bsp_x;
1173  float bsp_y;
1174  float bsp_z;
1175  float bsp_sigmax;
1176  float bsp_sigmay;
1177  float bsp_sigmaz;
1179  // seeds
1180  // (first) index runs through seeds
1181  std::vector<short> see_fitok;
1182  std::vector<float> see_px;
1183  std::vector<float> see_py;
1184  std::vector<float> see_pz;
1185  std::vector<float> see_pt;
1186  std::vector<float> see_eta;
1187  std::vector<float> see_phi;
1188  std::vector<float> see_dxy;
1189  std::vector<float> see_dz;
1190  std::vector<float> see_ptErr;
1191  std::vector<float> see_etaErr;
1192  std::vector<float> see_phiErr;
1193  std::vector<float> see_dxyErr;
1194  std::vector<float> see_dzErr;
1195  std::vector<float> see_chi2;
1196  std::vector<float> see_statePt;
1197  std::vector<float> see_stateTrajX;
1198  std::vector<float> see_stateTrajY;
1199  std::vector<float> see_stateTrajPx;
1200  std::vector<float> see_stateTrajPy;
1201  std::vector<float> see_stateTrajPz;
1202  std::vector<int> see_q;
1203  std::vector<unsigned int> see_nValid;
1204  std::vector<unsigned int> see_nPixel;
1205  std::vector<unsigned int> see_nGlued;
1206  std::vector<unsigned int> see_nStrip;
1207  std::vector<unsigned int> see_nPhase2OT;
1208  std::vector<unsigned int> see_nCluster;
1209  std::vector<unsigned int> see_algo;
1210  std::vector<unsigned short> see_stopReason;
1211  std::vector<unsigned short> see_nCands;
1212  std::vector<int> see_trkIdx;
1213  std::vector<short> see_isTrue;
1214  std::vector<int> see_bestSimTrkIdx;
1215  std::vector<float> see_bestSimTrkShareFrac;
1218  std::vector<std::vector<float>> see_simTrkShareFrac; // second index runs through matched TrackingParticles
1219  std::vector<std::vector<int>> see_simTrkIdx; // second index runs through matched TrackingParticles
1220  std::vector<std::vector<int>> see_hitIdx; // second index runs through hits
1221  std::vector<std::vector<int>> see_hitType; // second index runs through hits
1222  //seed algo offset, index runs through iterations
1223  std::vector<unsigned int> see_offset;
1224 
1226  // Vertices
1227  // (first) index runs through vertices
1228  std::vector<float> vtx_x;
1229  std::vector<float> vtx_y;
1230  std::vector<float> vtx_z;
1231  std::vector<float> vtx_xErr;
1232  std::vector<float> vtx_yErr;
1233  std::vector<float> vtx_zErr;
1234  std::vector<float> vtx_ndof;
1235  std::vector<float> vtx_chi2;
1236  std::vector<short> vtx_fake;
1237  std::vector<short> vtx_valid;
1238  std::vector<std::vector<int>> vtx_trkIdx; // second index runs through tracks used in the vertex fit
1239 
1241  // Tracking vertices
1242  // (first) index runs through TrackingVertices
1243  std::vector<int> simvtx_event;
1244  std::vector<int> simvtx_bunchCrossing;
1245  std::vector<unsigned int> simvtx_processType; // only from first SimVertex of TrackingVertex
1246  std::vector<float> simvtx_x;
1247  std::vector<float> simvtx_y;
1248  std::vector<float> simvtx_z;
1249  std::vector<std::vector<int>> simvtx_sourceSimIdx; // second index runs through source TrackingParticles
1250  std::vector<std::vector<int>> simvtx_daughterSimIdx; // second index runs through daughter TrackingParticles
1251  std::vector<int> simpv_idx;
1252 };
1253 
1254 //
1255 // constructors and destructor
1256 //
1258  : trackToken_(consumes<edm::View<reco::Track>>(iConfig.getUntrackedParameter<edm::InputTag>("tracks"))),
1259  clusterTPMapToken_(consumes<ClusterTPAssociation>(iConfig.getUntrackedParameter<edm::InputTag>("clusterTPMap"))),
1260  simHitTPMapToken_(consumes<SimHitTPAssociationProducer::SimHitTPAssociationList>(
1261  iConfig.getUntrackedParameter<edm::InputTag>("simHitTPMap"))),
1262  trackAssociatorToken_(consumes<reco::TrackToTrackingParticleAssociator>(
1263  iConfig.getUntrackedParameter<edm::InputTag>("trackAssociator"))),
1264  pixelSimLinkToken_(consumes<edm::DetSetVector<PixelDigiSimLink>>(
1265  iConfig.getUntrackedParameter<edm::InputTag>("pixelDigiSimLink"))),
1266  stripSimLinkToken_(consumes<edm::DetSetVector<StripDigiSimLink>>(
1267  iConfig.getUntrackedParameter<edm::InputTag>("stripDigiSimLink"))),
1268  siphase2OTSimLinksToken_(consumes<edm::DetSetVector<PixelDigiSimLink>>(
1269  iConfig.getUntrackedParameter<edm::InputTag>("phase2OTSimLink"))),
1270  includeStripHits_(!iConfig.getUntrackedParameter<edm::InputTag>("stripDigiSimLink").label().empty()),
1271  includePhase2OTHits_(!iConfig.getUntrackedParameter<edm::InputTag>("phase2OTSimLink").label().empty()),
1272  beamSpotToken_(consumes<reco::BeamSpot>(iConfig.getUntrackedParameter<edm::InputTag>("beamSpot"))),
1273  pixelRecHitToken_(
1274  consumes<SiPixelRecHitCollection>(iConfig.getUntrackedParameter<edm::InputTag>("pixelRecHits"))),
1275  stripRphiRecHitToken_(
1276  consumes<SiStripRecHit2DCollection>(iConfig.getUntrackedParameter<edm::InputTag>("stripRphiRecHits"))),
1277  stripStereoRecHitToken_(
1278  consumes<SiStripRecHit2DCollection>(iConfig.getUntrackedParameter<edm::InputTag>("stripStereoRecHits"))),
1279  stripMatchedRecHitToken_(consumes<SiStripMatchedRecHit2DCollection>(
1280  iConfig.getUntrackedParameter<edm::InputTag>("stripMatchedRecHits"))),
1281  phase2OTRecHitToken_(consumes<Phase2TrackerRecHit1DCollectionNew>(
1282  iConfig.getUntrackedParameter<edm::InputTag>("phase2OTRecHits"))),
1283  vertexToken_(consumes<reco::VertexCollection>(iConfig.getUntrackedParameter<edm::InputTag>("vertices"))),
1284  trackingVertexToken_(
1285  consumes<TrackingVertexCollection>(iConfig.getUntrackedParameter<edm::InputTag>("trackingVertices"))),
1286  tpNLayersToken_(consumes<edm::ValueMap<unsigned int>>(
1287  iConfig.getUntrackedParameter<edm::InputTag>("trackingParticleNlayers"))),
1288  tpNPixelLayersToken_(consumes<edm::ValueMap<unsigned int>>(
1289  iConfig.getUntrackedParameter<edm::InputTag>("trackingParticleNpixellayers"))),
1290  tpNStripStereoLayersToken_(consumes<edm::ValueMap<unsigned int>>(
1291  iConfig.getUntrackedParameter<edm::InputTag>("trackingParticleNstripstereolayers"))),
1292  builderName_(iConfig.getUntrackedParameter<std::string>("TTRHBuilder")),
1293  parametersDefinerName_(iConfig.getUntrackedParameter<std::string>("parametersDefiner")),
1294  includeSeeds_(iConfig.getUntrackedParameter<bool>("includeSeeds")),
1295  includeAllHits_(iConfig.getUntrackedParameter<bool>("includeAllHits")),
1296  includeMVA_(iConfig.getUntrackedParameter<bool>("includeMVA")),
1297  includeTrackingParticles_(iConfig.getUntrackedParameter<bool>("includeTrackingParticles")) {
1298  if (includeSeeds_) {
1299  seedTokens_ =
1300  edm::vector_transform(iConfig.getUntrackedParameter<std::vector<edm::InputTag>>("seedTracks"),
1301  [&](const edm::InputTag& tag) { return consumes<edm::View<reco::Track>>(tag); });
1303  edm::vector_transform(iConfig.getUntrackedParameter<std::vector<edm::InputTag>>("trackCandidates"),
1304  [&](const edm::InputTag& tag) { return consumes<std::vector<SeedStopInfo>>(tag); });
1305  if (seedTokens_.size() != seedStopInfoTokens_.size()) {
1306  throw cms::Exception("Configuration") << "Got " << seedTokens_.size() << " seed collections, but "
1307  << seedStopInfoTokens_.size() << " track candidate collections";
1308  }
1309  }
1310 
1311  if (includeAllHits_) {
1313  throw cms::Exception("Configuration")
1314  << "Both stripDigiSimLink and phase2OTSimLink are set, please set only either one (this information is used "
1315  "to infer if you're running phase0/1 or phase2 detector)";
1316  }
1318  throw cms::Exception("Configuration")
1319  << "Neither stripDigiSimLink or phase2OTSimLink are set, please set either one.";
1320  }
1321  }
1322 
1323  const bool tpRef = iConfig.getUntrackedParameter<bool>("trackingParticlesRef");
1324  const auto tpTag = iConfig.getUntrackedParameter<edm::InputTag>("trackingParticles");
1325  if (tpRef) {
1326  trackingParticleRefToken_ = consumes<TrackingParticleRefVector>(tpTag);
1327  } else {
1328  trackingParticleToken_ = consumes<TrackingParticleCollection>(tpTag);
1329  }
1330 
1331  tracer_.depth(-2); // as in SimTracker/TrackHistory/src/TrackClassifier.cc
1332 
1333  if (includeMVA_) {
1335  iConfig.getUntrackedParameter<std::vector<std::string>>("trackMVAs"), [&](const std::string& tag) {
1336  return std::make_tuple(consumes<MVACollection>(edm::InputTag(tag, "MVAValues")),
1337  consumes<QualityMaskCollection>(edm::InputTag(tag, "QualityMasks")));
1338  });
1339  }
1340 
1341  usesResource(TFileService::kSharedResource);
1343  t = fs->make<TTree>("tree", "tree");
1344 
1345  t->Branch("event", &ev_event);
1346  t->Branch("lumi", &ev_lumi);
1347  t->Branch("run", &ev_run);
1348 
1349  //tracks
1350  t->Branch("trk_px", &trk_px);
1351  t->Branch("trk_py", &trk_py);
1352  t->Branch("trk_pz", &trk_pz);
1353  t->Branch("trk_pt", &trk_pt);
1354  t->Branch("trk_inner_px", &trk_inner_px);
1355  t->Branch("trk_inner_py", &trk_inner_py);
1356  t->Branch("trk_inner_pz", &trk_inner_pz);
1357  t->Branch("trk_inner_pt", &trk_inner_pt);
1358  t->Branch("trk_outer_px", &trk_outer_px);
1359  t->Branch("trk_outer_py", &trk_outer_py);
1360  t->Branch("trk_outer_pz", &trk_outer_pz);
1361  t->Branch("trk_outer_pt", &trk_outer_pt);
1362  t->Branch("trk_eta", &trk_eta);
1363  t->Branch("trk_lambda", &trk_lambda);
1364  t->Branch("trk_cotTheta", &trk_cotTheta);
1365  t->Branch("trk_phi", &trk_phi);
1366  t->Branch("trk_dxy", &trk_dxy);
1367  t->Branch("trk_dz", &trk_dz);
1368  t->Branch("trk_dxyPV", &trk_dxyPV);
1369  t->Branch("trk_dzPV", &trk_dzPV);
1370  t->Branch("trk_dxyClosestPV", &trk_dxyClosestPV);
1371  t->Branch("trk_dzClosestPV", &trk_dzClosestPV);
1372  t->Branch("trk_ptErr", &trk_ptErr);
1373  t->Branch("trk_etaErr", &trk_etaErr);
1374  t->Branch("trk_lambdaErr", &trk_lambdaErr);
1375  t->Branch("trk_phiErr", &trk_phiErr);
1376  t->Branch("trk_dxyErr", &trk_dxyErr);
1377  t->Branch("trk_dzErr", &trk_dzErr);
1378  t->Branch("trk_refpoint_x", &trk_refpoint_x);
1379  t->Branch("trk_refpoint_y", &trk_refpoint_y);
1380  t->Branch("trk_refpoint_z", &trk_refpoint_z);
1381  t->Branch("trk_nChi2", &trk_nChi2);
1382  t->Branch("trk_nChi2_1Dmod", &trk_nChi2_1Dmod);
1383  t->Branch("trk_ndof", &trk_ndof);
1384  if (includeMVA_) {
1385  trk_mvas.resize(mvaQualityCollectionTokens_.size());
1387  if (!trk_mvas.empty()) {
1388  t->Branch("trk_mva", &(trk_mvas[0]));
1389  t->Branch("trk_qualityMask", &(trk_qualityMasks[0]));
1390  for (size_t i = 1; i < trk_mvas.size(); ++i) {
1391  t->Branch(("trk_mva" + std::to_string(i + 1)).c_str(), &(trk_mvas[i]));
1392  t->Branch(("trk_qualityMask" + std::to_string(i + 1)).c_str(), &(trk_qualityMasks[i]));
1393  }
1394  }
1395  }
1396  t->Branch("trk_q", &trk_q);
1397  t->Branch("trk_nValid", &trk_nValid);
1398  t->Branch("trk_nLost", &trk_nLost);
1399  t->Branch("trk_nInactive", &trk_nInactive);
1400  t->Branch("trk_nPixel", &trk_nPixel);
1401  t->Branch("trk_nStrip", &trk_nStrip);
1402  t->Branch("trk_nOuterLost", &trk_nOuterLost);
1403  t->Branch("trk_nInnerLost", &trk_nInnerLost);
1404  t->Branch("trk_nOuterInactive", &trk_nOuterInactive);
1405  t->Branch("trk_nInnerInactive", &trk_nInnerInactive);
1406  t->Branch("trk_nPixelLay", &trk_nPixelLay);
1407  t->Branch("trk_nStripLay", &trk_nStripLay);
1408  t->Branch("trk_n3DLay", &trk_n3DLay);
1409  t->Branch("trk_nLostLay", &trk_nLostLay);
1410  t->Branch("trk_nCluster", &trk_nCluster);
1411  t->Branch("trk_algo", &trk_algo);
1412  t->Branch("trk_originalAlgo", &trk_originalAlgo);
1413  t->Branch("trk_algoMask", &trk_algoMask);
1414  t->Branch("trk_stopReason", &trk_stopReason);
1415  t->Branch("trk_isHP", &trk_isHP);
1416  if (includeSeeds_) {
1417  t->Branch("trk_seedIdx", &trk_seedIdx);
1418  }
1419  t->Branch("trk_vtxIdx", &trk_vtxIdx);
1421  t->Branch("trk_simTrkIdx", &trk_simTrkIdx);
1422  t->Branch("trk_simTrkShareFrac", &trk_simTrkShareFrac);
1423  t->Branch("trk_simTrkNChi2", &trk_simTrkNChi2);
1424  t->Branch("trk_bestSimTrkIdx", &trk_bestSimTrkIdx);
1425  t->Branch("trk_bestFromFirstHitSimTrkIdx", &trk_bestFromFirstHitSimTrkIdx);
1426  } else {
1427  t->Branch("trk_isTrue", &trk_isTrue);
1428  }
1429  t->Branch("trk_bestSimTrkShareFrac", &trk_bestSimTrkShareFrac);
1430  t->Branch("trk_bestSimTrkShareFracSimDenom", &trk_bestSimTrkShareFracSimDenom);
1431  t->Branch("trk_bestSimTrkShareFracSimClusterDenom", &trk_bestSimTrkShareFracSimClusterDenom);
1432  t->Branch("trk_bestSimTrkNChi2", &trk_bestSimTrkNChi2);
1433  t->Branch("trk_bestFromFirstHitSimTrkShareFrac", &trk_bestFromFirstHitSimTrkShareFrac);
1434  t->Branch("trk_bestFromFirstHitSimTrkShareFracSimDenom", &trk_bestFromFirstHitSimTrkShareFracSimDenom);
1435  t->Branch("trk_bestFromFirstHitSimTrkShareFracSimClusterDenom", &trk_bestFromFirstHitSimTrkShareFracSimClusterDenom);
1436  t->Branch("trk_bestFromFirstHitSimTrkNChi2", &trk_bestFromFirstHitSimTrkNChi2);
1437  if (includeAllHits_) {
1438  t->Branch("trk_hitIdx", &trk_hitIdx);
1439  t->Branch("trk_hitType", &trk_hitType);
1440  }
1442  //sim tracks
1443  t->Branch("sim_event", &sim_event);
1444  t->Branch("sim_bunchCrossing", &sim_bunchCrossing);
1445  t->Branch("sim_pdgId", &sim_pdgId);
1446  t->Branch("sim_genPdgIds", &sim_genPdgIds);
1447  t->Branch("sim_isFromBHadron", &sim_isFromBHadron);
1448  t->Branch("sim_px", &sim_px);
1449  t->Branch("sim_py", &sim_py);
1450  t->Branch("sim_pz", &sim_pz);
1451  t->Branch("sim_pt", &sim_pt);
1452  t->Branch("sim_eta", &sim_eta);
1453  t->Branch("sim_phi", &sim_phi);
1454  t->Branch("sim_pca_pt", &sim_pca_pt);
1455  t->Branch("sim_pca_eta", &sim_pca_eta);
1456  t->Branch("sim_pca_lambda", &sim_pca_lambda);
1457  t->Branch("sim_pca_cotTheta", &sim_pca_cotTheta);
1458  t->Branch("sim_pca_phi", &sim_pca_phi);
1459  t->Branch("sim_pca_dxy", &sim_pca_dxy);
1460  t->Branch("sim_pca_dz", &sim_pca_dz);
1461  t->Branch("sim_q", &sim_q);
1462  t->Branch("sim_nValid", &sim_nValid);
1463  t->Branch("sim_nPixel", &sim_nPixel);
1464  t->Branch("sim_nStrip", &sim_nStrip);
1465  t->Branch("sim_nLay", &sim_nLay);
1466  t->Branch("sim_nPixelLay", &sim_nPixelLay);
1467  t->Branch("sim_n3DLay", &sim_n3DLay);
1468  t->Branch("sim_nTrackerHits", &sim_nTrackerHits);
1469  t->Branch("sim_nRecoClusters", &sim_nRecoClusters);
1470  t->Branch("sim_trkIdx", &sim_trkIdx);
1471  t->Branch("sim_trkShareFrac", &sim_trkShareFrac);
1472  if (includeSeeds_) {
1473  t->Branch("sim_seedIdx", &sim_seedIdx);
1474  }
1475  t->Branch("sim_parentVtxIdx", &sim_parentVtxIdx);
1476  t->Branch("sim_decayVtxIdx", &sim_decayVtxIdx);
1477  if (includeAllHits_) {
1478  t->Branch("sim_simHitIdx", &sim_simHitIdx);
1479  }
1480  }
1481  if (includeAllHits_) {
1482  //pixels
1483  t->Branch("pix_isBarrel", &pix_isBarrel);
1484  pix_detId.book("pix", t);
1485  t->Branch("pix_trkIdx", &pix_trkIdx);
1486  if (includeSeeds_) {
1487  t->Branch("pix_seeIdx", &pix_seeIdx);
1488  }
1490  t->Branch("pix_simHitIdx", &pix_simHitIdx);
1491  t->Branch("pix_chargeFraction", &pix_chargeFraction);
1492  t->Branch("pix_simType", &pix_simType);
1493  }
1494  t->Branch("pix_x", &pix_x);
1495  t->Branch("pix_y", &pix_y);
1496  t->Branch("pix_z", &pix_z);
1497  t->Branch("pix_xx", &pix_xx);
1498  t->Branch("pix_xy", &pix_xy);
1499  t->Branch("pix_yy", &pix_yy);
1500  t->Branch("pix_yz", &pix_yz);
1501  t->Branch("pix_zz", &pix_zz);
1502  t->Branch("pix_zx", &pix_zx);
1503  t->Branch("pix_radL", &pix_radL);
1504  t->Branch("pix_bbxi", &pix_bbxi);
1505  t->Branch("pix_bbxi", &pix_bbxi);
1506  //strips
1507  if (includeStripHits_) {
1508  t->Branch("str_isBarrel", &str_isBarrel);
1509  str_detId.book("str", t);
1510  t->Branch("str_trkIdx", &str_trkIdx);
1511  if (includeSeeds_) {
1512  t->Branch("str_seeIdx", &str_seeIdx);
1513  }
1515  t->Branch("str_simHitIdx", &str_simHitIdx);
1516  t->Branch("str_chargeFraction", &str_chargeFraction);
1517  t->Branch("str_simType", &str_simType);
1518  }
1519  t->Branch("str_x", &str_x);
1520  t->Branch("str_y", &str_y);
1521  t->Branch("str_z", &str_z);
1522  t->Branch("str_xx", &str_xx);
1523  t->Branch("str_xy", &str_xy);
1524  t->Branch("str_yy", &str_yy);
1525  t->Branch("str_yz", &str_yz);
1526  t->Branch("str_zz", &str_zz);
1527  t->Branch("str_zx", &str_zx);
1528  t->Branch("str_radL", &str_radL);
1529  t->Branch("str_bbxi", &str_bbxi);
1530  //matched hits
1531  t->Branch("glu_isBarrel", &glu_isBarrel);
1532  glu_detId.book("glu", t);
1533  t->Branch("glu_monoIdx", &glu_monoIdx);
1534  t->Branch("glu_stereoIdx", &glu_stereoIdx);
1535  if (includeSeeds_) {
1536  t->Branch("glu_seeIdx", &glu_seeIdx);
1537  }
1538  t->Branch("glu_x", &glu_x);
1539  t->Branch("glu_y", &glu_y);
1540  t->Branch("glu_z", &glu_z);
1541  t->Branch("glu_xx", &glu_xx);
1542  t->Branch("glu_xy", &glu_xy);
1543  t->Branch("glu_yy", &glu_yy);
1544  t->Branch("glu_yz", &glu_yz);
1545  t->Branch("glu_zz", &glu_zz);
1546  t->Branch("glu_zx", &glu_zx);
1547  t->Branch("glu_radL", &glu_radL);
1548  t->Branch("glu_bbxi", &glu_bbxi);
1549  }
1550  //phase2 OT
1551  if (includePhase2OTHits_) {
1552  t->Branch("ph2_isBarrel", &ph2_isBarrel);
1553  ph2_detId.book("ph2", t);
1554  t->Branch("ph2_trkIdx", &ph2_trkIdx);
1555  if (includeSeeds_) {
1556  t->Branch("ph2_seeIdx", &ph2_seeIdx);
1557  }
1559  t->Branch("ph2_simHitIdx", &ph2_simHitIdx);
1560  t->Branch("ph2_simType", &ph2_simType);
1561  }
1562  t->Branch("ph2_x", &ph2_x);
1563  t->Branch("ph2_y", &ph2_y);
1564  t->Branch("ph2_z", &ph2_z);
1565  t->Branch("ph2_xx", &ph2_xx);
1566  t->Branch("ph2_xy", &ph2_xy);
1567  t->Branch("ph2_yy", &ph2_yy);
1568  t->Branch("ph2_yz", &ph2_yz);
1569  t->Branch("ph2_zz", &ph2_zz);
1570  t->Branch("ph2_zx", &ph2_zx);
1571  t->Branch("ph2_radL", &ph2_radL);
1572  t->Branch("ph2_bbxi", &ph2_bbxi);
1573  t->Branch("ph2_bbxi", &ph2_bbxi);
1574  }
1575  //invalid hits
1576  t->Branch("inv_isBarrel", &inv_isBarrel);
1577  if (includeStripHits_)
1578  inv_detId.book("inv", t);
1579  else
1580  inv_detId_phase2.book("inv", t);
1581  t->Branch("inv_type", &inv_type);
1582  //simhits
1584  if (includeStripHits_)
1585  simhit_detId.book("simhit", t);
1586  else
1587  simhit_detId_phase2.book("simhit", t);
1588  t->Branch("simhit_x", &simhit_x);
1589  t->Branch("simhit_y", &simhit_y);
1590  t->Branch("simhit_z", &simhit_z);
1591  t->Branch("simhit_particle", &simhit_particle);
1592  t->Branch("simhit_process", &simhit_process);
1593  t->Branch("simhit_eloss", &simhit_eloss);
1594  t->Branch("simhit_tof", &simhit_tof);
1595  t->Branch("simhit_simTrkIdx", &simhit_simTrkIdx);
1596  t->Branch("simhit_hitIdx", &simhit_hitIdx);
1597  t->Branch("simhit_hitType", &simhit_hitType);
1598  }
1599  }
1600  //beam spot
1601  t->Branch("bsp_x", &bsp_x, "bsp_x/F");
1602  t->Branch("bsp_y", &bsp_y, "bsp_y/F");
1603  t->Branch("bsp_z", &bsp_z, "bsp_z/F");
1604  t->Branch("bsp_sigmax", &bsp_sigmax, "bsp_sigmax/F");
1605  t->Branch("bsp_sigmay", &bsp_sigmay, "bsp_sigmay/F");
1606  t->Branch("bsp_sigmaz", &bsp_sigmaz, "bsp_sigmaz/F");
1607  if (includeSeeds_) {
1608  //seeds
1609  t->Branch("see_fitok", &see_fitok);
1610  t->Branch("see_px", &see_px);
1611  t->Branch("see_py", &see_py);
1612  t->Branch("see_pz", &see_pz);
1613  t->Branch("see_pt", &see_pt);
1614  t->Branch("see_eta", &see_eta);
1615  t->Branch("see_phi", &see_phi);
1616  t->Branch("see_dxy", &see_dxy);
1617  t->Branch("see_dz", &see_dz);
1618  t->Branch("see_ptErr", &see_ptErr);
1619  t->Branch("see_etaErr", &see_etaErr);
1620  t->Branch("see_phiErr", &see_phiErr);
1621  t->Branch("see_dxyErr", &see_dxyErr);
1622  t->Branch("see_dzErr", &see_dzErr);
1623  t->Branch("see_chi2", &see_chi2);
1624  t->Branch("see_statePt", &see_statePt);
1625  t->Branch("see_stateTrajX", &see_stateTrajX);
1626  t->Branch("see_stateTrajY", &see_stateTrajY);
1627  t->Branch("see_stateTrajPx", &see_stateTrajPx);
1628  t->Branch("see_stateTrajPy", &see_stateTrajPy);
1629  t->Branch("see_stateTrajPz", &see_stateTrajPz);
1630  t->Branch("see_q", &see_q);
1631  t->Branch("see_nValid", &see_nValid);
1632  t->Branch("see_nPixel", &see_nPixel);
1633  t->Branch("see_nGlued", &see_nGlued);
1634  t->Branch("see_nStrip", &see_nStrip);
1635  t->Branch("see_nPhase2OT", &see_nPhase2OT);
1636  t->Branch("see_nCluster", &see_nCluster);
1637  t->Branch("see_algo", &see_algo);
1638  t->Branch("see_stopReason", &see_stopReason);
1639  t->Branch("see_nCands", &see_nCands);
1640  t->Branch("see_trkIdx", &see_trkIdx);
1642  t->Branch("see_simTrkIdx", &see_simTrkIdx);
1643  t->Branch("see_simTrkShareFrac", &see_simTrkShareFrac);
1644  t->Branch("see_bestSimTrkIdx", &see_bestSimTrkIdx);
1645  t->Branch("see_bestFromFirstHitSimTrkIdx", &see_bestFromFirstHitSimTrkIdx);
1646  } else {
1647  t->Branch("see_isTrue", &see_isTrue);
1648  }
1649  t->Branch("see_bestSimTrkShareFrac", &see_bestSimTrkShareFrac);
1650  t->Branch("see_bestFromFirstHitSimTrkShareFrac", &see_bestFromFirstHitSimTrkShareFrac);
1651  if (includeAllHits_) {
1652  t->Branch("see_hitIdx", &see_hitIdx);
1653  t->Branch("see_hitType", &see_hitType);
1654  }
1655  //seed algo offset
1656  t->Branch("see_offset", &see_offset);
1657  }
1658 
1659  //vertices
1660  t->Branch("vtx_x", &vtx_x);
1661  t->Branch("vtx_y", &vtx_y);
1662  t->Branch("vtx_z", &vtx_z);
1663  t->Branch("vtx_xErr", &vtx_xErr);
1664  t->Branch("vtx_yErr", &vtx_yErr);
1665  t->Branch("vtx_zErr", &vtx_zErr);
1666  t->Branch("vtx_ndof", &vtx_ndof);
1667  t->Branch("vtx_chi2", &vtx_chi2);
1668  t->Branch("vtx_fake", &vtx_fake);
1669  t->Branch("vtx_valid", &vtx_valid);
1670  t->Branch("vtx_trkIdx", &vtx_trkIdx);
1671 
1672  // tracking vertices
1673  t->Branch("simvtx_event", &simvtx_event);
1674  t->Branch("simvtx_bunchCrossing", &simvtx_bunchCrossing);
1675  t->Branch("simvtx_processType", &simvtx_processType);
1676  t->Branch("simvtx_x", &simvtx_x);
1677  t->Branch("simvtx_y", &simvtx_y);
1678  t->Branch("simvtx_z", &simvtx_z);
1679  t->Branch("simvtx_sourceSimIdx", &simvtx_sourceSimIdx);
1680  t->Branch("simvtx_daughterSimIdx", &simvtx_daughterSimIdx);
1681 
1682  t->Branch("simpv_idx", &simpv_idx);
1683 
1684  //t->Branch("" , &);
1685 }
1686 
1688  // do anything here that needs to be done at desctruction time
1689  // (e.g. close files, deallocate resources etc.)
1690 }
1691 
1692 //
1693 // member functions
1694 //
1696  ev_run = 0;
1697  ev_lumi = 0;
1698  ev_event = 0;
1699 
1700  //tracks
1701  trk_px.clear();
1702  trk_py.clear();
1703  trk_pz.clear();
1704  trk_pt.clear();
1705  trk_inner_px.clear();
1706  trk_inner_py.clear();
1707  trk_inner_pz.clear();
1708  trk_inner_pt.clear();
1709  trk_outer_px.clear();
1710  trk_outer_py.clear();
1711  trk_outer_pz.clear();
1712  trk_outer_pt.clear();
1713  trk_eta.clear();
1714  trk_lambda.clear();
1715  trk_cotTheta.clear();
1716  trk_phi.clear();
1717  trk_dxy.clear();
1718  trk_dz.clear();
1719  trk_dxyPV.clear();
1720  trk_dzPV.clear();
1721  trk_dxyClosestPV.clear();
1722  trk_dzClosestPV.clear();
1723  trk_ptErr.clear();
1724  trk_etaErr.clear();
1725  trk_lambdaErr.clear();
1726  trk_phiErr.clear();
1727  trk_dxyErr.clear();
1728  trk_dzErr.clear();
1729  trk_refpoint_x.clear();
1730  trk_refpoint_y.clear();
1731  trk_refpoint_z.clear();
1732  trk_nChi2.clear();
1733  trk_nChi2_1Dmod.clear();
1734  trk_ndof.clear();
1735  for (auto& mva : trk_mvas) {
1736  mva.clear();
1737  }
1738  for (auto& mask : trk_qualityMasks) {
1739  mask.clear();
1740  }
1741  trk_q.clear();
1742  trk_nValid.clear();
1743  trk_nLost.clear();
1744  trk_nInactive.clear();
1745  trk_nPixel.clear();
1746  trk_nStrip.clear();
1747  trk_nOuterLost.clear();
1748  trk_nInnerLost.clear();
1749  trk_nOuterInactive.clear();
1750  trk_nInnerInactive.clear();
1751  trk_nPixelLay.clear();
1752  trk_nStripLay.clear();
1753  trk_n3DLay.clear();
1754  trk_nLostLay.clear();
1755  trk_nCluster.clear();
1756  trk_algo.clear();
1757  trk_originalAlgo.clear();
1758  trk_algoMask.clear();
1759  trk_stopReason.clear();
1760  trk_isHP.clear();
1761  trk_seedIdx.clear();
1762  trk_vtxIdx.clear();
1763  trk_isTrue.clear();
1764  trk_bestSimTrkIdx.clear();
1765  trk_bestSimTrkShareFrac.clear();
1768  trk_bestSimTrkNChi2.clear();
1774  trk_simTrkIdx.clear();
1775  trk_simTrkShareFrac.clear();
1776  trk_simTrkNChi2.clear();
1777  trk_hitIdx.clear();
1778  trk_hitType.clear();
1779  //sim tracks
1780  sim_event.clear();
1781  sim_bunchCrossing.clear();
1782  sim_pdgId.clear();
1783  sim_genPdgIds.clear();
1784  sim_isFromBHadron.clear();
1785  sim_px.clear();
1786  sim_py.clear();
1787  sim_pz.clear();
1788  sim_pt.clear();
1789  sim_eta.clear();
1790  sim_phi.clear();
1791  sim_pca_pt.clear();
1792  sim_pca_eta.clear();
1793  sim_pca_lambda.clear();
1794  sim_pca_cotTheta.clear();
1795  sim_pca_phi.clear();
1796  sim_pca_dxy.clear();
1797  sim_pca_dz.clear();
1798  sim_q.clear();
1799  sim_nValid.clear();
1800  sim_nPixel.clear();
1801  sim_nStrip.clear();
1802  sim_nLay.clear();
1803  sim_nPixelLay.clear();
1804  sim_n3DLay.clear();
1805  sim_nTrackerHits.clear();
1806  sim_nRecoClusters.clear();
1807  sim_trkIdx.clear();
1808  sim_seedIdx.clear();
1809  sim_trkShareFrac.clear();
1810  sim_parentVtxIdx.clear();
1811  sim_decayVtxIdx.clear();
1812  sim_simHitIdx.clear();
1813  //pixels
1814  pix_isBarrel.clear();
1815  pix_detId.clear();
1816  pix_trkIdx.clear();
1817  pix_seeIdx.clear();
1818  pix_simHitIdx.clear();
1819  pix_chargeFraction.clear();
1820  pix_simType.clear();
1821  pix_x.clear();
1822  pix_y.clear();
1823  pix_z.clear();
1824  pix_xx.clear();
1825  pix_xy.clear();
1826  pix_yy.clear();
1827  pix_yz.clear();
1828  pix_zz.clear();
1829  pix_zx.clear();
1830  pix_radL.clear();
1831  pix_bbxi.clear();
1832  //strips
1833  str_isBarrel.clear();
1834  str_detId.clear();
1835  str_trkIdx.clear();
1836  str_seeIdx.clear();
1837  str_simHitIdx.clear();
1838  str_chargeFraction.clear();
1839  str_simType.clear();
1840  str_x.clear();
1841  str_y.clear();
1842  str_z.clear();
1843  str_xx.clear();
1844  str_xy.clear();
1845  str_yy.clear();
1846  str_yz.clear();
1847  str_zz.clear();
1848  str_zx.clear();
1849  str_radL.clear();
1850  str_bbxi.clear();
1851  //matched hits
1852  glu_isBarrel.clear();
1853  glu_detId.clear();
1854  glu_monoIdx.clear();
1855  glu_stereoIdx.clear();
1856  glu_seeIdx.clear();
1857  glu_x.clear();
1858  glu_y.clear();
1859  glu_z.clear();
1860  glu_xx.clear();
1861  glu_xy.clear();
1862  glu_yy.clear();
1863  glu_yz.clear();
1864  glu_zz.clear();
1865  glu_zx.clear();
1866  glu_radL.clear();
1867  glu_bbxi.clear();
1868  //phase2 OT
1869  ph2_isBarrel.clear();
1870  ph2_detId.clear();
1871  ph2_trkIdx.clear();
1872  ph2_seeIdx.clear();
1873  ph2_simHitIdx.clear();
1874  ph2_simType.clear();
1875  ph2_x.clear();
1876  ph2_y.clear();
1877  ph2_z.clear();
1878  ph2_xx.clear();
1879  ph2_xy.clear();
1880  ph2_yy.clear();
1881  ph2_yz.clear();
1882  ph2_zz.clear();
1883  ph2_zx.clear();
1884  ph2_radL.clear();
1885  ph2_bbxi.clear();
1886  //invalid hits
1887  inv_isBarrel.clear();
1888  inv_detId.clear();
1889  inv_detId_phase2.clear();
1890  inv_type.clear();
1891  // simhits
1892  simhit_detId.clear();
1893  simhit_detId_phase2.clear();
1894  simhit_x.clear();
1895  simhit_y.clear();
1896  simhit_z.clear();
1897  simhit_particle.clear();
1898  simhit_process.clear();
1899  simhit_eloss.clear();
1900  simhit_tof.clear();
1901  //simhit_simTrackId.clear();
1902  simhit_simTrkIdx.clear();
1903  simhit_hitIdx.clear();
1904  simhit_hitType.clear();
1905  //beamspot
1906  bsp_x = -9999.;
1907  bsp_y = -9999.;
1908  bsp_z = -9999.;
1909  bsp_sigmax = -9999.;
1910  bsp_sigmay = -9999.;
1911  bsp_sigmaz = -9999.;
1912  //seeds
1913  see_fitok.clear();
1914  see_px.clear();
1915  see_py.clear();
1916  see_pz.clear();
1917  see_pt.clear();
1918  see_eta.clear();
1919  see_phi.clear();
1920  see_dxy.clear();
1921  see_dz.clear();
1922  see_ptErr.clear();
1923  see_etaErr.clear();
1924  see_phiErr.clear();
1925  see_dxyErr.clear();
1926  see_dzErr.clear();
1927  see_chi2.clear();
1928  see_statePt.clear();
1929  see_stateTrajX.clear();
1930  see_stateTrajY.clear();
1931  see_stateTrajPx.clear();
1932  see_stateTrajPy.clear();
1933  see_stateTrajPz.clear();
1934  see_q.clear();
1935  see_nValid.clear();
1936  see_nPixel.clear();
1937  see_nGlued.clear();
1938  see_nStrip.clear();
1939  see_nPhase2OT.clear();
1940  see_nCluster.clear();
1941  see_algo.clear();
1942  see_stopReason.clear();
1943  see_nCands.clear();
1944  see_trkIdx.clear();
1945  see_isTrue.clear();
1946  see_bestSimTrkIdx.clear();
1947  see_bestSimTrkShareFrac.clear();
1950  see_simTrkIdx.clear();
1951  see_simTrkShareFrac.clear();
1952  see_hitIdx.clear();
1953  see_hitType.clear();
1954  //seed algo offset
1955  see_offset.clear();
1956 
1957  // vertices
1958  vtx_x.clear();
1959  vtx_y.clear();
1960  vtx_z.clear();
1961  vtx_xErr.clear();
1962  vtx_yErr.clear();
1963  vtx_zErr.clear();
1964  vtx_ndof.clear();
1965  vtx_chi2.clear();
1966  vtx_fake.clear();
1967  vtx_valid.clear();
1968  vtx_trkIdx.clear();
1969 
1970  // Tracking vertices
1971  simvtx_event.clear();
1972  simvtx_bunchCrossing.clear();
1973  simvtx_processType.clear();
1974  simvtx_x.clear();
1975  simvtx_y.clear();
1976  simvtx_z.clear();
1977  simvtx_sourceSimIdx.clear();
1978  simvtx_daughterSimIdx.clear();
1979  simpv_idx.clear();
1980 }
1981 
1982 // ------------ method called for each event ------------
1984  using namespace edm;
1985  using namespace reco;
1986  using namespace std;
1987 
1989  iSetup.get<IdealMagneticFieldRecord>().get(mfHandle);
1990  const auto& mf = *mfHandle;
1991 
1993  iSetup.get<TransientRecHitRecord>().get(builderName_, theTTRHBuilder);
1994 
1995  edm::ESHandle<TrackerTopology> tTopoHandle;
1996  iSetup.get<TrackerTopologyRcd>().get(tTopoHandle);
1997  const TrackerTopology& tTopo = *tTopoHandle;
1998 
1999  edm::ESHandle<TrackerGeometry> geometryHandle;
2000  iSetup.get<TrackerDigiGeometryRecord>().get(geometryHandle);
2001  const TrackerGeometry& tracker = *geometryHandle;
2002 
2004  iEvent.getByToken(trackAssociatorToken_, theAssociator);
2005  const reco::TrackToTrackingParticleAssociator& associatorByHits = *theAssociator;
2006 
2007  LogDebug("TrackingNtuple") << "Analyzing new event";
2008 
2009  //initialize tree variables
2010  clearVariables();
2011 
2012  // FIXME: we really need to move to edm::View for reading the
2013  // TrackingParticles... Unfortunately it has non-trivial
2014  // consequences on the associator/association interfaces etc.
2016  const TrackingParticleRefVector* tmpTPptr = nullptr;
2018  edm::Handle<TrackingParticleRefVector> TPCollectionHRefVector;
2019 
2021  iEvent.getByToken(trackingParticleToken_, TPCollectionH);
2022  for (size_t i = 0, size = TPCollectionH->size(); i < size; ++i) {
2023  tmpTP.push_back(TrackingParticleRef(TPCollectionH, i));
2024  }
2025  tmpTPptr = &tmpTP;
2026  } else {
2027  iEvent.getByToken(trackingParticleRefToken_, TPCollectionHRefVector);
2028  tmpTPptr = TPCollectionHRefVector.product();
2029  }
2030  const TrackingParticleRefVector& tpCollection = *tmpTPptr;
2031 
2032  // Fill mapping from Ref::key() to index
2033  TrackingParticleRefKeyToIndex tpKeyToIndex;
2034  for (size_t i = 0; i < tpCollection.size(); ++i) {
2035  tpKeyToIndex[tpCollection[i].key()] = i;
2036  }
2037 
2038  // tracking vertices
2040  iEvent.getByToken(trackingVertexToken_, htv);
2041  const TrackingVertexCollection& tvs = *htv;
2042 
2043  // Fill mapping from Ref::key() to index
2044  TrackingVertexRefVector tvRefs;
2045  TrackingVertexRefKeyToIndex tvKeyToIndex;
2046  for (size_t i = 0; i < tvs.size(); ++i) {
2047  const TrackingVertex& v = tvs[i];
2048  if (v.eventId().bunchCrossing() != 0) // Ignore OOTPU; would be better to not to hardcode?
2049  continue;
2050  tvKeyToIndex[i] = tvRefs.size();
2051  tvRefs.push_back(TrackingVertexRef(htv, i));
2052  }
2053 
2054  //get association maps, etc.
2055  Handle<ClusterTPAssociation> pCluster2TPListH;
2056  iEvent.getByToken(clusterTPMapToken_, pCluster2TPListH);
2057  const ClusterTPAssociation& clusterToTPMap = *pCluster2TPListH;
2059  iEvent.getByToken(simHitTPMapToken_, simHitsTPAssoc);
2060 
2061  // TP -> cluster count
2062  TrackingParticleRefKeyToCount tpKeyToClusterCount;
2063  for (const auto& clusterTP : clusterToTPMap) {
2064  tpKeyToClusterCount[clusterTP.second.key()] += 1;
2065  }
2066 
2067  // SimHit key -> index mapping
2068  SimHitRefKeyToIndex simHitRefKeyToIndex;
2069 
2070  //make a list to link TrackingParticles to its simhits
2071  std::vector<TPHitIndex> tpHitList;
2072 
2073  // Count the number of reco cluster per TP
2074 
2075  std::set<edm::ProductID> hitProductIds;
2076  std::map<edm::ProductID, size_t> seedCollToOffset;
2077 
2078  ev_run = iEvent.id().run();
2079  ev_lumi = iEvent.id().luminosityBlock();
2080  ev_event = iEvent.id().event();
2081 
2082  // Digi->Sim links for pixels and strips
2083  edm::Handle<edm::DetSetVector<PixelDigiSimLink>> pixelDigiSimLinksHandle;
2084  iEvent.getByToken(pixelSimLinkToken_, pixelDigiSimLinksHandle);
2085  const auto& pixelDigiSimLinks = *pixelDigiSimLinksHandle;
2086 
2087  edm::Handle<edm::DetSetVector<StripDigiSimLink>> stripDigiSimLinksHandle;
2088  iEvent.getByToken(stripSimLinkToken_, stripDigiSimLinksHandle);
2089 
2090  // Phase2 OT DigiSimLink
2091  edm::Handle<edm::DetSetVector<PixelDigiSimLink>> siphase2OTSimLinksHandle;
2092  iEvent.getByToken(siphase2OTSimLinksToken_, siphase2OTSimLinksHandle);
2093 
2094  //beamspot
2095  Handle<reco::BeamSpot> recoBeamSpotHandle;
2096  iEvent.getByToken(beamSpotToken_, recoBeamSpotHandle);
2097  BeamSpot const& bs = *recoBeamSpotHandle;
2098  fillBeamSpot(bs);
2099 
2100  //prapare list to link matched hits to collection
2101  vector<pair<int, int>> monoStereoClusterList;
2102  if (includeAllHits_) {
2103  // simhits, only if TPs are saved as well
2105  fillSimHits(tracker, tpKeyToIndex, *simHitsTPAssoc, tTopo, simHitRefKeyToIndex, tpHitList);
2106  }
2107 
2108  //pixel hits
2110  clusterToTPMap,
2111  tpKeyToIndex,
2112  *simHitsTPAssoc,
2113  pixelDigiSimLinks,
2114  *theTTRHBuilder,
2115  tTopo,
2116  simHitRefKeyToIndex,
2117  hitProductIds);
2118 
2119  //strip hits
2120  if (includeStripHits_) {
2121  LogDebug("TrackingNtuple") << "foundStripSimLink";
2122  const auto& stripDigiSimLinks = *stripDigiSimLinksHandle;
2124  clusterToTPMap,
2125  tpKeyToIndex,
2126  *simHitsTPAssoc,
2127  stripDigiSimLinks,
2128  *theTTRHBuilder,
2129  tTopo,
2130  simHitRefKeyToIndex,
2131  hitProductIds);
2132 
2133  //matched hits
2134  fillStripMatchedHits(iEvent, *theTTRHBuilder, tTopo, monoStereoClusterList);
2135  }
2136 
2137  if (includePhase2OTHits_) {
2138  LogDebug("TrackingNtuple") << "foundPhase2OTSimLinks";
2139  const auto& phase2OTSimLinks = *siphase2OTSimLinksHandle;
2141  clusterToTPMap,
2142  tpKeyToIndex,
2143  *simHitsTPAssoc,
2144  phase2OTSimLinks,
2145  *theTTRHBuilder,
2146  tTopo,
2147  simHitRefKeyToIndex,
2148  hitProductIds);
2149  }
2150  }
2151 
2152  //seeds
2153  if (includeSeeds_) {
2154  fillSeeds(iEvent,
2155  tpCollection,
2156  tpKeyToIndex,
2157  bs,
2158  associatorByHits,
2159  clusterToTPMap,
2160  *theTTRHBuilder,
2161  mf,
2162  tTopo,
2163  monoStereoClusterList,
2164  hitProductIds,
2165  seedCollToOffset);
2166  }
2167 
2168  //tracks
2169  edm::Handle<edm::View<reco::Track>> tracksHandle;
2170  iEvent.getByToken(trackToken_, tracksHandle);
2171  const edm::View<reco::Track>& tracks = *tracksHandle;
2172  // The associator interfaces really need to be fixed...
2174  for (edm::View<Track>::size_type i = 0; i < tracks.size(); ++i) {
2175  trackRefs.push_back(tracks.refAt(i));
2176  }
2177  std::vector<const MVACollection*> mvaColls;
2178  std::vector<const QualityMaskCollection*> qualColls;
2179  if (includeMVA_) {
2182 
2183  for (const auto& tokenTpl : mvaQualityCollectionTokens_) {
2184  iEvent.getByToken(std::get<0>(tokenTpl), hmva);
2185  iEvent.getByToken(std::get<1>(tokenTpl), hqual);
2186 
2187  mvaColls.push_back(hmva.product());
2188  qualColls.push_back(hqual.product());
2189  if (mvaColls.back()->size() != tracks.size()) {
2190  throw cms::Exception("Configuration")
2191  << "Inconsistency in track collection and MVA sizes. Track collection has " << tracks.size()
2192  << " tracks, whereas the MVA " << (mvaColls.size() - 1) << " has " << mvaColls.back()->size()
2193  << " entries. Double-check your configuration.";
2194  }
2195  if (qualColls.back()->size() != tracks.size()) {
2196  throw cms::Exception("Configuration")
2197  << "Inconsistency in track collection and quality mask sizes. Track collection has " << tracks.size()
2198  << " tracks, whereas the quality mask " << (qualColls.size() - 1) << " has " << qualColls.back()->size()
2199  << " entries. Double-check your configuration.";
2200  }
2201  }
2202  }
2203 
2205  iEvent.getByToken(vertexToken_, vertices);
2206 
2207  fillTracks(trackRefs,
2208  tpCollection,
2209  tpKeyToIndex,
2210  tpKeyToClusterCount,
2211  mf,
2212  bs,
2213  *vertices,
2214  associatorByHits,
2215  clusterToTPMap,
2216  *theTTRHBuilder,
2217  tTopo,
2218  hitProductIds,
2219  seedCollToOffset,
2220  mvaColls,
2221  qualColls);
2222 
2223  //tracking particles
2224  //sort association maps with simHits
2225  std::sort(tpHitList.begin(), tpHitList.end(), tpHitIndexListLessSort);
2227  iEvent, iSetup, trackRefs, bs, tpCollection, tvKeyToIndex, associatorByHits, tpHitList, tpKeyToClusterCount);
2228 
2229  // vertices
2230  fillVertices(*vertices, trackRefs);
2231 
2232  // tracking vertices
2233  fillTrackingVertices(tvRefs, tpKeyToIndex);
2234 
2235  t->Fill();
2236 }
2237 
2239  bsp_x = bs.x0();
2240  bsp_y = bs.y0();
2241  bsp_z = bs.x0();
2242  bsp_sigmax = bs.BeamWidthX();
2243  bsp_sigmay = bs.BeamWidthY();
2244  bsp_sigmaz = bs.sigmaZ();
2245 }
2246 
2247 namespace {
2248  template <typename SimLink>
2249  struct GetCluster;
2250  template <>
2251  struct GetCluster<PixelDigiSimLink> {
2252  static const SiPixelCluster& call(const OmniClusterRef& cluster) { return cluster.pixelCluster(); }
2253  };
2254  template <>
2255  struct GetCluster<StripDigiSimLink> {
2256  static const SiStripCluster& call(const OmniClusterRef& cluster) { return cluster.stripCluster(); }
2257  };
2258 } // namespace
2259 
2260 template <typename SimLink>
2262  const OmniClusterRef& cluster,
2263  DetId hitId,
2264  int clusterKey,
2266  const ClusterTPAssociation& clusterToTPMap,
2267  const TrackingParticleRefKeyToIndex& tpKeyToIndex,
2270  const SimHitRefKeyToIndex& simHitRefKeyToIndex,
2271  HitType hitType) {
2272  SimHitData ret;
2273 
2274  std::map<unsigned int, double> simTrackIdToChargeFraction;
2275  if (hitType == HitType::Phase2OT)
2276  simTrackIdToChargeFraction = chargeFraction(cluster.phase2OTCluster(), hitId, digiSimLinks);
2277  else
2278  simTrackIdToChargeFraction = chargeFraction(GetCluster<SimLink>::call(cluster), hitId, digiSimLinks);
2279 
2280  ret.type = HitSimType::Noise;
2281  auto range = clusterToTPMap.equal_range(cluster);
2282  if (range.first != range.second) {
2283  for (auto ip = range.first; ip != range.second; ++ip) {
2284  const TrackingParticleRef& trackingParticle = ip->second;
2285 
2286  // Find out if the cluster is from signal/ITPU/OOTPU
2287  const auto event = trackingParticle->eventId().event();
2288  const auto bx = trackingParticle->eventId().bunchCrossing();
2290  if (bx == 0) {
2291  type = (event == 0 ? HitSimType::Signal : HitSimType::ITPileup);
2292  }
2293  ret.type = static_cast<HitSimType>(std::min(static_cast<int>(ret.type), static_cast<int>(type)));
2294 
2295  // Limit to only input TrackingParticles (usually signal+ITPU)
2296  auto tpIndex = tpKeyToIndex.find(trackingParticle.key());
2297  if (tpIndex == tpKeyToIndex.end())
2298  continue;
2299 
2300  //now get the corresponding sim hit
2301  std::pair<TrackingParticleRef, TrackPSimHitRef> simHitTPpairWithDummyTP(trackingParticle, TrackPSimHitRef());
2302  //SimHit is dummy: for simHitTPAssociationListGreater sorting only the TP is needed
2303  auto range = std::equal_range(simHitsTPAssoc.begin(),
2304  simHitsTPAssoc.end(),
2305  simHitTPpairWithDummyTP,
2307  bool foundSimHit = false;
2308  bool foundElectron = false;
2309  for (auto ip = range.first; ip != range.second; ++ip) {
2310  TrackPSimHitRef TPhit = ip->second;
2311  DetId dId = DetId(TPhit->detUnitId());
2312  if (dId.rawId() == hitId.rawId()) {
2313  // skip electron SimHits for non-electron TPs also here
2314  if (std::abs(TPhit->particleType()) == 11 && std::abs(trackingParticle->pdgId()) != 11) {
2315  foundElectron = true;
2316  continue;
2317  }
2318 
2319  foundSimHit = true;
2320  auto simHitKey = TPhit.key();
2321  auto simHitID = TPhit.id();
2322 
2323  auto simHitIndex = simHitRefKeyToIndex.at(std::make_pair(simHitKey, simHitID));
2324  ret.matchingSimHit.push_back(simHitIndex);
2325 
2326  double chargeFraction = 0.;
2327  for (const SimTrack& simtrk : trackingParticle->g4Tracks()) {
2328  auto found = simTrackIdToChargeFraction.find(simtrk.trackId());
2329  if (found != simTrackIdToChargeFraction.end()) {
2330  chargeFraction += found->second;
2331  }
2332  }
2333  ret.chargeFraction.push_back(chargeFraction);
2334 
2335  // only for debug prints
2336  ret.bunchCrossing.push_back(bx);
2337  ret.event.push_back(event);
2338 
2339  simhit_hitIdx[simHitIndex].push_back(clusterKey);
2340  simhit_hitType[simHitIndex].push_back(static_cast<int>(hitType));
2341  }
2342  }
2343  if (!foundSimHit) {
2344  // In case we didn't find a simhit because of filtered-out
2345  // electron SimHit, just ignore the missing SimHit.
2346  if (foundElectron)
2347  continue;
2348 
2349  auto ex = cms::Exception("LogicError")
2350  << "Did not find SimHit for reco hit DetId " << hitId.rawId() << " for TP " << trackingParticle.key()
2351  << " bx:event " << bx << ":" << event << ".\nFound SimHits from detectors ";
2352  for (auto ip = range.first; ip != range.second; ++ip) {
2353  TrackPSimHitRef TPhit = ip->second;
2354  DetId dId = DetId(TPhit->detUnitId());
2355  ex << dId.rawId() << " ";
2356  }
2357  if (trackingParticle->eventId().event() != 0) {
2358  ex << "\nSince this is a TrackingParticle from pileup, check that you're running the pileup mixing in "
2359  "playback mode.";
2360  }
2361  throw ex;
2362  }
2363  }
2364  }
2365 
2366  return ret;
2367 }
2368 
2370  const TrackingParticleRefKeyToIndex& tpKeyToIndex,
2372  const TrackerTopology& tTopo,
2373  SimHitRefKeyToIndex& simHitRefKeyToIndex,
2374  std::vector<TPHitIndex>& tpHitList) {
2375  for (const auto& assoc : simHitsTPAssoc) {
2376  auto tpKey = assoc.first.key();
2377 
2378  // SimHitTPAssociationList can contain more TrackingParticles than
2379  // what are given to this EDAnalyzer, so we can filter those out here.
2380  auto found = tpKeyToIndex.find(tpKey);
2381  if (found == tpKeyToIndex.end())
2382  continue;
2383  const auto tpIndex = found->second;
2384 
2385  // skip non-tracker simhits (mostly muons)
2386  const auto& simhit = *(assoc.second);
2387  auto detId = DetId(simhit.detUnitId());
2388  if (detId.det() != DetId::Tracker)
2389  continue;
2390 
2391  // Skip electron SimHits for non-electron TrackingParticles to
2392  // filter out delta rays. The delta ray hits just confuse. If we
2393  // need them later, let's add them as a separate "collection" of
2394  // hits of a TP
2395  const TrackingParticle& tp = *(assoc.first);
2396  if (std::abs(simhit.particleType()) == 11 && std::abs(tp.pdgId()) != 11)
2397  continue;
2398 
2399  auto simHitKey = std::make_pair(assoc.second.key(), assoc.second.id());
2400 
2401  if (simHitRefKeyToIndex.find(simHitKey) != simHitRefKeyToIndex.end()) {
2402  for (const auto& assoc2 : simHitsTPAssoc) {
2403  if (std::make_pair(assoc2.second.key(), assoc2.second.id()) == simHitKey) {
2404 #ifdef EDM_ML_DEBUG
2405  auto range1 = std::equal_range(simHitsTPAssoc.begin(),
2406  simHitsTPAssoc.end(),
2407  std::make_pair(assoc.first, TrackPSimHitRef()),
2409  auto range2 = std::equal_range(simHitsTPAssoc.begin(),
2410  simHitsTPAssoc.end(),
2411  std::make_pair(assoc2.first, TrackPSimHitRef()),
2413 
2414  LogTrace("TrackingNtuple") << "Earlier TP " << assoc2.first.key() << " SimTrack Ids";
2415  for (const auto& simTrack : assoc2.first->g4Tracks()) {
2416  edm::LogPrint("TrackingNtuple") << " SimTrack " << simTrack.trackId() << " BX:event "
2417  << simTrack.eventId().bunchCrossing() << ":" << simTrack.eventId().event();
2418  }
2419  for (auto iHit = range2.first; iHit != range2.second; ++iHit) {
2420  LogTrace("TrackingNtuple") << " SimHit " << iHit->second.key() << " " << iHit->second.id() << " tof "
2421  << iHit->second->tof() << " trackId " << iHit->second->trackId() << " BX:event "
2422  << iHit->second->eventId().bunchCrossing() << ":"
2423  << iHit->second->eventId().event();
2424  }
2425  LogTrace("TrackingNtuple") << "Current TP " << assoc.first.key() << " SimTrack Ids";
2426  for (const auto& simTrack : assoc.first->g4Tracks()) {
2427  edm::LogPrint("TrackingNtuple") << " SimTrack " << simTrack.trackId() << " BX:event "
2428  << simTrack.eventId().bunchCrossing() << ":" << simTrack.eventId().event();
2429  }
2430  for (auto iHit = range1.first; iHit != range1.second; ++iHit) {
2431  LogTrace("TrackingNtuple") << " SimHit " << iHit->second.key() << " " << iHit->second.id() << " tof "
2432  << iHit->second->tof() << " trackId " << iHit->second->trackId() << " BX:event "
2433  << iHit->second->eventId().bunchCrossing() << ":"
2434  << iHit->second->eventId().event();
2435  }
2436 #endif
2437 
2438  throw cms::Exception("LogicError")
2439  << "Got second time the SimHit " << simHitKey.first << " of " << simHitKey.second
2440  << ", first time with TrackingParticle " << assoc2.first.key() << ", now with " << tpKey;
2441  }
2442  }
2443  throw cms::Exception("LogicError") << "Got second time the SimHit " << simHitKey.first << " of "
2444  << simHitKey.second << ", now with TrackingParticle " << tpKey
2445  << ", but I didn't find the first occurrance!";
2446  }
2447 
2448  auto det = tracker.idToDetUnit(detId);
2449  if (!det)
2450  throw cms::Exception("LogicError") << "Did not find a det unit for DetId " << simhit.detUnitId()
2451  << " from tracker geometry";
2452 
2453  const auto pos = det->surface().toGlobal(simhit.localPosition());
2454  const float tof = simhit.timeOfFlight();
2455 
2456  const auto simHitIndex = simhit_x.size();
2457  simHitRefKeyToIndex[simHitKey] = simHitIndex;
2458 
2459  if (includeStripHits_)
2460  simhit_detId.push_back(tTopo, detId);
2461  else
2462  simhit_detId_phase2.push_back(tTopo, detId);
2463  simhit_x.push_back(pos.x());
2464  simhit_y.push_back(pos.y());
2465  simhit_z.push_back(pos.z());
2466  simhit_particle.push_back(simhit.particleType());
2467  simhit_process.push_back(simhit.processType());
2468  simhit_eloss.push_back(simhit.energyLoss());
2469  simhit_tof.push_back(tof);
2470  //simhit_simTrackId.push_back(simhit.trackId());
2471 
2472  simhit_simTrkIdx.push_back(tpIndex);
2473 
2474  simhit_hitIdx.emplace_back(); // filled in matchCluster
2475  simhit_hitType.emplace_back(); // filled in matchCluster
2476 
2477  tpHitList.emplace_back(tpKey, simHitIndex, tof, simhit.detUnitId());
2478  }
2479 }
2480 
2482  const ClusterTPAssociation& clusterToTPMap,
2483  const TrackingParticleRefKeyToIndex& tpKeyToIndex,
2485  const edm::DetSetVector<PixelDigiSimLink>& digiSimLink,
2486  const TransientTrackingRecHitBuilder& theTTRHBuilder,
2487  const TrackerTopology& tTopo,
2488  const SimHitRefKeyToIndex& simHitRefKeyToIndex,
2489  std::set<edm::ProductID>& hitProductIds) {
2491  iEvent.getByToken(pixelRecHitToken_, pixelHits);
2492  for (auto it = pixelHits->begin(); it != pixelHits->end(); it++) {
2493  const DetId hitId = it->detId();
2494  for (auto hit = it->begin(); hit != it->end(); hit++) {
2495  TransientTrackingRecHit::RecHitPointer ttrh = theTTRHBuilder.build(&*hit);
2496 
2497  hitProductIds.insert(hit->cluster().id());
2498 
2499  const int key = hit->cluster().key();
2500  const int lay = tTopo.layer(hitId);
2501 
2502  pix_isBarrel.push_back(hitId.subdetId() == 1);
2503  pix_detId.push_back(tTopo, hitId);
2504  pix_trkIdx.emplace_back(); // filled in fillTracks
2505  pix_seeIdx.emplace_back(); // filled in fillSeeds
2506  pix_x.push_back(ttrh->globalPosition().x());
2507  pix_y.push_back(ttrh->globalPosition().y());
2508  pix_z.push_back(ttrh->globalPosition().z());
2509  pix_xx.push_back(ttrh->globalPositionError().cxx());
2510  pix_xy.push_back(ttrh->globalPositionError().cyx());
2511  pix_yy.push_back(ttrh->globalPositionError().cyy());
2512  pix_yz.push_back(ttrh->globalPositionError().czy());
2513  pix_zz.push_back(ttrh->globalPositionError().czz());
2514  pix_zx.push_back(ttrh->globalPositionError().czx());
2515  pix_radL.push_back(ttrh->surface()->mediumProperties().radLen());
2516  pix_bbxi.push_back(ttrh->surface()->mediumProperties().xi());
2517 
2518  LogTrace("TrackingNtuple") << "pixHit cluster=" << key << " subdId=" << hitId.subdetId() << " lay=" << lay
2519  << " rawId=" << hitId.rawId() << " pos =" << ttrh->globalPosition();
2521  SimHitData simHitData = matchCluster(hit->firstClusterRef(),
2522  hitId,
2523  key,
2524  ttrh,
2525  clusterToTPMap,
2526  tpKeyToIndex,
2527  simHitsTPAssoc,
2528  digiSimLink,
2529  simHitRefKeyToIndex,
2530  HitType::Pixel);
2531  pix_simHitIdx.push_back(simHitData.matchingSimHit);
2532  pix_simType.push_back(static_cast<int>(simHitData.type));
2533  pix_chargeFraction.push_back(simHitData.chargeFraction);
2534  LogTrace("TrackingNtuple") << " nMatchingSimHit=" << simHitData.matchingSimHit.size();
2535  if (!simHitData.matchingSimHit.empty()) {
2536  const auto simHitIdx = simHitData.matchingSimHit[0];
2537  LogTrace("TrackingNtuple") << " firstMatchingSimHit=" << simHitIdx << " simHitPos="
2538  << GlobalPoint(simhit_x[simHitIdx], simhit_y[simHitIdx], simhit_z[simHitIdx])
2539  << " energyLoss=" << simhit_eloss[simHitIdx]
2540  << " particleType=" << simhit_particle[simHitIdx]
2541  << " processType=" << simhit_process[simHitIdx]
2542  << " bunchCrossing=" << simHitData.bunchCrossing[0]
2543  << " event=" << simHitData.event[0];
2544  }
2545  }
2546  }
2547  }
2548 }
2549 
2551  const ClusterTPAssociation& clusterToTPMap,
2552  const TrackingParticleRefKeyToIndex& tpKeyToIndex,
2554  const edm::DetSetVector<StripDigiSimLink>& digiSimLink,
2555  const TransientTrackingRecHitBuilder& theTTRHBuilder,
2556  const TrackerTopology& tTopo,
2557  const SimHitRefKeyToIndex& simHitRefKeyToIndex,
2558  std::set<edm::ProductID>& hitProductIds) {
2559  //index strip hit branches by cluster index
2561  iEvent.getByToken(stripRphiRecHitToken_, rphiHits);
2563  iEvent.getByToken(stripStereoRecHitToken_, stereoHits);
2564  int totalStripHits = rphiHits->dataSize() + stereoHits->dataSize();
2565  str_isBarrel.resize(totalStripHits);
2566  str_detId.resize(totalStripHits);
2567  str_trkIdx.resize(totalStripHits); // filled in fillTracks
2568  str_seeIdx.resize(totalStripHits); // filled in fillSeeds
2569  str_simHitIdx.resize(totalStripHits);
2570  str_simType.resize(totalStripHits);
2571  str_chargeFraction.resize(totalStripHits);
2572  str_x.resize(totalStripHits);
2573  str_y.resize(totalStripHits);
2574  str_z.resize(totalStripHits);
2575  str_xx.resize(totalStripHits);
2576  str_xy.resize(totalStripHits);
2577  str_yy.resize(totalStripHits);
2578  str_yz.resize(totalStripHits);
2579  str_zz.resize(totalStripHits);
2580  str_zx.resize(totalStripHits);
2581  str_radL.resize(totalStripHits);
2582  str_bbxi.resize(totalStripHits);
2583 
2584  auto fill = [&](const SiStripRecHit2DCollection& hits, const char* name) {
2585  for (const auto& detset : hits) {
2586  const DetId hitId = detset.detId();
2587  for (const auto& hit : detset) {
2588  TransientTrackingRecHit::RecHitPointer ttrh = theTTRHBuilder.build(&hit);
2589 
2590  hitProductIds.insert(hit.cluster().id());
2591 
2592  const int key = hit.cluster().key();
2593  const int lay = tTopo.layer(hitId);
2595  str_detId.set(key, tTopo, hitId);
2596  str_x[key] = ttrh->globalPosition().x();
2597  str_y[key] = ttrh->globalPosition().y();
2598  str_z[key] = ttrh->globalPosition().z();
2599  str_xx[key] = ttrh->globalPositionError().cxx();
2600  str_xy[key] = ttrh->globalPositionError().cyx();
2601  str_yy[key] = ttrh->globalPositionError().cyy();
2602  str_yz[key] = ttrh->globalPositionError().czy();
2603  str_zz[key] = ttrh->globalPositionError().czz();
2604  str_zx[key] = ttrh->globalPositionError().czx();
2605  str_radL[key] = ttrh->surface()->mediumProperties().radLen();
2606  str_bbxi[key] = ttrh->surface()->mediumProperties().xi();
2607  LogTrace("TrackingNtuple") << name << " cluster=" << key << " subdId=" << hitId.subdetId() << " lay=" << lay
2608  << " rawId=" << hitId.rawId() << " pos =" << ttrh->globalPosition();
2609 
2611  SimHitData simHitData = matchCluster(hit.firstClusterRef(),
2612  hitId,
2613  key,
2614  ttrh,
2615  clusterToTPMap,
2616  tpKeyToIndex,
2617  simHitsTPAssoc,
2618  digiSimLink,
2619  simHitRefKeyToIndex,
2620  HitType::Strip);
2621  str_simHitIdx[key] = simHitData.matchingSimHit;
2622  str_simType[key] = static_cast<int>(simHitData.type);
2623  str_chargeFraction[key] = simHitData.chargeFraction;
2624  LogTrace("TrackingNtuple") << " nMatchingSimHit=" << simHitData.matchingSimHit.size();
2625  if (!simHitData.matchingSimHit.empty()) {
2626  const auto simHitIdx = simHitData.matchingSimHit[0];
2627  LogTrace("TrackingNtuple") << " firstMatchingSimHit=" << simHitIdx << " simHitPos="
2628  << GlobalPoint(simhit_x[simHitIdx], simhit_y[simHitIdx], simhit_z[simHitIdx])
2629  << " simHitPos="
2630  << GlobalPoint(simhit_x[simHitIdx], simhit_y[simHitIdx], simhit_z[simHitIdx])
2631  << " energyLoss=" << simhit_eloss[simHitIdx]
2632  << " particleType=" << simhit_particle[simHitIdx]
2633  << " processType=" << simhit_process[simHitIdx]
2634  << " bunchCrossing=" << simHitData.bunchCrossing[0]
2635  << " event=" << simHitData.event[0];
2636  }
2637  }
2638  }
2639  }
2640  };
2641 
2642  fill(*rphiHits, "stripRPhiHit");
2643  fill(*stereoHits, "stripStereoHit");
2644 }
2645 
2647  const TransientTrackingRecHitBuilder& theTTRHBuilder,
2648  const TrackerTopology& tTopo,
2649  std::vector<std::pair<int, int>>& monoStereoClusterList) {
2650  TransientTrackingRecHit::RecHitPointer ttrh = theTTRHBuilder.build(&hit);
2651  const auto hitId = hit.geographicalId();
2652  const int lay = tTopo.layer(hitId);
2653  monoStereoClusterList.emplace_back(hit.monoHit().cluster().key(), hit.stereoHit().cluster().key());
2654  glu_isBarrel.push_back((hitId.subdetId() == StripSubdetector::TIB || hitId.subdetId() == StripSubdetector::TOB));
2655  glu_detId.push_back(tTopo, hitId);
2656  glu_monoIdx.push_back(hit.monoHit().cluster().key());
2657  glu_stereoIdx.push_back(hit.stereoHit().cluster().key());
2658  glu_seeIdx.emplace_back(); // filled in fillSeeds
2659  glu_x.push_back(ttrh->globalPosition().x());
2660  glu_y.push_back(ttrh->globalPosition().y());
2661  glu_z.push_back(ttrh->globalPosition().z());
2662  glu_xx.push_back(ttrh->globalPositionError().cxx());
2663  glu_xy.push_back(ttrh->globalPositionError().cyx());
2664  glu_yy.push_back(ttrh->globalPositionError().cyy());
2665  glu_yz.push_back(ttrh->globalPositionError().czy());
2666  glu_zz.push_back(ttrh->globalPositionError().czz());
2667  glu_zx.push_back(ttrh->globalPositionError().czx());
2668  glu_radL.push_back(ttrh->surface()->mediumProperties().radLen());
2669  glu_bbxi.push_back(ttrh->surface()->mediumProperties().xi());
2670  LogTrace("TrackingNtuple") << "stripMatchedHit"
2671  << " cluster0=" << hit.stereoHit().cluster().key()
2672  << " cluster1=" << hit.monoHit().cluster().key() << " subdId=" << hitId.subdetId()
2673  << " lay=" << lay << " rawId=" << hitId.rawId() << " pos =" << ttrh->globalPosition();
2674  return glu_isBarrel.size() - 1;
2675 }
2676 
2678  const TransientTrackingRecHitBuilder& theTTRHBuilder,
2679  const TrackerTopology& tTopo,
2680  std::vector<std::pair<int, int>>& monoStereoClusterList) {
2682  iEvent.getByToken(stripMatchedRecHitToken_, matchedHits);
2683  for (auto it = matchedHits->begin(); it != matchedHits->end(); it++) {
2684  for (auto hit = it->begin(); hit != it->end(); hit++) {
2685  addStripMatchedHit(*hit, theTTRHBuilder, tTopo, monoStereoClusterList);
2686  }
2687  }
2688 }
2689 
2691  const ClusterTPAssociation& clusterToTPMap,
2692  const TrackingParticleRefKeyToIndex& tpKeyToIndex,
2694  const edm::DetSetVector<PixelDigiSimLink>& digiSimLink,
2695  const TransientTrackingRecHitBuilder& theTTRHBuilder,
2696  const TrackerTopology& tTopo,
2697  const SimHitRefKeyToIndex& simHitRefKeyToIndex,
2698  std::set<edm::ProductID>& hitProductIds) {
2700  iEvent.getByToken(phase2OTRecHitToken_, phase2OTHits);
2701  for (auto it = phase2OTHits->begin(); it != phase2OTHits->end(); it++) {
2702  const DetId hitId = it->detId();
2703  for (auto hit = it->begin(); hit != it->end(); hit++) {
2704  TransientTrackingRecHit::RecHitPointer ttrh = theTTRHBuilder.build(&*hit);
2705 
2706  hitProductIds.insert(hit->cluster().id());
2707 
2708  const int key = hit->cluster().key();
2709  const int lay = tTopo.layer(hitId);
2710 
2711  ph2_isBarrel.push_back(hitId.subdetId() == 1);
2712  ph2_detId.push_back(tTopo, hitId);
2713  ph2_trkIdx.emplace_back(); // filled in fillTracks
2714  ph2_seeIdx.emplace_back(); // filled in fillSeeds
2715  ph2_x.push_back(ttrh->globalPosition().x());
2716  ph2_y.push_back(ttrh->globalPosition().y());
2717  ph2_z.push_back(ttrh->globalPosition().z());
2718  ph2_xx.push_back(ttrh->globalPositionError().cxx());
2719  ph2_xy.push_back(ttrh->globalPositionError().cyx());
2720  ph2_yy.push_back(ttrh->globalPositionError().cyy());
2721  ph2_yz.push_back(ttrh->globalPositionError().czy());
2722  ph2_zz.push_back(ttrh->globalPositionError().czz());
2723  ph2_zx.push_back(ttrh->globalPositionError().czx());
2724  ph2_radL.push_back(ttrh->surface()->mediumProperties().radLen());
2725  ph2_bbxi.push_back(ttrh->surface()->mediumProperties().xi());
2726 
2727  LogTrace("TrackingNtuple") << "phase2 OT cluster=" << key << " subdId=" << hitId.subdetId() << " lay=" << lay
2728  << " rawId=" << hitId.rawId() << " pos =" << ttrh->globalPosition();
2729 
2731  SimHitData simHitData = matchCluster(hit->firstClusterRef(),
2732  hitId,
2733  key,
2734  ttrh,
2735  clusterToTPMap,
2736  tpKeyToIndex,
2737  simHitsTPAssoc,
2738  digiSimLink,
2739  simHitRefKeyToIndex,
2741  ph2_simHitIdx.push_back(simHitData.matchingSimHit);
2742  ph2_simType.push_back(static_cast<int>(simHitData.type));
2743  LogTrace("TrackingNtuple") << " nMatchingSimHit=" << simHitData.matchingSimHit.size();
2744  if (!simHitData.matchingSimHit.empty()) {
2745  const auto simHitIdx = simHitData.matchingSimHit[0];
2746  LogTrace("TrackingNtuple") << " firstMatchingSimHit=" << simHitIdx << " simHitPos="
2747  << GlobalPoint(simhit_x[simHitIdx], simhit_y[simHitIdx], simhit_z[simHitIdx])
2748  << " energyLoss=" << simhit_eloss[simHitIdx]
2749  << " particleType=" << simhit_particle[simHitIdx]
2750  << " processType=" << simhit_process[simHitIdx]
2751  << " bunchCrossing=" << simHitData.bunchCrossing[0]
2752  << " event=" << simHitData.event[0];
2753  }
2754  }
2755  }
2756  }
2757 }
2758 
2760  const TrackingParticleRefVector& tpCollection,
2761  const TrackingParticleRefKeyToIndex& tpKeyToIndex,
2762  const reco::BeamSpot& bs,
2763  const reco::TrackToTrackingParticleAssociator& associatorByHits,
2764  const ClusterTPAssociation& clusterToTPMap,
2765  const TransientTrackingRecHitBuilder& theTTRHBuilder,
2766  const MagneticField& theMF,
2767  const TrackerTopology& tTopo,
2768  std::vector<std::pair<int, int>>& monoStereoClusterList,
2769  const std::set<edm::ProductID>& hitProductIds,
2770  std::map<edm::ProductID, size_t>& seedCollToOffset) {
2771  TSCBLBuilderNoMaterial tscblBuilder;
2772  for (size_t iColl = 0; iColl < seedTokens_.size(); ++iColl) {
2773  const auto& seedToken = seedTokens_[iColl];
2774 
2775  edm::Handle<edm::View<reco::Track>> seedTracksHandle;
2776  iEvent.getByToken(seedToken, seedTracksHandle);
2777  const auto& seedTracks = *seedTracksHandle;
2778 
2779  if (seedTracks.empty())
2780  continue;
2781 
2783  labelsForToken(seedToken, labels);
2784 
2785  const auto& seedStopInfoToken = seedStopInfoTokens_[iColl];
2786  edm::Handle<std::vector<SeedStopInfo>> seedStopInfoHandle;
2787  iEvent.getByToken(seedStopInfoToken, seedStopInfoHandle);
2788  const auto& seedStopInfos = *seedStopInfoHandle;
2789  if (seedTracks.size() != seedStopInfos.size()) {
2791  labelsForToken(seedStopInfoToken, labels2);
2792 
2793  throw cms::Exception("LogicError") << "Got " << seedTracks.size() << " seeds, but " << seedStopInfos.size()
2794  << " seed stopping infos for collections " << labels.module << ", "
2795  << labels2.module;
2796  }
2797 
2798  // The associator interfaces really need to be fixed...
2799  edm::RefToBaseVector<reco::Track> seedTrackRefs;
2800  for (edm::View<reco::Track>::size_type i = 0; i < seedTracks.size(); ++i) {
2801  seedTrackRefs.push_back(seedTracks.refAt(i));
2802  }
2803  reco::RecoToSimCollection recSimColl = associatorByHits.associateRecoToSim(seedTrackRefs, tpCollection);
2804  reco::SimToRecoCollection simRecColl = associatorByHits.associateSimToReco(seedTrackRefs, tpCollection);
2805 
2806  TString label = labels.module;
2807  //format label to match algoName
2808  label.ReplaceAll("seedTracks", "");
2809  label.ReplaceAll("Seeds", "");
2810  label.ReplaceAll("muonSeeded", "muonSeededStep");
2811  int algo = reco::TrackBase::algoByName(label.Data());
2812 
2813  edm::ProductID id = seedTracks[0].seedRef().id();
2814  const auto offset = see_fitok.size();
2815  auto inserted = seedCollToOffset.emplace(id, offset);
2816  if (!inserted.second)
2817  throw cms::Exception("Configuration")
2818  << "Trying to add seeds with ProductID " << id << " for a second time from collection " << labels.module
2819  << ", seed algo " << label << ". Typically this is caused by a configuration problem.";
2820  see_offset.push_back(offset);
2821 
2822  LogTrace("TrackingNtuple") << "NEW SEED LABEL: " << label << " size: " << seedTracks.size() << " algo=" << algo
2823  << " ProductID " << id;
2824 
2825  for (size_t iSeed = 0; iSeed < seedTrackRefs.size(); ++iSeed) {
2826  const auto& seedTrackRef = seedTrackRefs[iSeed];
2827  const auto& seedTrack = *seedTrackRef;
2828  const auto& seedRef = seedTrack.seedRef();
2829  const auto& seed = *seedRef;
2830 
2831  const auto seedStopInfo = seedStopInfos[iSeed];
2832 
2833  if (seedRef.id() != id)
2834  throw cms::Exception("LogicError")
2835  << "All tracks in 'TracksFromSeeds' collection should point to seeds in the same collection. Now the "
2836  "element 0 had ProductID "
2837  << id << " while the element " << seedTrackRef.key() << " had " << seedTrackRef.id()
2838  << ". The source collection is " << labels.module << ".";
2839 
2840  std::vector<int> tpIdx;
2841  std::vector<float> sharedFraction;
2842  auto foundTPs = recSimColl.find(seedTrackRef);
2843  if (foundTPs != recSimColl.end()) {
2844  for (const auto& tpQuality : foundTPs->val) {
2845  tpIdx.push_back(tpKeyToIndex.at(tpQuality.first.key()));
2846  sharedFraction.push_back(tpQuality.second);
2847  }
2848  }
2849 
2850  // Search for a best-matching TrackingParticle for a seed
2851  const int nHits = seedTrack.numberOfValidHits();
2853  seedTrack.recHitsBegin(),
2854  seedTrack.recHitsEnd()); // TODO: this function is called 3 times per track, try to reduce
2855  const int nClusters = clusters.size();
2856  const auto bestKeyCount = findBestMatchingTrackingParticle(seedTrack, clusterToTPMap, tpKeyToIndex);
2857  const float bestShareFrac =
2858  nClusters > 0 ? static_cast<float>(bestKeyCount.countClusters) / static_cast<float>(nClusters) : 0;
2859  // Another way starting from the first hit of the seed
2860  const auto bestFirstHitKeyCount =
2861  findMatchingTrackingParticleFromFirstHit(seedTrack, clusterToTPMap, tpKeyToIndex);
2862  const float bestFirstHitShareFrac =
2863  nClusters > 0 ? static_cast<float>(bestFirstHitKeyCount.countClusters) / static_cast<float>(nClusters) : 0;
2864 
2865  const bool seedFitOk = !trackFromSeedFitFailed(seedTrack);
2866  const int charge = seedTrack.charge();
2867  const float pt = seedFitOk ? seedTrack.pt() : 0;
2868  const float eta = seedFitOk ? seedTrack.eta() : 0;
2869  const float phi = seedFitOk ? seedTrack.phi() : 0;
2870 
2871  const auto seedIndex = see_fitok.size();
2872 
2873  see_fitok.push_back(seedFitOk);
2874 
2875  see_px.push_back(seedFitOk ? seedTrack.px() : 0);
2876  see_py.push_back(seedFitOk ? seedTrack.py() : 0);
2877  see_pz.push_back(seedFitOk ? seedTrack.pz() : 0);
2878  see_pt.push_back(pt);
2879  see_eta.push_back(eta);
2880  see_phi.push_back(phi);
2881  see_q.push_back(charge);
2882  see_nValid.push_back(nHits);
2883 
2884  see_dxy.push_back(seedFitOk ? seedTrack.dxy(bs.position()) : 0);
2885  see_dz.push_back(seedFitOk ? seedTrack.dz(bs.position()) : 0);
2886  see_ptErr.push_back(seedFitOk ? seedTrack.ptError() : 0);
2887  see_etaErr.push_back(seedFitOk ? seedTrack.etaError() : 0);
2888  see_phiErr.push_back(seedFitOk ? seedTrack.phiError() : 0);
2889  see_dxyErr.push_back(seedFitOk ? seedTrack.dxyError() : 0);
2890  see_dzErr.push_back(seedFitOk ? seedTrack.dzError() : 0);
2891  see_algo.push_back(algo);
2892  see_stopReason.push_back(seedStopInfo.stopReasonUC());
2893  see_nCands.push_back(seedStopInfo.candidatesPerSeed());
2894 
2895  const auto& state = seedTrack.seedRef()->startingState();
2896  const auto& pos = state.parameters().position();
2897  const auto& mom = state.parameters().momentum();
2898  see_statePt.push_back(state.pt());
2899  see_stateTrajX.push_back(pos.x());
2900  see_stateTrajY.push_back(pos.y());
2901  see_stateTrajPx.push_back(mom.x());
2902  see_stateTrajPy.push_back(mom.y());
2903  see_stateTrajPz.push_back(mom.z());
2904 
2905  see_trkIdx.push_back(-1); // to be set correctly in fillTracks
2907  see_simTrkIdx.push_back(tpIdx);
2908  see_simTrkShareFrac.push_back(sharedFraction);
2909  see_bestSimTrkIdx.push_back(bestKeyCount.key >= 0 ? tpKeyToIndex.at(bestKeyCount.key) : -1);
2911  bestFirstHitKeyCount.key >= 0 ? tpKeyToIndex.at(bestFirstHitKeyCount.key) : -1);
2912  } else {
2913  see_isTrue.push_back(!tpIdx.empty());
2914  }
2915  see_bestSimTrkShareFrac.push_back(bestShareFrac);
2916  see_bestFromFirstHitSimTrkShareFrac.push_back(bestFirstHitShareFrac);
2917 
2919  /*
2920  TransientTrackingRecHit::RecHitPointer lastRecHit = theTTRHBuilder.build(&*(seed.recHits().second-1));
2921  TrajectoryStateOnSurface state = trajectoryStateTransform::transientState( itSeed->startingState(), lastRecHit->surface(), &theMF);
2922  float pt = state.globalParameters().momentum().perp();
2923  float eta = state.globalParameters().momentum().eta();
2924  float phi = state.globalParameters().momentum().phi();
2925  see_px .push_back( state.globalParameters().momentum().x() );
2926  see_py .push_back( state.globalParameters().momentum().y() );
2927  see_pz .push_back( state.globalParameters().momentum().z() );
2928  */
2929 
2930  std::vector<int> hitIdx;
2931  std::vector<int> hitType;
2932 
2933  for (auto const& hit : seed.recHits()) {
2935  int subid = recHit->geographicalId().subdetId();
2936  if (subid == (int)PixelSubdetector::PixelBarrel || subid == (int)PixelSubdetector::PixelEndcap) {
2937  const BaseTrackerRecHit* bhit = dynamic_cast<const BaseTrackerRecHit*>(&*recHit);
2938  const auto& clusterRef = bhit->firstClusterRef();
2939  const auto clusterKey = clusterRef.cluster_pixel().key();
2940  if (includeAllHits_) {
2941  checkProductID(hitProductIds, clusterRef.id(), "seed");
2942  pix_seeIdx[clusterKey].push_back(seedIndex);
2943  }
2944  hitIdx.push_back(clusterKey);
2945  hitType.push_back(static_cast<int>(HitType::Pixel));
2946  } else if (subid == (int)StripSubdetector::TOB || subid == (int)StripSubdetector::TID ||
2947  subid == (int)StripSubdetector::TIB || subid == (int)StripSubdetector::TEC) {
2949  const SiStripMatchedRecHit2D* matchedHit = dynamic_cast<const SiStripMatchedRecHit2D*>(&*recHit);
2950  if (includeAllHits_) {
2951  checkProductID(hitProductIds, matchedHit->monoClusterRef().id(), "seed");
2952  checkProductID(hitProductIds, matchedHit->stereoClusterRef().id(), "seed");
2953  }
2954  int monoIdx = matchedHit->monoClusterRef().key();
2955  int stereoIdx = matchedHit->stereoClusterRef().key();
2956 
2957  std::vector<std::pair<int, int>>::iterator pos =
2958  find(monoStereoClusterList.begin(), monoStereoClusterList.end(), std::make_pair(monoIdx, stereoIdx));
2959  size_t gluedIndex = -1;
2960  if (pos != monoStereoClusterList.end()) {
2961  gluedIndex = std::distance(monoStereoClusterList.begin(), pos);
2962  } else {
2963  // We can encounter glued hits not in the input
2964  // SiStripMatchedRecHit2DCollection, e.g. via muon
2965  // outside-in seeds (or anything taking hits from
2966  // MeasurementTrackerEvent). So let's add them here.
2967  gluedIndex = addStripMatchedHit(*matchedHit, theTTRHBuilder, tTopo, monoStereoClusterList);
2968  }
2969 
2970  if (includeAllHits_)
2971  glu_seeIdx[gluedIndex].push_back(seedIndex);
2972  hitIdx.push_back(gluedIndex);
2973  hitType.push_back(static_cast<int>(HitType::Glued));
2974  } else {
2975  const BaseTrackerRecHit* bhit = dynamic_cast<const BaseTrackerRecHit*>(&*recHit);
2976  const auto& clusterRef = bhit->firstClusterRef();
2977  unsigned int clusterKey;
2978  if (clusterRef.isPhase2()) {
2979  clusterKey = clusterRef.cluster_phase2OT().key();
2980  } else {
2981  clusterKey = clusterRef.cluster_strip().key();
2982  }
2983 
2984  if (includeAllHits_) {
2985  checkProductID(hitProductIds, clusterRef.id(), "seed");
2986  if (clusterRef.isPhase2()) {
2987  ph2_seeIdx[clusterKey].push_back(seedIndex);
2988  } else {
2989  str_seeIdx[clusterKey].push_back(seedIndex);
2990  }
2991  }
2992 
2993  hitIdx.push_back(clusterKey);
2994  if (clusterRef.isPhase2()) {
2995  hitType.push_back(static_cast<int>(HitType::Phase2OT));
2996  } else {
2997  hitType.push_back(static_cast<int>(HitType::Strip));
2998  }
2999  }
3000  } else {
3001  LogTrace("TrackingNtuple") << " not pixel and not Strip detector";
3002  }
3003  }
3004  see_hitIdx.push_back(hitIdx);
3005  see_hitType.push_back(hitType);
3006  see_nPixel.push_back(std::count(hitType.begin(), hitType.end(), static_cast<int>(HitType::Pixel)));
3007  see_nGlued.push_back(std::count(hitType.begin(), hitType.end(), static_cast<int>(HitType::Glued)));
3008  see_nStrip.push_back(std::count(hitType.begin(), hitType.end(), static_cast<int>(HitType::Strip)));
3009  see_nPhase2OT.push_back(std::count(hitType.begin(), hitType.end(), static_cast<int>(HitType::Phase2OT)));
3010  see_nCluster.push_back(nClusters);
3011  //the part below is not strictly needed
3012  float chi2 = -1;
3013  if (nHits == 2) {
3014  TransientTrackingRecHit::RecHitPointer recHit0 = theTTRHBuilder.build(&*(seed.recHits().begin()));
3015  TransientTrackingRecHit::RecHitPointer recHit1 = theTTRHBuilder.build(&*(seed.recHits().begin() + 1));
3016  std::vector<GlobalPoint> gp(2);
3017  std::vector<GlobalError> ge(2);
3018  gp[0] = recHit0->globalPosition();
3019  ge[0] = recHit0->globalPositionError();
3020  gp[1] = recHit1->globalPosition();
3021  ge[1] = recHit1->globalPositionError();
3022  LogTrace("TrackingNtuple")
3023  << "seed " << seedTrackRef.key() << " pt=" << pt << " eta=" << eta << " phi=" << phi << " q=" << charge
3024  << " - PAIR - ids: " << recHit0->geographicalId().rawId() << " " << recHit1->geographicalId().rawId()
3025  << " hitpos: " << gp[0] << " " << gp[1] << " trans0: "
3026  << (recHit0->transientHits().size() > 1 ? recHit0->transientHits()[0]->globalPosition()
3027  : GlobalPoint(0, 0, 0))
3028  << " "
3029  << (recHit0->transientHits().size() > 1 ? recHit0->transientHits()[1]->globalPosition()
3030  : GlobalPoint(0, 0, 0))
3031  << " trans1: "
3032  << (recHit1->transientHits().size() > 1 ? recHit1->transientHits()[0]->globalPosition()
3033  : GlobalPoint(0, 0, 0))
3034  << " "
3035  << (recHit1->transientHits().size() > 1 ? recHit1->transientHits()[1]->globalPosition()
3036  : GlobalPoint(0, 0, 0))
3037  << " eta,phi: " << gp[0].eta() << "," << gp[0].phi();
3038  } else if (nHits == 3) {
3039  TransientTrackingRecHit::RecHitPointer recHit0 = theTTRHBuilder.build(&*(seed.recHits().begin()));
3040  TransientTrackingRecHit::RecHitPointer recHit1 = theTTRHBuilder.build(&*(seed.recHits().begin() + 1));
3041  TransientTrackingRecHit::RecHitPointer recHit2 = theTTRHBuilder.build(&*(seed.recHits().begin() + 2));
3043  declareDynArray(GlobalError, 4, ge);
3044  declareDynArray(bool, 4, bl);
3045  gp[0] = recHit0->globalPosition();
3046  ge[0] = recHit0->globalPositionError();
3047  int subid0 = recHit0->geographicalId().subdetId();
3048  bl[0] = (subid0 == StripSubdetector::TIB || subid0 == StripSubdetector::TOB ||
3049  subid0 == (int)PixelSubdetector::PixelBarrel);
3050  gp[1] = recHit1->globalPosition();
3051  ge[1] = recHit1->globalPositionError();
3052  int subid1 = recHit1->geographicalId().subdetId();
3053  bl[1] = (subid1 == StripSubdetector::TIB || subid1 == StripSubdetector::TOB ||
3054  subid1 == (int)PixelSubdetector::PixelBarrel);
3055  gp[2] = recHit2->globalPosition();
3056  ge[2] = recHit2->globalPositionError();
3057  int subid2 = recHit2->geographicalId().subdetId();
3058  bl[2] = (subid2 == StripSubdetector::TIB || subid2 == StripSubdetector::TOB ||
3059  subid2 == (int)PixelSubdetector::PixelBarrel);
3060  RZLine rzLine(gp, ge, bl);
3061  float seed_chi2 = rzLine.chi2();
3062  //float seed_pt = state.globalParameters().momentum().perp();
3063  float seed_pt = pt;
3064  LogTrace("TrackingNtuple")
3065  << "seed " << seedTrackRef.key() << " pt=" << pt << " eta=" << eta << " phi=" << phi << " q=" << charge
3066  << " - TRIPLET - ids: " << recHit0->geographicalId().rawId() << " " << recHit1->geographicalId().rawId()
3067  << " " << recHit2->geographicalId().rawId() << " hitpos: " << gp[0] << " " << gp[1] << " " << gp[2]
3068  << " trans0: "
3069  << (recHit0->transientHits().size() > 1 ? recHit0->transientHits()[0]->globalPosition()
3070  : GlobalPoint(0, 0, 0))
3071  << " "
3072  << (recHit0->transientHits().size() > 1 ? recHit0->transientHits()[1]->globalPosition()
3073  : GlobalPoint(0, 0, 0))
3074  << " trans1: "
3075  << (recHit1->transientHits().size() > 1 ? recHit1->transientHits()[0]->globalPosition()
3076  : GlobalPoint(0, 0, 0))
3077  << " "
3078  << (recHit1->transientHits().size() > 1 ? recHit1->transientHits()[1]->globalPosition()
3079  : GlobalPoint(0, 0, 0))
3080  << " trans2: "
3081  << (recHit2->transientHits().size() > 1 ? recHit2->transientHits()[0]->globalPosition()
3082  : GlobalPoint(0, 0, 0))
3083  << " "
3084  << (recHit2->transientHits().size() > 1 ? recHit2->transientHits()[1]->globalPosition()
3085  : GlobalPoint(0, 0, 0))
3086  << " local: "
3087  << recHit2->localPosition()
3088  //<< " tsos pos, mom: " << state.globalPosition()<<" "<<state.globalMomentum()
3089  << " eta,phi: " << gp[0].eta() << "," << gp[0].phi() << " pt,chi2: " << seed_pt << "," << seed_chi2;
3090  chi2 = seed_chi2;
3091  }
3092  see_chi2.push_back(chi2);
3093  }
3094 
3095  fillTrackingParticlesForSeeds(tpCollection, simRecColl, tpKeyToIndex, offset);
3096  }
3097 }
3098 
3100  const TrackingParticleRefVector& tpCollection,
3101  const TrackingParticleRefKeyToIndex& tpKeyToIndex,
3102  const TrackingParticleRefKeyToCount& tpKeyToClusterCount,
3103  const MagneticField& mf,
3104  const reco::BeamSpot& bs,
3106  const reco::TrackToTrackingParticleAssociator& associatorByHits,
3107  const ClusterTPAssociation& clusterToTPMap,
3108  const TransientTrackingRecHitBuilder& theTTRHBuilder,
3109  const TrackerTopology& tTopo,
3110  const std::set<edm::ProductID>& hitProductIds,
3111  const std::map<edm::ProductID, size_t>& seedCollToOffset,
3112  const std::vector<const MVACollection*>& mvaColls,
3113  const std::vector<const QualityMaskCollection*>& qualColls) {
3114  reco::RecoToSimCollection recSimColl = associatorByHits.associateRecoToSim(tracks, tpCollection);
3117  LogTrace("TrackingNtuple") << "NEW TRACK LABEL: " << labels.module;
3118 
3119  auto pvPosition = vertices[0].position();
3120 
3121  for (size_t iTrack = 0; iTrack < tracks.size(); ++iTrack) {
3122  const auto& itTrack = tracks[iTrack];
3123  int charge = itTrack->charge();
3124  float pt = itTrack->pt();
3125  float eta = itTrack->eta();
3126  const double lambda = itTrack->lambda();
3127  float chi2 = itTrack->normalizedChi2();
3128  float ndof = itTrack->ndof();
3129  float phi = itTrack->phi();
3130  int nHits = itTrack->numberOfValidHits();
3131  const reco::HitPattern& hp = itTrack->hitPattern();
3132 
3133  const auto& tkParam = itTrack->parameters();
3134  auto tkCov = itTrack->covariance();
3135  tkCov.Invert();
3136 
3137  // Standard track-TP matching
3138  int nSimHits = 0;
3139  bool isSimMatched = false;
3140  std::vector<int> tpIdx;
3141  std::vector<float> sharedFraction;
3142  std::vector<float> tpChi2;
3143  auto foundTPs = recSimColl.find(itTrack);
3144  if (foundTPs != recSimColl.end()) {
3145  if (!foundTPs->val.empty()) {
3146  nSimHits = foundTPs->val[0].first->numberOfTrackerHits();
3147  isSimMatched = true;
3148  }
3149  for (const auto& tpQuality : foundTPs->val) {
3150  tpIdx.push_back(tpKeyToIndex.at(tpQuality.first.key()));
3151  sharedFraction.push_back(tpQuality.second);
3152  tpChi2.push_back(track_associator::trackAssociationChi2(tkParam, tkCov, *(tpCollection[tpIdx.back()]), mf, bs));
3153  }
3154  }
3155 
3156  // Search for a best-matching TrackingParticle for a track
3158  itTrack->recHitsBegin(),
3159  itTrack->recHitsEnd()); // TODO: this function is called 3 times per track, try to reduce
3160  const int nClusters = clusters.size();
3161 
3162  const auto bestKeyCount = findBestMatchingTrackingParticle(*itTrack, clusterToTPMap, tpKeyToIndex);
3163  const float bestShareFrac = static_cast<float>(bestKeyCount.countClusters) / static_cast<float>(nClusters);
3164  float bestShareFracSimDenom = 0;
3165  float bestShareFracSimClusterDenom = 0;
3166  float bestChi2 = -1;
3167  if (bestKeyCount.key >= 0) {
3168  bestShareFracSimDenom =
3169  static_cast<float>(bestKeyCount.countClusters) /
3170  static_cast<float>(tpCollection[tpKeyToIndex.at(bestKeyCount.key)]->numberOfTrackerHits());
3171  bestShareFracSimClusterDenom =
3172  static_cast<float>(bestKeyCount.countClusters) / static_cast<float>(tpKeyToClusterCount.at(bestKeyCount.key));
3174  tkParam, tkCov, *(tpCollection[tpKeyToIndex.at(bestKeyCount.key)]), mf, bs);
3175  }
3176  // Another way starting from the first hit of the track
3177  const auto bestFirstHitKeyCount = findMatchingTrackingParticleFromFirstHit(*itTrack, clusterToTPMap, tpKeyToIndex);
3178  const float bestFirstHitShareFrac =
3179  static_cast<float>(bestFirstHitKeyCount.countClusters) / static_cast<float>(nClusters);
3180  float bestFirstHitShareFracSimDenom = 0;
3181  float bestFirstHitShareFracSimClusterDenom = 0;
3182  float bestFirstHitChi2 = -1;
3183  if (bestFirstHitKeyCount.key >= 0) {
3184  bestFirstHitShareFracSimDenom =
3185  static_cast<float>(bestFirstHitKeyCount.countClusters) /
3186  static_cast<float>(tpCollection[tpKeyToIndex.at(bestFirstHitKeyCount.key)]->numberOfTrackerHits());
3187  bestFirstHitShareFracSimClusterDenom = static_cast<float>(bestFirstHitKeyCount.countClusters) /
3188  static_cast<float>(tpKeyToClusterCount.at(bestFirstHitKeyCount.key));
3189  bestFirstHitChi2 = track_associator::trackAssociationChi2(
3190  tkParam, tkCov, *(tpCollection[tpKeyToIndex.at(bestFirstHitKeyCount.key)]), mf, bs);
3191  }
3192 
3193  float chi2_1Dmod = chi2;
3194  int count1dhits = 0;
3195  for (auto iHit = itTrack->recHitsBegin(), iEnd = itTrack->recHitsEnd(); iHit != iEnd; ++iHit) {
3196  const TrackingRecHit& hit = **iHit;
3197  if (hit.isValid() && typeid(hit) == typeid(SiStripRecHit1D))
3198  ++count1dhits;
3199  }
3200  if (count1dhits > 0) {
3201  chi2_1Dmod = (chi2 + count1dhits) / (ndof + count1dhits);
3202  }
3203 
3204  Point bestPV = getBestVertex(*itTrack, vertices);
3205 
3206  trk_px.push_back(itTrack->px());
3207  trk_py.push_back(itTrack->py());
3208  trk_pz.push_back(itTrack->pz());
3209  trk_pt.push_back(pt);
3210  trk_inner_px.push_back(itTrack->innerMomentum().x());
3211  trk_inner_py.push_back(itTrack->innerMomentum().y());
3212  trk_inner_pz.push_back(itTrack->innerMomentum().z());
3213  trk_inner_pt.push_back(itTrack->innerMomentum().rho());
3214  trk_outer_px.push_back(itTrack->outerMomentum().x());
3215  trk_outer_py.push_back(itTrack->outerMomentum().y());
3216  trk_outer_pz.push_back(itTrack->outerMomentum().z());
3217  trk_outer_pt.push_back(itTrack->outerMomentum().rho());
3218  trk_eta.push_back(eta);
3219  trk_lambda.push_back(lambda);
3220  trk_cotTheta.push_back(1 / tan(M_PI * 0.5 - lambda));
3221  trk_phi.push_back(phi);
3222  trk_dxy.push_back(itTrack->dxy(bs.position()));
3223  trk_dz.push_back(itTrack->dz(bs.position()));
3224  trk_dxyPV.push_back(itTrack->dxy(pvPosition));
3225  trk_dzPV.push_back(itTrack->dz(pvPosition));
3226  trk_dxyClosestPV.push_back(itTrack->dxy(bestPV));
3227  trk_dzClosestPV.push_back(itTrack->dz(bestPV));
3228  trk_ptErr.push_back(itTrack->ptError());
3229  trk_etaErr.push_back(itTrack->etaError());
3230  trk_lambdaErr.push_back(itTrack->lambdaError());
3231  trk_phiErr.push_back(itTrack->phiError());
3232  trk_dxyErr.push_back(itTrack->dxyError());
3233  trk_dzErr.push_back(itTrack->dzError());
3234  trk_refpoint_x.push_back(itTrack->vx());
3235  trk_refpoint_y.push_back(itTrack->vy());
3236  trk_refpoint_z.push_back(itTrack->vz());
3237  trk_nChi2.push_back(chi2);
3238  trk_nChi2_1Dmod.push_back(chi2_1Dmod);
3239  trk_ndof.push_back(ndof);
3240  trk_q.push_back(charge);
3241  trk_nValid.push_back(hp.numberOfValidHits());
3242  trk_nLost.push_back(hp.numberOfLostHits(reco::HitPattern::TRACK_HITS));
3243  trk_nInactive.push_back(hp.trackerLayersTotallyOffOrBad(reco::HitPattern::TRACK_HITS));
3244  trk_nPixel.push_back(hp.numberOfValidPixelHits());
3245  trk_nStrip.push_back(hp.numberOfValidStripHits());
3246  trk_nOuterLost.push_back(hp.numberOfLostTrackerHits(reco::HitPattern::MISSING_OUTER_HITS));
3247  trk_nInnerLost.push_back(hp.numberOfLostTrackerHits(reco::HitPattern::MISSING_INNER_HITS));
3248  trk_nOuterInactive.push_back(hp.trackerLayersTotallyOffOrBad(reco::HitPattern::MISSING_OUTER_HITS));
3249  trk_nInnerInactive.push_back(hp.trackerLayersTotallyOffOrBad(reco::HitPattern::MISSING_INNER_HITS));
3250  trk_nPixelLay.push_back(hp.pixelLayersWithMeasurement());
3251  trk_nStripLay.push_back(hp.stripLayersWithMeasurement());
3252  trk_n3DLay.push_back(hp.numberOfValidStripLayersWithMonoAndStereo() + hp.pixelLayersWithMeasurement());
3253  trk_nLostLay.push_back(hp.trackerLayersWithoutMeasurement(reco::HitPattern::TRACK_HITS));
3254  trk_nCluster.push_back(nClusters);
3255  trk_algo.push_back(itTrack->algo());
3256  trk_originalAlgo.push_back(itTrack->originalAlgo());
3257  trk_algoMask.push_back(itTrack->algoMaskUL());
3258  trk_stopReason.push_back(itTrack->stopReason());
3259  trk_isHP.push_back(itTrack->quality(reco::TrackBase::highPurity));
3260  if (includeMVA_) {
3261  for (size_t i = 0; i < trk_mvas.size(); ++i) {
3262  trk_mvas[i].push_back((*(mvaColls[i]))[iTrack]);
3263  trk_qualityMasks[i].push_back((*(qualColls[i]))[iTrack]);
3264  }
3265  }
3266  if (includeSeeds_) {
3267  auto offset = seedCollToOffset.find(itTrack->seedRef().id());
3268  if (offset == seedCollToOffset.end()) {
3269  throw cms::Exception("Configuration")
3270  << "Track algo '" << reco::TrackBase::algoName(itTrack->algo()) << "' originalAlgo '"
3271  << reco::TrackBase::algoName(itTrack->originalAlgo()) << "' refers to seed collection "
3272  << itTrack->seedRef().id()
3273  << ", but that seed collection is not given as an input. The following collections were given as an input "
3274  << make_ProductIDMapPrinter(seedCollToOffset);
3275  }
3276 
3277  const auto seedIndex = offset->second + itTrack->seedRef().key();
3278  trk_seedIdx.push_back(seedIndex);
3279  if (see_trkIdx[seedIndex] != -1) {
3280  throw cms::Exception("LogicError") << "Track index has already been set for seed " << seedIndex << " to "
3281  << see_trkIdx[seedIndex] << "; was trying to set it to " << iTrack;
3282  }
3283  see_trkIdx[seedIndex] = iTrack;
3284  }
3285  trk_vtxIdx.push_back(-1); // to be set correctly in fillVertices
3287  trk_simTrkIdx.push_back(tpIdx);
3288  trk_simTrkShareFrac.push_back(sharedFraction);
3289  trk_simTrkNChi2.push_back(tpChi2);
3290  trk_bestSimTrkIdx.push_back(bestKeyCount.key >= 0 ? tpKeyToIndex.at(bestKeyCount.key) : -1);
3291  trk_bestFromFirstHitSimTrkIdx.push_back(bestFirstHitKeyCount.key >= 0 ? tpKeyToIndex.at(bestFirstHitKeyCount.key)
3292  : -1);
3293  } else {
3294  trk_isTrue.push_back(!tpIdx.empty());
3295  }
3296  trk_bestSimTrkShareFrac.push_back(bestShareFrac);
3297  trk_bestSimTrkShareFracSimDenom.push_back(bestShareFracSimDenom);
3298  trk_bestSimTrkShareFracSimClusterDenom.push_back(bestShareFracSimClusterDenom);
3299  trk_bestSimTrkNChi2.push_back(bestChi2);
3300  trk_bestFromFirstHitSimTrkShareFrac.push_back(bestFirstHitShareFrac);
3301  trk_bestFromFirstHitSimTrkShareFracSimDenom.push_back(bestFirstHitShareFracSimDenom);
3302  trk_bestFromFirstHitSimTrkShareFracSimClusterDenom.push_back(bestFirstHitShareFracSimClusterDenom);
3303  trk_bestFromFirstHitSimTrkNChi2.push_back(bestFirstHitChi2);
3304 
3305  LogTrace("TrackingNtuple") << "Track #" << itTrack.key() << " with q=" << charge << ", pT=" << pt
3306  << " GeV, eta: " << eta << ", phi: " << phi << ", chi2=" << chi2 << ", Nhits=" << nHits
3307  << ", algo=" << itTrack->algoName(itTrack->algo()).c_str()
3308  << " hp=" << itTrack->quality(reco::TrackBase::highPurity)
3309  << " seed#=" << itTrack->seedRef().key() << " simMatch=" << isSimMatched
3310  << " nSimHits=" << nSimHits
3311  << " sharedFraction=" << (sharedFraction.empty() ? -1 : sharedFraction[0])
3312  << " tpIdx=" << (tpIdx.empty() ? -1 : tpIdx[0]);
3313  std::vector<int> hitIdx;
3314  std::vector<int> hitType;
3315 
3316  for (auto i = itTrack->recHitsBegin(); i != itTrack->recHitsEnd(); i++) {
3317  TransientTrackingRecHit::RecHitPointer hit = theTTRHBuilder.build(&**i);
3318  DetId hitId = hit->geographicalId();
3319  LogTrace("TrackingNtuple") << "hit #" << std::distance(itTrack->recHitsBegin(), i)
3320  << " subdet=" << hitId.subdetId();
3321  if (hitId.det() != DetId::Tracker)
3322  continue;
3323 
3324  LogTrace("TrackingNtuple") << " " << subdetstring(hitId.subdetId()) << " " << tTopo.layer(hitId);
3325 
3326  if (hit->isValid()) {
3327  //ugly... but works
3328  const BaseTrackerRecHit* bhit = dynamic_cast<const BaseTrackerRecHit*>(&*hit);
3329  const auto& clusterRef = bhit->firstClusterRef();
3330  unsigned int clusterKey;
3331  if (clusterRef.isPixel()) {
3332  clusterKey = clusterRef.cluster_pixel().key();
3333  } else if (clusterRef.isPhase2()) {
3334  clusterKey = clusterRef.cluster_phase2OT().key();
3335  } else {
3336  clusterKey = clusterRef.cluster_strip().key();
3337  }
3338 
3339  LogTrace("TrackingNtuple") << " id: " << hitId.rawId() << " - globalPos =" << hit->globalPosition()
3340  << " cluster=" << clusterKey << " clusterRef ID=" << clusterRef.id()
3341  << " eta,phi: " << hit->globalPosition().eta() << "," << hit->globalPosition().phi();
3342  if (includeAllHits_) {
3343  checkProductID(hitProductIds, clusterRef.id(), "track");
3344  if (clusterRef.isPixel()) {
3345  pix_trkIdx[clusterKey].push_back(iTrack);
3346  } else if (clusterRef.isPhase2()) {
3347  ph2_trkIdx[clusterKey].push_back(iTrack);
3348  } else {
3349  str_trkIdx[clusterKey].push_back(iTrack);
3350  }
3351  }
3352 
3353  hitIdx.push_back(clusterKey);
3354  if (clusterRef.isPixel()) {
3355  hitType.push_back(static_cast<int>(HitType::Pixel));
3356  } else if (clusterRef.isPhase2()) {
3357  hitType.push_back(static_cast<int>(HitType::Phase2OT));
3358  } else {
3359  hitType.push_back(static_cast<int>(HitType::Strip));
3360  }
3361  } else {
3362  LogTrace("TrackingNtuple") << " - invalid hit";
3363 
3364  hitIdx.push_back(inv_isBarrel.size());
3365  hitType.push_back(static_cast<int>(HitType::Invalid));
3366 
3367  inv_isBarrel.push_back(hitId.subdetId() == 1);
3368  if (includeStripHits_)
3369  inv_detId.push_back(tTopo, hitId);
3370  else
3371  inv_detId_phase2.push_back(tTopo, hitId);
3372  inv_type.push_back(hit->getType());
3373  }
3374  }
3375 
3376  trk_hitIdx.push_back(hitIdx);
3377  trk_hitType.push_back(hitType);
3378  }
3379 }
3380 
3382  const edm::EventSetup& iSetup,
3384  const reco::BeamSpot& bs,
3385  const TrackingParticleRefVector& tpCollection,
3386  const TrackingVertexRefKeyToIndex& tvKeyToIndex,
3387  const reco::TrackToTrackingParticleAssociator& associatorByHits,
3388  const std::vector<TPHitIndex>& tpHitList,
3389  const TrackingParticleRefKeyToCount& tpKeyToClusterCount) {
3390  edm::ESHandle<ParametersDefinerForTP> parametersDefinerH;
3391  iSetup.get<TrackAssociatorRecord>().get(parametersDefinerName_, parametersDefinerH);
3392  const ParametersDefinerForTP* parametersDefiner = parametersDefinerH.product();
3393 
3394  // Number of 3D layers for TPs
3396  iEvent.getByToken(tpNLayersToken_, tpNLayersH);
3397  const auto& nLayers_tPCeff = *tpNLayersH;
3398 
3399  iEvent.getByToken(tpNPixelLayersToken_, tpNLayersH);
3400  const auto& nPixelLayers_tPCeff = *tpNLayersH;
3401 
3402  iEvent.getByToken(tpNStripStereoLayersToken_, tpNLayersH);
3403  const auto& nStripMonoAndStereoLayers_tPCeff = *tpNLayersH;
3404 
3405  reco::SimToRecoCollection simRecColl = associatorByHits.associateSimToReco(tracks, tpCollection);
3406 
3407  for (const TrackingParticleRef& tp : tpCollection) {
3408  LogTrace("TrackingNtuple") << "tracking particle pt=" << tp->pt() << " eta=" << tp->eta() << " phi=" << tp->phi();
3409  bool isRecoMatched = false;
3410  std::vector<int> tkIdx;
3411  std::vector<float> sharedFraction;
3412  auto foundTracks = simRecColl.find(tp);
3413  if (foundTracks != simRecColl.end()) {
3414  isRecoMatched = true;
3415  for (const auto& trackQuality : foundTracks->val) {
3416  sharedFraction.push_back(trackQuality.second);
3417  tkIdx.push_back(trackQuality.first.key());
3418  }
3419  }
3420 
3421  sim_genPdgIds.emplace_back();
3422  for (const auto& genRef : tp->genParticles()) {
3423  if (genRef.isNonnull())
3424  sim_genPdgIds.back().push_back(genRef->pdgId());
3425  }
3426 
3427  bool isFromBHadron = false;
3428  // Logic is similar to SimTracker/TrackHistory
3429  if (tracer_.evaluate(tp)) { // ignore TP if history can not be traced
3430  // following is from TrackClassifier::processesAtGenerator()
3431  HistoryBase::RecoGenParticleTrail const& recoGenParticleTrail = tracer_.recoGenParticleTrail();
3432  for (const auto& particle : recoGenParticleTrail) {
3433  HepPDT::ParticleID particleID(particle->pdgId());
3434  if (particleID.hasBottom()) {
3435  isFromBHadron = true;
3436  break;
3437  }
3438  }
3439  }
3440 
3441  LogTrace("TrackingNtuple") << "matched to tracks = " << make_VectorPrinter(tkIdx)
3442  << " isRecoMatched=" << isRecoMatched;
3443  sim_event.push_back(tp->eventId().event());
3444  sim_bunchCrossing.push_back(tp->eventId().bunchCrossing());
3445  sim_pdgId.push_back(tp->pdgId());
3446  sim_isFromBHadron.push_back(isFromBHadron);
3447  sim_px.push_back(tp->px());
3448  sim_py.push_back(tp->py());
3449  sim_pz.push_back(tp->pz());
3450  sim_pt.push_back(tp->pt());
3451  sim_eta.push_back(tp->eta());
3452  sim_phi.push_back(tp->phi());
3453  sim_q.push_back(tp->charge());
3454  sim_trkIdx.push_back(tkIdx);
3455  sim_trkShareFrac.push_back(sharedFraction);
3456  sim_parentVtxIdx.push_back(tvKeyToIndex.at(tp->parentVertex().key()));
3457  std::vector<int> decayIdx;
3458  for (const auto& v : tp->decayVertices())
3459  decayIdx.push_back(tvKeyToIndex.at(v.key()));
3460  sim_decayVtxIdx.push_back(decayIdx);
3461 
3462  //Calcualte the impact parameters w.r.t. PCA
3463  TrackingParticle::Vector momentum = parametersDefiner->momentum(iEvent, iSetup, tp);
3465  auto dxySim = TrackingParticleIP::dxy(vertex, momentum, bs.position());
3466  auto dzSim = TrackingParticleIP::dz(vertex, momentum, bs.position());
3467  const double lambdaSim = M_PI / 2 - momentum.theta();
3468  sim_pca_pt.push_back(std::sqrt(momentum.perp2()));
3469  sim_pca_eta.push_back(momentum.Eta());
3470  sim_pca_lambda.push_back(lambdaSim);
3471  sim_pca_cotTheta.push_back(1 / tan(M_PI * 0.5 - lambdaSim));
3472  sim_pca_phi.push_back(momentum.phi());
3473  sim_pca_dxy.push_back(dxySim);
3474  sim_pca_dz.push_back(dzSim);
3475 
3476  std::vector<int> hitIdx;
3477  int nPixel = 0, nStrip = 0;
3478  auto rangeHit = std::equal_range(tpHitList.begin(), tpHitList.end(), TPHitIndex(tp.key()), tpHitIndexListLess);
3479  for (auto ip = rangeHit.first; ip != rangeHit.second; ++ip) {
3480  auto type = HitType::Unknown;
3481  if (!simhit_hitType[ip->simHitIdx].empty())
3482  type = static_cast<HitType>(simhit_hitType[ip->simHitIdx][0]);
3483  LogTrace("TrackingNtuple") << "simhit=" << ip->simHitIdx << " type=" << static_cast<int>(type);
3484  hitIdx.push_back(ip->simHitIdx);
3485  const auto detid = DetId(includeStripHits_ ? simhit_detId[ip->simHitIdx] : simhit_detId_phase2[ip->simHitIdx]);
3486  if (detid.det() != DetId::Tracker) {
3487  throw cms::Exception("LogicError") << "Encountered SimHit for TP " << tp.key() << " with DetId "
3488  << detid.rawId() << " whose det() is not Tracker but " << detid.det();
3489  }
3490  const auto subdet = detid.subdetId();
3491  switch (subdet) {
3494  ++nPixel;
3495  break;
3496  case StripSubdetector::TIB:
3497  case StripSubdetector::TID:
3498  case StripSubdetector::TOB:
3499  case StripSubdetector::TEC:
3500  ++nStrip;
3501  break;
3502  default:
3503  throw cms::Exception("LogicError") << "Encountered SimHit for TP " << tp.key() << " with DetId "
3504  << detid.rawId() << " whose subdet is not recognized, is " << subdet;
3505  };
3506  }
3507  sim_nValid.push_back(hitIdx.size());
3508  sim_nPixel.push_back(nPixel);
3509  sim_nStrip.push_back(nStrip);
3510 
3511  const auto nSimLayers = nLayers_tPCeff[tp];
3512  const auto nSimPixelLayers = nPixelLayers_tPCeff[tp];
3513  const auto nSimStripMonoAndStereoLayers = nStripMonoAndStereoLayers_tPCeff[tp];
3514  sim_nLay.push_back(nSimLayers);
3515  sim_nPixelLay.push_back(nSimPixelLayers);
3516  sim_n3DLay.push_back(nSimPixelLayers + nSimStripMonoAndStereoLayers);
3517 
3518  sim_nTrackerHits.push_back(tp->numberOfTrackerHits());
3519  auto found = tpKeyToClusterCount.find(tp.key());
3520  sim_nRecoClusters.push_back(found != cend(tpKeyToClusterCount) ? found->second : 0);
3521 
3522  sim_simHitIdx.push_back(hitIdx);
3523  }
3524 }
3525 
3526 // called from fillSeeds
3528  const reco::SimToRecoCollection& simRecColl,
3529  const TrackingParticleRefKeyToIndex& tpKeyToIndex,
3530  const unsigned int seedOffset) {
3531  if (sim_seedIdx.empty()) // first call
3532  sim_seedIdx.resize(tpCollection.size());
3533 
3534  for (const auto& keyVal : simRecColl) {
3535  const auto& tpRef = keyVal.key;
3536  auto found = tpKeyToIndex.find(tpRef.key());
3537  if (found == tpKeyToIndex.end())
3538  throw cms::Exception("Assert") << __FILE__ << ":" << __LINE__ << " fillTrackingParticlesForSeeds: tpRef.key() "
3539  << tpRef.key() << " not found from tpKeyToIndex. tpKeyToIndex size "
3540  << tpKeyToIndex.size();
3541  const auto tpIndex = found->second;
3542  for (const auto& pair : keyVal.val) {
3543  const auto& seedRef = pair.first->seedRef();
3544  sim_seedIdx[tpIndex].push_back(seedOffset + seedRef.key());
3545  }
3546  }
3547 }
3548 
3551  for (size_t iVertex = 0, size = vertices.size(); iVertex < size; ++iVertex) {
3552  const reco::Vertex& vertex = vertices[iVertex];
3553  vtx_x.push_back(vertex.x());
3554  vtx_y.push_back(vertex.y());
3555  vtx_z.push_back(vertex.z());
3556  vtx_xErr.push_back(vertex.xError());
3557  vtx_yErr.push_back(vertex.yError());
3558  vtx_zErr.push_back(vertex.zError());
3559  vtx_chi2.push_back(vertex.chi2());
3560  vtx_ndof.push_back(vertex.ndof());
3561  vtx_fake.push_back(vertex.isFake());
3562  vtx_valid.push_back(vertex.isValid());
3563 
3564  std::vector<int> trkIdx;
3565  for (auto iTrack = vertex.tracks_begin(); iTrack != vertex.tracks_end(); ++iTrack) {
3566  // Ignore link if vertex was fit from a track collection different from the input
3567  if (iTrack->id() != tracks.id())
3568  continue;
3569 
3570  trkIdx.push_back(iTrack->key());
3571 
3572  if (trk_vtxIdx[iTrack->key()] != -1) {
3573  throw cms::Exception("LogicError") << "Vertex index has already been set for track " << iTrack->key() << " to "
3574  << trk_vtxIdx[iTrack->key()] << "; was trying to set it to " << iVertex;
3575  }
3576  trk_vtxIdx[iTrack->key()] = iVertex;
3577  }
3578  vtx_trkIdx.push_back(trkIdx);
3579  }
3580 }
3581 
3583  const TrackingParticleRefKeyToIndex& tpKeyToIndex) {
3584  int current_event = -1;
3585  for (const auto& ref : trackingVertices) {
3586  const TrackingVertex v = *ref;
3587  if (v.eventId().event() != current_event) {
3588  // next PV
3589  current_event = v.eventId().event();
3590  simpv_idx.push_back(simvtx_x.size());
3591  }
3592 
3593  unsigned int processType = std::numeric_limits<unsigned int>::max();
3594  if (!v.g4Vertices().empty()) {
3595  processType = v.g4Vertices()[0].processType();
3596  }
3597 
3598  simvtx_event.push_back(v.eventId().event());
3599  simvtx_bunchCrossing.push_back(v.eventId().bunchCrossing());
3600  simvtx_processType.push_back(processType);
3601 
3602  simvtx_x.push_back(v.position().x());
3603  simvtx_y.push_back(v.position().y());
3604  simvtx_z.push_back(v.position().z());
3605 
3606  auto fill = [&](const TrackingParticleRefVector& tps, std::vector<int>& idx) {
3607  for (const auto& tpRef : tps) {
3608  auto found = tpKeyToIndex.find(tpRef.key());
3609  if (found != tpKeyToIndex.end()) {
3610  idx.push_back(found->second);
3611  }
3612  }
3613  };
3614 
3615  std::vector<int> sourceIdx;
3616  std::vector<int> daughterIdx;
3617  fill(v.sourceTracks(), sourceIdx);
3618  fill(v.daughterTracks(), daughterIdx);
3619 
3620  simvtx_sourceSimIdx.push_back(sourceIdx);
3621  simvtx_daughterSimIdx.push_back(daughterIdx);
3622  }
3623 }
3624 
3625 // ------------ method fills 'descriptions' with the allowed parameters for the module ------------
3627  //The following says we do not know what parameters are allowed so do no validation
3628  // Please change this to state exactly what you do use, even if it is no parameters
3630  desc.addUntracked<std::vector<edm::InputTag>>(
3631  "seedTracks",
3632  std::vector<edm::InputTag>{edm::InputTag("seedTracksinitialStepSeeds"),
3633  edm::InputTag("seedTracksdetachedTripletStepSeeds"),
3634  edm::InputTag("seedTrackspixelPairStepSeeds"),
3635  edm::InputTag("seedTrackslowPtTripletStepSeeds"),
3636  edm::InputTag("seedTracksmixedTripletStepSeeds"),
3637  edm::InputTag("seedTrackspixelLessStepSeeds"),
3638  edm::InputTag("seedTrackstobTecStepSeeds"),
3639  edm::InputTag("seedTracksjetCoreRegionalStepSeeds"),
3640  edm::InputTag("seedTracksmuonSeededSeedsInOut"),
3641  edm::InputTag("seedTracksmuonSeededSeedsOutIn")});
3642  desc.addUntracked<std::vector<edm::InputTag>>(
3643  "trackCandidates",
3644  std::vector<edm::InputTag>{edm::InputTag("initialStepTrackCandidates"),
3645  edm::InputTag("detachedTripletStepTrackCandidates"),
3646  edm::InputTag("pixelPairStepTrackCandidates"),
3647  edm::InputTag("lowPtTripletStepTrackCandidates"),
3648  edm::InputTag("mixedTripletStepTrackCandidates"),
3649  edm::InputTag("pixelLessStepTrackCandidates"),
3650  edm::InputTag("tobTecStepTrackCandidates"),
3651  edm::InputTag("jetCoreRegionalStepTrackCandidates"),
3652  edm::InputTag("muonSeededTrackCandidatesInOut"),
3653  edm::InputTag("muonSeededTrackCandidatesOutIn")});
3654  desc.addUntracked<edm::InputTag>("tracks", edm::InputTag("generalTracks"));
3655  desc.addUntracked<std::vector<std::string>>("trackMVAs", std::vector<std::string>{{"generalTracks"}});
3656  desc.addUntracked<edm::InputTag>("trackingParticles", edm::InputTag("mix", "MergedTrackTruth"));
3657  desc.addUntracked<bool>("trackingParticlesRef", false);
3658  desc.addUntracked<edm::InputTag>("clusterTPMap", edm::InputTag("tpClusterProducer"));
3659  desc.addUntracked<edm::InputTag>("simHitTPMap", edm::InputTag("simHitTPAssocProducer"));
3660  desc.addUntracked<edm::InputTag>("trackAssociator", edm::InputTag("quickTrackAssociatorByHits"));
3661  desc.addUntracked<edm::InputTag>("pixelDigiSimLink", edm::InputTag("simSiPixelDigis"));
3662  desc.addUntracked<edm::InputTag>("stripDigiSimLink", edm::InputTag("simSiStripDigis"));
3663  desc.addUntracked<edm::InputTag>("phase2OTSimLink", edm::InputTag(""));
3664  desc.addUntracked<edm::InputTag>("beamSpot", edm::InputTag("offlineBeamSpot"));
3665  desc.addUntracked<edm::InputTag>("pixelRecHits", edm::InputTag("siPixelRecHits"));
3666  desc.addUntracked<edm::InputTag>("stripRphiRecHits", edm::InputTag("siStripMatchedRecHits", "rphiRecHit"));
3667  desc.addUntracked<edm::InputTag>("stripStereoRecHits", edm::InputTag("siStripMatchedRecHits", "stereoRecHit"));
3668  desc.addUntracked<edm::InputTag>("stripMatchedRecHits", edm::InputTag("siStripMatchedRecHits", "matchedRecHit"));
3669  desc.addUntracked<edm::InputTag>("phase2OTRecHits", edm::InputTag("siPhase2RecHits"));
3670  desc.addUntracked<edm::InputTag>("vertices", edm::InputTag("offlinePrimaryVertices"));
3671  desc.addUntracked<edm::InputTag>("trackingVertices", edm::InputTag("mix", "MergedTrackTruth"));
3672  desc.addUntracked<edm::InputTag>("trackingParticleNlayers",
3673  edm::InputTag("trackingParticleNumberOfLayersProducer", "trackerLayers"));
3674  desc.addUntracked<edm::InputTag>("trackingParticleNpixellayers",
3675  edm::InputTag("trackingParticleNumberOfLayersProducer", "pixelLayers"));
3676  desc.addUntracked<edm::InputTag>("trackingParticleNstripstereolayers",
3677  edm::InputTag("trackingParticleNumberOfLayersProducer", "stripStereoLayers"));
3678  desc.addUntracked<std::string>("TTRHBuilder", "WithTrackAngle");
3679  desc.addUntracked<std::string>("parametersDefiner", "LhcParametersDefinerForTP");
3680  desc.addUntracked<bool>("includeSeeds", false);
3681  desc.addUntracked<bool>("includeAllHits", false);
3682  desc.addUntracked<bool>("includeMVA", true);
3683  desc.addUntracked<bool>("includeTrackingParticles", true);
3684  descriptions.add("trackingNtuple", desc);
3685 }
3686 
3687 //define this as a plug-in
TrackingNtuple::DetIdCommon::module
std::vector< unsigned short > module
Definition: TrackingNtuple.cc:730
runTheMatrix.ret
ret
prodAgent to be discontinued
Definition: runTheMatrix.py:373
TrackingNtuple::sim_px
std::vector< float > sim_px
Definition: TrackingNtuple.cc:1028
TrackingNtuple::DetIdOTCommon::ring
std::vector< unsigned short > ring
Definition: TrackingNtuple.cc:822
TrackingNtuple::HitType::Unknown
TrackingNtuple::fillPixelHits
void fillPixelHits(const edm::Event &iEvent, const ClusterTPAssociation &clusterToTPMap, const TrackingParticleRefKeyToIndex &tpKeyToIndex, const SimHitTPAssociationProducer::SimHitTPAssociationList &simHitsTPAssoc, const edm::DetSetVector< PixelDigiSimLink > &digiSimLink, const TransientTrackingRecHitBuilder &theTTRHBuilder, const TrackerTopology &tTopo, const SimHitRefKeyToIndex &simHitRefKeyToIndex, std::set< edm::ProductID > &hitProductIds)
Definition: TrackingNtuple.cc:2481
TrackerTopology::tobIsDoubleSide
bool tobIsDoubleSide(const DetId &id) const
Definition: TrackerTopology.h:245
TrackerTopology::tibOrder
unsigned int tibOrder(const DetId &id) const
Definition: TrackerTopology.h:209
SummaryClient_cfi.labels
labels
Definition: SummaryClient_cfi.py:61
TrackingNtuple::trackAssociatorToken_
edm::EDGetTokenT< reco::TrackToTrackingParticleAssociator > trackAssociatorToken_
Definition: TrackingNtuple.cc:638
writedatasetfile.args
args
Definition: writedatasetfile.py:18
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
edm::DetSetVector
Definition: DetSetVector.h:61
TrackingNtuple::HitSimType::Noise
TrackingNtuple::vtx_chi2
std::vector< float > vtx_chi2
Definition: TrackingNtuple.cc:1235
TSCBLBuilderNoMaterial.h
heavyionUCCDQM_cfi.nClusters
nClusters
Definition: heavyionUCCDQM_cfi.py:9
TrackingNtuple::pix_simHitIdx
std::vector< std::vector< int > > pix_simHitIdx
Definition: TrackingNtuple.cc:1067
reco::HitPattern::MISSING_OUTER_HITS
Definition: HitPattern.h:155
TrackingNtuple::sim_simHitIdx
std::vector< std::vector< int > > sim_simHitIdx
Definition: TrackingNtuple.cc:1059
edm::RunNumber_t
unsigned int RunNumber_t
Definition: RunLumiEventNumber.h:14
FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
TrackingNtuple::see_hitIdx
std::vector< std::vector< int > > see_hitIdx
Definition: TrackingNtuple.cc:1220
TrackingNtuple::TPHitIndex::simHitIdx
unsigned int simHitIdx
Definition: TrackingNtuple.cc:496
TrackerTopology::side
unsigned int side(const DetId &id) const
Definition: TrackerTopology.cc:28
TrackingNtuple::vtx_xErr
std::vector< float > vtx_xErr
Definition: TrackingNtuple.cc:1231
TrackingNtuple::str_yz
std::vector< float > str_yz
Definition: TrackingNtuple.cc:1098
PDWG_EXOHSCP_cff.tracks
tracks
Definition: PDWG_EXOHSCP_cff.py:28
TrackingNtuple::t
TTree * t
Definition: TrackingNtuple.cc:663
TrackingNtuple::DetIdOTCommon::Parsed::ring
unsigned int ring
Definition: TrackingNtuple.cc:803
TrackingNtuple::trk_refpoint_z
std::vector< float > trk_refpoint_z
Definition: TrackingNtuple.cc:976
TrackingNtuple::see_eta
std::vector< float > see_eta
Definition: TrackingNtuple.cc:1186
electrons_cff.bool
bool
Definition: electrons_cff.py:393
EDAnalyzer.h
TrackingNtuple::ev_lumi
edm::LuminosityBlockNumber_t ev_lumi
Definition: TrackingNtuple.cc:940
edm::AssociationMap::find
const_iterator find(const key_type &k) const
find element with specified reference key
Definition: AssociationMap.h:173
mps_fire.i
i
Definition: mps_fire.py:428
trackHitsToClusterRefs.h
TrackingNtuple::trk_seedIdx
std::vector< int > trk_seedIdx
Definition: TrackingNtuple.cc:1002
TrackingNtuple::HitType::Phase2OT
TrackingNtuple::DetIdPixelOnly::push_back
void push_back(const TrackerTopology &tTopo, const DetId &id)
Definition: TrackingNtuple.cc:743
TrackingNtuple::sim_trkShareFrac
std::vector< std::vector< float > > sim_trkShareFrac
Definition: TrackingNtuple.cc:1055
TrackingNtuple::matchCluster
SimHitData matchCluster(const OmniClusterRef &cluster, DetId hitId, int clusterKey, const TransientTrackingRecHit::RecHitPointer &ttrh, const ClusterTPAssociation &clusterToTPMap, const TrackingParticleRefKeyToIndex &tpKeyToIndex, const SimHitTPAssociationProducer::SimHitTPAssociationList &simHitsTPAssoc, const edm::DetSetVector< SimLink > &digiSimLinks, const SimHitRefKeyToIndex &simHitRefKeyToIndex, HitType hitType)
Definition: TrackingNtuple.cc:2261
HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11713
TrackingNtuple::trackToken_
edm::EDGetTokenT< edm::View< reco::Track > > trackToken_
Definition: TrackingNtuple.cc:631
TrackingNtuple::str_seeIdx
std::vector< std::vector< int > > str_seeIdx
Definition: TrackingNtuple.cc:1088
TrackingNtuple::tpHitIndexListLessSort
static bool tpHitIndexListLessSort(const TPHitIndex &i, const TPHitIndex &j)
Definition: TrackingNtuple.cc:501
StandaloneTrackMonitor_cfi.trackQuality
trackQuality
Definition: StandaloneTrackMonitor_cfi.py:11
TrackingNtuple::glu_yy
std::vector< float > glu_yy
Definition: TrackingNtuple.cc:1117
MessageLogger.h
TrackingNtuple::trk_nChi2_1Dmod
std::vector< float > trk_nChi2_1Dmod
Definition: TrackingNtuple.cc:978
TrackingNtuple::trk_inner_pz
std::vector< float > trk_inner_pz
Definition: TrackingNtuple.cc:952
TrackingNtuple::trk_qualityMasks
std::vector< std::vector< unsigned short > > trk_qualityMasks
Definition: TrackingNtuple.cc:981
TrackingNtuple::trk_originalAlgo
std::vector< unsigned int > trk_originalAlgo
Definition: TrackingNtuple.cc:998
TrackingNtuple::includeTrackingParticles_
const bool includeTrackingParticles_
Definition: TrackingNtuple.cc:659
TrackingNtuple::str_radL
std::vector< float > str_radL
Definition: TrackingNtuple.cc:1102
TrackingNtuple::see_stateTrajPy
std::vector< float > see_stateTrajPy
Definition: TrackingNtuple.cc:1200
TrackingNtuple::trk_dzPV
std::vector< float > trk_dzPV
Definition: TrackingNtuple.cc:965
TrackingNtuple::trk_isHP
std::vector< short > trk_isHP
Definition: TrackingNtuple.cc:1001
PixelSubdetector::PixelEndcap
Definition: PixelSubdetector.h:11
TrackerGeometry.h
hit::id
unsigned int id
Definition: SiStripHitEffFromCalibTree.cc:92
PixelSubdetector::PixelBarrel
Definition: PixelSubdetector.h:11
edm::Handle::product
T const * product() const
Definition: Handle.h:70
TrackingNtuple::clearVariables
void clearVariables()
Definition: TrackingNtuple.cc:1695
TrackingNtuple::see_nPixel
std::vector< unsigned int > see_nPixel
Definition: TrackingNtuple.cc:1204
SimHitTPAssociationProducer
Definition: SimHitTPAssociationProducer.h:15
MainPageGenerator.link
link
Definition: MainPageGenerator.py:271
hfClusterShapes_cfi.hits
hits
Definition: hfClusterShapes_cfi.py:5
TrackingNtuple::DetIdPixelOnly::book
void book(const std::string &prefix, TTree *tree)
Definition: TrackingNtuple.cc:737
TrackingNtuple::ev_event
edm::EventNumber_t ev_event
Definition: TrackingNtuple.cc:941
Phase2TrackerCluster1D
Definition: Phase2TrackerCluster1D.h:10
TrackingNtuple::str_y
std::vector< float > str_y
Definition: TrackingNtuple.cc:1093
TrackingNtuple::trackingVertexToken_
edm::EDGetTokenT< TrackingVertexCollection > trackingVertexToken_
Definition: TrackingNtuple.cc:650
ESHandle.h
align::BeamSpot
Definition: StructureType.h:89
TrackingNtuple::glu_seeIdx
std::vector< std::vector< int > > glu_seeIdx
Definition: TrackingNtuple.cc:1111
TrackingNtuple::trk_n3DLay
std::vector< unsigned int > trk_n3DLay
Definition: TrackingNtuple.cc:994
edm::DetSetVector::end
iterator end()
Return the off-the-end iterator.
Definition: DetSetVector.h:325
TrackingNtuple::see_stateTrajX
std::vector< float > see_stateTrajX
Definition: TrackingNtuple.cc:1197
TrackingNtuple::trk_nPixel
std::vector< unsigned int > trk_nPixel
Definition: TrackingNtuple.cc:986
TrackingNtuple::glu_xx
std::vector< float > glu_xx
Definition: TrackingNtuple.cc:1115
sistrip::View
View
Definition: ConstantsForView.h:26
TrackerTopology::isLower
bool isLower(const DetId &id) const
Definition: TrackerTopology.cc:195
TrackingNtuple::trk_nOuterInactive
std::vector< unsigned int > trk_nOuterInactive
Definition: TrackingNtuple.cc:990
TrackingNtuple::trk_dz
std::vector< float > trk_dz
Definition: TrackingNtuple.cc:963
edm::isNotFinite
constexpr bool isNotFinite(T x)
Definition: isFinite.h:9
TrackingNtuple::see_stateTrajPz
std::vector< float > see_stateTrajPz
Definition: TrackingNtuple.cc:1201
TrackingNtuple::str_isBarrel
std::vector< short > str_isBarrel
Definition: TrackingNtuple.cc:1085
TrackingNtuple::trk_dzErr
std::vector< float > trk_dzErr
Definition: TrackingNtuple.cc:973
edm::DetSet
Definition: DetSet.h:23
TrackingNtuple::ph2_z
std::vector< float > ph2_z
Definition: TrackingNtuple.cc:1136
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
SiStripMatchedRecHit2DCollection.h
TrackingNtuple::see_simTrkIdx
std::vector< std::vector< int > > see_simTrkIdx
Definition: TrackingNtuple.cc:1219
TrackingNtuple::tracer_
HistoryBase tracer_
Definition: TrackingNtuple.cc:661
TrackingNtuple::trk_etaErr
std::vector< float > trk_etaErr
Definition: TrackingNtuple.cc:969
TrackingNtuple::trk_isTrue
std::vector< short > trk_isTrue
Definition: TrackingNtuple.cc:1004
min
T min(T a, T b)
Definition: MathUtil.h:58
TrackingNtuple::includeAllHits_
const bool includeAllHits_
Definition: TrackingNtuple.cc:657
TrackingNtuple::trk_bestSimTrkNChi2
std::vector< float > trk_bestSimTrkNChi2
Definition: TrackingNtuple.cc:1009
edm::EDGetTokenT
Definition: EDGetToken.h:33
TrackingNtuple::trk_bestSimTrkIdx
std::vector< int > trk_bestSimTrkIdx
Definition: TrackingNtuple.cc:1005
edm
HLT enums.
Definition: AlignableModifier.h:19
TrackingNtuple::includeMVA_
const bool includeMVA_
Definition: TrackingNtuple.cc:658
TrackingNtuple::trk_bestFromFirstHitSimTrkShareFracSimDenom
std::vector< float > trk_bestFromFirstHitSimTrkShareFracSimDenom
Definition: TrackingNtuple.cc:1012
TrackerTopology
Definition: TrackerTopology.h:16
TrackingNtuple::DetIdStripOnly::parse
Parsed parse(const TrackerTopology &tTopo, const DetId &id) const
Definition: TrackingNtuple.cc:880
TrackingNtuple::see_px
std::vector< float > see_px
Definition: TrackingNtuple.cc:1182
tree
Definition: tree.py:1
edm::ProductLabels::module
char const * module
Definition: ProductLabels.h:5
reco::TrackToTrackingParticleAssociator::associateRecoToSim
reco::RecoToSimCollection associateRecoToSim(const edm::Handle< edm::View< reco::Track >> &tCH, const edm::Handle< TrackingParticleCollection > &tPCH) const
Definition: TrackToTrackingParticleAssociator.h:64
TrackerTopology::tecIsDoubleSide
bool tecIsDoubleSide(const DetId &id) const
Definition: TrackerTopology.h:246
TransientRecHitRecord.h
DetId::det
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
TrackingNtuple::see_dxy
std::vector< float > see_dxy
Definition: TrackingNtuple.cc:1188
TrackerTopology::tidIsDoubleSide
bool tidIsDoubleSide(const DetId &id) const
Definition: TrackerTopology.h:250
TrackerTopology::pxbLadder
unsigned int pxbLadder(const DetId &id) const
Definition: TrackerTopology.h:155
TrackingNtuple::HitSimType
HitSimType
Definition: TrackingNtuple.cc:487
reco::VertexCollection
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
TrackingNtuple::trk_nOuterLost
std::vector< unsigned int > trk_nOuterLost
Definition: TrackingNtuple.cc:988
TrackingNtuple::bsp_sigmax
float bsp_sigmax
Definition: TrackingNtuple.cc:1175
pos
Definition: PixelAliasList.h:18
edm::LogPrint
Log< level::Warning, true > LogPrint
Definition: MessageLogger.h:130
TrackingNtuple::pixelSimLinkToken_
edm::EDGetTokenT< edm::DetSetVector< PixelDigiSimLink > > pixelSimLinkToken_
Definition: TrackingNtuple.cc:639
TrackingNtuple::ph2_xy
std::vector< float > ph2_xy
Definition: TrackingNtuple.cc:1138
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89287
reco::TrackToTrackingParticleAssociator
Definition: TrackToTrackingParticleAssociator.h:51
ClusterTPAssociation
Definition: ClusterTPAssociation.h:21
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
TrackingNtuple::DetIdStripOnly::string
std::vector< unsigned short > string
Definition: TrackingNtuple.cc:895
TransientRecHitRecord
Definition: TransientRecHitRecord.h:14
getBestVertex.h
TrackingNtuple::~TrackingNtuple
~TrackingNtuple() override
Definition: TrackingNtuple.cc:1687
TrackingNtuple::see_hitType
std::vector< std::vector< int > > see_hitType
Definition: TrackingNtuple.cc:1221
TrackingNtuple::simhit_detId
DetIdAll simhit_detId
Definition: TrackingNtuple.cc:1157
TrackingNtuple::simhit_process
std::vector< short > simhit_process
Definition: TrackingNtuple.cc:1163
TrackingNtuple::DetIdOTCommon::resize
void resize(size_t size)
Definition: TrackingNtuple.cc:779
track_associator::trackAssociationChi2
double trackAssociationChi2(const reco::TrackBase::ParameterVector &rParameters, const reco::TrackBase::CovarianceMatrix &recoTrackCovMatrix, const Basic3DVector< double > &momAtVtx, const Basic3DVector< double > &vert, int charge, const MagneticField &magfield, const reco::BeamSpot &bs)
basic method where chi2 is computed
Definition: trackAssociationChi2.cc:9
to
TrackingNtuple::DetIdCommon::push_back
void push_back(const TrackerTopology &tTopo, const DetId &id)
Definition: TrackingNtuple.cc:681
muonClassificationByHits_cfi.pixel
pixel
Definition: muonClassificationByHits_cfi.py:9
TrackingNtuple::vertexToken_
edm::EDGetTokenT< reco::VertexCollection > vertexToken_
Definition: TrackingNtuple.cc:649
edm::EDGetTokenT::isUninitialized
constexpr bool isUninitialized() const noexcept
Definition: EDGetToken.h:99
TrackingVertexCollection
std::vector< TrackingVertex > TrackingVertexCollection
Definition: TrackingVertexContainer.h:8
TrackingNtuple::trk_nPixelLay
std::vector< unsigned int > trk_nPixelLay
Definition: TrackingNtuple.cc:992
TrackingNtuple::see_trkIdx
std::vector< int > see_trkIdx
Definition: TrackingNtuple.cc:1212
TrackingNtuple::tpNLayersToken_
edm::EDGetTokenT< edm::ValueMap< unsigned int > > tpNLayersToken_
Definition: TrackingNtuple.cc:651
TrackingNtuple::SimHitData
Definition: TrackingNtuple.cc:608
TrackingNtuple::inv_detId
DetIdAll inv_detId
Definition: TrackingNtuple.cc:1151
TrackerTopology::layer
unsigned int layer(const DetId &id) const
Definition: TrackerTopology.cc:47
TrackingNtuple::str_trkIdx
std::vector< std::vector< int > > str_trkIdx
Definition: TrackingNtuple.cc:1087
TrackingNtuple::trk_nCluster
std::vector< unsigned int > trk_nCluster
Definition: TrackingNtuple.cc:996
PixelChannelIdentifier.h
edmNew::DetSetVector::begin
const_iterator begin(bool update=false) const
Definition: DetSetVectorNew.h:530
TrackingNtuple::see_bestFromFirstHitSimTrkShareFrac
std::vector< float > see_bestFromFirstHitSimTrkShareFrac
Definition: TrackingNtuple.cc:1217
HistoryBase::recoGenParticleTrail
const RecoGenParticleTrail & recoGenParticleTrail() const
Return all reco::GenParticle in the history.
Definition: HistoryBase.h:64
TrackingVertex.h
TrackingNtuple::trk_refpoint_y
std::vector< float > trk_refpoint_y
Definition: TrackingNtuple.cc:975
TrackerTopology::stack
uint32_t stack(const DetId &id) const
Definition: TrackerTopology.cc:104
TrackingNtuple::simpv_idx
std::vector< int > simpv_idx
Definition: TrackingNtuple.cc:1251
HistoryBase::RecoGenParticleTrail
std::vector< const reco::GenParticle * > RecoGenParticleTrail
reco::GenParticle trail type.
Definition: HistoryBase.h:18
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
TrackingParticle::Vector
math::XYZVectorD Vector
point in the space
Definition: TrackingParticle.h:37
TrackingNtuple::see_nGlued
std::vector< unsigned int > see_nGlued
Definition: TrackingNtuple.cc:1205
TrackingNtuple::sim_parentVtxIdx
std::vector< int > sim_parentVtxIdx
Definition: TrackingNtuple.cc:1057
edm::RefVector< TrackingParticleCollection >
SiPixelCluster
Pixel cluster – collection of neighboring pixels above threshold.
Definition: SiPixelCluster.h:27
TrackingNtuple::trk_px
std::vector< float > trk_px
Definition: TrackingNtuple.cc:946
TrackingNtuple::trk_bestFromFirstHitSimTrkShareFrac
std::vector< float > trk_bestFromFirstHitSimTrkShareFrac
Definition: TrackingNtuple.cc:1011
TrackingNtuple::pix_isBarrel
std::vector< short > pix_isBarrel
Definition: TrackingNtuple.cc:1063
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
TrackingNtuple::trk_inner_pt
std::vector< float > trk_inner_pt
Definition: TrackingNtuple.cc:953
edm::one::EDAnalyzer
Definition: EDAnalyzer.h:30
TrackingNtuple::pix_yz
std::vector< float > pix_yz
Definition: TrackingNtuple.cc:1076
TrackingRecHit::RecHitPointer
std::shared_ptr< TrackingRecHit const > RecHitPointer
Definition: TrackingRecHit.h:24
TrackerTopology::module
unsigned int module(const DetId &id) const
Definition: TrackerTopology.cc:66
Signal
findQualityFiles.v
v
Definition: findQualityFiles.py:179
hltPixelTracks_cff.chi2
chi2
Definition: hltPixelTracks_cff.py:25
beam_dqm_sourceclient-live_cfg.mva
mva
Definition: beam_dqm_sourceclient-live_cfg.py:124
TransientTrackingRecHitBuilder::build
virtual RecHitPointer build(const TrackingRecHit *p) const =0
build a tracking rechit from an existing rechit
TrackingNtuple::DetIdPixelOnly::ladder
std::vector< unsigned short > ladder
Definition: TrackingNtuple.cc:757
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
TrackingNtuple::DetIdCommon::DetIdCommon
DetIdCommon()
Definition: TrackingNtuple.cc:669
TrackingNtuple::trk_outer_pz
std::vector< float > trk_outer_pz
Definition: TrackingNtuple.cc:956
TrackingNtuple::str_xy
std::vector< float > str_xy
Definition: TrackingNtuple.cc:1096
newFWLiteAna.found
found
Definition: newFWLiteAna.py:118
edm::Handle< reco::TrackToTrackingParticleAssociator >
edm::LuminosityBlockNumber_t
unsigned int LuminosityBlockNumber_t
Definition: RunLumiEventNumber.h:13
TrackingNtuple::simhit_z
std::vector< float > simhit_z
Definition: TrackingNtuple.cc:1161
OmniClusterRef
Definition: OmniClusterRef.h:12
TrackingNtuple::ph2_zz
std::vector< float > ph2_zz
Definition: TrackingNtuple.cc:1141
TrackingNtuple::ph2_yy
std::vector< float > ph2_yy
Definition: TrackingNtuple.cc:1139
dqmdumpme.first
first
Definition: dqmdumpme.py:55
TrackToTrackingParticleAssociator
SiPixelCluster::Pixel
Definition: SiPixelCluster.h:29
TrackingNtuple::sim_nStrip
std::vector< unsigned int > sim_nStrip
Definition: TrackingNtuple.cc:1045
TrackingNtuple::see_dzErr
std::vector< float > see_dzErr
Definition: TrackingNtuple.cc:1194
TrackingNtuple::sim_isFromBHadron
std::vector< int > sim_isFromBHadron
Definition: TrackingNtuple.cc:1027
rpcPointValidation_cfi.recHit
recHit
Definition: rpcPointValidation_cfi.py:7
TrackingNtuple::trk_nInnerLost
std::vector< unsigned int > trk_nInnerLost
Definition: TrackingNtuple.cc:989
TrackerTopology::tidRing
unsigned int tidRing(const DetId &id) const
Definition: TrackerTopology.h:218
EcalTangentSkim_cfg.o
o
Definition: EcalTangentSkim_cfg.py:36
RZLine::chi2
float chi2() const
Definition: RZLine.h:94
TrackerTopology::tobRod
unsigned int tobRod(const DetId &id) const
Definition: TrackerTopology.h:195
TkTransientTrackingRecHitBuilder.h
TrackingNtuple::sim_nRecoClusters
std::vector< unsigned int > sim_nRecoClusters
Definition: TrackingNtuple.cc:1052
edm::Ref< TrackingParticleCollection >
TrackingNtuple::glu_zx
std::vector< float > glu_zx
Definition: TrackingNtuple.cc:1120
TrackingNtuple::glu_detId
DetIdStrip glu_detId
Definition: TrackingNtuple.cc:1108
OmniClusterRef::cluster_phase2OT
Phase2Cluster1DRef cluster_phase2OT() const
Definition: OmniClusterRef.h:48
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
TrackingNtuple::pix_zx
std::vector< float > pix_zx
Definition: TrackingNtuple.cc:1078
TrackerTopology::tibSide
unsigned int tibSide(const DetId &id) const
Definition: TrackerTopology.h:186
F
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
Definition: blowfish.cc:163
TrackingNtuple::fillSeeds
void fillSeeds(const edm::Event &iEvent, const TrackingParticleRefVector &tpCollection, const TrackingParticleRefKeyToIndex &tpKeyToIndex, const reco::BeamSpot &bs, const reco::TrackToTrackingParticleAssociator &associatorByHits, const ClusterTPAssociation &clusterToTPMap, const TransientTrackingRecHitBuilder &theTTRHBuilder, const MagneticField &theMF, const TrackerTopology &tTopo, std::vector< std::pair< int, int >> &monoStereoClusterList, const std::set< edm::ProductID > &hitProductIds, std::map< edm::ProductID, size_t > &seedToCollIndex)
Definition: TrackingNtuple.cc:2759
SiStripCluster::firstStrip
uint16_t firstStrip() const
Definition: SiStripCluster.h:47
TrackingNtuple::fillTracks
void fillTracks(const edm::RefToBaseVector< reco::Track > &tracks, const TrackingParticleRefVector &tpCollection, const TrackingParticleRefKeyToIndex &tpKeyToIndex, const TrackingParticleRefKeyToCount &tpKeyToClusterCount, const MagneticField &mf, const reco::BeamSpot &bs, const reco::VertexCollection &vertices, const reco::TrackToTrackingParticleAssociator &associatorByHits, const ClusterTPAssociation &clusterToTPMap, const TransientTrackingRecHitBuilder &theTTRHBuilder, const TrackerTopology &tTopo, const std::set< edm::ProductID > &hitProductIds, const std::map< edm::ProductID, size_t > &seedToCollIndex, const std::vector< const MVACollection * > &mvaColls, const std::vector< const QualityMaskCollection * > &qualColls)
Definition: TrackingNtuple.cc:3099
TrackingNtuple::fillSimHits
void fillSimHits(const TrackerGeometry &tracker, const TrackingParticleRefKeyToIndex &tpKeyToIndex, const SimHitTPAssociationProducer::SimHitTPAssociationList &simHitsTPAssoc, const TrackerTopology &tTopo, SimHitRefKeyToIndex &simHitRefKeyToIndex, std::vector< TPHitIndex > &tpHitList)
Definition: TrackingNtuple.cc:2369
ecalLiteDTU::adc
constexpr int adc(sample_type sample)
get the ADC sample (12 bits)
Definition: EcalLiteDTUSample.h:12
trackingPlots.assoc
assoc
Definition: trackingPlots.py:184
TrackerTopology::pxfPanel
unsigned int pxfPanel(const DetId &id) const
Definition: TrackerTopology.h:450
ndof
Definition: HIMultiTrackSelector.h:49
TrackingNtuple::DetIdCommon::detId
std::vector< unsigned int > detId
Definition: TrackingNtuple.cc:726
TrackingNtuple::TPHitIndex::TPHitIndex
TPHitIndex(unsigned int tp=0, unsigned int simHit=0, float to=0, unsigned int id=0)
Definition: TrackingNtuple.cc:493
MuonAssociatorByHits_cfi.tpTag
tpTag
Definition: MuonAssociatorByHits_cfi.py:152
fileCollector.seed
seed
Definition: fileCollector.py:127
TrackingNtuple::DetIdPhase2OTOnly
Definition: TrackingNtuple.cc:902
TrackingNtuple::str_chargeFraction
std::vector< std::vector< float > > str_chargeFraction
Definition: TrackingNtuple.cc:1090
TrackingNtuple::fillTrackingParticles
void fillTrackingParticles(const edm::Event &iEvent, const edm::EventSetup &iSetup, const edm::RefToBaseVector< reco::Track > &tracks, const reco::BeamSpot &bs, const TrackingParticleRefVector &tpCollection, const TrackingVertexRefKeyToIndex &tvKeyToIndex, const reco::TrackToTrackingParticleAssociator &associatorByHits, const std::vector< TPHitIndex > &tpHitList, const TrackingParticleRefKeyToCount &tpKeyToClusterCount)
Definition: TrackingNtuple.cc:3381
IdealMagneticFieldRecord
Definition: IdealMagneticFieldRecord.h:11
DetId
Definition: DetId.h:17
cmsdt::algo
algo
Definition: constants.h:164
TrackingNtuple::str_z
std::vector< float > str_z
Definition: TrackingNtuple.cc:1094
TrackingNtuple::glu_zz
std::vector< float > glu_zz
Definition: TrackingNtuple.cc:1119
edm::AssociationMap::end
const_iterator end() const
last iterator over the map (read only)
Definition: AssociationMap.h:171
TrackingNtuple::DetIdPixel
CombineDetId< DetIdCommon, DetIdPixelOnly > DetIdPixel
Definition: TrackingNtuple.cc:932
MakerMacros.h
TrackerTopology.h
alignCSCRings.s
s
Definition: alignCSCRings.py:92
cms::cuda::bs
bs
Definition: HistoContainer.h:127
TrackingNtuple::sim_decayVtxIdx
std::vector< std::vector< int > > sim_decayVtxIdx
Definition: TrackingNtuple.cc:1058
TrackingNtuple::bsp_sigmay
float bsp_sigmay
Definition: TrackingNtuple.cc:1176
reco::HitPattern
Definition: HitPattern.h:147
track_associator::hitsToClusterRefs
std::vector< OmniClusterRef > hitsToClusterRefs(iter begin, iter end)
Definition: trackHitsToClusterRefs.h:20
TrackingNtuple::sim_q
std::vector< int > sim_q
Definition: TrackingNtuple.cc:1041
TrackingNtuple::HitType::Pixel
TTClusterAssociation_cfi.digiSimLinks
digiSimLinks
Definition: TTClusterAssociation_cfi.py:8
TrackingNtuple::trk_algo
std::vector< unsigned int > trk_algo
Definition: TrackingNtuple.cc:997
EgammaObjectsElectrons_cfi.particleID
particleID
Definition: EgammaObjectsElectrons_cfi.py:4
TrackingParticleIP::dxy
auto dxy(const T_Vertex &vertex, const T_Momentum &momentum, const T_Point &point)
Definition: TrackingParticleIP.h:11
TrackingNtuple::trk_phi
std::vector< float > trk_phi
Definition: TrackingNtuple.cc:961
TrackerTopologyRcd.h
TrackingNtuple::ph2_simType
std::vector< unsigned short > ph2_simType
Definition: TrackingNtuple.cc:1133
Track.h
trackingPlots.hp
hp
Definition: trackingPlots.py:1248
TrackingNtuple::DetIdCommon::operator[]
unsigned int operator[](size_t i) const
Definition: TrackingNtuple.cc:671
edm::EventSetup::get
T get() const
Definition: EventSetup.h:80
TrackFwd.h
TrackingNtuple::trk_bestFromFirstHitSimTrkShareFracSimClusterDenom
std::vector< float > trk_bestFromFirstHitSimTrkShareFracSimClusterDenom
Definition: TrackingNtuple.cc:1013
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
TrackingVertexContainer.h
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
edm::RefToBaseVector::push_back
void push_back(const RefToBase< T > &)
Definition: RefToBaseVector.h:217
TrackingNtuple::trk_algoMask
std::vector< decltype(reco::TrackBase().algoMaskUL())> trk_algoMask
Definition: TrackingNtuple.cc:999
TrackingNtuple::SimHitData::type
HitSimType type
Definition: TrackingNtuple.cc:613
PixelChannelIdentifier::pixelToChannel
static int pixelToChannel(int row, int col)
Definition: PixelChannelIdentifier.h:65
TrackingNtuple::see_pt
std::vector< float > see_pt
Definition: TrackingNtuple.cc:1185
TrackingNtuple::trk_dxyClosestPV
std::vector< float > trk_dxyClosestPV
Definition: TrackingNtuple.cc:966
TrackingNtuple::see_pz
std::vector< float > see_pz
Definition: TrackingNtuple.cc:1184
TrackingNtuple::DetIdStrip
CombineDetId< DetIdCommon, DetIdOTCommon, DetIdStripOnly > DetIdStrip
Definition: TrackingNtuple.cc:933
GlobalPosition_Frontier_DevDB_cff.tag
tag
Definition: GlobalPosition_Frontier_DevDB_cff.py:11
TrackingNtuple::inv_detId_phase2
DetIdAllPhase2 inv_detId_phase2
Definition: TrackingNtuple.cc:1152
BaseTrackerRecHit
Definition: BaseTrackerRecHit.h:15
TrackerTopology::isStereo
bool isStereo(const DetId &id) const
Definition: TrackerTopology.cc:158
TrackingNtuple::see_nValid
std::vector< unsigned int > see_nValid
Definition: TrackingNtuple.cc:1203
TrackingNtuple::simhit_tof
std::vector< float > simhit_tof
Definition: TrackingNtuple.cc:1165
TrackingNtuple::pix_x
std::vector< float > pix_x
Definition: TrackingNtuple.cc:1070
TrackingNtuple::HitType::Glued
Service.h
PVValHelper::eta
Definition: PVValidationHelpers.h:69
OmniClusterRef::stripCluster
SiStripCluster const & stripCluster() const
Definition: OmniClusterRef.h:55
rpcPointValidation_cfi.simHit
simHit
Definition: rpcPointValidation_cfi.py:24
TrackingNtuple::DetIdStripOnly
Definition: TrackingNtuple.cc:826
TrackingNtuple::inv_type
std::vector< unsigned short > inv_type
Definition: TrackingNtuple.cc:1153
TrackingNtuple::see_etaErr
std::vector< float > see_etaErr
Definition: TrackingNtuple.cc:1191
TrackingNtuple::pix_zz
std::vector< float > pix_zz
Definition: TrackingNtuple.cc:1077
TrackerDigiGeometryRecord
Definition: TrackerDigiGeometryRecord.h:15
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
TrackingNtuple::ph2_yz
std::vector< float > ph2_yz
Definition: TrackingNtuple.cc:1140
PerigeeConversions.h
TrackingParticle
Monte Carlo truth information used for tracking validation.
Definition: TrackingParticle.h:29
TrackingNtuple::fillPhase2OTHits
void fillPhase2OTHits(const edm::Event &iEvent, const ClusterTPAssociation &clusterToTPMap, const TrackingParticleRefKeyToIndex &tpKeyToIndex, const SimHitTPAssociationProducer::SimHitTPAssociationList &simHitsTPAssoc, const edm::DetSetVector< PixelDigiSimLink > &digiSimLink, const TransientTrackingRecHitBuilder &theTTRHBuilder, const TrackerTopology &tTopo, const SimHitRefKeyToIndex &simHitRefKeyToIndex, std::set< edm::ProductID > &hitProductIds)
Definition: TrackingNtuple.cc:2690
mps_fire.end
end
Definition: mps_fire.py:242
TrackingNtuple::trk_simTrkIdx
std::vector< std::vector< int > > trk_simTrkIdx
Definition: TrackingNtuple.cc:1017
reco::BeamSpot
Definition: BeamSpot.h:21
TrackingNtuple::DetIdOTCommon::push_back
void push_back(const TrackerTopology &tTopo, const DetId &id)
Definition: TrackingNtuple.cc:772
TrackingNtuple::SimHitData::bunchCrossing
std::vector< int > bunchCrossing
Definition: TrackingNtuple.cc:611
reco::Track
Definition: Track.h:27
TrackAssociatorRecord
Definition: TrackAssociatorRecord.h:18
ProductID.h
IdealMagneticFieldRecord.h
edm::ESHandle< MagneticField >
TrackingNtuple::sim_pca_eta
std::vector< float > sim_pca_eta
Definition: TrackingNtuple.cc:1035
TrackingNtuple::str_simHitIdx
std::vector< std::vector< int > > str_simHitIdx
Definition: TrackingNtuple.cc:1089
TrackingVertexRef
edm::Ref< TrackingVertexCollection > TrackingVertexRef
Definition: TrackingVertexContainer.h:9
TrackingNtuple::sim_nPixelLay
std::vector< unsigned int > sim_nPixelLay
Definition: TrackingNtuple.cc:1047
declareDynArray
#define declareDynArray(T, n, x)
Definition: DynArray.h:91
TrackingNtuple::see_dz
std::vector< float > see_dz
Definition: TrackingNtuple.cc:1189
TrackingNtuple::see_bestSimTrkShareFrac
std::vector< float > see_bestSimTrkShareFrac
Definition: TrackingNtuple.cc:1215
TrackingNtuple::bsp_x
float bsp_x
Definition: TrackingNtuple.cc:1172
TrackingNtuple::DetIdOTCommon::set
void set(size_t index, const TrackerTopology &tTopo, const DetId &id)
Definition: TrackingNtuple.cc:785
TrackingNtuple::trk_simTrkNChi2
std::vector< std::vector< float > > trk_simTrkNChi2
Definition: TrackingNtuple.cc:1016
TrackingNtuple::DetIdStripOnly::resize
void resize(size_t size)
Definition: TrackingNtuple.cc:847
submitPVResolutionJobs.count
count
Definition: submitPVResolutionJobs.py:352
TrackingNtuple::sim_pca_cotTheta
std::vector< float > sim_pca_cotTheta
Definition: TrackingNtuple.cc:1037
StripSubdetector::TIB
static constexpr auto TIB
Definition: StripSubdetector.h:16
TrackingNtuple::simvtx_daughterSimIdx
std::vector< std::vector< int > > simvtx_daughterSimIdx
Definition: TrackingNtuple.cc:1250
TrackingNtuple::sim_trkIdx
std::vector< std::vector< int > > sim_trkIdx
Definition: TrackingNtuple.cc:1054
reco::TrackBase::algoName
std::string algoName() const
Definition: TrackBase.h:550
edm::EventNumber_t
unsigned long long EventNumber_t
Definition: RunLumiEventNumber.h:12
TrackingNtuple::trk_lambdaErr
std::vector< float > trk_lambdaErr
Definition: TrackingNtuple.cc:970
TrackingNtuple::ph2_isBarrel
std::vector< short > ph2_isBarrel
Definition: TrackingNtuple.cc:1127
TrackingNtuple::sim_pca_lambda
std::vector< float > sim_pca_lambda
Definition: TrackingNtuple.cc:1036
TrackingNtuple::pix_xy
std::vector< float > pix_xy
Definition: TrackingNtuple.cc:1074
TrackingNtuple::DetIdStripOnly::petalNumber
std::vector< unsigned short > petalNumber
Definition: TrackingNtuple.cc:896
TrackingNtuple::DetIdPixelOnly::blade
std::vector< unsigned short > blade
Definition: TrackingNtuple.cc:758
GlobalPoint
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
TrackingNtuple::pix_simType
std::vector< unsigned short > pix_simType
Definition: TrackingNtuple.cc:1069
TrackingNtuple::QualityMaskCollection
std::vector< unsigned char > QualityMaskCollection
Definition: TrackingNtuple.cc:490
TrackingNtuple::DetIdOTCommon::order
std::vector< unsigned short > order
Definition: TrackingNtuple.cc:821
TrackingNtuple::simhit_x
std::vector< float > simhit_x
Definition: TrackingNtuple.cc:1159
TrackingNtuple::trk_simTrkShareFrac
std::vector< std::vector< float > > trk_simTrkShareFrac
Definition: TrackingNtuple.cc:1015
TrackingNtuple::vtx_valid
std::vector< short > vtx_valid
Definition: TrackingNtuple.cc:1237
TrackingNtuple::ph2_radL
std::vector< float > ph2_radL
Definition: TrackingNtuple.cc:1144
TrackingNtuple::ev_run
edm::RunNumber_t ev_run
Definition: TrackingNtuple.cc:939
Point3DBase< float, GlobalTag >
TrackingNtuple::DetIdStripOnly::push_back
void push_back(const TrackerTopology &tTopo, const DetId &id)
Definition: TrackingNtuple.cc:838
TrackingNtuple::sim_pca_pt
std::vector< float > sim_pca_pt
Definition: TrackingNtuple.cc:1034
TrackingNtuple::DetIdOTCommon::rod
std::vector< unsigned short > rod
Definition: TrackingNtuple.cc:823
TrajectorySeed.h
TrackingNtuple::tpHitIndexListLess
static bool tpHitIndexListLess(const TPHitIndex &i, const TPHitIndex &j)
Definition: TrackingNtuple.cc:500
TrackingNtuple::ph2_detId
DetIdPhase2OT ph2_detId
Definition: TrackingNtuple.cc:1128
TrackingNtuple::DetIdAll
CombineDetId< DetIdCommon, DetIdPixelOnly, DetIdOTCommon, DetIdStripOnly > DetIdAll
Definition: TrackingNtuple.cc:935
TrackingNtuple::mvaQualityCollectionTokens_
std::vector< std::tuple< edm::EDGetTokenT< MVACollection >, edm::EDGetTokenT< QualityMaskCollection > > > mvaQualityCollectionTokens_
Definition: TrackingNtuple.cc:633
TrackingNtuple::trk_nInnerInactive
std::vector< unsigned int > trk_nInnerInactive
Definition: TrackingNtuple.cc:991
TrackingNtuple::simhit_y
std::vector< float > simhit_y
Definition: TrackingNtuple.cc:1160
cmsswSequenceInfo.tp
tp
Definition: cmsswSequenceInfo.py:17
TrackingNtuple::DetIdPhase2OTOnly::DetIdPhase2OTOnly
DetIdPhase2OTOnly()
Definition: TrackingNtuple.cc:904
TrackingNtuple::see_bestSimTrkIdx
std::vector< int > see_bestSimTrkIdx
Definition: TrackingNtuple.cc:1214
TrackingNtuple::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: TrackingNtuple.cc:1983
TrackingNtuple::DetIdOTCommon::book
void book(const std::string &prefix, TTree *tree)
Definition: TrackingNtuple.cc:766
edmNew::DetSetVector::dataSize
size_type dataSize() const
Definition: DetSetVectorNew.h:552
TrackingNtuple::see_statePt
std::vector< float > see_statePt
Definition: TrackingNtuple.cc:1196
DetId::subdetId
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
Definition: DetId.h:48
TrackingNtuple::DetIdStripOnly::isRPhi
std::vector< unsigned short > isRPhi
Definition: TrackingNtuple.cc:898
TrackingNtuple::trk_lambda
std::vector< float > trk_lambda
Definition: TrackingNtuple.cc:959
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
TrackingNtuple::glu_isBarrel
std::vector< short > glu_isBarrel
Definition: TrackingNtuple.cc:1107
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::vector_transform
auto vector_transform(std::vector< InputType > const &input, Function predicate) -> std::vector< typename std::remove_cv< typename std::remove_reference< decltype(predicate(input.front()))>::type >::type >
Definition: transform.h:11
Vertex.h
TrackingNtuple::trk_pz
std::vector< float > trk_pz
Definition: TrackingNtuple.cc:948
TrackingNtuple::sim_nLay
std::vector< unsigned int > sim_nLay
Definition: TrackingNtuple.cc:1046
TrackingNtuple::str_simType
std::vector< unsigned short > str_simType
Definition: TrackingNtuple.cc:1091
ParametersDefinerForTPESProducer.h
TrackingNtuple::ph2_xx
std::vector< float > ph2_xx
Definition: TrackingNtuple.cc:1137
TFileService.h
TrackingNtuple::trk_mvas
std::vector< std::vector< float > > trk_mvas
Definition: TrackingNtuple.cc:980
bsc_activity_cfg.clusters
clusters
Definition: bsc_activity_cfg.py:36
TrackingNtuple::beamSpotToken_
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
Definition: TrackingNtuple.cc:643
PbPb_ZMuSkimMuonDPG_cff.tracker
tracker
Definition: PbPb_ZMuSkimMuonDPG_cff.py:60
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
TrackingNtuple::DetIdOTCommon::DetIdOTCommon
DetIdOTCommon()
Definition: TrackingNtuple.cc:764
PixelPluginsPhase0_cfi.isBarrel
isBarrel
Definition: PixelPluginsPhase0_cfi.py:17
TrackingNtuple::SimHitData::chargeFraction
std::vector< float > chargeFraction
Definition: TrackingNtuple.cc:610
trackFromSeedFitFailed
bool trackFromSeedFitFailed(const reco::Track &track)
Definition: trackFromSeedFitFailed.h:6
HistoryBase.h
runTauDisplay.gp
gp
Definition: runTauDisplay.py:431
TrackingNtuple::stripSimLinkToken_
edm::EDGetTokenT< edm::DetSetVector< StripDigiSimLink > > stripSimLinkToken_
Definition: TrackingNtuple.cc:640
TrackingNtuple::pix_y
std::vector< float > pix_y
Definition: TrackingNtuple.cc:1071
edm::View
Definition: CaloClusterFwd.h:14
ntuplemaker.fill
fill
Definition: ntuplemaker.py:304
TrackingNtuple::trk_vtxIdx
std::vector< int > trk_vtxIdx
Definition: TrackingNtuple.cc:1003
TrackerDigiGeometryRecord.h
Point
Structure Point Contains parameters of Gaussian fits to DMRs.
Definition: DMRtrends.cc:57
TrackerTopology::tibString
unsigned int tibString(const DetId &id) const
Definition: TrackerTopology.h:419
SiPixelRecHitCollection.h
Phase2TrackerRecHit1D.h
TrackingNtuple::DetIdCommon::clear
void clear()
Definition: TrackingNtuple.cc:717
TrackToTrackingParticleAssociator.h
trackerHitRTTI::isMatched
bool isMatched(TrackingRecHit const &hit)
Definition: trackerHitRTTI.h:33
TrackingNtuple::trk_nChi2
std::vector< float > trk_nChi2
Definition: TrackingNtuple.cc:977
BOOK
#define BOOK(name)
Definition: TrackingNtuple.cc:666
TrackingNtuple::see_simTrkShareFrac
std::vector< std::vector< float > > see_simTrkShareFrac
Definition: TrackingNtuple.cc:1218
bphysicsOniaDQM_cfi.vertex
vertex
Definition: bphysicsOniaDQM_cfi.py:7
TrackingNtuple::stripMatchedRecHitToken_
edm::EDGetTokenT< SiStripMatchedRecHit2DCollection > stripMatchedRecHitToken_
Definition: TrackingNtuple.cc:647
TrackingNtuple::str_zx
std::vector< float > str_zx
Definition: TrackingNtuple.cc:1100
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:223
trackFromSeedFitFailed.h
TrackingNtuple::trk_inner_py
std::vector< float > trk_inner_py
Definition: TrackingNtuple.cc:951
edm::ParameterSet
Definition: ParameterSet.h:47
TrackingNtuple::see_nPhase2OT
std::vector< unsigned int > see_nPhase2OT
Definition: TrackingNtuple.cc:1207
TrackingNtuple::sim_genPdgIds
std::vector< std::vector< int > > sim_genPdgIds
Definition: TrackingNtuple.cc:1026
DetId::Tracker
Definition: DetId.h:25
clear
void clear(HadCaloObj &c)
Definition: data.h:124
TrackingNtuple::TPHitIndex::tpKey
unsigned int tpKey
Definition: TrackingNtuple.cc:495
TrackerTopology::tidOrder
unsigned int tidOrder(const DetId &id) const
Definition: TrackerTopology.h:212
TrackingNtuple::DetIdCommon::subdet
std::vector< unsigned short > subdet
Definition: TrackingNtuple.cc:727
TrackingNtuple::DetIdOTCommon::parse
Parsed parse(const TrackerTopology &tTopo, const DetId &id) const
Definition: TrackingNtuple.cc:806
TrackingNtuple::see_nCluster
std::vector< unsigned int > see_nCluster
Definition: TrackingNtuple.cc:1208
Event.h
TrackingNtuple::sim_nValid
std::vector< unsigned int > sim_nValid
Definition: TrackingNtuple.cc:1043
TrackingNtuple::seedTokens_
std::vector< edm::EDGetTokenT< edm::View< reco::Track > > > seedTokens_
Definition: TrackingNtuple.cc:629
operator<<
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:167
TrackingNtuple::trackingParticleToken_
edm::EDGetTokenT< TrackingParticleCollection > trackingParticleToken_
Definition: TrackingNtuple.cc:634
TrackingNtuple::simHitTPMapToken_
edm::EDGetTokenT< SimHitTPAssociationProducer::SimHitTPAssociationList > simHitTPMapToken_
Definition: TrackingNtuple.cc:637
TrackingNtuple::HitSimType::ITPileup
TrackingNtuple::ph2_simHitIdx
std::vector< std::vector< int > > ph2_simHitIdx
Definition: TrackingNtuple.cc:1131
TrackerTopology::tecPetalNumber
unsigned int tecPetalNumber(const DetId &id) const
Definition: TrackerTopology.h:221
TrackingNtuple::sim_bunchCrossing
std::vector< int > sim_bunchCrossing
Definition: TrackingNtuple.cc:1024
print
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:46
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
TrackingNtuple::DetIdStripOnly::Parsed
Definition: TrackingNtuple.cc:873
TrackingNtuple::pix_yy
std::vector< float > pix_yy
Definition: TrackingNtuple.cc:1075
TrackingNtuple::DetIdPhase2OTOnly::clear
void clear()
Definition: TrackingNtuple.cc:919
SiStripMatchedRecHit2D::stereoClusterRef
OmniClusterRef const & stereoClusterRef() const
Definition: SiStripMatchedRecHit2D.h:34
edm::AssociationMap< edm::OneToManyWithQualityGeneric< TrackingParticleCollection, edm::View< reco::Track >, double > >
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
TrackingNtuple::glu_x
std::vector< float > glu_x
Definition: TrackingNtuple.cc:1112
TrackingNtuple::fillTrackingVertices
void fillTrackingVertices(const TrackingVertexRefVector &trackingVertices, const TrackingParticleRefKeyToIndex &tpKeyToIndex)
Definition: TrackingNtuple.cc:3582
TrackingVertex
Definition: TrackingVertex.h:22
TrackingNtuple::trk_q
std::vector< int > trk_q
Definition: TrackingNtuple.cc:982
TrackingNtuple::sim_event
std::vector< int > sim_event
Definition: TrackingNtuple.cc:1023
trackingNtuple_cff.seedTracks
seedTracks
Definition: trackingNtuple_cff.py:76
TrackingNtuple::DetIdCommon::resize
void resize(size_t size)
Definition: TrackingNtuple.cc:701
TrackerTopology::isRPhi
bool isRPhi(const DetId &id) const
Definition: TrackerTopology.cc:177
TrackingNtuple::stripStereoRecHitToken_
edm::EDGetTokenT< SiStripRecHit2DCollection > stripStereoRecHitToken_
Definition: TrackingNtuple.cc:646
TrackingNtuple::see_py
std::vector< float > see_py
Definition: TrackingNtuple.cc:1183
TrackingNtuple::parametersDefinerName_
std::string parametersDefinerName_
Definition: TrackingNtuple.cc:655
TrackingNtuple::see_nStrip
std::vector< unsigned int > see_nStrip
Definition: TrackingNtuple.cc:1206
RZLine.h
muonSimHitMatcherPSet.simTrack
simTrack
Definition: muonSimHitMatcherPSet.py:4
TrackingNtuple::see_stopReason
std::vector< unsigned short > see_stopReason
Definition: TrackingNtuple.cc:1210
TrackingNtuple::DetIdStripOnly::Parsed::petalNumber
unsigned int petalNumber
Definition: TrackingNtuple.cc:877
TrackingNtuple::HitSimType::Signal
funct::tan
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
edm::DetSetVector::find
iterator find(det_id_type id)
Definition: DetSetVector.h:264
OmniClusterRef::phase2OTCluster
Phase2TrackerCluster1D const & phase2OTCluster() const
Definition: OmniClusterRef.h:56
TrackingNtuple::glu_yz
std::vector< float > glu_yz
Definition: TrackingNtuple.cc:1118
TrackingNtuple::glu_z
std::vector< float > glu_z
Definition: TrackingNtuple.cc:1114
edm::Service< TFileService >
createfilelist.int
int
Definition: createfilelist.py:10
SiStripCluster::size
uint8_t size() const
Definition: SiStripCluster.h:64
iEvent
int iEvent
Definition: GenABIO.cc:224
TrackingNtuple::ph2_seeIdx
std::vector< std::vector< int > > ph2_seeIdx
Definition: TrackingNtuple.cc:1130
HistoryBase
Base class to all the history types.
Definition: HistoryBase.h:12
TrackingNtuple::trk_bestFromFirstHitSimTrkNChi2
std::vector< float > trk_bestFromFirstHitSimTrkNChi2
Definition: TrackingNtuple.cc:1014
reco::TrackBase
Definition: TrackBase.h:62
TrackerTopology::tecRing
unsigned int tecRing(const DetId &id) const
ring id
Definition: TrackerTopology.h:217
TrackingNtuple::sim_pz
std::vector< float > sim_pz
Definition: TrackingNtuple.cc:1030
SiStripRecHit2DCollection.h
TrackingNtuple::simvtx_sourceSimIdx
std::vector< std::vector< int > > simvtx_sourceSimIdx
Definition: TrackingNtuple.cc:1249
TrackingNtuple::SimHitData::matchingSimHit
std::vector< int > matchingSimHit
Definition: TrackingNtuple.cc:609
M_PI
#define M_PI
Definition: BXVectorInputProducer.cc:49
TrackingNtuple::DetIdOTCommon::Parsed::rod
unsigned int rod
Definition: TrackingNtuple.cc:804
TrackingNtuple::sim_eta
std::vector< float > sim_eta
Definition: TrackingNtuple.cc:1032
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
TrackingNtuple::trk_nLost
std::vector< unsigned int > trk_nLost
Definition: TrackingNtuple.cc:984
ClusterTPAssociation::equal_range
range equal_range(const OmniClusterRef &key) const
Definition: ClusterTPAssociation.h:65
TrackingNtuple::vtx_fake
std::vector< short > vtx_fake
Definition: TrackingNtuple.cc:1236
TrackingNtuple::trk_outer_py
std::vector< float > trk_outer_py
Definition: TrackingNtuple.cc:955
MuonTrackValidator_cfi.parametersDefiner
parametersDefiner
Definition: MuonTrackValidator_cfi.py:26
OmniClusterRef::pixelCluster
SiPixelCluster const & pixelCluster() const
Definition: OmniClusterRef.h:54
TrackingNtuple::DetIdPixelOnly
Definition: TrackingNtuple.cc:733
GlobalErrorBase< double, ErrorMatrixTag >
TrackingNtuple::DetIdPhase2OT
CombineDetId< DetIdCommon, DetIdOTCommon, DetIdPhase2OTOnly > DetIdPhase2OT
Definition: TrackingNtuple.cc:934
TrackingNtuple::see_isTrue
std::vector< short > see_isTrue
Definition: TrackingNtuple.cc:1213
TrackingNtuple::simhit_eloss
std::vector< float > simhit_eloss
Definition: TrackingNtuple.cc:1164
TrackingNtuple::DetIdPhase2OTOnly::isUpper
std::vector< unsigned short > isUpper
Definition: TrackingNtuple.cc:927
BaseTrackerRecHit::firstClusterRef
virtual OmniClusterRef const & firstClusterRef() const =0
MagneticField.h
TrackingNtuple::trk_hitIdx
std::vector< std::vector< int > > trk_hitIdx
Definition: TrackingNtuple.cc:1018
B2GTnPMonitor_cfi.item
item
Definition: B2GTnPMonitor_cfi.py:147
edm::EventSetup
Definition: EventSetup.h:57
TrackingNtuple::simvtx_x
std::vector< float > simvtx_x
Definition: TrackingNtuple.cc:1246
TrackingNtuple::simhit_detId_phase2
DetIdAllPhase2 simhit_detId_phase2
Definition: TrackingNtuple.cc:1158
TrackingNtuple::trk_dxy
std::vector< float > trk_dxy
Definition: TrackingNtuple.cc:962
TrackingNtuple::pix_xx
std::vector< float > pix_xx
Definition: TrackingNtuple.cc:1073
SiPixelCluster::size
int size() const
Definition: SiPixelCluster.h:122
TrackingNtuple::glu_stereoIdx
std::vector< int > glu_stereoIdx
Definition: TrackingNtuple.cc:1110
TrackingNtuple::str_zz
std::vector< float > str_zz
Definition: TrackingNtuple.cc:1099
SiPixelCluster::pixel
Pixel pixel(int i) const
Definition: SiPixelCluster.h:158
TrackAssociatorRecord.h
TrackingNtuple::addStripMatchedHit
size_t addStripMatchedHit(const SiStripMatchedRecHit2D &hit, const TransientTrackingRecHitBuilder &theTTRHBuilder, const TrackerTopology &tTopo, std::vector< std::pair< int, int >> &monoStereoClusterList)
Definition: TrackingNtuple.cc:2646
TrackingNtuple::trk_py
std::vector< float > trk_py
Definition: TrackingNtuple.cc:947
TrackingNtuple::vtx_zErr
std::vector< float > vtx_zErr
Definition: TrackingNtuple.cc:1233
SiStripRecHit1D
Definition: SiStripRecHit1D.h:8
TrackingNtuple::trk_bestFromFirstHitSimTrkIdx
std::vector< int > trk_bestFromFirstHitSimTrkIdx
Definition: TrackingNtuple.cc:1010
SiStripCluster::amplitudes
SiStripCluster const & amplitudes() const
Definition: SiStripCluster.h:69
TrackCollections2monitor_cff.func
func
Definition: TrackCollections2monitor_cff.py:359
TrackingNtuple::simvtx_event
std::vector< int > simvtx_event
Definition: TrackingNtuple.cc:1243
TrackingNtuple::fillStripRphiStereoHits
void fillStripRphiStereoHits(const edm::Event &iEvent, const ClusterTPAssociation &clusterToTPMap, const TrackingParticleRefKeyToIndex &tpKeyToIndex, const SimHitTPAssociationProducer::SimHitTPAssociationList &simHitsTPAssoc, const edm::DetSetVector< StripDigiSimLink > &digiSimLink, const TransientTrackingRecHitBuilder &theTTRHBuilder, const TrackerTopology &tTopo, const SimHitRefKeyToIndex &simHitRefKeyToIndex, std::set< edm::ProductID > &hitProductIds)
Definition: TrackingNtuple.cc:2550
get
#define get
edm::RefVector::push_back
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
Definition: RefVector.h:67
edm::RefToBaseVector< reco::Track >
SiStripMatchedRecHit2D::monoClusterRef
OmniClusterRef const & monoClusterRef() const
Definition: SiStripMatchedRecHit2D.h:35
TrackingNtuple::DetIdStripOnly::set
void set(size_t index, const TrackerTopology &tTopo, const DetId &id)
Definition: TrackingNtuple.cc:855
TrajectorySeedCollection.h
TrackingNtuple::str_bbxi
std::vector< float > str_bbxi
Definition: TrackingNtuple.cc:1103
TrackingNtuple::bsp_z
float bsp_z
Definition: TrackingNtuple.cc:1174
TrackingNtuple::DetIdAllPhase2
CombineDetId< DetIdCommon, DetIdPixelOnly, DetIdOTCommon, DetIdPhase2OTOnly > DetIdAllPhase2
Definition: TrackingNtuple.cc:936
TrackingNtuple::trk_nInactive
std::vector< unsigned int > trk_nInactive
Definition: TrackingNtuple.cc:985
TrackingNtuple::ph2_x
std::vector< float > ph2_x
Definition: TrackingNtuple.cc:1134
TrackingNtuple::tpNPixelLayersToken_
edm::EDGetTokenT< edm::ValueMap< unsigned int > > tpNPixelLayersToken_
Definition: TrackingNtuple.cc:652
TrackingNtuple::DetIdStripOnly::book
void book(const std::string &prefix, TTree *tree)
Definition: TrackingNtuple.cc:830
DynArray.h
TrackingNtuple::str_detId
DetIdStrip str_detId
Definition: TrackingNtuple.cc:1086
TrackingNtuple::includeSeeds_
const bool includeSeeds_
Definition: TrackingNtuple.cc:656
reco::HitPattern::TRACK_HITS
Definition: HitPattern.h:155
TrackingNtuple::trk_bestSimTrkShareFracSimClusterDenom
std::vector< float > trk_bestSimTrkShareFracSimClusterDenom
Definition: TrackingNtuple.cc:1008
TrackingNtuple::trk_nStripLay
std::vector< unsigned int > trk_nStripLay
Definition: TrackingNtuple.cc:993
TrackingNtuple::trk_ndof
std::vector< float > trk_ndof
Definition: TrackingNtuple.cc:979
TrackingNtuple::trk_outer_pt
std::vector< float > trk_outer_pt
Definition: TrackingNtuple.cc:957
TrackingNtuple::sim_nTrackerHits
std::vector< unsigned int > sim_nTrackerHits
Definition: TrackingNtuple.cc:1050
TrackingRecHit
Definition: TrackingRecHit.h:21
SiStripRecHit1D.h
TrackingNtuple::glu_bbxi
std::vector< float > glu_bbxi
Definition: TrackingNtuple.cc:1123
SimHitTPAssociationProducer.h
TrackingNtuple::trk_bestSimTrkShareFrac
std::vector< float > trk_bestSimTrkShareFrac
Definition: TrackingNtuple.cc:1006
TrackingNtuple::glu_monoIdx
std::vector< int > glu_monoIdx
Definition: TrackingNtuple.cc:1109
TrackingNtuple::vtx_ndof
std::vector< float > vtx_ndof
Definition: TrackingNtuple.cc:1234
Types
Definition: Types.py:1
edm::EDConsumerBase::labelsForToken
void labelsForToken(EDGetToken iToken, Labels &oLabels) const
Definition: EDConsumerBase.cc:337
TrackingNtuple::simvtx_z
std::vector< float > simvtx_z
Definition: TrackingNtuple.cc:1248
VertexFwd.h
TrackingNtuple::trk_cotTheta
std::vector< float > trk_cotTheta
Definition: TrackingNtuple.cc:960
TrackingNtuple::includePhase2OTHits_
bool includePhase2OTHits_
Definition: TrackingNtuple.cc:642
DDAxes::phi
TrackingNtuple::trk_refpoint_x
std::vector< float > trk_refpoint_x
Definition: TrackingNtuple.cc:974
TrackingNtuple::vtx_y
std::vector< float > vtx_y
Definition: TrackingNtuple.cc:1229
TrackingNtuple::stripRphiRecHitToken_
edm::EDGetTokenT< SiStripRecHit2DCollection > stripRphiRecHitToken_
Definition: TrackingNtuple.cc:645
TrackingNtuple::trk_stopReason
std::vector< unsigned short > trk_stopReason
Definition: TrackingNtuple.cc:1000
TrackingNtuple::clusterTPMapToken_
edm::EDGetTokenT< ClusterTPAssociation > clusterTPMapToken_
Definition: TrackingNtuple.cc:636
SimHitTPAssociationProducer::SimHitTPAssociationList
std::vector< SimHitTPPair > SimHitTPAssociationList
Definition: SimHitTPAssociationProducer.h:18
TrackingNtuple::trk_nLostLay
std::vector< unsigned int > trk_nLostLay
Definition: TrackingNtuple.cc:995
RZLine
Definition: RZLine.h:12
TrackingNtuple::DetIdOTCommon
Definition: TrackingNtuple.cc:762
edmNew::DetSetVector
Definition: DetSetNew.h:13
TrackingNtuple::DetIdPhase2OTOnly::book
void book(const std::string &prefix, TTree *tree)
Definition: TrackingNtuple.cc:906
edm::Ref::id
ProductID id() const
Accessor for product ID.
Definition: Ref.h:244
edm::RefToBaseVector::size
size_type size() const
Definition: RefToBaseVector.h:160
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
TrackingNtuple::ph2_bbxi
std::vector< float > ph2_bbxi
Definition: TrackingNtuple.cc:1145
OmniClusterRef::id
edm::ProductID id() const
Definition: OmniClusterRef.h:69
impl
Definition: trackAlgoPriorityOrder.h:18
std
Definition: JetResolutionObject.h:76
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
TrackingNtuple::fillBeamSpot
void fillBeamSpot(const reco::BeamSpot &bs)
Definition: TrackingNtuple.cc:2238
TrackingNtuple::trk_outer_px
std::vector< float > trk_outer_px
Definition: TrackingNtuple.cc:954
StripSubdetector::TEC
static constexpr auto TEC
Definition: StripSubdetector.h:19
TrackerTopology::isUpper
bool isUpper(const DetId &id) const
Definition: TrackerTopology.cc:214
TrackingNtuple::DetIdStripOnly::isStereo
std::vector< unsigned short > isStereo
Definition: TrackingNtuple.cc:897
TrackingNtuple::pix_detId
DetIdPixel pix_detId
Definition: TrackingNtuple.cc:1064
TrackingNtuple::pix_trkIdx
std::vector< std::vector< int > > pix_trkIdx
Definition: TrackingNtuple.cc:1065
RunInfoPI::state
state
Definition: RunInfoPayloadInspectoHelper.h:16
isFinite.h
TrackerTopology::tibIsDoubleSide
bool tibIsDoubleSide(const DetId &id) const
Definition: TrackerTopology.h:249
TrackingNtuple::pixelRecHitToken_
edm::EDGetTokenT< SiPixelRecHitCollection > pixelRecHitToken_
Definition: TrackingNtuple.cc:644
TrackingNtuple::inv_isBarrel
std::vector< short > inv_isBarrel
Definition: TrackingNtuple.cc:1150
TrackingNtuple::glu_xy
std::vector< float > glu_xy
Definition: TrackingNtuple.cc:1116
TrackingNtuple::sim_nPixel
std::vector< unsigned int > sim_nPixel
Definition: TrackingNtuple.cc:1044
TrackingNtuple::ph2_zx
std::vector< float > ph2_zx
Definition: TrackingNtuple.cc:1142
SiStripMatchedRecHit2D
Definition: SiStripMatchedRecHit2D.h:8
TrackingNtuple::TPHitIndex
Definition: TrackingNtuple.cc:492
TrackingNtuple::phase2OTRecHitToken_
edm::EDGetTokenT< Phase2TrackerRecHit1DCollectionNew > phase2OTRecHitToken_
Definition: TrackingNtuple.cc:648
TrackingNtuple::SimHitData::event
std::vector< int > event
Definition: TrackingNtuple.cc:612
SeedStopInfo.h
SimTrack
Definition: SimTrack.h:6
Frameworkfwd.h
TrackingNtuple::see_algo
std::vector< unsigned int > see_algo
Definition: TrackingNtuple.cc:1209
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
TrackingNtuple::trk_dxyErr
std::vector< float > trk_dxyErr
Definition: TrackingNtuple.cc:972
TSCBLBuilderNoMaterial
Definition: TSCBLBuilderNoMaterial.h:13
TrackingNtuple::trk_pt
std::vector< float > trk_pt
Definition: TrackingNtuple.cc:949
transform.h
TrackingNtuple::trk_eta
std::vector< float > trk_eta
Definition: TrackingNtuple.cc:958
TrackingNtuple::DetIdStripOnly::clear
void clear()
Definition: TrackingNtuple.cc:864
edmNew::DetSetVector::end
const_iterator end(bool update=false) const
Definition: DetSetVectorNew.h:535
TrackingNtuple::see_stateTrajPx
std::vector< float > see_stateTrajPx
Definition: TrackingNtuple.cc:1199
TrackingNtuple::vtx_trkIdx
std::vector< std::vector< int > > vtx_trkIdx
Definition: TrackingNtuple.cc:1238
relativeConstraints.empty
bool empty
Definition: relativeConstraints.py:46
TrackingNtuple::DetIdStripOnly::isGlued
std::vector< unsigned short > isGlued
Definition: TrackingNtuple.cc:899
Exception
Definition: hltDiff.cc:246
TFileService::kSharedResource
static const std::string kSharedResource
Definition: TFileService.h:76
reco::HitPattern::MISSING_INNER_HITS
Definition: HitPattern.h:155
TrackingNtuple::see_nCands
std::vector< unsigned short > see_nCands
Definition: TrackingNtuple.cc:1211
TrackingNtuple::sim_pca_dxy
std::vector< float > sim_pca_dxy
Definition: TrackingNtuple.cc:1039
TrackingNtuple::see_stateTrajY
std::vector< float > see_stateTrajY
Definition: TrackingNtuple.cc:1198
TrackingNtuple::TPHitIndex::detId
unsigned int detId
Definition: TrackingNtuple.cc:498
TrackingNtuple::simhit_hitIdx
std::vector< std::vector< int > > simhit_hitIdx
Definition: TrackingNtuple.cc:1168
TrackingNtuple::simhit_particle
std::vector< int > simhit_particle
Definition: TrackingNtuple.cc:1162
TrackingNtuple::bsp_y
float bsp_y
Definition: TrackingNtuple.cc:1173
TrackerTopology::tecOrder
unsigned int tecOrder(const DetId &id) const
Definition: TrackerTopology.h:206
TrackingNtuple::glu_radL
std::vector< float > glu_radL
Definition: TrackingNtuple.cc:1122
TrackingNtuple::trk_nValid
std::vector< unsigned int > trk_nValid
Definition: TrackingNtuple.cc:983
TrackingNtuple::HitSimType::Unknown
TrackingNtuple::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: TrackingNtuple.cc:3626
StripSubdetector::TOB
static constexpr auto TOB
Definition: StripSubdetector.h:18
TrackingNtuple::trk_hitType
std::vector< std::vector< int > > trk_hitType
Definition: TrackingNtuple.cc:1019
TrackingNtuple::DetIdCommon::set
void set(size_t index, const TrackerTopology &tTopo, const DetId &id)
Definition: TrackingNtuple.cc:709
TrackPSimHitRef
edm::Ref< edm::PSimHitContainer > TrackPSimHitRef
Definition: PSimHitContainer.h:14
TrackingNtuple::HitType
HitType
Definition: TrackingNtuple.cc:481
TrackingNtuple::str_xx
std::vector< float > str_xx
Definition: TrackingNtuple.cc:1095
TrackingNtuple::see_phi
std::vector< float > see_phi
Definition: TrackingNtuple.cc:1187
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
TrackingNtuple
Definition: TrackingNtuple.cc:469
TrackingNtuple::DetIdStripOnly::Parsed::glued
bool glued
Definition: TrackingNtuple.cc:878
TrackingNtuple::siphase2OTSimLinksToken_
edm::EDGetTokenT< edm::DetSetVector< PixelDigiSimLink > > siphase2OTSimLinksToken_
Definition: TrackingNtuple.cc:641
TrackingNtuple::DetIdOTCommon::Parsed
Definition: TrackingNtuple.cc:799
TrajectoryStateTransform.h
TrackingNtuple::DetIdCommon::layer
std::vector< unsigned short > layer
Definition: TrackingNtuple.cc:728
TrackingNtuple::tpNStripStereoLayersToken_
edm::EDGetTokenT< edm::ValueMap< unsigned int > > tpNStripStereoLayersToken_
Definition: TrackingNtuple.cc:653
TrackingNtuple::see_q
std::vector< int > see_q
Definition: TrackingNtuple.cc:1202
reco::TrackToTrackingParticleAssociator::associateSimToReco
reco::SimToRecoCollection associateSimToReco(const edm::Handle< edm::View< reco::Track >> &tCH, const edm::Handle< TrackingParticleCollection > &tPCH) const
Definition: TrackToTrackingParticleAssociator.h:71
TrackingNtuple::glu_y
std::vector< float > glu_y
Definition: TrackingNtuple.cc:1113
TrackingNtuple::see_dxyErr
std::vector< float > see_dxyErr
Definition: TrackingNtuple.cc:1193
TrackingNtuple::fillVertices
void fillVertices(const reco::VertexCollection &vertices, const edm::RefToBaseVector< reco::Track > &tracks)
Definition: TrackingNtuple.cc:3549
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
TrackingNtuple::DetIdCommon::side
std::vector< unsigned short > side
Definition: TrackingNtuple.cc:729
TrackingNtuple::HitType::Invalid
TrackingNtuple::sim_pt
std::vector< float > sim_pt
Definition: TrackingNtuple.cc:1031
TrackingNtuple::trk_ptErr
std::vector< float > trk_ptErr
Definition: TrackingNtuple.cc:968
TrackingNtuple::pix_radL
std::vector< float > pix_radL
Definition: TrackingNtuple.cc:1080
TrackingNtuple::pix_bbxi
std::vector< float > pix_bbxi
Definition: TrackingNtuple.cc:1081
TrackingNtuple::DetIdPhase2OTOnly::isStack
std::vector< unsigned short > isStack
Definition: TrackingNtuple.cc:928
TrackingNtuple::DetIdPixelOnly::clear
void clear()
Definition: TrackingNtuple.cc:750
edm::Ref::key
key_type key() const
Accessor for product key.
Definition: Ref.h:250
TrackingNtuple::trk_dxyPV
std::vector< float > trk_dxyPV
Definition: TrackingNtuple.cc:964
TrackingNtuple::DetIdOTCommon::Parsed::order
unsigned int order
Definition: TrackingNtuple.cc:802
TrackingNtuple::vtx_z
std::vector< float > vtx_z
Definition: TrackingNtuple.cc:1230
TrackerTopology::pxfBlade
unsigned int pxfBlade(const DetId &id) const
Definition: TrackerTopology.h:447
TrackingNtuple::fillStripMatchedHits
void fillStripMatchedHits(const edm::Event &iEvent, const TransientTrackingRecHitBuilder &theTTRHBuilder, const TrackerTopology &tTopo, std::vector< std::pair< int, int >> &monoStereoClusterList)
Definition: TrackingNtuple.cc:2677
TrackingNtuple::sim_seedIdx
std::vector< std::vector< int > > sim_seedIdx
Definition: TrackingNtuple.cc:1056
TransientTrackingRecHitBuilder.h
TrackingNtuple::sim_pca_dz
std::vector< float > sim_pca_dz
Definition: TrackingNtuple.cc:1040
TrackingNtuple::see_fitok
std::vector< short > see_fitok
Definition: TrackingNtuple.cc:1181
TrackingNtuple::trk_nStrip
std::vector< unsigned int > trk_nStrip
Definition: TrackingNtuple.cc:987
TrackingNtuple::str_x
std::vector< float > str_x
Definition: TrackingNtuple.cc:1092
TrackingNtuple::see_offset
std::vector< unsigned int > see_offset
Definition: TrackingNtuple.cc:1223
TrackingNtuple::sim_n3DLay
std::vector< unsigned int > sim_n3DLay
Definition: TrackingNtuple.cc:1048
cms::Exception
Definition: Exception.h:70
reco::TrackBase::algoByName
static TrackAlgorithm algoByName(const std::string &name)
Definition: TrackBase.cc:137
TrackingNtuple::str_yy
std::vector< float > str_yy
Definition: TrackingNtuple.cc:1097
TrackingNtuple::pix_z
std::vector< float > pix_z
Definition: TrackingNtuple.cc:1072
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
TrackingNtuple::DetIdCommon
Definition: TrackingNtuple.cc:667
TrackingNtuple::builderName_
std::string builderName_
Definition: TrackingNtuple.cc:654
TrackingNtuple::DetIdOTCommon::clear
void clear()
Definition: TrackingNtuple.cc:792
genParticles_cff.map
map
Definition: genParticles_cff.py:11
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:224
TrackerTopologyRcd
Definition: TrackerTopologyRcd.h:10
SimHitTPAssociationList
TrackAssociatorByHitsImpl::SimHitTPAssociationList SimHitTPAssociationList
Definition: TrackAssociatorByHitsProducer.cc:46
operator[]
T operator[](int i) const
Definition: extBasic3DVector.h:222
ParameterSet.h
trackAssociationChi2.h
TrackingNtuple::trk_inner_px
std::vector< float > trk_inner_px
Definition: TrackingNtuple.cc:950
TrackingParticleRef
edm::Ref< TrackingParticleCollection > TrackingParticleRef
Definition: TrackingParticleFwd.h:10
TrackingNtuple::DetIdCommon::book
void book(const std::string &prefix, TTree *tree)
Definition: TrackingNtuple.cc:673
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
TrackingNtuple::sim_pca_phi
std::vector< float > sim_pca_phi
Definition: TrackingNtuple.cc:1038
TrackingNtuple::ph2_trkIdx
std::vector< std::vector< int > > ph2_trkIdx
Definition: TrackingNtuple.cc:1129
TrackingNtuple::trk_bestSimTrkShareFracSimDenom
std::vector< float > trk_bestSimTrkShareFracSimDenom
Definition: TrackingNtuple.cc:1007
TrackingNtuple::simvtx_processType
std::vector< unsigned int > simvtx_processType
Definition: TrackingNtuple.cc:1245
TrackingNtuple::DetIdPhase2OTOnly::isLower
std::vector< unsigned short > isLower
Definition: TrackingNtuple.cc:926
event
Definition: event.py:1
TrackingNtuple::trackingParticleRefToken_
edm::EDGetTokenT< TrackingParticleRefVector > trackingParticleRefToken_
Definition: TrackingNtuple.cc:635
TrackingNtuple::fillTrackingParticlesForSeeds
void fillTrackingParticlesForSeeds(const TrackingParticleRefVector &tpCollection, const reco::SimToRecoCollection &simRecColl, const TrackingParticleRefKeyToIndex &tpKeyToIndex, const unsigned int seedOffset)
Definition: TrackingNtuple.cc:3527
hltrates_dqm_sourceclient-live_cfg.offset
offset
Definition: hltrates_dqm_sourceclient-live_cfg.py:82
edm::Event
Definition: Event.h:73
TrackingNtuple::see_phiErr
std::vector< float > see_phiErr
Definition: TrackingNtuple.cc:1192
TrackingParticle::Point
math::XYZPointD Point
point in the space
Definition: TrackingParticle.h:36
TrackingNtuple::TPHitIndex::tof
float tof
Definition: TrackingNtuple.cc:497
TrackingParticleIP.h
edm::RefVector::size
size_type size() const
Size of the RefVector.
Definition: RefVector.h:102
HLT_FULL_cff.distance
distance
Definition: HLT_FULL_cff.py:7733
crabWrapper.key
key
Definition: crabWrapper.py:19
MagneticField
Definition: MagneticField.h:19
TrackingNtuple::MVACollection
std::vector< float > MVACollection
Definition: TrackingNtuple.cc:489
TransientTrackingRecHitBuilder
Definition: TransientTrackingRecHitBuilder.h:6
SiStripCluster
Definition: SiStripCluster.h:9
OmniClusterRef::key
unsigned int key() const
Definition: OmniClusterRef.h:70
HistoryBase::evaluate
bool evaluate(TrackingParticleRef tpr)
Evaluate track history using a TrackingParticleRef.
Definition: HistoryBase.h:96
TrackingNtuple::sim_pdgId
std::vector< int > sim_pdgId
Definition: TrackingNtuple.cc:1025
LHEGenericFilter_cfi.ParticleID
ParticleID
Definition: LHEGenericFilter_cfi.py:6
TrackingNtuple::seedStopInfoTokens_
std::vector< edm::EDGetTokenT< std::vector< SeedStopInfo > > > seedStopInfoTokens_
Definition: TrackingNtuple.cc:630
TrackingNtuple::see_ptErr
std::vector< float > see_ptErr
Definition: TrackingNtuple.cc:1190
TrackingNtuple::simhit_hitType
std::vector< std::vector< int > > simhit_hitType
Definition: TrackingNtuple.cc:1169
edm::InputTag
Definition: InputTag.h:15
TrackingNtuple::includeStripHits_
bool includeStripHits_
Definition: TrackingNtuple.cc:642
label
const char * label
Definition: PFTauDecayModeTools.cc:11
TrackingNtuple::HitSimType::OOTPileup
OmniClusterRef::cluster_pixel
ClusterPixelRef cluster_pixel() const
Definition: OmniClusterRef.h:40
HistoryBase::depth
void depth(int d)
Set the depth of the history.
Definition: HistoryBase.h:49
TrackingNtuple::pix_chargeFraction
std::vector< std::vector< float > > pix_chargeFraction
Definition: TrackingNtuple.cc:1068
TrackingNtuple::simvtx_y
std::vector< float > simvtx_y
Definition: TrackingNtuple.cc:1247
edm::ProductID
Definition: ProductID.h:27
reco::Vertex
Definition: Vertex.h:35
TrackingNtuple::DetIdPixelOnly::DetIdPixelOnly
DetIdPixelOnly()
Definition: TrackingNtuple.cc:735
StripSubdetector::TID
static constexpr auto TID
Definition: StripSubdetector.h:17
TrackerTopology::tobSide
unsigned int tobSide(const DetId &id) const
Definition: TrackerTopology.h:180
TrackingNtuple::TrackingNtuple
TrackingNtuple(const edm::ParameterSet &)
Definition: TrackingNtuple.cc:1257
TrackingNtuple::ph2_y
std::vector< float > ph2_y
Definition: TrackingNtuple.cc:1135
TrackingNtuple::DetIdPhase2OTOnly::push_back
void push_back(const TrackerTopology &tTopo, const DetId &id)
Definition: TrackingNtuple.cc:912
TrackingNtuple::sim_phi
std::vector< float > sim_phi
Definition: TrackingNtuple.cc:1033
hit
Definition: SiStripHitEffFromCalibTree.cc:88
TrackingNtuple::HitType::Strip
TrackingNtuple::sim_py
std::vector< float > sim_py
Definition: TrackingNtuple.cc:1029
TFileService::make
T * make(const Args &... args) const
make new ROOT object
Definition: TFileService.h:64
edm::View::size_type
unsigned int size_type
Definition: View.h:90
TrackingNtuple::bsp_sigmaz
float bsp_sigmaz
Definition: TrackingNtuple.cc:1177
TrackingNtuple::vtx_x
std::vector< float > vtx_x
Definition: TrackingNtuple.cc:1228
ClusterTPAssociation.h
TrackingNtuple::simhit_simTrkIdx
std::vector< int > simhit_simTrkIdx
Definition: TrackingNtuple.cc:1167
getBestVertex
Point getBestVertex(reco::Track const &trk, reco::VertexCollection const &vertices, const size_t minNtracks=2)
Definition: getBestVertex.h:8
edm::ProductLabels
Definition: ProductLabels.h:4
TrackingNtuple::simvtx_bunchCrossing
std::vector< int > simvtx_bunchCrossing
Definition: TrackingNtuple.cc:1244
TrackingNtuple::trk_phiErr
std::vector< float > trk_phiErr
Definition: TrackingNtuple.cc:971
TrackingNtuple::see_bestFromFirstHitSimTrkIdx
std::vector< int > see_bestFromFirstHitSimTrkIdx
Definition: TrackingNtuple.cc:1216
ParametersDefinerForTP
Definition: ParametersDefinerForTP.h:19
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
pwdgSkimBPark_cfi.vertices
vertices
Definition: pwdgSkimBPark_cfi.py:7
TrackingNtuple::DetIdStripOnly::DetIdStripOnly
DetIdStripOnly()
Definition: TrackingNtuple.cc:828
TrackingParticleIP::dz
auto dz(const T_Vertex &vertex, const T_Momentum &momentum, const T_Point &point)
Definition: TrackingParticleIP.h:16
ZMuMuAnalysisNtupler_cff.prefix
prefix
Definition: ZMuMuAnalysisNtupler_cff.py:14
TrackingNtuple::DetIdPixelOnly::panel
std::vector< unsigned short > panel
Definition: TrackingNtuple.cc:759
TrackerGeometry
Definition: TrackerGeometry.h:14
TrackingNtuple::pix_seeIdx
std::vector< std::vector< int > > pix_seeIdx
Definition: TrackingNtuple.cc:1066
SimHitTPAssociationProducer::simHitTPAssociationListGreater
static bool simHitTPAssociationListGreater(SimHitTPPair i, SimHitTPPair j)
Definition: SimHitTPAssociationProducer.h:23
TrackingNtuple::see_chi2
std::vector< float > see_chi2
Definition: TrackingNtuple.cc:1195
TrackingNtuple::trk_dzClosestPV
std::vector< float > trk_dzClosestPV
Definition: TrackingNtuple.cc:967
reco::TrackBase::highPurity
Definition: TrackBase.h:154
TrackingNtuple::vtx_yErr
std::vector< float > vtx_yErr
Definition: TrackingNtuple.cc:1232