ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigAlgorithms
TrigT2BeamSpot
src
T2VertexBeamSpot.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3
*/
4
//============================================================
5
//
6
// T2VertexBeamSpot.cxx, (c) ATLAS Detector software
7
// Trigger/TrigAlgorithms/TrigT2BeamSpot/T2VertexBeamSpot
8
//
9
// Online beam spot measurement and monitoring using
10
// L2 recontructed primary vertices.
11
//
12
// Authors : David W. Miller, Rainer Bartoldus,
13
// Su Dong
14
//============================================================
15
16
#include "
T2VertexBeamSpot.h
"
17
18
// General ATHENA/Trigger stuff
19
#include "GaudiKernel/StatusCode.h"
20
#include "
AthenaMonitoringKernel/Monitored.h
"
21
22
using namespace
PESA
;
23
24
// Constructor
25
T2VertexBeamSpot::T2VertexBeamSpot
(
const
std::string& name, ISvcLocator* pSvcLocator )
26
:
AthReentrantAlgorithm
(name, pSvcLocator)
27
{
28
declareProperty
(
"doTrackBeamSpot"
,
m_doTrackBeamSpot
=
true
);
29
}
30
31
StatusCode
T2VertexBeamSpot::initialize
() {
32
33
ATH_CHECK
(
m_beamSpotTool
.retrieve());
34
ATH_CHECK
(
m_trackBSTool
.retrieve());
35
if
(!
m_monTool
.empty())
ATH_CHECK
(
m_monTool
.retrieve());
36
37
ATH_CHECK
(
m_trackCollectionKey
.initialize() );
38
39
return
StatusCode::SUCCESS;
40
}
41
42
StatusCode
T2VertexBeamSpot::execute
(
const
EventContext& ctx)
const
{
43
// Start the overall timer
44
auto
tTotal =
Monitored::Timer
(
"TIME_TotalTime"
);
45
46
// Retrieve tracks
47
SG::ReadHandle<TrackCollection>
trackCollection(
m_trackCollectionKey
, ctx);
48
ATH_CHECK
(trackCollection.
isValid
());
49
const
TrackCollection
* tracks = trackCollection.
cptr
();
50
51
// call track-based tool
52
if
(
m_doTrackBeamSpot
) {
53
m_trackBSTool
->updateBS(*tracks, ctx.eventID());
54
}
55
56
// call vertex-based tool
57
m_beamSpotTool
->updateBS(*tracks, ctx);
58
59
//What should go as an output? SelectedTrackCollection and Vertices?
60
//Atm just try add vertex
61
//TODO: adding split vertices as well, will need an array
62
63
auto
mon =
Monitored::Group
(
m_monTool
, tTotal);
64
65
return
StatusCode::SUCCESS;
66
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
Monitored.h
Header file to be included by clients of the Monitored infrastructure.
T2VertexBeamSpot.h
TrackCollection
DataVector< Trk::Track > TrackCollection
This typedef represents a collection of Trk::Track objects.
Definition
TrackCollection.h:19
AthCommonAlgorithm< Gaudi::Algorithm >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition
AthCommonDataStore.h:145
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition
AthReentrantAlgorithm.h:74
Monitored::Group
Group of local monitoring quantities and retain correlation when filling histograms
Definition
MonitoredGroup.h:53
Monitored::Timer
A monitored timer.
Definition
MonitoredTimer.h:32
PESA::T2VertexBeamSpot::T2VertexBeamSpot
T2VertexBeamSpot(const std::string &name, ISvcLocator *pSvcLocator)
std Gaudi Algorithm constructor
Definition
T2VertexBeamSpot.cxx:25
PESA::T2VertexBeamSpot::initialize
virtual StatusCode initialize() override final
Initialize the beamspot algorithm for Run3 Athena MT configuration, initialize all the handles and re...
Definition
T2VertexBeamSpot.cxx:31
PESA::T2VertexBeamSpot::m_doTrackBeamSpot
bool m_doTrackBeamSpot
Definition
T2VertexBeamSpot.h:64
PESA::T2VertexBeamSpot::m_trackCollectionKey
SG::ReadHandleKey< TrackCollection > m_trackCollectionKey
Definition
T2VertexBeamSpot.h:71
PESA::T2VertexBeamSpot::m_trackBSTool
ToolHandle< T2TrackBeamSpotTool > m_trackBSTool
Definition
T2VertexBeamSpot.h:68
PESA::T2VertexBeamSpot::execute
virtual StatusCode execute(const EventContext &ctx) const override final
Loop over events, selecting tracks and reconstructing vertices out of these tracks.
Definition
T2VertexBeamSpot.cxx:42
PESA::T2VertexBeamSpot::m_monTool
ToolHandle< GenericMonitoringTool > m_monTool
Definition
T2VertexBeamSpot.h:69
PESA::T2VertexBeamSpot::m_beamSpotTool
ToolHandle< T2VertexBeamSpotTool > m_beamSpotTool
Definition
T2VertexBeamSpot.h:67
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:67
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
SG::ReadHandle::cptr
const_pointer_type cptr()
Dereference the pointer.
PESA
Local tools.
Definition
idx.h:9
Generated on
for ATLAS Offline Software by
1.17.0