ATLAS Offline Software
Loading...
Searching...
No Matches
HGTD::VertexTimeAlg Class Reference

#include <VertexTimeAlg.h>

Inheritance diagram for HGTD::VertexTimeAlg:
Collaboration diagram for HGTD::VertexTimeAlg:

Classes

struct  HSclusterBDT

Public Member Functions

 VertexTimeAlg (const std::string &name, ISvcLocator *pSvcLocator)
StatusCode initialize () override final
StatusCode execute (const EventContext &ctx) const override final
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
virtual bool filterPassed (const EventContext &ctx) const
 Get filter decision:
virtual void setFilterPassed (bool state, const EventContext &ctx) const
 Set filter decision:
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef ServiceHandle< StoreGateSvc > StoreGateSvc_t

Private Member Functions

std::vector< const xAOD::TrackParticle * > vertexAssociatedHGTDTracks (const xAOD::Vertex *vertex, const xAOD::TrackParticleContainer *tracks, double min_trk_pt) const
bool passTrackVertexAssociation (const xAOD::TrackParticle *track, const xAOD::Vertex *vertex, double min_trk_pt, const double significance_cut=2.5) const
std::vector< HGTD::Cluster< const xAOD::TrackParticle * > > clusterTracksInTime (const EventContext &ctx, const std::vector< const xAOD::TrackParticle * > &tracks, double cluster_distance) const
HGTD::Cluster< const xAOD::TrackParticle * > getHScluster (const EventContext &ctx, const std::vector< HGTD::Cluster< const xAOD::TrackParticle * > > &clusters, const xAOD::Vertex *vertex) const
float scoreCluster (const EventContext &ctx, const HGTD::Cluster< const xAOD::TrackParticle * > &cluster, const xAOD::Vertex *vertex) const
std::pair< float, float > getZOfCluster (const HGTD::Cluster< const xAOD::TrackParticle * > &cluster) const
std::pair< float, float > getOneOverPOfCluster (const HGTD::Cluster< const xAOD::TrackParticle * > &cluster) const
std::pair< float, float > getDOfCluster (const HGTD::Cluster< const xAOD::TrackParticle * > &cluster) const
float getSumPt2OfCluster (const HGTD::Cluster< const xAOD::TrackParticle * > &cluster) const
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

SG::ReadHandleKey< xAOD::VertexContainer > m_primVxCont_key
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_trackCont_key
SG::WriteDecorHandleKey< xAOD::VertexContainer > m_vxHasTime_key
SG::WriteDecorHandleKey< xAOD::VertexContainer > m_vxTime_key
SG::WriteDecorHandleKey< xAOD::VertexContainer > m_vxTimeRes_key
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_trackValidTime_key
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_trackTime_key
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_trackTimeRes_key
Gaudi::Property< float > m_default_vxTime
Gaudi::Property< float > m_default_vxTimeRes
Gaudi::Property< float > m_bdt_cutvalue
SG::SlotSpecificObj< HSclusterBDT > m_BDT ATLAS_THREAD_SAFE
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default).
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default).
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Definition at line 43 of file VertexTimeAlg.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 376 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ VertexTimeAlg()

HGTD::VertexTimeAlg::VertexTimeAlg ( const std::string & name,
ISvcLocator * pSvcLocator )

Definition at line 26 of file VertexTimeAlg.cxx.

27 : AthReentrantAlgorithm(name, pSvcLocator) {}

Member Function Documentation

◆ clusterTracksInTime()

std::vector< HGTD::Cluster< const xAOD::TrackParticle * > > HGTD::VertexTimeAlg::clusterTracksInTime ( const EventContext & ctx,
const std::vector< const xAOD::TrackParticle * > & tracks,
double cluster_distance ) const
private

Definition at line 165 of file VertexTimeAlg.cxx.

168 {
169
170 SG::ReadDecorHandle<xAOD::TrackParticleContainer, uint8_t> trackValidTime(
172
173 SG::ReadDecorHandle<xAOD::TrackParticleContainer, float> trackTime(
174 m_trackTime_key, ctx);
175
176 SG::ReadDecorHandle<xAOD::TrackParticleContainer, float> trackTimeResolution(
177 m_trackTimeRes_key, ctx);
178
179
180 HGTD::ClusterCollection<const xAOD::TrackParticle*> collection { };
181
182 for (const auto& track : tracks) {
183
184 if (trackValidTime(*track)) {
185 double time { trackTime(*track) };
186 double timeResolution { trackTimeResolution(*track) };
187
188 HGTD::Cluster<const xAOD::TrackParticle*> cluster(
189 {time}, {timeResolution}, track);
190
191 collection.addCluster(cluster);
192 }
193 }
194
195 collection.updateDistanceCut(cluster_distance);
197
198 return collection.getClusters();
199}
void doClustering(ClusterAlgo algo)
Definition Clustering.h:357
void updateDistanceCut(double cut_value)
Set the distance cut.
Definition Clustering.h:259
void addCluster(const Cluster< T > &vx)
Definition Clustering.h:263
const std::vector< Cluster< T > > & getClusters() const
Definition Clustering.h:495
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_trackValidTime_key
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_trackTime_key
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_trackTimeRes_key
time(flags, cells_name, *args, **kw)

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

StatusCode HGTD::VertexTimeAlg::execute ( const EventContext & ctx) const
finaloverride

Definition at line 62 of file VertexTimeAlg.cxx.

62 {
63
64 SG::ReadHandle<xAOD::VertexContainer> primVxCont(m_primVxCont_key, ctx);
65 SG::ReadHandle<xAOD::TrackParticleContainer> trackCont(m_trackCont_key, ctx);
66
67 SG::WriteDecorHandle<xAOD::VertexContainer, uint8_t> vxHasTime(
68 m_vxHasTime_key, ctx);
69 SG::WriteDecorHandle<xAOD::VertexContainer, float> vxTime(
70 m_vxTime_key, ctx);
71 SG::WriteDecorHandle<xAOD::VertexContainer, float> vxTimeRes(
72 m_vxTimeRes_key, ctx);
73
74
75 for (const auto vx : *primVxCont) {
76
77 if (vx->vertexType() == xAOD::VxType::VertexType::PriVtx) {
78
79 std::vector<const xAOD::TrackParticle*> hgtdTracks {
80 vertexAssociatedHGTDTracks(vx, trackCont.cptr(), 1.0 * Gaudi::Units::GeV)
81 };
82
83 std::vector<HGTD::Cluster<const xAOD::TrackParticle*>> trackClusters {
84 clusterTracksInTime(ctx, hgtdTracks, 3.0)
85 };
86
87 // Get the cluster that was determined as HS by the BDT
88 HGTD::Cluster<const xAOD::TrackParticle*> HS_cluster {
89 getHScluster(ctx, trackClusters, vx)
90 };
91
92 if (HS_cluster.getEntries().size() > 0) {
93 // HS cluster was found
94
95 vxHasTime(*vx) = 1;
96 vxTime(*vx) = HS_cluster.getValues().at(0);
97 vxTimeRes(*vx) = HS_cluster.getSigmas().at(0);
98
99 } else {
100 // No cluster was chosen as HS
101
102 vxHasTime(*vx) = 0;
103 vxTime(*vx) = m_default_vxTime;
104 vxTimeRes(*vx) = m_default_vxTimeRes;
105 }
106
107 } else {
108 // Pileup vertices do not have a time
109
110 vxHasTime(*vx) = 0;
111 vxTime(*vx) = m_default_vxTime;
112 vxTimeRes(*vx) = m_default_vxTimeRes;
113 }
114 }
115
116 return StatusCode::SUCCESS;
117}
std::vector< double > getValues() const
Return the N-dimensional value of the Cluster.
Definition Clustering.h:217
const std::vector< double > & getSigmas() const
Return the N-dimensional resolution of the Cluster.
Definition Clustering.h:229
const std::vector< T > & getEntries() const
Return the objects that are part of the Cluster.
Definition Clustering.h:199
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_trackCont_key
Gaudi::Property< float > m_default_vxTime
std::vector< const xAOD::TrackParticle * > vertexAssociatedHGTDTracks(const xAOD::Vertex *vertex, const xAOD::TrackParticleContainer *tracks, double min_trk_pt) const
SG::ReadHandleKey< xAOD::VertexContainer > m_primVxCont_key
HGTD::Cluster< const xAOD::TrackParticle * > getHScluster(const EventContext &ctx, const std::vector< HGTD::Cluster< const xAOD::TrackParticle * > > &clusters, const xAOD::Vertex *vertex) const
std::vector< HGTD::Cluster< const xAOD::TrackParticle * > > clusterTracksInTime(const EventContext &ctx, const std::vector< const xAOD::TrackParticle * > &tracks, double cluster_distance) const
SG::WriteDecorHandleKey< xAOD::VertexContainer > m_vxTimeRes_key
Gaudi::Property< float > m_default_vxTimeRes
SG::WriteDecorHandleKey< xAOD::VertexContainer > m_vxHasTime_key
SG::WriteDecorHandleKey< xAOD::VertexContainer > m_vxTime_key
@ PriVtx
Primary vertex.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ extraOutputDeps()

const DataObjIDColl & AthCommonAlgorithm< Gaudi::Algorithm >::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 89 of file AthCommonAlgorithm.cxx.

54{
55 // If we didn't find any symlinks to add, just return the collection
56 // from the base class. Otherwise, return the extended collection.
57 if (!m_extendedExtraObjects.empty()) {
59 }
61}
Common base class for algorithms.

◆ filterPassed()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::filterPassed ( const EventContext & ctx) const
inlinevirtualinherited

Get filter decision:

Definition at line 93 of file AthCommonAlgorithm.h.

93 {
94 return execState( ctx ).filterPassed();
95 }
virtual bool filterPassed(const EventContext &ctx) const
Get filter decision:

◆ getDOfCluster()

std::pair< float, float > HGTD::VertexTimeAlg::getDOfCluster ( const HGTD::Cluster< const xAOD::TrackParticle * > & cluster) const
private

Definition at line 309 of file VertexTimeAlg.cxx.

310 {
311
312 std::vector<const xAOD::TrackParticle*> tracks { cluster.getEntries() };
313
314 float num { 0.0f };
315 float denom { 0.0f };
316
317 for (const auto& track : tracks) {
318
319 float d0 { track->d0() };
320 float d0_variance {
321 static_cast<float>(track->definingParametersCovMatrix()(0, 0))
322 };
323
324 num += d0 / d0_variance;
325 denom += 1.0f / d0_variance;
326 }
327 if (denom == 0.)[[unlikely]]{
328 throw std::runtime_error("VertexTimeAlg::getDOfCluster: denominator is zero");
329 }
330 float avg_z0 = num / denom;
331 float avg_z0_sigma = std::sqrt(1.0f / denom);
332
333 return {avg_z0, avg_z0_sigma};
334}
#define unlikely(x)

◆ getHScluster()

HGTD::Cluster< const xAOD::TrackParticle * > HGTD::VertexTimeAlg::getHScluster ( const EventContext & ctx,
const std::vector< HGTD::Cluster< const xAOD::TrackParticle * > > & clusters,
const xAOD::Vertex * vertex ) const
private

Definition at line 201 of file VertexTimeAlg.cxx.

204 {
205
206 HGTD::Cluster<const xAOD::TrackParticle*> HS_cluster { };
207 float max_BDT_score { -1.0f };
208
209 for (const auto& cluster : clusters) {
210
211 // HS cluster has an additional requirement to have at least 3 tracks
212 if (cluster.getEntries().size() < 3) {
213 continue;
214 }
215
216 const float cluster_score { scoreCluster(ctx, cluster, vertex) };
217
218 if (cluster_score > m_bdt_cutvalue && cluster_score > max_BDT_score) {
219
220 max_BDT_score = cluster_score;
221 HS_cluster = cluster;
222 }
223 }
224
225 // If no cluster passes the HS criteria, the return value will be an empty
226 // cluster
227 return HS_cluster;
228}
Gaudi::Property< float > m_bdt_cutvalue
float scoreCluster(const EventContext &ctx, const HGTD::Cluster< const xAOD::TrackParticle * > &cluster, const xAOD::Vertex *vertex) const

◆ getOneOverPOfCluster()

std::pair< float, float > HGTD::VertexTimeAlg::getOneOverPOfCluster ( const HGTD::Cluster< const xAOD::TrackParticle * > & cluster) const
private

Definition at line 282 of file VertexTimeAlg.cxx.

283 {
284
285 std::vector<const xAOD::TrackParticle*> tracks { cluster.getEntries() };
286
287 float num { 0.0f };
288 float denom { 0.0f };
289
290 for (const auto& track : tracks) {
291
292 float one_over_p { std::abs(track->qOverP()) };
293 float one_over_p_variance {
294 static_cast<float>(track->definingParametersCovMatrix()(4, 4))
295 };
296
297 num += one_over_p / one_over_p_variance;
298 denom += 1.0f / one_over_p_variance;
299 }
300 if (denom == 0.)[[unlikely]]{
301 throw std::runtime_error("VertexTimeAlg::getOneOverPOfCluster: denominator is zero");
302 }
303 float avg_oneover_p = num / denom;
304 float avg_oneover_p_sigma = std::sqrt(1.0f / denom);
305
306 return {avg_oneover_p, avg_oneover_p_sigma};
307}

◆ getSumPt2OfCluster()

float HGTD::VertexTimeAlg::getSumPt2OfCluster ( const HGTD::Cluster< const xAOD::TrackParticle * > & cluster) const
private

Definition at line 336 of file VertexTimeAlg.cxx.

337 {
338
339 std::vector<const xAOD::TrackParticle*> tracks { cluster.getEntries() };
340
341 float sumpt2 { 0.0f };
342
343 for (const auto& track : tracks) {
344 sumpt2 += std::pow(track->pt(), 2.0);
345 }
346
347 return sumpt2;
348}

◆ getZOfCluster()

std::pair< float, float > HGTD::VertexTimeAlg::getZOfCluster ( const HGTD::Cluster< const xAOD::TrackParticle * > & cluster) const
private

Definition at line 255 of file VertexTimeAlg.cxx.

256 {
257
258 std::vector<const xAOD::TrackParticle*> tracks { cluster.getEntries() };
259
260 float num { 0.0f };
261 float denom { 0.0f };
262
263 for (const auto& track : tracks) {
264
265 float z0 { track->z0() };
266 float z0_variance {
267 static_cast<float>(track->definingParametersCovMatrix()(1, 1))
268 };
269
270 num += z0 / z0_variance;
271 denom += 1.0f / z0_variance;
272 }
273 if (denom == 0.)[[unlikely]]{
274 throw std::runtime_error("VertexTimeAlg::getZOfCluster: denominator is zero");
275 }
276 float avg_z0 = num / denom;
277 float avg_z0_sigma = std::sqrt(1.0f / denom);
278
279 return {avg_z0, avg_z0_sigma};
280}

◆ initialize()

StatusCode HGTD::VertexTimeAlg::initialize ( )
finaloverride

Definition at line 29 of file VertexTimeAlg.cxx.

29 {
30
31 // Initialize keys for event data access
32 ATH_CHECK(m_primVxCont_key.initialize());
33 ATH_CHECK(m_trackCont_key.initialize());
34 ATH_CHECK(m_vxHasTime_key.initialize());
35 ATH_CHECK(m_vxTime_key.initialize());
36 ATH_CHECK(m_vxTimeRes_key.initialize());
37 ATH_CHECK(m_trackValidTime_key.initialize());
38 ATH_CHECK(m_trackTime_key.initialize());
39 ATH_CHECK(m_trackTimeRes_key.initialize());
40 const std::string weightFile {
41 PathResolver::find_file("TMVA.VBFinv.mu200.Step3p1.8var.weights.xml", "DATAPATH")
42 };
43 // Initialize the BDT
44 for (auto& bdt : m_BDT) {
45
46 bdt.reader = std::make_unique<TMVA::Reader>("!Color:!Silent");
47
48 bdt.reader->AddVariable("m_delta_z", &bdt.delta_z);
49 bdt.reader->AddVariable("m_z_sigma", &bdt.z_sigma);
50 bdt.reader->AddVariable("m_q_over_p", &bdt.q_over_p);
51 bdt.reader->AddVariable("m_q_over_p_sigma", &bdt.q_over_p_sigma);
52 bdt.reader->AddVariable("m_delta_z_resunits", &bdt.delta_z_resunits);
53 bdt.reader->AddVariable("m_cluster_sumpt2", &bdt.cluster_sumpt2);
54 bdt.reader->AddVariable("m_d0", &bdt.d0);
55 bdt.reader->AddVariable("m_d0_sigma", &bdt.d0_sigma);
56 bdt.reader->BookMVA("BDT", weightFile);
57 }
58
59 return StatusCode::SUCCESS;
60}
#define ATH_CHECK
Evaluate an expression and check for errors.
static std::string find_file(const std::string &logical_file_name, const std::string &search_path)

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ isClonable()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::isClonable ( ) const
inlineoverridevirtualinherited

Specify if the algorithm is clonable.

Only relevant for non-reentrant algorithms. Actual number of clones needs to be set via the "Cardinality" property.

Reimplemented in AFP_DigiTop, AlgB, AlgT, BCM_Digitization, CscDigitBuilder, CscDigitToCscRDO, G4AtlasAlg, G4RunAlg, HGTD_Digitization, HiveAlgBase, InDet::GNNSeedingTrackMaker, InDet::SCT_Clusterization, InDet::SiSPGNNTrackMaker, InDet::SiSPSeededTrackFinder, InDet::SiTrackerSpacePointFinder, ISF::SimKernelMT, ITk::StripDigitization, ITkPixelCablingAlg, ITkStripCablingAlg, LArHitEMapMaker, LArTTL1Maker, LUCID_DigiTop, LVL1::L1TopoSimulation, MergeCalibHits, MergeGenericMuonSimHitColl, MergeHijingPars, MergeMcEventCollection, MergeTrackRecordCollection, MergeTruthJets, MergeTruthParticles, MuonDigitizer, PileUpMTAlg, PixelDigitization, RoIBResultToxAOD, SCT_ByteStreamErrorsTestAlg, SCT_CablingCondAlgFromCoraCool, SCT_CablingCondAlgFromText, SCT_ConditionsParameterTestAlg, SCT_ConditionsSummaryTestAlg, SCT_ConfigurationConditionsTestAlg, SCT_Digitization, SCT_FlaggedConditionTestAlg, SCT_LinkMaskingTestAlg, SCT_MajorityConditionsTestAlg, SCT_ModuleVetoTestAlg, SCT_MonitorConditionsTestAlg, SCT_PrepDataToxAOD, SCT_RawDataToxAOD, SCT_ReadCalibChipDataTestAlg, SCT_ReadCalibDataTestAlg, SCT_RODVetoTestAlg, SCT_SensorsTestAlg, SCT_SiliconConditionsTestAlg, SCT_StripVetoTestAlg, SCT_TdaqEnabledTestAlg, SCT_TestCablingAlg, SCTEventFlagWriter, SCTRawDataProvider, SCTSiLorentzAngleTestAlg, SCTSiPropertiesTestAlg, SGInputLoader, Simulation::BeamEffectsAlg, TileHitVecToCnt, TileMuonFitter, TilePulseForTileMuonReceiver, TileRawChannelMaker, TRTDigitization, and ZDC_DigiTop.

Definition at line 68 of file AthCommonAlgorithm.h.

68 {
69 return true;
70 }

◆ msg()

MsgStream & AthCommonMsg< Gaudi::Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< Gaudi::Algorithm >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ passTrackVertexAssociation()

bool HGTD::VertexTimeAlg::passTrackVertexAssociation ( const xAOD::TrackParticle * track,
const xAOD::Vertex * vertex,
double min_trk_pt,
const double significance_cut = 2.5 ) const
private

Definition at line 142 of file VertexTimeAlg.cxx.

144 {
145
146 if (track->pt() < min_trk_pt || std::abs(track->eta()) > 4.0) {
147 return false;
148 }
149
150 const double vx_z { vertex->z() };
151 const double vx_z_variance { vertex->covariancePosition()(2, 2) };
152
153 const double trk_z { track->vz() + track->z0() };
154 const double trk_z_variance { track->definingParametersCovMatrix()(1, 1) };
155
156 if (std::abs(trk_z - vx_z) / std::sqrt(trk_z_variance + vx_z_variance)
157 < significance_cut) {
158 return true;
159 } else {
160 return false;
161 }
162}

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 368 of file AthCommonDataStore.h.

369 {
370 h.renounce();
372 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 352 of file AthCommonDataStore.h.

352 {
354 }

◆ scoreCluster()

float HGTD::VertexTimeAlg::scoreCluster ( const EventContext & ctx,
const HGTD::Cluster< const xAOD::TrackParticle * > & cluster,
const xAOD::Vertex * vertex ) const
private

Definition at line 230 of file VertexTimeAlg.cxx.

233 {
234
235 std::pair<float, float> cluster_z { getZOfCluster(cluster) };
236 std::pair<float, float> cluster_oneover_p { getOneOverPOfCluster(cluster) };
237 std::pair<float, float> cluster_d0 { getDOfCluster(cluster) };
238 double vertex_z_variance { vertex->covariancePosition()(2, 2) };
239
240 auto& bdt { *m_BDT.get(ctx) };
241
242 bdt.delta_z = cluster_z.first - vertex->z();
243 bdt.z_sigma = cluster_z.second;
244 bdt.q_over_p = cluster_oneover_p.first;
245 bdt.q_over_p_sigma = cluster_oneover_p.second;
246 bdt.d0 = cluster_d0.first;
247 bdt.d0_sigma = cluster_d0.second;
248 bdt.cluster_sumpt2 = getSumPt2OfCluster(cluster);
249 bdt.delta_z_resunits = (cluster_z.first - vertex->z()) /
250 std::sqrt(std::pow(cluster_z.second, 2.0) + vertex_z_variance);
251
252 return bdt.reader->EvaluateMVA("BDT");
253}
std::pair< float, float > getDOfCluster(const HGTD::Cluster< const xAOD::TrackParticle * > &cluster) const
std::pair< float, float > getOneOverPOfCluster(const HGTD::Cluster< const xAOD::TrackParticle * > &cluster) const
std::pair< float, float > getZOfCluster(const HGTD::Cluster< const xAOD::TrackParticle * > &cluster) const
float getSumPt2OfCluster(const HGTD::Cluster< const xAOD::TrackParticle * > &cluster) const

◆ setFilterPassed()

virtual void AthCommonAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Set filter decision:

Definition at line 99 of file AthCommonAlgorithm.h.

99 {
101 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const
Set filter decision:

◆ sysExecute()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::sysExecute ( const EventContext & ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Reimplemented in AthAnalysisAlgorithm.

Definition at line 80 of file AthCommonAlgorithm.cxx.

41{
42 return BaseAlg::sysExecute (ctx);
43}

◆ sysInitialize()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthHistogramAlgorithm, HypoBase, InputMakerBase, and PyAthena::Alg.

Definition at line 60 of file AthCommonAlgorithm.cxx.

71 {
73
74 if (sc.isFailure()) {
75 return sc;
76 }
77
78 ServiceHandle<ICondSvc> cs("CondSvc",name());
79 for (auto h : outputHandles()) {
80 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
81 // do this inside the loop so we don't create the CondSvc until needed
82 if ( cs.retrieve().isFailure() ) {
83 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
85 }
86 if (cs->regHandle(this,*h).isFailure()) {
88 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
89 << " with CondSvc");
90 }
91 }
92 }
93 return sc;
94}
#define ATH_MSG_ERROR(x,...)
#define ATH_MSG_WARNING(x,...)
virtual StatusCode sysInitialize() override
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 298 of file AthCommonDataStore.h.

298 {
299 for (auto &a : m_vhka) {
301 for (auto k : keys) {
302 k->setOwner(this);
303 }
304 }
305 }

◆ vertexAssociatedHGTDTracks()

std::vector< const xAOD::TrackParticle * > HGTD::VertexTimeAlg::vertexAssociatedHGTDTracks ( const xAOD::Vertex * vertex,
const xAOD::TrackParticleContainer * tracks,
double min_trk_pt ) const
private

Definition at line 120 of file VertexTimeAlg.cxx.

122 {
123
124 std::vector<const xAOD::TrackParticle*> good_tracks { };
125
126 for (const auto trk : *tracks) {
127 if (std::abs(trk->eta()) < 2.4 || std::abs(trk->eta()) > 4.0) {
128 // Track is not within HGTD acceptance
129 continue;
130 }
131 if (trk->pt() < 1.0 * Gaudi::Units::GeV) {
132 continue;
133 }
134 if (passTrackVertexAssociation(trk, vertex, min_trk_pt)) {
135 good_tracks.push_back(trk);
136 }
137 }
138
139 return good_tracks;
140}
bool passTrackVertexAssociation(const xAOD::TrackParticle *track, const xAOD::Vertex *vertex, double min_trk_pt, const double significance_cut=2.5) const

Member Data Documentation

◆ ATLAS_THREAD_SAFE

SG::SlotSpecificObj<HSclusterBDT> m_BDT HGTD::VertexTimeAlg::ATLAS_THREAD_SAFE
mutableprivate

Definition at line 155 of file VertexTimeAlg.h.

◆ m_bdt_cutvalue

Gaudi::Property<float> HGTD::VertexTimeAlg::m_bdt_cutvalue
private
Initial value:
{
this, "BDTCutValue", 0.2f ,
"The BDT output has to be above this value for the cluster to be accepted as HS"
}

Definition at line 100 of file VertexTimeAlg.h.

100 {
101 this, "BDTCutValue", 0.2f ,
102 "The BDT output has to be above this value for the cluster to be accepted as HS"
103 };

◆ m_default_vxTime

Gaudi::Property<float> HGTD::VertexTimeAlg::m_default_vxTime
private
Initial value:
{
this, "DefaultVertexTime", 0.0 * Gaudi::Units::ns,
"The default time assigned to the vertex if no precision time can be calculated"
}

Definition at line 90 of file VertexTimeAlg.h.

90 {
91 this, "DefaultVertexTime", 0.0 * Gaudi::Units::ns,
92 "The default time assigned to the vertex if no precision time can be calculated"
93 };

◆ m_default_vxTimeRes

Gaudi::Property<float> HGTD::VertexTimeAlg::m_default_vxTimeRes
private
Initial value:
{
this, "DefaultVertexTimeResolution", 50.0 / std::sqrt(12.0) * Gaudi::Units::ns,
"The default time resolution assigned to the vertex if no precision time can be calculated"
}

Definition at line 95 of file VertexTimeAlg.h.

95 {
96 this, "DefaultVertexTimeResolution", 50.0 / std::sqrt(12.0) * Gaudi::Units::ns,
97 "The default time resolution assigned to the vertex if no precision time can be calculated"
98 };

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default).

Definition at line 381 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default).

Definition at line 378 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthCommonAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 108 of file AthCommonAlgorithm.h.

◆ m_primVxCont_key

SG::ReadHandleKey<xAOD::VertexContainer> HGTD::VertexTimeAlg::m_primVxCont_key
private
Initial value:
{
this, "PrimaryVertexContainer", "PrimaryVertices",
"Name of the primary vertex container"
}

Definition at line 52 of file VertexTimeAlg.h.

52 {
53 this, "PrimaryVertexContainer", "PrimaryVertices",
54 "Name of the primary vertex container"
55 };

◆ m_trackCont_key

SG::ReadHandleKey<xAOD::TrackParticleContainer> HGTD::VertexTimeAlg::m_trackCont_key
private
Initial value:
{
this, "TrackParticleContainer", "InDetTrackParticles",
"Name of the track container"
}

Definition at line 57 of file VertexTimeAlg.h.

57 {
58 this, "TrackParticleContainer", "InDetTrackParticles",
59 "Name of the track container"
60 };

◆ m_trackTime_key

SG::ReadDecorHandleKey<xAOD::TrackParticleContainer> HGTD::VertexTimeAlg::m_trackTime_key
private
Initial value:
{
this, "TrackTime", m_trackCont_key, "time", "Time assigned to tracks"
}

Definition at line 81 of file VertexTimeAlg.h.

81 {
82 this, "TrackTime", m_trackCont_key, "time", "Time assigned to tracks"
83 };

◆ m_trackTimeRes_key

SG::ReadDecorHandleKey<xAOD::TrackParticleContainer> HGTD::VertexTimeAlg::m_trackTimeRes_key
private
Initial value:
{
this, "TrackTimeResolution", m_trackCont_key, "timeResolution",
"Time resolution assigned to tracks"
}

Definition at line 85 of file VertexTimeAlg.h.

85 {
86 this, "TrackTimeResolution", m_trackCont_key, "timeResolution",
87 "Time resolution assigned to tracks"
88 };

◆ m_trackValidTime_key

SG::ReadDecorHandleKey<xAOD::TrackParticleContainer> HGTD::VertexTimeAlg::m_trackValidTime_key
private
Initial value:
{
this, "TrackHasValidTime", m_trackCont_key, "hasValidTime",
"Specifies if the track has a valid precision time"
}

Definition at line 76 of file VertexTimeAlg.h.

76 {
77 this, "TrackHasValidTime", m_trackCont_key, "hasValidTime",
78 "Specifies if the track has a valid precision time"
79 };

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 387 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
privateinherited

Definition at line 386 of file AthCommonDataStore.h.

◆ m_vxHasTime_key

SG::WriteDecorHandleKey<xAOD::VertexContainer> HGTD::VertexTimeAlg::m_vxHasTime_key
private
Initial value:
{
this, "VertexHasValidTime", m_primVxCont_key, "hasValidTime",
"Specifies if the vertex has a valid time"
}

Definition at line 62 of file VertexTimeAlg.h.

62 {
63 this, "VertexHasValidTime", m_primVxCont_key, "hasValidTime",
64 "Specifies if the vertex has a valid time"
65 };

◆ m_vxTime_key

SG::WriteDecorHandleKey<xAOD::VertexContainer> HGTD::VertexTimeAlg::m_vxTime_key
private
Initial value:
{
this, "VertexTime", m_primVxCont_key, "time", "Time assigned to vertices"
}

Definition at line 67 of file VertexTimeAlg.h.

67 {
68 this, "VertexTime", m_primVxCont_key, "time", "Time assigned to vertices"
69 };

◆ m_vxTimeRes_key

SG::WriteDecorHandleKey<xAOD::VertexContainer> HGTD::VertexTimeAlg::m_vxTimeRes_key
private
Initial value:
{
this, "VertexTimeResolution", m_primVxCont_key, "timeResolution",
"Time resolution assigned to vertices"
}

Definition at line 71 of file VertexTimeAlg.h.

71 {
72 this, "VertexTimeResolution", m_primVxCont_key, "timeResolution",
73 "Time resolution assigned to vertices"
74 };

The documentation for this class was generated from the following files: