CMS 3D CMS Logo

CrossingFramePlaybackInfoNew.h
Go to the documentation of this file.
1 #ifndef CROSSING_FRAME_PLAYBACKINFONEW_H
2 #define CROSSING_FRAME_PLAYBACKINFONEW_H
3 
20 #include <iterator>
21 #include <vector>
22 #include <utility>
23 
25 {
26 
27  public:
28  // con- and destructors
29 
31  CrossingFramePlaybackInfoNew(int minBunch, int maxBunch, unsigned int maxNbSources);
32 
34 
35  typedef std::vector<edm::SecondaryEventIDAndFileInfo>::iterator iterator;
36  typedef std::pair<iterator, iterator> range;
37 
38  // setter
39  void setInfo(std::vector<edm::SecondaryEventIDAndFileInfo>& eventInfo, std::vector<size_t>& sizes) {
40  sizes_.swap(sizes);
41  eventInfo_.swap(eventInfo);
42  }
43 
44  // getters
45  std::vector<edm::SecondaryEventIDAndFileInfo>::const_iterator getEventId(size_t offset) const {
46  std::vector<edm::SecondaryEventIDAndFileInfo>::const_iterator iter = eventInfo_.begin();
47  std::advance(iter, offset);
48  return iter;
49  }
50 
51  size_t getNumberOfEvents(int bunchIdx, size_t sourceNumber) const {
52  return sizes_[((bunchIdx - minBunch_) * maxNbSources_) + sourceNumber];
53  }
54 
55  //private:
56 
57  // we need the same info for each bunchcrossing
58  unsigned int maxNbSources_;
60  std::vector<size_t> sizes_;
61  std::vector<edm::SecondaryEventIDAndFileInfo> eventInfo_;
62  int minBunch_;
63 };
64 
65 
66 #endif
void setInfo(std::vector< edm::SecondaryEventIDAndFileInfo > &eventInfo, std::vector< size_t > &sizes)
std::vector< edm::SecondaryEventIDAndFileInfo >::const_iterator getEventId(size_t offset) const
std::pair< iterator, iterator > range
size_t getNumberOfEvents(int bunchIdx, size_t sourceNumber) const
std::vector< edm::SecondaryEventIDAndFileInfo >::iterator iterator
eventInfo
add run, event number and lumi section
std::vector< edm::SecondaryEventIDAndFileInfo > eventInfo_