ATLAS Offline Software
Loading...
Searching...
No Matches
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
6
7namespace ActsTrk {
8
10 ISvcLocator* pSvcLocator)
11 : AthMonitorAlgorithm(name, pSvcLocator)
12 {}
13
15 ATH_MSG_INFO("Initializing " << name() << " ...");
16
18
19 ATH_MSG_DEBUG("Monitoring settings ...");
21
23 }
24
25 StatusCode EstimatedTrackParamsAnalysisAlg::fillHistograms(const EventContext& ctx) const {
26 ATH_MSG_DEBUG( "Filling Histograms for " << name() << " ... " );
27
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}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
#define ATH_MSG_DEBUG(x)
EstimatedTrackParamsAnalysisAlg(const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode fillHistograms(const EventContext &ctx) const override
adds event to the monitoring histograms
virtual StatusCode initialize() override
initialize
SG::ReadHandleKey< ActsTrk::BoundTrackParametersContainer > m_inputTrackParamsColletionKey
virtual StatusCode initialize() override
initialize
AthMonitorAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
size_type size() const noexcept
Returns the number of elements in the collection.
Declare a monitored scalar variable.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
const_pointer_type get() const
Dereference the pointer, but don't cache anything.
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.
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
DataVector< Acts::BoundTrackParameters > BoundTrackParametersContainer
ValuesCollection< T > Collection(std::string name, const T &collection)
Declare a monitored (double-convertible) collection.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())