ATLAS Offline Software
Loading...
Searching...
No Matches
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
38class RegSelModule : public ZRObject {
39
40public:
41
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
117private:
118
120 // double m_etaMin, m_etaMax; // eta is never used and so not needed
121
124
125 uint32_t m_robID;
127
128};
129
130
131std::ostream& operator<<(std::ostream& s, const RegSelModule& m);
132bool getModule(std::istream& s, RegSelModule& m);
133
134
135#endif /* __REGSELMODULE_H */
136
137
138
139
140
141
142
143
144
145
#define M_PI
bool getModule(std::istream &s, RegSelModule &m)
std::ostream & operator<<(std::ostream &s, const RegSelModule &m)
This is a "hash" representation of an Identifier.
IdentifierHash m_hashID
double phiWidth() const
int detector() const
bool inRoI(const RegSelRoI &roi) const
uint32_t m_robID
IdentifierHash hashID() const
double phiMin() const
uint32_t robID() const
int layer() const
double phiMax() const
bool getsplit() const
Definition RegSelRoI.h:52
double getphiMin() const
Definition RegSelRoI.h:46
double getphiMax() const
Definition RegSelRoI.h:47
ZRObject()
Definition ZRObject.h:45
virtual bool inRoI(const RegSelRoI &roi) const
Definition ZRObject.h:71