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

◆ WrappedCluster()

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

Definition at line 100 of file StripCPEgeometric.cc.

101  : 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

◆ addSuppressedEdgeStrip()

void StripCPEgeometric::WrappedCluster::addSuppressedEdgeStrip ( )
inline

Definition at line 103 of file StripCPEgeometric.cc.

References PVValHelper::eta, first, dqmdumpme::last, and N.

Referenced by StripCPEgeometric::offset_from_firstStrip().

103  {
104  if (eta().sigmaFrom(0) < 1) {
105  first--;
106  N += 2;
107  } else if (*first > last()) {
108  first--;
109  N += 1;
110  } else {
111  N += 1;
112  }
113 }
const stats_t< float > & last() const
std::vector< stats_t< float > >::const_iterator first

◆ centroid()

stats_t< float > StripCPEgeometric::WrappedCluster::centroid ( ) const
inline

Definition at line 129 of file StripCPEgeometric.cc.

References first, mps_fire::i, N, hcaldqm::utilities::sumQ(), and trackerHitRTTI::vector.

Referenced by StripCPEgeometric::offset_from_firstStrip().

129  {
130  stats_t<float> sumXQ(0);
131  for (std::vector<stats_t<float> >::const_iterator i = first; i < first + N; i++)
132  sumXQ += (i - clusterFirst) * (*i);
133  return sumXQ / sumQ() + 0.5;
134 }
std::vector< stats_t< float > >::const_iterator first
std::vector< stats_t< float > >::const_iterator clusterFirst

◆ deformed()

bool StripCPEgeometric::WrappedCluster::deformed ( ) const
inline

Definition at line 142 of file StripCPEgeometric.cc.

References first, dqmdumpme::last, SiStripPI::max, and N.

Referenced by StripCPEgeometric::offset_from_firstStrip().

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

◆ dropSmallerEdgeStrip()

void StripCPEgeometric::WrappedCluster::dropSmallerEdgeStrip ( )
inline

Definition at line 115 of file StripCPEgeometric.cc.

References first, dqmdumpme::last, and N.

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

115  {
116  if (*first < last()) {
117  first++;
118  N -= 1;
119  } else if (last() < *first) {
120  N -= 1;
121  } else {
122  first++;
123  N -= 2;
124  }
125 }
const stats_t< float > & last() const
std::vector< stats_t< float > >::const_iterator first

◆ eta()

stats_t< float > StripCPEgeometric::WrappedCluster::eta ( void  ) const
inline

Definition at line 140 of file StripCPEgeometric.cc.

References first, dqmdumpme::last, and hcaldqm::utilities::sumQ().

Referenced by Particle.Particle::__str__(), StripCPEgeometric::geometric_position(), Jet.Jet::jetID(), Jet.Jet::puJetId(), and StripCPEgeometric::useNMinusOne().

140 { return (last() - *first) / sumQ(); }
const stats_t< float > & last() const
std::vector< stats_t< float > >::const_iterator first

◆ last()

const stats_t<float>& StripCPEgeometric::WrappedCluster::last ( ) const
inlineprivate

Definition at line 49 of file StripCPEgeometric.h.

References first, and N.

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

◆ maxProjection()

stats_t< float > StripCPEgeometric::WrappedCluster::maxProjection ( ) const
inline

◆ middle()

float StripCPEgeometric::WrappedCluster::middle ( ) const
inline

Definition at line 127 of file StripCPEgeometric.cc.

References first, and N.

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

127 { return (first - clusterFirst) + N / 2.; }
std::vector< stats_t< float > >::const_iterator first
std::vector< stats_t< float > >::const_iterator clusterFirst

◆ sign()

int StripCPEgeometric::WrappedCluster::sign ( void  ) const
inline

Definition at line 152 of file StripCPEgeometric.cc.

References first, and dqmdumpme::last.

Referenced by StripCPEgeometric::useNMinusOne().

152 { return (*first < last()) ? 1 : -1; }
const stats_t< float > & last() const
std::vector< stats_t< float > >::const_iterator first

◆ smallerEdgeStrip()

stats_t< float > StripCPEgeometric::WrappedCluster::smallerEdgeStrip ( ) const
inline

Definition at line 150 of file StripCPEgeometric.cc.

References first, dqmdumpme::last, and SiStripPI::min.

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

150 { return std::min(*first, last()); }
const stats_t< float > & last() const
std::vector< stats_t< float > >::const_iterator first

◆ sumQ()

stats_t< float > StripCPEgeometric::WrappedCluster::sumQ ( ) const
inline

Definition at line 136 of file StripCPEgeometric.cc.

References first, and N.

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

Member Data Documentation

◆ clusterFirst

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

Definition at line 50 of file StripCPEgeometric.h.

◆ first

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

Definition at line 50 of file StripCPEgeometric.h.

Referenced by last().

◆ N

uint16_t StripCPEgeometric::WrappedCluster::N