3#ifndef FPGATrackSim_DATAPREPALG_H
4#define FPGATrackSim_DATAPREPALG_H
11#include "GaudiKernel/ToolHandle.h"
64 virtual StatusCode
execute(
const EventContext& ctx)
const override final;
65 virtual StatusCode
finalize()
override;
70 mutable std::atomic<unsigned>
m_ev{0};
73 ToolHandle<IFPGATrackSimInputTool>
m_hitSGInputTool {
this,
"SGInputTool",
"",
"Input tool from SG"};
74 ToolHandle<IFPGATrackSimEventInputHeaderTool>
m_hitInputTool {
this,
"InputTool",
"FPGATrackSimSGToRawHitsTool/FPGATrackSimSGToRawHitsTool",
"Input Tool"};
75 ToolHandle<FPGATrackSimReadRawRandomHitsTool>
m_hitInputTool2 {
this,
"InputTool2",
"FPGATrackSimReadRawRandomHitsTool/FPGATrackSimReadRawRandomHitsTool",
"Potential 2nd input Tool to load data from more than one source"};
76 ToolHandleArray<FPGATrackSimRawToLogicalHitsTool>
m_hitMapTools {
this,
"RawToLogicalHitsTools", {},
"Raw To Logical Tools"};
77 ToolHandle<IFPGATrackSimHitFilteringTool>
m_hitFilteringTool {
this,
"HitFilteringTool",
"FPGATrackSimHitFilteringTool/FPGATrackSimHitFilteringTool",
"Hit Filtering Tool"};
78 ToolHandle<FPGATrackSimClusteringToolI>
m_clusteringTool {
this,
"ClusteringTool",
"FPGATrackSimClusteringTool/FPGATrackSimClusteringTool",
"Hit Clustering Tool"};
79 ToolHandle<FPGATrackSimOutputHeaderTool>
m_writeOutputTool {
this,
"OutputTool",
"FPGATrackSimOutputHeaderTool/FPGATrackSimOutputHeaderTool",
"Output tool"};
80 ToolHandleArray<FPGATrackSim::FPGATrackSimEventSelectionTool>
m_eventSelectionTools {
this,
"eventSelectors", {},
"Event selection Tools"};
85 Gaudi::Property<bool>
m_isDataPrepPipeline {
this,
"isDataPrepPipeline",
false,
"If True, this is for data prep pipeline only, thus skipping unecessary steps"};
86 Gaudi::Property<int>
m_firstInputToolN {
this,
"FirstInputToolN", 1,
"number of times to use event from first input tool"};
87 Gaudi::Property<int>
m_secondInputToolN {
this,
"SecondInputToolN", 0,
"number of times to use event from second input tool"};
88 Gaudi::Property<bool>
m_doHitFiltering {
this,
"HitFiltering",
false,
"flag to enable hit/cluster filtering"};
89 Gaudi::Property<int>
m_clustering {
this,
"Clustering", 0,
"int to enable the clustering and say how many times to run it"};
90 Gaudi::Property<bool>
m_writeOutputData {
this,
"writeOutputData",
true,
"write the output TTree"};
91 Gaudi::Property<bool>
m_writePreClusterBranch {
this,
"writePreClusterBranch",
true,
"If set to false, never write precluster branches"};
94 Gaudi::Property<bool>
m_doEvtSel {
this,
"doEvtSel",
false,
"do event selection"};
95 Gaudi::Property<bool>
m_useInternalTruthTracks {
this,
"useInternalTruthTracks",
false,
"case when runnin on RDO file (and not or wrapper)"};
96 Gaudi::Property<bool>
m_recordHits {
this,
"recordHits",
true,
"For F-100 this is not needed"};
97 Gaudi::Property<int>
m_writeRegion {
this,
"writeRegion", -1,
"Only output selected region, default is -1 which means not requirement"};
100 Gaudi::Property<std::string>
m_preClusterBranch {
this,
"preClusterBranch",
"LogicalEventInputHeader_PreCluster",
"Name of the branch for pre-cluster input data in output ROOT file." };
101 Gaudi::Property<std::string>
m_postClusterBranch {
this,
"postClusterBranch",
"LogicalEventInputHeader_PostCluster",
"Name of the branch for post-cluster input data in output ROOT file." };
108 mutable std::atomic<size_t>
m_evt = 0;
117 StatusCode
readInputs(
const EventContext& ctx,
125 std::vector<FPGATrackSimHit>& hits_miss,
130 ToolHandle<GenericMonitoringTool>
m_monTool{
this,
"MonTool",
"",
"Monitoring tool"};
std::vector< FPGATrackSimCluster > FPGATrackSimClusterCollection
Header file to be included by clients of the Monitored infrastructure.
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid from which a WriteHandle is made.
An algorithm that can be simultaneously executed in multiple threads.
ToolHandleArray< FPGATrackSimRawToLogicalHitsTool > m_hitMapTools
SG::WriteHandleKey< FPGATrackSimOfflineTrackCollection > m_FPGAOfflineTrackKey
virtual StatusCode execute(const EventContext &ctx) const override final
SG::WriteHandleKey< FPGATrackSimHitCollection > m_FPGAHitUnmappedKey
Gaudi::Property< std::string > m_preClusterBranch
Gaudi::Property< bool > m_isDataPrepPipeline
Gaudi::Property< std::string > m_postClusterBranch
virtual StatusCode finalize() override
virtual ~FPGATrackSimDataPrepAlg()=default
std::mutex m_rootWriteMutex
Gaudi::Property< bool > m_doEvtSel
SG::WriteHandleKey< FPGATrackSimTruthTrackCollection > m_FPGATruthTrackKey
FPGATrackSimLogicalEventInputHeader * m_logicEventHeader_precluster
ToolHandle< IFPGATrackSimInputTool > m_hitSGInputTool
Gaudi::Property< int > m_firstInputToolN
ToolHandle< FPGATrackSimOutputHeaderTool > m_writeOutputTool
StatusCode processInputs(const FPGATrackSimEventInputHeader &eventHeader, FPGATrackSimLogicalEventInputHeader &logicEventHeader, FPGATrackSimLogicalEventInputHeader &logicEventHeader_precluster, std::vector< FPGATrackSimHit > &hits_miss, FPGATrackSimClusterCollection &clusters, SG::WriteHandle< FPGATrackSimHitCollection > &FPGAHitUnmapped, SG::WriteHandle< FPGATrackSimClusterCollection > &FPGAClusters) const
virtual StatusCode initialize() override
Gaudi::Property< int > m_secondInputToolN
std::atomic< unsigned > m_nMaxStripClusters
ToolHandleArray< FPGATrackSim::FPGATrackSimEventSelectionTool > m_eventSelectionTools
std::atomic< unsigned > m_nMaxClusters
ToolHandle< FPGATrackSimReadRawRandomHitsTool > m_hitInputTool2
Gaudi::Property< bool > m_writePreClusterBranch
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_inputTruthParticleContainerKey
ToolHandle< GenericMonitoringTool > m_monTool
Gaudi::Property< bool > m_useInternalTruthTracks
std::atomic< unsigned long > m_nPixClusters
std::atomic< size_t > m_evt
ToolHandle< IFPGATrackSimEventInputHeaderTool > m_hitInputTool
FPGATrackSimLogicalEventInputHeader * m_logicEventHeader
std::atomic< unsigned > m_nMaxPixClusters
Gaudi::Property< int > m_writeRegion
SG::WriteHandleKey< FPGATrackSimHitCollection > m_FPGAHitKey
std::string m_description
Gaudi::Property< int > m_clustering
std::atomic< unsigned long > m_nStripClusters
SG::WriteHandleKey< FPGATrackSimEventInfo > m_FPGAEventInfoKey
Gaudi::Property< bool > m_writeOutputData
SG::WriteHandleKeyArray< FPGATrackSimClusterCollection > m_FPGAClusterKey
ServiceHandle< IChronoStatSvc > m_chrono
ToolHandle< FPGATrackSimClusteringToolI > m_clusteringTool
FPGATrackSimDataPrepAlg(const std::string &name, ISvcLocator *pSvcLocator)
Gaudi::Property< bool > m_doHitFiltering
Gaudi::Property< bool > m_recordHits
std::atomic< unsigned > m_ev
ToolHandle< IFPGATrackSimHitFilteringTool > m_hitFilteringTool
SG::WriteHandleKey< xAODTruthParticleLinkVector > m_truthLinkContainerKey
StatusCode readInputs(const EventContext &ctx, FPGATrackSimEventInputHeader &eventHeader, FPGATrackSimEventInputHeader &firstInputHeader, bool &done) const
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid from which a WriteHandle is made.
HandleKeyArray< WriteHandle< T >, WriteHandleKey< T >, Gaudi::DataHandle::Writer > WriteHandleKeyArray