#include <CrossingFrame.h>
Public Member Functions | |
void | addPileups (std::vector< T > const &vec) |
void | addPileups (T const &product) |
void | addSignals (const std::vector< T > *vec, edm::EventID id) |
void | addSignals (const T *vec, edm::EventID id) |
CrossingFrame (int minb, int maxb, int bunchsp, std::string subdet, unsigned int maxNbSources) | |
CrossingFrame () | |
int | getBunchCrossing (unsigned int ip) const |
std::pair< int, int > | getBunchRange () const |
int | getBunchSpace () const |
edm::EventID | getEventID () const |
edm::EventID | getIdFirstPileup () const |
unsigned int | getMaxNbSources () const |
unsigned int | getNrPileups (int bcr) const |
unsigned int | getNrPileups () const |
unsigned int | getNrSignals () const |
const T & | getObject (unsigned int ip) const |
unsigned int | getPileupFileNr () const |
std::vector< unsigned int > | getPileupOffsetsBcr () const |
std::vector< std::vector < unsigned int > > | getPileupOffsetsSource () const |
std::vector< const T * > | getPileups () const |
void | getPileups (typename std::vector< const T * >::const_iterator &first, typename std::vector< const T * >::const_iterator &last) const |
std::vector< const T * > | getSignal () const |
void | getSignal (typename std::vector< const T * >::const_iterator &first, typename std::vector< const T * >::const_iterator &last) const |
int | getSourceType (unsigned int ip) const |
std::string | getSubDet () const |
CrossingFrame & | operator= (CrossingFrame const &rhs) |
void | print (int level=0) const |
void | setBcrOffset () |
void | setBunchRange (std::pair< int, int > bunchRange) |
void | setBunchSpace (int bSpace) |
void | setEventID (edm::EventID evId) |
void | setIdFirstPileup (edm::EventID idFP) |
void | setMaxNbSources (unsigned int mNbS) |
void | setPileupFileNr (unsigned int pFileNr) |
void | setPileupOffsetsBcr (std::vector< unsigned int > pOffsetsBcr) |
void | setPileupOffsetsSource (std::vector< std::vector< unsigned int > > pOffsetsS) |
void | setPileupPtr (boost::shared_ptr< edm::Wrapper< std::vector< T > > const > shPtr) |
void | setPileupPtr (boost::shared_ptr< edm::Wrapper< T > const > shPtr) |
void | setPileupPtr (boost::shared_ptr< edm::Wrapper< PCrossingFrame< T > > const > shPtr) |
void | setPileups (std::vector< const T * > p) |
void | setSourceOffset (const unsigned int s) |
void | setSubDet (std::string det) |
void | setTof () |
void | swap (CrossingFrame &other) |
~CrossingFrame () | |
Private Attributes | |
int | bunchSpace_ |
int | firstCrossing_ |
edm::EventID | id_ |
edm::EventID | idFirstPileup_ |
int | lastCrossing_ |
unsigned int | maxNbSources_ |
unsigned int | pileupFileNr_ |
std::vector< unsigned int > | pileupOffsetsBcr_ |
std::vector< std::vector < unsigned int > > | pileupOffsetsSource_ |
std::vector< const T * > | pileups_ |
std::vector< boost::shared_ptr < edm::Wrapper< T > const > > | shPtrPileups2_ |
std::vector< boost::shared_ptr < edm::Wrapper< std::vector< T > > const > > | shPtrPileups_ |
boost::shared_ptr < edm::Wrapper< PCrossingFrame < T > > const > | shPtrPileupsPCF_ |
std::vector< const T * > | signals_ |
std::string | subdet_ |
CrossingFrame is the result of the Sim Mixing Module
Definition at line 39 of file CrossingFrame.h.
CrossingFrame< T >::CrossingFrame | ( | ) | [inline] |
Definition at line 45 of file CrossingFrame.h.
: firstCrossing_(0), lastCrossing_(0), bunchSpace_(75),subdet_(""),maxNbSources_(0) { }
CrossingFrame< T >::CrossingFrame | ( | int | minb, |
int | maxb, | ||
int | bunchsp, | ||
std::string | subdet, | ||
unsigned int | maxNbSources | ||
) |
Definition at line 181 of file CrossingFrame.h.
References CrossingFrame< T >::firstCrossing_, i, CrossingFrame< T >::lastCrossing_, CrossingFrame< T >::maxNbSources_, CrossingFrame< T >::pileupOffsetsBcr_, and CrossingFrame< T >::pileupOffsetsSource_.
:firstCrossing_(minb), lastCrossing_(maxb), bunchSpace_(bunchsp),subdet_(subdet),maxNbSources_(maxNbSources) { pileupOffsetsSource_.resize(maxNbSources_); for (unsigned int i=0;i<maxNbSources_;++i) pileupOffsetsSource_[i].reserve(-firstCrossing_+lastCrossing_+1); //FIXME: should we force around 0 or so?? pileupOffsetsBcr_.reserve(-firstCrossing_+lastCrossing_+1); }
CrossingFrame< T >::~CrossingFrame | ( | ) | [inline] |
Definition at line 49 of file CrossingFrame.h.
{;}
void CrossingFrame< T >::addPileups | ( | std::vector< T > const & | vec | ) |
Definition at line 292 of file CrossingFrame.h.
{ for (auto const& item : product) { pileups_.push_back(&item); } }
void CrossingFrame< T >::addPileups | ( | T const & | product | ) |
Definition at line 285 of file CrossingFrame.h.
{ // default, valid for HepMCProduct pileups_.push_back(&product); }
void CrossingFrame< T >::addSignals | ( | const std::vector< T > * | vec, |
edm::EventID | id | ||
) |
void CrossingFrame< T >::addSignals | ( | const T * | vec, |
edm::EventID | id | ||
) |
Definition at line 309 of file CrossingFrame.h.
int CrossingFrame< T >::getBunchCrossing | ( | unsigned int | ip | ) | const |
Definition at line 249 of file CrossingFrame.h.
References cuy::ii.
{ // return the bcr for a certain position in the pileup vector for (unsigned int ii=1;ii<pileupOffsetsBcr_.size();ii++){ if (ip>=pileupOffsetsBcr_[ii-1] && ip<pileupOffsetsBcr_[ii]) return ii+firstCrossing_-1; } if (ip<pileups_.size()) return lastCrossing_; else return 999; }
std::pair<int,int> CrossingFrame< T >::getBunchRange | ( | ) | const [inline] |
Definition at line 88 of file CrossingFrame.h.
References CrossingFrame< T >::firstCrossing_, and CrossingFrame< T >::lastCrossing_.
Referenced by PCrossingFrame< T >::PCrossingFrame().
{return std::pair<int,int>(firstCrossing_,lastCrossing_);}
int CrossingFrame< T >::getBunchSpace | ( | ) | const [inline] |
Definition at line 89 of file CrossingFrame.h.
References CrossingFrame< T >::bunchSpace_.
Referenced by PCrossingFrame< T >::PCrossingFrame().
{return bunchSpace_;}
edm::EventID CrossingFrame< T >::getEventID | ( | ) | const [inline] |
Definition at line 87 of file CrossingFrame.h.
References CrossingFrame< T >::id_.
Referenced by PCrossingFrame< T >::PCrossingFrame().
{return id_;}
edm::EventID CrossingFrame< T >::getIdFirstPileup | ( | ) | const [inline] |
Definition at line 93 of file CrossingFrame.h.
References CrossingFrame< T >::idFirstPileup_.
Referenced by PCrossingFrame< T >::PCrossingFrame().
{return idFirstPileup_;}
unsigned int CrossingFrame< T >::getMaxNbSources | ( | ) | const [inline] |
Definition at line 90 of file CrossingFrame.h.
References CrossingFrame< T >::maxNbSources_.
Referenced by PCrossingFrame< T >::PCrossingFrame().
{return maxNbSources_; }
unsigned int CrossingFrame< T >::getNrPileups | ( | ) | const [inline] |
Definition at line 106 of file CrossingFrame.h.
References CrossingFrame< T >::pileups_.
Referenced by CrossingFrame< T >::getObject().
{return pileups_.size();}
unsigned int CrossingFrame< T >::getNrPileups | ( | int | bcr | ) | const [inline] |
Definition at line 107 of file CrossingFrame.h.
References CrossingFrame< T >::firstCrossing_, CrossingFrame< T >::lastCrossing_, CrossingFrame< T >::pileupOffsetsBcr_, and CrossingFrame< T >::pileups_.
{ return bcr==lastCrossing_ ? pileups_.size()-pileupOffsetsBcr_[lastCrossing_-firstCrossing_] :pileupOffsetsBcr_[bcr-firstCrossing_+1]- pileupOffsetsBcr_[bcr-firstCrossing_];}
unsigned int CrossingFrame< T >::getNrSignals | ( | ) | const [inline] |
Definition at line 105 of file CrossingFrame.h.
References CrossingFrame< T >::signals_.
Referenced by CrossingFrame< T >::getObject().
{return signals_.size();}
const T& CrossingFrame< T >::getObject | ( | unsigned int | ip | ) | const [inline] |
Definition at line 117 of file CrossingFrame.h.
References Exception, CrossingFrame< T >::getNrPileups(), CrossingFrame< T >::getNrSignals(), CrossingFrame< T >::pileups_, and CrossingFrame< T >::signals_.
{ //ip is position in the MixCollection (i.e. signal + pileup) if (ip>getNrSignals()+getNrPileups()) throw cms::Exception("BadIndex")<<"CrossingFrame::getObject called with an invalid index- index was "<<ip<<"!"; // ip >=0, since ip is unsigned if (ip<getNrSignals()) { return *(signals_[ip]); } else { return *(pileups_[ip-getNrSignals()]); } }
unsigned int CrossingFrame< T >::getPileupFileNr | ( | ) | const [inline] |
Definition at line 92 of file CrossingFrame.h.
References CrossingFrame< T >::pileupFileNr_.
Referenced by PCrossingFrame< T >::PCrossingFrame().
{return pileupFileNr_;}
std::vector<unsigned int> CrossingFrame< T >::getPileupOffsetsBcr | ( | ) | const [inline] |
Definition at line 94 of file CrossingFrame.h.
References CrossingFrame< T >::pileupOffsetsBcr_.
Referenced by PCrossingFrame< T >::PCrossingFrame().
{return pileupOffsetsBcr_;}
std::vector< std::vector<unsigned int> > CrossingFrame< T >::getPileupOffsetsSource | ( | ) | const [inline] |
Definition at line 95 of file CrossingFrame.h.
References CrossingFrame< T >::pileupOffsetsSource_.
Referenced by PCrossingFrame< T >::PCrossingFrame().
{return pileupOffsetsSource_;} //one per source
std::vector<const T *> CrossingFrame< T >::getPileups | ( | ) | const [inline] |
Definition at line 96 of file CrossingFrame.h.
References CrossingFrame< T >::pileups_.
Referenced by PCrossingFrame< T >::PCrossingFrame().
{return pileups_;}
void CrossingFrame< T >::getPileups | ( | typename std::vector< const T * >::const_iterator & | first, |
typename std::vector< const T * >::const_iterator & | last | ||
) | const |
void CrossingFrame< T >::getSignal | ( | typename std::vector< const T * >::const_iterator & | first, |
typename std::vector< const T * >::const_iterator & | last | ||
) | const [inline] |
Definition at line 100 of file CrossingFrame.h.
References CrossingFrame< T >::signals_.
std::vector<const T *> CrossingFrame< T >::getSignal | ( | ) | const [inline] |
Definition at line 97 of file CrossingFrame.h.
References CrossingFrame< T >::signals_.
Referenced by PCrossingFrame< T >::PCrossingFrame().
{return signals_;}
int CrossingFrame< T >::getSourceType | ( | unsigned int | ip | ) | const |
Definition at line 237 of file CrossingFrame.h.
References i.
{ // ip is position in the pileup vector // decide to which source belongs object with index ip in the pileup vector // pileup=0, cosmics=1, beam halo+ =2, beam halo- =3 forward =4 unsigned int bcr= getBunchCrossing(ip)-firstCrossing_; //starts at 0 for (unsigned int i=0;i<pileupOffsetsSource_.size()-1;++i) { if (ip>=(pileupOffsetsSource_[i])[bcr] && ip <(pileupOffsetsSource_[i+1])[bcr]) return i; } return pileupOffsetsSource_.size()-1; }
std::string CrossingFrame< T >::getSubDet | ( | ) | const [inline] |
Definition at line 91 of file CrossingFrame.h.
References CrossingFrame< T >::subdet_.
Referenced by PCrossingFrame< T >::PCrossingFrame().
{ return subdet_;}
CrossingFrame& CrossingFrame< T >::operator= | ( | CrossingFrame< T > const & | rhs | ) |
void CrossingFrame< T >::print | ( | int | level = 0 | ) | const |
Definition at line 233 of file CrossingFrame.h.
{ }
void CrossingFrame< T >::setBcrOffset | ( | ) | [inline] |
Definition at line 78 of file CrossingFrame.h.
References CrossingFrame< T >::pileupOffsetsBcr_, and CrossingFrame< T >::pileups_.
{ pileupOffsetsBcr_.push_back(pileups_.size()); }
void CrossingFrame< T >::setBunchRange | ( | std::pair< int, int > | bunchRange | ) | [inline] |
Definition at line 139 of file CrossingFrame.h.
References CrossingFrame< T >::firstCrossing_, and CrossingFrame< T >::lastCrossing_.
{ firstCrossing_ = bunchRange.first; lastCrossing_ = bunchRange.second;}
void CrossingFrame< T >::setBunchSpace | ( | int | bSpace | ) | [inline] |
Definition at line 132 of file CrossingFrame.h.
References CrossingFrame< T >::bunchSpace_.
{ bunchSpace_ = bSpace; }
void CrossingFrame< T >::setEventID | ( | edm::EventID | evId | ) | [inline] |
void CrossingFrame< T >::setIdFirstPileup | ( | edm::EventID | idFP | ) | [inline] |
Definition at line 136 of file CrossingFrame.h.
References CrossingFrame< T >::idFirstPileup_.
{idFirstPileup_ = idFP;}
void CrossingFrame< T >::setMaxNbSources | ( | unsigned int | mNbS | ) | [inline] |
Definition at line 133 of file CrossingFrame.h.
References CrossingFrame< T >::maxNbSources_.
{ maxNbSources_ = mNbS; }
void CrossingFrame< T >::setPileupFileNr | ( | unsigned int | pFileNr | ) | [inline] |
Definition at line 135 of file CrossingFrame.h.
References CrossingFrame< T >::pileupFileNr_.
{ pileupFileNr_ = pFileNr;}
void CrossingFrame< T >::setPileupOffsetsBcr | ( | std::vector< unsigned int > | pOffsetsBcr | ) | [inline] |
Definition at line 137 of file CrossingFrame.h.
References CrossingFrame< T >::pileupOffsetsBcr_.
{ pileupOffsetsBcr_ = pOffsetsBcr;}
void CrossingFrame< T >::setPileupOffsetsSource | ( | std::vector< std::vector< unsigned int > > | pOffsetsS | ) | [inline] |
Definition at line 138 of file CrossingFrame.h.
References CrossingFrame< T >::pileupOffsetsSource_.
{ pileupOffsetsSource_ = pOffsetsS;} //one per source
void CrossingFrame< T >::setPileupPtr | ( | boost::shared_ptr< edm::Wrapper< std::vector< T > > const > | shPtr | ) | [inline] |
Definition at line 71 of file CrossingFrame.h.
References CrossingFrame< T >::shPtrPileups_.
{shPtrPileups_.push_back( shPtr );}
void CrossingFrame< T >::setPileupPtr | ( | boost::shared_ptr< edm::Wrapper< T > const > | shPtr | ) | [inline] |
Definition at line 72 of file CrossingFrame.h.
References CrossingFrame< T >::shPtrPileups2_.
{shPtrPileups2_.push_back( shPtr );}
void CrossingFrame< T >::setPileupPtr | ( | boost::shared_ptr< edm::Wrapper< PCrossingFrame< T > > const > | shPtr | ) |
Definition at line 281 of file CrossingFrame.h.
{shPtrPileupsPCF_=shPtr;}
void CrossingFrame< T >::setPileups | ( | std::vector< const T * > | p | ) | [inline] |
Definition at line 131 of file CrossingFrame.h.
References AlCaHLTBitMon_ParallelJobs::p, and CrossingFrame< T >::pileups_.
void CrossingFrame< T >::setSourceOffset | ( | const unsigned int | s | ) | [inline] |
Definition at line 82 of file CrossingFrame.h.
References CrossingFrame< T >::pileupOffsetsSource_, CrossingFrame< T >::pileups_, and alignCSCRings::s.
{ pileupOffsetsSource_[s].push_back(pileups_.size()); }
void CrossingFrame< T >::setSubDet | ( | std::string | det | ) | [inline] |
Definition at line 134 of file CrossingFrame.h.
References CrossingFrame< T >::subdet_.
{ subdet_ = det; }
void CrossingFrame< T >::setTof | ( | ) |
Definition at line 316 of file CrossingFrame.h.
{;}
void CrossingFrame< T >::swap | ( | CrossingFrame< T > & | other | ) |
Referenced by swap().
int CrossingFrame< T >::bunchSpace_ [private] |
Definition at line 147 of file CrossingFrame.h.
Referenced by CrossingFrame< T >::getBunchSpace(), and CrossingFrame< T >::setBunchSpace().
int CrossingFrame< T >::firstCrossing_ [private] |
Definition at line 145 of file CrossingFrame.h.
Referenced by CrossingFrame< T >::CrossingFrame(), CrossingFrame< T >::getBunchRange(), CrossingFrame< T >::getNrPileups(), and CrossingFrame< T >::setBunchRange().
edm::EventID CrossingFrame< T >::id_ [private] |
Definition at line 149 of file CrossingFrame.h.
Referenced by CrossingFrame< T >::getEventID(), and CrossingFrame< T >::setEventID().
edm::EventID CrossingFrame< T >::idFirstPileup_ [private] |
Definition at line 152 of file CrossingFrame.h.
Referenced by CrossingFrame< T >::getIdFirstPileup(), and CrossingFrame< T >::setIdFirstPileup().
int CrossingFrame< T >::lastCrossing_ [private] |
Definition at line 146 of file CrossingFrame.h.
Referenced by CrossingFrame< T >::CrossingFrame(), CrossingFrame< T >::getBunchRange(), CrossingFrame< T >::getNrPileups(), and CrossingFrame< T >::setBunchRange().
unsigned int CrossingFrame< T >::maxNbSources_ [private] |
Definition at line 155 of file CrossingFrame.h.
Referenced by CrossingFrame< T >::CrossingFrame(), CrossingFrame< T >::getMaxNbSources(), and CrossingFrame< T >::setMaxNbSources().
unsigned int CrossingFrame< T >::pileupFileNr_ [private] |
Definition at line 153 of file CrossingFrame.h.
Referenced by CrossingFrame< T >::getPileupFileNr(), and CrossingFrame< T >::setPileupFileNr().
std::vector<unsigned int> CrossingFrame< T >::pileupOffsetsBcr_ [private] |
Definition at line 171 of file CrossingFrame.h.
Referenced by CrossingFrame< T >::CrossingFrame(), CrossingFrame< T >::getNrPileups(), CrossingFrame< T >::getPileupOffsetsBcr(), CrossingFrame< T >::setBcrOffset(), and CrossingFrame< T >::setPileupOffsetsBcr().
std::vector< std::vector<unsigned int> > CrossingFrame< T >::pileupOffsetsSource_ [private] |
Definition at line 172 of file CrossingFrame.h.
Referenced by CrossingFrame< T >::CrossingFrame(), CrossingFrame< T >::getPileupOffsetsSource(), CrossingFrame< T >::setPileupOffsetsSource(), and CrossingFrame< T >::setSourceOffset().
std::vector<const T *> CrossingFrame< T >::pileups_ [private] |
Definition at line 161 of file CrossingFrame.h.
Referenced by CrossingFrame< T >::getNrPileups(), CrossingFrame< T >::getObject(), CrossingFrame< T >::getPileups(), CrossingFrame< T >::setBcrOffset(), CrossingFrame< T >::setPileups(), and CrossingFrame< T >::setSourceOffset().
std::vector< boost::shared_ptr<edm::Wrapper<T> const> > CrossingFrame< T >::shPtrPileups2_ [private] |
Definition at line 163 of file CrossingFrame.h.
Referenced by CrossingFrame< T >::setPileupPtr().
std::vector< boost::shared_ptr<edm::Wrapper<std::vector<T> > const> > CrossingFrame< T >::shPtrPileups_ [private] |
Definition at line 162 of file CrossingFrame.h.
Referenced by CrossingFrame< T >::setPileupPtr().
boost::shared_ptr<edm::Wrapper<PCrossingFrame<T> > const> CrossingFrame< T >::shPtrPileupsPCF_ [private] |
Definition at line 166 of file CrossingFrame.h.
std::vector<const T * > CrossingFrame< T >::signals_ [private] |
Definition at line 158 of file CrossingFrame.h.
Referenced by CrossingFrame< T >::getNrSignals(), CrossingFrame< T >::getObject(), and CrossingFrame< T >::getSignal().
std::string CrossingFrame< T >::subdet_ [private] |
Definition at line 148 of file CrossingFrame.h.
Referenced by CrossingFrame< T >::getSubDet(), and CrossingFrame< T >::setSubDet().