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