CMS 3D CMS Logo

HFPreRecHit.h
Go to the documentation of this file.
1 #ifndef DATAFORMATS_HCALRECHIT_HFPRERECHIT_H
2 #define DATAFORMATS_HCALRECHIT_HFPRERECHIT_H
3 
4 #include <utility>
5 
7 
15 {
16 public:
18 
19  HFPreRecHit();
20 
21  // In the constructor below, either "first" or "second"
22  // pointer can be nullptr
23  HFPreRecHit(const HcalDetId& id, const HFQIE10Info* first,
24  const HFQIE10Info* second);
25 
26  inline HcalDetId id() const {return id_;}
27 
28  // Get a pointer to the QIE10 info. nullptr will be returned
29  // if the info with the given index does not exist or if the
30  // index is out of range.
31  const HFQIE10Info* getHFQIE10Info(unsigned index) const;
32 
33  // Quantities simply added from both anodes
34  float charge() const;
35  float energy() const;
36 
37  // The following function returns a pair.
38  // The first element of the pair is the charge asymmetry,
39  // if calculated. The second element of the pair indicates
40  // whether the asymmetry is actually calculated. "true"
41  // means yes, it is. The asymmetry is calculated if all
42  // of the following conditions are satisfied:
43  //
44  // 1) The data is available for both PMT anodes.
45  // 2) The sum of the charges is positive.
46  // 3) The sum of the charges is at least "chargeThreshold".
47  //
48  // If the asymmetry is not calculated, the first element of
49  // the pair is set to 0 and the second to "false".
50  //
51  std::pair<float,bool> chargeAsymmetry(float chargeThreshold) const;
52 
53  // Similar function for the energy asymmetry
54  std::pair<float,bool> energyAsymmetry(float energyThreshold) const;
55 
56 private:
58 
60  bool hasInfo_[2];
61 };
62 
63 #endif // DATAFORMATS_HCALRECHIT_HFPRERECHIT_H
HcalDetId key_type
Definition: HFPreRecHit.h:17
float energy() const
Definition: HFPreRecHit.cc:33
const HFQIE10Info * getHFQIE10Info(unsigned index) const
Definition: HFPreRecHit.cc:42
HcalDetId id_
Definition: HFPreRecHit.h:57
U second(std::pair< T, U > const &p)
HcalDetId id() const
Definition: HFPreRecHit.h:26
std::pair< float, bool > energyAsymmetry(float energyThreshold) const
Definition: HFPreRecHit.cc:67
float charge() const
Definition: HFPreRecHit.cc:24
HFQIE10Info hfQIE10Info_[2]
Definition: HFPreRecHit.h:59
std::pair< float, bool > chargeAsymmetry(float chargeThreshold) const
Definition: HFPreRecHit.cc:50
bool hasInfo_[2]
Definition: HFPreRecHit.h:60