CMS 3D CMS Logo

TrackingRegionsSeedingLayerSets.h
Go to the documentation of this file.
1 #ifndef RecoTracker_TkTrackingRegions_TrackingRegionsSeedingLayerSets_H
2 #define RecoTracker_TkTrackingRegions_TrackingRegionsSeedingLayerSets_H
3 
6 
7 #include <vector>
8 #include <memory>
9 
11  class Element;
12 
13 public:
14  class RegionLayers {
15  public:
17 
20 
21  const TrackingRegion& region() const;
22  std::vector<SeedingLayerSet> layerPairs() const;
23 
24  private:
25  const Element* elem_;
27  };
28 
30  public:
31  using internal_iterator_type = std::vector<Element>::const_iterator;
33  using difference_type = internal_iterator_type::difference_type;
34 
37 
40  ++iter_;
41  return *this;
42  }
44  const_iterator clone(*this);
45  ++(*this);
46  return clone;
47  }
48 
49  bool operator==(const const_iterator& other) const { return iter_ == other.iter_; }
50  bool operator!=(const const_iterator& other) const { return !operator==(other); }
51 
52  private:
55  };
56 
65 
66  void reserve(size_t s) { regionLayers_.reserve(s); }
67 
68  // layerSets index points to a layer set within seedingLayerSetsHits_
69  void emplace_back(std::unique_ptr<TrackingRegion>&& region,
70  std::vector<SeedingLayerSetsHits::LayerSetIndex>&& layerSets) {
71  regionLayers_.emplace_back(std::move(region), std::move(layerSets));
72  }
73 
75  std::swap(seedingLayerSetsHits_, other.seedingLayerSetsHits_);
76  regionLayers_.swap(other.regionLayers_);
77  }
78 
80  size_t regionsSize() const { return regionLayers_.size(); }
81 
83  const_iterator cbegin() const { return begin(); }
85  const_iterator cend() const { return end(); }
86 
87 private:
88  class Element {
89  public:
90  Element(std::unique_ptr<TrackingRegion>&& region, std::vector<SeedingLayerSetsHits::LayerSetIndex>&& layerSets)
92  ~Element() = default;
93  Element(Element const&) = delete;
94  Element& operator=(Element const&) = delete;
95  Element(Element&&) = default;
96  Element& operator=(Element&&) = default;
97 
98  const TrackingRegion& region() const { return *region_; }
99  const std::vector<SeedingLayerSetsHits::LayerSetIndex>& layerSets() const { return layerSets_; }
100 
101  private:
102  std::unique_ptr<TrackingRegion> region_;
103  std::vector<SeedingLayerSetsHits::LayerSetIndex> layerSets_;
104  };
105 
107  std::vector<Element> regionLayers_;
108 };
109 
111 
112 inline std::vector<TrackingRegionsSeedingLayerSets::RegionLayers::SeedingLayerSet>
114  std::vector<SeedingLayerSet> ret; // TODO: get rid of the vector with more boilerplate code (sigh)
115 
116  const auto& layerSets = elem_->layerSets();
117  ret.reserve(layerSets.size());
118  for (const auto& ind : layerSets) {
119  ret.push_back((*seedingLayerSetsHits_)[ind]);
120  }
121  return ret;
122 }
123 
124 #endif
runTheMatrix.ret
ret
prodAgent to be discontinued
Definition: runTheMatrix.py:373
TrackingRegionsSeedingLayerSets::TrackingRegionsSeedingLayerSets
TrackingRegionsSeedingLayerSets(const SeedingLayerSetsHits *seedingLayerSetsHits)
Definition: TrackingRegionsSeedingLayerSets.h:58
TrackingRegionsSeedingLayerSets::operator=
TrackingRegionsSeedingLayerSets & operator=(TrackingRegionsSeedingLayerSets const &)=delete
TrackingRegionsSeedingLayerSets::const_iterator::operator++
const_iterator & operator++()
Definition: TrackingRegionsSeedingLayerSets.h:39
TrackingRegionsSeedingLayerSets
Definition: TrackingRegionsSeedingLayerSets.h:10
TrackingRegionsSeedingLayerSets::const_iterator::operator*
value_type operator*() const
Definition: TrackingRegionsSeedingLayerSets.h:38
TrackingRegionsSeedingLayerSets::Element::layerSets_
std::vector< SeedingLayerSetsHits::LayerSetIndex > layerSets_
Definition: TrackingRegionsSeedingLayerSets.h:103
TrackingRegionsSeedingLayerSets::const_iterator::operator!=
bool operator!=(const const_iterator &other) const
Definition: TrackingRegionsSeedingLayerSets.h:50
SeedingLayerSetsHits
Definition: SeedingLayerSetsHits.h:18
TrackingRegionsSeedingLayerSets::const_iterator::difference_type
internal_iterator_type::difference_type difference_type
Definition: TrackingRegionsSeedingLayerSets.h:33
TrackingRegionsSeedingLayerSets::RegionLayers::layerPairs
std::vector< SeedingLayerSet > layerPairs() const
Definition: TrackingRegionsSeedingLayerSets.h:113
TrackingRegionsSeedingLayerSets::const_iterator::const_iterator
const_iterator(internal_iterator_type iter, const SeedingLayerSetsHits *seedingLayerSetsHits)
Definition: TrackingRegionsSeedingLayerSets.h:35
TrackingRegionsSeedingLayerSets::const_iterator::internal_iterator_type
std::vector< Element >::const_iterator internal_iterator_type
Definition: TrackingRegionsSeedingLayerSets.h:31
TrackingRegionsSeedingLayerSets::Element::Element
Element(std::unique_ptr< TrackingRegion > &&region, std::vector< SeedingLayerSetsHits::LayerSetIndex > &&layerSets)
Definition: TrackingRegionsSeedingLayerSets.h:90
TrackingRegionsSeedingLayerSets::RegionLayers::seedingLayerSetsHits_
const SeedingLayerSetsHits * seedingLayerSetsHits_
Definition: TrackingRegionsSeedingLayerSets.h:26
alignCSCRings.s
s
Definition: alignCSCRings.py:92
TrackingRegionsSeedingLayerSets::RegionLayers::elem_
const Element * elem_
Definition: TrackingRegionsSeedingLayerSets.h:25
TrackingRegionsSeedingLayerSets::begin
const_iterator begin() const
Definition: TrackingRegionsSeedingLayerSets.h:82
SeedingLayerSetsHits.h
std::swap
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
Definition: DataFrameContainer.h:209
clone
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135
TrackingRegionsSeedingLayerSets::const_iterator::operator==
bool operator==(const const_iterator &other) const
Definition: TrackingRegionsSeedingLayerSets.h:49
trackingPlots.other
other
Definition: trackingPlots.py:1467
TrackingRegionsSeedingLayerSets::cend
const_iterator cend() const
Definition: TrackingRegionsSeedingLayerSets.h:85
TrackingRegionsSeedingLayerSets::const_iterator::operator++
const_iterator operator++(int)
Definition: TrackingRegionsSeedingLayerSets.h:43
TrackingRegionsSeedingLayerSets::TrackingRegionsSeedingLayerSets
TrackingRegionsSeedingLayerSets()=default
TrackingRegionsSeedingLayerSets::Element
Definition: TrackingRegionsSeedingLayerSets.h:88
TrackingRegionsSeedingLayerSets::RegionLayers::region
const TrackingRegion & region() const
Definition: TrackingRegionsSeedingLayerSets.h:110
TrackingRegionsSeedingLayerSets::regionsSize
size_t regionsSize() const
Definition: TrackingRegionsSeedingLayerSets.h:80
TrackingRegionsSeedingLayerSets::Element::region_
std::unique_ptr< TrackingRegion > region_
Definition: TrackingRegionsSeedingLayerSets.h:102
TrackingRegionsSeedingLayerSets::RegionLayers
Definition: TrackingRegionsSeedingLayerSets.h:14
TrackingRegionsSeedingLayerSets::end
const_iterator end() const
Definition: TrackingRegionsSeedingLayerSets.h:84
HLT_FULL_cff.region
region
Definition: HLT_FULL_cff.py:88272
TrackingRegionsSeedingLayerSets::Element::layerSets
const std::vector< SeedingLayerSetsHits::LayerSetIndex > & layerSets() const
Definition: TrackingRegionsSeedingLayerSets.h:99
TrackingRegionsSeedingLayerSets::RegionLayers::RegionLayers
RegionLayers(const Element *elem, const SeedingLayerSetsHits *seedingLayerSetsHits)
Definition: TrackingRegionsSeedingLayerSets.h:18
TrackingRegionsSeedingLayerSets::Element::~Element
~Element()=default
TrackingRegionsSeedingLayerSets::emplace_back
void emplace_back(std::unique_ptr< TrackingRegion > &&region, std::vector< SeedingLayerSetsHits::LayerSetIndex > &&layerSets)
Definition: TrackingRegionsSeedingLayerSets.h:69
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
TrackingRegionsSeedingLayerSets::const_iterator
Definition: TrackingRegionsSeedingLayerSets.h:29
TrackingRegionsSeedingLayerSets::regionLayers_
std::vector< Element > regionLayers_
Definition: TrackingRegionsSeedingLayerSets.h:107
SeedingLayerSetsHits::SeedingLayerSet
Definition: SeedingLayerSetsHits.h:65
TrackingRegionsSeedingLayerSets::cbegin
const_iterator cbegin() const
Definition: TrackingRegionsSeedingLayerSets.h:83
TrackingRegionsSeedingLayerSets::swap
void swap(TrackingRegionsSeedingLayerSets &other)
Definition: TrackingRegionsSeedingLayerSets.h:74
TrackingRegionsSeedingLayerSets::Element::region
const TrackingRegion & region() const
Definition: TrackingRegionsSeedingLayerSets.h:98
TrackingRegion
Definition: TrackingRegion.h:41
TrackingRegionsSeedingLayerSets::const_iterator::iter_
internal_iterator_type iter_
Definition: TrackingRegionsSeedingLayerSets.h:53
TrackingRegion.h
TrackingRegionsSeedingLayerSets::seedingLayerSetsHits
const SeedingLayerSetsHits & seedingLayerSetsHits() const
Definition: TrackingRegionsSeedingLayerSets.h:79
TrackingRegionsSeedingLayerSets::seedingLayerSetsHits_
const SeedingLayerSetsHits * seedingLayerSetsHits_
Definition: TrackingRegionsSeedingLayerSets.h:106
TrackingRegionsSeedingLayerSets::const_iterator::seedingLayerSetsHits_
const SeedingLayerSetsHits * seedingLayerSetsHits_
Definition: TrackingRegionsSeedingLayerSets.h:54
TrackingRegionsSeedingLayerSets::Element::operator=
Element & operator=(Element const &)=delete
TrackingRegionsSeedingLayerSets::~TrackingRegionsSeedingLayerSets
~TrackingRegionsSeedingLayerSets()=default
TrackingRegionsSeedingLayerSets::reserve
void reserve(size_t s)
Definition: TrackingRegionsSeedingLayerSets.h:66