CMS 3D CMS Logo

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

#include <MixCollection.h>

Classes

struct  end_tag
 

Public Member Functions

int bunch () const
 
int getPileupEventNr () const
 
int getSourceType () const
 
bool getTrigger () const
 
 MixItr ()
 
 MixItr (const MixCollection *shc, int nrDets, end_tag)
 
 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 internalCtr2_
 
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 61 of file MixCollection.h.

Constructor & Destructor Documentation

◆ MixItr() [1/3]

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_

◆ MixItr() [2/3]

template<class T>
MixCollection< T >::MixItr::MixItr ( const MixCollection shc,
int  nrDets,
end_tag   
)
inline

Definition at line 67 of file MixCollection.h.

References MixCollection< T >::crossingFrames_, CrossingFrame< T >::getPileups(), CrossingFrame< T >::getSignal(), mps_fire::i, and MixCollection< T >::MixItr::internalCtr2_.

67  : internalCtr2_(0) {
68  for (int i = 0; i < nrDets; ++i) {
69  const auto &cf = shc->crossingFrames_[i];
70  internalCtr2_ += cf->getSignal().size() + cf->getPileups().size();
71  }
72  }
std::vector< const CrossingFrame< T > * > crossingFrames_
unsigned int internalCtr2_

◆ MixItr() [3/3]

template<class T>
MixCollection< T >::MixItr::MixItr ( const MixCollection shc,
int  nrDets 
)
inline

Definition at line 73 of file MixCollection.h.

74  : mixCol_(shc), nrDets_(nrDets), first_(true), iSignal_(0), iPileup_(0), internalCtr_(0) {
75  ;
76  }
const MixCollection * mixCol_
unsigned int internalCtr_

◆ ~MixItr()

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

Default destructor

Definition at line 79 of file MixCollection.h.

79 { ; }

Member Function Documentation

◆ bunch()

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

◆ getNewPileups()

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

References first, dqmdumpme::last, MixCollection< T >::nrDets_, and alignCSCRings::s.

239  {
240  // gets the next pileup collection , changing subdet if necessary
241  while (iPileup_ < nrDets_) {
242  mixCol_->crossingFrames_[iPileup_]->getPileups(first, last);
243  int s = 0;
244  for (typename std::vector<const T *>::const_iterator it = first; it != last; it++) {
245  s++;
246  }
248  iPileup_++;
249  if (first != last)
250  return true;
251  }
252  return false;
253 }
const CrossingFrame< T > * myCF_
const MixCollection * mixCol_
std::vector< const CrossingFrame< T > * > crossingFrames_

◆ getNewSignal()

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

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

224  {
225  // gets the next signal collection with non-zero size
226 
227  while (iSignal_ < nrDets_) {
228  mixCol_->crossingFrames_[iSignal_]->getSignal(first, last);
230  iSignal_++;
231  if (first != last)
232  return true;
233  }
234  return false;
235 }
const CrossingFrame< T > * myCF_
const MixCollection * mixCol_
std::vector< const CrossingFrame< T > * > crossingFrames_

◆ getPileupEventNr()

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

Definition at line 100 of file MixCollection.h.

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

100 { return (getTrigger() ? 0 : myCF_->getPileupEventNr(internalCtr_)); }
const CrossingFrame< T > * myCF_
bool getTrigger() const
Definition: MixCollection.h:97
unsigned int internalCtr_

◆ getSourceType()

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

Definition at line 99 of file MixCollection.h.

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

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

99 { return (getTrigger() ? -1 : myCF_->getSourceType(internalCtr_)); }
const CrossingFrame< T > * myCF_
bool getTrigger() const
Definition: MixCollection.h:97
unsigned int internalCtr_

◆ getTrigger()

template<class T>
bool MixCollection< T >::MixItr::getTrigger ( ) const
inline

◆ next()

template<class T >
const MixCollection< T >::MixItr MixCollection< T >::MixItr::next ( void  )
private

Definition at line 256 of file MixCollection.h.

References convertSQLiteXML::ok.

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

256  {
257  // initialisation
258  if (first_) {
259  first_ = false;
260  trigger_ = true;
261  } else {
262  ++internalCtr2_;
263  if (!trigger_)
264  internalCtr_++;
265  if (++pMixItr_ != pMixItrEnd_)
266  return *this;
267  }
268 
269  // we have an end condition, look whether there are more collections
270  bool ok;
271  if (trigger_) {
273  if (ok)
274  return *this;
275  trigger_ = false;
276  }
278  if (ok) {
279  // debug print start
280  // for (auto dbIt=pMixItr_;dbIt!=pMixItrEnd_;++dbIt) printf("Found pointer %p\n",(*dbIt));fflush(stdout);
281  // debug print end
282  internalCtr_ = 0;
283  }
284  return *this; // with internalCtr2_ we can always return *this
285 }
bool getNewSignal(typename std::vector< const T *>::const_iterator &first, typename std::vector< const T *>::const_iterator &last)
unsigned int internalCtr2_
std::vector< const T * >::const_iterator pMixItr_
std::vector< const T * >::const_iterator pMixItrEnd_
bool getNewPileups(typename std::vector< const T *>::const_iterator &first, typename std::vector< const T *>::const_iterator &last)
unsigned int internalCtr_

◆ operator!=()

template<class T>
bool MixCollection< T >::MixItr::operator!= ( const MixItr itr)
inline

Definition at line 87 of file MixCollection.h.

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

87 { return internalCtr2_ != itr.internalCtr2_; }
unsigned int internalCtr2_

◆ operator*()

template<class T>
const T& MixCollection< T >::MixItr::operator* ( void  ) const
inline

Definition at line 84 of file MixCollection.h.

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

84 { return *(pMixItr_.operator*()); }
std::vector< const T * >::const_iterator pMixItr_

◆ operator++() [1/2]

template<class T>
const MixItr MixCollection< T >::MixItr::operator++ ( void  )
inline

Definition at line 85 of file MixCollection.h.

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

85 { return next(); }
const MixItr next()

◆ operator++() [2/2]

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

Definition at line 86 of file MixCollection.h.

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

86 { return next(); }
const MixItr next()

◆ operator->()

template<class T>
const T* MixCollection< T >::MixItr::operator-> ( ) const
inline

operators

Definition at line 83 of file MixCollection.h.

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

83 { return *(pMixItr_.operator->()); }
std::vector< const T * >::const_iterator pMixItr_

◆ reset()

template<class T>
void MixCollection< T >::MixItr::reset ( void  )
inlineprivate

Definition at line 117 of file MixCollection.h.

117 { ; }

Member Data Documentation

◆ first_

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

Definition at line 109 of file MixCollection.h.

◆ internalCtr2_

template<class T>
unsigned int MixCollection< T >::MixItr::internalCtr2_
private
Initial value:
=
0

Definition at line 113 of file MixCollection.h.

Referenced by MixCollection< T >::MixItr::MixItr(), and MixCollection< T >::MixItr::operator!=().

◆ internalCtr_

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

◆ iPileup_

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

Definition at line 110 of file MixCollection.h.

◆ iSignal_

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

Definition at line 110 of file MixCollection.h.

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

◆ mixCol_

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

Definition at line 107 of file MixCollection.h.

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

◆ myCF_

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

◆ nrDets_

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

Definition at line 108 of file MixCollection.h.

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

◆ pMixItr_

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

◆ pMixItrEnd_

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

Definition at line 104 of file MixCollection.h.

◆ trigger_

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