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 99 of file StripCPEgeometric.cc.

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

Member Function Documentation

◆ addSuppressedEdgeStrip()

void StripCPEgeometric::WrappedCluster::addSuppressedEdgeStrip ( )
inline

Definition at line 102 of file StripCPEgeometric.cc.

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 }

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

Referenced by StripCPEgeometric::offset_from_firstStrip().

◆ centroid()

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

Definition at line 128 of file StripCPEgeometric.cc.

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 }

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

Referenced by StripCPEgeometric::offset_from_firstStrip().

◆ deformed()

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

Definition at line 141 of file StripCPEgeometric.cc.

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

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

Referenced by StripCPEgeometric::offset_from_firstStrip().

◆ dropSmallerEdgeStrip()

void StripCPEgeometric::WrappedCluster::dropSmallerEdgeStrip ( )
inline

Definition at line 114 of file StripCPEgeometric.cc.

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 }

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

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

◆ eta()

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

◆ last()

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

Definition at line 49 of file StripCPEgeometric.h.

49 { return *(first + N - 1); }

References first, and N.

◆ maxProjection()

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

Definition at line 145 of file StripCPEgeometric.cc.

145  {
146  return N * (1 + sign() * eta()).inverse();
147 }

References PVValHelper::eta, N, and Validation_hcalonly_cfi::sign.

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

◆ middle()

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

Definition at line 126 of file StripCPEgeometric.cc.

126 { return (first - clusterFirst) + N / 2.; }

References dqmdumpme::first, and N.

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

◆ sign()

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

Definition at line 151 of file StripCPEgeometric.cc.

151 { return (*first < last()) ? 1 : -1; }

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

Referenced by StripCPEgeometric::useNMinusOne().

◆ smallerEdgeStrip()

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

Definition at line 149 of file StripCPEgeometric.cc.

149 { return std::min(*first, last()); }

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

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

◆ sumQ()

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

Definition at line 135 of file StripCPEgeometric.cc.

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

References dqmdumpme::first, and N.

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
mps_fire.i
i
Definition: mps_fire.py:355
StripCPEgeometric::WrappedCluster::eta
stats_t< float > eta() const
Definition: StripCPEgeometric.cc:139
min
T min(T a, T b)
Definition: MathUtil.h:58
StripCPEgeometric::WrappedCluster::N
uint16_t N
Definition: StripCPEgeometric.h:46
StripCPEgeometric::WrappedCluster::last
const stats_t< float > & last() const
Definition: StripCPEgeometric.h:49
stats_t
Definition: ErrorPropogationTypes.h:38
class-composition.Q
Q
Definition: class-composition.py:82
StripCPEgeometric::WrappedCluster::sumQ
stats_t< float > sumQ() const
Definition: StripCPEgeometric.cc:135
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
StripCPEgeometric::WrappedCluster::first
std::vector< stats_t< float > >::const_iterator first
Definition: StripCPEgeometric.h:50
StripCPEgeometric::WrappedCluster::sign
int sign() const
Definition: StripCPEgeometric.cc:151
StripCPEgeometric::WrappedCluster::clusterFirst
std::vector< stats_t< float > >::const_iterator clusterFirst
Definition: StripCPEgeometric.h:50