Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:28:48

0001 #ifndef SimDataFormats_CaloHit_H
0002 #define SimDataFormats_CaloHit_H
0003 ///////////////////////////////////////////////////////////////////////////////
0004 // File: CaloHit.h
0005 // Hit class for QIE analysis
0006 ///////////////////////////////////////////////////////////////////////////////
0007 
0008 #include <iostream>
0009 #include <cmath>
0010 #include <cstdint>
0011 
0012 class CaloHit {
0013 public:
0014   CaloHit(int deti, int layi, double ei, double etai, double phii, double timi, uint32_t idi = 0);
0015   CaloHit();
0016   CaloHit(const CaloHit&);
0017   virtual ~CaloHit();
0018 
0019   int det() const { return deth; }
0020   int layer() const { return layerh; }
0021   double e() const { return eh; }
0022   double eta() const { return etah; }
0023   double phi() const { return phih; }
0024   double t() const { return timeh; }
0025   uint32_t id() const { return idh; }
0026   void setId(const uint32_t idi) { idh = idi; }
0027 
0028   bool operator<(const CaloHit& hit) const;
0029 
0030 private:
0031   int deth, layerh;
0032   double eh, etah, phih, timeh;
0033   uint32_t idh;
0034 };
0035 
0036 class CaloHitMore {
0037 public:
0038   bool operator()(const CaloHit* a, const CaloHit* b) { return (a->t() < b->t()); }
0039 };
0040 
0041 class CaloHitIdMore {
0042 public:
0043   bool operator()(const CaloHit* a, const CaloHit* b) {
0044     if (a->id() < b->id()) {
0045       return true;
0046     } else if (a->id() > b->id()) {
0047       return false;
0048     } else {
0049       return (a->t() < b->t());
0050     }
0051   }
0052 };
0053 
0054 class CaloHitELess {
0055 public:
0056   bool operator()(const CaloHit* a, const CaloHit* b) { return (a->e() > b->e()); }
0057 };
0058 
0059 class CaloHitEtLess {
0060 public:
0061   bool operator()(const CaloHit* a, const CaloHit* b) {
0062     return (a->e() / std::cosh(a->eta()) > b->e() / std::cosh(b->eta()));
0063   }
0064 };
0065 
0066 std::ostream& operator<<(std::ostream&, const CaloHit&);
0067 #endif