 |
ATLAS Offline Software
|
#include <TrackFitter.h>
|
| void | resetCounters () |
| |
| int | fitTracks (const std::shared_ptr< const FPGATrackSimRoad > &road, std::vector< FPGATrackSimTrack > &tracks) |
| | Creates tracks from the given road. More...
|
| |
| void | getMissingInfo (const FPGATrackSimRoad &road, int &nMissing, bool &missPixel, bool &missStrip, layer_bitmask_t &missing_mask, layer_bitmask_t &norecovery_mask) |
| |
| void | makeTrackCandidates (const FPGATrackSimRoad &road, const FPGATrackSimTrack &temp, std::vector< FPGATrackSimTrack > &track_cands) |
| | Creates a list of track candidates by taking all possible combination of hits in road. More...
|
| |
| FPGATrackSimTrack | makeTrackCandidate (const FPGATrackSimRoad &road, const FPGATrackSimTrack &temp, const std::vector< int > &hit_indices) |
| |
| FPGATrackSimTrack | recoverTrack (FPGATrackSimTrack const &t, sector_t sector, layer_bitmask_t norecovery_mask, double qoverpt) |
| | Given a N/N track that has a bad chi2, try to refit the track by taking away a single hit, trying N combinations of N-1/N tracks. More...
|
| |
| void | compute_truth (FPGATrackSimTrack &newtrk) const |
| |
| void | initMessaging () const |
| | Initialize our message level and MessageSvc. More...
|
| |
◆ TrackFitter() [1/2]
Definition at line 25 of file TrackFitter.cxx.
34 for (
auto bank : droppedLayerbanks)
◆ TrackFitter() [2/2]
| TrackFitter::TrackFitter |
( |
void |
| ) |
|
◆ ~TrackFitter()
| virtual TrackFitter::~TrackFitter |
( |
void |
| ) |
|
|
virtual |
◆ compute_truth()
Definition at line 511 of file TrackFitter.cxx.
513 std::vector<FPGATrackSimMultiTruth> mtv;
519 if (
layer <
t.getFPGATrackSimHits().size()) mtv.push_back(
t.getFPGATrackSimHits().at(
layer).getTruth());
522 mtv.back().assign_equal_normalization();
530 const bool ok = mt.best(tbarcode, tfrac);
533 t.setEventIndex(tbarcode.first);
534 t.setBarcode(tbarcode.second);
535 t.setBarcodeFrac(tfrac);
◆ createDkfTrack()
◆ extrapolate()
◆ fit()
◆ fitTracks() [1/2]
Creates tracks from the given road.
Takes all combinations of hits in the road to create track candidates, fits them using the constant bank, and filters them based on the chi2 of the fit.
Definition at line 74 of file TrackFitter.cxx.
88 ATH_MSG_DEBUG(
"Attempting to fit Hough road with y = " <<
y <<
", x = " <<
x <<
", sector = " << road->getSector() <<
"and nhits = " << road->getNHits());
94 sector = road->getSector();
104 ATH_MSG_WARNING(
"Constants for sector " << sector <<
" are not valid");
115 getMissingInfo(*road, nMissing, missPixel, missStrip, missing_mask, norecovery_mask);
144 std::vector<FPGATrackSimTrack> track_cands;
147 std::vector<std::vector<int>> comboIndices =
getComboIndices(road->getNHits_layer());
148 ATH_MSG_DEBUG(
"There are theoretically " << comboIndices.size() <<
" combinations to process for this road");
150 for (
size_t icomb = 0; icomb < comboIndices.size(); icomb++) {
163 track_cand.
setChi2(road->getFitChi2());
164 track_cand.
setPars(road->getFitParams());
165 ATH_MSG_DEBUG(
"Assigned chi2 = " << track_cand.
getChi2() <<
" and parameters from genscan tool");
181 if (!( (missing_mask >>
ic) & 0
x1))
break;
198 bitmask &= ~(1 << icoord);
200 bitmask &= ~(1 << (icoord+1));
213 tracks.push_back(track_cand);
222 ATH_MSG_DEBUG(
"Processed " << tracks.size() <<
" actual/valid tracks for this road");
◆ fitTracks() [2/2]
Definition at line 56 of file TrackFitter.cxx.
58 for (
const std::shared_ptr<const FPGATrackSimRoad>& cur_road : roads) {
59 std::vector<FPGATrackSimTrack>
t;
62 else tracks.insert(tracks.end(),
t.begin(),
t.end());
◆ getChi2DofRecoveryMax()
| float TrackFitter::getChi2DofRecoveryMax |
( |
| ) |
const |
|
inline |
◆ getChi2DofRecoveryMin()
| float TrackFitter::getChi2DofRecoveryMin |
( |
| ) |
const |
|
inline |
◆ getDoDeltaGPhis()
| bool TrackFitter::getDoDeltaGPhis |
( |
| ) |
const |
|
inline |
◆ getDoMajority()
| unsigned TrackFitter::getDoMajority |
( |
| ) |
const |
|
inline |
◆ getDoMissingHitsCheck()
| bool TrackFitter::getDoMissingHitsCheck |
( |
| ) |
const |
|
inline |
◆ getDoSecondStage()
| bool TrackFitter::getDoSecondStage |
( |
| ) |
const |
|
inline |
◆ getFitFromRoad()
| bool TrackFitter::getFitFromRoad |
( |
| ) |
const |
|
inline |
◆ getIdealCoordFitType()
◆ getIdentifyBadHit()
| bool TrackFitter::getIdentifyBadHit |
( |
| ) |
const |
|
inline |
◆ getMissingHitsCheckTracks()
◆ getMissingInfo()
Definition at line 264 of file TrackFitter.cxx.
284 missing_mask |= 1 << ix;
289 missing_mask |= (1<<ix) | (1<<iy);
296 else missPixel =
true;
299 else if (!((wclayers >>
layer) & 1)) {
304 missing_mask |= 1 << ix;
309 missing_mask |= (1<<ix) | (1<<iy);
315 norecovery_mask |= (1<<
layer);
◆ getNFits()
| int TrackFitter::getNFits |
( |
| ) |
|
|
inline |
◆ getNFitsMajority()
| int TrackFitter::getNFitsMajority |
( |
| ) |
|
|
inline |
◆ getNFitsMajorityPix()
| int TrackFitter::getNFitsMajorityPix |
( |
| ) |
|
|
inline |
◆ getNFitsMajoritySCI()
| int TrackFitter::getNFitsMajoritySCI |
( |
| ) |
|
|
inline |
◆ getNFitsRecovery()
| int TrackFitter::getNFitsRecovery |
( |
| ) |
|
|
inline |
◆ getNorecoveryNhits()
| int TrackFitter::getNorecoveryNhits |
( |
| ) |
const |
|
inline |
◆ getPlaneMap()
◆ getRequireFirst()
| bool TrackFitter::getRequireFirst |
( |
| ) |
const |
|
inline |
◆ initMessaging()
| void AthMessaging::initMessaging |
( |
| ) |
const |
|
privateinherited |
Initialize our message level and MessageSvc.
This method should only be called once.
Definition at line 39 of file AthMessaging.cxx.
◆ makeTrackCandidate()
Definition at line 388 of file TrackFitter.cxx.
406 if (hit_indices[
layer] < 0)
414 if (wcbits & (1 <<
layer ) ) {
419 track_cand.setFPGATrackSimHit(
layer, newhit);
423 const std::shared_ptr<const FPGATrackSimHit> hit = road.
getHits(
layer)[hit_indices[
layer]];
431 track_cand.setValidCand(
false);
435 track_cand.setFPGATrackSimHit(
layer, *hit);
◆ makeTrackCandidates()
Creates a list of track candidates by taking all possible combination of hits in road.
Sets basic ID info and hits.
NB: If the number of combinations becomes large and memory is a concern, it may be worth turning this function into a sort of iterator over combs, return a single track each call.
This has now been done, but this function preserved for legacy support.
Definition at line 332 of file TrackFitter.cxx.
335 track_cands.resize(combs.size(), temp);
339 for (
size_t icomb = 0; icomb < combs.size(); icomb++)
342 track_cands[icomb].setTrackID(
m_idbase + icomb);
351 if (hit_indices[
layer] < 0)
359 if (wcbits & (1 <<
layer ) ) {
364 track_cands[icomb].setFPGATrackSimHit(
layer, newhit);
368 const std::shared_ptr<const FPGATrackSimHit> hit = road.
getHits(
layer)[hit_indices[
layer]];
376 track_cands[icomb].setValidCand(
false);
379 track_cands[icomb].setFPGATrackSimHit(
layer, *hit);
◆ matrixInversion5x5()
| void TrackFitter::matrixInversion5x5 |
( |
double |
a[5][5] | ) |
|
|
protected |
◆ msg() [1/2]
| MsgStream & AthMessaging::msg |
( |
| ) |
const |
|
inlineinherited |
The standard message stream.
Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.
Definition at line 164 of file AthMessaging.h.
◆ msg() [2/2]
| MsgStream & AthMessaging::msg |
( |
const MSG::Level |
lvl | ) |
const |
|
inlineinherited |
The standard message stream.
Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.
Definition at line 179 of file AthMessaging.h.
180 {
return msg() << lvl; }
◆ msgLvl()
| bool AthMessaging::msgLvl |
( |
const MSG::Level |
lvl | ) |
const |
|
inlineinherited |
Test the output level.
- Parameters
-
| lvl | The message level to test against |
- Returns
- boolean Indicating if messages at given level will be printed
- Return values
-
| true | Messages at level "lvl" will be printed |
Definition at line 151 of file AthMessaging.h.
◆ recoverTrack()
Given a N/N track that has a bad chi2, try to refit the track by taking away a single hit, trying N combinations of N-1/N tracks.
Returns the track with the best chi2 (or the original track if none of the N-1/N tracks are an improvement).
- Parameters
-
| norecovery_mask | - will skip removing hits from layers with bit set in this mask |
Definition at line 449 of file TrackFitter.cxx.
455 float best_chi2ndof =
t.getChi2ndof();
462 if (norecovery_mask & (1<<
layer))
continue;
470 recovered_tracks[
layer].setFPGATrackSimHit(
layer,newhit);
474 unsigned int missing_mask =
t.getHitMap();
475 missing_mask &= ~(1 << ix);
479 recovered_tracks[
layer].setHitMap(missing_mask);
483 recovered_tracks[
layer].setQOverPt(qoverpt);
493 if (recovered_tracks[
layer].getChi2ndof() < best_chi2ndof)
495 best_chi2ndof = recovered_tracks[
layer].getChi2ndof();
501 return recovered_tracks[best_i];
◆ resetCounters()
| void TrackFitter::resetCounters |
( |
| ) |
|
|
private |
◆ setChi2DofRecoveryMax()
| void TrackFitter::setChi2DofRecoveryMax |
( |
float |
v | ) |
|
|
inline |
◆ setChi2DofRecoveryMin()
| void TrackFitter::setChi2DofRecoveryMin |
( |
float |
v | ) |
|
|
inline |
◆ setDoDeltaGPhis()
| void TrackFitter::setDoDeltaGPhis |
( |
bool |
v | ) |
|
|
inline |
◆ setDoMajority()
| void TrackFitter::setDoMajority |
( |
unsigned int |
v | ) |
|
|
inline |
◆ setDoMissingHitsCheck()
| void TrackFitter::setDoMissingHitsCheck |
( |
bool |
v | ) |
|
|
inline |
◆ setDoSecondStage()
| void TrackFitter::setDoSecondStage |
( |
bool |
v | ) |
|
|
inline |
◆ setFitFromRoad()
| void TrackFitter::setFitFromRoad |
( |
bool |
v | ) |
|
|
inline |
◆ setIdealCoordFitType()
◆ setIdentifyBadHit()
| void TrackFitter::setIdentifyBadHit |
( |
bool |
flag | ) |
|
|
inline |
◆ setLevel()
| void AthMessaging::setLevel |
( |
MSG::Level |
lvl | ) |
|
|
inherited |
◆ setNorecoveryNhits()
| void TrackFitter::setNorecoveryNhits |
( |
int |
v | ) |
|
|
inline |
◆ setPlaneMap()
◆ setRegionMap()
◆ setRequireFirst()
| void TrackFitter::setRequireFirst |
( |
bool |
v | ) |
|
|
inline |
◆ ATLAS_THREAD_SAFE
| std::atomic_flag m_initialized AthMessaging::ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT |
|
mutableprivateinherited |
◆ m_Chi2Dof_recovery_max
| float TrackFitter::m_Chi2Dof_recovery_max = 1e30 |
|
private |
◆ m_Chi2Dof_recovery_min
| float TrackFitter::m_Chi2Dof_recovery_min = 40. |
|
private |
◆ m_comboIndices
| std::vector<std::vector<int> > TrackFitter::m_comboIndices |
|
private |
◆ m_do2ndStage
| bool TrackFitter::m_do2ndStage = false |
|
private |
◆ m_do_majority
| unsigned TrackFitter::m_do_majority = 1 |
|
private |
◆ m_doDeltaGPhis
| bool TrackFitter::m_doDeltaGPhis = false |
|
private |
◆ m_droppedLayerBanks
◆ m_endB
| double TrackFitter::m_endB[3] {} |
|
protected |
◆ m_fitFromRoad
| bool TrackFitter::m_fitFromRoad = false |
|
private |
◆ m_guessinghits
| bool TrackFitter::m_guessinghits = true |
|
private |
◆ m_idbase
| int TrackFitter::m_idbase = 0 |
|
private |
◆ m_IdealCoordFitType
◆ m_identify_badhit
| bool TrackFitter::m_identify_badhit = false |
|
private |
◆ m_imsg
| std::atomic<IMessageSvc*> AthMessaging::m_imsg { nullptr } |
|
mutableprivateinherited |
◆ m_lvl
| std::atomic<MSG::Level> AthMessaging::m_lvl { MSG::NIL } |
|
mutableprivateinherited |
◆ m_max_ncomb
| const int TrackFitter::m_max_ncomb = 10000 |
|
private |
◆ m_msg_tls
| boost::thread_specific_ptr<MsgStream> AthMessaging::m_msg_tls |
|
mutableprivateinherited |
MsgStream instance (a std::cout like with print-out levels)
Definition at line 132 of file AthMessaging.h.
◆ m_nfits
| int TrackFitter::m_nfits = 0 |
|
private |
◆ m_nfits_addrec
| int TrackFitter::m_nfits_addrec = 0 |
|
private |
◆ m_nfits_maj
| int TrackFitter::m_nfits_maj = 0 |
|
private |
◆ m_nfits_maj_pix
| int TrackFitter::m_nfits_maj_pix = 0 |
|
private |
◆ m_nfits_maj_SCT
| int TrackFitter::m_nfits_maj_SCT = 0 |
|
private |
◆ m_nfits_rec
| int TrackFitter::m_nfits_rec = 0 |
|
private |
◆ m_nm
| std::string AthMessaging::m_nm |
|
privateinherited |
◆ m_nominalBank
◆ m_norecovery_nhits
| int TrackFitter::m_norecovery_nhits = -1 |
|
private |
◆ m_pmap
◆ m_reMapVector
| std::vector<int> TrackFitter::m_reMapVector |
|
protected |
◆ m_require_first
| bool TrackFitter::m_require_first = true |
|
private |
◆ m_rmap
◆ m_setDoMissingHitsCheck
| bool TrackFitter::m_setDoMissingHitsCheck = false |
|
private |
◆ m_startB
| double TrackFitter::m_startB[3] {} |
|
protected |
◆ m_tracks_missinghits_track
The documentation for this class was generated from the following files:
void setHitMap(unsigned int v)
void compute_truth(FPGATrackSimTrack &newtrk) const
std::atomic< MSG::Level > m_lvl
Current logging level.
void setSection(unsigned v)
void setBinIdx(std::vector< unsigned > x)
uint32_t getNLogiLayers() const
void setPars(FPGATrackSimTrackPars const &pars)
float m_Chi2Dof_recovery_max
const std::vector< std::shared_ptr< const FPGATrackSimHit > > & getHits(size_t layer) const
accumulate
Update flags based on parser line args.
float m_Chi2Dof_recovery_min
void setHoughXBin(unsigned v)
uint32_t getNCoords() const
void setFirstSectorID(int v)
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
FPGATrackSimTrack recoverTrack(FPGATrackSimTrack const &t, sector_t sector, layer_bitmask_t norecovery_mask, double qoverpt)
Given a N/N track that has a bad chi2, try to refit the track by taking away a single hit,...
std::vector< size_t > getNHits_layer() const
IMessageSvc * getMessageSvc(bool quiet=false)
std::vector< FPGATrackSimTrack > m_tracks_missinghits_track
void setOrigChi2(float v)
uint32_t getCoordLayer(uint32_t coord) const
uint32_t getDim(size_t logiLayer) const
int fitTracks(const std::vector< std::shared_ptr< const FPGATrackSimRoad >> &roads, std::vector< FPGATrackSimTrack > &tracks)
void setSecondSectorID(int v)
uint32_t getCoordOffset(size_t logiLayer) const
bool isPixel(int pl) const
void setDetType(SiliconTech detType)
AthMessaging()
Default constructor:
void setHoughYBin(unsigned v)
FPGATrackSimPlaneMap const * m_pmap
void setDoDeltaGPhis(bool v)
std::pair< unsigned long, unsigned long > Barcode
bool m_setDoMissingHitsCheck
std::vector< std::vector< int > > m_comboIndices
TrackCorrType m_IdealCoordFitType
void setTrackCorrType(TrackCorrType v)
MsgStream & msg() const
The standard message stream.
std::vector< std::vector< int > > getComboIndices(std::vector< size_t > const &sizes)
Given a vector of sizes (of arrays), generates a vector of all combinations of indices to index one e...
void setTrackStage(TrackStage v)
FPGATrackSimRegionMap const * m_rmap
void getMissingInfo(const FPGATrackSimRoad &road, int &nMissing, bool &missPixel, bool &missStrip, layer_bitmask_t &missing_mask, layer_bitmask_t &norecovery_mask)
layer_bitmask_t getWCLayers() const
const std::vector< double > & getAvgRadii(unsigned region) const
bool getIsGood(sector_t sector) const
bool linfit(sector_t sector, FPGATrackSimTrack &track, bool isSecondStage) const
void setLayer(unsigned v)
const FPGATrackSimFitConstantBank * m_nominalBank
#define ATH_MSG_WARNING(x)
std::string m_nm
Message source name.
FPGATrackSimTrack makeTrackCandidate(const FPGATrackSimRoad &road, const FPGATrackSimTrack &temp, const std::vector< int > &hit_indices)
void setSubRegion(unsigned v)
void initMessaging() const
Initialize our message level and MessageSvc.
void setNLayers(int)
set the number of layers in the track.
bool getDoMissingHitsCheck() const
boost::thread_specific_ptr< MsgStream > m_msg_tls
MsgStream instance (a std::cout like with print-out levels)
HitType getHitType() const
void setHitType(HitType type)
bool hasGoodFit(std::vector< FPGATrackSimTrack > const &track_cands, float minchi2)
std::vector< const FPGATrackSimFitConstantBank * > m_droppedLayerBanks