ATLAS Offline Software
Loading...
Searching...
No Matches
InDet::SiSPSeededTrackFinderRoI Class Reference

#include <SiSPSeededTrackFinderRoI.h>

Inheritance diagram for InDet::SiSPSeededTrackFinderRoI:
Collaboration diagram for InDet::SiSPSeededTrackFinderRoI:

Classes

class  Counter_t
 For counters. More...

Public Member Functions

 SiSPSeededTrackFinderRoI (const std::string &name, ISvcLocator *pSvcLocator)
virtual ~SiSPSeededTrackFinderRoI ()=default
virtual StatusCode initialize () override
virtual StatusCode execute (const EventContext &ctx) const override
virtual StatusCode finalize () override
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 Types

enum  ECounter { kNSeeds , kNTracks , kNCounter }
 enums for Counter_t More...

Protected Member Functions

void filterSharedTracks (std::multimap< double, Trk::Track * > &) const
 cleans up the collection of quality filtered tracks.
void magneticFieldInit ()
bool passEtaDepCuts (const Trk::Track *track, int nClusters, int nFreeClusters, int nPixels) const
 apply eta-dependent selections
MsgStream & dump (MSG::Level lvl, const SiSPSeededTrackFinderRoI::Counter_t *) const
MsgStream & dumptools (MsgStream &out) const
MsgStream & dumpevent (MsgStream &out, const SiSPSeededTrackFinderRoI::Counter_t &counter) const
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.

Protected Attributes

BooleanProperty m_useRoIWidth {this, "useRoIWidth", true, "Use width of RoI along z-axis"}
IntegerProperty m_maxNumberSeeds {this, "maxNumberSeeds", 3000000, "Max. number used seeds"}
IntegerProperty m_nfreeCut {this, "FreeClustersCut", 1, "Min number free clusters"}
BooleanProperty m_doRandomSpot {this, "doRandomSpot", false, "Low-pT tracking setting the RoI in a random position"}
StringProperty m_fieldmode {this, "MagneticFieldMode", "MapSolenoid"}
SG::WriteHandleKey< TrackCollectionm_outputTracksKey {this, "TracksLocation", "SiSPSeededTracksRoI", "Output track collection"}
SG::WriteHandleKey< xAOD::VertexContainerm_vxOutputKey {this, "VxOutputName", "LowPtRoIVertices", "Output Vertex collection with per-event RoI information"}
SG::ReadHandleKey< Trk::PRDtoTrackMapm_prdToTrackMap {this,"PRDtoTrackMap",""}
SG::ReadCondHandleKey< InDet::BeamSpotDatam_beamSpotKey {this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot"}
SG::ReadHandleKey< xAOD::EventInfom_evtKey {this, "EventInfoKey", "EventInfo"}
ToolHandle< ISiSpacePointsSeedMakerm_seedsmaker {this, "SeedsTool", "InDet::SiSpacePointsSeedMaker_ATLxk/InDetSpSeedsMaker", "Space poins seed maker"}
ToolHandle< ISiTrackMakerm_trackmaker {this, "TrackTool", "InDet::SiTrackMaker_xk/InDetSiTrackMaker", "Track maker"}
ToolHandle< Trk::IExtendedTrackSummaryToolm_trackSummaryTool {this, "TrackSummaryTool", "InDetTrackSummaryToolNoHoleSearch"}
ToolHandle< IZWindowRoISeedToolm_ZWindowRoISeedTool {this, "ZWindowRoISeedTool", "InDet::ZWindowRoISeedTool", "Tool to determin per-event RoI"}
ToolHandle< IZWindowRoISeedToolm_RandomRoISeedTool {this, "RandomRoISeedTool", "InDet::RandomRoISeedTool", "Tool to run using additional RoIs randomly chosen away from the main one if doRandomSpot is set"}
ServiceHandle< IInDetEtaDependentCutsSvcm_etaDependentCutsSvc {this, "EtaDependentCutsSvc", "", "if enable, further require eta-dependent selections on track candidates"}
Trk::MagneticFieldProperties m_fieldprop
Counter_t m_counterTotal ATLAS_THREAD_SAFE {}
std::atomic_int m_neventsTotal {0}
 Number events.
std::atomic_int m_problemsTotal {0}
 Number events with number seeds > maxNumber.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

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 41 of file SiSPSeededTrackFinderRoI.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Member Enumeration Documentation

◆ ECounter

Constructor & Destructor Documentation

◆ SiSPSeededTrackFinderRoI()

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

Definition at line 67 of file SiSPSeededTrackFinderRoI.cxx.

68 : AthReentrantAlgorithm(name, pSvcLocator)
69{
70}

◆ ~SiSPSeededTrackFinderRoI()

virtual InDet::SiSPSeededTrackFinderRoI::~SiSPSeededTrackFinderRoI ( )
virtualdefault

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.

◆ dump()

MsgStream & InDet::SiSPSeededTrackFinderRoI::dump ( MSG::Level lvl,
const SiSPSeededTrackFinderRoI::Counter_t * counter ) const
protected

Definition at line 328 of file SiSPSeededTrackFinderRoI.cxx.

329{
330 msg(assign_level) <<std::endl;
331 MsgStream& out_msg=msg();
332 if (counter) dumpevent(out_msg ,*counter);
333 else dumptools(out_msg);
334 out_msg << endmsg;
335 return out_msg;
336}
#define endmsg
MsgStream & dumpevent(MsgStream &out, const SiSPSeededTrackFinderRoI::Counter_t &counter) const
MsgStream & dumptools(MsgStream &out) const

◆ dumpevent()

MsgStream & InDet::SiSPSeededTrackFinderRoI::dumpevent ( MsgStream & out,
const SiSPSeededTrackFinderRoI::Counter_t & counter ) const
protected

Definition at line 371 of file SiSPSeededTrackFinderRoI.cxx.

372{
373 int ns = counter[kNSeeds];
374 int nt = counter[kNTracks];
375
376 out<<"|-------------------------------------------------------------------|" <<std::endl;
377 out<<"| Investigated "
378 <<std::setw(9)<<ns<<" space points seeds and found ";
379 out<<std::setw(9)<<nt<<" tracks using RoI-z strategy |"<<std::endl;
380
381 out<<"|-------------------------------------------------------------------|" <<std::endl;
382 if(m_problemsTotal > 0) {
383 out<<"| Events "
384 <<std::setw(7)<<m_neventsTotal <<" |"
385 <<std::endl;
386 out<<"| Problems "
387 <<std::setw(7)<<m_problemsTotal <<" |"
388 <<std::endl;
389 out<<"|-------------------------------------------------------------------|" <<std::endl;
390 }
391 return out;
392}
std::atomic_int m_neventsTotal
Number events.
std::atomic_int m_problemsTotal
Number events with number seeds > maxNumber.

◆ dumptools()

MsgStream & InDet::SiSPSeededTrackFinderRoI::dumptools ( MsgStream & out) const
protected

Definition at line 342 of file SiSPSeededTrackFinderRoI.cxx.

343{
344 int n;
345 n = 65-m_seedsmaker.type().size();
346 std::string s2; for(int i=0; i<n; ++i) s2.append(" "); s2.append("|");
347 n = 65-m_trackmaker.type().size();
348 std::string s3; for(int i=0; i<n; ++i) s3.append(" "); s3.append("|");
349 n = 65-m_outputTracksKey.key().size();
350 std::string s4; for(int i=0; i<n; ++i) s4.append(" "); s4.append("|");
351
352 out<<"|----------------------------------------------------------------"
353 <<"----------------------------------------------------|"
354 <<std::endl;
355 out<<"| Tool for space points seeds finding | "<<m_seedsmaker.type()<<s2
356 <<std::endl;
357 out<<"| Tool for space points seeded track finding | "<<m_trackmaker.type()<<s3
358 <<std::endl;
359 out<<"| Location of output tracks | "<<m_outputTracksKey.key()<<s4
360 <<std::endl;
361 out<<"|----------------------------------------------------------------"
362 <<"----------------------------------------------------|"
363 <<std::endl;
364 return out;
365}
ToolHandle< ISiSpacePointsSeedMaker > m_seedsmaker
SG::WriteHandleKey< TrackCollection > m_outputTracksKey
ToolHandle< ISiTrackMaker > m_trackmaker

◆ 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 InDet::SiSPSeededTrackFinderRoI::execute ( const EventContext & ctx) const
overridevirtual

Definition at line 129 of file SiSPSeededTrackFinderRoI.cxx.

130{
131 SG::WriteHandle<TrackCollection> outputTracks{m_outputTracksKey, ctx};
132 ATH_CHECK(outputTracks.record(std::make_unique<TrackCollection>()));
133
134 SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle{m_beamSpotKey, ctx};
135 ATH_CHECK( beamSpotHandle.isValid() );
136 Trk::PerigeeSurface beamPosPerigee(beamSpotHandle->beamPos());
137
138 bool PIX = true ;
139 bool SCT = true ;
140 bool ERR = false;
141
142 //Create container for RoI information
143 auto theVertexContainer = std::make_unique<xAOD::VertexContainer>();
144 auto theVertexAuxContainer = std::make_unique<xAOD::VertexAuxContainer>();
145 theVertexContainer->setStore( theVertexAuxContainer.get() );
146
147 // Find reference point of the event and create z boundary region
148 //
149 std::vector<InDet::IZWindowRoISeedTool::ZWindow> listRoIs;
150 listRoIs = m_ZWindowRoISeedTool->getRoIs(ctx);
151 double ZBoundary[2] = {0.0, 0.0};
152 //if no RoI found; no need to go further
153 if ( listRoIs.empty() ) {
154 ATH_MSG_DEBUG("no selectedRoIs" );
155 } else {
156 //listRoIs[0].zReference is the midpoint
157 ZBoundary[0] = listRoIs[0].zWindow[0];
158 ZBoundary[1] = listRoIs[0].zWindow[1];
159 ATH_MSG_DEBUG("selectedRoIs " << ZBoundary[0] <<" " << ZBoundary[1]);
160 }
161
162 //Store RoI information in a xAOD::Vertex object
163 static const SG::AuxElement::Accessor<float> vtxDecor_boundaryLow("boundaryLow");
164 static const SG::AuxElement::Accessor<float> vtxDecor_boundaryHigh("boundaryHigh");
165 static const SG::AuxElement::Accessor<float> vtxDecor_perigeeZ0Lead("perigeeZ0Lead");
166 static const SG::AuxElement::Accessor<float> vtxDecor_perigeeZ0Sublead("perigeeZ0Sublead");
167 static const SG::AuxElement::Accessor<float> vtxDecor_isHS("isHS");
168
169 for( size_t r = 0; r < listRoIs.size(); r++ ){
170
171 theVertexContainer->push_back( new xAOD::Vertex() );
172
173 theVertexContainer->back()->setZ( listRoIs[r].zReference );
174 vtxDecor_boundaryLow(*theVertexContainer->back()) = listRoIs[r].zWindow[0];;
175 vtxDecor_boundaryHigh(*theVertexContainer->back()) = listRoIs[r].zWindow[1];
176 vtxDecor_perigeeZ0Lead(*theVertexContainer->back()) = listRoIs[r].zPerigeePos[0];
177 vtxDecor_perigeeZ0Sublead(*theVertexContainer->back()) = listRoIs[r].zPerigeePos[1];
178 vtxDecor_isHS(*theVertexContainer->back()) = 1;
179 }
180
181 // Analyses that want to run low-pt tracking with a region of interest care
182 // about the beam conditions near a collision of interest. Validation of the
183 // beam conditions elsewhere in the beamspot (regarding low-pt tracks) will be
184 // needed to establish meaningful uncertainties. Choosing a random position
185 // allows for this check. Run with RAWtoESD section of postexec:
186 // ToolSvc.InDetSiSpTrackFinder_LowPtRoI.doRandomSpot = True
187 double RandZBoundary[2];
188 std::vector<InDet::IZWindowRoISeedTool::ZWindow> listRandRoIs;
189 if(m_doRandomSpot and not listRoIs.empty()){
190 //Finding Random Spot in beamspot
191 listRandRoIs = m_RandomRoISeedTool->getRoIs(ctx);
192
193 while( std::abs( listRoIs[0].zReference - listRandRoIs[0].zReference ) < 5. || std::abs(listRandRoIs[0].zReference) > 250.0 ){
194 listRandRoIs.clear();
195 listRandRoIs = m_RandomRoISeedTool->getRoIs(ctx);
196 }
197
198 RandZBoundary[0] = listRandRoIs[0].zWindow[0];
199 RandZBoundary[1] = listRandRoIs[0].zWindow[1];
200 for( size_t r = 0; r < listRandRoIs.size(); r++ ){
201
202 theVertexContainer->push_back( new xAOD::Vertex() );
203
204 theVertexContainer->back()->setZ( listRandRoIs[r].zReference );
205 vtxDecor_boundaryLow(*theVertexContainer->back()) = listRoIs[r].zWindow[0];;
206 vtxDecor_boundaryHigh(*theVertexContainer->back()) = listRoIs[r].zWindow[1];
207 vtxDecor_perigeeZ0Lead(*theVertexContainer->back()) = listRoIs[r].zPerigeePos[0];
208 vtxDecor_perigeeZ0Sublead(*theVertexContainer->back()) = listRoIs[r].zPerigeePos[1];
209 vtxDecor_isHS(*theVertexContainer->back()) = 0;
210 }
211 }
212
213 // Record the RoI information
214 SG::WriteHandle<xAOD::VertexContainer> vxOut_h (m_vxOutputKey, ctx);
215 CHECK( vxOut_h.record ( std::move(theVertexContainer), std::move(theVertexAuxContainer) ) );
216
217 // Find seeds that point within the RoI region in z
218 //
219 SiSpacePointsSeedMakerEventData seedEventData;
220 m_seedsmaker->newEvent(ctx, seedEventData, -1);
221 if (not listRoIs.empty()) {
222 std::list<Trk::Vertex> VZ;
223 if(m_useRoIWidth) m_seedsmaker->find3Sp(ctx, seedEventData, VZ, ZBoundary);
224 //If you want to disable the RoI but still have a separate container for low-pt tracks
225 // The RoI "vertex" container will still be there in case you want to use
226 // that information for whatever reason (ie where the RoI would have been centered).
227 else m_seedsmaker->find3Sp(ctx, seedEventData, VZ);
228 if(m_doRandomSpot) m_seedsmaker->find3Sp(ctx, seedEventData, VZ, RandZBoundary);
229 }
230
231 InDet::ExtendedSiTrackMakerEventData_xk trackEventData(m_prdToTrackMap);
232 m_trackmaker->newEvent(ctx, trackEventData, PIX, SCT);
233
234
235 // Get the value of the seed maker validation ntuple writing switch
236 bool doWriteNtuple = m_seedsmaker->getWriteNtupleBoolProperty();
237 unsigned long EvNumber = 0; //Event number variable to be used for the validation ntuple
238
239 if (doWriteNtuple) {
240 SG::ReadHandle<xAOD::EventInfo> eventInfo(m_evtKey,ctx);
241 EvNumber = !eventInfo.isValid() ? 0 : eventInfo->eventNumber();
242 }
243
244 // Loop through all seed and create track candidates
245 //
246 ERR = false;
248 std::multimap<double,Trk::Track*> qualitySortedTrackCandidates;
249 const InDet::SiSpacePointsSeed* seed = nullptr;
250
251 while((seed = m_seedsmaker->next(ctx, seedEventData))) {
252 ++counter[kNSeeds];
253 const std::list<Trk::Track*> trackList = m_trackmaker->getTracks(ctx, trackEventData, seed->spacePoints());
254 for(Trk::Track* t: trackList) {
255 qualitySortedTrackCandidates.insert(std::make_pair( -trackQuality(t), t ));
256 }
257 if(doWriteNtuple) {
258 // Note: determining if "pixel" or "strips" or "mixed" seed depending on innermost/outermost radii - hardcoded boundaries for Run 1-3 detector
260 if (seed->r3() > 200.) {
261 if (seed->r1() < 200.) {
263 } else {
265 }
266 }
267 m_seedsmaker->writeNtuple(seed, !trackList.empty() ? trackList.front() : nullptr, seedType, EvNumber) ;
268 }
269 if( counter[kNSeeds] >= m_maxNumberSeeds) {
270 ERR = true;
272 break;
273 }
274 }
275
276 m_trackmaker->endEvent(trackEventData);
277
278 // Remove shared tracks with worse quality
279 //
280 filterSharedTracks(qualitySortedTrackCandidates);
281
282 // Save good tracks in track collection
283 //
284 for (const std::pair<const double, Trk::Track*> & qualityAndTrack: qualitySortedTrackCandidates) {
285 ++counter[kNTracks];
286 if (m_trackSummaryTool.isEnabled()) {
287 m_trackSummaryTool->computeAndReplaceTrackSummary(*(qualityAndTrack.second),
288 false /* DO NOT suppress hole search*/);
289 }
290 outputTracks->push_back(qualityAndTrack.second);
291 }
292 m_counterTotal[kNSeeds] += counter[kNSeeds];
294
295 // In case of errors, clear output tracks
296 //
297 if (ERR) {
298 outputTracks->clear();
299 } else {
300 m_counterTotal[kNTracks] += counter[kNTracks];
301 }
302
303 // Print common event information
304 //
305 if (msgLvl(MSG::DEBUG)) {
306 dump(MSG::DEBUG, &counter);
307 }
308
309 return StatusCode::SUCCESS;
310
311}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x)
#define CHECK(...)
Evaluate an expression and check for errors.
@ SCT
Definition RegSelEnums.h:25
bool msgLvl(const MSG::Level lvl) const
ToolHandle< Trk::IExtendedTrackSummaryTool > m_trackSummaryTool
SG::WriteHandleKey< xAOD::VertexContainer > m_vxOutputKey
void filterSharedTracks(std::multimap< double, Trk::Track * > &) const
cleans up the collection of quality filtered tracks.
SG::ReadHandleKey< xAOD::EventInfo > m_evtKey
SG::ReadHandleKey< Trk::PRDtoTrackMap > m_prdToTrackMap
MsgStream & dump(MSG::Level lvl, const SiSPSeededTrackFinderRoI::Counter_t *) const
ToolHandle< IZWindowRoISeedTool > m_RandomRoISeedTool
SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamSpotKey
ToolHandle< IZWindowRoISeedTool > m_ZWindowRoISeedTool
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
int r
Definition globals.cxx:22
Vertex_v1 Vertex
Define the latest version of the vertex class.

◆ 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

◆ filterSharedTracks()

void InDet::SiSPSeededTrackFinderRoI::filterSharedTracks ( std::multimap< double, Trk::Track * > & qualitySortedTracks) const
protected

cleans up the collection of quality filtered tracks.

Candidates which share most of their hits (steered by m_freeCut) with higher quality candidates are erased from the multimap

Parameters
[in,out]scoredTracksTrack candidates, sorted by by score, best scored first (implemented by assigning negative sign to scores)

loop over all track candidates, sorted by quality

loop over measurements on the track candidate

get the PRD from the measurement

increase cluster count

and check if the cluster was already used in a previous ( = higher quality) track

if not, record as a free (not prevously used) cluster

check if the track has the minimum number of free clusters or if it has no shared clusters

if this is fulfilled, we keep the candidate add the free clusters to our cluster set

if this is fulfilled, we keep the candidate

if we do not keep the track, clean up candidate

if we do not keep the track, clean up candidate

Definition at line 398 of file SiSPSeededTrackFinderRoI.cxx.

400{
401 std::set<const Trk::PrepRawData*> clusters;
402
403 std::vector<const Trk::PrepRawData*> freeClusters;
404 freeClusters.reserve(15);
405
406 std::multimap<double, Trk::Track*>::iterator it_qualityAndTrack = qualitySortedTracks.begin();
407
409 while (it_qualityAndTrack!=qualitySortedTracks.end()) {
410 freeClusters.clear();
411
412 std::set<const Trk::PrepRawData*>::iterator it_clustersEnd = clusters.end();
413
414 int nClusters = 0;
415 int nPixels = 0;
416
418 for (const Trk::TrackStateOnSurface* tsos: *((*it_qualityAndTrack).second->trackStateOnSurfaces())) {
420 if(!tsos->type(Trk::TrackStateOnSurface::Measurement)) continue;
421 const Trk::FitQualityOnSurface fq = tsos->fitQualityOnSurface();
422 if(!fq) continue;
423 if(fq.numberDoF() == 2) ++nPixels;
424
425 const Trk::MeasurementBase* mb = tsos->measurementOnTrack();
426 const Trk::RIO_OnTrack* ri = dynamic_cast<const Trk::RIO_OnTrack*>(mb);
427 if(!ri) continue;
428 const Trk::PrepRawData* pr = ri->prepRawData();
429 if (not pr) continue;
431 ++nClusters;
433 if (clusters.find(pr)==it_clustersEnd) {
435 freeClusters.push_back(pr);
436 }
437 }
438
440 int nFreeClusters = static_cast<int>(freeClusters.size());
441 if (nFreeClusters >= m_nfreeCut || nFreeClusters==nClusters) {
444 clusters.insert(freeClusters.begin(), freeClusters.end());
445
446 if (m_etaDependentCutsSvc.name().empty()) {
447 ++it_qualityAndTrack;
448 } else {
449 //eta-dependent cuts
450 int nFreeClusters = static_cast<int>(freeClusters.size());
451 if( passEtaDepCuts( (*it_qualityAndTrack).second, nClusters, nFreeClusters, nPixels) ){
453 ++it_qualityAndTrack;
454 } else {
456 delete (*it_qualityAndTrack).second;
457 qualitySortedTracks.erase(it_qualityAndTrack++);
458 }
459 } //eta-dependent cuts
460 } else {
462 delete (*it_qualityAndTrack).second;
463 qualitySortedTracks.erase(it_qualityAndTrack++);
464 }
465 }
466}
bool passEtaDepCuts(const Trk::Track *track, int nClusters, int nFreeClusters, int nPixels) const
apply eta-dependent selections
ServiceHandle< IInDetEtaDependentCutsSvc > m_etaDependentCutsSvc
int numberDoF() const
returns the number of degrees of freedom of the overall track or vertex fit as integer
Definition FitQuality.h:60
virtual const Trk::PrepRawData * prepRawData() const =0
returns the PrepRawData (also known as RIO) object to which this RIO_OnTrack is associated.
@ Measurement
This is a measurement, and will at least contain a Trk::MeasurementBase.

◆ finalize()

StatusCode InDet::SiSPSeededTrackFinderRoI::finalize ( )
overridevirtual

Definition at line 317 of file SiSPSeededTrackFinderRoI.cxx.

318{
319 dump(MSG::INFO, &m_counterTotal);
320
321 return StatusCode::SUCCESS;
322}

◆ initialize()

StatusCode InDet::SiSPSeededTrackFinderRoI::initialize ( )
overridevirtual

Statistics and Debug

Definition at line 76 of file SiSPSeededTrackFinderRoI.cxx.

77{
78
79 // Initialize read/write handles
80 ATH_CHECK( m_outputTracksKey.initialize() );
81 ATH_CHECK( m_vxOutputKey.initialize() );
82 ATH_CHECK( m_prdToTrackMap.initialize( !m_prdToTrackMap.key().empty() ) );
83 ATH_CHECK( m_beamSpotKey.initialize() );
84 ATH_CHECK(m_evtKey.initialize());
85
86 // Retrieve Tools
87 ATH_CHECK( m_ZWindowRoISeedTool.retrieve() );
88 ATH_CHECK( m_RandomRoISeedTool.retrieve( DisableTool{(not m_doRandomSpot) or m_RandomRoISeedTool.name().empty()} ) );
89 ATH_CHECK( m_seedsmaker.retrieve() );
90 ATH_CHECK( m_trackmaker.retrieve() );
91 ATH_CHECK( m_trackSummaryTool.retrieve( DisableTool{ m_trackSummaryTool.name().empty()} ));
92 if (not m_etaDependentCutsSvc.name().empty()) ATH_CHECK(m_etaDependentCutsSvc.retrieve());
93 magneticFieldInit(); //init magnetic field for simplified propagation
94
96 if (msgLvl(MSG::DEBUG)) {
97 dump(MSG::DEBUG, nullptr);
98 }
100 m_problemsTotal = 0;
101
102 return StatusCode::SUCCESS;
103}

◆ 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()

◆ magneticFieldInit()

void InDet::SiSPSeededTrackFinderRoI::magneticFieldInit ( )
protected

Definition at line 472 of file SiSPSeededTrackFinderRoI.cxx.

473{
474 // Build MagneticFieldProperties
475 //
476 if(m_fieldmode == "NoField") {
477 m_fieldprop = Trk::MagneticFieldProperties(Trk::NoField);
478 } else {
479 m_fieldprop = Trk::MagneticFieldProperties(Trk::FastField);
480 }
481}
Trk::MagneticFieldProperties m_fieldprop
@ FastField
call the fast field access method of the FieldSvc
@ NoField
Field is set to 0., 0., 0.,.

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

◆ passEtaDepCuts()

bool InDet::SiSPSeededTrackFinderRoI::passEtaDepCuts ( const Trk::Track * track,
int nClusters,
int nFreeClusters,
int nPixels ) const
protected

apply eta-dependent selections

Candidate tracks can be further selected using eta-dependent selections.

Definition at line 483 of file SiSPSeededTrackFinderRoI.cxx.

487{
488 Trk::TrackStates::const_iterator m = track->trackStateOnSurfaces()->begin();
489 const Trk::TrackParameters* par = (*m)->trackParameters();
490 if(!par) return false;
491
492 double eta = std::abs(par->eta());
493 if(nClusters < m_etaDependentCutsSvc->getMinSiHitsAtEta(eta)) return false;
494 if(nFreeClusters < m_etaDependentCutsSvc->getMinSiNotSharedAtEta(eta)) return false;
495 if(nClusters-nFreeClusters > m_etaDependentCutsSvc->getMaxSharedAtEta(eta)) return false;
496 if(nPixels < m_etaDependentCutsSvc->getMinPixelHitsAtEta(eta)) return false;
497
498 if(par->pT() < m_etaDependentCutsSvc->getMinPtAtEta(eta)) return false;
499 if(!(*m)->type(Trk::TrackStateOnSurface::Perigee)) return true ;
500 if(std::abs(par->localPosition()[0]) > m_etaDependentCutsSvc->getMaxPrimaryImpactAtEta(eta)) return false;
501 return true;
502}
Scalar eta() const
pseudorapidity method
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
@ Perigee
This represents a perigee, and so will contain a Perigee object only.
ParametersBase< TrackParametersDim, Charged > TrackParameters

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

◆ ATLAS_THREAD_SAFE

Counter_t m_counterTotal InDet::SiSPSeededTrackFinderRoI::ATLAS_THREAD_SAFE {}
mutableprotected

Definition at line 154 of file SiSPSeededTrackFinderRoI.h.

154{};

◆ m_beamSpotKey

SG::ReadCondHandleKey<InDet::BeamSpotData> InDet::SiSPSeededTrackFinderRoI::m_beamSpotKey {this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot"}
protected

Definition at line 85 of file SiSPSeededTrackFinderRoI.h.

85{this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot"};

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

BooleanProperty InDet::SiSPSeededTrackFinderRoI::m_doRandomSpot {this, "doRandomSpot", false, "Low-pT tracking setting the RoI in a random position"}
protected

Definition at line 72 of file SiSPSeededTrackFinderRoI.h.

72{this, "doRandomSpot", false, "Low-pT tracking setting the RoI in a random position"};

◆ m_etaDependentCutsSvc

ServiceHandle<IInDetEtaDependentCutsSvc> InDet::SiSPSeededTrackFinderRoI::m_etaDependentCutsSvc {this, "EtaDependentCutsSvc", "", "if enable, further require eta-dependent selections on track candidates"}
protected

Definition at line 101 of file SiSPSeededTrackFinderRoI.h.

101{this, "EtaDependentCutsSvc", "", "if enable, further require eta-dependent selections on track candidates"};

◆ m_evtKey

SG::ReadHandleKey<xAOD::EventInfo> InDet::SiSPSeededTrackFinderRoI::m_evtKey {this, "EventInfoKey", "EventInfo"}
protected

Definition at line 86 of file SiSPSeededTrackFinderRoI.h.

86{this, "EventInfoKey", "EventInfo"};

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

StringProperty InDet::SiSPSeededTrackFinderRoI::m_fieldmode {this, "MagneticFieldMode", "MapSolenoid"}
protected

Definition at line 74 of file SiSPSeededTrackFinderRoI.h.

74{this, "MagneticFieldMode", "MapSolenoid"};

◆ m_fieldprop

Trk::MagneticFieldProperties InDet::SiSPSeededTrackFinderRoI::m_fieldprop
protected

Definition at line 107 of file SiSPSeededTrackFinderRoI.h.

◆ m_maxNumberSeeds

IntegerProperty InDet::SiSPSeededTrackFinderRoI::m_maxNumberSeeds {this, "maxNumberSeeds", 3000000, "Max. number used seeds"}
protected

Definition at line 70 of file SiSPSeededTrackFinderRoI.h.

70{this, "maxNumberSeeds", 3000000, "Max. number used seeds"};

◆ m_neventsTotal

std::atomic_int InDet::SiSPSeededTrackFinderRoI::m_neventsTotal {0}
mutableprotected

Number events.

Definition at line 156 of file SiSPSeededTrackFinderRoI.h.

156{0};

◆ m_nfreeCut

IntegerProperty InDet::SiSPSeededTrackFinderRoI::m_nfreeCut {this, "FreeClustersCut", 1, "Min number free clusters"}
protected

Definition at line 71 of file SiSPSeededTrackFinderRoI.h.

71{this, "FreeClustersCut", 1, "Min number free clusters"};

◆ m_outputTracksKey

SG::WriteHandleKey<TrackCollection> InDet::SiSPSeededTrackFinderRoI::m_outputTracksKey {this, "TracksLocation", "SiSPSeededTracksRoI", "Output track collection"}
protected

Definition at line 81 of file SiSPSeededTrackFinderRoI.h.

81{this, "TracksLocation", "SiSPSeededTracksRoI", "Output track collection"};

◆ m_prdToTrackMap

SG::ReadHandleKey<Trk::PRDtoTrackMap> InDet::SiSPSeededTrackFinderRoI::m_prdToTrackMap {this,"PRDtoTrackMap",""}
protected

Definition at line 84 of file SiSPSeededTrackFinderRoI.h.

84{this,"PRDtoTrackMap",""};

◆ m_problemsTotal

std::atomic_int InDet::SiSPSeededTrackFinderRoI::m_problemsTotal {0}
mutableprotected

Number events with number seeds > maxNumber.

Definition at line 157 of file SiSPSeededTrackFinderRoI.h.

157{0};

◆ m_RandomRoISeedTool

ToolHandle<IZWindowRoISeedTool> InDet::SiSPSeededTrackFinderRoI::m_RandomRoISeedTool {this, "RandomRoISeedTool", "InDet::RandomRoISeedTool", "Tool to run using additional RoIs randomly chosen away from the main one if doRandomSpot is set"}
protected

Definition at line 99 of file SiSPSeededTrackFinderRoI.h.

99{this, "RandomRoISeedTool", "InDet::RandomRoISeedTool", "Tool to run using additional RoIs randomly chosen away from the main one if doRandomSpot is set"};

◆ m_seedsmaker

ToolHandle<ISiSpacePointsSeedMaker> InDet::SiSPSeededTrackFinderRoI::m_seedsmaker {this, "SeedsTool", "InDet::SiSpacePointsSeedMaker_ATLxk/InDetSpSeedsMaker", "Space poins seed maker"}
protected

Definition at line 94 of file SiSPSeededTrackFinderRoI.h.

94{this, "SeedsTool", "InDet::SiSpacePointsSeedMaker_ATLxk/InDetSpSeedsMaker", "Space poins seed maker"};

◆ m_trackmaker

ToolHandle<ISiTrackMaker> InDet::SiSPSeededTrackFinderRoI::m_trackmaker {this, "TrackTool", "InDet::SiTrackMaker_xk/InDetSiTrackMaker", "Track maker"}
protected

Definition at line 95 of file SiSPSeededTrackFinderRoI.h.

95{this, "TrackTool", "InDet::SiTrackMaker_xk/InDetSiTrackMaker", "Track maker"};

◆ m_trackSummaryTool

ToolHandle<Trk::IExtendedTrackSummaryTool> InDet::SiSPSeededTrackFinderRoI::m_trackSummaryTool {this, "TrackSummaryTool", "InDetTrackSummaryToolNoHoleSearch"}
protected

Definition at line 96 of file SiSPSeededTrackFinderRoI.h.

96{this, "TrackSummaryTool", "InDetTrackSummaryToolNoHoleSearch"};

◆ m_useRoIWidth

BooleanProperty InDet::SiSPSeededTrackFinderRoI::m_useRoIWidth {this, "useRoIWidth", true, "Use width of RoI along z-axis"}
protected

Definition at line 69 of file SiSPSeededTrackFinderRoI.h.

69{this, "useRoIWidth", true, "Use width of RoI along z-axis"};

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

SG::WriteHandleKey<xAOD::VertexContainer> InDet::SiSPSeededTrackFinderRoI::m_vxOutputKey {this, "VxOutputName", "LowPtRoIVertices", "Output Vertex collection with per-event RoI information"}
protected

Definition at line 82 of file SiSPSeededTrackFinderRoI.h.

82{this, "VxOutputName", "LowPtRoIVertices", "Output Vertex collection with per-event RoI information"};

◆ m_ZWindowRoISeedTool

ToolHandle<IZWindowRoISeedTool> InDet::SiSPSeededTrackFinderRoI::m_ZWindowRoISeedTool {this, "ZWindowRoISeedTool", "InDet::ZWindowRoISeedTool", "Tool to determin per-event RoI"}
protected

Definition at line 98 of file SiSPSeededTrackFinderRoI.h.

98{this, "ZWindowRoISeedTool", "InDet::ZWindowRoISeedTool", "Tool to determin per-event RoI"};

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