test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 (MixCollection *shc, int nrDets)
 
bool operator!= (const MixItr &itr)
 
const Toperator* () const
 
MixItr operator++ ()
 
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)
 
MixItr next ()
 
void reset ()
 

Private Attributes

bool first_
 
unsigned int internalCtr_
 
int iPileup_
 
int iSignal_
 
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 61 of file MixCollection.h.

Constructor & Destructor Documentation

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

constructors

Definition at line 65 of file MixCollection.h.

65 :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 66 of file MixCollection.h.

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

Definition at line 67 of file MixCollection.h.

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

Default destructor

Definition at line 72 of file MixCollection.h.

72 {;}

Member Function Documentation

template<class T>
int MixCollection< T >::MixItr::bunch ( ) const
inline

getters

Definition at line 83 of file MixCollection.h.

References MixCollection< T >::MixItr::internalCtr_, MixCollection< T >::MixItr::myCF_, and MixCollection< T >::MixItr::trigger_.

Referenced by edm::TestMix::analyze(), and edm::TestMixedSource::analyze().

83  {
84  if (trigger_) return 0;
85  int bcr= myCF_->getBunchCrossing(internalCtr_);
86  return bcr;
87  }
const CrossingFrame< T > * myCF_
Definition: MixCollection.h:99
unsigned int internalCtr_
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 220 of file MixCollection.h.

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

220  {
221 
222  // gets the next pileup collection , changing subdet if necessary
223  while (iPileup_<nrDets_) {
224  mixCol_-> crossingFrames_[iPileup_]->getPileups(first,last);
225  int s=0;
226  for (typename std::vector<const T*>::const_iterator it=first;it!= last ;it++) {
227  s++;
228  }
230  iPileup_++;
231  if (first!=last) return true;
232  }
233  return false;
234 }
const CrossingFrame< T > * myCF_
Definition: MixCollection.h:99
MixCollection * mixCol_
std::vector< const CrossingFrame< T > * > crossingFrames_
bool first
Definition: L1TdeRCT.cc:75
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 207 of file MixCollection.h.

References MixCollection< T >::crossingFrames_, MixCollection< T >::MixItr::iSignal_, MixCollection< T >::MixItr::mixCol_, MixCollection< T >::MixItr::myCF_, and MixCollection< T >::MixItr::nrDets_.

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

Definition at line 92 of file MixCollection.h.

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

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

Definition at line 91 of file MixCollection.h.

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

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

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

Definition at line 237 of file MixCollection.h.

References convertSQLiteXML::ok.

Referenced by BeautifulSoup.PageElement::_invert(), and MixCollection< T >::MixItr::operator++().

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

Definition at line 80 of file MixCollection.h.

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

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

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:96
template<class T>
MixItr MixCollection< T >::MixItr::operator++ ( void  )
inline

Definition at line 78 of file MixCollection.h.

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

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

Definition at line 79 of file MixCollection.h.

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

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

operators

Definition at line 76 of file MixCollection.h.

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

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

Definition at line 108 of file MixCollection.h.

108 {;}

Member Data Documentation

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

Definition at line 102 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 103 of file MixCollection.h.

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

Definition at line 103 of file MixCollection.h.

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

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

Definition at line 100 of file MixCollection.h.

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

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

Definition at line 101 of file MixCollection.h.

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

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 97 of file MixCollection.h.

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