CMS 3D CMS Logo

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 33 of file StripCPEgeometric.h.

Constructor & Destructor Documentation

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

Definition at line 99 of file StripCPEgeometric.cc.

100  : N(Q.size() - 2), clusterFirst(Q.begin() + 1), first(clusterFirst) {}
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(), first, last(), and N.

Referenced by StripCPEgeometric::offset_from_firstStrip().

102  {
103  if (eta().sigmaFrom(0) < 1) {
104  first--;
105  N += 2;
106  } else if (*first > last()) {
107  first--;
108  N += 1;
109  } else {
110  N += 1;
111  }
112 }
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 128 of file StripCPEgeometric.cc.

References clusterFirst, first, mps_fire::i, N, and sumQ().

Referenced by StripCPEgeometric::offset_from_firstStrip().

128  {
129  stats_t<float> sumXQ(0);
130  for (std::vector<stats_t<float> >::const_iterator i = first; i < first + N; i++)
131  sumXQ += (i - clusterFirst) * (*i);
132  return sumXQ / sumQ() + 0.5;
133 }
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 first, last(), SiStripPI::max, and N.

Referenced by StripCPEgeometric::offset_from_firstStrip().

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

Definition at line 114 of file StripCPEgeometric.cc.

References first, last(), and N.

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

114  {
115  if (*first < last()) {
116  first++;
117  N -= 1;
118  } else if (last() < *first) {
119  N -= 1;
120  } else {
121  first++;
122  N -= 2;
123  }
124 }
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 49 of file StripCPEgeometric.h.

References first.

Referenced by addSuppressedEdgeStrip(), deformed(), dropSmallerEdgeStrip(), eta(), sign(), and smallerEdgeStrip().

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

Definition at line 145 of file StripCPEgeometric.cc.

References eta(), N, and sign().

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

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

Definition at line 126 of file StripCPEgeometric.cc.

References clusterFirst, first, and N.

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

126 { 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 151 of file StripCPEgeometric.cc.

References first, and last().

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

151 { 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 149 of file StripCPEgeometric.cc.

References first, last(), and min().

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

149 { 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 135 of file StripCPEgeometric.cc.

References first, and N.

Referenced by centroid(), and eta().

135  {
136  return accumulate(first, first + N, stats_t<float>(0));
137 }
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 50 of file StripCPEgeometric.h.

Referenced by centroid(), and middle().

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