CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

MixCollection< T >::MixItr Class Reference

#include <MixCollection.h>

List of all members.

Public Member Functions

int bunch () const
int getPileupEventNr () const
int getSourceType () const
bool getTrigger () const
 MixItr (typename std::vector< const T * >::const_iterator it)
 MixItr ()
 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.

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

Definition at line 66 of file MixCollection.h.

: pMixItr_(it),nrDets_(0),first_(true),internalCtr_(0) {;}
template<class T>
MixCollection< T >::MixItr::MixItr ( MixCollection shc,
int  nrDets 
) [inline]

Definition at line 67 of file MixCollection.h.

                                              :     
       mixCol_(shc),nrDets_(nrDets),first_(true),iSignal_(0),iPileup_(0),internalCtr_(0) {;}
template<class T>
virtual MixCollection< T >::MixItr::~MixItr ( ) [inline, virtual]

Default destructor

Definition at line 72 of file MixCollection.h.

{;}

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().

                      {
      if (trigger_) return 0;
      int bcr= myCF_->getBunchCrossing(internalCtr_);
      return bcr;
    }
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 asciidump::s.

                                                                                                                                               {

  // gets the next pileup collection , changing subdet if necessary
  while (iPileup_<nrDets_) {
    mixCol_-> crossingFrames_[iPileup_]->getPileups(first,last);
    int s=0;
    for (typename std::vector<const T*>::const_iterator it=first;it!= last ;it++) {
      s++;
    }
    myCF_=mixCol_->crossingFrames_[iPileup_];
    iPileup_++;
    if (first!=last) return true;
  }
  return false;
}
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]
template<class T>
int MixCollection< T >::MixItr::getPileupEventNr ( ) const [inline]
template<class T>
int MixCollection< T >::MixItr::getSourceType ( ) const [inline]
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 MixCollection< T >::MixItr::operator++().

                                                             {

  // initialisation
  if (first_) {
    first_=false;
    trigger_=true;
  } else {
    if (!trigger_) internalCtr_++;
    if (++pMixItr_!=pMixItrEnd_) return *this;
  }

  // we have an end condition, look whether there are more collections
  bool ok;
  if (trigger_) {
    ok=this->getNewSignal(pMixItr_,pMixItrEnd_);
    if (ok) return *this;
    trigger_=false;
  } 
  ok=this->getNewPileups(pMixItr_,pMixItrEnd_);
  if (ok) {
    // debug print start
    typename std::vector<const T *>::const_iterator dbIt;
    //    for (dbIt=pMixItr_;dbIt!=pMixItrEnd_;++dbIt)  printf("Found pointer %p\n",(*dbIt));fflush(stdout);
    // debug print end
    internalCtr_=0;
    return *this;
  }
  else {
    return mixCol_->end();
  }
}
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_.

{return pMixItr_!=itr.pMixItr_;}
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_.

{return *(pMixItr_.operator*()); }
template<class T>
MixItr MixCollection< T >::MixItr::operator++ ( int  ) [inline]

Definition at line 79 of file MixCollection.h.

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

{return next();}
template<class T>
MixItr MixCollection< T >::MixItr::operator++ ( void  ) [inline]

Definition at line 78 of file MixCollection.h.

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

{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_.

{ return *(pMixItr_.operator->()); }
template<class T>
void MixCollection< T >::MixItr::reset ( void  ) [inline, private]

Definition at line 108 of file MixCollection.h.

{;}

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]