 |
ATLAS Offline Software
|
Go to the source code of this file.
|
StatusCode | runOverlapRemoval (std::vector< FPGATrackSimTrack > &tracks, const float minChi2, const int NumOfHitPerGrouping, ORAlgo orAlgo, ToolHandle< GenericMonitoringTool > &monTool, bool compareAllHits) |
|
int | findNonOverlapHits (const FPGATrackSimTrack &Track1, const FPGATrackSimTrack &Track2) |
|
void | findMinChi2MaxHit (const std::vector< int > &duplicates, std::vector< FPGATrackSimTrack > &RMtracks, std::vector< int > flags_OR, const float minChi2) |
|
int | findNCommonHits_v2 (const FPGATrackSimTrack &Track1, const FPGATrackSimTrack &Track2) |
|
int | findNCommonHitsGlobal (const FPGATrackSimTrack &Track1, const FPGATrackSimTrack &Track2) |
|
int | findNCommonHits (const FPGATrackSimTrack &Track1, const FPGATrackSimTrack &Track2) |
|
void | getMissingInfo (const FPGATrackSimRoad &road, int &nMissing, bool &missPixel, bool &missStrip, layer_bitmask_t &missing_mask, layer_bitmask_t &norecovery_mask, const ServiceHandle< IFPGATrackSimMappingSvc > &FPGATrackSimMapping, const TrackCorrType idealCoordFitType) |
|
void | makeTrackCandidates (const FPGATrackSimRoad &road, const FPGATrackSimTrack &temp, std::vector< FPGATrackSimTrack > &track_cands, const ServiceHandle< IFPGATrackSimMappingSvc > &FPGATrackSimMapping) |
| Creates a list of track candidates by taking all possible combination of hits in road. More...
|
|
long | getVolumeID (const FPGATrackSimHit &hit) |
|
long | getCoarseID (const FPGATrackSimHit &hit) |
|
bool | isFineIDInStrip (long ID) |
|
bool | isFineIDInPixel (long ID) |
|
long | getFineID (const FPGATrackSimHit &hit) |
|
void | roadsToTrack (std::vector< std::shared_ptr< const FPGATrackSimRoad >> &roads, std::vector< FPGATrackSimTrack > &track_cands, const FPGATrackSimPlaneMap *pmap) |
|
◆ findMinChi2MaxHit()
void findMinChi2MaxHit |
( |
const std::vector< int > & |
duplicates, |
|
|
std::vector< FPGATrackSimTrack > & |
RMtracks, |
|
|
std::vector< int > |
flags_OR, |
|
|
const float |
minChi2 |
|
) |
| |
Definition at line 190 of file FPGATrackSimHoughFunctions.cxx.
192 int ntr_belowMinChi2 = 0;
193 std::vector<int> track_counter;
195 for(
unsigned int i=0;
i<RMtracks.size();
i++)
197 if(RMtracks.at(
i).getChi2ndof() > minChi2) {
198 track_counter.push_back(0);
199 flags_OR.push_back(-1);
203 track_counter.push_back(ntr_belowMinChi2);
204 flags_OR.push_back(1);
209 float head_chi2 = 0.;
214 float t_chi2 = RMtracks.at(dup).getChi2ndof();
215 int t_nhitlayers = RMtracks.at(dup).getFPGATrackSimHits().size();
216 for(
auto& hit : RMtracks.at(dup).getFPGATrackSimHits())
219 ANA_MSG_DEBUG(
"Real hit info (global) = Gphi= " << hit.getGPhi() <<
" Z=" << hit.getZ() <<
" R=" << hit.getR() <<
" chi2=" << t_chi2);
226 if (dup_counter == 0) {
228 head_chi2 = RMtracks.at(head_track).getChi2ndof();
229 head_nhits = t_nhitlayers;
231 if (dup_counter > 0){
232 if(t_nhitlayers>head_nhits)
234 RMtracks.at(head_track).setPassedOR(0);
236 else if(t_nhitlayers==head_nhits)
238 if((head_chi2-t_chi2)>0.000001)
240 RMtracks.at(head_track).setPassedOR(0);
242 if(std::abs(t_chi2-head_chi2)<0.000001)
244 if(track_counter[head_track] < track_counter[dup]) {
245 RMtracks.at(dup).setPassedOR(0);
247 if(track_counter[head_track] > track_counter[dup]) {
248 RMtracks.at(head_track).setPassedOR(0);
254 if(!RMtracks.at(head_track).passedOR()) flags_OR[head_track] = 0;
255 if(RMtracks.at(head_track).passedOR()) flags_OR[head_track] = 1;
◆ findNCommonHits()
◆ findNCommonHits_v2()
Definition at line 261 of file FPGATrackSimHoughFunctions.cxx.
272 if (hit2_matched[j])
continue;
273 else if (!hit1.isReal() || !hit2.isReal())
continue;
274 else if (hit1.getLayer() != hit2.getLayer())
continue;
275 else if (hit1.getIdentifierHash() != hit2.getIdentifierHash())
continue;
281 if (std::abs(hit1.getX() - hit2.getX()) <
EPSILON &&
282 std::abs(hit1.getY() - hit2.getY()) <
EPSILON &&
283 std::abs(hit1.getZ() - hit2.getZ()) <
EPSILON)
286 hit2_matched[j] =
true;
292 else if (std::abs(hit1.getGPhi() - hit2.getGPhi()) < 0.001 &&
293 std::abs(hit1.getZ() - hit2.getZ()) < 0.001 &&
294 std::abs(hit1.getR() - hit2.getR()) < 0.001)
297 hit2_matched[j] =
true;
◆ findNCommonHitsGlobal()
Definition at line 307 of file FPGATrackSimHoughFunctions.cxx.
318 if (hit2_matched[j])
continue;
319 else if (!hit1.isReal() || !hit2.isReal())
continue;
320 else if (hit1.getLayer() != hit2.getLayer())
continue;
321 else if (hit1.getIdentifierHash() != hit2.getIdentifierHash())
continue;
327 if (std::abs(hit1.getX() - hit2.getX()) <
EPSILON &&
328 std::abs(hit1.getY() - hit2.getY()) <
EPSILON &&
329 std::abs(hit1.getZ() - hit2.getZ()) <
EPSILON)
332 hit2_matched[j] =
true;
338 else if (std::abs(hit1.getGPhi() - hit2.getGPhi()) <
EPSILON &&
339 std::abs(hit1.getZ() - hit2.getZ()) <
EPSILON &&
340 std::abs(hit1.getR() - hit2.getR()) <
EPSILON)
343 hit2_matched[j] =
true;
◆ findNonOverlapHits()
◆ getCoarseID()
◆ getFineID()
Definition at line 624 of file FPGATrackSimHoughFunctions.cxx.
642 if(volumeID == -999)
return -999;
645 if(layerID == 0)
offset = 21;
646 if(layerID == 1)
offset = 21+15;
647 if(layerID == 2)
offset = 21+15+6;
648 if(layerID == 3)
offset = 21+15+6+23;
649 if(layerID == 4)
offset = 21+15+6+23+6;
650 if(layerID == 5)
offset = 21+15+6+23+6+11;
651 if(layerID == 6)
offset = 21+15+6+23+6+11+8;
652 if(layerID == 7)
offset = 21+15+6+23+6+11+8+8;
653 if(layerID == 8)
offset = 21+15+6+23+6+11+8+8+9;
658 if(layerID == 0)
offset = 116;
659 if(layerID == 1)
offset = 116+15;
660 if(layerID == 2)
offset = 116+15+6;
661 if(layerID == 3)
offset = 116+15+6+23;
662 if(layerID == 4)
offset = 116+15+6+23+6;
663 if(layerID == 5)
offset = 116+15+6+23+6+11;
664 if(layerID == 6)
offset = 116+15+6+23+6+11+8;
665 if(layerID == 7)
offset = 116+15+6+23+6+11+8+8;
666 if(layerID == 8)
offset = 116+15+6+23+6+11+8+8+9;
◆ getMissingInfo()
Definition at line 401 of file FPGATrackSimHoughFunctions.cxx.
404 nMissing = FPGATrackSimMapping->PlaneMap_1st(subregion)->getNCoords();
410 for (
unsigned layer = 0;
layer < FPGATrackSimMapping->PlaneMap_1st(subregion)->getNLogiLayers();
layer++)
417 int ix = FPGATrackSimMapping->PlaneMap_1st(subregion)->getCoordOffset(
layer);
419 if (FPGATrackSimMapping->PlaneMap_1st(subregion)->isSCT(
layer))
421 missing_mask |= 1 << ix;
426 missing_mask |= (1<<ix) | (1<<iy);
432 if (FPGATrackSimMapping->PlaneMap_1st(subregion)->isSCT(
layer)) missStrip =
true;
433 else missPixel =
true;
436 else if (!((wclayers >>
layer) & 1)) {
437 int ix = FPGATrackSimMapping->PlaneMap_1st(subregion)->getCoordOffset(
layer);
439 if (FPGATrackSimMapping->PlaneMap_1st(subregion)->isSCT(
layer))
441 missing_mask |= 1 << ix;
446 missing_mask |= (1<<ix) | (1<<iy);
◆ getVolumeID()
◆ isFineIDInPixel()
bool isFineIDInPixel |
( |
long |
ID | ) |
|
◆ isFineIDInStrip()
bool isFineIDInStrip |
( |
long |
ID | ) |
|
◆ 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.
Definition at line 463 of file FPGATrackSimHoughFunctions.cxx.
467 auto pmap = FPGATrackSimMapping->PlaneMap_2nd(subregion);
470 pmap = FPGATrackSimMapping->PlaneMap_1st(subregion);
474 track_cands.resize(combs.size(),
temp);
481 for (
size_t icomb = 0; icomb < combs.size(); icomb++)
484 track_cands[icomb].setTrackID(idbase + icomb);
485 track_cands[icomb].setNLayers(pmap->getNLogiLayers());
488 track_cands[icomb].setIdealRadii(SUBREGIONMAP->
getAvgRadii(subregion));
489 track_cands[icomb].setPassedOR(1);
491 std::vector<int>
const & hit_indices = combs[icomb];
494 if (hit_indices[
layer] < 0)
502 if (wcbits & (1 <<
layer ) ) {
507 track_cands[icomb].setFPGATrackSimHit(
layer, newhit);
511 const std::shared_ptr<const FPGATrackSimHit> hit = road.
getHits(
layer)[hit_indices[
layer]];
517 if (
layer == 0)
throw (std::out_of_range(
"makeTrackCandidates: Attempt to access vector at element -1"));
520 track_cands[icomb].setValidCand(
false);
523 track_cands[icomb].setFPGATrackSimHit(
layer, *hit);
528 idbase += combs.size();
◆ roadsToTrack()
Definition at line 674 of file FPGATrackSimHoughFunctions.cxx.
678 for (
const std::shared_ptr<const FPGATrackSimRoad>& road : roads) {
683 temp.setPatternID(road->getPID());
684 temp.setHoughX(road->getX());
685 temp.setHoughY(road->getY());
686 temp.setQOverPt(road->getY());
688 temp.setSubRegion(road->getSubRegion());
689 temp.setHoughXBin(road->getXBin());
690 temp.setHoughYBin(road->getYBin());
694 std::vector<std::vector<int>> combs =
getComboIndices(road->getNHits_layer());
695 unsigned existing_size = track_cands.size();
696 track_cands.resize(existing_size + combs.size(),
temp);
701 for (
size_t icomb = 0; icomb < combs.size(); icomb++)
703 if ((existing_size + icomb) >= track_cands.size())
continue;
704 track_cands[existing_size + icomb].setNLayers(pmap->
getNLogiLayers());
705 std::vector<int>
const & hit_indices = combs[icomb];
708 if (hit_indices[
layer] < 0)
716 if (wcbits & (1 <<
layer ) ) {
721 track_cands[existing_size + icomb].setFPGATrackSimHit(
layer, newhit);
725 const std::shared_ptr<const FPGATrackSimHit> hit = road->getHits(
layer)[hit_indices[
layer]];
731 const FPGATrackSimHit inner_hit = track_cands[existing_size + icomb].getFPGATrackSimHits().at(
layer - 1);
733 track_cands[existing_size + icomb].setValidCand(
false);
736 track_cands[existing_size + icomb].setFPGATrackSimHit(
layer, *hit);
◆ runOverlapRemoval()
Definition at line 15 of file FPGATrackSimHoughFunctions.cxx.
20 std::vector<int> flags_OR;
24 int ntrack_passOR = 0;
26 std::vector<int> track_passOR_counter;
27 std::vector<int> track_passOR_barcodefrac;
28 track_passOR_counter.clear();
29 track_passOR_barcodefrac.clear();
30 int track_barcodefrac_num;
31 int track_barcodefrac_den;
32 float track_barcodefrac = -999;
33 int ntrack_passOR_total = 0;
34 int trackMuon_gt0pt5_passOR = 0;
35 float tmp_TrueTrack_BCF = -999;
39 for(
unsigned int i=0;
i<tracks.size();
i++)
55 for(
unsigned int j=0; j<tracks.size(); j++)
72 int nOverlappingHits = 0;
75 if(nOverlappingHits >= NumOfHitPerGrouping)
83 int nNotOverlappingHits=0;
87 if(nNotOverlappingHits <= NumOfHitPerGrouping)
98 track_passOR_counter.push_back(ntrack);
99 track_barcodefrac_num = 0;
102 if(hit.getBarcode() == 10001) track_barcodefrac_num++;
105 if (track_barcodefrac_den > 0){
106 track_barcodefrac = (
float)track_barcodefrac_num/(
float)track_barcodefrac_den;
109 track_passOR_barcodefrac.push_back(track_barcodefrac);
111 trackMuon_gt0pt5_passOR++;
112 if(trackMuon_gt0pt5_passOR == 1) {
115 if(trackMuon_gt0pt5_passOR > 1) {
126 for(
unsigned int i=0;
i<tracks.size();
i++){
130 ANA_MSG_DEBUG(
"track# = " << track_passOR_counter[
i] <<
": chi2 = " << fit1.
getChi2ndof() <<
" barcodefrac = " << track_passOR_barcodefrac[
i]);
133 ntrack_passOR_total += ntrack_passOR;
138 ANA_MSG_DEBUG(
"Number of tracks passing OR (total) = " << ntrack_passOR_total);
141 return StatusCode::SUCCESS;
◆ EPSILON
constexpr float EPSILON = 1e-5 |
|
constexpr |
int findNCommonHits(const FPGATrackSimTrack &Track1, const FPGATrackSimTrack &Track2)
void setSection(unsigned v)
Group
Properties of a chain group.
uint32_t getNLogiLayers() const
int getEtaModule(bool old=false) const
std::vector< Identifier > ID
long getCoarseID(const FPGATrackSimHit &hit)
int findNonOverlapHits(const FPGATrackSimTrack &Track1, const FPGATrackSimTrack &Track2)
unsigned getLayerDisk(bool old=false) const
const std::vector< std::shared_ptr< const FPGATrackSimHit > > & getHits(size_t layer) const
void findMinChi2MaxHit(const std::vector< int > &duplicates, std::vector< FPGATrackSimTrack > &RMtracks, std::vector< int > flags_OR, const float minChi2)
void setPassedOR(unsigned int)
unsigned int passedOR() const
std::vector< size_t > getNHits_layer() const
uint32_t getDim(size_t logiLayer) const
const std::vector< FPGATrackSimHit > & getFPGATrackSimHits() const
long getVolumeID(const FPGATrackSimHit &hit)
float getBarcodeFrac() const
void setDetType(SiliconTech detType)
float getChi2ndof() const
int findNCommonHitsGlobal(const FPGATrackSimTrack &Track1, const FPGATrackSimTrack &Track2)
unsigned getIdentifierHash() const
void setBarcodeFrac(const float &v)
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...
bool isFineIDInStrip(long ID)
layer_bitmask_t getWCLayers() const
const std::vector< double > & getAvgRadii(unsigned region) const
void setLayer(unsigned v)
unsigned getPhysLayer(bool old=false) const
Declare a monitored scalar variable.
HitType getHitType() const
void setHitType(HitType type)