CMS 3D CMS Logo

MuonHOAcceptance.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 #include <vector>
3 #include <list>
4 #include <cstdint>
6 
7 class TMultiGraph;
8 
10  public:
11  static bool isChannelDead(uint32_t id);
12  static bool isChannelSiPM(uint32_t id);
13  static bool inGeomAccept(double eta, double phi, double delta_eta = 0.,
14  double delta_phi = 0.);
15  static bool inNotDeadGeom(double eta, double phi, double delta_eta = 0.,
16  double delta_phi = 0.);
17  static bool inSiPMGeom(double eta, double phi, double delta_eta = 0.,
18  double delta_phi = 0.);
19  static void initIds(edm::EventSetup const& eSetup);
20  static bool Inited() { return inited; }
21  static TMultiGraph * graphDeadRegions() { return graphRegions(deadRegions); }
22  static TMultiGraph * graphSiPMRegions() { return graphRegions(SiPMRegions); }
23 
24  private:
25 
26  struct deadRegion {
27  deadRegion( double eMin = 0., double eMax = 0.,
28  double pMin = 0., double pMax = 0. ) :
31  etaMin(other.etaMin), etaMax(other.etaMax),
32  phiMin(other.phiMin), phiMax(other.phiMax) { }
33  double etaMin;
34  double etaMax;
35  double phiMin;
36  double phiMax;
37  bool operator== ( deadRegion const& other) {
38  return ((other.etaMin==etaMin) && (other.etaMax==etaMax) &&
39  (other.phiMin==phiMin) && (other.phiMax==phiMax));
40  }
41  };
42 
43  struct deadIdRegion {
44  deadIdRegion( int eMin = 0, int eMax = 0, int pMin = 0, int pMax = 0 ) :
47  etaMin(other.etaMin), etaMax(other.etaMax),
48  phiMin(other.phiMin), phiMax(other.phiMax) { }
49  int etaMin;
50  int etaMax;
51  int phiMin;
52  int phiMax;
53  bool operator== ( deadIdRegion const& other ) {
54  return ((other.etaMin==etaMin) && (other.etaMax==etaMax) &&
55  (other.phiMin==phiMin) && (other.phiMax==phiMax));
56  }
57  bool sameEta (deadIdRegion const& other) {
58  return ((other.etaMin==etaMin) && (other.etaMax==etaMax));
59  }
60  bool samePhi (deadIdRegion const& other) {
61  return ((other.phiMax==phiMax) && (other.phiMin==phiMin));
62  }
63  bool adjacentEta (deadIdRegion const& other) {
64  return ( (other.etaMin-1 == etaMax) ||
65  (etaMin-1 == other.etaMax ) );
66  }
67  bool adjacentPhi (deadIdRegion const& other) {
68  return ( (other.phiMin-1 == phiMax) ||
69  (phiMin-1 == other.phiMax) );
70  }
71  void merge (deadIdRegion const& other);
72  };
73 
74  static void buildDeadAreas();
75  static void buildSiPMAreas();
76  static void mergeRegionLists(std::list<deadIdRegion>& didregions);
77  static void convertRegions(std::list<deadIdRegion> const& idregions,
78  std::vector<deadRegion>& regions);
79  static TMultiGraph * graphRegions(std::vector<deadRegion> const& regions);
80 
81  static std::vector<uint32_t> deadIds;
82  static std::vector<deadRegion> deadRegions;
83  static std::vector<uint32_t> SiPMIds;
84  static std::vector<deadRegion> SiPMRegions;
85  static bool inited;
86  static int const etaBounds;
87  static double const etaMin[];
88  static double const etaMax[];
89  static double const twopi;
90  static int const phiSectors;
91  static double const phiMinR0[];
92  static double const phiMaxR0[];
93  static double const phiMinR12[];
94  static double const phiMaxR12[];
95 };
bool adjacentPhi(deadIdRegion const &other)
static double const twopi
static bool inSiPMGeom(double eta, double phi, double delta_eta=0., double delta_phi=0.)
bool sameEta(deadIdRegion const &other)
static TMultiGraph * graphRegions(std::vector< deadRegion > const &regions)
static void mergeRegionLists(std::list< deadIdRegion > &didregions)
deadRegion(deadRegion const &other)
static std::vector< uint32_t > deadIds
static double const phiMaxR0[]
static double const phiMinR12[]
static void initIds(edm::EventSetup const &eSetup)
deadIdRegion(int eMin=0, int eMax=0, int pMin=0, int pMax=0)
deadIdRegion(deadIdRegion const &other)
static int const etaBounds
static double const phiMinR0[]
bool samePhi(deadIdRegion const &other)
static bool Inited()
static void buildDeadAreas()
static bool inNotDeadGeom(double eta, double phi, double delta_eta=0., double delta_phi=0.)
bool adjacentEta(deadIdRegion const &other)
static void buildSiPMAreas()
static std::vector< deadRegion > deadRegions
static double const phiMaxR12[]
static bool isChannelDead(uint32_t id)
static bool inited
static TMultiGraph * graphSiPMRegions()
static bool inGeomAccept(double eta, double phi, double delta_eta=0., double delta_phi=0.)
static int const phiSectors
static std::vector< uint32_t > SiPMIds
static void convertRegions(std::list< deadIdRegion > const &idregions, std::vector< deadRegion > &regions)
deadRegion(double eMin=0., double eMax=0., double pMin=0., double pMax=0.)
bool operator==(deadRegion const &other)
static TMultiGraph * graphDeadRegions()
static std::vector< deadRegion > SiPMRegions
static bool isChannelSiPM(uint32_t id)
def merge(dictlist, TELL=False)
Definition: MatrixUtil.py:191