CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC2/src/DataFormats/L1GlobalCaloTrigger/interface/L1GctInternJetData.h

Go to the documentation of this file.
00001 #ifndef L1GCTINTERNJETDATA_H
00002 #define L1GCTINTERNJETDATA_H
00003 
00004 #include <string>
00005 
00006 #include "DataFormats/L1CaloTrigger/interface/L1CaloRegionDetId.h"
00007 
00013 
00014 
00015 class L1GctInternJetData {
00016 
00017  public:
00018 
00019   enum L1GctInternJetType { null, emulator, jet_cluster, jet_cluster_minimal, jet_precluster,gct_trig_object };
00020 
00021 public:
00022 
00024   L1GctInternJetData();
00025 
00027   L1GctInternJetData(L1CaloRegionDetId rgn,
00028                      uint16_t capBlock,
00029                      uint16_t capIndex,
00030                      int16_t bx,
00031                      uint8_t sgnEta,
00032                      uint8_t oflow,
00033                      uint16_t et,
00034                      uint8_t eta,
00035                      uint8_t phi,
00036                      uint8_t tauVeto,
00037                      uint8_t rank);
00038 
00039   // 'named' constructors to avoid confusion
00040 
00041   // emulator calibrated jet ctor
00042   static L1GctInternJetData fromEmulator(L1CaloRegionDetId rgn,
00043                                          int16_t bx,
00044                                          uint16_t et, 
00045                                          bool overFlow, 
00046                                          bool tauVeto,
00047                                          uint8_t eta,
00048                                          uint8_t phi,
00049                                          uint16_t rank);
00050                                        
00052   static L1GctInternJetData fromJetCluster(L1CaloRegionDetId rgn,
00053                                            uint16_t capBlock,
00054                                            uint16_t capIndex,
00055                                            int16_t bx,
00056                                            uint32_t data);
00057 
00059   static L1GctInternJetData fromJetPreCluster(L1CaloRegionDetId rgn,
00060                                               uint16_t capBlock,
00061                                               uint16_t capIndex,
00062                                               int16_t bx,
00063                                               uint32_t data);
00064 
00066   static L1GctInternJetData fromJetClusterMinimal(L1CaloRegionDetId rgn,
00067                                                   uint16_t capBlock,
00068                                                   uint16_t capIndex,
00069                                                   int16_t bx,
00070                                                   uint32_t data);
00071                                          
00073   static L1GctInternJetData fromGctTrigObject(L1CaloRegionDetId rgn,
00074                                               uint16_t capBlock,
00075                                               uint16_t capIndex,
00076                                               int16_t bx,
00077                                               uint32_t data);
00078 
00079 
00081   virtual ~L1GctInternJetData();
00082 
00083 
00084   // getters
00085 
00087   L1GctInternJetData::L1GctInternJetType type() const { return type_; }
00088 
00090   L1CaloRegionDetId regionId() const { return regionId_; }
00091 
00093   bool empty() const { return (data_ == 0); }
00094 
00096   uint16_t capBlock() const { return capBlock_; }
00097 
00099   uint16_t capIndex() const { return capIndex_; }
00100 
00102   int16_t bx() const { return bx_; }
00103 
00105   uint32_t raw() const { return data_; }
00106   
00108   uint16_t rank() const { return data_ & 0x3f; }
00109   
00111   uint16_t tauVeto() const { return (data_>>6) & 0x1; }
00112 
00114   uint16_t phi() const { return (data_>>7) & 0x1f; }
00115 
00117   uint16_t eta() const { return (data_>>12) & 0xf; }
00118   
00120   uint16_t et() const { return (data_>>16) & 0xfff; }
00121 
00123   uint16_t oflow() const { return (data_>>28) & 0x1; }
00124 
00126   uint16_t sgnEta() const { return (data_>>29) & 0x1; }
00127 
00128 
00129   // setters
00130 
00132   void setRegionId(L1CaloRegionDetId rgn) { regionId_ = rgn; }
00133 
00135   void setCapBlock(uint16_t capBlock) { capBlock_ = capBlock; }
00136 
00138   void setCapIndex(uint16_t capIndex) { capIndex_ = capIndex; }
00139 
00141   void setBx(uint16_t bx) { bx_ = bx; }
00142 
00144   void setType(L1GctInternJetType type) { type_ = type; }
00145 
00147   void setRawData(uint32_t data) { data_ = data; }
00148 
00150   void setData(uint8_t sgnEta,
00151                uint8_t oflow,
00152                uint16_t et,
00153                uint8_t eta,
00154                uint8_t phi,
00155                uint8_t tauVeto,
00156                uint8_t rank);
00157 
00158 
00159   // operators
00160 
00162   bool operator==(const L1GctInternJetData& c) const;
00163   
00165   bool operator!=(const L1GctInternJetData& c) const { return !(*this == c); }
00166   
00167 
00168  private:
00169 
00170   // location in calorimeter (optionally set by unpacker)
00171   L1CaloRegionDetId regionId_;
00172 
00173   // source of the data
00174   uint16_t capBlock_;
00175   uint16_t capIndex_;
00176   int16_t bx_;
00177 
00178   // type of data
00179   L1GctInternJetType type_;
00180 
00181   // the captured data
00182   uint32_t data_;
00183 
00184  };
00185 
00186 std::ostream& operator<<(std::ostream& s, const L1GctInternJetData& cand);
00187 
00188 #endif