CMS 3D CMS Logo

Public Member Functions | Public Attributes | Static Public Attributes

reco::PatternSet< N > Struct Template Reference

#include <HitPattern.h>

List of all members.

Public Member Functions

unsigned char const * begin () const
unsigned char * begin ()
unsigned char const * end () const
unsigned char * end ()
void fill (reco::HitPattern const &hp)
unsigned char operator[] (int i) const
 PatternSet (reco::HitPattern const &hp)
 PatternSet ()
int size () const

Public Attributes

unsigned char hit [N]
unsigned char nhit

Static Public Attributes

static constexpr int MaxHits = N

Detailed Description

template<int N = reco::HitPattern::MaxHits>
struct reco::PatternSet< N >

Definition at line 815 of file HitPattern.h.


Constructor & Destructor Documentation

template<int N = reco::HitPattern::MaxHits>
reco::PatternSet< N >::PatternSet ( ) [inline]

Definition at line 827 of file HitPattern.h.

: nhit(0){}
template<int N = reco::HitPattern::MaxHits>
reco::PatternSet< N >::PatternSet ( reco::HitPattern const &  hp) [inline]

Definition at line 828 of file HitPattern.h.

References reco::PatternSet< N >::fill().

                                          {
      fill(hp);
    }

Member Function Documentation

template<int N = reco::HitPattern::MaxHits>
unsigned char const* reco::PatternSet< N >::begin ( void  ) const [inline]

Definition at line 820 of file HitPattern.h.

References reco::PatternSet< N >::hit.

Referenced by reco::commonHits().

{ return hit;}
template<int N = reco::HitPattern::MaxHits>
unsigned char* reco::PatternSet< N >::begin ( void  ) [inline]

Definition at line 822 of file HitPattern.h.

References reco::PatternSet< N >::hit.

{ return hit;}
template<int N = reco::HitPattern::MaxHits>
unsigned char const* reco::PatternSet< N >::end ( void  ) const [inline]

Definition at line 821 of file HitPattern.h.

References reco::PatternSet< N >::nhit.

Referenced by reco::commonHits().

{ return hit+nhit;}
template<int N = reco::HitPattern::MaxHits>
unsigned char* reco::PatternSet< N >::end ( void  ) [inline]

Definition at line 823 of file HitPattern.h.

References reco::PatternSet< N >::nhit.

{ return hit+nhit;}
template<int N = reco::HitPattern::MaxHits>
void reco::PatternSet< N >::fill ( reco::HitPattern const &  hp) [inline]

Definition at line 832 of file HitPattern.h.

References reco::HitPattern::call(), h, reco::PatternSet< N >::hit, reco::PatternSet< N >::MaxHits, reco::PatternSet< N >::nhit, AlCaHLTBitMon_ParallelJobs::p, listBenchmarks::pattern, timeUnitHelper::unpack(), and reco::HitPattern::validHitFilter().

Referenced by reco::PatternSet< N >::PatternSet().

                                         {
      int lhit=0;
      auto unpack =[&lhit,this](uint32_t pattern) -> bool {
        unsigned char p = 255&(pattern>>3);
        hit[lhit++]= p;
        
        // bouble sort
        if (lhit>1)
          for (auto h=hit+lhit-1; h!=hit; --h) {
            if ( (*(h-1)) <= p) break; // { (*h)=p;break;}
            (*h)=*(h-1);  *(h-1)=p;
        }
        return lhit<MaxHits;
      };
      hp.call(reco::HitPattern::validHitFilter,unpack);
      nhit=lhit;
    }
template<int N = reco::HitPattern::MaxHits>
unsigned char reco::PatternSet< N >::operator[] ( int  i) const [inline]

Definition at line 825 of file HitPattern.h.

References i.

{ return hit[i];}
template<int N = reco::HitPattern::MaxHits>
int reco::PatternSet< N >::size ( void  ) const [inline]

Definition at line 824 of file HitPattern.h.

References reco::PatternSet< N >::nhit.

{ return nhit;}

Member Data Documentation

template<int N = reco::HitPattern::MaxHits>
unsigned char reco::PatternSet< N >::hit[N]

Definition at line 817 of file HitPattern.h.

Referenced by reco::PatternSet< N >::begin(), and reco::PatternSet< N >::fill().

template<int N = reco::HitPattern::MaxHits>
constexpr int reco::PatternSet< N >::MaxHits = N [static]

Definition at line 816 of file HitPattern.h.

Referenced by reco::PatternSet< N >::fill().

template<int N = reco::HitPattern::MaxHits>
unsigned char reco::PatternSet< N >::nhit