CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
CrossingFramePlaybackInfoNew.h
Go to the documentation of this file.
1 #ifndef CROSSING_FRAME_PLAYBACKINFONEW_H
2 #define CROSSING_FRAME_PLAYBACKINFONEW_H
3 
18 #include <iterator>
19 #include <vector>
20 #include <utility>
21 
23 public:
24  // con- and destructors
25 
27  CrossingFramePlaybackInfoNew(int minBunch, int maxBunch, unsigned int maxNbSources);
28 
30 
31  typedef std::vector<edm::SecondaryEventIDAndFileInfo>::iterator iterator;
32  typedef std::pair<iterator, iterator> range;
33 
34  // setter
35  void setInfo(std::vector<edm::SecondaryEventIDAndFileInfo>& eventInfo, std::vector<size_t>& sizes) {
36  sizes_.swap(sizes);
37  eventInfo_.swap(eventInfo);
38  }
39 
40  // getters
41  std::vector<edm::SecondaryEventIDAndFileInfo>::const_iterator getEventId(size_t offset) const {
42  std::vector<edm::SecondaryEventIDAndFileInfo>::const_iterator iter = eventInfo_.begin();
43  std::advance(iter, offset);
44  return iter;
45  }
46 
47  size_t getNumberOfEvents(int bunchIdx, size_t sourceNumber) const {
48  return sizes_[((bunchIdx - minBunch_) * maxNbSources_) + sourceNumber];
49  }
50 
51  //private:
52 
53  // we need the same info for each bunchcrossing
54  unsigned int maxNbSources_;
56  std::vector<size_t> sizes_;
57  std::vector<edm::SecondaryEventIDAndFileInfo> eventInfo_;
58  int minBunch_;
59 };
60 
61 #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
std::vector< edm::SecondaryEventIDAndFileInfo > eventInfo_