Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:20:15

0001 #ifndef UCTObject_hh
0002 #define UCTObject_hh
0003 
0004 #include <bitset>
0005 using std::bitset;
0006 
0007 class UCTObject {
0008 public:
0009   enum UCTObjectType {
0010     jet = 0x0000,
0011     tau = 0x0001,
0012     eGamma = 0x0010,
0013     isoTau = 0x0100,
0014     isoEGamma = 0x1000,
0015     ET = 0x10000,
0016     HT = 0x100000,
0017     MET = 0x1000000,
0018     MHT = 0x10000000,
0019     unknown = 0xDEADBEEF
0020   };
0021 
0022   UCTObject(UCTObjectType type, uint32_t et, int iEta, int iPhi, uint32_t pileup, uint32_t isolation, uint32_t et3x3)
0023       : myType(type), myET(et), myEta(iEta), myPhi(iPhi), myPileup(pileup), myIsolation(isolation), myEt3x3(et3x3) {
0024     myActiveTowerEta = 0;
0025     myActiveTowerPhi = 0;
0026     myNTaus = 0;
0027   }
0028 
0029   virtual ~UCTObject() { ; }
0030 
0031   // Equality operator is needed
0032 
0033   const UCTObject& operator=(const UCTObject& i) {
0034     myET = i.et();
0035     myEta = i.iEta();
0036     myPhi = i.iPhi();
0037     return *this;
0038   }
0039 
0040   // For sorting
0041 
0042   bool operator<(const UCTObject& other) const { return this->et() < other.et(); }
0043 
0044   // Is this needed?
0045   bool operator>(const UCTObject& other) const { return this->et() > other.et(); }
0046 
0047   // This is to compare exactly -- including location!
0048   bool operator==(const UCTObject& other) const {
0049     if (this->iEta() == other.iEta()) {
0050       if (this->iPhi() == other.iPhi()) {
0051         return this->et() == other.et();
0052       }
0053     }
0054     return false;
0055   }
0056 
0057   bool clearEvent() {
0058     myET = 0;
0059     return true;
0060   }
0061 
0062   // Access functions for convenience
0063 
0064   const uint32_t et() const { return myET; }
0065   const int iEta() const { return myEta; }
0066   const int iPhi() const { return myPhi; }
0067 
0068   const uint32_t pileup() const { return myPileup; }
0069   const uint32_t isolation() const { return myIsolation; }
0070   const uint32_t et3x3() const { return myEt3x3; }
0071   const uint32_t nTaus() const { return myNTaus; }
0072   const std::vector<uint32_t> boostedJetRegionET() const { return myBoostedJetRegionET; }
0073   const std::vector<uint32_t> boostedJetRegionTauVeto() const { return myBoostedJetRegionTauVeto; }
0074   bool setNTaus(uint32_t in) {
0075     myNTaus = in;
0076     return true;
0077   }
0078   bool setActiveTowerEta(bitset<12> in) {
0079     myActiveTowerEta = in;
0080     return true;
0081   }
0082   bool setActiveTowerPhi(bitset<12> in) {
0083     myActiveTowerPhi = in;
0084     return true;
0085   }
0086   bool setBoostedJetTowers(std::vector<uint32_t> in) {
0087     myBoostedJetTowers = in;
0088     return true;
0089   }
0090   bool setBoostedJetRegionET(std::vector<uint32_t> in) {
0091     myBoostedJetRegionET = in;
0092     return true;
0093   }
0094   bool setBoostedJetRegionTauVeto(std::vector<uint32_t> in) {
0095     myBoostedJetRegionTauVeto = in;
0096     return true;
0097   }
0098 
0099   void print(bool header = true);
0100 
0101 private:
0102   // No default constructor is needed
0103 
0104   UCTObject();
0105 
0106   // No copy constructor is needed
0107 
0108   UCTObject(const UCTObject&);
0109 
0110   // Object data
0111 
0112   UCTObjectType myType;
0113 
0114   uint32_t myET;
0115 
0116   int myEta;
0117   int myPhi;
0118 
0119   uint32_t myPileup;
0120   uint32_t myIsolation;
0121   uint32_t myEt3x3;
0122   uint32_t myNTaus;
0123   bitset<12> myActiveTowerEta;
0124   bitset<12> myActiveTowerPhi;
0125   std::vector<uint32_t> myBoostedJetTowers;
0126   std::vector<uint32_t> myBoostedJetRegionET;
0127   std::vector<uint32_t> myBoostedJetRegionTauVeto;
0128 };
0129 
0130 #endif