|
|
Go to the documentation of this file. 1 #ifndef CROSSING_FRAME_H
2 #define CROSSING_FRAME_H
93 typename std::vector<const T*>::const_iterator&
last)
const {
98 typename std::vector<const T*>::const_iterator&
last)
const;
116 throw cms::Exception(
"BadIndex") <<
"CrossingFrame::getObject called with an invalid index- index was " << ip
162 std::vector<std::shared_ptr<edm::Wrapper<std::vector<T> >
const> >
shPtrPileups_;
181 : firstCrossing_(minb), lastCrossing_(maxb), bunchSpace_(bunchsp), subdet_(subdet), maxNbSources_(maxNbSources) {
190 template <
typename T>
195 subdet_.swap(
other.subdet_);
200 signals_.swap(
other.signals_);
201 pileups_.swap(
other.pileups_);
202 shPtrPileups_.swap(
other.shPtrPileups_);
203 shPtrPileups2_.swap(
other.shPtrPileups2_);
204 shPtrPileupsPCF_.swap(
other.shPtrPileupsPCF_);
205 pileupOffsetsBcr_.swap(
other.pileupOffsetsBcr_);
206 pileupOffsetsSource_.resize(maxNbSources_);
207 for (
unsigned int i = 0;
i < pileupOffsetsSource_.size(); ++
i) {
208 pileupOffsetsSource_[
i].swap(
other.pileupOffsetsSource_[
i]);
212 template <
typename T>
221 typename std::vector<const T*>::const_iterator&
last)
const {
222 first = pileups_.begin();
223 last = pileups_.end();
234 unsigned int bcr = getBunchCrossing(ip) - firstCrossing_;
235 for (
unsigned int i = 0;
i < pileupOffsetsSource_.size() - 1; ++
i) {
236 if (ip >= (pileupOffsetsSource_[
i])[bcr] && ip < (pileupOffsetsSource_[
i + 1])[bcr])
239 return pileupOffsetsSource_.size() - 1;
245 for (
unsigned int ii = 1;
ii < pileupOffsetsBcr_.size();
ii++) {
246 if (ip >= pileupOffsetsBcr_[
ii - 1] && ip < pileupOffsetsBcr_[
ii])
247 return ii + firstCrossing_ - 1;
249 if (ip < pileups_.size())
250 return lastCrossing_;
256 template <
typename T>
267 o <<
"\nCrossingFrame for subdet " << cf.
getEventID() <<
", bunchrange = " <<
range.first <<
"," <<
range.second
276 shPtrPileupsPCF_ = shPtr;
282 pileups_.push_back(&product);
288 for (
auto const&
item : product) {
289 pileups_.push_back(&
item);
298 for (
unsigned int i = 0;
i < vec->size(); ++
i) {
299 signals_.push_back(&((*vec)[
i]));
307 signals_.push_back(product);
const std::vector< const T * > & getPileups() const
unsigned int maxNbSources_
void addPileups(std::vector< T > const &vec)
std::string getSubDet() const
edm::EventID idFirstPileup_
void print(int level=0) const
void setBunchRange(std::pair< int, int > bunchRange)
void addSignals(const std::vector< T > *vec, edm::EventID id)
void setPileups(const std::vector< const T * > &p)
void setMaxNbSources(unsigned int mNbS)
unsigned int getPileupFileNr() const
int getSourceType(unsigned int ip) const
void setPileupOffsetsSource(const std::vector< std::vector< unsigned int > > &pOffsetsS)
void setSubDet(std::string det)
void setIdFirstPileup(edm::EventID idFP)
unsigned int getNrSignals() const
void setEventID(edm::EventID evId)
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
std::vector< std::shared_ptr< edm::Wrapper< T > const > > shPtrPileups2_
void setSourceOffset(const unsigned int s)
unsigned int getNrPileups(int bcr) const
edm::EventID getEventID() const
const std::vector< unsigned int > & getPileupOffsetsBcr() const
void getSignal(typename std::vector< const T * >::const_iterator &first, typename std::vector< const T * >::const_iterator &last) const
int getBunchSpace() const
void setPileupPtr(std::shared_ptr< edm::Wrapper< std::vector< T > > const > shPtr)
const std::vector< const T * > & getSignal() const
void setPileupFileNr(unsigned int pFileNr)
unsigned int getMaxNbSources() const
int getBunchCrossing(unsigned int ip) const
std::vector< std::vector< unsigned int > > pileupOffsetsSource_
std::vector< std::shared_ptr< edm::Wrapper< std::vector< T > > const > > shPtrPileups_
const T & getObject(unsigned int ip) const
std::shared_ptr< edm::Wrapper< PCrossingFrame< T > > const > shPtrPileupsPCF_
void setBunchSpace(int bSpace)
std::vector< const T * > signals_
void swap(CrossingFrame< T > &lhs, CrossingFrame< T > &rhs)
unsigned int getNrPileups() const
void setPileupOffsetsBcr(const std::vector< unsigned int > &pOffsetsBcr)
void setPileupPtr(std::shared_ptr< edm::Wrapper< T > const > shPtr)
std::pair< int, int > getBunchRange() const
unsigned int pileupFileNr_
std::vector< const T * > pileups_
std::ostream & operator<<(std::ostream &o, const CrossingFrame< T > &cf)
void swap(CrossingFrame &other)
edm::EventID getIdFirstPileup() const
CrossingFrame & operator=(CrossingFrame const &rhs)
std::vector< unsigned int > pileupOffsetsBcr_
const std::vector< std::vector< unsigned int > > & getPileupOffsetsSource() const