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

#include <TimeCompatibilityCheckAlg.h>

Inheritance diagram for HGTD::TimeCompatibilityCheckAlg:
Collaboration diagram for HGTD::TimeCompatibilityCheckAlg:

Classes

struct  Hit

Public Member Functions

 TimeCompatibilityCheckAlg (const std::string &name, ISvcLocator *pSvcLocator)
virtual ~TimeCompatibilityCheckAlg ()
virtual StatusCode initialize () override final
virtual 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< StoreGateSvcStoreGateSvc_t

Private Member Functions

float calculateChi2 (const std::vector< Hit > &hits) const
std::vector< TimeCompatibilityCheckAlg::HitgetValidHits (const xAOD::TrackParticle *track_particle) const
bool passesDeltaT (const std::vector< Hit > &hits) const
std::vector< TimeCompatibilityCheckAlg::HitgetTimeCompatibleHits (const xAOD::TrackParticle *track_particle) const
bool lastHitIsOnLastSurface (const xAOD::TrackParticle &track_particle) const
const Trk::TrackParametersgetLastHitOnTrack (const Trk::Track &track) const
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

ToolHandle< IHGTD_HolesITkToolm_extensionTool {this, "ITkHoles", "HGTD_IterativeExtensionTool/HGTD_IterativeExtensionTool", "Tool for calculating the holes in"}
SG::ReadHandleKey< xAOD::TrackParticleContainerm_trackParticleContainerKey {this, "TrackParticleContainerName", "InDetTrackParticles", "Name of the TrackParticle container"}
SG::ReadDecorHandleKey< xAOD::TrackParticleContainerm_layerHasExtensionKey {this, "HGTD_has_extension", m_trackParticleContainerKey, "HGTD_has_extension", "deco with a handle for an extension"}
SG::ReadDecorHandleKey< xAOD::TrackParticleContainerm_layerExtensionChi2Key {this, "HGTD_extension_chi2", m_trackParticleContainerKey, "HGTD_extension_chi2", "deco with a handle for a ch2 of extension"}
SG::ReadDecorHandleKey< xAOD::TrackParticleContainerm_layerClusterRawTimeKey {this, "HGTD_cluster_raw_time", m_trackParticleContainerKey, "HGTD_cluster_raw_time", "deco with a handle for layer cluster raw time"}
SG::ReadDecorHandleKey< xAOD::TrackParticleContainerm_layerClusterTimeKey {this, "HGTD_cluster_time", m_trackParticleContainerKey, "HGTD_cluster_time", "deco with a handle for cluster time"}
SG::ReadDecorHandleKey< xAOD::TrackParticleContainerm_layerClusterTruthClassKey {this, "HGTD_cluster_truth_class", m_trackParticleContainerKey, "HGTD_cluster_truth_class", "deco with a handle for a truth time"}
SG::ReadDecorHandleKey< xAOD::TrackParticleContainerm_layerClusterShadowedKey {this, "HGTD_cluster_shadowed", m_trackParticleContainerKey, "HGTD_cluster_shadowed", "deco with a handle for a shadowed cluster"}
SG::ReadDecorHandleKey< xAOD::TrackParticleContainerm_layerClusterMergedKey {this, "HGTD_cluster_merged", m_trackParticleContainerKey, "HGTD_cluster_merged", "deco with a handle for a merged cluster"}
SG::ReadDecorHandleKey< xAOD::TrackParticleContainerm_layerPrimaryExpectedKey {this, "HGTD_primary_expected", m_trackParticleContainerKey, "HGTD_primary_expected", "deco with a handle for an expected primary"}
SG::ReadDecorHandleKey< xAOD::TrackParticleContainerm_extrapXKey {this, "HGTD_extrap_x",m_trackParticleContainerKey, "HGTD_extrap_x", "deco with a handle for an x of extrap"}
SG::ReadDecorHandleKey< xAOD::TrackParticleContainerm_extrapYKey {this, "HGTD_extrap_y", m_trackParticleContainerKey, "HGTD_extrap_y", "deco with a handle for an y of extrap"}
SG::ReadDecorHandleKey< xAOD::TrackParticleContainerm_holesHGTDKey {this, "HGTD_holes", m_trackParticleContainerKey, "HGTD_holes", "deco with the holes on track in HGTD"}
SG::WriteDecorHandleKey< xAOD::TrackParticleContainerm_compatibleHitsTimesKey {this, "HGTD_times_of_compatible_hits",m_trackParticleContainerKey, "HGTD_times_of_compatible_hits", "deco with a handle for the time compatible hits' times"}
SG::WriteDecorHandleKey< xAOD::TrackParticleContainerm_lastHitInITkCutKey {this, "HGTD_last_hit_in_ITk_cut", m_trackParticleContainerKey, "HGTD_last_hit_in_ITk_cut", "deco with a handle for the last hit to be close to HGTDrequirement"}
SG::WriteDecorHandleKey< xAOD::TrackParticleContainerm_holesITkKey {this, "HGTD_holes_in_ITk", m_trackParticleContainerKey, "HGTD_holes_in_ITk", "deco with a handle for the number of holes on track in ITk between the last hit on track and HGTD"}
FloatProperty m_chi2_threshold
FloatProperty m_delta_cut
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 44 of file TimeCompatibilityCheckAlg.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

◆ TimeCompatibilityCheckAlg()

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

Definition at line 20 of file TimeCompatibilityCheckAlg.cxx.

22 : AthReentrantAlgorithm(name, pSvcLocator){}

◆ ~TimeCompatibilityCheckAlg()

virtual HGTD::TimeCompatibilityCheckAlg::~TimeCompatibilityCheckAlg ( )
inlinevirtual

Definition at line 48 of file TimeCompatibilityCheckAlg.h.

48{}

Member Function Documentation

◆ calculateChi2()

float HGTD::TimeCompatibilityCheckAlg::calculateChi2 ( const std::vector< Hit > & hits) const
private

Definition at line 117 of file TimeCompatibilityCheckAlg.cxx.

117 {
118
119 //Calculation of the mean
120 float sum = 0.;
121 for (const auto& hit : hits){
122 sum += hit.m_time;
123 }
124 float mean = sum / (float)hits.size();
125
126 //Calculation of the Chi2
127 float chi2 = 0.;
128 for (size_t i = 0; i < hits.size(); i++) {
129 chi2 += (hits.at(i).m_time - mean) * (hits.at(i).m_time - mean) /
130 (hits.at(i).m_resolution * hits.at(i).m_resolution);
131 }
132 return chi2;
133 }
double chi2(TH1 *h0, TH1 *h1)
void mean(std::vector< double > &bins, std::vector< double > &values, const std::vector< std::string > &files, const std::string &histname, const std::string &tplotname, const std::string &label="")

◆ 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::TimeCompatibilityCheckAlg::execute ( const EventContext & ctx) const
finaloverridevirtual

This is a first attempt to design a bitfield with an HGTD track summary

uint32_t HGTD_track_summary = 0;

Field will contain the following values: HGTD_acceptance : 1; HGTD_has_extension : 3; (max 4 extensions) HGTD_extension_chi2 : 12; (each layer (4) has 1 option (3 bits): <1 / <2 / <3 / <4) HGTD_number_of_holes : 3; (max 4 holes) HGTD_hits_compatible_in_time : 3 (max 4)

Definition at line 49 of file TimeCompatibilityCheckAlg.cxx.

49 {
50
51 SG::ReadHandle<xAOD::TrackParticleContainer> trk_ptkl_container_handle(
53 const xAOD::TrackParticleContainer* track_particles = trk_ptkl_container_handle.cptr();
54if (not track_particles) {
55 ATH_MSG_ERROR("[TimeCompatibilityCheckAlg] TrackParticleContainer not found, "
56 "aborting execute!");
57 return StatusCode::FAILURE;
58}
59
60 SG::WriteDecorHandle<xAOD::TrackParticleContainer, std::vector<float>> compatibleHitsTimesHandle(
62 SG::WriteDecorHandle<xAOD::TrackParticleContainer, char> lastHitInITkCutHandle(
64 SG::WriteDecorHandle<xAOD::TrackParticleContainer, int> holesITkHandle(
65 m_holesITkKey, ctx);
66
67 SG::ReadDecorHandle<xAOD::TrackParticleContainer, std::vector<float>> layerExtensionChi2Handle(
69 SG::ReadDecorHandle<xAOD::TrackParticleContainer, std::vector<float>> layerClusterRawTimeHandle(
71 SG::ReadDecorHandle<xAOD::TrackParticleContainer, std::vector<int>> layerClusterTruthClassHandle(
73 SG::ReadDecorHandle<xAOD::TrackParticleContainer, std::vector<char>> layerClusterShadowedHandle(
75 SG::ReadDecorHandle<xAOD::TrackParticleContainer, std::vector<char>> layerClusterMergedHandle(
77 SG::ReadDecorHandle<xAOD::TrackParticleContainer, std::vector<char>> layerPrimaryExpectedHandle(
79 SG::ReadDecorHandle<xAOD::TrackParticleContainer, float> extrapXHandle(
80 m_extrapXKey, ctx);
81 SG::ReadDecorHandle<xAOD::TrackParticleContainer, float> extrapYHandle(
82 m_extrapYKey, ctx);
83
84 for (const auto* track_ptkl : *track_particles) {
85
86// Filling here the decoration with times of the compatible hits per track
87
88 for(const auto hit : getTimeCompatibleHits(track_ptkl)){
89 compatibleHitsTimesHandle(*track_ptkl).push_back(hit.m_time);
90 }
91 lastHitInITkCutHandle(*track_ptkl) = lastHitIsOnLastSurface(*track_ptkl);
92
93 holesITkHandle(*track_ptkl) = (m_extensionTool->getHolesITk(ctx, *track_ptkl)).size();
94
95
109
110 }
111 return StatusCode::SUCCESS;
112}
#define ATH_MSG_ERROR(x)
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_extrapYKey
ToolHandle< IHGTD_HolesITkTool > m_extensionTool
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_layerClusterRawTimeKey
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_compatibleHitsTimesKey
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_layerClusterTruthClassKey
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_layerExtensionChi2Key
std::vector< TimeCompatibilityCheckAlg::Hit > getTimeCompatibleHits(const xAOD::TrackParticle *track_particle) const
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_lastHitInITkCutKey
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_layerClusterShadowedKey
bool lastHitIsOnLastSurface(const xAOD::TrackParticle &track_particle) const
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_layerClusterMergedKey
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_extrapXKey
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_trackParticleContainerKey
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_layerPrimaryExpectedKey
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_holesITkKey
TrackParticleContainer_v1 TrackParticleContainer
Definition of the current "TrackParticle container version".

◆ 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:

◆ getLastHitOnTrack()

const Trk::TrackParameters * HGTD::TimeCompatibilityCheckAlg::getLastHitOnTrack ( const Trk::Track & track) const
private

Definition at line 257 of file TimeCompatibilityCheckAlg.cxx.

257 {
258
259 const DataVector<const Trk::TrackStateOnSurface>* tsos =
260 track.trackStateOnSurfaces();
261 if (not tsos) {
262 ATH_MSG_ERROR("Failed to retrieve track state on surfaces");
263 return nullptr;
264 }
265 // loop over the associated hits in ITk in reverse order, since we want to
266 // select the one closest to HGTD to start the extrapolation
267 for (auto i = tsos->rbegin(); i != tsos->rend(); ++i) {
268 const auto* curr_last_tsos = *i;
269 if (not curr_last_tsos) {
270 continue;
271 }
272 if (curr_last_tsos->type(Trk::TrackStateOnSurface::Measurement) and
273 curr_last_tsos->trackParameters() and
274 curr_last_tsos->measurementOnTrack()) {
275 return curr_last_tsos->trackParameters();
276 }
277 }
278 return nullptr;
279}
@ Measurement
This is a measurement, and will at least contain a Trk::MeasurementBase.

◆ getTimeCompatibleHits()

std::vector< TimeCompatibilityCheckAlg::Hit > HGTD::TimeCompatibilityCheckAlg::getTimeCompatibleHits ( const xAOD::TrackParticle * track_particle) const
private

Definition at line 174 of file TimeCompatibilityCheckAlg.cxx.

175 {
176// get all available hits (see the struct Hit) in a first step
177auto valid_hits = getValidHits(track_particle);
178
179size_t vts = valid_hits.size();
180
181// if there is only one hit, not time consistency check can be done
182if (vts <= 1) {
183 return valid_hits;
184}
185
186// in case of two hits, check for time consistencyf
187if (vts == 2) {
188 if (passesDeltaT(valid_hits)) {
189 return valid_hits;
190 } else {
191 // if times are too far away form each other, do not accept time
192 return {};
193 }
194}
195
196// if there are 3 or 4 hits, perfome chi2 outlier removal
197// calculate the chi2 value of the available hits in a first step
198float chi2 = calculateChi2(valid_hits);
199
200// if the chi2 value does not surpass the set threshold, the hits are accepted as compatible in time
201if (chi2 < m_chi2_threshold) {
202 return valid_hits;
203}
204
205std::vector<Hit> time_candidates_copy = valid_hits; // TODO do I need this copy?
206 bool searching = true;
207 while (searching) {
208 // calculate chi2 contribution of each value
209 std::vector<float> chi2_contributions(time_candidates_copy.size(), 0.0);
210 for (size_t i = 0; i < time_candidates_copy.size(); i++) {
211 std::vector<Hit> buff = time_candidates_copy;
212 buff.erase(buff.begin() + i);
213
214 // calculate the chi2 value we would get when removing the i-th hit
215 double local_chi2 = calculateChi2(buff);
216
217 chi2_contributions.at(i) = local_chi2;
218 }
219 // if removing one of the hits gives a much smaller chi2, it should be
220 // removed so find the position where the "local chi2" is the smallest, and
221 // this is the hit that should be removed (since it gave a big
222 // contribution)]
223
224 // find minimum local chi2
225 int position = std::distance(
226 chi2_contributions.begin(),
227 std::min_element(chi2_contributions.begin(), chi2_contributions.end()));
228
229 // and remove it from the hits
230 time_candidates_copy.erase(time_candidates_copy.begin() + position);
231
232 // recompute chi2 value
233 chi2 = calculateChi2(time_candidates_copy);
234
235 // check for accepted chi2
236 if (chi2 < m_chi2_threshold) {
237 // if the threshold is now fulfilled, break out of the while loop
238 searching = false;
239 }
240 // if everything except 2 values has been removed, stop algo
241 if (time_candidates_copy.size() == 2) {
242 if (passesDeltaT(time_candidates_copy)) {
243 return time_candidates_copy;
244 } else {
245 ATH_MSG_DEBUG("[TimeCompatibilityCheckAlg::getValidHits] times of hits are too far away");
246 // if times are too far away, don't accept any TODO maybe accept one,
247 // can the spatial chi2 be used?
248 return {};
249 }
250 }
251 }
252 return time_candidates_copy;
253}
#define ATH_MSG_DEBUG(x)
std::vector< TimeCompatibilityCheckAlg::Hit > getValidHits(const xAOD::TrackParticle *track_particle) const
float calculateChi2(const std::vector< Hit > &hits) const
bool passesDeltaT(const std::vector< Hit > &hits) const
const Amg::Vector3D & position() const
Method to retrieve the position of the Intersection.

◆ getValidHits()

std::vector< TimeCompatibilityCheckAlg::Hit > HGTD::TimeCompatibilityCheckAlg::getValidHits ( const xAOD::TrackParticle * track_particle) const
private

Definition at line 136 of file TimeCompatibilityCheckAlg.cxx.

136 {
137
138 SG::ReadDecorHandle<xAOD::TrackParticleContainer, std::vector<float>> layerClusterTimeHandle(m_layerClusterTimeKey);
139 std::vector<float> times = layerClusterTimeHandle(*track_particle);
140
141 SG::ReadDecorHandle<xAOD::TrackParticleContainer, std::vector<char>> layerHasExtensionHandle(m_layerHasExtensionKey);
142 std::vector<char> has_clusters = layerHasExtensionHandle(*track_particle);
143
144 std::vector<Hit> valid_hits;
145 valid_hits.reserve(4);
146
147for (size_t i = 0; i < has_clusters.size(); i++){
148 if (not has_clusters.at(i)) {
149 ATH_MSG_DEBUG("[TimeCompatibilityCheckAlg::getValidHits] NO clusters found");
150 continue;
151 }
152 Hit newhit;
153
154 newhit.m_time = times.at(i);
155
156 valid_hits.push_back(newhit);
157}
158return valid_hits;
159
160}
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_layerClusterTimeKey
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_layerHasExtensionKey

◆ initialize()

StatusCode HGTD::TimeCompatibilityCheckAlg::initialize ( )
finaloverridevirtual

Definition at line 24 of file TimeCompatibilityCheckAlg.cxx.

24 {
25
26 ATH_CHECK(m_extensionTool.retrieve());
31 ATH_CHECK(m_layerClusterTimeKey.initialize());
36 ATH_CHECK(m_extrapXKey.initialize());
37 ATH_CHECK(m_extrapYKey.initialize());
39 ATH_CHECK(m_lastHitInITkCutKey.initialize());
40 ATH_CHECK(m_holesHGTDKey.initialize());
41 ATH_CHECK(m_holesITkKey.initialize());
42
43 return StatusCode::SUCCESS;
44}
#define ATH_CHECK
Evaluate an expression and check for errors.
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_holesHGTDKey

◆ 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 }

◆ lastHitIsOnLastSurface()

bool HGTD::TimeCompatibilityCheckAlg::lastHitIsOnLastSurface ( const xAOD::TrackParticle & track_particle) const
private

Definition at line 281 of file TimeCompatibilityCheckAlg.cxx.

281 {
282 const Trk::Track* track = track_particle.track();
283 const Trk::TrackParameters* last_hit_param = getLastHitOnTrack(*track);
284 double radius = hypot(last_hit_param->position().x(), last_hit_param->position().y());
285 double abs_z = fabs(last_hit_param->position().z());
286
287 if (abs_z > 2700) {
288 return true;
289 }
290 if (radius < 350 and abs_z > 2400) {
291 return true;
292 }
293 // region 2
294 if (radius > 205 and radius < 350 and abs_z > 2100) {
295 return true;
296 }
297 // region 3
298 if (radius < 220 and abs_z > 2200) {
299 return true;
300 }
301
302 if (radius < 140 and abs_z > 1890) {
303 return true;
304 }
305
306 return false;
307}
const Trk::TrackParameters * getLastHitOnTrack(const Trk::Track &track) const
const Amg::Vector3D & position() const
Access method for the position.
const Trk::Track * track() const
Returns a pointer (which can be NULL) to the Trk::Track which was used to make this TrackParticle.
ParametersBase< TrackParametersDim, Charged > TrackParameters

◆ 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.

◆ passesDeltaT()

bool HGTD::TimeCompatibilityCheckAlg::passesDeltaT ( const std::vector< Hit > & hits) const
private

Definition at line 162 of file TimeCompatibilityCheckAlg.cxx.

162 {
163 if (not(hits.size()==2)){
164 return false;
165 }
166// pass if the distance in units of the resolution passes the cut
167if (fabs(hits.at(0).m_time - hits.at(1).m_time) <
168 m_delta_cut * hypot(hits.at(0).m_resolution, hits.at(1).m_resolution)) {
169 return true;
170 }
171 return false;
172}

◆ 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 }

◆ setFilterPassed()

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

Set filter decision:

Reimplemented in AthFilterAlgorithm.

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, AthFilterAlgorithm, 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_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 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 }

Member Data Documentation

◆ m_chi2_threshold

FloatProperty HGTD::TimeCompatibilityCheckAlg::m_chi2_threshold
private
Initial value:
{this, "Chi2Threshold", 1.5,
"Quality cut for decision to keep hits compatible in time"}

Definition at line 82 of file TimeCompatibilityCheckAlg.h.

82 {this, "Chi2Threshold", 1.5,
83 "Quality cut for decision to keep hits compatible in time"};

◆ m_compatibleHitsTimesKey

SG::WriteDecorHandleKey<xAOD::TrackParticleContainer> HGTD::TimeCompatibilityCheckAlg::m_compatibleHitsTimesKey {this, "HGTD_times_of_compatible_hits",m_trackParticleContainerKey, "HGTD_times_of_compatible_hits", "deco with a handle for the time compatible hits' times"}
private

Definition at line 71 of file TimeCompatibilityCheckAlg.h.

71{this, "HGTD_times_of_compatible_hits",m_trackParticleContainerKey, "HGTD_times_of_compatible_hits", "deco with a handle for the time compatible hits' times"};

◆ m_delta_cut

FloatProperty HGTD::TimeCompatibilityCheckAlg::m_delta_cut
private
Initial value:
{this, "DeltaTCut", 2.0,
"Upper limit for a cluster delta t cut"}

Definition at line 85 of file TimeCompatibilityCheckAlg.h.

85 {this, "DeltaTCut", 2.0,
86 "Upper limit for a cluster delta t cut"};

◆ 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 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_extensionTool

ToolHandle<IHGTD_HolesITkTool> HGTD::TimeCompatibilityCheckAlg::m_extensionTool {this, "ITkHoles", "HGTD_IterativeExtensionTool/HGTD_IterativeExtensionTool", "Tool for calculating the holes in"}
private

Definition at line 53 of file TimeCompatibilityCheckAlg.h.

53{this, "ITkHoles", "HGTD_IterativeExtensionTool/HGTD_IterativeExtensionTool", "Tool for calculating the holes in"};

◆ m_extrapXKey

SG::ReadDecorHandleKey<xAOD::TrackParticleContainer> HGTD::TimeCompatibilityCheckAlg::m_extrapXKey {this, "HGTD_extrap_x",m_trackParticleContainerKey, "HGTD_extrap_x", "deco with a handle for an x of extrap"}
private

Definition at line 66 of file TimeCompatibilityCheckAlg.h.

66{this, "HGTD_extrap_x",m_trackParticleContainerKey, "HGTD_extrap_x", "deco with a handle for an x of extrap"};

◆ m_extrapYKey

SG::ReadDecorHandleKey<xAOD::TrackParticleContainer> HGTD::TimeCompatibilityCheckAlg::m_extrapYKey {this, "HGTD_extrap_y", m_trackParticleContainerKey, "HGTD_extrap_y", "deco with a handle for an y of extrap"}
private

Definition at line 67 of file TimeCompatibilityCheckAlg.h.

67{this, "HGTD_extrap_y", m_trackParticleContainerKey, "HGTD_extrap_y", "deco with a handle for an y of extrap"};

◆ m_holesHGTDKey

SG::ReadDecorHandleKey<xAOD::TrackParticleContainer> HGTD::TimeCompatibilityCheckAlg::m_holesHGTDKey {this, "HGTD_holes", m_trackParticleContainerKey, "HGTD_holes", "deco with the holes on track in HGTD"}
private

Definition at line 68 of file TimeCompatibilityCheckAlg.h.

68{this, "HGTD_holes", m_trackParticleContainerKey, "HGTD_holes", "deco with the holes on track in HGTD"};

◆ m_holesITkKey

SG::WriteDecorHandleKey<xAOD::TrackParticleContainer> HGTD::TimeCompatibilityCheckAlg::m_holesITkKey {this, "HGTD_holes_in_ITk", m_trackParticleContainerKey, "HGTD_holes_in_ITk", "deco with a handle for the number of holes on track in ITk between the last hit on track and HGTD"}
private

Definition at line 73 of file TimeCompatibilityCheckAlg.h.

73{this, "HGTD_holes_in_ITk", m_trackParticleContainerKey, "HGTD_holes_in_ITk", "deco with a handle for the number of holes on track in ITk between the last hit on track and HGTD"};

◆ m_lastHitInITkCutKey

SG::WriteDecorHandleKey<xAOD::TrackParticleContainer> HGTD::TimeCompatibilityCheckAlg::m_lastHitInITkCutKey {this, "HGTD_last_hit_in_ITk_cut", m_trackParticleContainerKey, "HGTD_last_hit_in_ITk_cut", "deco with a handle for the last hit to be close to HGTDrequirement"}
private

Definition at line 72 of file TimeCompatibilityCheckAlg.h.

72{this, "HGTD_last_hit_in_ITk_cut", m_trackParticleContainerKey, "HGTD_last_hit_in_ITk_cut", "deco with a handle for the last hit to be close to HGTDrequirement"};

◆ m_layerClusterMergedKey

SG::ReadDecorHandleKey<xAOD::TrackParticleContainer> HGTD::TimeCompatibilityCheckAlg::m_layerClusterMergedKey {this, "HGTD_cluster_merged", m_trackParticleContainerKey, "HGTD_cluster_merged", "deco with a handle for a merged cluster"}
private

Definition at line 64 of file TimeCompatibilityCheckAlg.h.

64{this, "HGTD_cluster_merged", m_trackParticleContainerKey, "HGTD_cluster_merged", "deco with a handle for a merged cluster"};

◆ m_layerClusterRawTimeKey

SG::ReadDecorHandleKey<xAOD::TrackParticleContainer> HGTD::TimeCompatibilityCheckAlg::m_layerClusterRawTimeKey {this, "HGTD_cluster_raw_time", m_trackParticleContainerKey, "HGTD_cluster_raw_time", "deco with a handle for layer cluster raw time"}
private

Definition at line 60 of file TimeCompatibilityCheckAlg.h.

60{this, "HGTD_cluster_raw_time", m_trackParticleContainerKey, "HGTD_cluster_raw_time", "deco with a handle for layer cluster raw time"};

◆ m_layerClusterShadowedKey

SG::ReadDecorHandleKey<xAOD::TrackParticleContainer> HGTD::TimeCompatibilityCheckAlg::m_layerClusterShadowedKey {this, "HGTD_cluster_shadowed", m_trackParticleContainerKey, "HGTD_cluster_shadowed", "deco with a handle for a shadowed cluster"}
private

Definition at line 63 of file TimeCompatibilityCheckAlg.h.

63{this, "HGTD_cluster_shadowed", m_trackParticleContainerKey, "HGTD_cluster_shadowed", "deco with a handle for a shadowed cluster"};

◆ m_layerClusterTimeKey

SG::ReadDecorHandleKey<xAOD::TrackParticleContainer> HGTD::TimeCompatibilityCheckAlg::m_layerClusterTimeKey {this, "HGTD_cluster_time", m_trackParticleContainerKey, "HGTD_cluster_time", "deco with a handle for cluster time"}
private

Definition at line 61 of file TimeCompatibilityCheckAlg.h.

61{this, "HGTD_cluster_time", m_trackParticleContainerKey, "HGTD_cluster_time", "deco with a handle for cluster time"};

◆ m_layerClusterTruthClassKey

SG::ReadDecorHandleKey<xAOD::TrackParticleContainer> HGTD::TimeCompatibilityCheckAlg::m_layerClusterTruthClassKey {this, "HGTD_cluster_truth_class", m_trackParticleContainerKey, "HGTD_cluster_truth_class", "deco with a handle for a truth time"}
private

Definition at line 62 of file TimeCompatibilityCheckAlg.h.

62{this, "HGTD_cluster_truth_class", m_trackParticleContainerKey, "HGTD_cluster_truth_class", "deco with a handle for a truth time"};

◆ m_layerExtensionChi2Key

SG::ReadDecorHandleKey<xAOD::TrackParticleContainer> HGTD::TimeCompatibilityCheckAlg::m_layerExtensionChi2Key {this, "HGTD_extension_chi2", m_trackParticleContainerKey, "HGTD_extension_chi2", "deco with a handle for a ch2 of extension"}
private

Definition at line 59 of file TimeCompatibilityCheckAlg.h.

59{this, "HGTD_extension_chi2", m_trackParticleContainerKey, "HGTD_extension_chi2", "deco with a handle for a ch2 of extension"};

◆ m_layerHasExtensionKey

SG::ReadDecorHandleKey<xAOD::TrackParticleContainer> HGTD::TimeCompatibilityCheckAlg::m_layerHasExtensionKey {this, "HGTD_has_extension", m_trackParticleContainerKey, "HGTD_has_extension", "deco with a handle for an extension"}
private

Definition at line 58 of file TimeCompatibilityCheckAlg.h.

58{this, "HGTD_has_extension", m_trackParticleContainerKey, "HGTD_has_extension", "deco with a handle for an extension"};

◆ m_layerPrimaryExpectedKey

SG::ReadDecorHandleKey<xAOD::TrackParticleContainer> HGTD::TimeCompatibilityCheckAlg::m_layerPrimaryExpectedKey {this, "HGTD_primary_expected", m_trackParticleContainerKey, "HGTD_primary_expected", "deco with a handle for an expected primary"}
private

Definition at line 65 of file TimeCompatibilityCheckAlg.h.

65{this, "HGTD_primary_expected", m_trackParticleContainerKey, "HGTD_primary_expected", "deco with a handle for an expected primary"};

◆ m_trackParticleContainerKey

SG::ReadHandleKey<xAOD::TrackParticleContainer> HGTD::TimeCompatibilityCheckAlg::m_trackParticleContainerKey {this, "TrackParticleContainerName", "InDetTrackParticles", "Name of the TrackParticle container"}
private

Definition at line 57 of file TimeCompatibilityCheckAlg.h.

57{this, "TrackParticleContainerName", "InDetTrackParticles", "Name of the TrackParticle container"};

◆ 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.


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