CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Types | Static Protected Member Functions
AbsPlan1RechitCombiner Class Referenceabstract

#include <AbsPlan1RechitCombiner.h>

Inheritance diagram for AbsPlan1RechitCombiner:
SimplePlan1RechitCombiner

Public Member Functions

virtual void add (const HBHERecHit &rh)=0
 
virtual void clear ()=0
 
virtual void combine (HBHERecHitCollection *collectionToFill)=0
 
virtual void setTopo (const HcalTopology *topo)=0
 
virtual ~AbsPlan1RechitCombiner ()
 

Protected Types

typedef std::pair< float, float > FPair
 

Static Protected Member Functions

static float energyWeightedAverage (const FPair *data, unsigned len, float valueToReturnOnFailure)
 

Detailed Description

Definition at line 10 of file AbsPlan1RechitCombiner.h.

Member Typedef Documentation

◆ FPair

typedef std::pair<float, float> AbsPlan1RechitCombiner::FPair
protected

Definition at line 35 of file AbsPlan1RechitCombiner.h.

Constructor & Destructor Documentation

◆ ~AbsPlan1RechitCombiner()

virtual AbsPlan1RechitCombiner::~AbsPlan1RechitCombiner ( )
inlinevirtual

Definition at line 12 of file AbsPlan1RechitCombiner.h.

12 {}

Member Function Documentation

◆ add()

virtual void AbsPlan1RechitCombiner::add ( const HBHERecHit rh)
pure virtual

◆ clear()

virtual void AbsPlan1RechitCombiner::clear ( )
pure virtual

Implemented in SimplePlan1RechitCombiner.

◆ combine()

virtual void AbsPlan1RechitCombiner::combine ( HBHERecHitCollection collectionToFill)
pure virtual

Implemented in SimplePlan1RechitCombiner.

◆ energyWeightedAverage()

float AbsPlan1RechitCombiner::energyWeightedAverage ( const FPair data,
unsigned  len,
float  valueToReturnOnFailure 
)
staticprotected

Definition at line 3 of file AbsPlan1RechitCombiner.cc.

References data, f, mps_fire::i, and w().

Referenced by SimplePlan1RechitCombiner::makeRechit().

5  {
6  double sum = 0.0, wsum = 0.0;
7  for (unsigned i = 0; i < len; ++i) {
8  const float w = data[i].second;
9  if (w > 0.f) {
10  sum += w * data[i].first;
11  wsum += w;
12  }
13  }
14  if (wsum > 0.0)
15  return sum / wsum;
16  else
17  return valueToReturnOnFailure;
18 }
T w() const
double f[11][100]
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80

◆ setTopo()

virtual void AbsPlan1RechitCombiner::setTopo ( const HcalTopology topo)
pure virtual

Implemented in SimplePlan1RechitCombiner.