ATLAS Offline Software
RegSelModule.h
Go to the documentation of this file.
1 // emacs: this is -*- c++ -*-
2 
3 /*
4  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 /**************************************************************************
8  **
9  ** File: RegSelModule.h
10  **
11  ** Description:
12  **
13  **
14  **
15  ** Author: M.Sutton
16  **
17  ** Created: Tue Apr 3 11:16:18 BST 2007
18  ** Modified:
19  **
20  **
21  **
22  **************************************************************************/
23 
24 
25 #ifndef __REGSELMODULE_H
26 #define __REGSELMODULE_H
27 
29 #include "RegSelLUT/ZRObject.h"
30 
31 #include <iostream>
32 #include <cmath>
33 #include <stdint.h>
34 
35 
36 
37 
38 class RegSelModule : public ZRObject {
39 
40 public:
41 
42  RegSelModule();
45  RegSelModule(double zmin, double zmax,
46  double rmin, double rmax,
47  double phimin, double phimax,
48  int layer,
49  int detector,
50  uint32_t robid=0,
51  IdentifierHash hashid=0);
52 
54  RegSelModule(double zmin, double zmax,
55  double z2min, double z2max,
56  double rmin, double rmax,
57  double phimin, double phimax,
58  int layer,
59  int detector,
60  uint32_t robid=0,
61  IdentifierHash hashid=0);
62 
63 #if 0
64  bool inRoI(const RegSelRoI& roi) const {
65  // check to see if the RoI and the object overlap in phi
66  // FIXME: need checking for 0-2pi boundary ???
67  // std::cout << "RegSelModule::inRoI()" << std::endl;
68  if ( roi.getphiMax()>phiMin() && roi.getphiMin()<phiMax() ) {
69  return ZRObject::inRoI(roi);
70  }
71  return false;
72  }
73 
74 #else
75 
76 
77  // this is a *nasty* function, but it should get all modules
78  // in the roi, irrespective of how wide and whether the module
79  // and roi cross the pi boundary
80  bool inRoI(const RegSelRoI& roi) const {
81  if ( roi.getsplit() ) { // roi is split across pi
82  if ( phiMin()>phiMax() ) return ZRObject::inRoI(roi); // module is also split
83  else { // module isn't split
84  if ( ( phiMin()<=M_PI && phiMax()>roi.getphiMin() ) ||
85  ( phiMin()<=roi.getphiMax() && phiMax()>=-M_PI ) ) return ZRObject::inRoI(roi);
86  }
87  }
88  else { // roi is not split
89  if ( phiMin()<phiMax() ) { // module is not split
90  if ( phiMin()<=roi.getphiMax() && phiMax()>=roi.getphiMin() ) return ZRObject::inRoI(roi);
91  }
92  else // module is split NB notice the || rather than the && when not split
93  if ( phiMin()<=roi.getphiMax() || phiMax()>=roi.getphiMin() ) return ZRObject::inRoI(roi);
94  }
95  return false;
96  }
97 
98 #endif
99 
100  double phiMin() const { return m_phiMin; }
101  double phiMax() const { return m_phiMax; }
102 
103  double phiWidth() const {
105  }
106 
107  // never needed
108  // double etaMin() const { return m_etaMin; }
109  // double etaMax() const { return m_etaMax; }
110 
111  int layer() const { return m_layer; }
112  int detector() const { return m_detector; }
113 
114  uint32_t robID() const { return m_robID; }
115  IdentifierHash hashID() const { return m_hashID; }
116 
117 private:
118 
119  double m_phiMin, m_phiMax;
120  // double m_etaMin, m_etaMax; // eta is never used and so not needed
121 
122  int m_layer;
123  int m_detector;
124 
127 
128 };
129 
130 
131 std::ostream& operator<<(std::ostream& s, const RegSelModule& m);
132 bool getModule(std::istream& s, RegSelModule& m);
133 
134 
135 #endif /* __REGSELMODULE_H */
136 
137 
138 
139 
140 
141 
142 
143 
144 
145 
RegSelModule
Definition: RegSelModule.h:38
RegSelModule::m_detector
int m_detector
Definition: RegSelModule.h:138
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
RegSelModule::m_phiMax
double m_phiMax
Definition: RegSelModule.h:134
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
RegSelModule::inRoI
bool inRoI(const RegSelRoI &roi) const
Definition: RegSelModule.h:95
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
RegSelModule::robID
uint32_t robID() const
Definition: RegSelModule.h:129
PixelAthClusterMonAlgCfg.zmin
zmin
Definition: PixelAthClusterMonAlgCfg.py:169
RegSelModule::phiMin
double phiMin() const
Definition: RegSelModule.h:115
RegSelModule::layer
int layer() const
Definition: RegSelModule.h:126
RegSelModule::m_phiMin
double m_phiMin
Definition: RegSelModule.h:134
M_PI
#define M_PI
Definition: ActiveFraction.h:11
getModule
bool getModule(std::istream &s, RegSelModule &m)
Definition: RegSelModule.cxx:110
operator<<
std::ostream & operator<<(std::ostream &s, const RegSelModule &m)
Definition: RegSelModule.cxx:95
RegSelModule::detector
int detector() const
Definition: RegSelModule.h:127
RegSelRoI::getphiMax
double getphiMax() const
Definition: RegSelRoI.h:62
RegSelModule::phiWidth
double phiWidth() const
Definition: RegSelModule.h:118
RegSelModule::m_layer
int m_layer
Definition: RegSelModule.h:137
PixelAthClusterMonAlgCfg.zmax
zmax
Definition: PixelAthClusterMonAlgCfg.py:169
RegSelRoI
Definition: RegSelRoI.h:32
RegSelRoI::getphiMin
double getphiMin() const
Definition: RegSelRoI.h:61
IdentifierHash.h
RegSelRoI::getsplit
bool getsplit() const
Definition: RegSelRoI.h:67
RegSelModule::phiMax
double phiMax() const
Definition: RegSelModule.h:116
RegSelModule::m_robID
uint32_t m_robID
Definition: RegSelModule.h:140
ZRObject
Definition: ZRObject.h:41
RegSelModule::hashID
IdentifierHash hashID() const
Definition: RegSelModule.h:130
ZRObject.h
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
ZRObject::inRoI
virtual bool inRoI(const RegSelRoI &roi) const
Definition: ZRObject.h:71
RegSelModule::RegSelModule
RegSelModule()
Definition: RegSelModule.cxx:31
RegSelModule::m_hashID
IdentifierHash m_hashID
Definition: RegSelModule.h:141