CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC2_patch1/src/SimDataFormats/CrossingFrame/interface/CrossingFramePlaybackInfo.h

Go to the documentation of this file.
00001 #ifndef CROSSING_FRAME_PLAYBACKINFO_H
00002 #define CROSSING_FRAME_PLAYBACKINFO_H
00003 
00017 #include "DataFormats/Provenance/interface/EventID.h"
00018 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00019 #include <vector>
00020 
00021 class CrossingFramePlaybackInfo 
00022 { 
00023 
00024  public:
00025   // con- and destructors
00026 
00027   CrossingFramePlaybackInfo() {;}
00028   CrossingFramePlaybackInfo(int minBunch, int maxBunch, unsigned int maxNbSources);
00029 
00030   ~CrossingFramePlaybackInfo() {;}
00031 
00032   // getters 
00033   int getStartFileNr(const unsigned int s,const int bcr) const {return (pileupFileNr_[s])[bcr-minBunch_];}
00034   edm::EventID getStartEventId(const unsigned int s,const int bcr) const {return (idFirstPileup_[s])[bcr-minBunch_];}
00035   int getNrEvents(const unsigned int s,const int bcr) const {return (nrEvents_[s])[bcr-minBunch_];}
00036 
00037   void getEventStartInfo(std::vector<edm::EventID> &ids, std::vector<int> &  fileNrs, std::vector<unsigned int> &nrEvents, const unsigned int s) const {
00038     ids=idFirstPileup_[s];
00039     fileNrs= pileupFileNr_[s];
00040     nrEvents=nrEvents_[s];
00041   }
00042 
00043   // setters 
00044   //FIXME: max nr sources, test on max nrsources
00045   void setStartFileNr(const  unsigned int nr, const unsigned int s,const int bcr) {pileupFileNr_[s][bcr-minBunch_]=nr;}
00046   void setStartEventId( const edm::EventID &id, const unsigned int s, const int bcr) {idFirstPileup_[s][bcr-minBunch_]=id;}
00047   void setNrEvents(const  unsigned int nr, const unsigned int s, const int bcr) {nrEvents_[s][bcr-minBunch_]=nr;}
00048   void setEventStartInfo(std::vector<edm::EventID> &id, std::vector<int>& fileNr, std::vector<unsigned int>& nrEvents, const unsigned int s);
00049 
00050  private:
00051 
00052   // we need the same info for each bunchcrossing
00053   unsigned int maxNbSources_;
00054   std::vector<std::vector<edm::EventID> > idFirstPileup_;   // EventId fof the first pileup event used for this signal event
00055   std::vector<std::vector<int> > pileupFileNr_;             // ordinal number of the pileup file this event was in
00056   std::vector<std::vector<unsigned int> > nrEvents_;
00057 
00058   int nBcrossings_;
00059   int minBunch_;
00060 
00061 };
00062 
00063 
00064 #endif