ATLAS Offline Software
MuonSpectrometer
MuonCalib
MdtCalib
MdtCalibUtils
src
SimpleMdtSegmentSelector.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
MdtCalibUtils/SimpleMdtSegmentSelector.h
"
6
7
#include <iostream>
8
9
#include "
AthenaKernel/getMessageSvc.h
"
10
#include "GaudiKernel/MsgStream.h"
11
#include "
MuonCalibEventBase/MuonCalibSegment.h
"
12
13
namespace
MuonCalib
{
14
15
SimpleMdtSegmentSelector::SimpleMdtSegmentSelector
(
double
chi2_max,
unsigned
int
hits_min) :
16
m_chi2_max(chi2_max), m_hits_min(hits_min) {
17
m_printLevel
= 0;
18
19
MsgStream
log
(
Athena::getMessageSvc
(),
"SimpleMdtSegmentSelector"
);
20
log
<< MSG::INFO <<
"SimpleMdtSegmentSelector::SimpleMdtSegmentSelector"
<<
endmsg
;
21
log
<< MSG::INFO <<
"New SimpleMdtSegmentSelector : "
<<
endmsg
;
22
log
<< MSG::INFO <<
" chi2 cut "
<<
m_chi2_max
<<
endmsg
;
23
log
<< MSG::INFO <<
" hits cut "
<<
m_hits_min
<<
endmsg
;
24
}
25
26
bool
SimpleMdtSegmentSelector::select
(
const
MuonCalibSegment
& seg)
const
{
27
MsgStream
log
(
Athena::getMessageSvc
(),
"SimpleMdtSegmentSelector"
);
28
if
(
log
.level() <=
MSG::VERBOSE
) {
29
log
<<
MSG::VERBOSE
<<
"SimpleMdtSegmentSelector::select"
<<
endmsg
;
30
log
<<
MSG::VERBOSE
<<
"Segment: chi2 "
<< seg.
chi2
() <<
" mdtHits "
<< seg.
mdtHitsOnTrack
() <<
" tan "
31
<< seg.
direction
().y() / seg.
direction
().z() <<
endmsg
;
32
}
33
34
// test if segments satisfies the selectors selection criteria
35
36
// test chi2
37
if
(seg.
chi2
() >
m_chi2_max
)
return
false
;
38
39
if
(
log
.level() <=
MSG::DEBUG
)
log
<<
MSG::DEBUG
<<
"segment passed chi2 cut "
<< seg.
chi2
() <<
endmsg
;
40
41
// test total numbers of hits on segment
42
if
(seg.
mdtHitsOnTrack
() <
m_hits_min
)
return
false
;
43
44
if
(
log
.level() <=
MSG::DEBUG
)
log
<<
MSG::DEBUG
<<
"segment passed mdtHits cut "
<< seg.
mdtHitsOnTrack
() <<
endmsg
;
45
46
double
tanphi = seg.
direction
().y() / seg.
direction
().z();
47
// if( std::abs(tanphi) > 1. ) return false;
48
49
if
(
log
.level() <=
MSG::DEBUG
)
log
<<
MSG::DEBUG
<<
"segment passed angular cut "
<< tanphi <<
endmsg
;
50
51
return
true
;
52
}
53
54
}
// namespace MuonCalib
MuonCalibSegment.h
getMessageSvc.h
singleton-like access to IMessageSvc via open function and helper
MuonCalib::MuonCalibSegment
Definition:
MuonCalibSegment.h:39
MuonCalib::SimpleMdtSegmentSelector::m_printLevel
int m_printLevel
print level
Definition:
SimpleMdtSegmentSelector.h:52
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition:
getMessageSvc.cxx:20
MuonCalib::MuonCalibSegment::direction
const Amg::Vector3D & direction() const
retrieve local direction of segment (on station level) retrieve the transformation from local chamber...
Definition:
MuonCalibSegment.cxx:186
MuonCalib::SimpleMdtSegmentSelector::m_hits_min
unsigned int m_hits_min
minimum numbers of hits on segment
Definition:
SimpleMdtSegmentSelector.h:49
endmsg
#define endmsg
Definition:
AnalysisConfig_Ntuple.cxx:63
MuonCalib
CscCalcPed - algorithm that finds the Cathode Strip Chamber pedestals from an RDO.
Definition:
CscCalcPed.cxx:22
MuonCalib::SimpleMdtSegmentSelector::SimpleMdtSegmentSelector
SimpleMdtSegmentSelector(double chi2_max, unsigned int hits_min)
constructor
Definition:
SimpleMdtSegmentSelector.cxx:15
MuonCalib::MuonCalibSegment::mdtHitsOnTrack
unsigned int mdtHitsOnTrack() const
retrieve the number of MdtCalibHitBase s assigned to this segment
Definition:
MuonCalibSegment.cxx:146
MuonCalib::SimpleMdtSegmentSelector::m_chi2_max
double m_chi2_max
selection criteria
Definition:
SimpleMdtSegmentSelector.h:48
SimpleMdtSegmentSelector.h
DEBUG
#define DEBUG
Definition:
page_access.h:11
python.CaloCondTools.log
log
Definition:
CaloCondTools.py:20
MuonCalib::MuonCalibSegment::chi2
double chi2() const
retrieve chi2
Definition:
MuonCalibSegment.cxx:182
python.Constants.VERBOSE
int VERBOSE
Definition:
Control/AthenaCommon/python/Constants.py:14
MuonCalib::SimpleMdtSegmentSelector::select
virtual bool select(const MuonCalibSegment &seg) const
test MdtSegment on selection criteria
Definition:
SimpleMdtSegmentSelector.cxx:26
Generated on Fri Jan 10 2025 21:17:45 for ATLAS Offline Software by
1.8.18