Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:51:05

0001 #ifndef CondFormats_EcalObjects_EcalSampleMask_H
0002 #define CondFormats_EcalObjects_EcalSampleMask_H
0003 /**
0004  * Author: Giovanni Franzoni, UMN
0005  * Created: 09 Apr 2012
0006  * $Id: EcalSampleMask.h,v 1.1 2012/05/10 08:22:10 argiro Exp $
0007  **/
0008 
0009 #include "CondFormats/Serialization/interface/Serializable.h"
0010 
0011 #include <iostream>
0012 #include <vector>
0013 #include "DataFormats/EcalDetId/interface/EBDetId.h"
0014 #include "DataFormats/EcalDetId/interface/EEDetId.h"
0015 
0016 class EcalSampleMask {
0017 public:
0018   EcalSampleMask();
0019 
0020   // construct from pre-organized binary words
0021   EcalSampleMask(const unsigned int ebmask, const unsigned int eemask);
0022   // constructor from an ordered set of switches, one per sample
0023   EcalSampleMask(const std::vector<unsigned int> &ebmask, const std::vector<unsigned int> &eemask);
0024 
0025   ~EcalSampleMask();
0026 
0027   void setEcalSampleMaskRecordEB(const unsigned int mask) { sampleMaskEB_ = mask; }
0028   void setEcalSampleMaskRecordEE(const unsigned int mask) { sampleMaskEE_ = mask; }
0029   void setEcalSampleMaskRecordEB(const std::vector<unsigned int> &ebmask);
0030   void setEcalSampleMaskRecordEE(const std::vector<unsigned int> &eemask);
0031 
0032   float getEcalSampleMaskRecordEB() const { return sampleMaskEB_; }
0033   float getEcalSampleMaskRecordEE() const { return sampleMaskEE_; }
0034   void print(std::ostream &s) const { s << "EcalSampleMask: EB " << sampleMaskEB_ << "; EE " << sampleMaskEE_; }
0035 
0036   bool useSampleEB(const int sampleId) const;
0037   bool useSampleEE(const int sampleId) const;
0038   bool useSample(const int sampleId, DetId &theCrystal) const;
0039 
0040 private:
0041   unsigned int sampleMaskEB_;
0042   unsigned int sampleMaskEE_;
0043 
0044   COND_SERIALIZABLE;
0045 };
0046 
0047 #endif