CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
MixCollection< T >::MixItr Class Reference

#include <MixCollection.h>

Public Member Functions

int bunch () const
 
int getPileupEventNr () const
 
int getSourceType () const
 
bool getTrigger () const
 
 MixItr ()
 
 MixItr (typename std::vector< const T * >::const_iterator it)
 
 MixItr (const MixCollection *shc, int nrDets)
 
bool operator!= (const MixItr &itr)
 
const Toperator* () const
 
const MixItr operator++ ()
 
const MixItr operator++ (int)
 
const Toperator-> () const
 
virtual ~MixItr ()
 

Private Member Functions

bool getNewPileups (typename std::vector< const T * >::const_iterator &first, typename std::vector< const T * >::const_iterator &last)
 
bool getNewSignal (typename std::vector< const T * >::const_iterator &first, typename std::vector< const T * >::const_iterator &last)
 
const MixItr next ()
 
void reset ()
 

Private Attributes

bool first_
 
unsigned int internalCtr_
 
int iPileup_
 
int iSignal_
 
const MixCollectionmixCol_
 
const CrossingFrame< T > * myCF_
 
int nrDets_
 
std::vector< const T * >::const_iterator pMixItr_
 
std::vector< const T * >::const_iterator pMixItrEnd_
 
bool trigger_
 

Detailed Description

template<class T>
class MixCollection< T >::MixItr

Definition at line 62 of file MixCollection.h.

Constructor & Destructor Documentation

template<class T>
MixCollection< T >::MixItr::MixItr ( )
inline

constructors

Definition at line 66 of file MixCollection.h.

66 :first_(true), internalCtr_(0) {;}
unsigned int internalCtr_
template<class T>
MixCollection< T >::MixItr::MixItr ( typename std::vector< const T * >::const_iterator  it)
inline

Definition at line 67 of file MixCollection.h.

67 : pMixItr_(it),nrDets_(0),first_(true),internalCtr_(0) {;}
std::vector< const T * >::const_iterator pMixItr_
Definition: MixCollection.h:97
unsigned int internalCtr_
template<class T>
MixCollection< T >::MixItr::MixItr ( const MixCollection shc,
int  nrDets 
)
inline

Definition at line 68 of file MixCollection.h.

template<class T>
virtual MixCollection< T >::MixItr::~MixItr ( )
inlinevirtual

Default destructor

Definition at line 73 of file MixCollection.h.

73 {;}

Member Function Documentation

template<class T>
int MixCollection< T >::MixItr::bunch ( ) const
inline
template<class T >
bool MixCollection< T >::MixItr::getNewPileups ( typename std::vector< const T * >::const_iterator &  first,
typename std::vector< const T * >::const_iterator &  last 
)
private

Definition at line 221 of file MixCollection.h.

References MixCollection< T >::crossingFrames_, plotBeamSpotDB::last, MixCollection< T >::nrDets_, and alignCSCRings::s.

Referenced by MixCollection< T >::MixItr::reset().

221  {
222 
223  // gets the next pileup collection , changing subdet if necessary
224  while (iPileup_<nrDets_) {
225  mixCol_-> crossingFrames_[iPileup_]->getPileups(first,last);
226  int s=0;
227  for (typename std::vector<const T*>::const_iterator it=first;it!= last ;it++) {
228  s++;
229  }
231  iPileup_++;
232  if (first!=last) return true;
233  }
234  return false;
235 }
const CrossingFrame< T > * myCF_
const MixCollection * mixCol_
std::vector< const CrossingFrame< T > * > crossingFrames_
template<class T >
bool MixCollection< T >::MixItr::getNewSignal ( typename std::vector< const T * >::const_iterator &  first,
typename std::vector< const T * >::const_iterator &  last 
)
private

Definition at line 208 of file MixCollection.h.

References MixCollection< T >::nrDets_.

Referenced by MixCollection< T >::MixItr::reset().

208  {
209  // gets the next signal collection with non-zero size
210 
211  while (iSignal_<nrDets_) {
212  mixCol_->crossingFrames_[iSignal_]->getSignal(first,last);
214  iSignal_++;
215  if (first != last) return true;
216  }
217  return false;
218 }
const CrossingFrame< T > * myCF_
const MixCollection * mixCol_
std::vector< const CrossingFrame< T > * > crossingFrames_
template<class T>
int MixCollection< T >::MixItr::getPileupEventNr ( ) const
inline

Definition at line 93 of file MixCollection.h.

References MixCollection< T >::MixItr::getTrigger(), MixCollection< T >::MixItr::internalCtr_, and MixCollection< T >::MixItr::myCF_.

93 {return (getTrigger() ? 0 : myCF_->getPileupEventNr(internalCtr_));}
const CrossingFrame< T > * myCF_
bool getTrigger() const
Definition: MixCollection.h:90
unsigned int internalCtr_
template<class T>
int MixCollection< T >::MixItr::getSourceType ( ) const
inline

Definition at line 92 of file MixCollection.h.

References MixCollection< T >::MixItr::getTrigger(), MixCollection< T >::MixItr::internalCtr_, and MixCollection< T >::MixItr::myCF_.

Referenced by edm::TestMix::analyze().

92 {return (getTrigger() ? -1 : myCF_->getSourceType(internalCtr_));}
const CrossingFrame< T > * myCF_
bool getTrigger() const
Definition: MixCollection.h:90
unsigned int internalCtr_
template<class T>
bool MixCollection< T >::MixItr::getTrigger ( ) const
inline
template<class T >
const MixCollection< T >::MixItr MixCollection< T >::MixItr::next ( void  )
private

Definition at line 238 of file MixCollection.h.

References convertSQLiteXML::ok.

Referenced by MixCollection< T >::MixItr::operator++().

238  {
239 
240  // initialisation
241  if (first_) {
242  first_=false;
243  trigger_=true;
244  } else {
245  if (!trigger_) internalCtr_++;
246  if (++pMixItr_!=pMixItrEnd_) return *this;
247  }
248 
249  // we have an end condition, look whether there are more collections
250  bool ok;
251  if (trigger_) {
253  if (ok) return *this;
254  trigger_=false;
255  }
257  if (ok) {
258  // debug print start
259  typename std::vector<const T *>::const_iterator dbIt;
260  // for (dbIt=pMixItr_;dbIt!=pMixItrEnd_;++dbIt) printf("Found pointer %p\n",(*dbIt));fflush(stdout);
261  // debug print end
262  internalCtr_=0;
263  return *this;
264  }
265  else {
266  return mixCol_->end();
267  }
268 }
const MixCollection * mixCol_
bool getNewSignal(typename std::vector< const T * >::const_iterator &first, typename std::vector< const T * >::const_iterator &last)
iterator end() const
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_
Definition: MixCollection.h:97
std::vector< const T * >::const_iterator pMixItrEnd_
Definition: MixCollection.h:98
unsigned int internalCtr_
template<class T>
bool MixCollection< T >::MixItr::operator!= ( const MixItr itr)
inline

Definition at line 81 of file MixCollection.h.

References MixCollection< T >::MixItr::pMixItr_.

81 {return pMixItr_!=itr.pMixItr_;}
std::vector< const T * >::const_iterator pMixItr_
Definition: MixCollection.h:97
template<class T>
const T& MixCollection< T >::MixItr::operator* ( void  ) const
inline

Definition at line 78 of file MixCollection.h.

References MixCollection< T >::MixItr::pMixItr_.

78 {return *(pMixItr_.operator*()); }
std::vector< const T * >::const_iterator pMixItr_
Definition: MixCollection.h:97
template<class T>
const MixItr MixCollection< T >::MixItr::operator++ ( void  )
inline

Definition at line 79 of file MixCollection.h.

References MixCollection< T >::MixItr::next().

79 {return next();}
const MixItr next()
template<class T>
const MixItr MixCollection< T >::MixItr::operator++ ( int  )
inline

Definition at line 80 of file MixCollection.h.

References MixCollection< T >::MixItr::next().

80 {return next();}
const MixItr next()
template<class T>
const T* MixCollection< T >::MixItr::operator-> ( ) const
inline

operators

Definition at line 77 of file MixCollection.h.

References MixCollection< T >::MixItr::pMixItr_.

77 { return *(pMixItr_.operator->()); }
std::vector< const T * >::const_iterator pMixItr_
Definition: MixCollection.h:97
template<class T>
void MixCollection< T >::MixItr::reset ( void  )
inlineprivate

Member Data Documentation

template<class T>
bool MixCollection< T >::MixItr::first_
private

Definition at line 103 of file MixCollection.h.

template<class T>
unsigned int MixCollection< T >::MixItr::internalCtr_
private
template<class T>
int MixCollection< T >::MixItr::iPileup_
private

Definition at line 104 of file MixCollection.h.

template<class T>
int MixCollection< T >::MixItr::iSignal_
private

Definition at line 104 of file MixCollection.h.

template<class T>
const MixCollection* MixCollection< T >::MixItr::mixCol_
private

Definition at line 101 of file MixCollection.h.

template<class T>
const CrossingFrame<T>* MixCollection< T >::MixItr::myCF_
private
template<class T>
int MixCollection< T >::MixItr::nrDets_
private

Definition at line 102 of file MixCollection.h.

template<class T>
std::vector<const T *>::const_iterator MixCollection< T >::MixItr::pMixItr_
private
template<class T>
std::vector<const T *>::const_iterator MixCollection< T >::MixItr::pMixItrEnd_
private

Definition at line 98 of file MixCollection.h.

template<class T>
bool MixCollection< T >::MixItr::trigger_
private