ATLAS Offline Software
Trigger
TrigAnalysis
TrigInDetAnalysisUtils
TrigInDetAnalysisUtils
Filter_RoiSelector.h
Go to the documentation of this file.
1
/* emacs: this is -*- c++ -*- */
12
#ifndef TRIGINDETANALYSISUTILS_FILTER_ROISELECTOR_H
13
#define TRIGINDETANALYSISUTILS_FILTER_ROISELECTOR_H
14
15
#include <iostream>
16
#include <cmath>
17
18
#include "
TrigInDetAnalysis/TrackFilter.h
"
19
#include "
TrigInDetAnalysis/Track.h
"
20
21
#include "
TrigInDetAnalysis/TIDARoiDescriptor.h
"
22
23
#ifndef M_2PI
24
// static const double M_2PI = 6.28318530717958647692;
25
static
const
double
M_2PI
= 2*
M_PI
;
26
#endif
27
28
29
// roi eta-phi roi based filter - should have z as well for an sensible use
30
31
class
Filter_RoiSelector
:
public
TrackFilter
{
32
33
public
:
34
35
Filter_RoiSelector
(
double
emin=0,
double
emax=0,
double
pmin=0,
double
pmax=0 ) :
36
m_etamin
(emin),
m_etamax
(emax),
37
m_phimin
(pmin),
m_phimax
(pmax)
38
{ }
39
40
Filter_RoiSelector
(
const
TIDARoiDescriptor
&
r
) :
41
m_etamin
(
r
.
eta
()-
r
.etaHalfWidth()),
m_etamax
(
r
.
eta
()+
r
.etaHalfWidth()),
42
m_phimin
(
r
.
phi
()-
r
.phiHalfWidth()),
m_phimax
(
r
.
phi
()-
r
.phiHalfWidth())
43
{
44
if
(
m_phimin
<-
M_PI
)
m_phimin
+=
M_2PI
;
45
if
(
m_phimin
>
M_PI
)
m_phimin
-=
M_2PI
;
46
if
(
m_phimax
<-
M_PI
)
m_phimax
+=
M_2PI
;
47
if
(
m_phimax
>
M_PI
)
m_phimax
-=
M_2PI
;
48
}
49
50
Filter_RoiSelector
(
const
TIDARoiDescriptor
*
r
) :
51
m_etamin
(
r
->
eta
()-
r
->etaHalfWidth()),
m_etamax
(
r
->
eta
()+
r
->etaHalfWidth()),
52
m_phimin
(
r
->
phi
()-
r
->phiHalfWidth()),
m_phimax
(
r
->
phi
()-
r
->phiHalfWidth())
53
{
54
if
(
m_phimin
<-
M_PI
)
m_phimin
+=
M_2PI
;
55
if
(
m_phimin
>
M_PI
)
m_phimin
-=
M_2PI
;
56
if
(
m_phimax
<-
M_PI
)
m_phimax
+=
M_2PI
;
57
if
(
m_phimax
>
M_PI
)
m_phimax
-=
M_2PI
;
58
}
59
60
bool
select
(
const
TIDA::Track
*
t
,
const
TIDARoiDescriptor
*
/*r=0*/
) {
61
bool
inphi =
false
;
62
if
(
m_phimin
<
m_phimax
) inphi = (
m_phimin
<
t
->phi() &&
t
->phi()<
m_phimax
);
63
else
inphi = (
m_phimin
<
t
->phi() ||
t
->phi()<
m_phimax
);
64
if
( m_etamin<t->
eta
() &&
t
->eta()<
m_etamax
&& inphi )
return
true
;
65
return
false
;
66
}
67
68
double
etamin
()
const
{
return
m_etamin
; }
69
double
etamax
()
const
{
return
m_etamax
; }
70
double
phimin
()
const
{
return
m_phimin
; }
71
double
phimax
()
const
{
return
m_phimax
; }
72
73
private
:
74
75
double
m_etamin
,
m_etamax
;
76
double
m_phimin
,
m_phimax
;
77
78
};
79
80
81
82
inline
std::ostream&
operator<<
( std::ostream&
s
,
const
Filter_RoiSelector
&
sr
) {
83
return
s
<<
"[ eta="
<<
sr
.etamin() <<
" .. "
<<
sr
.etamax() <<
" phi="
<<
sr
.phimin() <<
" .. "
<<
sr
.phimax() <<
" ]"
;
84
}
85
86
87
#endif // TRIGINDETANALYSISUTILS_FILTER_ROISELECTOR_H
Filter_RoiSelector::phimin
double phimin() const
Definition:
Filter_RoiSelector.h:70
beamspotman.r
def r
Definition:
beamspotman.py:676
Track.h
python.SystemOfUnits.s
int s
Definition:
SystemOfUnits.py:131
operator<<
std::ostream & operator<<(std::ostream &s, const Filter_RoiSelector &sr)
Definition:
Filter_RoiSelector.h:82
phi
Scalar phi() const
phi method
Definition:
AmgMatrixBasePlugin.h:67
Filter_RoiSelector::Filter_RoiSelector
Filter_RoiSelector(double emin=0, double emax=0, double pmin=0, double pmax=0)
Definition:
Filter_RoiSelector.h:35
eta
Scalar eta() const
pseudorapidity method
Definition:
AmgMatrixBasePlugin.h:83
Filter_RoiSelector::Filter_RoiSelector
Filter_RoiSelector(const TIDARoiDescriptor *r)
Definition:
Filter_RoiSelector.h:50
TrackFilter
Definition:
TrackFilter.h:26
TrackFilter.h
base class for a single track selection filter allowing parameter setting for complex track selection
M_PI
#define M_PI
Definition:
ActiveFraction.h:11
TIDARoiDescriptor
Describes the Region of Ineterest geometry It has basically 8 parameters.
Definition:
TIDARoiDescriptor.h:42
TIDARoiDescriptor.h
read_hist_ntuple.t
t
Definition:
read_hist_ntuple.py:5
Filter_RoiSelector::m_etamin
double m_etamin
Definition:
Filter_RoiSelector.h:75
Filter_RoiSelector::m_phimin
double m_phimin
Definition:
Filter_RoiSelector.h:76
Filter_RoiSelector::Filter_RoiSelector
Filter_RoiSelector(const TIDARoiDescriptor &r)
Definition:
Filter_RoiSelector.h:40
Filter_RoiSelector::m_etamax
double m_etamax
Definition:
Filter_RoiSelector.h:75
python.SystemOfUnits.sr
int sr
Definition:
SystemOfUnits.py:113
Filter_RoiSelector::select
bool select(const TIDA::Track *t, const TIDARoiDescriptor *)
Definition:
Filter_RoiSelector.h:60
Filter_RoiSelector::etamax
double etamax() const
Definition:
Filter_RoiSelector.h:69
Filter_RoiSelector::phimax
double phimax() const
Definition:
Filter_RoiSelector.h:71
Filter_RoiSelector::m_phimax
double m_phimax
Definition:
Filter_RoiSelector.h:76
Filter_RoiSelector::etamin
double etamin() const
Definition:
Filter_RoiSelector.h:68
TIDA::Track
Definition:
Trigger/TrigAnalysis/TrigInDetAnalysis/TrigInDetAnalysis/Track.h:26
M_2PI
#define M_2PI
Definition:
CaloGpuGeneral_fnc.cxx:8
Filter_RoiSelector
Definition:
Filter_RoiSelector.h:31
Generated on Fri Apr 18 2025 21:10:51 for ATLAS Offline Software by
1.8.18