1 #ifndef MIX_COLLECTION_H 2 #define MIX_COLLECTION_H 14 typedef std::pair<int, int>
range;
28 if (ip >= (
unsigned int)
size())
30 <<
"MixCollection::getObject called with an invalid index!";
39 for (
unsigned int iframe = 0; iframe <
crossingFrames_.size(); ++iframe) {
48 for (
unsigned int iframe = 0; iframe <
crossingFrames_.size(); ++iframe) {
55 throw cms::Exception(
"InternalError") <<
"MixCollection::getObject reached impossible condition";
69 for (
int i = 0;
i < nrDets; ++
i) {
104 typename std::vector<const T *>::const_iterator
pMixItr_;
120 typename std::vector<const T *>::const_iterator &
last);
122 bool getNewPileups(
typename std::vector<const T *>::const_iterator &first,
123 typename std::vector<const T *>::const_iterator &last);
127 iterator
begin()
const;
128 iterator
end()
const;
131 void init(
const range bunchRange);
159 edm::LogWarning(
"MixCollectionInvalidCtr") <<
"Could not construct MixCollection for " <<
typeid(
T).
name()
160 <<
", pointer to CrossingFrame invalid!" << std::endl;
167 range bR = cfs[0]->getBunchRange();
168 for (
unsigned int i = 1;
i < cfs.size(); ++
i) {
169 if (bR != cfs[
i]->getBunchRange())
171 <<
"You gave as input CrossingFrames with different bunchRanges!";
175 for (
unsigned int i = 0;
i < cfs.size(); ++
i) {
194 int first = defaultrange.first;
195 int last = defaultrange.second;
199 <<
"), outside of the existing runrange (" << defaultrange.first <<
", " << defaultrange.second <<
")\n";
225 typename std::vector<const T *>::const_iterator &
last) {
229 mixCol_->crossingFrames_[iSignal_]->getSignal(first, last);
230 myCF_ = mixCol_->crossingFrames_[iSignal_];
240 typename std::vector<const T *>::const_iterator &
last) {
243 mixCol_->crossingFrames_[iPileup_]->getPileups(first, last);
245 for (
typename std::vector<const T *>::const_iterator it = first; it !=
last; it++) {
248 myCF_ = mixCol_->crossingFrames_[iPileup_];
266 if (++pMixItr_ != pMixItrEnd_)
273 ok = this->getNewSignal(pMixItr_, pMixItrEnd_);
278 ok = this->getNewPileups(pMixItr_, pMixItrEnd_);
301 std::ostream &operator<<(std::ostream &o, const MixCollection<T> &
col) {
302 o <<
"MixCollection with bunchRange: " << (
col.bunchrange()).
first <<
"," << (
col.bunchrange()).
second 303 <<
" size of signal: " <<
col.sizeSignal() <<
" ,size of pileup: " <<
col.sizePileup();
const CrossingFrame< T > * myCF_
const T * operator->() const
const MixCollection * mixCol_
std::pair< int, int > range
const MixItr operator++(int)
MixItr(const MixCollection *shc, int nrDets, end_tag)
const T & operator*() const
MixItr(const MixCollection *shc, int nrDets)
U second(std::pair< T, U > const &p)
std::vector< const CrossingFrame< T > * > crossingFrames_
bool operator!=(const MixItr &itr)
bool getNewSignal(typename std::vector< const T * >::const_iterator &first, typename std::vector< const T * >::const_iterator &last)
unsigned int internalCtr2_
bool getNewPileups(typename std::vector< const T * >::const_iterator &first, typename std::vector< const T * >::const_iterator &last)
std::vector< const T * >::const_iterator pMixItr_
const T & getObject(unsigned int ip) const
std::vector< const T * >::const_iterator pMixItrEnd_
const std::vector< const T * > & getSignal() const
const std::vector< const T * > & getPileups() const
int getPileupEventNr() const
int getSourceType() const
void init(const range bunchRange)
unsigned int internalCtr_
const MixItr operator++()