CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes
StripCPEgeometric::WrappedCluster Class Reference

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 41 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.

94  :
95  N(Q.size()-2),
96  clusterFirst(Q.begin()+1),
98  {}
std::vector< stats_t< float > >::const_iterator first
std::vector< stats_t< float > >::const_iterator clusterFirst

Member Function Documentation

void StripCPEgeometric::WrappedCluster::addSuppressedEdgeStrip ( )
inline

Definition at line 102 of file StripCPEgeometric.cc.

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

Referenced by StripCPEgeometric::offset_from_firstStrip().

102  {
103  if( eta().sigmaFrom(0) < 1 ) { first--; N+=2; }
104  else if( *first > last() ) { first--; N+=1; }
105  else { N+=1; }
106 }
const stats_t< float > & last() const
std::vector< stats_t< float > >::const_iterator first
stats_t< float > StripCPEgeometric::WrappedCluster::centroid ( ) const
inline

Definition at line 123 of file StripCPEgeometric.cc.

References plotBeamSpotDB::first, i, and N.

Referenced by StripCPEgeometric::offset_from_firstStrip().

123  {
124  stats_t<float> sumXQ(0);
125  for(std::vector<stats_t<float> >::const_iterator i = first; i<first+N; i++) sumXQ += (i-clusterFirst)*(*i);
126  return sumXQ/sumQ() + 0.5;
127 }
int i
Definition: DBlmapReader.cc:9
stats_t< float > sumQ() const
std::vector< stats_t< float > >::const_iterator first
std::vector< stats_t< float > >::const_iterator clusterFirst
bool StripCPEgeometric::WrappedCluster::deformed ( ) const
inline

Definition at line 141 of file StripCPEgeometric.cc.

References plotBeamSpotDB::first, prof2calltree::last, bookConverter::max, and N.

Referenced by StripCPEgeometric::offset_from_firstStrip().

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

Definition at line 110 of file StripCPEgeometric.cc.

References plotBeamSpotDB::first, prof2calltree::last, and N.

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

110  {
111  if( *first < last() ) { first++; N-=1; } else
112  if( last() < *first ) { N-=1; } else
113  { first++; N-=2; }
114 }
const stats_t< float > & last() const
std::vector< stats_t< float > >::const_iterator first
stats_t< float > StripCPEgeometric::WrappedCluster::eta ( void  ) const
inline
const stats_t<float>& StripCPEgeometric::WrappedCluster::last ( ) const
inlineprivate

Definition at line 56 of file StripCPEgeometric.h.

References first, and N.

56 {return *(first+N-1);}
std::vector< stats_t< float > >::const_iterator first
stats_t< float > StripCPEgeometric::WrappedCluster::maxProjection ( ) const
inline
float StripCPEgeometric::WrappedCluster::middle ( ) const
inline

Definition at line 118 of file StripCPEgeometric.cc.

References plotBeamSpotDB::first, and N.

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

119 { return (first-clusterFirst) + N/2.;}
std::vector< stats_t< float > >::const_iterator first
std::vector< stats_t< float > >::const_iterator clusterFirst
int StripCPEgeometric::WrappedCluster::sign ( void  ) const
inline

Definition at line 156 of file StripCPEgeometric.cc.

References plotBeamSpotDB::first, and prof2calltree::last.

Referenced by StripCPEgeometric::useNMinusOne().

157 { return ( *first < last() ) ? 1 : -1; }
const stats_t< float > & last() const
std::vector< stats_t< float > >::const_iterator first
stats_t< float > StripCPEgeometric::WrappedCluster::smallerEdgeStrip ( ) const
inline

Definition at line 151 of file StripCPEgeometric.cc.

References plotBeamSpotDB::first, prof2calltree::last, and min().

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

152 { return std::min(*first, last()); }
T min(T a, T b)
Definition: MathUtil.h:58
const stats_t< float > & last() const
std::vector< stats_t< float > >::const_iterator first
stats_t< float > StripCPEgeometric::WrappedCluster::sumQ ( ) const
inline

Definition at line 131 of file StripCPEgeometric.cc.

References plotBeamSpotDB::first, and N.

132 { return accumulate(first, first+N, stats_t<float>(0));}
std::vector< stats_t< float > >::const_iterator first

Member Data Documentation

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

Definition at line 57 of file StripCPEgeometric.h.

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

Definition at line 57 of file StripCPEgeometric.h.

Referenced by last().

uint16_t StripCPEgeometric::WrappedCluster::N