#include <MixCollection.h>
Classes | |
class | MixItr |
Public Types | |
typedef MixItr | iterator |
typedef std::pair< int, int > | range |
Public Member Functions | |
iterator | begin () |
range | bunchrange () const |
iterator | end () |
const T & | getObject (unsigned int ip) const |
bool | inRegistry () const |
MixCollection (const CrossingFrame< T > *cf, const range bunchRange=range(-999, 999)) | |
MixCollection () | |
MixCollection (std::vector< const CrossingFrame< T > * > cfs, const range bunchRange=range(-999, 999)) | |
int | size () const |
int | sizePileup () const |
int | sizeSignal () const |
Private Member Functions | |
void | init (const range bunchRange) |
Private Attributes | |
range | bunchRange_ |
std::vector< const CrossingFrame< T > * > | crossingFrames_ |
bool | inRegistry_ |
int | nrDets_ |
Friends | |
class | MixItr |
Definition at line 10 of file MixCollection.h.
typedef MixItr MixCollection< T >::iterator |
Definition at line 114 of file MixCollection.h.
typedef std::pair<int,int> MixCollection< T >::range |
Definition at line 15 of file MixCollection.h.
MixCollection< T >::MixCollection | ( | ) |
Definition at line 135 of file MixCollection.h.
References MixCollection< T >::crossingFrames_, and NULL.
: bunchRange_(0,0), inRegistry_(false), nrDets_(0) { crossingFrames_.push_back(NULL); }
MixCollection< T >::MixCollection | ( | const CrossingFrame< T > * | cf, |
const range | bunchRange = range(-999,999) |
||
) |
Definition at line 142 of file MixCollection.h.
References gather_cfg::cout, MixCollection< T >::crossingFrames_, MixCollection< T >::init(), MixCollection< T >::inRegistry_, mergeVDriftHistosByStation::name, and MixCollection< T >::nrDets_.
: inRegistry_(false),nrDets_(0) { nrDets_=1; inRegistry_=true; if (cf) { crossingFrames_.push_back(cf); init(bunchRange); } else std::cout <<"Could not construct MixCollection for "<<typeid(T).name() <<", pointer to CrossingFrame invalid!"<<std::endl; }
MixCollection< T >::MixCollection | ( | std::vector< const CrossingFrame< T > * > | cfs, |
const range | bunchRange = range(-999,999) |
||
) |
Definition at line 155 of file MixCollection.h.
References MixCollection< T >::crossingFrames_, i, MixCollection< T >::init(), MixCollection< T >::inRegistry_, and MixCollection< T >::nrDets_.
: inRegistry_(false) , nrDets_(0) { // first, verify that all CrossingFrames have the same bunchrange range bR=cfs[0]->getBunchRange(); for (unsigned int i=1;i<cfs.size();++i) { if (bR!= cfs[i]->getBunchRange()) throw cms::Exception("Incompatible CrossingFrames")<<"You gave as input CrossingFrames with different bunchRanges!"; } //set necessary variables for (unsigned int i=0;i<cfs.size();++i) { nrDets_++; crossingFrames_.push_back(cfs[i]); inRegistry_=true; // true if at least one is present } init(bunchRange); }
MixCollection< T >::MixItr MixCollection< T >::begin | ( | void | ) |
Definition at line 270 of file MixCollection.h.
References MixCollection< T >::MixItr, and MixCollection< T >::nrDets_.
Referenced by edm::TestMix::analyze(), edm::TestMixedSource::analyze(), CSCDigitizer::doAction(), RPCDigitizer::doAction(), DTHitAssociator::DTHitAssociator(), CastorHitCorrection::fillChargeSums(), HcalHitCorrection::fillChargeSums(), CaloHitAnalyzer::fillHits(), SimHitSelectorFromDB::getSimHit(), MuonTruth::MuonTruth(), SiClusterTranslator::produce(), DTDigitizer::produce(), BSCTrigger::produce(), cms::SiPixelDigitizer::produce(), RPCHitAssociator::RPCHitAssociator(), CaloHitResponse::run(), EcalHitResponse::run(), EBHitResponse::run(), HcalSiPMHitResponse::run(), CaloHitRespoNew::run(), PixelPSimHitSelector::select(), MuonPSimHitSelector::select(), PSimHitSelector::select(), SiTrackerGaussianSmearingRecHitConverter::smearHits(), and TrackerHitAssociator::TrackerHitAssociator().
range MixCollection< T >::bunchrange | ( | ) | const [inline] |
Definition at line 22 of file MixCollection.h.
{return bunchRange_;}
MixCollection< T >::MixItr MixCollection< T >::end | ( | void | ) |
Definition at line 275 of file MixCollection.h.
References MixCollection< T >::crossingFrames_, first, prof2calltree::last, and MixCollection< T >::nrDets_.
Referenced by edm::TestMix::analyze(), edm::TestMixedSource::analyze(), CSCDigitizer::doAction(), RPCDigitizer::doAction(), DTHitAssociator::DTHitAssociator(), CastorHitCorrection::fillChargeSums(), HcalHitCorrection::fillChargeSums(), CaloHitAnalyzer::fillHits(), BSCTrigger::produce(), cms::SiPixelDigitizer::produce(), CaloHitResponse::run(), EcalHitResponse::run(), EBHitResponse::run(), HcalSiPMHitResponse::run(), CaloHitRespoNew::run(), SiTrackerGaussianSmearingRecHitConverter::smearHits(), and TrackerHitAssociator::TrackerHitAssociator().
{ typename std::vector<const T *>::const_iterator first; typename std::vector<const T*>::const_iterator last; crossingFrames_[nrDets_-1]->getPileups(first, last); return last; }
const T& MixCollection< T >::getObject | ( | unsigned int | ip | ) | const [inline] |
Definition at line 30 of file MixCollection.h.
Referenced by TrackerHitAssociator::associateHit(), TrackerHitAssociator::associateSimpleRecHitCluster(), and GenParticleProducer::produce().
{ if (ip>=(unsigned int)size()) throw cms::Exception("BadIndex")<<"MixCollection::getObject called with an invalid index!"; // ip >= 0, since ip is unsigned int n=ip; /* - int iframe=0; - for (unsigned int ii=0;ii<crossingFrames_.size();++ii) { - iframe=ii; - int s=crossingFrames_[iframe]->getNrSignals()+crossingFrames_[iframe]->getNrPileups(); - if (n<s) break; */ for (unsigned int iframe=0;iframe<crossingFrames_.size();++iframe) { int s=crossingFrames_[iframe]->getNrSignals(); if (n<s) return crossingFrames_[iframe]->getObject(n); n=n-s; } /* return crossingFrames_[iframe]->getObject(n); */ for (unsigned int iframe=0;iframe<crossingFrames_.size();++iframe) { int s=crossingFrames_[iframe]->getNrSignals(); int p=crossingFrames_[iframe]->getNrPileups(); if (n<p) return crossingFrames_[iframe]->getObject(s+n); n=n-p; } throw cms::Exception("InternalError")<<"MixCollection::getObject reached impossible condition"; }
void MixCollection< T >::init | ( | const range | bunchRange | ) | [private] |
Definition at line 174 of file MixCollection.h.
References Exception, first, and prof2calltree::last.
Referenced by MixCollection< T >::MixCollection().
{ bunchRange_=bunchRange; //verify whether bunchrange is ok // in case of several crossingFrames, we have verified before that they have the same bunchrange range defaultrange=crossingFrames_[0]->getBunchRange(); if (bunchRange_==range(-999,999)) bunchRange_=defaultrange; else if (bunchRange_!=defaultrange ) { int first=defaultrange.first; int last = defaultrange.second; if (bunchRange_.first<defaultrange.first || bunchRange_.second>defaultrange.second ) throw cms::Exception("BadRunRange")<<" You are asking for a runrange ("<<bunchRange_.first<<","<<bunchRange_.second<<"), outside of the existing runrange ("<<defaultrange.first<<", "<<defaultrange.second<<")\n"; bunchRange_=range(first,last); } }
bool MixCollection< T >::inRegistry | ( | ) | const [inline] |
Definition at line 27 of file MixCollection.h.
Referenced by EcalDigiProducer::produce().
{return inRegistry_;}
int MixCollection< T >::size | ( | void | ) | const [inline] |
Definition at line 23 of file MixCollection.h.
Referenced by MixCollection< PSimHit >::getObject(), GenParticleProducer::produce(), and SiTrackerGaussianSmearingRecHitConverter::smearHits().
{return sizeSignal() + sizePileup();}
int MixCollection< T >::sizePileup | ( | ) | const |
Definition at line 190 of file MixCollection.h.
References i, and alignCSCRings::s.
Referenced by MixCollection< PSimHit >::size().
int MixCollection< T >::sizeSignal | ( | ) | const |
Definition at line 198 of file MixCollection.h.
References i, and alignCSCRings::s.
Referenced by MixCollection< PSimHit >::size().
friend class MixItr [friend] |
Definition at line 57 of file MixCollection.h.
Referenced by MixCollection< T >::begin().
range MixCollection< T >::bunchRange_ [private] |
Definition at line 121 of file MixCollection.h.
Referenced by MixCollection< PSimHit >::bunchrange().
std::vector<const CrossingFrame<T> *> MixCollection< T >::crossingFrames_ [private] |
Definition at line 125 of file MixCollection.h.
Referenced by MixCollection< T >::end(), MixCollection< T >::MixItr::getNewPileups(), MixCollection< T >::MixItr::getNewSignal(), MixCollection< PSimHit >::getObject(), and MixCollection< T >::MixCollection().
bool MixCollection< T >::inRegistry_ [private] |
Definition at line 122 of file MixCollection.h.
Referenced by MixCollection< PSimHit >::inRegistry(), and MixCollection< T >::MixCollection().
int MixCollection< T >::nrDets_ [private] |
Definition at line 123 of file MixCollection.h.
Referenced by MixCollection< T >::begin(), MixCollection< T >::end(), MixCollection< T >::MixItr::getNewPileups(), and MixCollection< T >::MixCollection().