00001 #ifndef CondFormats_EcalObjects_EcalSampleMask_H 00002 #define CondFormats_EcalObjects_EcalSampleMask_H 00003 00009 #include <iostream> 00010 #include <vector> 00011 #include "DataFormats/EcalDetId/interface/EBDetId.h" 00012 #include "DataFormats/EcalDetId/interface/EEDetId.h" 00013 00014 class EcalSampleMask { 00015 public: 00016 EcalSampleMask(); 00017 00018 // construct from pre-organized binary words 00019 EcalSampleMask(const unsigned int ebmask, const unsigned int eemask); 00020 // constructor from an ordered set of switches, one per sample 00021 EcalSampleMask( const std::vector<unsigned int> &ebmask, const std::vector<unsigned int> &eemask); 00022 00023 ~EcalSampleMask(); 00024 00025 void setEcalSampleMaskRecordEB( const unsigned int mask ) { sampleMaskEB_ = mask; } 00026 void setEcalSampleMaskRecordEE( const unsigned int mask ) { sampleMaskEB_ = mask; } 00027 void setEcalSampleMaskRecordEB( const std::vector<unsigned int> & ebmask ); 00028 void setEcalSampleMaskRecordEE( const std::vector<unsigned int> & eemask ); 00029 00030 float getEcalSampleMaskRecordEB() const { return sampleMaskEB_; } 00031 float getEcalSampleMaskRecordEE() const { return sampleMaskEE_; } 00032 void print(std::ostream& s) const { 00033 s << "EcalSampleMask: EB " << sampleMaskEB_ << "; EE " << sampleMaskEE_ ; 00034 } 00035 00036 bool useSampleEB (const int sampleId) const ; 00037 bool useSampleEE (const int sampleId) const ; 00038 bool useSample (const int sampleId, DetId &theCrystal) const; 00039 00040 private: 00041 unsigned int sampleMaskEB_; 00042 unsigned int sampleMaskEE_; 00043 00044 }; 00045 00046 00047 #endif