CMS 3D CMS Logo

Public Member Functions | Public Attributes | Private Member Functions | Private Attributes

StripCPEgeometric::WrappedCluster Class Reference

List of all members.

Public Member Functions

void addSuppressedEdgeStrip ()
stats_t< float > centroid () const
bool deformed () const
void dropSmallerEdgeStrip ()
stats_t< float > eta () const
stats_t< float > maxProjection () const
float middle () const
int sign () const
stats_t< float > smallerEdgeStrip () const
stats_t< float > sumQ () const
 WrappedCluster (const std::vector< stats_t< float > > &)

Public Attributes

uint16_t N

Private Member Functions

const stats_t< float > & last () const

Private Attributes

std::vector< stats_t< float >
>::const_iterator 
clusterFirst
std::vector< stats_t< float >
>::const_iterator 
first

Detailed Description

Definition at line 40 of file StripCPEgeometric.h.


Constructor & Destructor Documentation

StripCPEgeometric::WrappedCluster::WrappedCluster ( const std::vector< stats_t< float > > &  Q)

Definition at line 94 of file StripCPEgeometric.cc.

                                                    : 
  N(Q.size()-2),
  clusterFirst(Q.begin()+1),
  first(clusterFirst)
  {}

Member Function Documentation

void StripCPEgeometric::WrappedCluster::addSuppressedEdgeStrip ( ) [inline]

Definition at line 102 of file StripCPEgeometric.cc.

References eta(), first, prof2calltree::last, and N.

Referenced by StripCPEgeometric::offset_from_firstStrip().

                         {
  if( eta().sigmaFrom(0) < 1 ) { first--; N+=2; } 
  else if( *first > last() )   { first--; N+=1; } 
  else                         {          N+=1; }
}
stats_t< float > StripCPEgeometric::WrappedCluster::centroid ( ) const [inline]

Definition at line 123 of file StripCPEgeometric.cc.

References first, i, and N.

Referenced by StripCPEgeometric::offset_from_firstStrip().

                 { 
  stats_t<float> sumXQ(0);
  for(std::vector<stats_t<float> >::const_iterator i = first; i<first+N; i++) sumXQ += (i-clusterFirst)*(*i);
  return sumXQ/sumQ() + 0.5;
}
bool StripCPEgeometric::WrappedCluster::deformed ( ) const [inline]

Definition at line 141 of file StripCPEgeometric.cc.

References first, prof2calltree::last, max(), and N.

Referenced by StripCPEgeometric::offset_from_firstStrip().

{  return  N>2  &&  std::max((*first)(),last()()) > accumulate(first+1,first+N-1,stats_t<float>(0))() / (N-2);}
void StripCPEgeometric::WrappedCluster::dropSmallerEdgeStrip ( ) [inline]

Definition at line 110 of file StripCPEgeometric.cc.

References first, prof2calltree::last, and N.

Referenced by StripCPEgeometric::offset_from_firstStrip(), and StripCPEgeometric::useNMinusOne().

                       {
  if( *first < last() ) { first++; N-=1; } else 
  if( last() < *first ) {          N-=1; } else  
                        { first++; N-=2; } 
}
stats_t< float > StripCPEgeometric::WrappedCluster::eta ( void  ) const [inline]

Definition at line 136 of file StripCPEgeometric.cc.

References first, and prof2calltree::last.

Referenced by StripCPEgeometric::geometric_position(), and StripCPEgeometric::useNMinusOne().

{ return  ( last() - *first ) / sumQ() ;}
const stats_t<float>& StripCPEgeometric::WrappedCluster::last ( ) const [inline, private]

Definition at line 55 of file StripCPEgeometric.h.

References first, and N.

{return *(first+N-1);}
stats_t< float > StripCPEgeometric::WrappedCluster::maxProjection ( ) const [inline]

Definition at line 146 of file StripCPEgeometric.cc.

References eta(), and N.

Referenced by StripCPEgeometric::offset_from_firstStrip(), StripCPEgeometric::useNMinusOne(), and StripCPEgeometric::useNPlusOne().

{ return N * (1 + sign()*eta() ).inverse(); }
float StripCPEgeometric::WrappedCluster::middle ( ) const [inline]

Definition at line 118 of file StripCPEgeometric.cc.

References first, and N.

Referenced by StripCPEgeometric::geometric_position(), and StripCPEgeometric::offset_from_firstStrip().

{ return (first-clusterFirst) + N/2.;}
int StripCPEgeometric::WrappedCluster::sign ( void  ) const [inline]

Definition at line 156 of file StripCPEgeometric.cc.

References first, and prof2calltree::last.

Referenced by StripCPEgeometric::useNMinusOne().

{ return ( *first < last() ) ? 1  : -1; }
stats_t< float > StripCPEgeometric::WrappedCluster::smallerEdgeStrip ( ) const [inline]

Definition at line 151 of file StripCPEgeometric.cc.

References first, prof2calltree::last, and min.

Referenced by StripCPEgeometric::ambiguousSize(), and StripCPEgeometric::useNMinusOne().

{ return std::min(*first, last()); }
stats_t< float > StripCPEgeometric::WrappedCluster::sumQ ( ) const [inline]

Definition at line 131 of file StripCPEgeometric.cc.

References first, and N.

{ return accumulate(first, first+N, stats_t<float>(0));}

Member Data Documentation

std::vector<stats_t<float> >::const_iterator StripCPEgeometric::WrappedCluster::clusterFirst [private]

Definition at line 56 of file StripCPEgeometric.h.

std::vector<stats_t<float> >::const_iterator StripCPEgeometric::WrappedCluster::first [private]

Definition at line 56 of file StripCPEgeometric.h.

Referenced by last().