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 <boost/range.hpp>
8 #include <cstdint>
9 
11 public:
15 
16  typedef std::pair<EncodedEventId, unsigned int> key_type;
17  struct HitRecord {
18  HitRecord() {}
19  HitRecord(uint32_t detid, uint16_t first, uint16_t size) : detId(detid), firstStrip(first), nStrips(size) {}
20  uint32_t detId;
21  uint16_t firstStrip;
22  uint16_t nStrips;
23  };
24  typedef boost::sub_range<const std::vector<HitRecord> > Links;
25  typedef Links value_type;
26 
28  using std::swap;
29  swap(trackRecords_, other.trackRecords_);
30  swap(hitRecords_, other.hitRecords_);
31  }
32 
33  Links getLinks(const key_type &key) const;
34  Links operator[](const key_type &key) const { return getLinks(key); }
35 
36  class Filler {
37  public:
39 
40  // out of line destructor to avoid code bloat
41  ~Filler();
42 
43  void insert(const key_type &key, const HitRecord &record);
44 
45  typedef std::map<key_type, std::vector<HitRecord> > Map;
46  const Map &storage() const { return storage_; }
47 
48  unsigned int keySize() const { return num_keys_; }
49  unsigned int dataSize() const { return num_values_; }
50 
51  private:
53  unsigned int num_keys_;
54  unsigned int num_values_;
55  };
58 
59  struct TrackRecord {
61  TrackRecord(key_type k, unsigned int offset) : key(k), start(offset) {}
63  unsigned int start; // first index in HitRecord
64  //unsigned int length;
65  inline bool operator<(const TrackRecord &other) const { return key < other.key; }
66  inline bool operator<(const key_type &otherKey) const { return key < otherKey; }
67  inline bool operator==(const key_type &otherKey) const { return key == otherKey; }
68  };
69 
70  struct RevLink {
77  unsigned int simTrackId;
78  uint16_t firstStrip;
79  uint16_t lastStrip;
80  };
81 
83  std::map<uint32_t, std::vector<RevLink> > makeReverseMap() const;
84 
85 private:
88  std::vector<TrackRecord> trackRecords_;
89 
90  std::vector<HitRecord> hitRecords_;
91 };
92 
94 #endif
start
Definition: start.py:1
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:215
dqmdumpme.first
first
Definition: dqmdumpme.py:55
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:1465
dqmdumpme.k
k
Definition: dqmdumpme.py:60
b
double b
Definition: hdecay.h:118
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
HLT_2018_cff.track
track
Definition: HLT_2018_cff.py:10352
hltrates_dqm_sourceclient-live_cfg.offset
offset
Definition: hltrates_dqm_sourceclient-live_cfg.py:78
crabWrapper.key
key
Definition: crabWrapper.py:19
hit
Definition: SiStripHitEffFromCalibTree.cc:88
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
EncodedEventId.h