1 #ifndef CROSSING_FRAME_H
2 #define CROSSING_FRAME_H
30 #include "boost/shared_ptr.hpp"
100 void getSignal(
typename std::vector<const T *>::const_iterator &
first,
typename std::vector<const T*>::const_iterator &
last)
const {
104 void getPileups(
typename std::vector<const T*>::const_iterator &
first,
typename std::vector<const T*>::const_iterator &
last)
const;
162 std::vector< boost::shared_ptr<edm::Wrapper<std::vector<T> >
const> >
shPtrPileups_;
182 maxNbSources):firstCrossing_(minb), lastCrossing_(maxb),
183 bunchSpace_(bunchsp),subdet_(subdet),maxNbSources_(maxNbSources) {
192 template <
typename T>
210 pileupOffsetsSource_.resize(maxNbSources_);
211 for (
unsigned int i=0;
i<pileupOffsetsSource_.size();++
i) {
216 template <
typename T>
228 first=pileups_.begin();
241 unsigned int bcr= getBunchCrossing(ip)-firstCrossing_;
242 for (
unsigned int i=0;
i<pileupOffsetsSource_.size()-1;++
i) {
243 if (ip>=(pileupOffsetsSource_[
i])[bcr] && ip <(pileupOffsetsSource_[i+1])[bcr])
return i;
245 return pileupOffsetsSource_.size()-1;
251 for (
unsigned int ii=1;
ii<pileupOffsetsBcr_.size();
ii++){
252 if (ip>=pileupOffsetsBcr_[
ii-1] && ip<pileupOffsetsBcr_[
ii])
return ii+firstCrossing_-1;
254 if (ip<pileups_.size())
return lastCrossing_;
259 template <
typename T>
270 std::ostream &operator<<(std::ostream& o, const CrossingFrame<T>& cf)
272 std::pair<int,int> range=cf.getBunchRange();
273 o <<
"\nCrossingFrame for subdet "<<cf.getEventID()<<
", bunchrange = "<<range.first<<
","<<range.second
274 <<
", bunchSpace "<<cf.getBunchSpace();
287 pileups_.push_back(&product);
293 for (
auto const& item : product) {
294 pileups_.push_back(&item);
303 for (
unsigned int i=0;
i<vec->size();++
i) {
304 signals_.push_back(&((*vec)[
i]));
312 signals_.push_back(product);
void swap(ora::Record &rh, ora::Record &lh)
void addSignals(const std::vector< T > *vec, edm::EventID id)
void addPileups(std::vector< T > const &vec)
void setEventID(edm::EventID evId)
std::pair< int, int > getBunchRange() const
void print(int level=0) const
unsigned int getMaxNbSources() const
void setPileups(const std::vector< const T * > &p)
unsigned int getNrPileups(int bcr) const
int getSourceType(unsigned int ip) const
void setMaxNbSources(unsigned int mNbS)
void setPileupFileNr(unsigned int pFileNr)
void setIdFirstPileup(edm::EventID idFP)
std::vector< std::vector< unsigned int > > getPileupOffsetsSource() const
std::vector< const T * > signals_
void setSubDet(std::string det)
unsigned int maxNbSources_
std::string getSubDet() const
edm::EventID getEventID() const
const T & getObject(unsigned int ip) const
std::vector< const T * > getSignal() const
edm::EventID idFirstPileup_
void setBunchRange(std::pair< int, int > bunchRange)
std::vector< unsigned int > pileupOffsetsBcr_
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
std::vector< const T * > getPileups() const
void setPileupOffsetsBcr(const std::vector< unsigned int > &pOffsetsBcr)
void setBunchSpace(int bSpace)
int getBunchCrossing(unsigned int ip) const
void setPileupOffsetsSource(const std::vector< std::vector< unsigned int > > &pOffsetsS)
std::vector< boost::shared_ptr< edm::Wrapper< std::vector< T > > const > > shPtrPileups_
unsigned int getPileupFileNr() const
void setPileupPtr(boost::shared_ptr< edm::Wrapper< std::vector< T > > const > shPtr)
boost::shared_ptr< edm::Wrapper< PCrossingFrame< T > > const > shPtrPileupsPCF_
std::vector< std::vector< unsigned int > > pileupOffsetsSource_
void setPileupPtr(boost::shared_ptr< edm::Wrapper< T > const > shPtr)
std::vector< boost::shared_ptr< edm::Wrapper< T > const > > shPtrPileups2_
std::vector< const T * > pileups_
void swap(CrossingFrame &other)
std::vector< unsigned int > getPileupOffsetsBcr() const
unsigned int getNrSignals() const
unsigned int pileupFileNr_
edm::EventID getIdFirstPileup() const
void setSourceOffset(const unsigned int s)
void getSignal(typename std::vector< const T * >::const_iterator &first, typename std::vector< const T * >::const_iterator &last) const
CrossingFrame & operator=(CrossingFrame const &rhs)
int getBunchSpace() const
unsigned int getNrPileups() const