CMS 3D CMS Logo

StripCompactDigiSimLinks.h
Go to the documentation of this file.
1 #ifndef SimDataFormats_TrackerDigiSimLink_interface_StripCompactDigiSimLinks_h
2 #define SimDataFormats_TrackerDigiSimLink_interface_StripCompactDigiSimLinks_h
3 
4 #include <map>
5 #include <algorithm>
6 #include <vector>
7 #include <boost/range.hpp>
9 #include <cstdint>
10 
12 public:
16 
17  typedef std::pair<EncodedEventId, unsigned int> key_type;
18  struct HitRecord {
19  HitRecord() {}
20  HitRecord(uint32_t detid, uint16_t first, uint16_t size) : detId(detid), firstStrip(first), nStrips(size) {}
21  uint32_t detId;
22  uint16_t firstStrip;
23  uint16_t nStrips;
24  };
25  typedef boost::sub_range<const std::vector<HitRecord> > Links;
26  typedef Links value_type;
27 
29  using std::swap;
30  swap(trackRecords_, other.trackRecords_);
31  swap(hitRecords_, other.hitRecords_);
32  }
33 
34  Links getLinks(const key_type &key) const;
35  Links operator[](const key_type &key) const { return getLinks(key); }
36 
37  class Filler {
38  public:
40 
41  // out of line destructor to avoid code bloat
42  ~Filler();
43 
44  void insert(const key_type &key, const HitRecord &record);
45 
46  typedef std::map<key_type, std::vector<HitRecord> > Map;
47  const Map &storage() const { return storage_; }
48 
49  unsigned int keySize() const { return num_keys_; }
50  unsigned int dataSize() const { return num_values_; }
51 
52  private:
54  unsigned int num_keys_;
55  unsigned int num_values_;
56  };
59 
60  struct TrackRecord {
62  TrackRecord(key_type k, unsigned int offset) : key(k), start(offset) {}
64  unsigned int start; // first index in HitRecord
65  //unsigned int length;
66  inline bool operator<(const TrackRecord &other) const { return key < other.key; }
67  inline bool operator<(const key_type &otherKey) const { return key < otherKey; }
68  inline bool operator==(const key_type &otherKey) const { return key == otherKey; }
69  };
70 
71  struct RevLink {
78  unsigned int simTrackId;
79  uint16_t firstStrip;
80  uint16_t lastStrip;
81  };
82 
84  std::map<uint32_t, std::vector<RevLink> > makeReverseMap() const;
85 
86 private:
89  std::vector<TrackRecord> trackRecords_;
90 
91  std::vector<HitRecord> hitRecords_;
92 };
93 
95 #endif
start
Definition: start.py:1
HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11713
GlobalPosition_Frontier_DevDB_cff.record
record
Definition: GlobalPosition_Frontier_DevDB_cff.py:10
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:222
EncodedEventId
Definition: EncodedEventId.h:11
std::swap
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
Definition: DataFrameContainer.h:209
trackingPlots.other
other
Definition: trackingPlots.py:1460
dqmdumpme.k
k
Definition: dqmdumpme.py:60
b
double b
Definition: hdecay.h:118
first
auto first
Definition: CAHitNtupletGeneratorKernelsImpl.h:112
a
double a
Definition: hdecay.h:119
trigObjTnPSource_cfi.filler
filler
Definition: trigObjTnPSource_cfi.py:21
me0TriggerPseudoDigis_cff.nStrips
nStrips
1.2 is to make the matching window safely the two nearest strips 0.35 is the size of an ME0 chamber i...
Definition: me0TriggerPseudoDigis_cff.py:26
hltrates_dqm_sourceclient-live_cfg.offset
offset
Definition: hltrates_dqm_sourceclient-live_cfg.py:82
crabWrapper.key
key
Definition: crabWrapper.py:19
hit
Definition: SiStripHitEffFromCalibTree.cc:88
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
EncodedEventId.h