CMS 3D CMS Logo

PCrossingFrame.h
Go to the documentation of this file.
1 #ifndef PCROSSING_FRAME_H
2 #define PCROSSING_FRAME_H
3 
15 
16 template <class T>
17 class PCrossingFrame {
18 public:
21 
23 
25 
26  // getters for data members of PCrossingFrame
27  edm::EventID getEventID() const { return Pid_; }
28  const std::vector<T>& getSignals() const { return PCFsignals_; }
29  const std::vector<T>& getPileupRefs() const { return PCFpileups_; }
30  std::vector<const T*> getPileups() const {
31  std::vector<const T*> ret;
32  ret.reserve(PCFpileups_.size());
33  for (const auto& p : PCFpileups_)
34  ret.emplace_back(&p);
35  return ret;
36  }
37  int getBunchSpace() const { return PbunchSpace_; }
38  unsigned int getMaxNbSources() const { return PmaxNbSources_; }
39  std::string getSubDet() const { return PCFsubdet_; }
40  unsigned int getPileupFileNr() const { return PCFpileupFileNr_; }
42  const std::vector<unsigned int>& getPileupOffsetsBcr() const { return PCFpileupOffsetsBcr_; }
43  const std::vector<std::vector<unsigned int> >& getPileupOffsetsSource() const {
45  } //one per source
46  std::pair<int, int> getBunchRange() const { return std::pair<int, int>(firstPCrossing_, lastPCrossing_); }
47 
48 private:
49  unsigned int PmaxNbSources_;
54  std::vector<T> PCFpileups_;
55  std::vector<T> PCFsignals_;
57  unsigned int PCFpileupFileNr_;
59  std::vector<unsigned int> PCFpileupOffsetsBcr_;
60  std::vector<std::vector<unsigned int> > PCFpileupOffsetsSource_;
61 };
62 
63 template <class T>
65  //get data members from CrossingFrame
66  PmaxNbSources_ = cf.getMaxNbSources();
67  PbunchSpace_ = cf.getBunchSpace();
68  Pid_ = cf.getEventID();
69  firstPCrossing_ = cf.getBunchRange().first;
70  lastPCrossing_ = cf.getBunchRange().second;
71 
72  const auto& pileups = cf.getPileups();
73  PCFpileups_.reserve(pileups.size());
74  for (const auto& ptr : pileups) {
75  PCFpileups_.emplace_back(*ptr);
76  }
77  const auto& signal = cf.getSignal();
78  PCFsignals_.reserve(signal.size());
79  for (const auto& ptr : signal) {
80  PCFsignals_.emplace_back(*ptr);
81  }
82 
83  PCFsubdet_ = cf.getSubDet();
84  PCFpileupFileNr_ = cf.getPileupFileNr();
85  PCFidFirstPileup_ = cf.getIdFirstPileup();
86  PCFpileupOffsetsBcr_ = cf.getPileupOffsetsBcr();
87  PCFpileupOffsetsSource_ = cf.getPileupOffsetsSource();
88 }
89 
90 template <typename T>
92  // TODO: reduce copy-paste
93  PmaxNbSources_ = cf.getMaxNbSources();
94  PbunchSpace_ = cf.getBunchSpace();
95  firstPCrossing_ = cf.getBunchRange().first;
96  lastPCrossing_ = cf.getBunchRange().second;
97 
98  PCFpileups_ = cf.getPileupRefs();
99 
100  PCFsubdet_ = cf.getSubDet();
101  PCFpileupFileNr_ = cf.getPileupFileNr();
102  PCFidFirstPileup_ = cf.getIdFirstPileup();
103  PCFpileupOffsetsBcr_ = cf.getPileupOffsetsBcr();
104  PCFpileupOffsetsSource_ = cf.getPileupOffsetsSource();
105 }
106 
107 #endif
runTheMatrix.ret
ret
prodAgent to be discontinued
Definition: runTheMatrix.py:367
CrossingFrame::getPileups
const std::vector< const T * > & getPileups() const
Definition: CrossingFrame.h:90
PCrossingFrame::getBunchSpace
int getBunchSpace() const
Definition: PCrossingFrame.h:37
CrossingFrame::getSubDet
std::string getSubDet() const
Definition: CrossingFrame.h:83
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
CrossingFrame.h
PCrossingFrame
Definition: CrossingFrame.h:28
CrossingFrame::getPileupFileNr
unsigned int getPileupFileNr() const
Definition: CrossingFrame.h:84
PCrossingFrame::lastPCrossing_
int lastPCrossing_
Definition: PCrossingFrame.h:53
PCrossingFrame::PCFpileupOffsetsSource_
std::vector< std::vector< unsigned int > > PCFpileupOffsetsSource_
Definition: PCrossingFrame.h:60
PCrossingFrame::~PCrossingFrame
~PCrossingFrame()
Definition: PCrossingFrame.h:22
PCrossingFrame::getMaxNbSources
unsigned int getMaxNbSources() const
Definition: PCrossingFrame.h:38
PCrossingFrame::getPileupRefs
const std::vector< T > & getPileupRefs() const
Definition: PCrossingFrame.h:29
CrossingFrame
Definition: CrossingFrame.h:38
PCrossingFrame::PmaxNbSources_
unsigned int PmaxNbSources_
Definition: PCrossingFrame.h:49
PCrossingFrame::getEventID
edm::EventID getEventID() const
Definition: PCrossingFrame.h:27
PCrossingFrame::getPileupFileNr
unsigned int getPileupFileNr() const
Definition: PCrossingFrame.h:40
PCrossingFrame::getBunchRange
std::pair< int, int > getBunchRange() const
Definition: PCrossingFrame.h:46
CrossingFrame::getEventID
edm::EventID getEventID() const
Definition: CrossingFrame.h:79
PCrossingFrame::getPileupOffsetsBcr
const std::vector< unsigned int > & getPileupOffsetsBcr() const
Definition: PCrossingFrame.h:42
CrossingFrame::getPileupOffsetsBcr
const std::vector< unsigned int > & getPileupOffsetsBcr() const
Definition: CrossingFrame.h:86
PCrossingFrame::getSignals
const std::vector< T > & getSignals() const
Definition: PCrossingFrame.h:28
PCrossingFrame::setAllExceptSignalFrom
void setAllExceptSignalFrom(const PCrossingFrame< T > &cf)
Definition: PCrossingFrame.h:91
PCrossingFrame::PCFpileupOffsetsBcr_
std::vector< unsigned int > PCFpileupOffsetsBcr_
Definition: PCrossingFrame.h:59
CrossingFrame::getBunchSpace
int getBunchSpace() const
Definition: CrossingFrame.h:81
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
CrossingFrame::getSignal
const std::vector< const T * > & getSignal() const
Definition: CrossingFrame.h:91
CrossingFrame::getMaxNbSources
unsigned int getMaxNbSources() const
Definition: CrossingFrame.h:82
PCrossingFrame::PCFpileupFileNr_
unsigned int PCFpileupFileNr_
Definition: PCrossingFrame.h:57
PCrossingFrame::firstPCrossing_
int firstPCrossing_
Definition: PCrossingFrame.h:52
PCrossingFrame::getSubDet
std::string getSubDet() const
Definition: PCrossingFrame.h:39
PCrossingFrame::PCFsignals_
std::vector< T > PCFsignals_
Definition: PCrossingFrame.h:55
PCrossingFrame::Pid_
edm::EventID Pid_
Definition: PCrossingFrame.h:51
PCrossingFrame::PCFsubdet_
std::string PCFsubdet_
Definition: PCrossingFrame.h:56
PCrossingFrame::getIdFirstPileup
edm::EventID getIdFirstPileup() const
Definition: PCrossingFrame.h:41
PCrossingFrame::getPileups
std::vector< const T * > getPileups() const
Definition: PCrossingFrame.h:30
PCrossingFrame::PbunchSpace_
int PbunchSpace_
Definition: PCrossingFrame.h:50
CrossingFrame::getBunchRange
std::pair< int, int > getBunchRange() const
Definition: CrossingFrame.h:80
pileupDistInMC.pileups
pileups
Definition: pileupDistInMC.py:59
PCrossingFrame::PCrossingFrame
PCrossingFrame()
Definition: PCrossingFrame.h:19
CrossingFrame::getIdFirstPileup
edm::EventID getIdFirstPileup() const
Definition: CrossingFrame.h:85
PCrossingFrame::PCFpileups_
std::vector< T > PCFpileups_
Definition: PCrossingFrame.h:54
edm::EventID
Definition: EventID.h:31
PCrossingFrame::PCFidFirstPileup_
edm::EventID PCFidFirstPileup_
Definition: PCrossingFrame.h:58
PCrossingFrame::getPileupOffsetsSource
const std::vector< std::vector< unsigned int > > & getPileupOffsetsSource() const
Definition: PCrossingFrame.h:43
CrossingFrame::getPileupOffsetsSource
const std::vector< std::vector< unsigned int > > & getPileupOffsetsSource() const
Definition: CrossingFrame.h:87