CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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

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

Definition at line 35 of file AbsPlan1RechitCombiner.h.

Constructor & Destructor Documentation

virtual AbsPlan1RechitCombiner::~AbsPlan1RechitCombiner ( )
inlinevirtual

Definition at line 12 of file AbsPlan1RechitCombiner.h.

12 {}

Member Function Documentation

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

Implemented in SimplePlan1RechitCombiner.

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

Implemented in SimplePlan1RechitCombiner.

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

Definition at line 3 of file AbsPlan1RechitCombiner.cc.

References validate-o2o-wbm::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 }
const double w
Definition: UKUtility.cc:23
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
virtual void AbsPlan1RechitCombiner::setTopo ( const HcalTopology topo)
pure virtual

Implemented in SimplePlan1RechitCombiner.