ATLAS Offline Software
Loading...
Searching...
No Matches
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"
21
22using namespace PESA;
23
24// Constructor
25T2VertexBeamSpot::T2VertexBeamSpot( const std::string& name, ISvcLocator* pSvcLocator )
26 : AthReentrantAlgorithm(name, pSvcLocator)
27{
28 declareProperty("doTrackBeamSpot", m_doTrackBeamSpot = true);
29}
30
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
42StatusCode T2VertexBeamSpot::execute(const EventContext& ctx) const{
43 // Start the overall timer
44 auto tTotal = Monitored::Timer("TIME_TotalTime");
45
46 // Retrieve tracks
48 ATH_CHECK(trackCollection.isValid());
49 const TrackCollection* tracks = trackCollection.cptr();
50
51 // call track-based tool
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}
#define ATH_CHECK
Evaluate an expression and check for errors.
Header file to be included by clients of the Monitored infrastructure.
DataVector< Trk::Track > TrackCollection
This typedef represents a collection of Trk::Track objects.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
An algorithm that can be simultaneously executed in multiple threads.
Group of local monitoring quantities and retain correlation when filling histograms
A monitored timer.
T2VertexBeamSpot(const std::string &name, ISvcLocator *pSvcLocator)
std Gaudi Algorithm constructor
virtual StatusCode initialize() override final
Initialize the beamspot algorithm for Run3 Athena MT configuration, initialize all the handles and re...
SG::ReadHandleKey< TrackCollection > m_trackCollectionKey
ToolHandle< T2TrackBeamSpotTool > m_trackBSTool
virtual StatusCode execute(const EventContext &ctx) const override final
Loop over events, selecting tracks and reconstructing vertices out of these tracks.
ToolHandle< GenericMonitoringTool > m_monTool
ToolHandle< T2VertexBeamSpotTool > m_beamSpotTool
virtual bool isValid() override final
Can the handle be successfully dereferenced?
const_pointer_type cptr()
Dereference the pointer.
Local tools.
Definition idx.h:9