Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:53:16

0001 // -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: t; tab-width: 8; -*-
0002 
0003 #ifndef EESRFLAG_H
0004 #define EESRFLAG_H
0005 
0006 #include "DataFormats/EcalDetId/interface/EcalScDetId.h"
0007 #include "DataFormats/EcalDigi/interface/EcalSrFlag.h"
0008 #include "FWCore/Utilities/interface/Exception.h"
0009 
0010 /** This class holds a Selective Readout Flag (SRF) associated to an
0011  * ECAL endcap supercrystal.
0012  */
0013 class EESrFlag : public EcalSrFlag {
0014 public:
0015 public:
0016   typedef EcalScDetId key_type;  //key for edm::SortedCollection
0017 
0018 public:
0019   /** Default constructor.
0020    */
0021   EESrFlag(){};
0022 
0023   /** Constructor
0024    * @param sc supercrystal det id
0025    * @param flag the srp flag, an integer in [0,7]. See constants SRF_xxx in EcalSrFlags class.
0026    */
0027   EESrFlag(const EcalScDetId& sc, const int& flag) : scId_(sc) {
0028     //SRP flag is coded on 3 bits:
0029     if (flag < 0 || flag > 0x7)
0030       throw cms::Exception("InvalidValue", "srp flag greater than 0x7 or negative.");
0031     flag_ = (unsigned char)flag;
0032   }
0033 
0034   /** For edm::SortedCollection.
0035    * @return det id of the trigger tower the flag is assigned to.
0036    */
0037   const EcalScDetId& id() const override { return scId_; }
0038 
0039 private:
0040   /** trigger tower id
0041    */
0042   EcalScDetId scId_;
0043 };
0044 
0045 std::ostream& operator<<(std::ostream& s, const EESrFlag& digi);
0046 
0047 #endif  //EESRFLAG_H not defined