ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Tracking
Acts
ActsMonitoring
src
EstimatedTrackParamsAnalysisAlg.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
EstimatedTrackParamsAnalysisAlg.h
"
6
7
namespace
ActsTrk
{
8
9
EstimatedTrackParamsAnalysisAlg::EstimatedTrackParamsAnalysisAlg
(
const
std::string& name,
10
ISvcLocator* pSvcLocator)
11
:
AthMonitorAlgorithm
(name, pSvcLocator)
12
{}
13
14
StatusCode
EstimatedTrackParamsAnalysisAlg::initialize
() {
15
ATH_MSG_INFO
(
"Initializing "
<< name() <<
" ..."
);
16
17
ATH_CHECK
(
m_inputTrackParamsColletionKey
.initialize() );
18
19
ATH_MSG_DEBUG
(
"Monitoring settings ..."
);
20
ATH_MSG_DEBUG
(
m_monGroupName
);
21
22
return
AthMonitorAlgorithm::initialize
();
23
}
24
25
StatusCode
EstimatedTrackParamsAnalysisAlg::fillHistograms
(
const
EventContext& ctx)
const
{
26
ATH_MSG_DEBUG
(
"Filling Histograms for "
<< name() <<
" ... "
);
27
28
SG::ReadHandle< ActsTrk::BoundTrackParametersContainer >
trackParamsHandle =
SG::makeHandle
(
m_inputTrackParamsColletionKey
, ctx);
29
ATH_CHECK
( trackParamsHandle.
isValid
() );
30
const
ActsTrk::BoundTrackParametersContainer
*trackParams = trackParamsHandle.
get
();
31
ATH_MSG_DEBUG
(
"Retrieved "
<< trackParams->
size
() <<
" input parameters with key "
<<
m_inputTrackParamsColletionKey
.key() );
32
33
auto
monitor_nparams =
Monitored::Scalar<int>
(
"Nparams"
, trackParams->
size
());
34
fill
(
m_monGroupName
.value(), monitor_nparams);
35
36
auto
monitor_pt =
Monitored::Collection
(
"track_param_pt"
, *trackParams,
37
[] (
const
auto
* param) ->
double
38
{
return
param ==
nullptr
? std::numeric_limits<double>::quiet_NaN() : param->transverseMomentum(); });
39
auto
monitor_eta =
Monitored::Collection
(
"track_param_eta"
, *trackParams,
40
[] (
const
auto
* param) ->
double
41
{
return
param ==
nullptr
? std::numeric_limits<double>::quiet_NaN() : -std::log( std::tan(0.5 * param->parameters()[Acts::eBoundTheta]) ); });
42
auto
monitor_loc0 =
Monitored::Collection
(
"track_param_loc0"
, *trackParams,
43
[] (
const
auto
* param) ->
double
44
{
return
param ==
nullptr
? std::numeric_limits<double>::quiet_NaN() : param->parameters()[Acts::eBoundLoc0]; });
45
auto
monitor_loc1 =
Monitored::Collection
(
"track_param_loc1"
, *trackParams,
46
[] (
const
auto
* param) ->
double
47
{
return
param ==
nullptr
? std::numeric_limits<double>::quiet_NaN() : param->parameters()[Acts::eBoundLoc1]; });
48
auto
monitor_phi =
Monitored::Collection
(
"track_param_phi"
, *trackParams,
49
[] (
const
auto
* param) ->
double
50
{
return
param ==
nullptr
? std::numeric_limits<double>::quiet_NaN() : param->parameters()[Acts::eBoundPhi]; });
51
auto
monitor_theta =
Monitored::Collection
(
"track_param_theta"
, *trackParams,
52
[] (
const
auto
* param) ->
double
53
{
return
param ==
nullptr
? std::numeric_limits<double>::quiet_NaN() : param->parameters()[Acts::eBoundTheta]; });
54
auto
monitor_qOverP =
Monitored::Collection
(
"track_param_qoverp"
, *trackParams,
55
[] (
const
auto
* param) ->
double
56
{
return
param ==
nullptr
? std::numeric_limits<double>::quiet_NaN() : param->parameters()[Acts::eBoundQOverP]; });
57
auto
monitor_time =
Monitored::Collection
(
"track_param_time"
, *trackParams,
58
[] (
const
auto
* param) ->
double
59
{
return
param ==
nullptr
? std::numeric_limits<double>::quiet_NaN() : param->parameters()[Acts::eBoundTime]; });
60
61
auto
monitor_charge =
Monitored::Collection
(
"track_param_charge"
, *trackParams,
62
[] (
const
auto
* param) ->
int
63
{
return
param ==
nullptr
? 0 : param->charge(); });
64
65
fill
(
m_monGroupName
.value(),
66
monitor_pt, monitor_eta,
67
monitor_loc0, monitor_loc1,
68
monitor_phi, monitor_theta,
69
monitor_qOverP,
70
monitor_time,
71
monitor_charge);
72
73
return
StatusCode::SUCCESS;
74
}
75
76
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
EstimatedTrackParamsAnalysisAlg.h
ActsTrk::EstimatedTrackParamsAnalysisAlg::EstimatedTrackParamsAnalysisAlg
EstimatedTrackParamsAnalysisAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition
EstimatedTrackParamsAnalysisAlg.cxx:9
ActsTrk::EstimatedTrackParamsAnalysisAlg::fillHistograms
virtual StatusCode fillHistograms(const EventContext &ctx) const override
adds event to the monitoring histograms
Definition
EstimatedTrackParamsAnalysisAlg.cxx:25
ActsTrk::EstimatedTrackParamsAnalysisAlg::initialize
virtual StatusCode initialize() override
initialize
Definition
EstimatedTrackParamsAnalysisAlg.cxx:14
ActsTrk::EstimatedTrackParamsAnalysisAlg::m_inputTrackParamsColletionKey
SG::ReadHandleKey< ActsTrk::BoundTrackParametersContainer > m_inputTrackParamsColletionKey
Definition
EstimatedTrackParamsAnalysisAlg.h:25
ActsTrk::EstimatedTrackParamsAnalysisAlg::m_monGroupName
Gaudi::Property< std::string > m_monGroupName
Definition
EstimatedTrackParamsAnalysisAlg.h:28
AthMonitorAlgorithm::initialize
virtual StatusCode initialize() override
initialize
Definition
AthMonitorAlgorithm.cxx:22
AthMonitorAlgorithm::AthMonitorAlgorithm
AthMonitorAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition
AthMonitorAlgorithm.cxx:8
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
Monitored::Scalar
Declare a monitored scalar variable.
Definition
MonitoredScalar.h:34
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:67
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
SG::ReadHandle::get
const_pointer_type get() const
Dereference the pointer, but don't cache anything.
AthMonitorAlgorithm::fill
void fill(const ToolHandle< GenericMonitoringTool > &groupHandle, std::vector< std::reference_wrapper< Monitored::IMonitoredVariable > > &&variables) const
Fills a vector of variables to a group by reference.
Definition
AthMonitorAlgorithm.cxx:99
ActsTrk
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
Definition
MdtCalibInput.h:31
ActsTrk::BoundTrackParametersContainer
DataVector< Acts::BoundTrackParameters > BoundTrackParametersContainer
Definition
Tracking/Acts/ActsEvent/ActsEvent/TrackParametersContainer.h:12
Monitored::Collection
ValuesCollection< T > Collection(std::string name, const T &collection)
Declare a monitored (double-convertible) collection.
Definition
MonitoredCollection.h:38
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition
ReadCondHandle.h:269
Generated on
for ATLAS Offline Software by
1.17.0