ATLAS Offline Software
Loading...
Searching...
No Matches
FPGATrackSimDataPrepAlg.h
Go to the documentation of this file.
1// Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2
3#ifndef FPGATrackSim_DATAPREPALG_H
4#define FPGATrackSim_DATAPREPALG_H
5
6/*
7 * Please put a description on what this class does
8 */
9
11#include "GaudiKernel/ToolHandle.h"
25
27
28#include <fstream>
29
41
44
51
53class FPGATrackSimHit;
56
58{
59 public:
60 FPGATrackSimDataPrepAlg(const std::string& name, ISvcLocator* pSvcLocator);
61 virtual ~FPGATrackSimDataPrepAlg() = default;
62
63 virtual StatusCode initialize() override;
64 virtual StatusCode execute() override;
65 virtual StatusCode finalize() override;
66
67 private:
68
69 std::string m_description;
70 int m_ev = 0;
71
72 // Handles
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"};
81 // chrono service
82 ServiceHandle<IChronoStatSvc> m_chrono{this,"ChronoStatSvc","ChronoStatSvc"};
83
84 // Flags
85 Gaudi::Property<int> m_firstInputToolN {this, "FirstInputToolN", 1, "number of times to use event from first input tool"};
86 Gaudi::Property<int> m_secondInputToolN {this, "SecondInputToolN", 0, "number of times to use event from second input tool"};
87 Gaudi::Property<bool> m_doHitFiltering {this, "HitFiltering", false, "flag to enable hit/cluster filtering"};
88 Gaudi::Property<int> m_clustering {this, "Clustering", 0, "int to enable the clustering and say how many times to run it"};
89 Gaudi::Property<bool> m_writeOutputData {this, "writeOutputData", true,"write the output TTree"};
90 Gaudi::Property<bool> m_writePreClusterBranch {this, "writePreClusterBranch", true, "If set to false, never write precluster branches"};
91 // Properties for the output header tool.
92
93 Gaudi::Property<bool> m_doEvtSel {this, "doEvtSel", false, "do event selection"};
94 Gaudi::Property<bool> m_useInternalTruthTracks {this,"useInternalTruthTracks", false, "case when runnin on RDO file (and not or wrapper)"};
95 Gaudi::Property<bool> m_recordHits {this,"recordHits", true, "For F-100 this is not needed"};
96 Gaudi::Property<int> m_writeRegion {this,"writeRegion", -1, "Only output selected region, default is -1 which means not requirement"};
97
98 // Properties for the output header tool.
99 Gaudi::Property<std::string> m_preClusterBranch {this, "preClusterBranch", "LogicalEventInputHeader_PreCluster", "Name of the branch for pre-cluster input data in output ROOT file." };
100 Gaudi::Property<std::string> m_postClusterBranch {this, "postClusterBranch", "LogicalEventInputHeader_PostCluster", "Name of the branch for post-cluster input data in output ROOT file." };
101
102 // ROOT pointers
107
108 // Event storage
109 std::unique_ptr<FPGATrackSimClusterCollection> m_clusters = std::make_unique<FPGATrackSimClusterCollection>();
110 std::vector<FPGATrackSimHit> m_hits_miss{};
111
112 // internal counters
113 double m_evt = 0; // number of events passing event selection, independent of truth
114
115 unsigned long m_nPixClusters = 0; // number of clusters for pix, total
116 unsigned m_nMaxPixClusters = 0; // max number of pixel clusters in an event
117 unsigned long m_nStripClusters = 0; // number of clusters for strip, total
118 unsigned m_nMaxStripClusters = 0; // max number of strip clusters in an event
119 unsigned m_nMaxClusters = 0; // max number of total clusters in an event
120
121
122 StatusCode readInputs(bool & done);
125
126 ToolHandle<GenericMonitoringTool> m_monTool{this,"MonTool", "", "Monitoring tool"};
127
128 // NOTE: the clusters collection(s) contain ALL Clusters, not just "first stage" clusters.
129 SG::WriteHandleKeyArray<FPGATrackSimClusterCollection> m_FPGAClusterKey{this, "FPGATrackSimClusterKey",{"FPGAClusters_1st"},"FPGATrackSim Clusters key"};
130 SG::WriteHandleKey<FPGATrackSimHitCollection> m_FPGAHitKey{this, "FPGATrackSimHitKey","FPGAHits", "FPGATrackSim Hits key"};
131 SG::WriteHandleKey<FPGATrackSimHitCollection> m_FPGAHitUnmappedKey{this, "FPGATrackSimHitUnmappedKey","FPGAHitsUnmapped_1st","FPGATrackSim Unmapped Hits 1st stage key"};
132
133 SG::ReadHandleKey<xAOD::TruthParticleContainer> m_inputTruthParticleContainerKey{this, "TruthTrackContainer", "TruthParticles", "Truth Particle Container"};
134 SG::WriteHandleKey<xAODTruthParticleLinkVector> m_truthLinkContainerKey{this, "TruthLinks", "xAODFPGATruthLinks", "Output EF xAODTruthLinks container"};
135
136 SG::WriteHandleKey<FPGATrackSimTruthTrackCollection> m_FPGATruthTrackKey {this, "FPGATrackSimTruthTrackKey", "FPGATruthTracks", "FPGATrackSim truth tracks"};
137 SG::WriteHandleKey<FPGATrackSimOfflineTrackCollection> m_FPGAOfflineTrackKey {this, "FPGATrackSimOfflineTrackKey", "FPGAOfflineTracks", "FPGATrackSim offline tracks"};
138 SG::WriteHandleKey<FPGATrackSimEventInfo> m_FPGAEventInfoKey{this, "FPGATrackSimEventInfoKey", "FPGAEventInfo", "FPGATrackSim event info"};
139
140};
141
142
143#endif // FPGATrackSimLOGICALHITSTOALGORITHMS_h
Declares an abstract class that implements an interface for pixel clustering. This class is implement...
Output roads into a ROOT file.
This class reads/write FPGATrackSim output data from/to a ROOT file Designed to be not thread-safe.
This declares a basic interface for input tools which provide the FPGATrackSimEventInputHeader data t...
Declares an abstract class that implements an interface for hit/cluster filtering....
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.
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
ToolHandleArray< FPGATrackSimRawToLogicalHitsTool > m_hitMapTools
SG::WriteHandleKey< FPGATrackSimOfflineTrackCollection > m_FPGAOfflineTrackKey
SG::WriteHandleKey< FPGATrackSimHitCollection > m_FPGAHitUnmappedKey
Gaudi::Property< std::string > m_preClusterBranch
Gaudi::Property< std::string > m_postClusterBranch
virtual StatusCode finalize() override
virtual ~FPGATrackSimDataPrepAlg()=default
Gaudi::Property< bool > m_doEvtSel
SG::WriteHandleKey< FPGATrackSimTruthTrackCollection > m_FPGATruthTrackKey
FPGATrackSimLogicalEventInputHeader * m_logicEventHeader_precluster
StatusCode processInputs(SG::WriteHandle< FPGATrackSimHitCollection > &FPGAHitUnmapped, SG::WriteHandle< FPGATrackSimClusterCollection > &FPGAClusters)
ToolHandle< IFPGATrackSimInputTool > m_hitSGInputTool
Gaudi::Property< int > m_firstInputToolN
ToolHandle< FPGATrackSimOutputHeaderTool > m_writeOutputTool
virtual StatusCode initialize() override
Gaudi::Property< int > m_secondInputToolN
ToolHandleArray< FPGATrackSim::FPGATrackSimEventSelectionTool > m_eventSelectionTools
ToolHandle< FPGATrackSimReadRawRandomHitsTool > m_hitInputTool2
Gaudi::Property< bool > m_writePreClusterBranch
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_inputTruthParticleContainerKey
ToolHandle< GenericMonitoringTool > m_monTool
virtual StatusCode execute() override
Gaudi::Property< bool > m_useInternalTruthTracks
std::unique_ptr< FPGATrackSimClusterCollection > m_clusters
ToolHandle< IFPGATrackSimEventInputHeaderTool > m_hitInputTool
FPGATrackSimLogicalEventInputHeader * m_logicEventHeader
Gaudi::Property< int > m_writeRegion
SG::WriteHandleKey< FPGATrackSimHitCollection > m_FPGAHitKey
std::vector< FPGATrackSimHit > m_hits_miss
Gaudi::Property< int > m_clustering
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
StatusCode readInputs(bool &done)
Gaudi::Property< bool > m_recordHits
FPGATrackSimEventInputHeader m_firstInputHeader
FPGATrackSimEventInputHeader m_eventHeader
ToolHandle< IFPGATrackSimHitFilteringTool > m_hitFilteringTool
SG::WriteHandleKey< xAODTruthParticleLinkVector > m_truthLinkContainerKey
Remove (mark) duplicate tracks This tool takes FPGATrackSimTrack as input and mark their status of pa...
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