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

#include <FPGATrackSimRawToLogicalHitsTool.h>

Inheritance diagram for FPGATrackSimRawToLogicalHitsTool:
Collaboration diagram for FPGATrackSimRawToLogicalHitsTool:

Public Member Functions

 FPGATrackSimRawToLogicalHitsTool (const std::string &, const std::string &, const IInterface *)
virtual ~FPGATrackSimRawToLogicalHitsTool ()=default
virtual StatusCode initialize () override
StatusCode convert (unsigned stage, const FPGATrackSimEventInputHeader &header, FPGATrackSimLogicalEventInputHeader &logicheader)
StatusCode getUnmapped (std::vector< FPGATrackSimHit > &missing_hits)
const FPGATrackSimPlaneMapgetPlaneMap_1st (int sliceNum)
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 sysInitialize () override
 Perform system initialization for an algorithm.
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

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

Private Attributes

ServiceHandle< IFPGATrackSimMappingSvcm_FPGATrackSimMapping {this, "FPGATrackSimMappingSvc", "FPGATrackSimMappingSvc"}
ServiceHandle< IFPGATrackSimEventSelectionSvcm_EvtSel {this, "FPGATrackSimEventSelectionSvc", ""}
IntegerProperty m_saveOptional {this, "SaveOptional", 2, "flag to enable the truth/offline tracking save =0 no optional saved, =1 saved in region, =2 save all "}
IntegerArrayProperty m_towersToMap {this, "TowersToMap", {}, "Which Towers to map, goes from 0 to 96!"}
std::vector< int > m_towers
std::vector< FPGATrackSimHitm_missing_hits
std::vector< int > m_missing_hit_codes
const FPGATrackSimPlaneMapm_pmap = nullptr
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 24 of file FPGATrackSimRawToLogicalHitsTool.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ FPGATrackSimRawToLogicalHitsTool()

FPGATrackSimRawToLogicalHitsTool::FPGATrackSimRawToLogicalHitsTool ( const std::string & algname,
const std::string & name,
const IInterface * ifc )

Definition at line 23 of file FPGATrackSimRawToLogicalHitsTool.cxx.

23 :
24 AthAlgTool(algname,name,ifc){}
AthAlgTool()
Default constructor:

◆ ~FPGATrackSimRawToLogicalHitsTool()

virtual FPGATrackSimRawToLogicalHitsTool::~FPGATrackSimRawToLogicalHitsTool ( )
virtualdefault

Member Function Documentation

◆ convert()

StatusCode FPGATrackSimRawToLogicalHitsTool::convert ( unsigned stage,
const FPGATrackSimEventInputHeader & header,
FPGATrackSimLogicalEventInputHeader & logicheader )

Definition at line 50 of file FPGATrackSimRawToLogicalHitsTool.cxx.

50 {
51
52 ATH_MSG_DEBUG ("Mapping " << eventHeader.nHits() << " hits using stage " << stage);
53 FPGATrackSimEventInfo eventinfo = eventHeader.event();
54 ATH_MSG_DEBUG ("Getting Event " << eventinfo);
55 logicEventHeader.newEvent(eventinfo);//this also reset all varaibles
56
57 if(stage!=1 && stage!=2)
58 {
59 ATH_MSG_FATAL("convert() must have stage == 1 or 2");
60 }
61
62 const FPGATrackSimPlaneMap* pmap = m_FPGATrackSimMapping->PlaneMap_2nd(0);
63
64 logicEventHeader.reserveTowers(m_towers.size());
65 for (int ireg: m_towers){
66 FPGATrackSimTowerInputHeader tower = FPGATrackSimTowerInputHeader(ireg);//default header, can eventually set eta/phi/deta/dphi
67 logicEventHeader.addTower( tower);
68 }
69 for (FPGATrackSimHit hit: eventHeader.hits()) { // hit loop
70 // In the ITk geometry, some of the plane IDs are -1 if the layers are not yet being used.
71 // This causes the code in this hit loop to crash. As a workaround for the moment, we currently
72 // skip over hits in layers that are not included in the FPGATrackSim geometry, with plane = -1
73
74 pmap->doRemap(hit);
75
76 for (unsigned int ireg = 0; ireg != m_towers.size(); ++ireg) {
77 logicEventHeader.getTower(ireg)->addHit(hit);
78 ATH_MSG_VERBOSE("Hit mapped (" << hit.isMapped() << ") to tower=" << ireg << ", nHits now=" << logicEventHeader.getTower(ireg)->nHits());
79 }
80 } // end hit loop
81
82 if (stage == 1) {
83 FPGATrackSimOptionalEventInfo op = eventHeader.optional();
84 if (m_saveOptional == 2) {
85 logicEventHeader.setOptional(op);
86 }
87 else if (m_saveOptional == 1) {
88 // save offline tracks
89 FPGATrackSimOptionalEventInfo newop;
91 for (FPGATrackSimOfflineTrack const & offline_t : op.getOfflineTracks()) newop.addOfflineTrack(offline_t);
92 // save truth in region
93 for (FPGATrackSimTruthTrack const & truth_t : op.getTruthTracks()) {
94 if (m_EvtSel->passMatching(truth_t)) newop.addTruthTrack(truth_t);
95 }
96 ATH_MSG_DEBUG("Selected " << newop.nTruthTracks() << " truth tracks");
97 logicEventHeader.setOptional(newop);
98 }
99 }
100
101 return StatusCode::SUCCESS;
102}
#define ATH_MSG_FATAL(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_DEBUG(x)
void addTruthTrack(const FPGATrackSimTruthTrack &t)
void addOfflineTrack(const FPGATrackSimOfflineTrack &t)
const std::vector< FPGATrackSimTruthTrack > & getTruthTracks() const
const std::vector< FPGATrackSimOfflineTrack > & getOfflineTracks() const
void doRemap(FPGATrackSimHit &hit) const
ServiceHandle< IFPGATrackSimEventSelectionSvc > m_EvtSel
ServiceHandle< IFPGATrackSimMappingSvc > m_FPGATrackSimMapping

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::evtStore ( )
inlineinherited

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

Definition at line 85 of file AthCommonDataStore.h.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::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

◆ getPlaneMap_1st()

const FPGATrackSimPlaneMap * FPGATrackSimRawToLogicalHitsTool::getPlaneMap_1st ( int sliceNum)

Definition at line 104 of file FPGATrackSimRawToLogicalHitsTool.cxx.

104 {
105 return m_FPGATrackSimMapping->PlaneMap_1st(sliceNum);
106}

◆ getUnmapped()

StatusCode FPGATrackSimRawToLogicalHitsTool::getUnmapped ( std::vector< FPGATrackSimHit > & missing_hits)

◆ initialize()

StatusCode FPGATrackSimRawToLogicalHitsTool::initialize ( )
overridevirtual

Definition at line 27 of file FPGATrackSimRawToLogicalHitsTool.cxx.

27 {
29 ATH_CHECK(m_EvtSel.retrieve());
30
31 ATH_MSG_INFO("SaveOptional="<<m_saveOptional);
32 // remove deferensed m_towersToMap.value() in newer releases!
33 if( m_towersToMap.value().empty() ){
34 int maxNtowers = m_FPGATrackSimMapping->RegionMap_2nd()->getNRegions();
35 for (int ireg=0;ireg!=maxNtowers;++ireg) m_towers.push_back(ireg);
36 }else{
37 m_towers = m_towersToMap.value();
38 }
39
40 ATH_MSG_DEBUG ("Configured to process "<<m_towers.size() << " towers");
41 std::stringstream listOfTowers;
42 for (int ireg: m_towers){
43 listOfTowers<<", "<<ireg;
44 }
45 ATH_MSG_DEBUG ("List of Towers: "<<listOfTowers.str());
46 return StatusCode::SUCCESS;
47}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::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.

◆ msg()

MsgStream & AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

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

◆ msgLvl()

bool AthCommonMsg< AlgTool >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and DerivationFramework::CfAthAlgTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::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< AlgTool > >::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 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_EvtSel

ServiceHandle<IFPGATrackSimEventSelectionSvc> FPGATrackSimRawToLogicalHitsTool::m_EvtSel {this, "FPGATrackSimEventSelectionSvc", ""}
private

Definition at line 42 of file FPGATrackSimRawToLogicalHitsTool.h.

42{this, "FPGATrackSimEventSelectionSvc", ""};

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_FPGATrackSimMapping

ServiceHandle<IFPGATrackSimMappingSvc> FPGATrackSimRawToLogicalHitsTool::m_FPGATrackSimMapping {this, "FPGATrackSimMappingSvc", "FPGATrackSimMappingSvc"}
private

Definition at line 41 of file FPGATrackSimRawToLogicalHitsTool.h.

41{this, "FPGATrackSimMappingSvc", "FPGATrackSimMappingSvc"};

◆ m_missing_hit_codes

std::vector<int> FPGATrackSimRawToLogicalHitsTool::m_missing_hit_codes
private

Definition at line 49 of file FPGATrackSimRawToLogicalHitsTool.h.

◆ m_missing_hits

std::vector<FPGATrackSimHit> FPGATrackSimRawToLogicalHitsTool::m_missing_hits
private

Definition at line 48 of file FPGATrackSimRawToLogicalHitsTool.h.

◆ m_pmap

const FPGATrackSimPlaneMap* FPGATrackSimRawToLogicalHitsTool::m_pmap = nullptr
private

Definition at line 50 of file FPGATrackSimRawToLogicalHitsTool.h.

◆ m_saveOptional

IntegerProperty FPGATrackSimRawToLogicalHitsTool::m_saveOptional {this, "SaveOptional", 2, "flag to enable the truth/offline tracking save =0 no optional saved, =1 saved in region, =2 save all "}
private

Definition at line 43 of file FPGATrackSimRawToLogicalHitsTool.h.

43{this, "SaveOptional", 2, "flag to enable the truth/offline tracking save =0 no optional saved, =1 saved in region, =2 save all "};

◆ m_towers

std::vector<int> FPGATrackSimRawToLogicalHitsTool::m_towers
private

Definition at line 47 of file FPGATrackSimRawToLogicalHitsTool.h.

◆ m_towersToMap

IntegerArrayProperty FPGATrackSimRawToLogicalHitsTool::m_towersToMap {this, "TowersToMap", {}, "Which Towers to map, goes from 0 to 96!"}
private

Definition at line 44 of file FPGATrackSimRawToLogicalHitsTool.h.

44{this, "TowersToMap", {}, "Which Towers to map, goes from 0 to 96!"};

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


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