1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
// -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: t; tab-width: 8; -*-
#ifndef EESRFLAG_H
#define EESRFLAG_H
#include "DataFormats/EcalDetId/interface/EcalScDetId.h"
#include "DataFormats/EcalDigi/interface/EcalSrFlag.h"
#include "FWCore/Utilities/interface/Exception.h"
/** This class holds a Selective Readout Flag (SRF) associated to an
* ECAL endcap supercrystal.
*/
class EESrFlag : public EcalSrFlag {
public:
public:
typedef EcalScDetId key_type; //key for edm::SortedCollection
public:
/** Default constructor.
*/
EESrFlag() {}
/** Constructor
* @param sc supercrystal det id
* @param flag the srp flag, an integer in [0,7]. See constants SRF_xxx in EcalSrFlags class.
*/
EESrFlag(const EcalScDetId& sc, const int& flag) : scId_(sc) {
//SRP flag is coded on 3 bits:
if (flag < 0 || flag > 0x7)
throw cms::Exception("InvalidValue", "srp flag greater than 0x7 or negative.");
flag_ = (unsigned char)flag;
}
/** For edm::SortedCollection.
* @return det id of the trigger tower the flag is assigned to.
*/
const EcalScDetId& id() const override { return scId_; }
private:
/** trigger tower id
*/
EcalScDetId scId_;
};
std::ostream& operator<<(std::ostream& s, const EESrFlag& digi);
#endif //EESRFLAG_H not defined
|