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 
19 #include <iterator>
20 #include <vector>
21 #include <utility>
22 
24 public:
25  // con- and destructors
26 
28  CrossingFramePlaybackInfoNew(int minBunch, int maxBunch, unsigned int maxNbSources);
29 
31 
32  typedef std::vector<edm::SecondaryEventIDAndFileInfo>::iterator iterator;
33  typedef std::pair<iterator, iterator> range;
34 
35  // setter
36  void setInfo(std::vector<edm::SecondaryEventIDAndFileInfo>& eventInfo, std::vector<size_t>& sizes) {
37  sizes_.swap(sizes);
38  eventInfo_.swap(eventInfo);
39  }
40 
41  // getters
42  std::vector<edm::SecondaryEventIDAndFileInfo>::const_iterator getEventId(size_t offset) const {
43  std::vector<edm::SecondaryEventIDAndFileInfo>::const_iterator iter = eventInfo_.begin();
44  std::advance(iter, offset);
45  return iter;
46  }
47 
48  size_t getNumberOfEvents(int bunchIdx, size_t sourceNumber) const {
49  return sizes_[((bunchIdx - minBunch_) * maxNbSources_) + sourceNumber];
50  }
51 
52  //private:
53 
54  // we need the same info for each bunchcrossing
55  unsigned int maxNbSources_;
57  std::vector<size_t> sizes_;
58  std::vector<edm::SecondaryEventIDAndFileInfo> eventInfo_;
59  int minBunch_;
60 };
61 
62 #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_