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 public:
12  inline virtual ~AbsPlan1RechitCombiner() {}
13 
14  // The topology should be set before the first call
15  // to "add" and whenever it changes
16  virtual void setTopo(const HcalTopology* topo) = 0;
17 
18  // The "clear" function is called once per event,
19  // at the beginning of the rechit processing
20  virtual void clear() = 0;
21 
22  // This method should be called to add a rechit to process.
23  // It will be assumed that the rechit reference will remain
24  // valid at the time "combine" method is called.
25  virtual void add(const HBHERecHit& rh) = 0;
26 
27  // This method should be called once per event,
28  // after all rechits have been added
29  virtual void combine(HBHERecHitCollection* collectionToFill) = 0;
30 
31 protected:
32  // The first element of the pair is the value to average
33  // and the second is the weight (energy). Non-positive weights
34  // will be ignored.
35  typedef std::pair<float, float> FPair;
36 
37  static float energyWeightedAverage(const FPair* data, unsigned len, float valueToReturnOnFailure);
38 };
39 
40 #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:80
virtual void setTopo(const HcalTopology *topo)=0