00001 #ifndef DATAFORMATS_CALORECHIT_CALORECHIT_H 00002 #define DATAFORMATS_CALORECHIT_CALORECHIT_H 1 00003 00004 #include "DataFormats/DetId/interface/DetId.h" 00005 #include <ostream> 00006 00007 00014 class CaloRecHit { 00015 public: 00016 CaloRecHit(); // for persistence 00017 explicit CaloRecHit(const DetId& id, float energy, float time, uint32_t flags = 0, uint32_t aux=0); 00018 virtual ~CaloRecHit(); 00019 float energy() const { return energy_; } 00020 float time() const { return time_; } 00021 const DetId& detid() const { return id_; } 00022 uint32_t flags() const { return flags_; } 00023 void setFlags(uint32_t flags) { flags_=flags; } 00024 void setFlagField(uint32_t value, int base, int width=1); 00025 uint32_t flagField(int base, int width=1) const; 00026 void setAux(uint32_t value) { aux_=value; } 00027 uint32_t aux() const { return aux_; } 00028 private: 00029 DetId id_; 00030 float energy_; 00031 float time_; 00032 uint32_t flags_; 00033 uint32_t aux_; 00034 }; 00035 00036 std::ostream& operator<<(std::ostream& s, const CaloRecHit& hit); 00037 00038 #endif