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

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

Definition at line 36 of file AbsPlan1RechitCombiner.h.

Constructor & Destructor Documentation

virtual AbsPlan1RechitCombiner::~AbsPlan1RechitCombiner ( )
inlinevirtual

Definition at line 13 of file AbsPlan1RechitCombiner.h.

References add(), clear(), combine(), and setTopo().

13 {}

Member Function Documentation

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

Implemented in SimplePlan1RechitCombiner.

Referenced by ~AbsPlan1RechitCombiner().

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

Implemented in SimplePlan1RechitCombiner.

Referenced by ~AbsPlan1RechitCombiner().

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

Definition at line 3 of file AbsPlan1RechitCombiner.cc.

References f, mps_fire::i, and w.

Referenced by SimplePlan1RechitCombiner::makeRechit().

6 {
7  double sum = 0.0, wsum = 0.0;
8  for (unsigned i=0; i<len; ++i)
9  {
10  const float w = data[i].second;
11  if (w > 0.f)
12  {
13  sum += w*data[i].first;
14  wsum += w;
15  }
16  }
17  if (wsum > 0.0)
18  return sum/wsum;
19  else
20  return valueToReturnOnFailure;
21 }
const double w
Definition: UKUtility.cc:23
double f[11][100]
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
virtual void AbsPlan1RechitCombiner::setTopo ( const HcalTopology topo)
pure virtual

Implemented in SimplePlan1RechitCombiner.

Referenced by ~AbsPlan1RechitCombiner().