ATLAS Offline Software
Loading...
Searching...
No Matches
egammaSelectedTrackCopy Class Reference

Algorithm which selects tracks to be GSF refitted later on. More...

#include <egammaSelectedTrackCopy.h>

Inheritance diagram for egammaSelectedTrackCopy:
Collaboration diagram for egammaSelectedTrackCopy:

Public Member Functions

 egammaSelectedTrackCopy (const std::string &name, ISvcLocator *pSvcLocator)
 Default constructor.
virtual StatusCode initialize () override final
virtual StatusCode finalize () 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 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

bool selectTrack (const EventContext &ctx, const xAOD::CaloCluster *cluster, const xAOD::TrackParticle *track, bool trkTRT, const CaloDetDescrManager &caloDD) const
 Broad track selection.
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

ToolHandle< IEMExtrapolationToolsm_extrapolationTool
 Tool for extrapolation.
ToolHandle< IegammaCaloClusterSelectorm_egammaCaloClusterSelector
 Tool to filter the calo clusters.
SG::ReadHandleKey< xAOD::CaloClusterContainerm_clusterContainerKey
 Names of input output collections.
SG::ReadHandleKey< xAOD::CaloClusterContainerm_fwdClusterContainerKey
 Names of forward input output collections.
SG::ReadHandleKey< xAOD::TrackParticleContainerm_trackParticleContainerKey
SG::ReadDecorHandleKey< xAOD::TrackParticleContainerm_trackParticleTimeDecorKey
SG::ReadCondHandleKey< CaloDetDescrManagerm_caloDetDescrMgrKey
SG::WriteHandleKey< ConstDataVector< xAOD::TrackParticleContainer > > m_OutputTrkPartContainerKey
Gaudi::Property< double > m_broadDeltaEta
 Broad windows.
Gaudi::Property< double > m_broadDeltaPhi
Gaudi::Property< double > m_narrowDeltaEta
 Narrow windows.
Gaudi::Property< double > m_narrowDeltaPhi
Gaudi::Property< double > m_narrowDeltaPhiBrem
Gaudi::Property< double > m_narrowRescale
Gaudi::Property< double > m_narrowRescaleBrem
Gaudi::Property< bool > m_doForwardTracks
 Private member flag to select forward tracks.
Gaudi::Accumulators::Counter m_AllClusters {}
Gaudi::Accumulators::Counter m_AllFwdClusters {}
Gaudi::Accumulators::Counter m_SelectedClusters {}
Gaudi::Accumulators::Counter m_AllTracks {}
Gaudi::Accumulators::Counter m_SelectedTracks {}
Gaudi::Accumulators::Counter m_SelectedFwdTracks {}
Gaudi::Accumulators::Counter m_AllSiTracks {}
Gaudi::Accumulators::Counter m_SelectedSiTracks {}
Gaudi::Accumulators::Counter m_AllTRTTracks {}
Gaudi::Accumulators::Counter m_SelectedTRTTracks {}
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

Algorithm which selects tracks to be GSF refitted later on.

The algorithm select tracks that are matched to cluster using eta and phi. Si-track/cluster pairs with Et (computed with eta from the track) less than 10 MeV are not considered. Non-Si-track/cluster pair with Et (from the cluster) less than 10 MeV are not considered.

The eta/phi matching is done in two steps. In the first step a broad matching is done. Then a narrower match is done using extrapolated tracks to the second layer. For TRT tracks only broad phi-matching is tried.

The heavy work is done directly inside the algorithm, without the usage of any particular external tool (see selectTrack private method).

Definition at line 53 of file egammaSelectedTrackCopy.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

◆ egammaSelectedTrackCopy()

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

Default constructor.

Definition at line 46 of file egammaSelectedTrackCopy.cxx.

48 : AthReentrantAlgorithm(name, pSvcLocator)
49{}

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}

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

Definition at line 91 of file egammaSelectedTrackCopy.cxx.

92{
93 SG::ReadHandle<xAOD::CaloClusterContainer> clusterTES(m_clusterContainerKey, ctx);
94 ATH_CHECK(clusterTES.isValid());
95
96 SG::ReadHandle<xAOD::TrackParticleContainer> trackTES(m_trackParticleContainerKey, ctx);
97 ATH_CHECK(trackTES.isValid());
98
99 SG::WriteHandle<ConstDataVector<xAOD::TrackParticleContainer>> outputTrkPartContainer(
101 ctx
102 );
103
104 SG::ReadHandle<xAOD::CaloClusterContainer> fwdClusterTES;
105 SG::WriteHandle<ConstDataVector<xAOD::TrackParticleContainer>> outputFwdTrkPartContainer;
106 if (m_doForwardTracks) {
107 fwdClusterTES = SG::ReadHandle<xAOD::CaloClusterContainer>(
109 ctx
110 );
111
112 ATH_CHECK(fwdClusterTES.isValid());
113 m_AllFwdClusters += fwdClusterTES->size();
114 }
115
116 // Here it just needs to be a view copy , i.e the collection of selected
117 // trackParticles we create does not really own its elements.
118 auto viewCopy = std::make_unique<ConstDataVector<xAOD::TrackParticleContainer>>(SG::VIEW_ELEMENTS);
119 // Local counters.
120 auto selectedTracks = m_SelectedTracks.buffer();
121 auto selectedFwdTracks = m_SelectedFwdTracks.buffer();
122 auto allSiTracks = m_AllSiTracks.buffer();
123 auto selectedSiTracks = m_SelectedSiTracks.buffer();
124 auto allTRTTracks = m_AllTRTTracks.buffer();
125 auto selectedTRTTracks = m_SelectedTRTTracks.buffer();
126
127 SG::ReadCondHandle<CaloDetDescrManager> caloDetDescrMgrHandle{m_caloDetDescrMgrKey, ctx};
128 ATH_CHECK(caloDetDescrMgrHandle.isValid());
129
130 const CaloDetDescrManager* calodetdescrmgr = *caloDetDescrMgrHandle;
131
132 // Check which clusters to seed on.
133 std::vector<const xAOD::CaloCluster*> passingClusters;
134 for (const xAOD::CaloCluster* cluster : *clusterTES) {
135 if (m_egammaCaloClusterSelector->passSelection(cluster, *calodetdescrmgr)) {
136 passingClusters.push_back(cluster);
137 }
138 }
139
140 m_AllTracks += trackTES->size();
141 m_AllClusters += clusterTES->size();
142 m_SelectedClusters += passingClusters.size();
143
144 // Extrapolation cache.
145 for (const xAOD::TrackParticle* track : *trackTES) {
146 bool isNotValidForRefit = !checkIfValidForRefit(track);
147 if (isNotValidForRefit) {
148 ++allTRTTracks;
149 } else {
150 ++allSiTracks;
151 }
152
153 // Check if the track is selected for a central electron
154 // due to a central cluster
155 for (const xAOD::CaloCluster* cluster : passingClusters) {
156 if (selectTrack(ctx, cluster, track, isNotValidForRefit, *calodetdescrmgr)) {
157 viewCopy->push_back(track);
158 ++selectedTracks;
159 if (isNotValidForRefit) {
160 ++selectedTRTTracks;
161 } else {
162 ++selectedSiTracks;
163 }
164 break;
165 }
166 } // Loop on clusters.
167
168 // Check if the track is selected for a forwand electron
169 // due to a forwand cluster
170 if (m_doForwardTracks) {
171 for (const xAOD::CaloCluster* cluster : *fwdClusterTES) {
172 if (selectTrack(ctx, cluster, track, isNotValidForRefit, *calodetdescrmgr)) {
173 viewCopy->push_back(track);
174 ++selectedFwdTracks;
175 break;
176 }
177 } // Loop on fwd cluster
178 }
179 }// Loop on tracks.
180
181 ATH_CHECK(outputTrkPartContainer.record(std::move(viewCopy)));
182
183 return StatusCode::SUCCESS;
184}
#define ATH_CHECK
Evaluate an expression and check for errors.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
Gaudi::Accumulators::Counter m_SelectedSiTracks
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloDetDescrMgrKey
Gaudi::Accumulators::Counter m_SelectedClusters
ToolHandle< IegammaCaloClusterSelector > m_egammaCaloClusterSelector
Tool to filter the calo clusters.
Gaudi::Accumulators::Counter m_AllFwdClusters
Gaudi::Accumulators::Counter m_SelectedFwdTracks
Gaudi::Accumulators::Counter m_AllSiTracks
Gaudi::Accumulators::Counter m_AllTracks
Gaudi::Accumulators::Counter m_AllClusters
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_trackParticleContainerKey
Gaudi::Accumulators::Counter m_SelectedTRTTracks
Gaudi::Property< bool > m_doForwardTracks
Private member flag to select forward tracks.
Gaudi::Accumulators::Counter m_SelectedTracks
SG::WriteHandleKey< ConstDataVector< xAOD::TrackParticleContainer > > m_OutputTrkPartContainerKey
bool selectTrack(const EventContext &ctx, const xAOD::CaloCluster *cluster, const xAOD::TrackParticle *track, bool trkTRT, const CaloDetDescrManager &caloDD) const
Broad track selection.
SG::ReadHandleKey< xAOD::CaloClusterContainer > m_fwdClusterContainerKey
Names of forward input output collections.
Gaudi::Accumulators::Counter m_AllTRTTracks
SG::ReadHandleKey< xAOD::CaloClusterContainer > m_clusterContainerKey
Names of input output collections.
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
TrackParticle_v1 TrackParticle
Reference the current persistent 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 & 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

◆ finalize()

virtual StatusCode egammaSelectedTrackCopy::finalize ( )
finaloverridevirtual

◆ initialize()

StatusCode egammaSelectedTrackCopy::initialize ( )
finaloverridevirtual

Definition at line 52 of file egammaSelectedTrackCopy.cxx.

53{
54 ATH_CHECK(m_clusterContainerKey.initialize());
57 // Needed to declare proper input dependency with scheduler
60
64 ATH_CHECK(m_caloDetDescrMgrKey.initialize());
65
66 return StatusCode::SUCCESS;
67}
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_trackParticleTimeDecorKey
ToolHandle< IEMExtrapolationTools > m_extrapolationTool
Tool for extrapolation.

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

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

◆ selectTrack()

bool egammaSelectedTrackCopy::selectTrack ( const EventContext & ctx,
const xAOD::CaloCluster * cluster,
const xAOD::TrackParticle * track,
bool trkTRT,
const CaloDetDescrManager & caloDD ) const
private

Broad track selection.

Definition at line 187 of file egammaSelectedTrackCopy.cxx.

192{
193
194 if (cluster == nullptr || track == nullptr) {
195 return false;
196 }
197
198 const Trk::Perigee& candidatePerigee = track->perigeeParameters();
199
200 // Get Perigee Parameters.
201 const double trkPhi = candidatePerigee.parameters()[Trk::phi];
202 const double trkEta = candidatePerigee.eta();
203 const double z_perigee = candidatePerigee.position().z();
204 const double r_perigee = candidatePerigee.position().perp();
205 const Amg::Vector3D PerigeeXYZPosition(candidatePerigee.position().x(),
206 candidatePerigee.position().y(),
207 z_perigee);
208
209 // Get Cluster parameters.
210 const double clusterEta = xAOD::EgammaHelpers::isFCAL(cluster) ? cluster->eta() : cluster->etaBE(2);
211 const bool isEndCap = !xAOD::EgammaHelpers::isBarrel(cluster);
212
213 // Use trkEta only if sufficient hits in the Si.
214 const double Et = trkTRT ? cluster->et() : cluster->e() / cosh(trkEta);
215
216 // A few sanity checks.
217 if (std::abs(clusterEta) > 10.0 || std::abs(trkEta) > 10.0 || Et < 10.0) {
219 "FAILS sanity checks : Track Eta : " << trkEta <<
220 ", Cluster Eta " << clusterEta
221 );
222
223 return false;
224 }
225
226 // Calculate the eta/phi of the cluster as would be seen from the perigee
227 // position of the Track.
228 const Amg::Vector3D XYZClusterWrtTrackPerigee = CandidateMatchHelpers::approxXYZwrtPoint(
229 *cluster,
230 PerigeeXYZPosition,
231 isEndCap
232 );
233
234 // Calculate the possible rotation of the track.
235 // Once assuming the cluster Et being the better estimate (e.g big brem).
236 const double phiRotRescaled = CandidateMatchHelpers::PhiROT(
237 Et,
238 trkEta,
239 track->charge(),
240 r_perigee,
241 isEndCap
242 );
243
244 // And also assuming the track Pt being correct.
245 const double phiRotTrack = CandidateMatchHelpers::PhiROT(
246 track->pt(),
247 trkEta,
248 track->charge(),
249 r_perigee,
250 isEndCap
251 );
252
253 const double clusterPhiCorrected = XYZClusterWrtTrackPerigee.phi();
254
255 // DeltaPhi between the track and the cluster.
256 const double deltaPhiStd = P4Helpers::deltaPhi(clusterPhiCorrected, trkPhi);
257
258 // DeltaPhi between the track and the cluster accounting for rotation assuming
259 // cluster Et is a better estimator.
260 const double trkPhiRescaled = P4Helpers::deltaPhi(trkPhi, phiRotRescaled);
261 const double deltaPhiRescaled = P4Helpers::deltaPhi(clusterPhiCorrected, trkPhiRescaled);
262
263 // DeltaPhi between the track and the cluster accounting for rotation.
264 const double trkPhiCorrTrack = P4Helpers::deltaPhi(trkPhi, phiRotTrack);
265 const double deltaPhiTrack = P4Helpers::deltaPhi(clusterPhiCorrected, trkPhiCorrTrack);
266
267 // First we will see if it fails the quick match.
268 // Then if it passed it will get 2 chances to be selected.
269 // One if it matches from last measurement.
270 // The second if it matched from Perigee rescales.
271 // Broad phi check.
272 if (
273 (std::abs(deltaPhiRescaled) > m_broadDeltaPhi) &&
274 (std::abs(deltaPhiTrack) > m_broadDeltaPhi) &&
275 (std::abs(deltaPhiStd) > m_broadDeltaPhi)
276 ) {
278 "FAILS broad window phi match (track phi, phirotCluster , phiRotTrack , " <<
279 "cluster phi corrected, cluster phi): ( " <<
280 trkPhi << ", " <<
281 phiRotRescaled << ", " <<
282 phiRotTrack << ", " <<
283 clusterPhiCorrected << ", " <<
284 cluster->phi() << ")"
285 );
286
287 return false;
288 }
289
290 // if TRT we can stop here , we can not check much in eta really.
291 if (trkTRT) { return true; }
292
293 const double clusterEtaCorrected = XYZClusterWrtTrackPerigee.eta();
294
295 // Broad eta check.
296 if (
297 std::abs(cluster->eta() - trkEta) > m_broadDeltaEta &&
298 std::abs(clusterEtaCorrected - trkEta) > m_broadDeltaEta
299 ) {
301 "FAILS broad window eta match (track eta, cluster eta, cluster eta corrected): ( " <<
302 trkEta << ", " <<
303 cluster->etaBE(2) << ", " <<
304 clusterEtaCorrected << " )"
305 );
306
307 return false;
308 }
309
310 std::pair<
311 std::vector<CaloSampling::CaloSample>,
312 std::vector<std::unique_ptr<Trk::Surface>>
313 > layersAndSurfaces = m_extrapolationTool->getClusterLayerSurfaces(*cluster, caloDD);
314
315 // Extrapolate from last measurement to the four EM layers.
316 // Since this is before brem fit last measurement is OK.
317 std::array<double, 4> eta = { -999.0, -999.0, -999.0, -999.0 };
318 std::array<double, 4> phi = { -999.0, -999.0, -999.0, -999.0 };
319 std::array<double, 4> deltaEta = { -999.0, -999.0, -999.0, -999.0 };
320 std::array<double, 4> deltaPhi = { -999.0, -999.0, -999.0, -999.0 };
321 if (m_extrapolationTool ->getMatchAtCalo(
322 ctx,
323 *cluster,
324 *track,
325 layersAndSurfaces.first,
326 layersAndSurfaces.second,
327 eta,
328 phi,
329 deltaEta,
330 deltaPhi,
332 ).isFailure()) {
333 return false;
334 }
335
336 // Selection in narrow eta/phi window from last measurement.
337 if (
338 std::abs(deltaEta[2]) < m_narrowDeltaEta &&
341 ) {
342 ATH_MSG_DEBUG("Match from Last measurement is successful : " << deltaPhi[2]);
343 return true;
344 }
345
346 // Cases where:
347 // - It passes deltaEta[2] from last measurement (rescaling should not affect the eta side).
348 // - and we have a cluster with higher Et.
349 // Rescale up the track to account for radiative loses and retry.
350 if (
351 std::abs(deltaEta[2]) < m_narrowDeltaEta &&
352 cluster->et() > track->pt()
353 ) {
354 // Extrapolate from Perigee Rescaled.
355 std::array<double, 4> etaRes = { -999.0, -999.0, -999.0, -999.0 };
356 std::array<double, 4> phiRes = { -999.0, -999.0, -999.0, -999.0 };
357 std::array<double, 4> deltaEtaRes = { -999.0, -999.0, -999.0, -999.0 };
358 std::array<double, 4> deltaPhiRes = { -999.0, -999.0, -999.0, -999.0 };
359
360 if (m_extrapolationTool->getMatchAtCalo(
361 ctx,
362 *cluster,
363 *track,
364 layersAndSurfaces.first,
365 layersAndSurfaces.second,
366 etaRes,
367 phiRes,
368 deltaEtaRes,
369 deltaPhiRes,
371 ).isFailure()) {
372 return false;
373 }
374
375 // Redo the check with rescale.
376 if (
377 std::abs(deltaEtaRes[2]) < m_narrowDeltaEta &&
378 deltaPhiRes[2] < m_narrowRescale &&
379 deltaPhiRes[2] > -m_narrowRescaleBrem
380 ) {
381 ATH_MSG_DEBUG("Rescale Match success " << deltaPhiRes[2]);
382 return true;
383 }
384 }
385
386 // Default is fail.
387 return false;
388}
Scalar eta() const
pseudorapidity method
Scalar deltaPhi(const MatrixBase< Derived > &vec) const
Scalar phi() const
phi method
#define ATH_MSG_DEBUG(x)
@ fromLastMeasurement
from the last measurement of TrackParticle
@ fromPerigeeRescaled
from the perigee of TrackParticle recaled by Ecluster
double eta() const
Access method for pseudorapidity - from momentum.
const Amg::Vector3D & position() const
Access method for the position.
Gaudi::Property< double > m_narrowDeltaPhiBrem
Gaudi::Property< double > m_narrowDeltaPhi
Gaudi::Property< double > m_broadDeltaEta
Broad windows.
Gaudi::Property< double > m_narrowRescale
Gaudi::Property< double > m_broadDeltaPhi
Gaudi::Property< double > m_narrowRescaleBrem
Gaudi::Property< double > m_narrowDeltaEta
Narrow windows.
virtual double eta() const
The pseudorapidity ( ) of the particle.
virtual double e() const
The total energy of the particle.
virtual double phi() const
The azimuthal angle ( ) of the particle.
float etaBE(const unsigned layer) const
Get the eta in one layer of the EM Calo.
Eigen::Matrix< double, 3, 1 > Vector3D
double PhiROT(const double pt, const double eta, const int charge, const double r_start, const bool isEndCap)
Function to calculate the approximate rotation in phi/bending of a track until it reaches the calo.
Amg::Vector3D approxXYZwrtPoint(const xAOD::CaloCluster &cluster, const Amg::Vector3D &point, const bool isEndCap)
Function to get the (x,y,z) of the cluster wrt to a point (x0,y0,z0)
double deltaEta(const I4Momentum &p1, const I4Momentum &p2)
Computes efficiently .
Definition P4Helpers.h:66
double deltaPhi(double phiA, double phiB)
delta Phi in range [-pi,pi[
Definition P4Helpers.h:34
ParametersT< TrackParametersDim, Charged, PerigeeSurface > Perigee
@ phi
Definition ParamDefs.h:75
@ deltaPhiRescaled
difference between the cluster phi (sampling 2) and the phi of the track extrapolated from the perige...
bool isBarrel(const xAOD::Egamma *eg)
return true if the cluster is in the barrel
bool isFCAL(const xAOD::CaloCluster *cluster)
return true if the cluster (or the majority of its energy) is in the FCAL0

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

Member Data Documentation

◆ m_AllClusters

Gaudi::Accumulators::Counter egammaSelectedTrackCopy::m_AllClusters {}
mutableprivate

Definition at line 189 of file egammaSelectedTrackCopy.h.

189{};

◆ m_AllFwdClusters

Gaudi::Accumulators::Counter egammaSelectedTrackCopy::m_AllFwdClusters {}
mutableprivate

Definition at line 190 of file egammaSelectedTrackCopy.h.

190{};

◆ m_AllSiTracks

Gaudi::Accumulators::Counter egammaSelectedTrackCopy::m_AllSiTracks {}
mutableprivate

Definition at line 195 of file egammaSelectedTrackCopy.h.

195{};

◆ m_AllTracks

Gaudi::Accumulators::Counter egammaSelectedTrackCopy::m_AllTracks {}
mutableprivate

Definition at line 192 of file egammaSelectedTrackCopy.h.

192{};

◆ m_AllTRTTracks

Gaudi::Accumulators::Counter egammaSelectedTrackCopy::m_AllTRTTracks {}
mutableprivate

Definition at line 197 of file egammaSelectedTrackCopy.h.

197{};

◆ m_broadDeltaEta

Gaudi::Property<double> egammaSelectedTrackCopy::m_broadDeltaEta
private
Initial value:
{
this,
"broadDeltaEta",
0.2,
"Value of broad cut for delta eta"
}

Broad windows.

Definition at line 131 of file egammaSelectedTrackCopy.h.

131 {
132 this,
133 "broadDeltaEta",
134 0.2,
135 "Value of broad cut for delta eta"
136 };

◆ m_broadDeltaPhi

Gaudi::Property<double> egammaSelectedTrackCopy::m_broadDeltaPhi
private
Initial value:
{
this,
"broadDeltaPhi",
0.3,
"Value of broad cut for delta phi"
}

Definition at line 138 of file egammaSelectedTrackCopy.h.

138 {
139 this,
140 "broadDeltaPhi",
141 0.3,
142 "Value of broad cut for delta phi"
143 };

◆ m_caloDetDescrMgrKey

SG::ReadCondHandleKey<CaloDetDescrManager> egammaSelectedTrackCopy::m_caloDetDescrMgrKey
private
Initial value:
{
this,
"CaloDetDescrManager",
"CaloDetDescrManager",
"SG Key for CaloDetDescrManager in the Condition Store"
}

Definition at line 116 of file egammaSelectedTrackCopy.h.

116 {
117 this,
118 "CaloDetDescrManager",
119 "CaloDetDescrManager",
120 "SG Key for CaloDetDescrManager in the Condition Store"
121 };

◆ m_clusterContainerKey

SG::ReadHandleKey<xAOD::CaloClusterContainer> egammaSelectedTrackCopy::m_clusterContainerKey
private
Initial value:
{
this,
"ClusterContainerName",
"egammaTopoCluster",
"Input calo cluster for seeding"
}

Names of input output collections.

Definition at line 88 of file egammaSelectedTrackCopy.h.

88 {
89 this,
90 "ClusterContainerName",
91 "egammaTopoCluster",
92 "Input calo cluster for seeding"
93 };

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

Gaudi::Property<bool> egammaSelectedTrackCopy::m_doForwardTracks
private
Initial value:
{
this,
"doFwdTracks",
false,
"Boolean to select tracks in the forward region"
}

Private member flag to select forward tracks.

Definition at line 182 of file egammaSelectedTrackCopy.h.

182 {
183 this,
184 "doFwdTracks",
185 false,
186 "Boolean to select tracks in the forward region"
187 };

◆ m_egammaCaloClusterSelector

ToolHandle<IegammaCaloClusterSelector> egammaSelectedTrackCopy::m_egammaCaloClusterSelector
private
Initial value:
{
this,
"egammaCaloClusterSelector",
"egammaCaloClusterSelector",
"Tool that makes the cluster selection"
}

Tool to filter the calo clusters.

Definition at line 80 of file egammaSelectedTrackCopy.h.

80 {
81 this,
82 "egammaCaloClusterSelector",
83 "egammaCaloClusterSelector",
84 "Tool that makes the cluster selection"
85 };

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

ToolHandle<IEMExtrapolationTools> egammaSelectedTrackCopy::m_extrapolationTool
private
Initial value:
{
this,
"ExtrapolationTool",
"EMExtrapolationTools",
"Extrapolation tool"
}

Tool for extrapolation.

Definition at line 72 of file egammaSelectedTrackCopy.h.

72 {
73 this,
74 "ExtrapolationTool",
75 "EMExtrapolationTools",
76 "Extrapolation tool"
77 };

◆ m_fwdClusterContainerKey

SG::ReadHandleKey<xAOD::CaloClusterContainer> egammaSelectedTrackCopy::m_fwdClusterContainerKey
private
Initial value:
{
this,
"FwdClusterContainerName",
"",
"Input calo cluster for seeding"
}

Names of forward input output collections.

Definition at line 96 of file egammaSelectedTrackCopy.h.

96 {
97 this,
98 "FwdClusterContainerName",
99 "",
100 "Input calo cluster for seeding"
101 };

◆ m_narrowDeltaEta

Gaudi::Property<double> egammaSelectedTrackCopy::m_narrowDeltaEta
private
Initial value:
{
this,
"narrowDeltaEta",
0.05,
"Value of narrow cut for delta eta"
}

Narrow windows.

Definition at line 146 of file egammaSelectedTrackCopy.h.

146 {
147 this,
148 "narrowDeltaEta",
149 0.05,
150 "Value of narrow cut for delta eta"
151 };

◆ m_narrowDeltaPhi

Gaudi::Property<double> egammaSelectedTrackCopy::m_narrowDeltaPhi
private
Initial value:
{
this,
"narrowDeltaPhi",
0.05,
"Value of narrow cut for delta phi"
}

Definition at line 153 of file egammaSelectedTrackCopy.h.

153 {
154 this,
155 "narrowDeltaPhi",
156 0.05,
157 "Value of narrow cut for delta phi"
158 };

◆ m_narrowDeltaPhiBrem

Gaudi::Property<double> egammaSelectedTrackCopy::m_narrowDeltaPhiBrem
private
Initial value:
{
this,
"narrowDeltaPhiBrem",
0.2,
"Value of the narrow cut for delta phi in the brem direction"
}

Definition at line 160 of file egammaSelectedTrackCopy.h.

160 {
161 this,
162 "narrowDeltaPhiBrem",
163 0.2,
164 "Value of the narrow cut for delta phi in the brem direction"
165 };

◆ m_narrowRescale

Gaudi::Property<double> egammaSelectedTrackCopy::m_narrowRescale
private
Initial value:
{
this,
"narrowDeltaPhiRescale",
0.05,
"Value of the narrow cut for delta phi Rescale"
}

Definition at line 167 of file egammaSelectedTrackCopy.h.

167 {
168 this,
169 "narrowDeltaPhiRescale",
170 0.05,
171 "Value of the narrow cut for delta phi Rescale"
172 };

◆ m_narrowRescaleBrem

Gaudi::Property<double> egammaSelectedTrackCopy::m_narrowRescaleBrem
private
Initial value:
{
this,
"narrowDeltaPhiRescaleBrem",
0.1,
"Value of the narrow cut for delta phi Rescale Brem"
}

Definition at line 174 of file egammaSelectedTrackCopy.h.

174 {
175 this,
176 "narrowDeltaPhiRescaleBrem",
177 0.1,
178 "Value of the narrow cut for delta phi Rescale Brem"
179 };

◆ m_OutputTrkPartContainerKey

SG::WriteHandleKey<ConstDataVector<xAOD::TrackParticleContainer> > egammaSelectedTrackCopy::m_OutputTrkPartContainerKey
private
Initial value:
{
this,
"OutputTrkPartContainerName",
"egammaSelectedTrackParticles",
"Output selected TrackParticles"
}

Definition at line 123 of file egammaSelectedTrackCopy.h.

123 {
124 this,
125 "OutputTrkPartContainerName",
126 "egammaSelectedTrackParticles",
127 "Output selected TrackParticles"
128 };

◆ m_SelectedClusters

Gaudi::Accumulators::Counter egammaSelectedTrackCopy::m_SelectedClusters {}
mutableprivate

Definition at line 191 of file egammaSelectedTrackCopy.h.

191{};

◆ m_SelectedFwdTracks

Gaudi::Accumulators::Counter egammaSelectedTrackCopy::m_SelectedFwdTracks {}
mutableprivate

Definition at line 194 of file egammaSelectedTrackCopy.h.

194{};

◆ m_SelectedSiTracks

Gaudi::Accumulators::Counter egammaSelectedTrackCopy::m_SelectedSiTracks {}
mutableprivate

Definition at line 196 of file egammaSelectedTrackCopy.h.

196{};

◆ m_SelectedTracks

Gaudi::Accumulators::Counter egammaSelectedTrackCopy::m_SelectedTracks {}
mutableprivate

Definition at line 193 of file egammaSelectedTrackCopy.h.

193{};

◆ m_SelectedTRTTracks

Gaudi::Accumulators::Counter egammaSelectedTrackCopy::m_SelectedTRTTracks {}
mutableprivate

Definition at line 198 of file egammaSelectedTrackCopy.h.

198{};

◆ m_trackParticleContainerKey

SG::ReadHandleKey<xAOD::TrackParticleContainer> egammaSelectedTrackCopy::m_trackParticleContainerKey
private
Initial value:
{
this,
"TrackParticleContainerName",
"InDetTrackParticles",
"Input TrackParticles to select from"
}

Definition at line 103 of file egammaSelectedTrackCopy.h.

103 {
104 this,
105 "TrackParticleContainerName",
106 "InDetTrackParticles",
107 "Input TrackParticles to select from"
108 };

◆ m_trackParticleTimeDecorKey

SG::ReadDecorHandleKey<xAOD::TrackParticleContainer> egammaSelectedTrackCopy::m_trackParticleTimeDecorKey
private
Initial value:
{
this,
"TrackParticleTimeDecoration",
"",
"Time assigned to this track"}

Definition at line 110 of file egammaSelectedTrackCopy.h.

110 {
111 this,
112 "TrackParticleTimeDecoration",
113 "",
114 "Time assigned to this track"};

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