CMS 3D CMS Logo

AbsPlan1RechitCombiner.h
Go to the documentation of this file.
1 #ifndef RecoLocalCalo_HcalRecAlgos_AbsPlan1RechitCombiner_h_
2 #define RecoLocalCalo_HcalRecAlgos_AbsPlan1RechitCombiner_h_
3 
4 #include <utility>
5 
7 
8 class HcalTopology;
9 
11 {
12 public:
13  inline virtual ~AbsPlan1RechitCombiner() {}
14 
15  // The topology should be set before the first call
16  // to "add" and whenever it changes
17  virtual void setTopo(const HcalTopology* topo) = 0;
18 
19  // The "clear" function is called once per event,
20  // at the beginning of the rechit processing
21  virtual void clear() = 0;
22 
23  // This method should be called to add a rechit to process.
24  // It will be assumed that the rechit reference will remain
25  // valid at the time "combine" method is called.
26  virtual void add(const HBHERecHit& rh) = 0;
27 
28  // This method should be called once per event,
29  // after all rechits have been added
30  virtual void combine(HBHERecHitCollection* collectionToFill) = 0;
31 
32 protected:
33  // The first element of the pair is the value to average
34  // and the second is the weight (energy). Non-positive weights
35  // will be ignored.
36  typedef std::pair<float, float> FPair;
37 
38  static float energyWeightedAverage(const FPair* data, unsigned len,
39  float valueToReturnOnFailure);
40 };
41 
42 #endif // RecoLocalCalo_HcalRecAlgos_AbsPlan1RechitCombiner_h_
virtual void combine(HBHERecHitCollection *collectionToFill)=0
virtual void clear()=0
static float energyWeightedAverage(const FPair *data, unsigned len, float valueToReturnOnFailure)
virtual void add(const HBHERecHit &rh)=0
std::pair< float, float > FPair
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
virtual void setTopo(const HcalTopology *topo)=0