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

#include <FPGATrackSimWindowExtensionTool.h>

Inheritance diagram for FPGATrackSimWindowExtensionTool:
Collaboration diagram for FPGATrackSimWindowExtensionTool:

Public Member Functions

virtual StatusCode initialize () override
virtual StatusCode extendTracks (const std::vector< std::shared_ptr< const FPGATrackSimHit > > &hits, const std::vector< std::shared_ptr< const FPGATrackSimTrack > > &tracks, std::vector< std::shared_ptr< const FPGATrackSimRoad > > &roads) override
virtual StatusCode setupSlices (FPGATrackSimLogicalEventInputHeader *slicedHitHeader) override
bool extendTrackSliced (std::shared_ptr< const FPGATrackSimTrack > track, std::vector< int > &numHits, layer_bitmask_t &hitLayers, std::vector< std::vector< std::shared_ptr< const FPGATrackSimHit > > > &road_hits)
bool extendTrackBinned (std::shared_ptr< const FPGATrackSimTrack > track, std::vector< int > &numHits, layer_bitmask_t &hitLayers, std::vector< std::vector< std::shared_ptr< const FPGATrackSimHit > > > &road_hits)

Private Attributes

ToolHandle< FPGATrackSimBinnedHitsm_hitBinningTool {this, "BinningTool", "FPGATrackSimBinning/FPGATrackSimBinnedHits"}
ServiceHandle< IFPGATrackSimBankSvcm_FPGATrackSimBankSvc {this, "FPGATrackSimBankSvc", "FPGATrackSimBankSvc"}
ServiceHandle< IFPGATrackSimMappingSvcm_FPGATrackSimMapping {this, "FPGATrackSimMappingSvc", "FPGATrackSimMappingSvc"}
Gaudi::Property< int > m_maxMiss { this, "threshold", 2, "Maximum number of missing hits allowed on a road"}
Gaudi::Property< std::vector< float > > m_phiwindows {this, "phiWindow", {}, "Default window settings for phi, must be size nlayers."}
Gaudi::Property< std::vector< float > > m_zwindows {this, "zWindow", {}, "Default window settings for z, must be size nlayers."}
Gaudi::Property< std::vector< float > > m_phiwindows_barrel {this, "phiWindow_barrel", {}, "Default window settings for phi in the barrel, must be size nlayers."}
Gaudi::Property< std::vector< float > > m_zwindows_barrel {this, "zWindow_barrel", {}, "Default window settings for z in the barrel, must be size nlayers."}
Gaudi::Property< std::vector< float > > m_phiwindows_endcap {this, "phiWindow_endcap", {}, "Default window settings for phi in the endcap, must be size nlayers."}
Gaudi::Property< std::vector< float > > m_zwindows_endcap {this, "zWindow_endcap", {}, "Default window settings for z in the endcap, must be size nlayers."}
Gaudi::Property< bool > m_detectorZoneWindows {this, "detectorZoneWindows", false, "If set to true we separate windows will be used for endcap and barrel hits."}
Gaudi::Property< bool > m_fieldCorrection {this, "fieldCorrection", true, "Use magnetic field correction for Hough transform"}
Gaudi::Property< bool > m_idealGeoRoads {this, "IdealGeoRoads", true, "Do sector assignment of second stage roads"}
Gaudi::Property< bool > m_doBinning {this, "doBinning", false, "Use second stage binning to sort hits, not the plane map"}
Gaudi::Property< bool > m_addAllHits {this, "addAllHits", false, "If set to true ignore the window and just add all the hits"}
Gaudi::Property< std::vector< int > > m_maxHits {this, "maxHits", {}, "If set to positive number, maximum number of hits allowed per layer"}
Gaudi::Property< bool > m_doRegionalMapping { this, "RegionalMapping", false, "Use the sub-region maps to define the sector"}
Gaudi::Property< bool > m_doEtaPatternConsts { this, "doEtaPatternConsts", false, "Whether to use the eta pattern tool for constant generation"}
Gaudi::Property< bool > m_useSpacePoints { this, "useSpacePoints", false, "Whether we are using spacepoints."}
Gaudi::Property< double > m_phiScale {this, "phiScale", 3.15, "Phi scale used when calculating distance from predicted window position" }
Gaudi::Property< double > m_zScale {this, "zScale", 3000, "z scale used when calculating distance from predicted window position" }
std::vector< FPGATrackSimRoadm_roads
std::map< unsigned, std::map< unsigned, std::vector< std::shared_ptr< const FPGATrackSimHit > > > > m_phits_atLayer
unsigned m_nLayers_1stStage = 0
unsigned m_nLayers_2ndStage = 0
unsigned m_threshold = 0
FPGATrackSimLogicalEventInputHeaderm_slicedHitHeader = nullptr

Detailed Description

Definition at line 34 of file FPGATrackSimWindowExtensionTool.h.

Member Function Documentation

◆ extendTrackBinned()

bool FPGATrackSimWindowExtensionTool::extendTrackBinned ( std::shared_ptr< const FPGATrackSimTrack > track,
std::vector< int > & numHits,
layer_bitmask_t & hitLayers,
std::vector< std::vector< std::shared_ptr< const FPGATrackSimHit > > > & road_hits )

Definition at line 246 of file FPGATrackSimWindowExtensionTool.cxx.

247 {
248
249 // Retrieve track parameters.
250 double trackd0 = track->getD0();
251 double trackphi = track->getPhi();
252 double trackz0 = track->getZ0();
253 double tracketa = track->getEta();
254 double trackqoverpt = track->getQOverPt();
255 double cottracktheta = 0.5*(exp(tracketa)-exp(-tracketa));
256
257 // If we're doing binning, match the track to a bin...
258 const FPGATrackSimBinStep* binStep = m_hitBinningTool->getBinTool().lastStep();
259 const IFPGATrackSimBinDesc* binDesc = m_hitBinningTool->getBinTool().binDesc();
260 ATH_MSG_DEBUG("Attempting to look up binIdx for track with phi = " << track->getPhi() << ", chi2/DOF = " << track->getChi2ndof() << ", q/pt = " << track->getQOverPt() << ", eta = " << track->getEta() << ", d0 = " << track->getD0() << ", z0 = " << track->getZ0());
261 FPGATrackSimTrackPars trackPars = track->getPars();
262
263 // MeV/GeV conversion factor, needed when switching between track parametrizations.
264 trackPars[FPGATrackSimTrackPars::IHIP] = trackPars[FPGATrackSimTrackPars::IHIP] * 1000;
265
266 FPGATrackSimBinUtil::ParSet parSet = binDesc->trackParsToParSet(trackPars);
267 if (!m_hitBinningTool->getBinTool().inRange(parSet)) {
268 ATH_MSG_DEBUG("Track doesn't pass binning tool track parameter cuts");
269 }
270 ATH_MSG_DEBUG("Found inside out parameters as " << parSet);
271
272 FPGATrackSimBinUtil::IdxSet binPars = binStep->binIdx(parSet);
273 ATH_MSG_DEBUG("Attempting to look up bin entry using binpars = " << binPars);
274 FPGATrackSimBinnedHits::BinEntry entry = (m_hitBinningTool->lastStepBinnedHits())[binPars];
275
276 ATH_MSG_DEBUG("Matched track to new bin containing " << entry.lyrCnt() << " layers with " << entry.hitCnt << " hits total");
277
278 std::vector<std::vector<std::tuple<float, float, std::shared_ptr<const FPGATrackSimHit>>>> road_hits_sortable;
279 road_hits_sortable.resize(m_nLayers_1stStage + m_nLayers_2ndStage);
280
281 for (FPGATrackSimBinUtil::StoredHit& storedHit : entry.hits) {
282 // These may need more adjustment if we try to bin deduplicated SPs in the future.
283 unsigned layer = storedHit.layer + m_nLayers_1stStage;
284 const std::shared_ptr<const FPGATrackSimHit>& hit = storedHit.hitptr;
285
286 // The rest of this should be the same as the previous loop.
287 double hitphi = hit->getGPhi();
288 double hitr = hit->getR();
289 double hitz = hit->getZ();
290 double pred_hitphi = trackphi - asin(hitr * fpgatracksim::A * 1000 * trackqoverpt - trackd0/hitr);
291 double pred_hitz = trackz0 + hitr*cottracktheta;
292
293 // Field correction, now pulled from FPGATrackSimFunctions.
295 double fieldCor = fieldCorrection(track->getRegion(), trackqoverpt, hitr);
296 pred_hitphi += fieldCor;
297 }
298
299 double diffphi = abs(hitphi-pred_hitphi);
300 double diffz = abs(hitz-pred_hitz);
301
302 // Apply the actual layer check, only accept hits that fall into a track's window.
303 ATH_MSG_DEBUG("Hit in region -- standard window comparison: comparing phi " << diffphi << " to " << m_phiwindows[layer] << " and z " << diffz << " to " << m_zwindows[layer]);
304 if (m_addAllHits) {
305 numHits[layer]++;
306 road_hits_sortable[layer].push_back({diffphi, diffz, hit});
307 hitLayers |= 1 << layer;
308 }
309 else if (m_detectorZoneWindows) {
310 if (hit->isBarrel()) { // Barrel
311 ATH_MSG_DEBUG("Hit in region -- detector zone window comparison comparing phi: " << diffphi << " to " << m_phiwindows_barrel[layer] << " and z " << diffz << " to " << m_zwindows_barrel[layer]);
312 if (m_phiwindows_barrel[layer] == -1 || m_zwindows_barrel[layer] == -1) {
313 ATH_MSG_WARNING("There is a hit in layer: " << layer << " with track eta " << tracketa << " in the barrel!");
314 }
315 if (diffphi < m_phiwindows_barrel[layer] && diffz < m_zwindows_barrel[layer]) {
316 numHits[layer]++;
317 road_hits[layer].push_back(hit);
318 hitLayers |= 1 << layer;
319 }
320 }
321 else { // Endcap
322 ATH_MSG_DEBUG("Hit in region -- detector zone window comparison comparing phi: " << diffphi << " to " << m_phiwindows_endcap[layer] << " and z " << diffz << " to " << m_zwindows_endcap[layer]);
323 if (m_phiwindows_endcap[layer] == -1 || m_zwindows_endcap[layer] == -1) {
324 ATH_MSG_WARNING("There is a hit in layer: " << layer << " with track eta " << tracketa << " in the endcap!");
325 }
326 if (diffphi < m_phiwindows_endcap[layer] && diffz < m_zwindows_endcap[layer]) {
327 numHits[layer]++;
328 road_hits[layer].push_back(hit);
329 hitLayers |= 1 << layer;
330 }
331 }
332 }
333 else if (diffphi < m_phiwindows[layer] && diffz < m_zwindows[layer]) {
334 numHits[layer]++;
335 road_hits_sortable[layer].push_back({diffphi, diffz, hit});
336 hitLayers |= 1 << layer;
337 }
338 }
339
340 // Post-processing. sort the hits by distance. NOTE: should also prioritize SPs here.
341 double zScale = m_zScale.value();
342 double phiScale = m_phiScale.value();
343 for (unsigned layer = 0; layer < m_FPGATrackSimMapping->PlaneMap_2nd(0)->getNLogiLayers(); layer++) {
344 if (road_hits_sortable.at(layer).size() >= 2) {
345 ATH_MSG_DEBUG("Sorting hits in layer " << layer);
346 std::ranges::sort(road_hits_sortable.at(layer), [zScale, phiScale](auto& a, auto& b){
347
348 // Prioritize SP vs non-SP
349 if (std::get<2>(a)->getHitType() == HitType::spacepoint && std::get<2>(b)->getHitType() != HitType::spacepoint) return true;
350 else if (std::get<2>(b)->getHitType() == HitType::spacepoint && std::get<2>(a)->getHitType() != HitType::spacepoint) return false;
351
352 // HitA
353 double dphi = std::get<0>(a);
354 double dz = std::get<1>(a);
355
356 // scaled distance because z and phi are not in same units
357 // these scales are the same as what the pathfinder uses for the time being,
358 // I don't't really know if that makes sense.
359 float distance_a = dphi*dphi/(phiScale*phiScale) + dz*dz/(zScale*zScale);
360
361 // HitB
362 dphi = std::get<0>(b);
363 dz = std::get<1>(b);
364
365 // scaled distance because z and phi are not in same units
366 float distance_b = dphi*dphi/(phiScale*phiScale) + dz*dz/(zScale*zScale);
367
368 return distance_a < distance_b;
369 });
370 }
371
372 // Remove any hits over the cutoff, whatever that is.
373 int cutoff = road_hits_sortable.at(layer).size();
374 if (m_maxHits.value().size() > layer && m_maxHits.value().at(layer) > 0) {
375 cutoff = std::min(cutoff, m_maxHits.value().at(layer));
376 }
377 for (int ihit = 0; ihit < cutoff; ihit++) {
378 auto& road_hit = std::get<2>(road_hits_sortable.at(layer).at(ihit));
379 road_hits.at(layer).push_back(road_hit);
380 }
381
382 }
383
384 return true;
385
386}
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
double fieldCorrection(unsigned region, double qoverpt, double r)
static Double_t a
unsigned binIdx(unsigned par, double val) const
Gaudi::Property< std::vector< float > > m_zwindows
Gaudi::Property< std::vector< float > > m_phiwindows
ToolHandle< FPGATrackSimBinnedHits > m_hitBinningTool
Gaudi::Property< std::vector< float > > m_phiwindows_endcap
Gaudi::Property< std::vector< int > > m_maxHits
ServiceHandle< IFPGATrackSimMappingSvc > m_FPGATrackSimMapping
Gaudi::Property< std::vector< float > > m_zwindows_barrel
Gaudi::Property< std::vector< float > > m_phiwindows_barrel
Gaudi::Property< std::vector< float > > m_zwindows_endcap
virtual const FPGATrackSimBinUtil::ParSet trackParsToParSet(const FPGATrackSimTrackPars &pars) const =0
@ layer
Definition HitInfo.h:79
static constexpr double A
std::shared_ptr< const FPGATrackSimHit > hitptr

◆ extendTracks()

StatusCode FPGATrackSimWindowExtensionTool::extendTracks ( const std::vector< std::shared_ptr< const FPGATrackSimHit > > & hits,
const std::vector< std::shared_ptr< const FPGATrackSimTrack > > & tracks,
std::vector< std::shared_ptr< const FPGATrackSimRoad > > & roads )
overridevirtual

Definition at line 62 of file FPGATrackSimWindowExtensionTool.cxx.

64 {
65
66 // Reset the internal second stage roads storage.
67 roads.clear();
68 m_roads.clear();
69 for (auto& sliceEntry : m_phits_atLayer){
70 for (auto& entry : sliceEntry.second) {
71 entry.second.clear();
72 }
73 }
74 const FPGATrackSimRegionMap* rmap_2nd = m_FPGATrackSimMapping->SubRegionMap_2nd();
75 const FPGATrackSimPlaneMap *pmap_2nd = nullptr;
76
77 // Create one "tower" per slice for this event.
78 // Note that there now might be only one "slice", at least for the time being.
80 for (int ireg = 0; ireg < rmap_2nd->getNRegions(); ireg++) {
81 FPGATrackSimTowerInputHeader tower = FPGATrackSimTowerInputHeader(ireg);
82 m_slicedHitHeader->addTower(tower);
83 }
84 }
85
86 // Second stage hits may be unmapped, in which case map them.
87 for (size_t i=0; i<m_FPGATrackSimMapping->GetPlaneMap_2ndSliceSize(); i++){
88 pmap_2nd = m_FPGATrackSimMapping->PlaneMap_2nd(i);
89 for (const std::shared_ptr<const FPGATrackSimHit>& hit : hits) {
90 std::shared_ptr<FPGATrackSimHit> hitCopy = std::make_shared<FPGATrackSimHit>(*hit);
91 pmap_2nd->map(*hitCopy);
92 if (!hitCopy->isMapped()){
93 continue;
94 }
95 if (rmap_2nd->isInRegion(i, *hitCopy)) {
96 m_phits_atLayer[i][hitCopy->getLayer()].push_back(hitCopy);
97 // Also store a copy of the hit object in the header class, for ROOT Output + TV creation.
98 if (m_slicedHitHeader) m_slicedHitHeader->getTower(i)->addHit(*hitCopy);
99 }
100 }
101 }
102
103 // Unfortunately this is a bit different from the other code path
104 // If we are using the binning tool here, we need to pass all of the hits to it, and then rely
105 // on the binning tool to match first stage tracks to second stage bins.
106 std::vector<std::shared_ptr<const FPGATrackSimHit>> allMappedHits;
107 if (m_doBinning && m_FPGATrackSimMapping->GetPlaneMap_2ndSliceSize() == 1) {
108 for (unsigned layer = 0; layer < m_nLayers_2ndStage + m_nLayers_1stStage; layer++) {
109 allMappedHits.insert(allMappedHits.end(), m_phits_atLayer[0][layer].begin(), m_phits_atLayer[0][layer].end());
110 }
111 ATH_MSG_VERBOSE("Attempting to bin nhits = " << allMappedHits.size());
112 ATH_CHECK(m_hitBinningTool->fill(allMappedHits));
113 }
114
115 // Now, loop over the tracks.
116 for (std::shared_ptr<const FPGATrackSimTrack> track : tracks) {
117 if (track->passedOR() == 0) {
118 continue;
119 }
120
121 // Retrieve track parameters.
122 double trackphi = track->getPhi();
123 double trackqoverpt = track->getQOverPt();
124
125 std::vector<int> numHits(m_nLayers_2ndStage + m_nLayers_1stStage, 0);
126
127 // Copy over the existing hits. We require that the layer assignment in the first stage
128 // is equal to the layer assignment in the second stage.
129 std::vector<std::vector<std::shared_ptr<const FPGATrackSimHit>>> road_hits;
130 road_hits.resize(m_nLayers_1stStage + m_nLayers_2ndStage);
131 layer_bitmask_t hitLayers = 0;
132 unsigned nhit = 0;
133 // We can't just use the the iterator since hit.getLayer() isn't guaranteed to be right.
134 for (unsigned layer = 0; layer < track->getFPGATrackSimHits().size(); layer++) {
135 const FPGATrackSimHit& hit = track->getFPGATrackSimHits().at(layer);
136 road_hits[layer].push_back(std::make_shared<FPGATrackSimHit>(hit));
137 if (hit.isReal()) {
138 hitLayers |= 1 << layer;
139 numHits[layer]++;
140 }
141 }
142
143 size_t slice = track->getSubRegion();
144 pmap_2nd = m_FPGATrackSimMapping->PlaneMap_2nd(slice);
145
146 // Extend the track using either slicing (F-200/300 legacy support) or binning (F-600)
147 bool success = (!m_doBinning) ? extendTrackSliced(track, numHits, hitLayers, road_hits) : extendTrackBinned(track, numHits, hitLayers, road_hits);
148 if (!success) continue;
149
150 // now nhit will be equal to the number of layers with hits in the new array.
151 for (auto num: numHits) {
152 if(num > 0) nhit += 1;
153 }
154
155 // If we have enough hits, create a new road.
156 ATH_MSG_DEBUG("Found potential new road with " << nhit << " hits relative to threshold of " << m_threshold);
157 if (nhit >= m_threshold) {
158 m_roads.emplace_back();
159 FPGATrackSimRoad & road = m_roads.back();
160 road.setRoadID(roads.size() - 1);
161
162 // Set the "Hough x" and "Hough y" using the track parameters.
163 road.setX(trackphi);
164 road.setY(trackqoverpt);
165 road.setXBin(track->getHoughXBin());
166 road.setYBin(track->getHoughYBin());
167 road.setSubRegion(track->getSubRegion());
168
169 // figure out bit mask for wild card layers
170 unsigned int wclayers = 0;
171 for (unsigned i = 0; i < numHits.size(); i++){
172 if(numHits[i]==0) wclayers |= (0x1 << i);
173 }
174 road.setWCLayers(wclayers);
175
176 // set hit layers and hits
177 road.setHitLayers(hitLayers);
178 road.setHits(std::move(road_hits));
179 }
180 }
181
182 // Copy the roads we found into the output argument and return success.
183 roads.reserve(m_roads.size());
184 for (FPGATrackSimRoad & r : m_roads) {
185 roads.emplace_back(std::make_shared<const FPGATrackSimRoad>(r));
186 }
187 ATH_MSG_DEBUG("Found " << m_roads.size() << " new roads in second stage.");
188
189 // Reset the hit binning tool.
190 m_hitBinningTool->resetBins();
191
192 return StatusCode::SUCCESS;
193}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
uint32_t layer_bitmask_t
bool isReal() const
void map(FPGATrackSimHit &hit) const
bool isInRegion(uint32_t region, const FPGATrackSimHit &hit) const
void setHitLayers(layer_bitmask_t hit_layers)
void setY(float v)
void setHits(std::vector< std::vector< std::shared_ptr< const FPGATrackSimHit > > > &&hits)
void setXBin(unsigned v)
void setYBin(unsigned v)
void setRoadID(int roadID)
void setSubRegion(int v)
void setX(float v)
void setWCLayers(layer_bitmask_t wc_layers)
bool extendTrackSliced(std::shared_ptr< const FPGATrackSimTrack > track, std::vector< int > &numHits, layer_bitmask_t &hitLayers, std::vector< std::vector< std::shared_ptr< const FPGATrackSimHit > > > &road_hits)
std::map< unsigned, std::map< unsigned, std::vector< std::shared_ptr< const FPGATrackSimHit > > > > m_phits_atLayer
FPGATrackSimLogicalEventInputHeader * m_slicedHitHeader
bool extendTrackBinned(std::shared_ptr< const FPGATrackSimTrack > track, std::vector< int > &numHits, layer_bitmask_t &hitLayers, std::vector< std::vector< std::shared_ptr< const FPGATrackSimHit > > > &road_hits)
int r
Definition globals.cxx:22

◆ extendTrackSliced()

bool FPGATrackSimWindowExtensionTool::extendTrackSliced ( std::shared_ptr< const FPGATrackSimTrack > track,
std::vector< int > & numHits,
layer_bitmask_t & hitLayers,
std::vector< std::vector< std::shared_ptr< const FPGATrackSimHit > > > & road_hits )

Definition at line 195 of file FPGATrackSimWindowExtensionTool.cxx.

196 {
197
198 const FPGATrackSimRegionMap* rmap_2nd = m_FPGATrackSimMapping->SubRegionMap_2nd();
199
200 // Retrieve track parameters.
201 double trackd0 = track->getD0();
202 double trackphi = track->getPhi();
203 double trackz0 = track->getZ0();
204 double tracketa = track->getEta();
205 double trackqoverpt = track->getQOverPt();
206 double cottracktheta = 0.5*(exp(tracketa)-exp(-tracketa));
207 size_t slice = track->getSubRegion();
208
210 ATH_MSG_DEBUG("Testing layer " << layer << " with " << m_phits_atLayer[slice][layer].size() << " hit");
211 for (const std::shared_ptr<const FPGATrackSimHit>& hit: m_phits_atLayer[slice][layer]) {
212 // Make sure this hit is in the same subregion as the track. TODO: mapping/slice changes.
213 if (!rmap_2nd->isInRegion(track->getSubRegion(), *hit)) {
214 continue;
215 }
216
217 double hitphi = hit->getGPhi();
218 double hitr = hit->getR();
219 double hitz = hit->getZ();
220 double pred_hitphi = trackphi - asin(hitr * fpgatracksim::A * 1000 * trackqoverpt - trackd0/hitr);
221 double pred_hitz = trackz0 + hitr*cottracktheta;
222
223 // Field correction, now pulled from FPGATrackSimFunctions.
225 double fieldCor = fieldCorrection(track->getRegion(), trackqoverpt, hitr);
226 pred_hitphi += fieldCor;
227 }
228
229 double diffphi = abs(hitphi-pred_hitphi);
230 double diffz = abs(hitz-pred_hitz);
231
232 // Apply the actual layer check, only accept hits that fall into a track's window.
233 ATH_MSG_DEBUG("Hit in region, comparing phi: " << diffphi << " to " << m_phiwindows[layer] << " and z " << diffz << " to " << m_zwindows[layer]);
234 if (diffphi < m_phiwindows[layer] && diffz < m_zwindows[layer]) {
235 numHits[layer]++;
236 road_hits[layer].push_back(hit);
237 hitLayers |= 1 << hit->getLayer();
238 }
239 }
240 }
241
242 return true;
243}

◆ initialize()

StatusCode FPGATrackSimWindowExtensionTool::initialize ( )
overridevirtual

Definition at line 30 of file FPGATrackSimWindowExtensionTool.cxx.

30 {
31
32 // Retrieve the mapping service.
35 m_nLayers_1stStage = m_FPGATrackSimMapping->PlaneMap_1st(0)->getNLogiLayers();
36 m_nLayers_2ndStage = m_FPGATrackSimMapping->PlaneMap_2nd(0)->getNLogiLayers() - m_nLayers_1stStage;
37
39
40 // This now needs to be done once for each slice.
41 for (size_t j=0; j<m_FPGATrackSimMapping->GetPlaneMap_2ndSliceSize(); j++){
42 ATH_MSG_DEBUG("Processing second stage slice " << j);
43 m_phits_atLayer[j] = std::map<unsigned, std::vector<std::shared_ptr<const FPGATrackSimHit>>>();
45 ATH_MSG_DEBUG("Processing layer " << i);
46 m_phits_atLayer[j][i] = std::vector<std::shared_ptr<const FPGATrackSimHit>>();
47 }
48 }
49
50 // Retrieve the hit binning tool, for use with inside out.
51 ATH_CHECK(m_hitBinningTool.retrieve());
52 // Setup layer configuration if not already set from layerMap
53 // TODO: this may not be correct because of spacepoints. Do we *really* want to bin using 8 layers?
54 if (m_hitBinningTool->getNLayers()==0) {
56 }
57
58 // Probably need to do something here.
59 return StatusCode::SUCCESS;
60}
ServiceHandle< IFPGATrackSimBankSvc > m_FPGATrackSimBankSvc

◆ setupSlices()

virtual StatusCode FPGATrackSimWindowExtensionTool::setupSlices ( FPGATrackSimLogicalEventInputHeader * slicedHitHeader)
inlineoverridevirtual

Definition at line 47 of file FPGATrackSimWindowExtensionTool.h.

47 {
48 m_slicedHitHeader = slicedHitHeader;
49 return StatusCode::SUCCESS;
50 };

Member Data Documentation

◆ m_addAllHits

Gaudi::Property<bool> FPGATrackSimWindowExtensionTool::m_addAllHits {this, "addAllHits", false, "If set to true ignore the window and just add all the hits"}
private

Definition at line 77 of file FPGATrackSimWindowExtensionTool.h.

77{this, "addAllHits", false, "If set to true ignore the window and just add all the hits"};

◆ m_detectorZoneWindows

Gaudi::Property<bool> FPGATrackSimWindowExtensionTool::m_detectorZoneWindows {this, "detectorZoneWindows", false, "If set to true we separate windows will be used for endcap and barrel hits."}
private

Definition at line 73 of file FPGATrackSimWindowExtensionTool.h.

73{this, "detectorZoneWindows", false, "If set to true we separate windows will be used for endcap and barrel hits."};

◆ m_doBinning

Gaudi::Property<bool> FPGATrackSimWindowExtensionTool::m_doBinning {this, "doBinning", false, "Use second stage binning to sort hits, not the plane map"}
private

Definition at line 76 of file FPGATrackSimWindowExtensionTool.h.

76{this, "doBinning", false, "Use second stage binning to sort hits, not the plane map"};

◆ m_doEtaPatternConsts

Gaudi::Property<bool> FPGATrackSimWindowExtensionTool::m_doEtaPatternConsts { this, "doEtaPatternConsts", false, "Whether to use the eta pattern tool for constant generation"}
private

Definition at line 85 of file FPGATrackSimWindowExtensionTool.h.

85{ this, "doEtaPatternConsts", false, "Whether to use the eta pattern tool for constant generation"};

◆ m_doRegionalMapping

Gaudi::Property<bool> FPGATrackSimWindowExtensionTool::m_doRegionalMapping { this, "RegionalMapping", false, "Use the sub-region maps to define the sector"}
private

Definition at line 84 of file FPGATrackSimWindowExtensionTool.h.

84{ this, "RegionalMapping", false, "Use the sub-region maps to define the sector"};

◆ m_fieldCorrection

Gaudi::Property<bool> FPGATrackSimWindowExtensionTool::m_fieldCorrection {this, "fieldCorrection", true, "Use magnetic field correction for Hough transform"}
private

Definition at line 74 of file FPGATrackSimWindowExtensionTool.h.

74{this, "fieldCorrection", true, "Use magnetic field correction for Hough transform"};

◆ m_FPGATrackSimBankSvc

ServiceHandle<IFPGATrackSimBankSvc> FPGATrackSimWindowExtensionTool::m_FPGATrackSimBankSvc {this, "FPGATrackSimBankSvc", "FPGATrackSimBankSvc"}
private

Definition at line 62 of file FPGATrackSimWindowExtensionTool.h.

62{this, "FPGATrackSimBankSvc", "FPGATrackSimBankSvc"};

◆ m_FPGATrackSimMapping

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

Definition at line 63 of file FPGATrackSimWindowExtensionTool.h.

63{this, "FPGATrackSimMappingSvc", "FPGATrackSimMappingSvc"};

◆ m_hitBinningTool

ToolHandle<FPGATrackSimBinnedHits> FPGATrackSimWindowExtensionTool::m_hitBinningTool {this, "BinningTool", "FPGATrackSimBinning/FPGATrackSimBinnedHits"}
private

Definition at line 60 of file FPGATrackSimWindowExtensionTool.h.

60{this, "BinningTool", "FPGATrackSimBinning/FPGATrackSimBinnedHits"};

◆ m_idealGeoRoads

Gaudi::Property<bool> FPGATrackSimWindowExtensionTool::m_idealGeoRoads {this, "IdealGeoRoads", true, "Do sector assignment of second stage roads"}
private

Definition at line 75 of file FPGATrackSimWindowExtensionTool.h.

75{this, "IdealGeoRoads", true, "Do sector assignment of second stage roads"};

◆ m_maxHits

Gaudi::Property<std::vector<int> > FPGATrackSimWindowExtensionTool::m_maxHits {this, "maxHits", {}, "If set to positive number, maximum number of hits allowed per layer"}
private

Definition at line 78 of file FPGATrackSimWindowExtensionTool.h.

78{this, "maxHits", {}, "If set to positive number, maximum number of hits allowed per layer"};

◆ m_maxMiss

Gaudi::Property<int> FPGATrackSimWindowExtensionTool::m_maxMiss { this, "threshold", 2, "Maximum number of missing hits allowed on a road"}
private

Definition at line 66 of file FPGATrackSimWindowExtensionTool.h.

66{ this, "threshold", 2, "Maximum number of missing hits allowed on a road"};

◆ m_nLayers_1stStage

unsigned FPGATrackSimWindowExtensionTool::m_nLayers_1stStage = 0
private

Definition at line 95 of file FPGATrackSimWindowExtensionTool.h.

◆ m_nLayers_2ndStage

unsigned FPGATrackSimWindowExtensionTool::m_nLayers_2ndStage = 0
private

Definition at line 96 of file FPGATrackSimWindowExtensionTool.h.

◆ m_phiScale

Gaudi::Property<double> FPGATrackSimWindowExtensionTool::m_phiScale {this, "phiScale", 3.15, "Phi scale used when calculating distance from predicted window position" }
private

Definition at line 89 of file FPGATrackSimWindowExtensionTool.h.

89{this, "phiScale", 3.15, "Phi scale used when calculating distance from predicted window position" };

◆ m_phits_atLayer

std::map<unsigned, std::map<unsigned, std::vector<std::shared_ptr<const FPGATrackSimHit> > > > FPGATrackSimWindowExtensionTool::m_phits_atLayer
private

Definition at line 94 of file FPGATrackSimWindowExtensionTool.h.

◆ m_phiwindows

Gaudi::Property<std::vector<float> > FPGATrackSimWindowExtensionTool::m_phiwindows {this, "phiWindow", {}, "Default window settings for phi, must be size nlayers."}
private

Definition at line 67 of file FPGATrackSimWindowExtensionTool.h.

67{this, "phiWindow", {}, "Default window settings for phi, must be size nlayers."};

◆ m_phiwindows_barrel

Gaudi::Property<std::vector<float> > FPGATrackSimWindowExtensionTool::m_phiwindows_barrel {this, "phiWindow_barrel", {}, "Default window settings for phi in the barrel, must be size nlayers."}
private

Definition at line 69 of file FPGATrackSimWindowExtensionTool.h.

69{this, "phiWindow_barrel", {}, "Default window settings for phi in the barrel, must be size nlayers."};

◆ m_phiwindows_endcap

Gaudi::Property<std::vector<float> > FPGATrackSimWindowExtensionTool::m_phiwindows_endcap {this, "phiWindow_endcap", {}, "Default window settings for phi in the endcap, must be size nlayers."}
private

Definition at line 71 of file FPGATrackSimWindowExtensionTool.h.

71{this, "phiWindow_endcap", {}, "Default window settings for phi in the endcap, must be size nlayers."};

◆ m_roads

std::vector<FPGATrackSimRoad> FPGATrackSimWindowExtensionTool::m_roads
private

Definition at line 92 of file FPGATrackSimWindowExtensionTool.h.

◆ m_slicedHitHeader

FPGATrackSimLogicalEventInputHeader* FPGATrackSimWindowExtensionTool::m_slicedHitHeader = nullptr
private

Definition at line 101 of file FPGATrackSimWindowExtensionTool.h.

◆ m_threshold

unsigned FPGATrackSimWindowExtensionTool::m_threshold = 0
private

Definition at line 97 of file FPGATrackSimWindowExtensionTool.h.

◆ m_useSpacePoints

Gaudi::Property<bool> FPGATrackSimWindowExtensionTool::m_useSpacePoints { this, "useSpacePoints", false, "Whether we are using spacepoints."}
private

Definition at line 86 of file FPGATrackSimWindowExtensionTool.h.

86{ this, "useSpacePoints", false, "Whether we are using spacepoints."};

◆ m_zScale

Gaudi::Property<double> FPGATrackSimWindowExtensionTool::m_zScale {this, "zScale", 3000, "z scale used when calculating distance from predicted window position" }
private

Definition at line 90 of file FPGATrackSimWindowExtensionTool.h.

90{this, "zScale", 3000, "z scale used when calculating distance from predicted window position" };

◆ m_zwindows

Gaudi::Property<std::vector<float> > FPGATrackSimWindowExtensionTool::m_zwindows {this, "zWindow", {}, "Default window settings for z, must be size nlayers."}
private

Definition at line 68 of file FPGATrackSimWindowExtensionTool.h.

68{this, "zWindow", {}, "Default window settings for z, must be size nlayers."};

◆ m_zwindows_barrel

Gaudi::Property<std::vector<float> > FPGATrackSimWindowExtensionTool::m_zwindows_barrel {this, "zWindow_barrel", {}, "Default window settings for z in the barrel, must be size nlayers."}
private

Definition at line 70 of file FPGATrackSimWindowExtensionTool.h.

70{this, "zWindow_barrel", {}, "Default window settings for z in the barrel, must be size nlayers."};

◆ m_zwindows_endcap

Gaudi::Property<std::vector<float> > FPGATrackSimWindowExtensionTool::m_zwindows_endcap {this, "zWindow_endcap", {}, "Default window settings for z in the endcap, must be size nlayers."}
private

Definition at line 72 of file FPGATrackSimWindowExtensionTool.h.

72{this, "zWindow_endcap", {}, "Default window settings for z in the endcap, must be size nlayers."};

The documentation for this class was generated from the following files: