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 unsigned int cardinality () const override
 Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.
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
virtual void setFilterPassed (bool state, const EventContext &ctx) const
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< StoreGateSvcStoreGateSvc_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::VertexContainerm_primVxCont_key
SG::ReadHandleKey< xAOD::TrackParticleContainerm_trackCont_key
SG::WriteDecorHandleKey< xAOD::VertexContainerm_vxHasTime_key
SG::WriteDecorHandleKey< xAOD::VertexContainerm_vxTime_key
SG::WriteDecorHandleKey< xAOD::VertexContainerm_vxTimeRes_key
SG::ReadDecorHandleKey< xAOD::TrackParticleContainerm_trackValidTime_key
SG::ReadDecorHandleKey< xAOD::TrackParticleContainerm_trackTime_key
SG::ReadDecorHandleKey< xAOD::TrackParticleContainerm_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 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ VertexTimeAlg()

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

Definition at line 25 of file VertexTimeAlg.cxx.

26 : AthReentrantAlgorithm(name, pSvcLocator) {}

Member Function Documentation

◆ cardinality()

unsigned int AthCommonReentrantAlgorithm< Gaudi::Algorithm >::cardinality ( ) const
overridevirtualinherited

Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.

Override this to return 0 for reentrant algorithms.

Definition at line 75 of file AthCommonReentrantAlgorithm.cxx.

64{
65 return 0;
66}

◆ 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 167 of file VertexTimeAlg.cxx.

170 {
171
172 SG::ReadDecorHandle<xAOD::TrackParticleContainer, uint8_t> trackValidTime(
174
175 SG::ReadDecorHandle<xAOD::TrackParticleContainer, float> trackTime(
176 m_trackTime_key, ctx);
177
178 SG::ReadDecorHandle<xAOD::TrackParticleContainer, float> trackTimeResolution(
179 m_trackTimeRes_key, ctx);
180
181
182 HGTD::ClusterCollection<const xAOD::TrackParticle*> collection { };
183
184 for (const auto& track : tracks) {
185
186 if (trackValidTime(*track)) {
187 double time { trackTime(*track) };
188 double timeResolution { trackTimeResolution(*track) };
189
190 HGTD::Cluster<const xAOD::TrackParticle*> cluster(
191 {time}, {timeResolution}, track);
192
193 collection.addCluster(cluster);
194 }
195 }
196
197 collection.updateDistanceCut(cluster_distance);
199
200 return collection.getClusters();
201}
void doClustering(ClusterAlgo algo)
Definition Clustering.h:368
void updateDistanceCut(double cut_value)
Set the distance cut.
Definition Clustering.h:270
void addCluster(const Cluster< T > &vx)
Definition Clustering.h:274
const std::vector< Cluster< T > > & getClusters() const
Definition Clustering.h:506
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 64 of file VertexTimeAlg.cxx.

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

90{
91 // If we didn't find any symlinks to add, just return the collection
92 // from the base class. Otherwise, return the extended collection.
93 if (!m_extendedExtraObjects.empty()) {
95 }
97}
An algorithm that can be simultaneously executed in multiple threads.

◆ filterPassed()

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

Definition at line 96 of file AthCommonReentrantAlgorithm.h.

96 {
97 return execState( ctx ).filterPassed();
98 }
virtual bool filterPassed(const EventContext &ctx) const

◆ getDOfCluster()

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

Definition at line 307 of file VertexTimeAlg.cxx.

308 {
309
310 std::vector<const xAOD::TrackParticle*> tracks { cluster.getEntries() };
311
312 float num { 0.0f };
313 float denom { 0.0f };
314
315 for (const auto& track : tracks) {
316
317 float d0 { track->d0() };
318 float d0_variance {
319 static_cast<float>(track->definingParametersCovMatrix()(0, 0))
320 };
321
322 num += d0 / d0_variance;
323 denom += 1.0f / d0_variance;
324 }
325
326 float avg_z0 = num / denom;
327 float avg_z0_sigma = std::sqrt(1.0f / denom);
328
329 return {avg_z0, avg_z0_sigma};
330}

◆ 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 203 of file VertexTimeAlg.cxx.

206 {
207
208 HGTD::Cluster<const xAOD::TrackParticle*> HS_cluster { };
209 float max_BDT_score { -1.0f };
210
211 for (const auto& cluster : clusters) {
212
213 // HS cluster has an additional requirement to have at least 3 tracks
214 if (cluster.getEntries().size() < 3) {
215 continue;
216 }
217
218 const float cluster_score { scoreCluster(ctx, cluster, vertex) };
219
220 if (cluster_score > m_bdt_cutvalue && cluster_score > max_BDT_score) {
221
222 max_BDT_score = cluster_score;
223 HS_cluster = cluster;
224 }
225 }
226
227 // If no cluster passes the HS criteria, the return value will be an empty
228 // cluster
229 return HS_cluster;
230}
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
301 float avg_oneover_p = num / denom;
302 float avg_oneover_p_sigma = std::sqrt(1.0f / denom);
303
304 return {avg_oneover_p, avg_oneover_p_sigma};
305}

◆ getSumPt2OfCluster()

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

Definition at line 332 of file VertexTimeAlg.cxx.

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

◆ getZOfCluster()

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

Definition at line 257 of file VertexTimeAlg.cxx.

258 {
259
260 std::vector<const xAOD::TrackParticle*> tracks { cluster.getEntries() };
261
262 float num { 0.0f };
263 float denom { 0.0f };
264
265 for (const auto& track : tracks) {
266
267 float z0 { track->z0() };
268 float z0_variance {
269 static_cast<float>(track->definingParametersCovMatrix()(1, 1))
270 };
271
272 num += z0 / z0_variance;
273 denom += 1.0f / z0_variance;
274 }
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 28 of file VertexTimeAlg.cxx.

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

◆ 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 144 of file VertexTimeAlg.cxx.

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

◆ 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 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
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 364 of file AthCommonDataStore.h.

364 {
366 }

◆ scoreCluster()

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

Definition at line 232 of file VertexTimeAlg.cxx.

235 {
236
237 std::pair<float, float> cluster_z { getZOfCluster(cluster) };
238 std::pair<float, float> cluster_oneover_p { getOneOverPOfCluster(cluster) };
239 std::pair<float, float> cluster_d0 { getDOfCluster(cluster) };
240 double vertex_z_variance { vertex->covariancePosition()(2, 2) };
241
242 auto& bdt { *m_BDT.get(ctx) };
243
244 bdt.delta_z = cluster_z.first - vertex->z();
245 bdt.z_sigma = cluster_z.second;
246 bdt.q_over_p = cluster_oneover_p.first;
247 bdt.q_over_p_sigma = cluster_oneover_p.second;
248 bdt.d0 = cluster_d0.first;
249 bdt.d0_sigma = cluster_d0.second;
250 bdt.cluster_sumpt2 = getSumPt2OfCluster(cluster);
251 bdt.delta_z_resunits = (cluster_z.first - vertex->z()) /
252 std::sqrt(std::pow(cluster_z.second, 2.0) + vertex_z_variance);
253
254 return bdt.reader->EvaluateMVA("BDT");
255}
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 AthCommonReentrantAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Definition at line 100 of file AthCommonReentrantAlgorithm.h.

100 {
102 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const

◆ sysExecute()

StatusCode AthCommonReentrantAlgorithm< 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.

Definition at line 85 of file AthCommonReentrantAlgorithm.cxx.

77{
78 return BaseAlg::sysExecute (ctx);
79}

◆ sysInitialize()

StatusCode AthCommonReentrantAlgorithm< 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 HypoBase, and InputMakerBase.

Definition at line 61 of file AthCommonReentrantAlgorithm.cxx.

107 {
109
110 if (sc.isFailure()) {
111 return sc;
112 }
113
114 ServiceHandle<ICondSvc> cs("CondSvc",name());
115 for (auto h : outputHandles()) {
116 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
117 // do this inside the loop so we don't create the CondSvc until needed
118 if ( cs.retrieve().isFailure() ) {
119 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
120 return StatusCode::SUCCESS;
121 }
122 if (cs->regHandle(this,*h).isFailure()) {
124 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
125 << " with CondSvc");
126 }
127 }
128 }
129 return sc;
130}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_WARNING(x)
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 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }

◆ 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 122 of file VertexTimeAlg.cxx.

124 {
125
126 std::vector<const xAOD::TrackParticle*> good_tracks { };
127
128 for (const auto trk : *tracks) {
129 if (std::abs(trk->eta()) < 2.4 || std::abs(trk->eta()) > 4.0) {
130 // Track is not within HGTD acceptance
131 continue;
132 }
133 if (trk->pt() < 1.0 * Gaudi::Units::GeV) {
134 continue;
135 }
136 if (passTrackVertexAssociation(trk, vertex, min_trk_pt)) {
137 good_tracks.push_back(trk);
138 }
139 }
140
141 return good_tracks;
142}
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 393 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 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

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

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

Empty if no symlinks were found.

Definition at line 114 of file AthCommonReentrantAlgorithm.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", "InDetTrackParticles.time", "Time assigned to tracks"
}

Definition at line 81 of file VertexTimeAlg.h.

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

◆ m_trackTimeRes_key

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

Definition at line 85 of file VertexTimeAlg.h.

85 {
86 this, "TrackTimeResolution", "InDetTrackParticles.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", "InDetTrackParticles.hasValidTime",
"Specifies if the track has a valid precision time"
}

Definition at line 76 of file VertexTimeAlg.h.

76 {
77 this, "TrackHasValidTime", "InDetTrackParticles.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 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.

◆ m_vxHasTime_key

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

Definition at line 62 of file VertexTimeAlg.h.

62 {
63 this, "VertexHasValidTime", "PrimaryVertices.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", "PrimaryVertices.time", "Time assigned to vertices"
}

Definition at line 67 of file VertexTimeAlg.h.

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

◆ m_vxTimeRes_key

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

Definition at line 71 of file VertexTimeAlg.h.

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

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