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);
123 typename std::vector<const T *>::const_iterator &
last);
152 : inRegistry_(
false), nrDets_(0) {
159 edm::LogWarning(
"MixCollectionInvalidCtr") <<
"Could not construct MixCollection for " <<
typeid(
T).
name()
160 <<
", pointer to CrossingFrame invalid!" << std::endl;
165 : inRegistry_(
false), nrDets_(0) {
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) {
186 bunchRange_ = bunchRange;
190 range defaultrange = crossingFrames_[0]->getBunchRange();
191 if (bunchRange_ ==
range(-999, 999))
192 bunchRange_ = defaultrange;
193 else if (bunchRange_ != defaultrange) {
194 int first = defaultrange.first;
195 int last = defaultrange.second;
196 if (bunchRange_.first < defaultrange.first || bunchRange_.second > defaultrange.second)
198 <<
" You are asking for a runrange (" << bunchRange_.first <<
"," << bunchRange_.second
199 <<
"), outside of the existing runrange (" << defaultrange.first <<
", " << defaultrange.second <<
")\n";
208 for (
int i = 0;
i < nrDets_; ++
i) {
209 s += crossingFrames_[
i]->getNrPileups();
217 for (
int i = 0;
i < nrDets_; ++
i) {
218 s += crossingFrames_[
i]->getNrSignals();
225 typename std::vector<const T *>::const_iterator &
last) {
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_);
302 o <<
"MixCollection with bunchRange: " << (
col.bunchrange()).
first <<
"," << (
col.bunchrange()).
second
303 <<
" size of signal: " <<
col.sizeSignal() <<
" ,size of pileup: " <<
col.sizePileup();