ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigAnalysis
TrigInDetAnalysis
src
TIDARoiDescriptor.cxx
Go to the documentation of this file.
1
11
12
13
14
#include "
TrigInDetAnalysis/TIDARoiDescriptor.h
"
15
#include <sstream>
16
17
ClassImp
(
TIDARoiDescriptor
)
18
19
20
#ifndef M_2PI
21
#define M_2PI 6.283185307179586476925286766559005768394
22
#endif
23
24
#ifndef M_PIF
25
static
const
float
M_PIF
= float(
M_PI
);
26
#endif
27
28
const
double
TIDARoiDescriptor::maxRadius
= 1000;
29
const
double
TIDARoiDescriptor::maxZed
= 2700;
30
33
double
TIDARoiDescriptor::exitpoint
(
double
tz0,
double
teta,
double
& zexit,
double
& rexit ) {
34
35
if
( teta<0 ) zexit = -
maxZed
;
36
else
if
( teta>0 ) zexit =
maxZed
;
37
else
{
38
zexit = tz0;
39
rexit =
maxRadius
;
40
return
1e16;
// don't really want to use nan
41
}
42
44
45
double
tantheta = std::tan( 2*std::atan( std::exp( -teta ) ) );
46
47
rexit = (zexit-tz0) * tantheta;
48
50
if
( std::fabs(rexit)>
maxRadius
) {
55
zexit =
maxRadius
/ tantheta + tz0;
56
rexit =
maxRadius
;
57
58
}
59
60
return
tantheta;
61
}
62
63
64
65
TIDARoiDescriptor::TIDARoiDescriptor
(
bool
fullscan )
66
:
m_fullscan
(fullscan),
67
m_l1Id
(0),
m_roiId
(0),
m_roiWord
(0),
68
m_cached
(false),
m_dphi
(0),
69
m_zedPlusR
(0),
70
m_zedMinusR
(0),
71
m_rPlusZed
(0),
72
m_rMinusZed
(0)
73
{
74
if
(
m_fullscan
) {
75
m_params
=
TIDARoiParameters
( 0, -5, 5, 0, -
M_PI
,
M_PI
, 0, -225, 225 );
76
m_tanthetaPlus
=
exitpoint
( 225, 5,
m_zedPlusR
,
m_rPlusZed
);
77
m_tanthetaMinus
=
exitpoint
( -225, -5,
m_zedMinusR
,
m_rMinusZed
);
78
}
else
{
79
m_tanthetaPlus
= 0.0;
80
m_tanthetaMinus
= 0.0;
81
}
82
}
83
84
85
TIDARoiDescriptor::TIDARoiDescriptor
(
double
eta
,
double
etaMinus
,
double
etaPlus
,
86
double
phi
,
double
phiMinus
,
double
phiPlus
,
87
double
zed
,
double
zedMinus
,
double
zedPlus
)
88
:
m_params
(
eta
,
etaMinus
,
etaPlus
,
89
phi
,
phiMinus
,
phiPlus
,
90
zed
,
zedMinus
,
zedPlus
),
91
m_fullscan
(false),
92
m_l1Id
(0),
m_roiId
(0),
m_roiWord
(0),
93
m_cached
(false),
m_dphi
(0)
94
{
95
// calculate z limits at radius maxRadius
96
97
m_tanthetaPlus
=
exitpoint
( this->
zedPlus
(), this->
etaPlus
(),
m_zedPlusR
,
m_rPlusZed
);
98
m_tanthetaMinus
=
exitpoint
( this->
zedMinus
(), this->
etaMinus
(),
m_zedMinusR
,
m_rMinusZed
);
99
}
100
101
102
TIDARoiDescriptor::TIDARoiDescriptor
(
unsigned
int
l1id,
int
id
,
103
double
eta
,
double
etaMinus,
double
etaPlus,
104
double
phi
,
double
phiMinus,
double
phiPlus,
105
double
zed,
double
zedMinus,
double
zedPlus )
106
: m_params(
eta
, etaMinus, etaPlus,
107
phi
, phiMinus, phiPlus,
108
zed, zedMinus, zedPlus ),
109
m_fullscan(false),
110
m_l1Id(l1id), m_roiId(id), m_roiWord(0),
111
m_cached(false), m_dphi(0)
112
{
113
// calculate z limits at radius maxRadius
114
115
m_tanthetaPlus
=
exitpoint
( this->
zedPlus
(), this->
etaPlus
(),
m_zedPlusR
,
m_rPlusZed
);
116
m_tanthetaMinus
=
exitpoint
( this->
zedMinus
(), this->
etaMinus
(),
m_zedMinusR
,
m_rMinusZed
);
117
}
118
119
120
TIDARoiDescriptor::TIDARoiDescriptor
(
unsigned
int
roiword,
unsigned
int
l1id,
int
id
,
121
double
eta
,
double
etaMinus,
double
etaPlus,
122
double
phi
,
double
phiMinus,
double
phiPlus,
123
double
zed,
double
zedMinus,
double
zedPlus )
124
: m_params(
eta
, etaMinus, etaPlus,
125
phi
, phiMinus, phiPlus,
126
zed, zedMinus, zedPlus ),
127
m_fullscan(false),
128
m_l1Id(l1id), m_roiId(
id
), m_roiWord(roiword),
129
m_cached(false), m_dphi(0)
130
{
131
// calculate z limits at radius maxRadius
132
m_tanthetaPlus
=
exitpoint
( this->
zedPlus
(), this->
etaPlus
(),
m_zedPlusR
,
m_rPlusZed
);
133
m_tanthetaMinus
=
exitpoint
( this->
zedMinus
(), this->
etaMinus
(),
m_zedMinusR
,
m_rMinusZed
);
134
}
135
136
137
TIDARoiDescriptor::TIDARoiDescriptor
(
const
TIDARoiDescriptor
&
a
) :
138
TObject(
a
),
139
m_params
(
a
.
m_params
),
140
m_fullscan
(
a
.
m_fullscan
),
141
m_l1Id
(
a
.
m_l1Id
),
m_roiId
(
a
.
m_roiId
),
m_roiWord
(
a
.
m_roiWord
),
142
m_rois
(
a
.
m_rois
),
143
m_cached
(false),
m_dphi
(0)
144
{
145
m_tanthetaPlus
=
exitpoint
( this->
zedPlus
(), this->
etaPlus
(),
m_zedPlusR
,
m_rPlusZed
);
146
m_tanthetaMinus
=
exitpoint
( this->
zedMinus
(), this->
etaMinus
(),
m_zedMinusR
,
m_rMinusZed
);
147
}
148
149
150
TIDARoiDescriptor
&
TIDARoiDescriptor::operator=
(
const
TIDARoiDescriptor
&
a
)
151
{
152
if
(
this
!= &
a
) {
153
TObject::operator= (
a
);
154
m_params
=
a
.m_params;
155
m_fullscan
=
a
.m_fullscan;
156
m_l1Id
=
a
.m_l1Id;
157
m_roiId
=
a
.m_roiId;
158
m_roiWord
=
a
.m_roiWord;
159
m_rois
=
a
.m_rois;
160
m_cached
=
a
.m_cached;
161
m_dphi
=
a
.m_dphi;
162
m_tanthetaPlus
=
exitpoint
( this->
zedPlus
(), this->
etaPlus
(),
m_zedPlusR
,
m_rPlusZed
);
163
m_tanthetaMinus
=
exitpoint
( this->
zedMinus
(), this->
etaMinus
(),
m_zedMinusR
,
m_rMinusZed
);
164
}
165
return
*
this
;
166
}
167
168
TIDARoiDescriptor
&
TIDARoiDescriptor::operator=
(
TIDARoiDescriptor
&&
a
)
noexcept
{
169
if
(
this
!= &
a
) {
170
TObject::operator=(
a
);
// TObject may not have a move assignment
171
m_params
= std::move(
a
.m_params);
172
m_fullscan
=
a
.m_fullscan;
173
m_l1Id
=
a
.m_l1Id;
174
m_roiId
=
a
.m_roiId;
175
m_roiWord
=
a
.m_roiWord;
176
m_rois
= std::move(
a
.m_rois);
177
m_cached
=
a
.m_cached;
178
m_dphi
=
a
.m_dphi;
179
m_zedPlusR
=
a
.m_zedPlusR;
180
m_zedMinusR
=
a
.m_zedMinusR;
181
m_rPlusZed
=
a
.m_rPlusZed;
182
m_rMinusZed
=
a
.m_rMinusZed;
183
m_tanthetaPlus
=
a
.m_tanthetaPlus;
184
m_tanthetaMinus
=
a
.m_tanthetaMinus;
185
}
186
return
*
this
;
187
}
188
189
190
191
TIDARoiDescriptor::~TIDARoiDescriptor
() { }
192
193
194
TIDARoiDescriptor::operator std::string()
const
{
195
std::stringstream s;
196
s <<
" z: "
<<
zed
() <<
" ("
<<
zedMinus
() <<
" - "
<<
zedPlus
() <<
")"
197
<<
" eta: "
<<
eta
() <<
" ("
<<
etaMinus
() <<
" - "
<<
etaPlus
() <<
")"
198
<<
" phi: "
<<
phi
() <<
" ("
<<
phiMinus
() <<
" - "
<<
phiPlus
() <<
")"
;
199
if
(
m_fullscan
) s <<
" (fullscan)"
;
200
s <<
" RoIid: "
<<
roiId
() <<
" RoIword: "
<<
roiWord
() <<
" (size "
<<
size
() <<
")"
;
201
for
(
unsigned
i=0 ; i<
size
() ; i++ ) s <<
"\n\t\t"
<< i <<
": "
<< (std::string)*
at
(i);
202
return
s.str();
203
}
204
205
206
207
double
TIDARoiDescriptor::phicheck
(
double
phi
) {
208
if
( !(
phi
> -
M_PIF
&&
phi
<
M_PIF
) ) {
// use ! of range rather than range to also catch nan etc
209
if
(
phi
< -
M_PIF
)
phi
+=
M_2PI
;
210
else
phi
-=
M_2PI
;
211
// std::cerr << "TIDARoiDescriptor constructed with phi smaller than -PI (allowed range -PI / +PI) PhiRange" << std::endl;
212
// std::cerr << "TIDARoiDescriptor constructed with phi greater than PI (allowed range -PI / +PI) PhiRange" << std::endl;
213
}
214
return
phi
;
215
}
216
217
218
double
TIDARoiDescriptor::etacheck
(
double
eta
) {
219
if
( !(
eta
> -100 &&
eta
< 100) ) {
// check also for nan
220
std::cerr <<
"TIDARoiDescriptor constructed with eta outside range -100 < eta <100 EtaRange"
<< std::endl;
221
}
222
return
eta
;
223
}
224
225
226
double
TIDARoiDescriptor::zedcheck
(
double
zed
) {
227
if
( !(
zed
> -100000 &&
zed
< 100000 ) ) {
// check also for nan
228
std::cerr <<
"TIDARoiDescriptor constructed with eta outside range -100000 < sed <100000 ZedRange"
<< std::endl;
229
}
230
return
zed
;
231
}
232
233
234
M_PI
#define M_PI
Definition
ActiveFraction.h:14
eta
Scalar eta() const
pseudorapidity method
Definition
AmgMatrixBasePlugin.h:83
phi
Scalar phi() const
phi method
Definition
AmgMatrixBasePlugin.h:67
M_2PI
#define M_2PI
Definition
CaloGpuGeneral_fnc.cxx:11
a
static Double_t a
Definition
LArPhysWaveHECTool.cxx:38
size
size_t size() const
Number of registered mappings.
ClassImp
ClassImp(TIDARoiDescriptor) static const float M_PIF
TIDARoiDescriptor.h
M_PIF
static const float M_PIF
Definition
TIDARoiParameters.cxx:27
TIDARoiDescriptor
Describes the Region of Interest geometry It has basically 8 parameters.
Definition
TIDARoiDescriptor.h:40
TIDARoiDescriptor::m_rPlusZed
double m_rPlusZed
don't save - transient zMinus at radius R
Definition
TIDARoiDescriptor.h:293
TIDARoiDescriptor::roiWord
unsigned roiWord() const
Definition
TIDARoiDescriptor.h:168
TIDARoiDescriptor::m_rMinusZed
double m_rMinusZed
don't save - transient zPlus at radius R
Definition
TIDARoiDescriptor.h:294
TIDARoiDescriptor::m_zedMinusR
double m_zedMinusR
don't save - transient zPlus at radius R
Definition
TIDARoiDescriptor.h:291
TIDARoiDescriptor::m_roiWord
unsigned int m_roiWord
Definition
TIDARoiDescriptor.h:283
TIDARoiDescriptor::m_params
TIDARoiParameters m_params
don't save
Definition
TIDARoiDescriptor.h:277
TIDARoiDescriptor::phi
double phi() const
Definition
TIDARoiDescriptor.h:137
TIDARoiDescriptor::etaMinus
double etaMinus() const
Definition
TIDARoiDescriptor.h:141
TIDARoiDescriptor::m_zedPlusR
double m_zedPlusR
cached value -
Definition
TIDARoiDescriptor.h:290
TIDARoiDescriptor::at
const TIDARoiDescriptor * at(int i) const
gets phi half-width
Definition
TIDARoiDescriptor.h:183
TIDARoiDescriptor::zedPlus
double zedPlus() const
Definition
TIDARoiDescriptor.h:148
TIDARoiDescriptor::m_cached
bool m_cached
Definition
TIDARoiDescriptor.h:287
TIDARoiDescriptor::m_tanthetaPlus
double m_tanthetaPlus
don't save - transient zMinus at radius R
Definition
TIDARoiDescriptor.h:296
TIDARoiDescriptor::m_rois
std::vector< TIDARoiDescriptor > m_rois
Definition
TIDARoiDescriptor.h:285
TIDARoiDescriptor::maxZed
static const double maxZed
don't save
Definition
TIDARoiDescriptor.h:273
TIDARoiDescriptor::exitpoint
static double exitpoint(double tz0, double teta, double &zexit, double &rexit)
returns the tantheta for the limits and the r and z exit points from the ID volume
Definition
TIDARoiDescriptor.cxx:33
TIDARoiDescriptor::maxRadius
static const double maxRadius
Definition
TIDARoiDescriptor.h:272
TIDARoiDescriptor::TIDARoiDescriptor
TIDARoiDescriptor(bool fullscan=false)
default constructor
Definition
TIDARoiDescriptor.cxx:65
TIDARoiDescriptor::operator=
TIDARoiDescriptor & operator=(const TIDARoiDescriptor &r)
copy assignment
Definition
TIDARoiDescriptor.cxx:150
TIDARoiDescriptor::etaPlus
double etaPlus() const
Definition
TIDARoiDescriptor.h:142
TIDARoiDescriptor::~TIDARoiDescriptor
virtual ~TIDARoiDescriptor()
Definition
TIDARoiDescriptor.cxx:191
TIDARoiDescriptor::zedMinus
double zedMinus() const
Definition
TIDARoiDescriptor.h:147
TIDARoiDescriptor::phiPlus
double phiPlus() const
Definition
TIDARoiDescriptor.h:145
TIDARoiDescriptor::roiId
unsigned roiId() const
identifier methods
Definition
TIDARoiDescriptor.h:166
TIDARoiDescriptor::zed
double zed() const
Definition
TIDARoiDescriptor.h:139
TIDARoiDescriptor::m_tanthetaMinus
double m_tanthetaMinus
don't save - transient roi edge gradients
Definition
TIDARoiDescriptor.h:297
TIDARoiDescriptor::etacheck
double etacheck(double eta)
helper function to check if eta range was violated
Definition
TIDARoiDescriptor.cxx:218
TIDARoiDescriptor::phiMinus
double phiMinus() const
Definition
TIDARoiDescriptor.h:144
TIDARoiDescriptor::m_roiId
unsigned int m_roiId
Definition
TIDARoiDescriptor.h:282
TIDARoiDescriptor::m_dphi
double m_dphi
cache flag - these should be mutable
Definition
TIDARoiDescriptor.h:288
TIDARoiDescriptor::zedcheck
double zedcheck(double zed)
helper function to check if zed range was violated
Definition
TIDARoiDescriptor.cxx:226
TIDARoiDescriptor::m_fullscan
bool m_fullscan
Definition
TIDARoiDescriptor.h:279
TIDARoiDescriptor::m_l1Id
unsigned int m_l1Id
Definition
TIDARoiDescriptor.h:281
TIDARoiDescriptor::phicheck
double phicheck(double phi)
helper function to check if phi range was violated
Definition
TIDARoiDescriptor.cxx:207
TIDARoiDescriptor::eta
double eta() const
Definition
TIDARoiDescriptor.h:138
TIDARoiParameters
Definition
TIDARoiParameters.h:29
Base_Fragment.id
id
Definition
Sherpa_i/share/common/Base_Fragment.py:61
Generated on
for ATLAS Offline Software by
1.17.0