 |
ATLAS Offline Software
|
#include <FPGATrackSimMatrixGenAlgo.h>
|
| FPGATrackSimMatrixGenAlgo (const std::string &name, ISvcLocator *pSvcLocator) |
|
virtual | ~FPGATrackSimMatrixGenAlgo ()=default |
|
StatusCode | initialize () override |
|
StatusCode | execute () override |
|
StatusCode | finalize () override |
|
virtual StatusCode | sysInitialize () override |
| Override sysInitialize. More...
|
|
virtual const DataObjIDColl & | extraOutputDeps () const override |
| Return the list of extra output dependencies. More...
|
|
ServiceHandle< StoreGateSvc > & | evtStore () |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | evtStore () const |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | detStore () const |
| The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
virtual StatusCode | sysStart () override |
| Handle START transition. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
| Return this algorithm's input handles. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
| Return this algorithm's output handles. More...
|
|
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T, V, H > &t) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc="none") |
| Declare a new Gaudi property. More...
|
|
void | updateVHKA (Gaudi::Details::PropertyBase &) |
|
MsgStream & | msg () const |
|
MsgStream & | msg (const MSG::Level lvl) const |
|
bool | msgLvl (const MSG::Level lvl) const |
|
|
StatusCode | bookHistograms () |
|
std::vector< FPGATrackSimHit > | getLogicalHits () |
|
std::vector< FPGATrackSimTruthTrack > | filterTrainingTracks (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 > §or_hits, FPGATrackSimTruthTrack const &t, bool is1ststage, int subregion) const |
|
int | getRegion (std::vector< FPGATrackSimHit > const &hits, bool is1ststage) const |
|
StatusCode | makeAccumulator (std::vector< FPGATrackSimHit > const §or_hits, FPGATrackSimTruthTrack const &track, std::pair< std::vector< module_t >, FPGATrackSimMatrixAccumulator > &accumulator) const |
|
StatusCode | fillAccumulatorByDropping (std::vector< FPGATrackSimHit > §or_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> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyArrayType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleType &) |
| specialization for handling Gaudi::Property<SG::VarHandleBase> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &t, const SG::NotHandleType &) |
| specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
|
|
|
std::vector< AccumulateMap > | m_sector_cum |
|
ServiceHandle< IFPGATrackSimMappingSvc > | m_FPGATrackSimMapping {this,"FPGATrackSimMappingSvc","FPGATrackSimMappingSvc"} |
|
ServiceHandle< IFPGATrackSimEventSelectionSvc > | m_EvtSel {this,"FPGATrackSimEventSelectionSvc",""} |
|
ServiceHandle< ITHistSvc > | m_tHistSvc {this,"THistSvc","THistSvc"} |
|
ToolHandle< IFPGATrackSimInputTool > | m_hitInputTool {this, "FPGATrackSimSGToRawHitsTool", "FPGATrackSimSGToRawHitsTool/FPGATrackSimSGToRawHits", "input handler"} |
|
ToolHandle< FPGATrackSimRawToLogicalHitsTool > | m_hitMapTool {this, "FPGATrackSimRawToLogicalHitsTool", "FPGATrackSimRawToLogicalHitsTool/FPGATrackSim_RawToLogicalHitsTool", "FPGATrackSim_RawToLogicalHitsTool"} |
|
ToolHandle< FPGATrackSimClusteringToolI > | m_clusteringTool { this, "FPGATrackSimClusteringFTKTool", "FPGATrackSimClusteringFTKTool/FPGATrackSimClusteringFTKTool", "FPGATrackSimClusteringFTKTool" } |
|
ToolHandle< FPGATrackSimSpacePointsToolI > | m_spacePointsTool { this, "SpacePointTool", "FPGATrackSimSpacePointsTool/FPGATrackSimSpacePointsTool", "FPGATrackSimSpacePointsTool" } |
|
const FPGATrackSimPlaneMap * | m_pmap = nullptr |
|
ToolHandle< FPGATrackSimRoadUnionTool > | m_roadFinderTool {this, "RoadFinder", "RoadFinder"} |
|
ToolHandle< FPGATrackSimTrackFitterTool > | m_trackFitterTool_1st {this, "TrackFitter_1st", "FPGATrackSimTrackFitterTool/FPGATrackSimTrackFitterTool_1st", "1st stage track fit tool"} |
|
ToolHandle< IFPGATrackSimTrackExtensionTool > | m_trackExtensionTool {this, "TrackExtensionTool", "FPGATrackSimTrackExtensionTool", "Track extensoin tool"} |
|
ToolHandle< FPGATrackSimOverlapRemovalTool > | m_overlapRemovalTool {this, "OverlapRemoval_1st", "FPGATrackSimOverlapRemovalTool/FPGATrackSimOverlapRemovalTool_1st", "1st stage overlap removal tool"} |
|
const FPGATrackSimPlaneMap * | m_pmap_1st = nullptr |
|
const FPGATrackSimPlaneMap * | m_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 |
|
FPGATrackSimEventInputHeader * | m_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) More...
|
|
StoreGateSvc_t | m_detStore |
| Pointer to StoreGate (detector store by default) More...
|
|
std::vector< SG::VarHandleKeyArray * > | m_vhka |
|
bool | m_varHandleArraysDeclared |
|
Definition at line 54 of file FPGATrackSimMatrixGenAlgo.h.
◆ StoreGateSvc_t
◆ 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 };
◆ FPGATrackSimMatrixGenAlgo()
FPGATrackSimMatrixGenAlgo::FPGATrackSimMatrixGenAlgo |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
pSvcLocator |
|
) |
| |
◆ ~FPGATrackSimMatrixGenAlgo()
virtual FPGATrackSimMatrixGenAlgo::~FPGATrackSimMatrixGenAlgo |
( |
| ) |
|
|
virtualdefault |
◆ bookHistograms()
StatusCode FPGATrackSimMatrixGenAlgo::bookHistograms |
( |
| ) |
|
|
private |
◆ createMatrixTrees()
std::vector<TTree*> FPGATrackSimMatrixGenAlgo::createMatrixTrees |
( |
| ) |
|
|
private |
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleBase
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 245 of file AthCommonDataStore.h.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey
. It just forwards to the base class version of declareProperty
.
Definition at line 333 of file AthCommonDataStore.h.
338 return PBASE::declareProperty(
name, property,
doc);
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This dispatches to either the generic declareProperty
or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
◆ declareProperty() [6/6]
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ execute()
StatusCode FPGATrackSimMatrixGenAlgo::execute |
( |
| ) |
|
|
override |
Definition at line 204 of file FPGATrackSimMatrixGenAlgo.cxx.
217 if (tracks.empty()) {
219 return StatusCode::SUCCESS;
222 std::map<int, std::vector<FPGATrackSimHit>> barcode_hits =
makeBarcodeMap(
hits, tracks);
230 std::vector<FPGATrackSimHit> & sector_hits = barcode_hits[
track.getBarcode()];
236 for (
int iSlice = 0; iSlice<nSlices; iSlice++){
239 for (
auto & iHit : sector_hits) {
258 std::vector<std::shared_ptr<const FPGATrackSimRoad>> houghRoads;
261 std::vector<std::shared_ptr<const FPGATrackSimHit>> phits;
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");
273 std::vector<FPGATrackSimTrack> tracks_1st;
279 ATH_MSG_DEBUG(
"We found " << tracks_1st.size() <<
" combinations");
281 for (
const auto& track_comb : tracks_1st) {
282 std::vector<FPGATrackSimHit> track_hits = track_comb.getFPGATrackSimHits();
289 std::vector<std::shared_ptr<const FPGATrackSimHit>> phits_2nd;
292 for (
const auto& hit : sector_hits) {
293 phits_2nd.push_back(std::make_shared<const FPGATrackSimHit>(hit));
297 std::vector<std::shared_ptr<const FPGATrackSimRoad>> roads_2nd;
298 std::vector<std::shared_ptr<const FPGATrackSimTrack>> ptracks_1st;
299 ptracks_1st.reserve(tracks_1st.size());
300 for (
const auto&
track : tracks_1st) {
301 ptracks_1st.push_back(std::make_shared<const FPGATrackSimTrack>(
track));
306 std::vector<FPGATrackSimTrack> tracks_2nd;
309 std::vector<FPGATrackSimHit> track_hits_2nd = track_2nd.getFPGATrackSimHits();
312 acc.pars.qOverPt = track_2nd.getHoughY();
313 acc.pars.phi = track_2nd.getHoughX();
316 std::vector<std::shared_ptr<const FPGATrackSimHit>> phits;
330 double y = track_comb.getHoughY();
331 double x = track_comb.getHoughX();
335 acc.pars.qOverPt =
y;
368 return StatusCode::SUCCESS;
◆ extraDeps_update_handler()
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.
57 return Algorithm::extraOutputDeps();
◆ fillAccumulatorByDropping()
Definition at line 694 of file FPGATrackSimMatrixGenAlgo.cxx.
701 for (
auto module : modules) {
711 ATH_MSG_DEBUG(
"Attempting to make wildcard in layer " <<
layer <<
", is1ststage = " << is1ststage);
718 sector_hits[
layer] = *wcHit;
722 unsigned other_layer = 0;
725 other_backup = sector_hits[other_layer];
730 new_acc.pars.qOverPt =
y;
731 new_acc.pars.phi =
x;
735 if (
sc != StatusCode::SUCCESS){
737 ATH_MSG_ERROR(
"FPGATrackSimMatrixGenAlgo::fillAccumulatorByDropping; makeAccumulator failed");
738 return StatusCode::FAILURE;
740 accumulate(map, new_modules_acc.first, new_modules_acc.second);
743 sector_hits[
layer] = backup_hit;
748 sector_hits[other_layer] = other_backup;
752 return StatusCode::SUCCESS;
◆ fillMatrixTrees()
void FPGATrackSimMatrixGenAlgo::fillMatrixTrees |
( |
std::vector< TTree * > const & |
matrixTrees | ) |
|
|
private |
◆ filterSectorHits()
Definition at line 577 of file FPGATrackSimMatrixGenAlgo.cxx.
584 sector_hits.resize(nLayers, nohit);
585 std::vector<int> layer_count(nLayers);
588 if (!hit.isReal() || !hit.isMapped())
continue;
592 if (
rmap->getRegions(hit).size() == 0) {
595 int layer = hit.getLayer();
596 if (layer_count[
layer] == 0){
597 layer_count[
layer]++;
598 sector_hits[
layer] = hit;
600 else if (layer_count[
layer] == 1) {
601 layer_count[
layer]++;
612 ATH_MSG_DEBUG(
"Too many hits on a plane, exiting filterHitsSec");
623 for (
int i = 0;
i < nLayers; ++
i)
625 if (layer_count[
i] == 0)
635 if (sector_hits[
i].isPixel()) {
642 ATH_MSG_DEBUG(
"Found " << num_sp <<
" spacepoints after removing duplicates.");
654 if (num_sp < minSpacePlusPixel) {
655 ATH_MSG_DEBUG(
"Not enough pixel hits + spacepoints (" << num_sp <<
" < " << minSpacePlusPixel <<
")");
◆ filterTrainingTracks()
Definition at line 413 of file FPGATrackSimMatrixGenAlgo.cxx.
415 std::vector<FPGATrackSimTruthTrack> training_tracks;
425 double pt_GeV =
pt / 1000;
433 double eta = TMath::ASinH(
track.getPZ() /
pt);
439 <<
" pdgcode = " <<
track.getPDGCode());
444 return training_tracks;
◆ finalize()
StatusCode FPGATrackSimMatrixGenAlgo::finalize |
( |
| ) |
|
|
override |
Definition at line 925 of file FPGATrackSimMatrixGenAlgo.cxx.
932 for (
int region = 0; region <
m_nRegions; region++) {
934 std::stringstream
name;
935 std::stringstream
title;
936 name <<
"am" << region;
937 title <<
"Ambank " << region <<
" parameters";
938 TTree*
tree =
new TTree(
name.str().c_str(),
title.str().c_str());
946 double coverage = sector_info.second.track_bins.size();
955 return StatusCode::SUCCESS;
◆ getLogicalHits()
std::vector< FPGATrackSimHit > FPGATrackSimMatrixGenAlgo::getLogicalHits |
( |
| ) |
|
|
private |
Definition at line 374 of file FPGATrackSimMatrixGenAlgo.cxx.
376 std::vector<FPGATrackSimHit>
hits;
389 std::vector<FPGATrackSimCluster> clustered_hits;
395 std::vector<FPGATrackSimCluster> spacepoints;
401 std::vector<FPGATrackSimTowerInputHeader>
towers = logicalHeader.
towers();
402 for (
auto &tower :
towers) {
403 std::vector<FPGATrackSimHit>
const & towerHits = tower.hits();
◆ getRegion()
int FPGATrackSimMatrixGenAlgo::getRegion |
( |
std::vector< FPGATrackSimHit > const & |
hits, |
|
|
bool |
is1ststage |
|
) |
| const |
|
private |
Definition at line 664 of file FPGATrackSimMatrixGenAlgo.cxx.
667 std::vector<bool> region_mask(
m_nRegions,
true);
671 for (
int region = 0; region <
m_nRegions; region++) {
674 region_mask[region] =
false;
678 region_mask[region] =
false;
685 for (
int region = 0; region <
m_nRegions; region++) {
686 if (region_mask[region])
◆ initialize()
StatusCode FPGATrackSimMatrixGenAlgo::initialize |
( |
| ) |
|
|
override |
Definition at line 48 of file FPGATrackSimMatrixGenAlgo.cxx.
88 ATH_MSG_INFO(
"Hough constants method needs idealized geometry > 0, aborting.");
89 return StatusCode::FAILURE;
115 ATH_MSG_ERROR(
"q/pt bin information not set in matrix element job options!");
116 return StatusCode::FAILURE;
125 return StatusCode::SUCCESS;
◆ inputHandles()
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.
◆ makeAccumulator()
Definition at line 757 of file FPGATrackSimMatrixGenAlgo.cxx.
764 std::vector<module_t> modules(nLayers);
770 double qoverpt =
track.getQ() /
track.getPt();
782 std::string module_printout =
"";
783 for (
int i = 0;
i < nLayers;
i++)
785 if (sector_hits[
i].isReal()) {
786 if (
m_single) modules[
i] = sector_hits[
i].getIdentifierHash();
788 modules[
i] = sectorbin;
802 ATH_MSG_DEBUG(
"Generating track in sectorbin = " << sectorbin <<
" with modules: " << module_printout);
806 const int ToKeep[13] = {2200,2564,2861,3831,5368,14169,14173,20442,20446,29625,29629,42176,42180};
807 bool keepThis =
true;
808 for (
int i = 0;
i < 13;
i++) {
809 if (modules[
i] != ToKeep[
i] && modules[
i] != -1) {
815 for (
int i = 0;
i < 13;
i++) modules[
i] = -1;
818 for (
int i = 0;
i < 13;
i++) {
825 double y = accumulator.second.pars.qOverPt;
826 double x = accumulator.second.pars.phi;
829 std::vector<float> coords;
831 for (
int i = 0;
i < nLayers; ++
i) {
833 if (sector_hits[
i].isReal()) {
838 int other_layer = (sector_hits[
i].getSide() == 0) ?
i + 1 :
i - 1;
844 std::vector<float> coords_tmp;
856 coords.push_back(coords_tmp[1]);
861 if (sector_hits[
i].getDim() == 2 || (sector_hits[
i].getHitType() ==
HitType::spacepoint && (sector_hits[
i].getPhysLayer() % 2) == 1)) {
863 coords.push_back(coords_tmp[0]);
874 assert(coords.size() == (
size_t)nDim);
875 acc.hit_coords = coords;
876 acc.hit_coordsG = coords;
881 acc.pars.qOverPt = (
y / 1000.0) -
track.getQOverPt();
888 acc.track_bins.push_back(
bins);
892 while (
acc.pars.phi < 0)
acc.pars.phi += 2*
M_PI;
897 for (
int i = 0;
i < nDim;
i++)
899 acc.hit_x_QoP[
i] = coords[
i] *
acc.pars.qOverPt;
900 acc.hit_xG_HIP[
i] = coords[
i] *
acc.pars.qOverPt;
901 acc.hit_x_d0[
i] = coords[
i] *
acc.pars.d0;
902 acc.hit_x_z0[
i] = coords[
i] *
acc.pars.z0;
903 acc.hit_x_eta[
i] = coords[
i] *
acc.pars.eta;
904 acc.hit_xG_eta[
i] = coords[
i] *
acc.pars.eta;
905 acc.hit_x_phi[
i] = coords[
i] *
acc.pars.phi;
907 for (
int j =
i; j < nDim; j++)
908 acc.covariance[
i * nDim + j] = coords[
i] * coords[j];
910 for (
int j =
i; j < nDim; j++)
911 acc.covarianceG[
i * nDim + j] = coords[
i] * coords[j];
914 accumulator = {modules,
acc};
915 return StatusCode::SUCCESS;
◆ makeBarcodeMap()
Definition at line 449 of file FPGATrackSimMatrixGenAlgo.cxx.
451 std::map<int, std::vector<FPGATrackSimHit>> map;
455 map[
track.getBarcode()] = std::vector<FPGATrackSimHit>();
460 int barcode = hit.getTruth().best_barcode();
464 if (
it != map.end()) (*it).second.push_back(hit);
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ outputHandles()
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()
◆ renounceArray()
◆ selectHit()
Definition at line 483 of file FPGATrackSimMatrixGenAlgo.cxx.
488 if ((new_hit.getSection() == old_hit.getSection()) && (new_hit.getLayer() == old_hit.getLayer())
489 && (new_hit.getEtaModule() == old_hit.getEtaModule()) && (new_hit.getPhiModule() == old_hit.getPhiModule())) {
500 int new_section = new_hit.getSection();
501 int old_section = old_hit.getSection();
503 if (old_section == new_section) {
504 if (old_hit.getEtaModule() == new_hit.getEtaModule()) {
507 int phi_max =
m_FPGATrackSimMapping->SubRegionMap()->getRegionBoundaries(subregion, new_hit.getLayer(), new_section).phi_max;
508 int phi_min =
m_FPGATrackSimMapping->SubRegionMap()->getRegionBoundaries(subregion, new_hit.getLayer(), new_section).phi_min;
509 rmax = phi_max - phi_min;
513 int phi_max =
m_FPGATrackSimMapping->SubRegionMap_2nd()->getRegionBoundaries(subregion, new_hit.getLayer(), new_section).phi_max;
514 int phi_min =
m_FPGATrackSimMapping->SubRegionMap_2nd()->getRegionBoundaries(subregion, new_hit.getLayer(), new_section).phi_min;
515 rmax = phi_max - phi_min;
518 int phi_diff = old_hit.getPhiModule() - new_hit.getPhiModule();
533 int layer = old_hit.getLayer();
551 if (old_isEC != new_isEC) {
557 else if (old_disk == new_disk) {
559 ATH_MSG_DEBUG(
"Two modules hit in same physical disk " << old_disk);
564 ATH_MSG_DEBUG(
"Keeping the lower-z of the two disks (" << old_disk <<
", " << new_disk <<
") hit");
◆ sysInitialize()
StatusCode AthAlgorithm::sysInitialize |
( |
| ) |
|
|
overridevirtualinherited |
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
◆ writeSliceTree()
void FPGATrackSimMatrixGenAlgo::writeSliceTree |
( |
| ) |
|
|
private |
◆ 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 |
◆ m_clusteringTool
ToolHandle<FPGATrackSimClusteringToolI> FPGATrackSimMatrixGenAlgo::m_clusteringTool { this, "FPGATrackSimClusteringFTKTool", "FPGATrackSimClusteringFTKTool/FPGATrackSimClusteringFTKTool", "FPGATrackSimClusteringFTKTool" } |
|
private |
◆ m_D0_THRESHOLD
Gaudi::Property<float> FPGATrackSimMatrixGenAlgo::m_D0_THRESHOLD {this, "D0_THRESHOLD", 1., "Max d0"} |
|
private |
◆ m_detStore
◆ m_doClustering
Gaudi::Property<bool> FPGATrackSimMatrixGenAlgo::m_doClustering {this, "Clustering", true, "Do cluster?"} |
|
private |
◆ m_doDeltaPhiConsts
Gaudi::Property<bool> FPGATrackSimMatrixGenAlgo::m_doDeltaPhiConsts {this, "DeltaPhiConstants", false, "If true will generate delta phi constants"} |
|
private |
◆ m_doHoughConstants
Gaudi::Property<bool> FPGATrackSimMatrixGenAlgo::m_doHoughConstants {this, "HoughConstants", true, "If true will run Hough Transform to set q/pt and phi0"} |
|
private |
◆ m_doSecondStage
Gaudi::Property<bool> FPGATrackSimMatrixGenAlgo::m_doSecondStage {this, "SecondStage", false, "Run second stage?"} |
|
private |
◆ m_doSpacePoints
Gaudi::Property<bool> FPGATrackSimMatrixGenAlgo::m_doSpacePoints {this, "SpacePoints", true, "Do spacepoints?"} |
|
private |
◆ m_dropHitsAndFill
Gaudi::Property<bool> FPGATrackSimMatrixGenAlgo::m_dropHitsAndFill {this, "dropHitsAndFill", false, "If true, we can drop hits to fill the accumulator"} |
|
private |
◆ m_eventHeader
◆ m_EvtSel
◆ m_evtStore
◆ m_extendedExtraObjects
DataObjIDColl AthAlgorithm::m_extendedExtraObjects |
|
privateinherited |
◆ m_FPGATrackSimMapping
◆ m_h_3hitsInLayer
◆ m_h_nHit
TH1I* FPGATrackSimMatrixGenAlgo::m_h_nHit = nullptr |
|
private |
◆ m_h_notEnoughHits
◆ m_h_sectorPars
◆ m_h_SHfailure
◆ m_h_trackQoP_okHits
TH1I* FPGATrackSimMatrixGenAlgo::m_h_trackQoP_okHits = nullptr |
|
private |
◆ m_h_trackQoP_okRegion
TH1I* FPGATrackSimMatrixGenAlgo::m_h_trackQoP_okRegion = nullptr |
|
private |
◆ m_h_trainingTrack
◆ m_hitInputTool
◆ m_hitMapTool
◆ 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 |
◆ m_MaxWC
Gaudi::Property<int> FPGATrackSimMatrixGenAlgo::m_MaxWC {this, "WCmax", 0, "Max number of WCs"} |
|
private |
◆ 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 |
◆ m_nBins
◆ m_nDim_1st
int FPGATrackSimMatrixGenAlgo::m_nDim_1st = 0 |
|
private |
◆ m_nDim_2nd
int FPGATrackSimMatrixGenAlgo::m_nDim_2nd = 0 |
|
private |
◆ m_nLayers_1st
int FPGATrackSimMatrixGenAlgo::m_nLayers_1st = 0 |
|
private |
◆ m_nLayers_2nd
int FPGATrackSimMatrixGenAlgo::m_nLayers_2nd = 0 |
|
private |
◆ m_nRegions
Gaudi::Property<int> FPGATrackSimMatrixGenAlgo::m_nRegions {this, "NBanks", 0, "Number of banks to make"} |
|
private |
◆ m_nTracks
size_t FPGATrackSimMatrixGenAlgo::m_nTracks = 0 |
|
private |
◆ m_nTracksUsed
size_t FPGATrackSimMatrixGenAlgo::m_nTracksUsed = 0 |
|
private |
◆ m_overlapRemovalTool
◆ m_pmap
◆ m_pmap_1st
◆ m_pmap_2nd
◆ m_PT_THRESHOLD
Gaudi::Property<float> FPGATrackSimMatrixGenAlgo::m_PT_THRESHOLD {this, "PT_THRESHOLD", 0., "Min pt"} |
|
private |
◆ m_qOverPtBins
Gaudi::Property<std::vector<double> > FPGATrackSimMatrixGenAlgo::m_qOverPtBins {this, "sectorQPtBins", {}, "q/pt bins for sector definition"} |
|
private |
◆ m_roadFinderTool
◆ m_sector_cum
std::vector<AccumulateMap> FPGATrackSimMatrixGenAlgo::m_sector_cum |
|
private |
◆ m_single
Gaudi::Property<bool> FPGATrackSimMatrixGenAlgo::m_single {this, "SingleSector", false, "Run single sector"} |
|
private |
◆ m_sliceMax
◆ m_sliceMin
◆ m_spacePointsTool
◆ m_temp_c_max
Gaudi::Property<float> FPGATrackSimMatrixGenAlgo::m_temp_c_max {this, "par_c_max", 1, "Max curvature"} |
|
private |
◆ m_temp_c_min
Gaudi::Property<float> FPGATrackSimMatrixGenAlgo::m_temp_c_min {this, "par_c_min", -1, "Min curvature"} |
|
private |
◆ m_temp_c_slices
Gaudi::Property<int> FPGATrackSimMatrixGenAlgo::m_temp_c_slices {this, "par_c_slices", 100, "Number of c slides"} |
|
private |
◆ m_temp_d0_max
Gaudi::Property<float> FPGATrackSimMatrixGenAlgo::m_temp_d0_max {this, "par_d0_max", 2, "Max d0"} |
|
private |
◆ m_temp_d0_min
Gaudi::Property<float> FPGATrackSimMatrixGenAlgo::m_temp_d0_min {this, "par_d0_min", -2, "Min d0"} |
|
private |
◆ m_temp_d0_slices
Gaudi::Property<int> FPGATrackSimMatrixGenAlgo::m_temp_d0_slices {this, "par_d0_slices", 100, "Number of d0 slices"} |
|
private |
◆ m_temp_eta_max
Gaudi::Property<float> FPGATrackSimMatrixGenAlgo::m_temp_eta_max {this, "par_eta_max", 5, "Max eta"} |
|
private |
◆ m_temp_eta_min
Gaudi::Property<float> FPGATrackSimMatrixGenAlgo::m_temp_eta_min {this, "par_eta_min", -5, "Min eta"} |
|
private |
◆ m_temp_eta_slices
Gaudi::Property<int> FPGATrackSimMatrixGenAlgo::m_temp_eta_slices {this, "par_eta_slices", 100, "Number of eta slices"} |
|
private |
◆ m_temp_phi_max
Gaudi::Property<float> FPGATrackSimMatrixGenAlgo::m_temp_phi_max {this, "par_phi_max", TMath::Pi(), "Max phi"} |
|
private |
◆ m_temp_phi_min
Gaudi::Property<float> FPGATrackSimMatrixGenAlgo::m_temp_phi_min {this, "par_phi_min", -TMath::Pi(), "Min phi"} |
|
private |
◆ m_temp_phi_slices
Gaudi::Property<int> FPGATrackSimMatrixGenAlgo::m_temp_phi_slices {this, "par_phi_slices", 100, "Number of phi slices"} |
|
private |
◆ m_temp_z0_max
Gaudi::Property<float> FPGATrackSimMatrixGenAlgo::m_temp_z0_max {this, "par_z0_max", 200, "Max z0"} |
|
private |
◆ m_temp_z0_min
Gaudi::Property<float> FPGATrackSimMatrixGenAlgo::m_temp_z0_min {this, "par_z0_min", -200, "Min z0"} |
|
private |
◆ m_temp_z0_slices
Gaudi::Property<int> FPGATrackSimMatrixGenAlgo::m_temp_z0_slices {this, "par_z0_slices", 100, "Number of z0 slices"} |
|
private |
◆ m_tHistSvc
ServiceHandle<ITHistSvc> FPGATrackSimMatrixGenAlgo::m_tHistSvc {this,"THistSvc","THistSvc"} |
|
private |
◆ m_trackExtensionTool
◆ m_trackFitterTool_1st
◆ m_TRAIN_PDG
Gaudi::Property<int> FPGATrackSimMatrixGenAlgo::m_TRAIN_PDG {this, "TRAIN_PDG", 0, "PDG of particles to train on"} |
|
private |
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
ToolHandle< FPGATrackSimRawToLogicalHitsTool > m_hitMapTool
std::vector< FPGATrackSimHit > getLogicalHits()
Gaudi::Property< std::vector< double > > m_qOverPtBins
Gaudi::Property< float > m_temp_z0_max
Gaudi::Property< float > m_temp_d0_max
StatusCode makeAccumulator(std::vector< FPGATrackSimHit > const §or_hits, FPGATrackSimTruthTrack const &track, std::pair< std::vector< module_t >, FPGATrackSimMatrixAccumulator > &accumulator) const
Gaudi::Property< float > m_temp_phi_max
Gaudi::Property< float > m_temp_d0_min
Scalar phi() const
phi method
Gaudi::Property< int > m_minSpacePlusPixel
const FPGATrackSimPlaneMap * m_pmap_2nd
std::map< int, std::vector< FPGATrackSimHit > > makeBarcodeMap(std::vector< FPGATrackSimHit > const &hits, std::vector< FPGATrackSimTruthTrack > const &tracks) const
Scalar eta() const
pseudorapidity method
ServiceHandle< IFPGATrackSimMappingSvc > m_FPGATrackSimMapping
Gaudi::Property< int > m_temp_z0_slices
constexpr int SPACEPOINT_SECTOR_OFFSET
std::vector< FPGATrackSimTruthTrack > filterTrainingTracks(std::vector< FPGATrackSimTruthTrack > const &truth_tracks) const
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool msgLvl(const MSG::Level lvl) const
ToolHandle< IFPGATrackSimTrackExtensionTool > m_trackExtensionTool
Gaudi::Property< bool > m_dropHitsAndFill
Gaudi::Property< int > m_ideal_geom
Gaudi::Property< float > m_temp_phi_min
Gaudi::Property< float > m_D0_THRESHOLD
Gaudi::Property< float > m_temp_z0_min
Gaudi::Property< int > m_temp_eta_slices
ToolHandle< FPGATrackSimTrackFitterTool > m_trackFitterTool_1st
Gaudi::Property< float > m_temp_eta_min
ServiceHandle< IFPGATrackSimEventSelectionSvc > m_EvtSel
const std::vector< FPGATrackSimTruthTrack > & getTruthTracks() const
virtual void setOwner(IDataHandleHolder *o)=0
uint32_t getDim(size_t logiLayer) const
Gaudi::Property< bool > m_doHoughConstants
void fillTree(AccumulateMap &map, TTree *tree, int nLayers, int nCoords)
Writes the contents of an AccumulateMap into the supplied tree (one entry per sector).
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)
void setDetType(SiliconTech detType)
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
FPGATrackSimTrackPars m_sliceMax
virtual StatusCode sysInitialize() override
Override sysInitialize.
Gaudi::Property< bool > m_doSecondStage
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
Gaudi::Property< float > m_temp_c_min
Gaudi::Property< int > m_nRegions
void map(FPGATrackSimHit &hit) const
Gaudi::Property< bool > m_single
void roadsToTrack(std::vector< std::shared_ptr< const FPGATrackSimRoad >> &roads, std::vector< FPGATrackSimTrack > &track_cands, const FPGATrackSimPlaneMap *pmap)
const FPGATrackSimHit getOriginalHit() const
::StatusCode StatusCode
StatusCode definition for legacy code.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
ToolHandle< FPGATrackSimSpacePointsToolI > m_spacePointsTool
TH1I * m_h_sectorPars[FPGATrackSimTrackPars::NPARS]
ToolHandle< IFPGATrackSimInputTool > m_hitInputTool
Gaudi::Property< int > m_temp_d0_slices
TH1I * m_h_trackQoP_okHits
selectHit_returnCode selectHit(FPGATrackSimHit const &old_hit, FPGATrackSimHit const &new_hit, bool is1ststage, int subregion) const
Gaudi::Property< bool > m_doDeltaPhiConsts
Gaudi::Property< float > m_PT_THRESHOLD
const FPGATrackSimPlaneMap * m_pmap_1st
Gaudi::Property< int > m_temp_phi_slices
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Gaudi::Property< bool > m_doSpacePoints
Gaudi::Property< bool > m_absQOverPtBinning
Gaudi::Property< bool > m_doClustering
ToolHandle< FPGATrackSimClusteringToolI > m_clusteringTool
FPGATrackSimEventInputHeader * m_eventHeader
StatusCode bookHistograms()
ToolHandle< FPGATrackSimOverlapRemovalTool > m_overlapRemovalTool
TH1I * m_h_notEnoughHits[FPGATrackSimTrackPars::NPARS]
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
StatusCode fillAccumulatorByDropping(std::vector< FPGATrackSimHit > §or_hits, bool is1ststage, double x, double y, std::vector< module_t > &modules, AccumulateMap &map, FPGATrackSimTruthTrack const &track, int subregion) const
constexpr int QPT_SECTOR_OFFSET
std::string to_string(const DetectorType &type)
TH1I * m_h_3hitsInLayer[FPGATrackSimTrackPars::NPARS]
std::vector< AccumulateMap > m_sector_cum
TH1I * m_h_SHfailure[FPGATrackSimTrackPars::NPARS]
static std::string parName(unsigned i)
Gaudi::Property< float > m_temp_c_max
DataObjIDColl m_extendedExtraObjects
accumulate
Update flags based on parser line args.
void fillTrackPars(TH1I *const hists[FPGATrackSimTrackPars::NPARS], FPGATrackSimTruthTrack const &track)
void setLayer(unsigned v)
#define ATH_MSG_WARNING(x)
TH1I * m_h_trackQoP_okRegion
FPGATrackSimTrackPars m_sliceMin
TH1I * m_h_trainingTrack[FPGATrackSimTrackPars::NPARS]
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Gaudi::Property< int > m_MaxWC
Gaudi::Property< int > m_TRAIN_PDG
ToolHandle< FPGATrackSimRoadUnionTool > m_roadFinderTool
FPGATrackSimTrackParsI m_nBins
AthAlgorithm()
Default constructor:
unsigned getPhysLayer(bool old=false) const
int generations(const T &p)
Method to return how many interactions a particle has undergone during simulation (TODO migrate to be...
ServiceHandle< ITHistSvc > m_tHistSvc
Gaudi::Property< float > m_temp_eta_max
HitType getHitType() const
Gaudi::Property< int > m_temp_c_slices
void setHitType(HitType type)
GeoGenfun::FunctionNoop ATan2(GeoGenfun::GENFUNCTION y, GeoGenfun::GENFUNCTION x)