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

#include <FPGATrackSimMatrixGenAlgo.h>

Inheritance diagram for FPGATrackSimMatrixGenAlgo:
Collaboration diagram for FPGATrackSimMatrixGenAlgo:

Public Member Functions

 FPGATrackSimMatrixGenAlgo (const std::string &name, ISvcLocator *pSvcLocator)
virtual ~FPGATrackSimMatrixGenAlgo ()=default
StatusCode initialize () override
StatusCode execute (const EventContext &ctx) override
 Execute method.
StatusCode finalize () override
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
bool filterPassed (const EventContext &ctx) const
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
const EventContext & getContext () const
 Deprecated methods (use the ones with EventContext).
bool filterPassed () const
void setFilterPassed (bool state) const

Protected Member Functions

virtual bool isReEntrant () const override final
 Legacy algorithms are not thread-safe.
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

enum class  selectHit_returnCode { SH_FAILURE , SH_KEEP_OLD , SH_KEEP_NEW }
typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

StatusCode bookHistograms ()
std::vector< FPGATrackSimHitgetLogicalHits ()
std::vector< FPGATrackSimTruthTrackfilterTrainingTracks (std::vector< FPGATrackSimTruthTrack > const &truth_tracks) const
std::map< int, std::vector< FPGATrackSimHit > > makeBarcodeMap (std::vector< FPGATrackSimHit > const &hits, std::vector< FPGATrackSimTruthTrack > const &tracks) const
selectHit_returnCode selectHit (FPGATrackSimHit const &old_hit, FPGATrackSimHit const &new_hit, bool is1ststage, int subregion) const
bool filterSectorHits (std::vector< FPGATrackSimHit > const &all_hits, std::vector< FPGATrackSimHit > &sector_hits, FPGATrackSimTruthTrack const &t, bool is1ststage, int subregion) const
int getRegion (std::vector< FPGATrackSimHit > const &hits, bool is1ststage) const
StatusCode makeAccumulator (std::vector< std::shared_ptr< const FPGATrackSimHit > > const &sector_hits, FPGATrackSimTruthTrack const &track, std::pair< std::vector< module_t >, FPGATrackSimMatrixAccumulator > &accumulator) const
StatusCode fillAccumulatorByDropping (std::vector< std::shared_ptr< const FPGATrackSimHit > > const &sector_hits, bool is1ststage, double x, double y, std::vector< module_t > &modules, AccumulateMap &map, FPGATrackSimTruthTrack const &track, int subregion) const
std::vector< TTree * > createMatrixTrees ()
void fillMatrixTrees (std::vector< TTree * > const &matrixTrees)
void writeSliceTree ()
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

std::vector< AccumulateMapm_sector_cum
ServiceHandle< IFPGATrackSimMappingSvcm_FPGATrackSimMapping {this,"FPGATrackSimMappingSvc","FPGATrackSimMappingSvc"}
ServiceHandle< IFPGATrackSimEventSelectionSvcm_EvtSel {this,"FPGATrackSimEventSelectionSvc",""}
ServiceHandle< ITHistSvc > m_tHistSvc {this,"THistSvc","THistSvc"}
ToolHandle< IFPGATrackSimInputToolm_hitInputTool {this, "FPGATrackSimSGToRawHitsTool", "FPGATrackSimSGToRawHitsTool/FPGATrackSimSGToRawHits", "input handler"}
ToolHandle< FPGATrackSimRawToLogicalHitsToolm_hitMapTool {this, "FPGATrackSimRawToLogicalHitsTool", "FPGATrackSimRawToLogicalHitsTool/FPGATrackSim_RawToLogicalHitsTool", "FPGATrackSim_RawToLogicalHitsTool"}
ToolHandle< FPGATrackSimClusteringToolIm_clusteringTool { this, "FPGATrackSimClusteringFTKTool", "FPGATrackSimClusteringFTKTool/FPGATrackSimClusteringFTKTool", "FPGATrackSimClusteringFTKTool" }
ToolHandle< FPGATrackSimSpacePointsToolIm_spacePointsTool { this, "SpacePointTool", "FPGATrackSimSpacePointsTool/FPGATrackSimSpacePointsTool", "FPGATrackSimSpacePointsTool" }
const FPGATrackSimPlaneMapm_pmap = nullptr
ToolHandle< FPGATrackSimRoadUnionToolm_roadFinderTool {this, "RoadFinder", "RoadFinder"}
ToolHandle< FPGATrackSimTrackFitterToolm_trackFitterTool_1st {this, "TrackFitter_1st", "FPGATrackSimTrackFitterTool/FPGATrackSimTrackFitterTool_1st", "1st stage track fit tool"}
ToolHandle< IFPGATrackSimTrackExtensionToolm_trackExtensionTool {this, "TrackExtensionTool", "FPGATrackSimTrackExtensionTool", "Track extensoin tool"}
ToolHandle< FPGATrackSimOverlapRemovalToolm_overlapRemovalTool {this, "OverlapRemoval_1st", "FPGATrackSimOverlapRemovalTool/FPGATrackSimOverlapRemovalTool_1st", "1st stage overlap removal tool"}
const FPGATrackSimPlaneMapm_pmap_1st = nullptr
const FPGATrackSimPlaneMapm_pmap_2nd = nullptr
Gaudi::Property< int > m_nRegions {this, "NBanks", 0, "Number of banks to make"}
Gaudi::Property< bool > m_doClustering {this, "Clustering", true, "Do cluster?"}
Gaudi::Property< bool > m_doSecondStage {this, "SecondStage", false, "Run second stage?"}
Gaudi::Property< bool > m_doSpacePoints {this, "SpacePoints", true, "Do spacepoints?"}
Gaudi::Property< int > m_ideal_geom {this, "IdealiseGeometry", 0, "Ideal geo flag, 0 is non, 1 is 1st order, 2 is 2nd order"}
Gaudi::Property< bool > m_single {this, "SingleSector", false, "Run single sector"}
Gaudi::Property< bool > m_doHoughConstants {this, "HoughConstants", true, "If true will run Hough Transform to set q/pt and phi0"}
Gaudi::Property< bool > m_doDeltaPhiConsts {this, "DeltaPhiConstants", false, "If true will generate delta phi constants"}
Gaudi::Property< int > m_MaxWC {this, "WCmax", 0, "Max number of WCs"}
Gaudi::Property< int > m_minSpacePlusPixel {this, "minSpacePlusPixel", 4, "Require that tracks in training have a certain number of pixel hits + spacepoints" }
Gaudi::Property< float > m_PT_THRESHOLD {this, "PT_THRESHOLD", 0., "Min pt"}
Gaudi::Property< float > m_D0_THRESHOLD {this, "D0_THRESHOLD", 1., "Max d0"}
Gaudi::Property< int > m_TRAIN_PDG {this, "TRAIN_PDG", 0, "PDG of particles to train on"}
Gaudi::Property< float > m_temp_c_min {this, "par_c_min", -1, "Min curvature"}
Gaudi::Property< float > m_temp_c_max {this, "par_c_max", 1, "Max curvature"}
Gaudi::Property< float > m_temp_phi_min {this, "par_phi_min", -TMath::Pi(), "Min phi"}
Gaudi::Property< float > m_temp_phi_max {this, "par_phi_max", TMath::Pi(), "Max phi"}
Gaudi::Property< float > m_temp_d0_min {this, "par_d0_min", -2, "Min d0"}
Gaudi::Property< float > m_temp_d0_max {this, "par_d0_max", 2, "Max d0"}
Gaudi::Property< float > m_temp_z0_min {this, "par_z0_min", -200, "Min z0"}
Gaudi::Property< float > m_temp_z0_max {this, "par_z0_max", 200, "Max z0"}
Gaudi::Property< float > m_temp_eta_min {this, "par_eta_min", -5, "Min eta"}
Gaudi::Property< float > m_temp_eta_max {this, "par_eta_max", 5, "Max eta"}
Gaudi::Property< int > m_temp_c_slices {this, "par_c_slices", 100, "Number of c slides"}
Gaudi::Property< int > m_temp_phi_slices {this, "par_phi_slices", 100, "Number of phi slices"}
Gaudi::Property< int > m_temp_d0_slices {this, "par_d0_slices", 100, "Number of d0 slices"}
Gaudi::Property< int > m_temp_z0_slices {this, "par_z0_slices", 100, "Number of z0 slices"}
Gaudi::Property< int > m_temp_eta_slices {this, "par_eta_slices", 100, "Number of eta slices"}
Gaudi::Property< bool > m_absQOverPtBinning {this, "qptAbsBinning", false, "This property controls whether or not to interpret the bins as q/pt or |q/pt|"}
Gaudi::Property< std::vector< double > > m_qOverPtBins {this, "sectorQPtBins", {}, "q/pt bins for sector definition"}
Gaudi::Property< bool > m_dropHitsAndFill {this, "dropHitsAndFill", false, "If true, we can drop hits to fill the accumulator"}
int m_nLayers_1st = 0
int m_nDim_1st = 0
int m_nLayers_2nd = 0
int m_nDim_2nd = 0
FPGATrackSimTrackPars m_sliceMin = 0
FPGATrackSimTrackPars m_sliceMax = 0
FPGATrackSimTrackParsI m_nBins
FPGATrackSimEventInputHeaderm_eventHeader = nullptr
size_t m_nTracks = 0
size_t m_nTracksUsed = 0
TH1I * m_h_trainingTrack [FPGATrackSimTrackPars::NPARS] {}
TH1I * m_h_sectorPars [FPGATrackSimTrackPars::NPARS] {}
TH1I * m_h_SHfailure [FPGATrackSimTrackPars::NPARS] {}
TH1I * m_h_3hitsInLayer [FPGATrackSimTrackPars::NPARS] {}
TH1I * m_h_notEnoughHits [FPGATrackSimTrackPars::NPARS] {}
TH1I * m_h_trackQoP_okHits = nullptr
TH1I * m_h_trackQoP_okRegion = nullptr
TH1I * m_h_nHit = nullptr
DataObjIDColl m_extendedExtraObjects
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 54 of file FPGATrackSimMatrixGenAlgo.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

◆ selectHit_returnCode

Enumerator
SH_FAILURE 
SH_KEEP_OLD 
SH_KEEP_NEW 

Definition at line 151 of file FPGATrackSimMatrixGenAlgo.h.

151{ SH_FAILURE, SH_KEEP_OLD, SH_KEEP_NEW };

Constructor & Destructor Documentation

◆ FPGATrackSimMatrixGenAlgo()

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

Definition at line 37 of file FPGATrackSimMatrixGenAlgo.cxx.

37 :
38 AthAlgorithm(name, pSvcLocator)
39{
40}
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:

◆ ~FPGATrackSimMatrixGenAlgo()

virtual FPGATrackSimMatrixGenAlgo::~FPGATrackSimMatrixGenAlgo ( )
virtualdefault

Member Function Documentation

◆ bookHistograms()

StatusCode FPGATrackSimMatrixGenAlgo::bookHistograms ( )
private

Definition at line 129 of file FPGATrackSimMatrixGenAlgo.cxx.

130{
131 // Training tracks
132 for (unsigned i = 0; i < FPGATrackSimTrackPars::NPARS; i++) {
133 std::string name = "h_trainingTrack_" + FPGATrackSimTrackPars::parName(i);
134 std::string title = FPGATrackSimTrackPars::parName(i) + " of tracks passing pt/barcode check";
135
136 m_h_trainingTrack[i] = new TH1I(name.c_str(), title.c_str(), 100, m_sliceMin[i], m_sliceMax[i]);
137 ATH_CHECK(m_tHistSvc->regHist("/TRIGFPGATrackSimMATRIXOUT/" + name, m_h_trainingTrack[i]));
138 }
139
140 // Sector pars
141 for (unsigned i = 0; i < FPGATrackSimTrackPars::NPARS; i++) {
142
143 std::string name = "h_sectorPars_" + FPGATrackSimTrackPars::parName(i);
144 std::string title = "Average " + FPGATrackSimTrackPars::parName(i) + " in sector";
145
146 m_h_sectorPars[i] = new TH1I(name.c_str(), title.c_str(), 100, m_sliceMin[i], m_sliceMax[i]);
147 ATH_CHECK(m_tHistSvc->regHist("/TRIGFPGATrackSimMATRIXOUT/" + name, m_h_sectorPars[i]));
148 }
149
150 // Select hit failure
151 for (unsigned i = 0; i < FPGATrackSimTrackPars::NPARS; i++) {
152
153 std::string name = "h_SHfailure_" + FPGATrackSimTrackPars::parName(i);
154 std::string title = FPGATrackSimTrackPars::parName(i) + " of tracks failing in selectHit()";
155
156 m_h_SHfailure[i] = new TH1I(name.c_str(), title.c_str(), 100, m_sliceMin[i], m_sliceMax[i]);
157 ATH_CHECK(m_tHistSvc->regHist("/TRIGFPGATrackSimMATRIXOUT/" + name, m_h_SHfailure[i]));
158 }
159
160 // 3 hits in layer
161 for (unsigned i = 0; i < FPGATrackSimTrackPars::NPARS; i++) {
162
163 std::string name = "h_3hitsInLayer_" + FPGATrackSimTrackPars::parName(i);
164 std::string title = FPGATrackSimTrackPars::parName(i) + " of tracks containing 3+ hits in a single layer";
165
166 m_h_3hitsInLayer[i] = new TH1I(name.c_str(), title.c_str(), 100, m_sliceMin[i], m_sliceMax[i]);
167 ATH_CHECK(m_tHistSvc->regHist("/TRIGFPGATrackSimMATRIXOUT/" + name, m_h_3hitsInLayer[i]));
168 }
169
170 // Not enough hits
171 for (unsigned i = 0; i < FPGATrackSimTrackPars::NPARS; i++) {
172 std::string name = "h_notEnoughHits_" + FPGATrackSimTrackPars::parName(i);
173 std::string title = FPGATrackSimTrackPars::parName(i) + " of tracks failing because it didn't have enough hits";
174
175 m_h_notEnoughHits[i] = new TH1I(name.c_str(), title.c_str(), 100, m_sliceMin[i], m_sliceMax[i]);
176 ATH_CHECK(m_tHistSvc->regHist("/TRIGFPGATrackSimMATRIXOUT/" + name, m_h_notEnoughHits[i]));
177 }
178
179 m_h_trackQoP_okHits = new TH1I("h_trackQoP_okHits", "half inverse pt of tracks passing hit check",
180 m_nBins.qOverPt, m_sliceMin.qOverPt, m_sliceMax.qOverPt);
181 m_h_trackQoP_okRegion = new TH1I("h_trackQoP_okRegion", "half inverse pt of tracks passing region check",
182 m_nBins.qOverPt, m_sliceMin.qOverPt, m_sliceMax.qOverPt);
183 m_h_nHit = new TH1I("h_nHit", "number of hits in sector", 100, 0, 100);
184
185 ATH_CHECK(m_tHistSvc->regHist("/TRIGFPGATrackSimMATRIXOUT/h_trackQoP_okHits", m_h_trackQoP_okHits));
186 ATH_CHECK(m_tHistSvc->regHist("/TRIGFPGATrackSimMATRIXOUT/h_trackQoP_okRegion", m_h_trackQoP_okRegion));
187 ATH_CHECK(m_tHistSvc->regHist("/TRIGFPGATrackSimMATRIXOUT/h_nHit",m_h_nHit));
188
189 return StatusCode::SUCCESS;
190}
#define ATH_CHECK
Evaluate an expression and check for errors.
TH1I * m_h_trainingTrack[FPGATrackSimTrackPars::NPARS]
TH1I * m_h_notEnoughHits[FPGATrackSimTrackPars::NPARS]
TH1I * m_h_sectorPars[FPGATrackSimTrackPars::NPARS]
TH1I * m_h_3hitsInLayer[FPGATrackSimTrackPars::NPARS]
ServiceHandle< ITHistSvc > m_tHistSvc
TH1I * m_h_SHfailure[FPGATrackSimTrackPars::NPARS]
static std::string parName(unsigned i)

◆ createMatrixTrees()

std::vector< TTree * > FPGATrackSimMatrixGenAlgo::createMatrixTrees ( )
private

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

Execute method.

Provides access to the EventContext if needed but is non-const as opposed to AthReentrantAlgorithm.

Implements AthAlgorithm.

Definition at line 204 of file FPGATrackSimMatrixGenAlgo.cxx.

205{
206 ATH_MSG_DEBUG("execute()");
207 m_eventHeader->clearHits();
208 m_eventHeader->reset();
209 // Get hits and training tracks from this event
210 ATH_CHECK(m_hitInputTool->readData(m_eventHeader, ctx));
211
212 std::vector<FPGATrackSimHit> hits = getLogicalHits();
213
214 std::vector<FPGATrackSimTruthTrack> truth_tracks = m_eventHeader->optional().getTruthTracks();
215 std::vector<FPGATrackSimTruthTrack> tracks = filterTrainingTracks(truth_tracks);
216 m_nTracks += truth_tracks.size();
217 if (tracks.empty()) {
218 ATH_MSG_DEBUG("Empty training tracks");
219 return StatusCode::SUCCESS;
220 }
221 // Prepare a map of the hits according the barcode
222 std::map<int, std::vector<FPGATrackSimHit>> barcode_hits = makeBarcodeMap(hits, tracks);
223 // For each training track, find the sector it belongs to and accumulate the
224 // hit coordinates and track parameters.
225 for (FPGATrackSimTruthTrack const & track : tracks) {
226
227 int nSlices = m_FPGATrackSimMapping->SubRegionMap()->getNRegions();
228
229 // Get list of hits associated to the current truth track
230 std::vector<FPGATrackSimHit> & sector_hits = barcode_hits[track.getBarcode()];
231
232 const FPGATrackSimPlaneMap *t_pmap = nullptr;
233
234 // Get the hits that will form the actual sector
235
236 for (int iSlice = 0; iSlice<nSlices; iSlice++){
237 t_pmap = m_FPGATrackSimMapping->PlaneMap_2nd(iSlice);
238
239 for (auto & iHit : sector_hits) {
240 t_pmap->map(iHit);
241 }
242
243 /* For now, don't do this. If we need regionalized/binned fit constants it needs to come from the road.
244 std::vector<FPGATrackSimHit> sector_hits;
245 bool success = filterSectorHits(track_hits, sector_hits, track, true, iSlice);
246 if (!success) continue; // Skip this track if it has bad hits (not complete, etc.)
247 */
248
249 m_h_trackQoP_okHits->Fill(track.getQOverPt());
250
251 // Get the region of this sector
252 // TODO: do we need this the pattern recognition should deal with it.
253 int region = 0; //sgetRegion(sector_hits, false);
254 //if (region < 0 || region >= m_nRegions) continue;
255 m_h_trackQoP_okRegion->Fill(track.getQOverPt());
256
257 //For the Hough constants, find the Hough roads
258 std::vector<FPGATrackSimRoad> houghRoads;
260
261 std::vector<std::shared_ptr<const FPGATrackSimHit>> phits;
262
263 ATH_MSG_DEBUG("Starting from some number of sector hits = " << sector_hits.size());
264 for (const FPGATrackSimHit& hit : sector_hits) if (hit.isMapped() && hit.isReal()) phits.emplace_back(std::make_shared<const FPGATrackSimHit>(hit));
265 ATH_MSG_DEBUG("Passing nhits = " << phits.size() << " to road finder");
266 StatusCode sc = m_roadFinderTool->getRoads(phits, houghRoads, truth_tracks);
267 if (sc.isFailure()) ATH_MSG_WARNING("Hough Transform -> getRoads() failed");
268
269 ATH_MSG_DEBUG("We found " << houghRoads.size() << " roads");
270
271 // We now want to just form the accumulator for any valid combination of hits
272 // In first stage mode we'll make the track fitter just generate combinations
273 std::vector<FPGATrackSimTrack> tracks_1st;
274 if (m_doSecondStage) {
275 ATH_CHECK(m_trackFitterTool_1st->getTracks(houghRoads, tracks_1st, m_EvtSel->getMin(), m_EvtSel->getMax()));
276 ATH_CHECK(m_overlapRemovalTool->runOverlapRemoval(tracks_1st));
277 } else {
278 roadsToTrack(houghRoads, tracks_1st, m_pmap_1st);
279 ATH_MSG_DEBUG("We found " << tracks_1st.size() << " combinations");
280 }
281 for (const auto& track_comb : tracks_1st) {
282 auto & track_hits_ptrs = track_comb.getFPGATrackSimHitPtrs();
283
284 if (m_doSecondStage) { // if doing 2nd stage, we want to get tracks from the road and then do tracking and overlap removal
285
286 // Prepare the accumulator struct
287 std::vector<module_t> modules(m_nLayers_2nd);
288 FPGATrackSimMatrixAccumulator acc(m_nLayers_2nd, m_nDim_2nd);
289 std::vector<std::shared_ptr<const FPGATrackSimHit>> phits_2nd;
290
291 // Pass all hits-- it's not possible to only select second stage hits here...
292 for (const auto& hit : sector_hits) {
293 phits_2nd.push_back(std::make_shared<const FPGATrackSimHit>(hit));
294 }
295
296 // Use the track extension tool to actually produce a new set of roads.
297 std::vector<FPGATrackSimRoad> roads_2nd;
298 ATH_CHECK(m_trackExtensionTool->extendTracks(phits_2nd, tracks_1st, roads_2nd));
299
300 // Now produce "track" candidates and loop over them.
301 std::vector<FPGATrackSimTrack> tracks_2nd;
302 roadsToTrack(roads_2nd, tracks_2nd, m_pmap_2nd);
303 for (const FPGATrackSimTrack& track_2nd : tracks_2nd) {
304 auto & track_hits_2nd_ptrs = track_2nd.getFPGATrackSimHitPtrs();
305 std::vector<module_t> modules(m_nLayers_2nd);
306 FPGATrackSimMatrixAccumulator acc(m_nLayers_2nd, m_nDim_2nd);
307 acc.pars.qOverPt = track_2nd.getHoughY();
308 acc.pars.phi = track_2nd.getHoughX();
309
310 std::pair<std::vector<module_t>, FPGATrackSimMatrixAccumulator> modules_acc = {modules, acc};
311 std::vector<std::shared_ptr<const FPGATrackSimHit>> phits;
312 ATH_CHECK(makeAccumulator(track_hits_2nd_ptrs, track, modules_acc));
313
314 // Add the track to the accumulate map
315 accumulate(m_sector_cum[region], modules_acc.first, modules_acc.second);
316
318 ATH_CHECK(fillAccumulatorByDropping(track_hits_2nd_ptrs, false, acc.pars.phi, acc.pars.qOverPt, modules, m_sector_cum[region], track, iSlice));
319
321 }
322 }
323 else {
324 // For each track combination (from a Hough road)
325 double y = track_comb.getHoughY();
326 double x = track_comb.getHoughX();
327 // Prepare the accumulator struct
328 std::vector<module_t> modules(m_nLayers_1st);
329 FPGATrackSimMatrixAccumulator acc(m_nLayers_1st, m_nDim_1st);
330 acc.pars.qOverPt = y;
331 acc.pars.phi = x;
332 std::pair<std::vector<module_t>, FPGATrackSimMatrixAccumulator> modules_acc = {modules, acc};
333 ATH_CHECK(makeAccumulator(track_hits_ptrs, track, modules_acc));
334
335 // Add the track to the accumulate map
336 accumulate(m_sector_cum[region], modules_acc.first, modules_acc.second);
337
339 ATH_CHECK(fillAccumulatorByDropping(track_hits_ptrs, true, acc.pars.phi, acc.pars.qOverPt, modules, m_sector_cum[region], track, iSlice));
340
342 }
343 }
344 }
345 else{
346 // Convert sector_hits to non-owning shared_ptr vector for the non-Hough-constants path
347 std::vector<std::shared_ptr<const FPGATrackSimHit>> sector_hits_ptrs;
348 sector_hits_ptrs.reserve(sector_hits.size());
349 // Single control block representing "the lifetime of sector_hits" (non-owning)
350 //this is ugly, but harmless: multiple smart pointers hold the resource, but one
351 //has a no-op deleter
352 //coverity[MULTIPLE_INIT_SMART_PTRS]
353 auto owner = std::shared_ptr<const std::vector<FPGATrackSimHit>>(
354 &sector_hits,
355 [](const std::vector<FPGATrackSimHit>*) {} // no-op deleter
356 );
357
358 for (const auto& hit : sector_hits) {
359 // Aliasing ctor: shares owner's control block, but points to this element
360 sector_hits_ptrs.emplace_back(owner, &hit);
361 }
362
363 // Prepare the accumulator struct
364 std::vector<module_t> modules(m_nLayers_1st);
365 FPGATrackSimMatrixAccumulator acc(m_nLayers_1st, m_nDim_1st);
366 std::pair<std::vector<module_t>, FPGATrackSimMatrixAccumulator> modules_acc = {modules, acc};
367 ATH_CHECK(makeAccumulator(sector_hits_ptrs, track, modules_acc));
368
369 // Add the track to the accumulate map
370 accumulate(m_sector_cum[region], modules_acc.first, modules_acc.second);
371
373 ATH_CHECK(fillAccumulatorByDropping(sector_hits_ptrs, true, acc.pars.phi, acc.pars.qOverPt, modules, m_sector_cum[region], track, iSlice));
374
376 }
377 }
378 }
379
380 return StatusCode::SUCCESS;
381}
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
void roadsToTrack(std::vector< FPGATrackSimRoad > &roads, std::vector< FPGATrackSimTrack > &track_cands, const FPGATrackSimPlaneMap *pmap)
bool accumulate(AccumulateMap &map, std::vector< module_t > const &modules, FPGATrackSimMatrixAccumulator const &acc)
Accumulates an accumulator (e.g.
static Double_t sc
#define y
#define x
std::map< int, std::vector< FPGATrackSimHit > > makeBarcodeMap(std::vector< FPGATrackSimHit > const &hits, std::vector< FPGATrackSimTruthTrack > const &tracks) const
const FPGATrackSimPlaneMap * m_pmap_2nd
std::vector< FPGATrackSimTruthTrack > filterTrainingTracks(std::vector< FPGATrackSimTruthTrack > const &truth_tracks) const
ToolHandle< FPGATrackSimRoadUnionTool > m_roadFinderTool
StatusCode makeAccumulator(std::vector< std::shared_ptr< const FPGATrackSimHit > > const &sector_hits, FPGATrackSimTruthTrack const &track, std::pair< std::vector< module_t >, FPGATrackSimMatrixAccumulator > &accumulator) const
ToolHandle< FPGATrackSimOverlapRemovalTool > m_overlapRemovalTool
StatusCode fillAccumulatorByDropping(std::vector< std::shared_ptr< const FPGATrackSimHit > > const &sector_hits, bool is1ststage, double x, double y, std::vector< module_t > &modules, AccumulateMap &map, FPGATrackSimTruthTrack const &track, int subregion) const
const FPGATrackSimPlaneMap * m_pmap_1st
std::vector< FPGATrackSimHit > getLogicalHits()
FPGATrackSimEventInputHeader * m_eventHeader
ToolHandle< FPGATrackSimTrackFitterTool > m_trackFitterTool_1st
std::vector< AccumulateMap > m_sector_cum
Gaudi::Property< bool > m_dropHitsAndFill
ToolHandle< IFPGATrackSimTrackExtensionTool > m_trackExtensionTool
ServiceHandle< IFPGATrackSimMappingSvc > m_FPGATrackSimMapping
Gaudi::Property< bool > m_doHoughConstants
ServiceHandle< IFPGATrackSimEventSelectionSvc > m_EvtSel
Gaudi::Property< bool > m_doSecondStage
ToolHandle< IFPGATrackSimInputTool > m_hitInputTool
void map(FPGATrackSimHit &hit) const
::StatusCode StatusCode
StatusCode definition for legacy code.

◆ 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 & AthAlgorithm::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 50 of file AthAlgorithm.cxx.

51{
52 // If we didn't find any symlinks to add, just return the collection
53 // from the base class. Otherwise, return the extended collection.
54 if (!m_extendedExtraObjects.empty()) {
56 }
57 return Algorithm::extraOutputDeps();
58}
DataObjIDColl m_extendedExtraObjects

◆ fillAccumulatorByDropping()

StatusCode FPGATrackSimMatrixGenAlgo::fillAccumulatorByDropping ( std::vector< std::shared_ptr< const FPGATrackSimHit > > const & sector_hits,
bool is1ststage,
double x,
double y,
std::vector< module_t > & modules,
AccumulateMap & map,
FPGATrackSimTruthTrack const & track,
int subregion ) const
private

Definition at line 706 of file FPGATrackSimMatrixGenAlgo.cxx.

707{
708
709 int nLayers = (is1ststage ? m_nLayers_1st : m_nLayers_2nd);
710 int nDim = (is1ststage ? m_nDim_1st : m_nDim_2nd);
711
712 int nwc = 0;
713 for (auto module : modules) {
714 if (module == -1) nwc++;
715 }
716 // Don't do this unless we miss at most one hit!
717 if (nwc < m_MaxWC) {
718 for (int layer = 0; layer < nLayers; layer++) {
719 // Create a modified pointer vector with a wildcard in this layer
720 std::vector<std::shared_ptr<const FPGATrackSimHit>> modified_hits = sector_hits;
721
722 // Create a new wildcard hit, and put it here.
723 ATH_MSG_DEBUG("Attempting to make wildcard in layer " << layer << ", is1ststage = " << is1ststage);
724 auto wcHit = std::make_shared<FPGATrackSimHit>();
725 wcHit->setHitType(HitType::wildcard);
726 wcHit->setLayer(layer);
727 if (is1ststage) wcHit->setDetType(m_FPGATrackSimMapping->PlaneMap_1st(subregion)->getDetType(layer));
728 else wcHit->setDetType(m_FPGATrackSimMapping->PlaneMap_2nd(subregion)->getDetType(layer));
729
730 modified_hits[layer] = std::move(wcHit);
731
732 // If this is a spacepoint, we must also convert the other hit.
733 std::shared_ptr<const FPGATrackSimHit> originalHit;
734 int other_layer = 0;
735 if (sector_hits[layer] && sector_hits[layer]->getHitType() == HitType::spacepoint) {
736 other_layer = (sector_hits[layer]->getPhysLayer() % 2 == 0) ? layer + 1 : layer - 1;
737 if(other_layer < 0)[[unlikely]]{
738 ATH_MSG_ERROR("FPGATrackSimMatrixGenAlgo::fillAccumulatorByDropping: layer index is negative.");
739 continue;
740 }
741 originalHit = std::make_shared<FPGATrackSimHit>(sector_hits[other_layer]->getOriginalHit());
742 modified_hits[other_layer] = std::move(originalHit);
743 }
744
745 FPGATrackSimMatrixAccumulator new_acc(nLayers, nDim);
746 new_acc.pars.qOverPt = y;
747 new_acc.pars.phi = x;
748 std::pair<std::vector<module_t>, FPGATrackSimMatrixAccumulator> new_modules_acc = {modules, new_acc};
749
750 auto sc = makeAccumulator(modified_hits, track, new_modules_acc);
751 if (sc != StatusCode::SUCCESS){
752 ATH_MSG_ERROR("FPGATrackSimMatrixGenAlgo::fillAccumulatorByDropping; makeAccumulator failed");
753 return StatusCode::FAILURE;
754 }
755 accumulate(map, new_modules_acc.first, new_modules_acc.second);
756 }
757 }
758 return StatusCode::SUCCESS;
759}
#define ATH_MSG_ERROR(x)
@ layer
Definition HitInfo.h:79
#define unlikely(x)

◆ fillMatrixTrees()

void FPGATrackSimMatrixGenAlgo::fillMatrixTrees ( std::vector< TTree * > const & matrixTrees)
private

◆ filterPassed() [1/2]

bool AthAlgorithm::filterPassed ( ) const
inherited

Definition at line 94 of file AthAlgorithm.cxx.

94 {
95 return filterPassed( Gaudi::Hive::currentContext() );
96}
bool filterPassed() const

◆ filterPassed() [2/2]

bool AthAlgorithm::filterPassed ( const EventContext & ctx) const
inherited

Definition at line 98 of file AthAlgorithm.cxx.

98 {
99 return execState( ctx ).filterPassed();
100}

◆ filterSectorHits()

bool FPGATrackSimMatrixGenAlgo::filterSectorHits ( std::vector< FPGATrackSimHit > const & all_hits,
std::vector< FPGATrackSimHit > & sector_hits,
FPGATrackSimTruthTrack const & t,
bool is1ststage,
int subregion ) const
private

Definition at line 589 of file FPGATrackSimMatrixGenAlgo.cxx.

591{
592 FPGATrackSimHit nohit;
594 int nLayers = (is1ststage ? m_nLayers_1st : m_nLayers_2nd);
595 const FPGATrackSimRegionMap *rmap = (is1ststage ? m_FPGATrackSimMapping->SubRegionMap() : m_FPGATrackSimMapping->SubRegionMap_2nd());
596 sector_hits.resize(nLayers, nohit);
597 std::vector<int> layer_count(nLayers); // count number of hits seen in each layer
598
599 for (FPGATrackSimHit const & hit : all_hits) {
600 if (!hit.isReal() || !hit.isMapped()) continue;
601
602 // Sanity check. make sure the hit is actually in the first stage?
603 // If the hit falls within the boundaries of ANY subregion in the first stage, it's 1st stage.
604 if (rmap->getRegions(hit).size() == 0) {
605 continue;
606 }
607 int layer = hit.getLayer();
608 if (layer_count[layer] == 0){
609 layer_count[layer]++;
610 sector_hits[layer] = hit;
611 }
612 else if (layer_count[layer] == 1) {
613 layer_count[layer]++;
614 // Already found a hit in this layer, so pick which hit to use
615 selectHit_returnCode selected_hit = selectHit(sector_hits[layer], hit, is1ststage, subregion);
616
617 if (selected_hit == selectHit_returnCode::SH_FAILURE) {
619 return false;
620 }
621 else if (selected_hit == selectHit_returnCode::SH_KEEP_NEW) sector_hits[layer] = hit;
622 }
623 else {
624 ATH_MSG_DEBUG("Too many hits on a plane, exiting filterHitsSec");
626 return false;
627 }
628 }
629 // Count number of wildcards, spacepoints, and pixel hits.
630 int nwc = 0;
631 int num_sp = 0;
632 int num_pixel = 0;
633
634 // Check we have the right number of hits.
635 for (int i = 0; i < nLayers; ++i)
636 {
637 if (layer_count[i] == 0)
638 {
639 ATH_MSG_DEBUG("Layer " << i << " has no hits");
640 nwc++;
641 }
642
643 // Now that we've decided which hit to use-- check their type.
644 if (sector_hits[i].getHitType() == HitType::spacepoint) {
645 num_sp += 1;
646 }
647 if (sector_hits[i].isPixel()) {
648 num_pixel += 1;
649 }
650 }
651 ATH_MSG_DEBUG("Found " << nwc << " wildcards compared to maximum: " << m_MaxWC);
652 // Divide by 2 due to spacepoint duplication.
653 num_sp /= 2;
654 ATH_MSG_DEBUG("Found " << num_sp << " spacepoints after removing duplicates.");
655 // Require we don't have too many wildcards.
656 if (nwc > m_MaxWC)
657 {
659 return false;
660 }
661 // Require that we have a certain number of "2D" hits (i.e. pixels and spacepoints)
662 // The effect of this is that we can ensure we have 4/5 2D hits but 7/9 hits total.
663 // NOTE Again, uncomment logic below for second stage running.
664 num_sp += num_pixel;
665 int minSpacePlusPixel = /*m_isSecondStage ? m_minSpacePlusPixel2 :*/ m_minSpacePlusPixel;
666 if (num_sp < minSpacePlusPixel) {
667 ATH_MSG_DEBUG("Not enough pixel hits + spacepoints (" << num_sp << " < " << minSpacePlusPixel << ")");
669 return false;
670 }
671 return true;
672}
void fillTrackPars(TH1I *const hists[FPGATrackSimTrackPars::NPARS], FPGATrackSimTruthTrack const &track)
void setHitType(HitType type)
Gaudi::Property< int > m_minSpacePlusPixel
selectHit_returnCode selectHit(FPGATrackSimHit const &old_hit, FPGATrackSimHit const &new_hit, bool is1ststage, int subregion) const

◆ filterTrainingTracks()

std::vector< FPGATrackSimTruthTrack > FPGATrackSimMatrixGenAlgo::filterTrainingTracks ( std::vector< FPGATrackSimTruthTrack > const & truth_tracks) const
private

Definition at line 425 of file FPGATrackSimMatrixGenAlgo.cxx.

426{
427 std::vector<FPGATrackSimTruthTrack> training_tracks;
428
429 for (FPGATrackSimTruthTrack const & track : truth_tracks) {
430 if (HepMC::generations(&track) >= 1 || std::abs(track.getPDGCode()) != m_TRAIN_PDG) continue;
431 if (std::abs(track.getD0()) > m_D0_THRESHOLD) continue;
432
433 // Actually use the event selection service here to kill anything outside the region.
434 if (!(m_EvtSel->passMatching(track))) continue;
435
436 double pt = TMath::Sqrt(track.getPX()*track.getPX() + track.getPY()*track.getPY());
437 double pt_GeV = pt / 1000;
438
439 // Add the track to the list of good tracks
440 if (pt_GeV > m_PT_THRESHOLD) training_tracks.push_back(track);
441
442 // Debug
443 if (msgLvl(MSG::DEBUG)) {
444 double c = track.getQ() /(2 * pt);
445 double eta = TMath::ASinH(track.getPZ() / pt);
446 double phi = TMath::ATan2(track.getPY(), track.getPX());
447 ATH_MSG_DEBUG("pt_GeV = "<< pt_GeV
448 << " c = " << c
449 << " eta = " << eta
450 << " phi = " << phi
451 << " pdgcode = " << track.getPDGCode());
452 }
454 }
455
456 return training_tracks;
457}
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
bool msgLvl(const MSG::Level lvl) const
Gaudi::Property< float > m_PT_THRESHOLD
Gaudi::Property< float > m_D0_THRESHOLD
int generations(const T &p)
Method to return how many interactions a particle has undergone during simulation (TODO migrate to be...

◆ finalize()

StatusCode FPGATrackSimMatrixGenAlgo::finalize ( )
override

Definition at line 931 of file FPGATrackSimMatrixGenAlgo.cxx.

932{
933 ATH_MSG_DEBUG("finalize()");
934 ATH_MSG_INFO("Tracks used: " << m_nTracksUsed << "/" << m_nTracks);
935 int nLayers = (m_doSecondStage ? m_nLayers_2nd : m_nLayers_1st);
936 int nDim = (m_doSecondStage ? m_nDim_2nd : m_nDim_1st);
937
938 for (int region = 0; region < m_nRegions; region++) {
939 // Create the tree
940 std::stringstream name;
941 std::stringstream title;
942 name << "am" << region;
943 title << "Ambank " << region << " parameters";
944 TTree* tree = new TTree(name.str().c_str(), title.str().c_str());
945 ATH_CHECK(m_tHistSvc->regTree(Form("/TRIGFPGATrackSimMATRIXOUT/%s",tree->GetName()), tree));
946
947 // Fill the tree
948 ::fillTree(m_sector_cum[region], tree, nLayers, nDim);
949 // Monitoring
950 ATH_MSG_INFO("Sectors found in region " << region << ": " << m_sector_cum[region].size());
951 for (auto & sector_info : m_sector_cum[region]) {
952 double coverage = sector_info.second.track_bins.size();
953 m_h_nHit->Fill(coverage);
954 for (unsigned i = 0; i < FPGATrackSimTrackPars::NPARS; i++)
955 m_h_sectorPars[i]->Fill(sector_info.second.pars[i] / coverage);
956 }
957 }
958
960 ATH_CHECK(m_tHistSvc->finalize());
961 return StatusCode::SUCCESS;
962}
#define ATH_MSG_INFO(x)
void fillTree(AccumulateMap &map, TTree *tree, int nLayers, int nCoords)
Writes the contents of an AccumulateMap into the supplied tree (one entry per sector).
size_t size() const
Number of registered mappings.
TChain * tree

◆ getContext()

const EventContext & AthAlgorithm::getContext ( ) const
inherited

Deprecated methods (use the ones with EventContext).

Definition at line 90 of file AthAlgorithm.cxx.

90 {
91 return Gaudi::Hive::currentContext();
92}

◆ getLogicalHits()

std::vector< FPGATrackSimHit > FPGATrackSimMatrixGenAlgo::getLogicalHits ( )
private

Definition at line 386 of file FPGATrackSimMatrixGenAlgo.cxx.

387{
388 std::vector<FPGATrackSimHit> hits;
389 //Setup the logical header...
390 FPGATrackSimLogicalEventInputHeader logicalHeader;
391 //Map the hits to the logical header...
392 unsigned stage = 0;
393 if (m_doHoughConstants) stage = 1; // For now Hough constants only works on 1st stage
394 else stage = 2;
395 StatusCode sc = m_hitMapTool->convert(stage, *m_eventHeader, logicalHeader);
396 if (sc.isFailure()) ATH_MSG_ERROR("Hit mapping failed");
397
398 // Since the clustering tool modifies the logical towers-- refactored this
399 // to only access the output hits from the towers.
400 if (m_doClustering) {
401 std::vector<FPGATrackSimCluster> clustered_hits;
402 sc = m_clusteringTool->DoClustering(logicalHeader, clustered_hits);
403 if (sc.isFailure()) ATH_MSG_ERROR("Clustering failed");
404 }
405 // Optionally do spacepoints (as well).
406 if (m_doSpacePoints) {
407 std::vector<FPGATrackSimCluster> spacepoints;
408 sc = m_spacePointsTool->DoSpacePoints(logicalHeader, spacepoints);
409 if (sc.isFailure()) ATH_MSG_ERROR("Spacepoints failed");
410 }
411
412 // It should now be safe to pull the towers, regardless.
413 std::vector<FPGATrackSimTowerInputHeader> towers = logicalHeader.towers();
414 for (auto &tower : towers) {
415 std::vector<FPGATrackSimHit> const & towerHits = tower.hits();
416 for (FPGATrackSimHit const & hit : towerHits) {
417 hits.push_back(hit);
418 }
419 }
420 return hits;
421}
const std::vector< FPGATrackSimTowerInputHeader > & towers() const
ToolHandle< FPGATrackSimRawToLogicalHitsTool > m_hitMapTool
Gaudi::Property< bool > m_doSpacePoints
ToolHandle< FPGATrackSimClusteringToolI > m_clusteringTool
Gaudi::Property< bool > m_doClustering
ToolHandle< FPGATrackSimSpacePointsToolI > m_spacePointsTool

◆ getRegion()

int FPGATrackSimMatrixGenAlgo::getRegion ( std::vector< FPGATrackSimHit > const & hits,
bool is1ststage ) const
private

Definition at line 676 of file FPGATrackSimMatrixGenAlgo.cxx.

677{
678 // Start with a bitmask, all true, and set a region to false if any mismatch is found
679 std::vector<bool> region_mask(m_nRegions, true);
680
681 for (FPGATrackSimHit const & hit : hits) {
682 if (hit.isReal()) { // don't worry about hits that are WCs
683 for (int region = 0; region < m_nRegions; region++) {
684 if (m_doHoughConstants && is1ststage) {
685 if (!m_FPGATrackSimMapping->RegionMap_1st()->isInRegion(region, hit))
686 region_mask[region] = false;
687 }
688 else {
689 if (!m_FPGATrackSimMapping->RegionMap_2nd()->isInRegion(region, hit))
690 region_mask[region] = false;
691 }
692 }
693 }
694 }
695
696 // For now just give preference to lowest region index for simplicity
697 for (int region = 0; region < m_nRegions; region++) {
698 if (region_mask[region])
699 return region;
700 }
701
702 return -1;
703}

◆ initialize()

StatusCode FPGATrackSimMatrixGenAlgo::initialize ( )
override

Definition at line 48 of file FPGATrackSimMatrixGenAlgo.cxx.

49{
50 ATH_MSG_DEBUG("initialize()");
51
52 // set the slicing variables from inputs
53 m_sliceMax.qOverPt = m_temp_c_max;
58
59 m_sliceMin.qOverPt = m_temp_c_min;
64
65 m_nBins.qOverPt = m_temp_c_slices;
70
71 // Retrieve handles
72 ATH_CHECK(m_tHistSvc.retrieve());
74 ATH_CHECK(m_hitInputTool.retrieve());
75 ATH_CHECK(m_hitMapTool.retrieve());
76 ATH_CHECK(m_EvtSel.retrieve());
77 ATH_CHECK(m_roadFinderTool.retrieve());
80 ATH_CHECK(m_trackExtensionTool.retrieve(EnableTool{m_doHoughConstants && m_doSecondStage}));
81 ATH_CHECK(m_trackFitterTool_1st.retrieve(EnableTool{m_doHoughConstants && m_doSecondStage}));
82 ATH_CHECK(m_overlapRemovalTool.retrieve(EnableTool{m_doHoughConstants && m_doSecondStage}));
83
84
85
87 if (m_ideal_geom == 0) {
88 ATH_MSG_INFO("Hough constants method needs idealized geometry > 0, aborting.");
89 return StatusCode::FAILURE;
90 }
91 m_nRegions = m_FPGATrackSimMapping->RegionMap_1st()->getNRegions();
92 m_pmap_2nd = m_FPGATrackSimMapping->PlaneMap_2nd(0);
93 m_pmap_1st = m_FPGATrackSimMapping->PlaneMap_1st(0);
94 // Get detector configurations
95 m_nLayers_1st = m_FPGATrackSimMapping->PlaneMap_1st(0)->getNLogiLayers();
96 m_nDim_1st = m_FPGATrackSimMapping->PlaneMap_1st(0)->getNCoords();
97 m_nLayers_2nd = m_FPGATrackSimMapping->PlaneMap_2nd(0)->getNLogiLayers();
98 m_nDim_2nd = m_FPGATrackSimMapping->PlaneMap_2nd(0)->getNCoords();
99 }
100 else {
101 // Get detector configurations
102 m_nLayers_1st = m_FPGATrackSimMapping->PlaneMap_2nd(0)->getNLogiLayers();
103 m_nRegions = m_FPGATrackSimMapping->RegionMap_2nd()->getNRegions();
104 m_nDim_1st = m_FPGATrackSimMapping->PlaneMap_2nd(0)->getNCoords();
105 }
106
107 m_sector_cum.resize(m_nRegions);
108
109 // Retrieve slice information
110 m_sliceMin = m_EvtSel->getMin();
111 m_sliceMax = m_EvtSel->getMax();
112
113 // Check q/pt binning information
114 if (m_qOverPtBins.size() == 0) {
115 ATH_MSG_ERROR("q/pt bin information not set in matrix element job options!");
116 return StatusCode::FAILURE;
117 }
118
119
120 // Histograms
122
123 m_eventHeader = new FPGATrackSimEventInputHeader();
124
125 return StatusCode::SUCCESS;
126}
Gaudi::Property< float > m_temp_c_max
Gaudi::Property< float > m_temp_d0_max
Gaudi::Property< std::vector< double > > m_qOverPtBins
Gaudi::Property< float > m_temp_phi_max
Gaudi::Property< int > m_temp_z0_slices
Gaudi::Property< int > m_temp_d0_slices
Gaudi::Property< int > m_temp_eta_slices
Gaudi::Property< int > m_temp_phi_slices
Gaudi::Property< float > m_temp_c_min
Gaudi::Property< float > m_temp_z0_max
Gaudi::Property< float > m_temp_eta_min
Gaudi::Property< float > m_temp_phi_min
Gaudi::Property< float > m_temp_z0_min
Gaudi::Property< float > m_temp_d0_min
Gaudi::Property< int > m_temp_c_slices
Gaudi::Property< float > m_temp_eta_max

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

◆ isReEntrant()

virtual bool AthAlgorithm::isReEntrant ( ) const
inlinefinaloverrideprotectedvirtualinherited

Legacy algorithms are not thread-safe.

Definition at line 111 of file AthAlgorithm.h.

111{ return false; }

◆ makeAccumulator()

StatusCode FPGATrackSimMatrixGenAlgo::makeAccumulator ( std::vector< std::shared_ptr< const FPGATrackSimHit > > const & sector_hits,
FPGATrackSimTruthTrack const & track,
std::pair< std::vector< module_t >, FPGATrackSimMatrixAccumulator > & accumulator ) const
private

Definition at line 763 of file FPGATrackSimMatrixGenAlgo.cxx.

764{
765
766
767 const FPGATrackSimPlaneMap *pmap = (m_doSecondStage ? m_pmap_2nd : m_pmap_1st);
768 int nLayers = (m_doSecondStage ? m_nLayers_2nd : m_nLayers_1st);
769 int nDim = (m_doSecondStage ? m_nDim_2nd : m_nDim_1st);
770 std::vector<module_t> modules(nLayers);
771 FPGATrackSimMatrixAccumulator acc(nLayers, nDim);
772
773 //find the bin!
774 // NOTE: this only implements q/pt binning, not the subregion / eta pattern-based constants for now.
775 int sectorbin = 0;
776 double qoverpt = track.getQ() / track.getPt();
777
778 // for 2nd stage we only use one q/pt bin
779 if (m_absQOverPtBinning || m_doSecondStage) qoverpt = abs(qoverpt);
780 if (!m_doSecondStage) {
781 for (unsigned bin = 0; bin < m_qOverPtBins.size()-1; bin++) {
783 if (qoverpt < m_qOverPtBins[bin+1]) break;
784 }
785 }
786
787 // Create sector definitions (list of modules)
788 std::string module_printout = "";
789 for (int i = 0; i < nLayers; i++)
790 {
791 if (sector_hits[i] && sector_hits[i]->isReal()) {
792 if (m_single) modules[i] = sector_hits[i]->getIdentifierHash();
793 else {
794 modules[i] = sectorbin;
795 // Modify sectorbin by a "type" field, which for now means: 0 = not spacepoint, 1 = spacepoint.
796 // This will fail if we have more than 99 q/pt bins!
797 if (sector_hits[i]->getHitType() == HitType::spacepoint) {
799 }
800 module_printout += std::to_string(modules[i]) + ", ";
801 }
802 }
803 else {
804 modules[i] = -1; // WC
805 }
806 }
807
808 ATH_MSG_DEBUG("Generating track in sectorbin = " << sectorbin << " with modules: " << module_printout);
809
810
811 if (m_single) {
812 const int ToKeep[13] = {2200,2564,2861,3831,5368,14169,14173,20442,20446,29625,29629,42176,42180};
813 bool keepThis = true;
814 for (int i = 0; i < 13; i++) {
815 if (modules[i] != ToKeep[i] && modules[i] != -1) {
816 keepThis = false;
817 }
818 }
819
820 if (!keepThis) {
821 for (int i = 0; i < 13; i++) modules[i] = -1;
822 }
823 else {
824 for (int i = 0; i < 13; i++) {
825 }
826 }
827 }
828
829
830 // Hough Constants parameters
831 double y = accumulator.second.pars.qOverPt;
832 double x = accumulator.second.pars.phi;
833
834 // Vectorize (flatten) coordinates
835 std::vector<float> coords;
836
837 for (int i = 0; i < nLayers; ++i) {
838
839 if (sector_hits[i] && sector_hits[i]->isReal()) {
840 double target_r = (m_doSecondStage ? m_FPGATrackSimMapping->RegionMap_2nd()->getAvgRadius(0, i) : m_FPGATrackSimMapping->RegionMap_1st()->getAvgRadius(0, i));
841 // If this is a spacepoint the target R should be the average of the two layers.
842 // TODO, get this to be loaded in from a mean radii file into the mapping infrastructure.
843 if (sector_hits[i]->getHitType() == HitType::spacepoint) {
844 int other_layer = (sector_hits[i]->getSide() == 0) ? i + 1 : i - 1;
845 target_r = (m_doSecondStage ?
846 (target_r + m_FPGATrackSimMapping->RegionMap_2nd()->getAvgRadius(0, other_layer))/2. :
847 (target_r + m_FPGATrackSimMapping->RegionMap_1st()->getAvgRadius(0, other_layer))/2.);
848 }
849
850 std::vector<float> coords_tmp;
851 if ( m_ideal_geom > 1 ) {
852 coords_tmp = computeIdealCoords(*sector_hits[i], x, y, target_r, m_doDeltaPhiConsts, TrackCorrType::Second);
853 }
854 else {
855 coords_tmp = computeIdealCoords(*sector_hits[i], x, y, target_r, m_doDeltaPhiConsts, TrackCorrType::None);
856 }
857
858 // Create phi for any hits that are not spacepoints, as well as "inner" spacepoints.
859 // but not outer spacepoints. this avoids duplicate coordinates.
860 if (sector_hits[i]->getHitType() != HitType::spacepoint || sector_hits[i]->getSide() == 0) {
861 // get idealized gPhi
862 coords.push_back(coords_tmp[1]);
863 }
864
865 // Create a z coordinate for the "outer" layer of the spacepoint and for 2D pixel hits.
866 // This means that a spacepoint will write out (phi, eta) pairs, but (0, phi) or (phi, 0) if it's missing.
867 if (sector_hits[i]->getDim() == 2 || (sector_hits[i]->getHitType() == HitType::spacepoint && (sector_hits[i]->getPhysLayer() % 2) == 1)) {
868 // get idealized z
869 coords.push_back(coords_tmp[0]);
870 }
871 }
872 else {
873 if (pmap->getDim(i) == 2) {
874 coords.push_back(0);
875 }
876 coords.push_back(0);
877 }
878 }
879
880 assert(coords.size() == (size_t)nDim);
881 acc.hit_coords = coords;
882 acc.hit_coordsG = coords;
883
884 // Get the track parameters
885 acc.pars = track.getPars();
887 acc.pars.qOverPt = (y / 1000.0) - track.getQOverPt(); // fit for delta q/pT
888 acc.pars.phi = x - track.getPhi(); // fit for delta phi_0
889 }
890
891 FPGATrackSimTrackParsI bins;
892 for (unsigned i = 0; i < FPGATrackSimTrackPars::NPARS; i++)
893 bins[i] = (acc.pars[i] - m_sliceMin[i]) * m_nBins[i] / (m_sliceMax[i] - m_sliceMin[i]);
894 acc.track_bins.push_back(bins);
895
896 // Force phi to be in [0, 2pi] (post binning)
897 if (!m_doDeltaPhiConsts) {
898 while (acc.pars.phi < 0) acc.pars.phi += 2*M_PI;
899 while (acc.pars.phi > 2*M_PI) acc.pars.phi -= 2*M_PI;
900 }
901
902 // Calculate the pre-multiplied elements
903 for (int i = 0; i < nDim; i++)
904 {
905 acc.hit_x_QoP[i] = coords[i] * acc.pars.qOverPt;
906 acc.hit_xG_HIP[i] = coords[i] * acc.pars.qOverPt;
907 acc.hit_x_d0[i] = coords[i] * acc.pars.d0;
908 acc.hit_x_z0[i] = coords[i] * acc.pars.z0;
909 acc.hit_x_eta[i] = coords[i] * acc.pars.eta;
910 acc.hit_xG_eta[i] = coords[i] * acc.pars.eta;
911 acc.hit_x_phi[i] = coords[i] * acc.pars.phi;
912
913 for (int j = i; j < nDim; j++)
914 acc.covariance[i * nDim + j] = coords[i] * coords[j];
915
916 for (int j = i; j < nDim; j++)
917 acc.covarianceG[i * nDim + j] = coords[i] * coords[j];
918 }
919
920 accumulator = {modules, acc};
921 return StatusCode::SUCCESS;
922}
#define M_PI
std::vector< float > computeIdealCoords(const FPGATrackSimHit &hit, const double hough_x, const double hough_y, const double target_r, const bool doDeltaGPhis, const TrackCorrType trackCorrType)
static const std::vector< std::string > bins
Gaudi::Property< bool > m_doDeltaPhiConsts
Gaudi::Property< bool > m_absQOverPtBinning
uint32_t getDim(size_t logiLayer) const
float j(const xAOD::IParticle &, const xAOD::TrackMeasurementValidation &hit, const Eigen::Matrix3d &jab_inv)
constexpr int QPT_SECTOR_OFFSET
constexpr int SPACEPOINT_SECTOR_OFFSET

◆ makeBarcodeMap()

std::map< int, std::vector< FPGATrackSimHit > > FPGATrackSimMatrixGenAlgo::makeBarcodeMap ( std::vector< FPGATrackSimHit > const & hits,
std::vector< FPGATrackSimTruthTrack > const & tracks ) const
private

Definition at line 461 of file FPGATrackSimMatrixGenAlgo.cxx.

462{
463 std::map<int, std::vector<FPGATrackSimHit>> map;
464
465 // Ready the barcodes
466 for (const FPGATrackSimTruthTrack & track : tracks)
467 map[track.getBarcode()] = std::vector<FPGATrackSimHit>();
468
469 // Add the hits
470 for (const FPGATrackSimHit & hit : hits) {
471 // Get the predominant barcode for the current hit
472 int barcode = hit.getTruth().best_barcode();
473
474 // Add hit to the list; skip the hits if not associated to a good truth tracks
475 auto it = map.find(barcode);
476 if (it != map.end()) (*it).second.push_back(hit);
477 }
478
479 return map;
480}
const std::string barcode

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

◆ selectHit()

FPGATrackSimMatrixGenAlgo::selectHit_returnCode FPGATrackSimMatrixGenAlgo::selectHit ( FPGATrackSimHit const & old_hit,
FPGATrackSimHit const & new_hit,
bool is1ststage,
int subregion ) const
private

Definition at line 495 of file FPGATrackSimMatrixGenAlgo.cxx.

496{
497 if (old_hit.isReal() && !new_hit.isReal()) return selectHit_returnCode::SH_KEEP_OLD;
498 if (!old_hit.isReal() && new_hit.isReal()) return selectHit_returnCode::SH_KEEP_NEW;
499 if (!old_hit.isReal() && !new_hit.isReal()) return selectHit_returnCode::SH_FAILURE;
500 if ((new_hit.getSection() == old_hit.getSection()) && (new_hit.getLayer() == old_hit.getLayer())
501 && (new_hit.getEtaModule() == old_hit.getEtaModule()) && (new_hit.getPhiModule() == old_hit.getPhiModule())) {
502 ATH_MSG_DEBUG("Two hits on same module");
504 }
505 // Always prefer spacepoints, regardless of all other considerations.
506 // This is necessary in part due to spacepoint duplication.
507 if (old_hit.getHitType() == HitType::spacepoint && new_hit.getHitType() != HitType::spacepoint) {
509 } else if (old_hit.getHitType() != HitType::spacepoint && new_hit.getHitType() == HitType::spacepoint) {
511 }
512 int new_section = new_hit.getSection();
513 int old_section = old_hit.getSection();
514
515 if (old_section == new_section) {
516 if (old_hit.getEtaModule() == new_hit.getEtaModule()) {
517 int rmax = 0;
518 if (m_doHoughConstants && is1ststage) {
519 int phi_max = m_FPGATrackSimMapping->SubRegionMap()->getRegionBoundaries(subregion, new_hit.getLayer(), new_section).phi_max;
520 int phi_min = m_FPGATrackSimMapping->SubRegionMap()->getRegionBoundaries(subregion, new_hit.getLayer(), new_section).phi_min;
521 rmax = phi_max - phi_min;
522
523 }
524 else {
525 int phi_max = m_FPGATrackSimMapping->SubRegionMap_2nd()->getRegionBoundaries(subregion, new_hit.getLayer(), new_section).phi_max;
526 int phi_min = m_FPGATrackSimMapping->SubRegionMap_2nd()->getRegionBoundaries(subregion, new_hit.getLayer(), new_section).phi_min;
527 rmax = phi_max - phi_min;
528 }
529
530 int phi_diff = old_hit.getPhiModule() - new_hit.getPhiModule();
531
532 if (phi_diff == 1 || phi_diff == -rmax) return selectHit_returnCode::SH_KEEP_OLD;
533 else if (phi_diff == -1 || phi_diff == rmax) return selectHit_returnCode::SH_KEEP_NEW;
534 else {
535 ATH_MSG_DEBUG("Hits are too far away in phi");
537 }
538 }
539 else { // Different eta is no good
540 ATH_MSG_DEBUG("Hits are in different eta");
542 }
543 }
544 else { // sections are different
545 int layer = old_hit.getLayer();
546 bool old_isEC = 0;
547 bool new_isEC = 0;
548 int old_disk = 0;
549 int new_disk = 0;
550 if (m_doHoughConstants && is1ststage) {
551 old_isEC = m_FPGATrackSimMapping->PlaneMap_1st(subregion)->isEC(layer, old_section);
552 new_isEC = m_FPGATrackSimMapping->PlaneMap_1st(subregion)->isEC(layer, new_section);
553 old_disk = m_FPGATrackSimMapping->PlaneMap_1st(subregion)->getLayerInfo(layer, old_section).physDisk;
554 new_disk = m_FPGATrackSimMapping->PlaneMap_1st(subregion)->getLayerInfo(layer, new_section).physDisk;
555 }
556 else {
557 old_isEC = m_FPGATrackSimMapping->PlaneMap_2nd(subregion)->isEC(layer, old_section);
558 new_isEC = m_FPGATrackSimMapping->PlaneMap_2nd(subregion)->isEC(layer, new_section);
559 old_disk = m_FPGATrackSimMapping->PlaneMap_2nd(subregion)->getLayerInfo(layer, old_section).physDisk;
560 new_disk = m_FPGATrackSimMapping->PlaneMap_2nd(subregion)->getLayerInfo(layer, new_section).physDisk;
561 }
562 // If one is barrel and one endcap, it's definitely OK, take the barrel hit
563 if (old_isEC != new_isEC) {
564
565 if (old_isEC) return selectHit_returnCode::SH_KEEP_NEW;
567 }
568 // Two endcap hits : same disk: discard
569 else if (old_disk == new_disk) {
570
571 ATH_MSG_DEBUG("Two modules hit in same physical disk " << old_disk);
573 }
574 // Two endcap hits on same side: different disks: take the lower-z
575 else {
576 ATH_MSG_DEBUG("Keeping the lower-z of the two disks (" << old_disk << ", " << new_disk << ") hit");
577 if (old_disk > new_disk) return selectHit_returnCode::SH_KEEP_NEW;
579 }
580 }
581}

◆ setFilterPassed() [1/2]

void AthAlgorithm::setFilterPassed ( bool state) const
inherited

Definition at line 102 of file AthAlgorithm.cxx.

102 {
103 setFilterPassed( state, Gaudi::Hive::currentContext() );
104}
void setFilterPassed(bool state) const

◆ setFilterPassed() [2/2]

void AthAlgorithm::setFilterPassed ( bool state,
const EventContext & ctx ) const
inherited

Definition at line 106 of file AthAlgorithm.cxx.

106 {
107 execState( ctx ).setFilterPassed(state);
108}

◆ sysInitialize()

StatusCode AthAlgorithm::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 AthAnalysisAlgorithm, AthFilterAlgorithm, AthHistogramAlgorithm, and PyAthena::Alg.

Definition at line 66 of file AthAlgorithm.cxx.

66 {
68
69 if (sc.isFailure()) {
70 return sc;
71 }
72 ServiceHandle<ICondSvc> cs("CondSvc",name());
73 for (auto h : outputHandles()) {
74 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
75 // do this inside the loop so we don't create the CondSvc until needed
76 if ( cs.retrieve().isFailure() ) {
77 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
78 return StatusCode::SUCCESS;
79 }
80 if (cs->regHandle(this,*h).isFailure()) {
81 sc = StatusCode::FAILURE;
82 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
83 << " with CondSvc");
84 }
85 }
86 }
87 return sc;
88}
virtual StatusCode sysInitialize() override
Override sysInitialize.
AthCommonDataStore(const std::string &name, T... args)
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 }

◆ writeSliceTree()

void FPGATrackSimMatrixGenAlgo::writeSliceTree ( )
private

Definition at line 965 of file FPGATrackSimMatrixGenAlgo.cxx.

966{
967 TTree* sliceTree = new TTree("slice", "Region slice boundaries"); // slice
968
969 sliceTree->Branch("c_max", &m_sliceMax.qOverPt);
970 sliceTree->Branch("d0_max", &m_sliceMax.d0);
971 sliceTree->Branch("phi_max", &m_sliceMax.phi);
972 sliceTree->Branch("z0_max", &m_sliceMax.z0);
973 sliceTree->Branch("eta_max", &m_sliceMax.eta);
974
975 sliceTree->Branch("c_min", &m_sliceMin.qOverPt);
976 sliceTree->Branch("d0_min", &m_sliceMin.d0);
977 sliceTree->Branch("phi_min", &m_sliceMin.phi);
978 sliceTree->Branch("z0_min", &m_sliceMin.z0);
979 sliceTree->Branch("eta_min", &m_sliceMin.eta);
980
981 sliceTree->Branch("c_slices", &m_nBins.qOverPt);
982 sliceTree->Branch("d0_slices", &m_nBins.d0);
983 sliceTree->Branch("phi_slices", &m_nBins.phi);
984 sliceTree->Branch("z0_slices", &m_nBins.z0);
985 sliceTree->Branch("eta_slices", &m_nBins.eta);
986
987 StatusCode sc = m_tHistSvc->regTree("/TRIGFPGATrackSimMATRIXOUT/slice",sliceTree);
988 if (sc.isFailure()) ATH_MSG_ERROR("tHist failed");
989
990 sliceTree->Fill();
991}

Member Data Documentation

◆ m_absQOverPtBinning

Gaudi::Property<bool> FPGATrackSimMatrixGenAlgo::m_absQOverPtBinning {this, "qptAbsBinning", false, "This property controls whether or not to interpret the bins as q/pt or |q/pt|"}
private

Definition at line 125 of file FPGATrackSimMatrixGenAlgo.h.

125{this, "qptAbsBinning", false, "This property controls whether or not to interpret the bins as q/pt or |q/pt|"};

◆ m_clusteringTool

ToolHandle<FPGATrackSimClusteringToolI> FPGATrackSimMatrixGenAlgo::m_clusteringTool { this, "FPGATrackSimClusteringFTKTool", "FPGATrackSimClusteringFTKTool/FPGATrackSimClusteringFTKTool", "FPGATrackSimClusteringFTKTool" }
private

Definition at line 81 of file FPGATrackSimMatrixGenAlgo.h.

81{ this, "FPGATrackSimClusteringFTKTool", "FPGATrackSimClusteringFTKTool/FPGATrackSimClusteringFTKTool", "FPGATrackSimClusteringFTKTool" };

◆ m_D0_THRESHOLD

Gaudi::Property<float> FPGATrackSimMatrixGenAlgo::m_D0_THRESHOLD {this, "D0_THRESHOLD", 1., "Max d0"}
private

Definition at line 108 of file FPGATrackSimMatrixGenAlgo.h.

108{this, "D0_THRESHOLD", 1., "Max d0"};

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

Gaudi::Property<bool> FPGATrackSimMatrixGenAlgo::m_doClustering {this, "Clustering", true, "Do cluster?"}
private

Definition at line 98 of file FPGATrackSimMatrixGenAlgo.h.

98{this, "Clustering", true, "Do cluster?"};

◆ m_doDeltaPhiConsts

Gaudi::Property<bool> FPGATrackSimMatrixGenAlgo::m_doDeltaPhiConsts {this, "DeltaPhiConstants", false, "If true will generate delta phi constants"}
private

Definition at line 104 of file FPGATrackSimMatrixGenAlgo.h.

104{this, "DeltaPhiConstants", false, "If true will generate delta phi constants"};

◆ m_doHoughConstants

Gaudi::Property<bool> FPGATrackSimMatrixGenAlgo::m_doHoughConstants {this, "HoughConstants", true, "If true will run Hough Transform to set q/pt and phi0"}
private

Definition at line 103 of file FPGATrackSimMatrixGenAlgo.h.

103{this, "HoughConstants", true, "If true will run Hough Transform to set q/pt and phi0"};

◆ m_doSecondStage

Gaudi::Property<bool> FPGATrackSimMatrixGenAlgo::m_doSecondStage {this, "SecondStage", false, "Run second stage?"}
private

Definition at line 99 of file FPGATrackSimMatrixGenAlgo.h.

99{this, "SecondStage", false, "Run second stage?"};

◆ m_doSpacePoints

Gaudi::Property<bool> FPGATrackSimMatrixGenAlgo::m_doSpacePoints {this, "SpacePoints", true, "Do spacepoints?"}
private

Definition at line 100 of file FPGATrackSimMatrixGenAlgo.h.

100{this, "SpacePoints", true, "Do spacepoints?"};

◆ m_dropHitsAndFill

Gaudi::Property<bool> FPGATrackSimMatrixGenAlgo::m_dropHitsAndFill {this, "dropHitsAndFill", false, "If true, we can drop hits to fill the accumulator"}
private

Definition at line 127 of file FPGATrackSimMatrixGenAlgo.h.

127{this, "dropHitsAndFill", false, "If true, we can drop hits to fill the accumulator"};

◆ m_eventHeader

FPGATrackSimEventInputHeader* FPGATrackSimMatrixGenAlgo::m_eventHeader = nullptr
private

Definition at line 140 of file FPGATrackSimMatrixGenAlgo.h.

◆ m_EvtSel

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

Definition at line 76 of file FPGATrackSimMatrixGenAlgo.h.

76{this,"FPGATrackSimEventSelectionSvc",""};

◆ 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 AthAlgorithm::m_extendedExtraObjects
privateinherited

Definition at line 114 of file AthAlgorithm.h.

◆ m_FPGATrackSimMapping

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

Definition at line 75 of file FPGATrackSimMatrixGenAlgo.h.

75{this,"FPGATrackSimMappingSvc","FPGATrackSimMappingSvc"};

◆ m_h_3hitsInLayer

TH1I* FPGATrackSimMatrixGenAlgo::m_h_3hitsInLayer[FPGATrackSimTrackPars::NPARS] {}
private

Definition at line 174 of file FPGATrackSimMatrixGenAlgo.h.

174{};

◆ m_h_nHit

TH1I* FPGATrackSimMatrixGenAlgo::m_h_nHit = nullptr
private

Definition at line 179 of file FPGATrackSimMatrixGenAlgo.h.

◆ m_h_notEnoughHits

TH1I* FPGATrackSimMatrixGenAlgo::m_h_notEnoughHits[FPGATrackSimTrackPars::NPARS] {}
private

Definition at line 175 of file FPGATrackSimMatrixGenAlgo.h.

175{};

◆ m_h_sectorPars

TH1I* FPGATrackSimMatrixGenAlgo::m_h_sectorPars[FPGATrackSimTrackPars::NPARS] {}
private

Definition at line 172 of file FPGATrackSimMatrixGenAlgo.h.

172{};

◆ m_h_SHfailure

TH1I* FPGATrackSimMatrixGenAlgo::m_h_SHfailure[FPGATrackSimTrackPars::NPARS] {}
private

Definition at line 173 of file FPGATrackSimMatrixGenAlgo.h.

173{};

◆ m_h_trackQoP_okHits

TH1I* FPGATrackSimMatrixGenAlgo::m_h_trackQoP_okHits = nullptr
private

Definition at line 177 of file FPGATrackSimMatrixGenAlgo.h.

◆ m_h_trackQoP_okRegion

TH1I* FPGATrackSimMatrixGenAlgo::m_h_trackQoP_okRegion = nullptr
private

Definition at line 178 of file FPGATrackSimMatrixGenAlgo.h.

◆ m_h_trainingTrack

TH1I* FPGATrackSimMatrixGenAlgo::m_h_trainingTrack[FPGATrackSimTrackPars::NPARS] {}
private

Definition at line 171 of file FPGATrackSimMatrixGenAlgo.h.

171{};

◆ m_hitInputTool

ToolHandle<IFPGATrackSimInputTool> FPGATrackSimMatrixGenAlgo::m_hitInputTool {this, "FPGATrackSimSGToRawHitsTool", "FPGATrackSimSGToRawHitsTool/FPGATrackSimSGToRawHits", "input handler"}
private

Definition at line 79 of file FPGATrackSimMatrixGenAlgo.h.

79{this, "FPGATrackSimSGToRawHitsTool", "FPGATrackSimSGToRawHitsTool/FPGATrackSimSGToRawHits", "input handler"};

◆ m_hitMapTool

ToolHandle<FPGATrackSimRawToLogicalHitsTool> FPGATrackSimMatrixGenAlgo::m_hitMapTool {this, "FPGATrackSimRawToLogicalHitsTool", "FPGATrackSimRawToLogicalHitsTool/FPGATrackSim_RawToLogicalHitsTool", "FPGATrackSim_RawToLogicalHitsTool"}
private

Definition at line 80 of file FPGATrackSimMatrixGenAlgo.h.

80{this, "FPGATrackSimRawToLogicalHitsTool", "FPGATrackSimRawToLogicalHitsTool/FPGATrackSim_RawToLogicalHitsTool", "FPGATrackSim_RawToLogicalHitsTool"};

◆ m_ideal_geom

Gaudi::Property<int> FPGATrackSimMatrixGenAlgo::m_ideal_geom {this, "IdealiseGeometry", 0, "Ideal geo flag, 0 is non, 1 is 1st order, 2 is 2nd order"}
private

Definition at line 101 of file FPGATrackSimMatrixGenAlgo.h.

101{this, "IdealiseGeometry", 0, "Ideal geo flag, 0 is non, 1 is 1st order, 2 is 2nd order"};

◆ m_MaxWC

Gaudi::Property<int> FPGATrackSimMatrixGenAlgo::m_MaxWC {this, "WCmax", 0, "Max number of WCs"}
private

Definition at line 105 of file FPGATrackSimMatrixGenAlgo.h.

105{this, "WCmax", 0, "Max number of WCs"};

◆ m_minSpacePlusPixel

Gaudi::Property<int> FPGATrackSimMatrixGenAlgo::m_minSpacePlusPixel {this, "minSpacePlusPixel", 4, "Require that tracks in training have a certain number of pixel hits + spacepoints" }
private

Definition at line 106 of file FPGATrackSimMatrixGenAlgo.h.

106{this, "minSpacePlusPixel", 4, "Require that tracks in training have a certain number of pixel hits + spacepoints" };

◆ m_nBins

FPGATrackSimTrackParsI FPGATrackSimMatrixGenAlgo::m_nBins
private

Definition at line 138 of file FPGATrackSimMatrixGenAlgo.h.

◆ m_nDim_1st

int FPGATrackSimMatrixGenAlgo::m_nDim_1st = 0
private

Definition at line 130 of file FPGATrackSimMatrixGenAlgo.h.

◆ m_nDim_2nd

int FPGATrackSimMatrixGenAlgo::m_nDim_2nd = 0
private

Definition at line 133 of file FPGATrackSimMatrixGenAlgo.h.

◆ m_nLayers_1st

int FPGATrackSimMatrixGenAlgo::m_nLayers_1st = 0
private

Definition at line 129 of file FPGATrackSimMatrixGenAlgo.h.

◆ m_nLayers_2nd

int FPGATrackSimMatrixGenAlgo::m_nLayers_2nd = 0
private

Definition at line 132 of file FPGATrackSimMatrixGenAlgo.h.

◆ m_nRegions

Gaudi::Property<int> FPGATrackSimMatrixGenAlgo::m_nRegions {this, "NBanks", 0, "Number of banks to make"}
private

Definition at line 97 of file FPGATrackSimMatrixGenAlgo.h.

97{this, "NBanks", 0, "Number of banks to make"};

◆ m_nTracks

size_t FPGATrackSimMatrixGenAlgo::m_nTracks = 0
private

Definition at line 145 of file FPGATrackSimMatrixGenAlgo.h.

◆ m_nTracksUsed

size_t FPGATrackSimMatrixGenAlgo::m_nTracksUsed = 0
private

Definition at line 146 of file FPGATrackSimMatrixGenAlgo.h.

◆ m_overlapRemovalTool

ToolHandle<FPGATrackSimOverlapRemovalTool> FPGATrackSimMatrixGenAlgo::m_overlapRemovalTool {this, "OverlapRemoval_1st", "FPGATrackSimOverlapRemovalTool/FPGATrackSimOverlapRemovalTool_1st", "1st stage overlap removal tool"}
private

Definition at line 88 of file FPGATrackSimMatrixGenAlgo.h.

88{this, "OverlapRemoval_1st", "FPGATrackSimOverlapRemovalTool/FPGATrackSimOverlapRemovalTool_1st", "1st stage overlap removal tool"};

◆ m_pmap

const FPGATrackSimPlaneMap* FPGATrackSimMatrixGenAlgo::m_pmap = nullptr
private

Definition at line 83 of file FPGATrackSimMatrixGenAlgo.h.

◆ m_pmap_1st

const FPGATrackSimPlaneMap* FPGATrackSimMatrixGenAlgo::m_pmap_1st = nullptr
private

Definition at line 91 of file FPGATrackSimMatrixGenAlgo.h.

◆ m_pmap_2nd

const FPGATrackSimPlaneMap* FPGATrackSimMatrixGenAlgo::m_pmap_2nd = nullptr
private

Definition at line 92 of file FPGATrackSimMatrixGenAlgo.h.

◆ m_PT_THRESHOLD

Gaudi::Property<float> FPGATrackSimMatrixGenAlgo::m_PT_THRESHOLD {this, "PT_THRESHOLD", 0., "Min pt"}
private

Definition at line 107 of file FPGATrackSimMatrixGenAlgo.h.

107{this, "PT_THRESHOLD", 0., "Min pt"};

◆ m_qOverPtBins

Gaudi::Property<std::vector<double> > FPGATrackSimMatrixGenAlgo::m_qOverPtBins {this, "sectorQPtBins", {}, "q/pt bins for sector definition"}
private

Definition at line 126 of file FPGATrackSimMatrixGenAlgo.h.

126{this, "sectorQPtBins", {}, "q/pt bins for sector definition"};

◆ m_roadFinderTool

ToolHandle<FPGATrackSimRoadUnionTool> FPGATrackSimMatrixGenAlgo::m_roadFinderTool {this, "RoadFinder", "RoadFinder"}
private

Definition at line 84 of file FPGATrackSimMatrixGenAlgo.h.

84{this, "RoadFinder", "RoadFinder"};

◆ m_sector_cum

std::vector<AccumulateMap> FPGATrackSimMatrixGenAlgo::m_sector_cum
private

Definition at line 70 of file FPGATrackSimMatrixGenAlgo.h.

◆ m_single

Gaudi::Property<bool> FPGATrackSimMatrixGenAlgo::m_single {this, "SingleSector", false, "Run single sector"}
private

Definition at line 102 of file FPGATrackSimMatrixGenAlgo.h.

102{this, "SingleSector", false, "Run single sector"};

◆ m_sliceMax

FPGATrackSimTrackPars FPGATrackSimMatrixGenAlgo::m_sliceMax = 0
private

Definition at line 137 of file FPGATrackSimMatrixGenAlgo.h.

◆ m_sliceMin

FPGATrackSimTrackPars FPGATrackSimMatrixGenAlgo::m_sliceMin = 0
private

Definition at line 136 of file FPGATrackSimMatrixGenAlgo.h.

◆ m_spacePointsTool

ToolHandle<FPGATrackSimSpacePointsToolI> FPGATrackSimMatrixGenAlgo::m_spacePointsTool { this, "SpacePointTool", "FPGATrackSimSpacePointsTool/FPGATrackSimSpacePointsTool", "FPGATrackSimSpacePointsTool" }
private

Definition at line 82 of file FPGATrackSimMatrixGenAlgo.h.

82{ this, "SpacePointTool", "FPGATrackSimSpacePointsTool/FPGATrackSimSpacePointsTool", "FPGATrackSimSpacePointsTool" };

◆ m_temp_c_max

Gaudi::Property<float> FPGATrackSimMatrixGenAlgo::m_temp_c_max {this, "par_c_max", 1, "Max curvature"}
private

Definition at line 111 of file FPGATrackSimMatrixGenAlgo.h.

111{this, "par_c_max", 1, "Max curvature"};

◆ m_temp_c_min

Gaudi::Property<float> FPGATrackSimMatrixGenAlgo::m_temp_c_min {this, "par_c_min", -1, "Min curvature"}
private

Definition at line 110 of file FPGATrackSimMatrixGenAlgo.h.

110{this, "par_c_min", -1, "Min curvature"};

◆ m_temp_c_slices

Gaudi::Property<int> FPGATrackSimMatrixGenAlgo::m_temp_c_slices {this, "par_c_slices", 100, "Number of c slides"}
private

Definition at line 120 of file FPGATrackSimMatrixGenAlgo.h.

120{this, "par_c_slices", 100, "Number of c slides"};

◆ m_temp_d0_max

Gaudi::Property<float> FPGATrackSimMatrixGenAlgo::m_temp_d0_max {this, "par_d0_max", 2, "Max d0"}
private

Definition at line 115 of file FPGATrackSimMatrixGenAlgo.h.

115{this, "par_d0_max", 2, "Max d0"};

◆ m_temp_d0_min

Gaudi::Property<float> FPGATrackSimMatrixGenAlgo::m_temp_d0_min {this, "par_d0_min", -2, "Min d0"}
private

Definition at line 114 of file FPGATrackSimMatrixGenAlgo.h.

114{this, "par_d0_min", -2, "Min d0"};

◆ m_temp_d0_slices

Gaudi::Property<int> FPGATrackSimMatrixGenAlgo::m_temp_d0_slices {this, "par_d0_slices", 100, "Number of d0 slices"}
private

Definition at line 122 of file FPGATrackSimMatrixGenAlgo.h.

122{this, "par_d0_slices", 100, "Number of d0 slices"};

◆ m_temp_eta_max

Gaudi::Property<float> FPGATrackSimMatrixGenAlgo::m_temp_eta_max {this, "par_eta_max", 5, "Max eta"}
private

Definition at line 119 of file FPGATrackSimMatrixGenAlgo.h.

119{this, "par_eta_max", 5, "Max eta"};

◆ m_temp_eta_min

Gaudi::Property<float> FPGATrackSimMatrixGenAlgo::m_temp_eta_min {this, "par_eta_min", -5, "Min eta"}
private

Definition at line 118 of file FPGATrackSimMatrixGenAlgo.h.

118{this, "par_eta_min", -5, "Min eta"};

◆ m_temp_eta_slices

Gaudi::Property<int> FPGATrackSimMatrixGenAlgo::m_temp_eta_slices {this, "par_eta_slices", 100, "Number of eta slices"}
private

Definition at line 124 of file FPGATrackSimMatrixGenAlgo.h.

124{this, "par_eta_slices", 100, "Number of eta slices"};

◆ m_temp_phi_max

Gaudi::Property<float> FPGATrackSimMatrixGenAlgo::m_temp_phi_max {this, "par_phi_max", TMath::Pi(), "Max phi"}
private

Definition at line 113 of file FPGATrackSimMatrixGenAlgo.h.

113{this, "par_phi_max", TMath::Pi(), "Max phi"};

◆ m_temp_phi_min

Gaudi::Property<float> FPGATrackSimMatrixGenAlgo::m_temp_phi_min {this, "par_phi_min", -TMath::Pi(), "Min phi"}
private

Definition at line 112 of file FPGATrackSimMatrixGenAlgo.h.

112{this, "par_phi_min", -TMath::Pi(), "Min phi"};

◆ m_temp_phi_slices

Gaudi::Property<int> FPGATrackSimMatrixGenAlgo::m_temp_phi_slices {this, "par_phi_slices", 100, "Number of phi slices"}
private

Definition at line 121 of file FPGATrackSimMatrixGenAlgo.h.

121{this, "par_phi_slices", 100, "Number of phi slices"};

◆ m_temp_z0_max

Gaudi::Property<float> FPGATrackSimMatrixGenAlgo::m_temp_z0_max {this, "par_z0_max", 200, "Max z0"}
private

Definition at line 117 of file FPGATrackSimMatrixGenAlgo.h.

117{this, "par_z0_max", 200, "Max z0"};

◆ m_temp_z0_min

Gaudi::Property<float> FPGATrackSimMatrixGenAlgo::m_temp_z0_min {this, "par_z0_min", -200, "Min z0"}
private

Definition at line 116 of file FPGATrackSimMatrixGenAlgo.h.

116{this, "par_z0_min", -200, "Min z0"};

◆ m_temp_z0_slices

Gaudi::Property<int> FPGATrackSimMatrixGenAlgo::m_temp_z0_slices {this, "par_z0_slices", 100, "Number of z0 slices"}
private

Definition at line 123 of file FPGATrackSimMatrixGenAlgo.h.

123{this, "par_z0_slices", 100, "Number of z0 slices"};

◆ m_tHistSvc

ServiceHandle<ITHistSvc> FPGATrackSimMatrixGenAlgo::m_tHistSvc {this,"THistSvc","THistSvc"}
private

Definition at line 77 of file FPGATrackSimMatrixGenAlgo.h.

77{this,"THistSvc","THistSvc"};

◆ m_trackExtensionTool

ToolHandle<IFPGATrackSimTrackExtensionTool> FPGATrackSimMatrixGenAlgo::m_trackExtensionTool {this, "TrackExtensionTool", "FPGATrackSimTrackExtensionTool", "Track extensoin tool"}
private

Definition at line 87 of file FPGATrackSimMatrixGenAlgo.h.

87{this, "TrackExtensionTool", "FPGATrackSimTrackExtensionTool", "Track extensoin tool"};

◆ m_trackFitterTool_1st

ToolHandle<FPGATrackSimTrackFitterTool> FPGATrackSimMatrixGenAlgo::m_trackFitterTool_1st {this, "TrackFitter_1st", "FPGATrackSimTrackFitterTool/FPGATrackSimTrackFitterTool_1st", "1st stage track fit tool"}
private

Definition at line 85 of file FPGATrackSimMatrixGenAlgo.h.

85{this, "TrackFitter_1st", "FPGATrackSimTrackFitterTool/FPGATrackSimTrackFitterTool_1st", "1st stage track fit tool"};

◆ m_TRAIN_PDG

Gaudi::Property<int> FPGATrackSimMatrixGenAlgo::m_TRAIN_PDG {this, "TRAIN_PDG", 0, "PDG of particles to train on"}
private

Definition at line 109 of file FPGATrackSimMatrixGenAlgo.h.

109{this, "TRAIN_PDG", 0, "PDG of particles to train on"};

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