|
ATLAS Offline Software
|
#include <TrigInDetTrackSeedingTool.h>
|
ToolHandle< ITrigL2LayerNumberTool > | m_layerNumberTool {this, "layerNumberTool", "TrigL2LayerNumberToolITk"} |
|
const AtlasDetectorID * | m_atlasId = nullptr |
|
const SCT_ID * | m_sctId = nullptr |
|
const PixelID * | m_pixelId = nullptr |
|
SG::ReadCondHandleKey< InDet::BeamSpotData > | m_beamSpotKey { this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" } |
|
SG::ReadHandleKey< SpacePointContainer > | m_sctSpacePointsContainerKey {this, "SCT_SP_ContainerName", "ITkStripTrigSpacePoints"} |
|
SG::ReadHandleKey< SpacePointContainer > | m_pixelSpacePointsContainerKey {this, "PixelSP_ContainerName", "ITkPixelTrigSpacePoints"} |
|
BooleanProperty | m_filter_phi {this, "DoPhiFiltering", true} |
|
BooleanProperty | m_useBeamTilt {this, "UseBeamTilt", false} |
|
BooleanProperty | m_usePixelSpacePoints {this, "UsePixelSpacePoints", true} |
|
BooleanProperty | m_useSctSpacePoints {this, "UseSctSpacePoints", false} |
|
BooleanProperty | m_LRTmode {this, "LRTMode",false} |
|
BooleanProperty | m_useML {this, "useML", true} |
|
UnsignedIntegerProperty | m_nMaxPhiSlice {this, "nMaxPhiSlice", 53} |
|
BooleanProperty | m_doubletFilterRZ {this, "Doublet_FilterRZ", true} |
|
BooleanProperty | m_useEtaBinning {this, "UseEtaBinning", true} |
|
FloatProperty | m_minPt {this, "pTmin", 1000.0} |
|
IntegerProperty | m_nMaxEdges {this, "MaxGraphEdges", 2000000} |
|
StringProperty | m_connectionFile {this, "ConnectionFileName", "binTables_ITK_RUN4.txt"} |
|
float | m_phiSliceWidth {} |
|
ToolHandle< IRegSelTool > | m_regsel_pix { this, "RegSelTool_Pixel", "RegSelTool/RegSelTool_Pixel" } |
| region selector tools More...
|
|
ToolHandle< IRegSelTool > | m_regsel_sct { this, "RegSelTool_SCT", "RegSelTool/RegSelTool_SCT" } |
|
std::unique_ptr< GNN_FasTrackConnector > | m_connector = nullptr |
|
std::vector< TrigInDetSiLayer > | m_layerGeometry |
|
std::unique_ptr< const TrigFTF_GNN_Geometry > | m_geo = nullptr |
|
Definition at line 30 of file TrigInDetTrackSeedingTool.h.
◆ TrigInDetTrackSeedingTool()
TrigInDetTrackSeedingTool::TrigInDetTrackSeedingTool |
( |
const std::string & |
t, |
|
|
const std::string & |
n, |
|
|
const IInterface * |
p |
|
) |
| |
◆ ~TrigInDetTrackSeedingTool()
virtual TrigInDetTrackSeedingTool::~TrigInDetTrackSeedingTool |
( |
| ) |
|
|
inlinevirtual |
◆ buildTheGraph()
Definition at line 308 of file TrigInDetTrackSeedingTool.cxx.
312 const float cut_dphi_max =
m_LRTmode ? 0.07 : 0.012;
313 const float cut_dcurv_max =
m_LRTmode ? 0.015 : 0.001;
314 const float cut_tau_ratio_max =
m_LRTmode ? 0.015 : 0.007;
317 const float min_deltaPhi =
m_LRTmode ? 0.01f : 0.001f;
319 const float maxOuterRadius =
m_LRTmode ? 1050.0 : 550.0;
321 const float cut_zMinU = min_z0 + maxOuterRadius*roi.
dzdrMinus();
322 const float cut_zMaxU = max_z0 + maxOuterRadius*roi.
dzdrPlus();
324 const float ptCoeff = 0.29997*1.9972/2.0;
326 float tripletPtMin = 0.8*
m_minPt;
328 float maxCurv = ptCoeff/tripletPtMin;
330 const float maxKappa_high_eta =
m_LRTmode ? 1.0*maxCurv : std::sqrt(0.8)*maxCurv;
331 const float maxKappa_low_eta =
m_LRTmode ? 1.0*maxCurv : std::sqrt(0.6)*maxCurv;
332 const float dphi_coeff =
m_LRTmode ? 1.0*maxCurv : 0.68*maxCurv;
334 const float minDeltaRadius = 2.0;
338 unsigned int nConnections = 0;
344 for(
const auto&
bg :
m_geo->bin_groups()) {
348 if(B1.
empty())
continue;
352 for(
const auto& b2_idx :
bg.second) {
356 if(B2.
empty())
continue;
361 deltaPhi = min_deltaPhi + dphi_coeff*std::fabs(rb2-rb1);
364 unsigned int first_it = 0;
366 for(
unsigned int n1Idx = 0;n1Idx<B1.
m_vn.size();n1Idx++) {
368 std::vector<unsigned int>& v1In = B1.
m_in[n1Idx];
372 const std::array<float, 5>& n1pars = B1.
m_params[n1Idx];
374 float phi1 = n1pars[2];
375 float r1 = n1pars[3];
376 float z1 = n1pars[4];
383 for(
unsigned int n2PhiIdx = first_it; n2PhiIdx<B2.
m_vPhiNodes.size();n2PhiIdx++) {
391 if(phi2 > maxPhi)
break;
393 unsigned int n2Idx = B2.
m_vPhiNodes[n2PhiIdx].second;
395 const std::vector<unsigned int>& v2In = B2.
m_in[n2Idx];
399 const std::array<float, 5>& n2pars = B2.
m_params[n2Idx];
401 float r2 = n2pars[3];
405 if(
dr < minDeltaRadius) {
409 float z2 = n2pars[4];
413 float ftau = std::fabs(tau);
418 if(ftau < n1pars[0])
continue;
419 if(ftau > n1pars[1])
continue;
421 if(ftau < n2pars[0])
continue;
422 if(ftau > n2pars[1])
continue;
426 float z0 = z1 -
r1*tau;
428 if(z0 < min_z0 || z0 > max_z0)
continue;
430 float zouter =
z0 + maxOuterRadius*tau;
432 if(zouter < cut_zMinU || zouter > cut_zMaxU)
continue;
435 float curv = (phi2-phi1)/
dr;
436 float abs_curv = std::abs(curv);
439 if(abs_curv > maxKappa_low_eta) {
444 if(abs_curv > maxKappa_high_eta) {
451 float exp_eta = std::sqrt(1+tau*tau)-tau;
453 bool isGood = v2In.size() <= 2;
457 float uat_1 = 1.0f/exp_eta;
459 for(
const auto& n2_in_idx : v2In) {
461 float tau2 = edgeStorage.at(n2_in_idx).m_p[0];
462 float tau_ratio = tau2*uat_1 - 1.0f;
464 if(std::fabs(tau_ratio) > cut_tau_ratio_max){
476 float dPhi2 = curv*
r2;
477 float dPhi1 = curv*
r1;
481 edgeStorage.emplace_back(B1.
m_vn[n1Idx], B2.
m_vn[n2Idx], exp_eta, curv, phi1 + dPhi1);
485 int outEdgeIdx = nEdges;
487 float uat_2 = 1/exp_eta;
488 float Phi2 = phi2 + dPhi2;
491 for(
const auto& inEdgeIdx : v2In) {
497 float tau_ratio = pS->
m_p[0]*uat_2 - 1.0f;
499 if(std::abs(tau_ratio) > cut_tau_ratio_max){
503 float dPhi = Phi2 - pS->
m_p[2];
508 if(dPhi < -cut_dphi_max || dPhi > cut_dphi_max) {
512 float dcurv = curv2 - pS->
m_p[1];
514 if(dcurv < -cut_dcurv_max || dcurv > cut_dcurv_max) {
530 return std::make_pair(nEdges, nConnections);
◆ createGraphNodes()
Definition at line 289 of file TrigInDetTrackSeedingTool.cxx.
293 for(
const auto& sp : *spColl) {
294 const auto&
pos = sp->globalPosition();
295 float xs =
pos.x() - shift_x;
296 float ys =
pos.y() - shift_y;
298 tmpColl[
idx].m_x = xs;
299 tmpColl[
idx].m_y = ys;
300 tmpColl[
idx].m_z = zs;
301 tmpColl[
idx].m_r = std::sqrt(xs*xs + ys*ys);
302 tmpColl[
idx].m_phi = std::atan2(ys,xs);
303 tmpColl[
idx].m_pSP = sp;
◆ finalize()
StatusCode TrigInDetTrackSeedingTool::finalize |
( |
| ) |
|
|
overridevirtual |
◆ findSeeds()
Definition at line 102 of file TrigInDetTrackSeedingTool.cxx.
110 float shift_x =
vertex.x() - beamSpotHandle->beamTilt(0)*
vertex.z();
111 float shift_y =
vertex.y() - beamSpotHandle->beamTilt(1)*
vertex.z();
113 std::unique_ptr<TrigFTF_GNN_DataStorage> storage = std::make_unique<TrigFTF_GNN_DataStorage>(*
m_geo);
118 std::vector<std::vector<TrigFTF_GNN_Node> > trigSpStorage[2];
124 if(!sctHandle.isValid()) {
131 std::vector<IdentifierHash> listOfSctIds;
133 m_regsel_sct->lookup(ctx)->HashIDList( internalRoI, listOfSctIds );
137 trigSpStorage[1].resize(h2l->size());
139 for(
const auto&
idx : listOfSctIds) {
141 short layerIndex = h2l->at(
static_cast<int>(
idx));
143 std::vector<TrigFTF_GNN_Node>& tmpColl = trigSpStorage[1].at(
static_cast<int>(
idx));
147 if(input_coll ==
nullptr)
continue;
160 if(!pixHandle.isValid()) {
165 pixelSpacePointsContainer = pixHandle.ptr();
167 std::vector<IdentifierHash> listOfPixIds;
169 m_regsel_pix->lookup(ctx)->HashIDList( internalRoI, listOfPixIds );
173 trigSpStorage[0].resize(h2l->size());
175 for(
const auto&
idx : listOfPixIds) {
177 short layerIndex = h2l->at(
static_cast<int>(
idx));
179 std::vector<TrigFTF_GNN_Node>& tmpColl = trigSpStorage[0].at(
static_cast<int>(
idx));
183 if(input_coll ==
nullptr)
continue;
203 std::vector<TrigFTF_GNN_Edge> edgeStorage;
205 std::pair<int, int> graphStats =
buildTheGraph(internalRoI, storage, edgeStorage);
207 ATH_MSG_DEBUG(
"Created graph with "<<graphStats.first<<
" edges and "<<graphStats.second<<
" edge links");
212 if(graphStats.second == 0)
return seedStats;
214 int maxLevel =
runCCA(graphStats.first, edgeStorage);
216 ATH_MSG_DEBUG(
"Reached Level "<<maxLevel<<
" after GNN iterations");
224 if(maxLevel < minLevel)
return seedStats;
226 std::vector<TrigFTF_GNN_Edge*> vSeeds;
228 vSeeds.reserve(graphStats.first/2);
230 for(
int edgeIndex=0;edgeIndex<graphStats.first;edgeIndex++) {
233 if(pS->
m_level < minLevel)
continue;
235 vSeeds.push_back(pS);
238 if(vSeeds.empty())
return seedStats;
246 output.reserve(vSeeds.size());
248 for(
auto pS : vSeeds) {
250 if(pS->
m_level == -1)
continue;
254 tFilter.followTrack(pS, rs);
256 if(!rs.m_initialized) {
260 if(
static_cast<int>(rs.m_vs.size()) < minLevel)
continue;
262 std::vector<const TrigFTF_GNN_Node*> vN;
264 for(std::vector<TrigFTF_GNN_Edge*>::reverse_iterator sIt=rs.m_vs.rbegin();sIt!=rs.m_vs.rend();++sIt) {
266 (*sIt)->m_level = -1;
268 if(sIt == rs.m_vs.rbegin()) {
269 vN.push_back((*sIt)->m_n1);
271 vN.push_back((*sIt)->m_n2);
274 if(vN.size()<3)
continue;
276 unsigned int lastIdx =
output.size();
277 output.emplace_back(rs.m_J);
279 for(
const auto&
n : vN) {
280 output[lastIdx].addSpacePoint(
n->m_pSP);
◆ initialize()
StatusCode TrigInDetTrackSeedingTool::initialize |
( |
| ) |
|
|
overridevirtual |
Definition at line 29 of file TrigInDetTrackSeedingTool.cxx.
54 ATH_MSG_FATAL(
"Both usePixelSpacePoints and useSctSpacePoints set to False. At least one needs to be True");
55 return StatusCode::FAILURE;
69 if (conn_fileName.empty()) {
70 ATH_MSG_FATAL(
"Cannot find layer connections file " << conn_fileName);
71 return StatusCode::FAILURE;
75 std::ifstream ifs(conn_fileName.c_str());
79 ATH_MSG_INFO(
"Layer connections are initialized from file " << conn_fileName);
◆ runCCA()
int TrigInDetTrackSeedingTool::runCCA |
( |
int |
nEdges, |
|
|
std::vector< TrigFTF_GNN_Edge > & |
edgeStorage |
|
) |
| const |
|
protected |
Definition at line 533 of file TrigInDetTrackSeedingTool.cxx.
535 const int maxIter = 15;
541 std::vector<TrigFTF_GNN_Edge*> v_old;
543 for(
int edgeIndex=0;edgeIndex<nEdges;edgeIndex++) {
546 if(pS->
m_nNei == 0)
continue;
551 for(;iter<maxIter;iter++) {
554 std::vector<TrigFTF_GNN_Edge*> v_new;
556 v_new.reserve(v_old.size());
558 for(
auto pS : v_old) {
562 for(
int nIdx=0;nIdx<pS->
m_nNei;nIdx++) {
564 unsigned int nextEdgeIdx = pS->
m_vNei[nIdx];
582 for(
auto pS : v_new) {
586 if(maxLevel < pS->m_level) maxLevel = pS->
m_level;
590 if(nChanges == 0)
break;
593 v_old = std::move(v_new);
◆ m_atlasId
◆ m_beamSpotKey
◆ m_connectionFile
StringProperty TrigInDetTrackSeedingTool::m_connectionFile {this, "ConnectionFileName", "binTables_ITK_RUN4.txt"} |
|
protected |
◆ m_connector
◆ m_doubletFilterRZ
BooleanProperty TrigInDetTrackSeedingTool::m_doubletFilterRZ {this, "Doublet_FilterRZ", true} |
|
protected |
◆ m_filter_phi
BooleanProperty TrigInDetTrackSeedingTool::m_filter_phi {this, "DoPhiFiltering", true} |
|
protected |
◆ m_geo
◆ m_layerGeometry
◆ m_layerNumberTool
◆ m_LRTmode
BooleanProperty TrigInDetTrackSeedingTool::m_LRTmode {this, "LRTMode",false} |
|
protected |
◆ m_minPt
FloatProperty TrigInDetTrackSeedingTool::m_minPt {this, "pTmin", 1000.0} |
|
protected |
◆ m_nMaxEdges
IntegerProperty TrigInDetTrackSeedingTool::m_nMaxEdges {this, "MaxGraphEdges", 2000000} |
|
protected |
◆ m_nMaxPhiSlice
UnsignedIntegerProperty TrigInDetTrackSeedingTool::m_nMaxPhiSlice {this, "nMaxPhiSlice", 53} |
|
protected |
◆ m_phiSliceWidth
float TrigInDetTrackSeedingTool::m_phiSliceWidth {} |
|
protected |
◆ m_pixelId
const PixelID* TrigInDetTrackSeedingTool::m_pixelId = nullptr |
|
protected |
◆ m_pixelSpacePointsContainerKey
◆ m_regsel_pix
ToolHandle<IRegSelTool> TrigInDetTrackSeedingTool::m_regsel_pix { this, "RegSelTool_Pixel", "RegSelTool/RegSelTool_Pixel" } |
|
protected |
◆ m_regsel_sct
ToolHandle<IRegSelTool> TrigInDetTrackSeedingTool::m_regsel_sct { this, "RegSelTool_SCT", "RegSelTool/RegSelTool_SCT" } |
|
protected |
◆ m_sctId
const SCT_ID* TrigInDetTrackSeedingTool::m_sctId = nullptr |
|
protected |
◆ m_sctSpacePointsContainerKey
◆ m_useBeamTilt
BooleanProperty TrigInDetTrackSeedingTool::m_useBeamTilt {this, "UseBeamTilt", false} |
|
protected |
◆ m_useEtaBinning
BooleanProperty TrigInDetTrackSeedingTool::m_useEtaBinning {this, "UseEtaBinning", true} |
|
protected |
◆ m_useML
BooleanProperty TrigInDetTrackSeedingTool::m_useML {this, "useML", true} |
|
protected |
◆ m_usePixelSpacePoints
BooleanProperty TrigInDetTrackSeedingTool::m_usePixelSpacePoints {this, "UsePixelSpacePoints", true} |
|
protected |
◆ m_useSctSpacePoints
BooleanProperty TrigInDetTrackSeedingTool::m_useSctSpacePoints {this, "UseSctSpacePoints", false} |
|
protected |
The documentation for this class was generated from the following files:
def retrieve(aClass, aKey=None)
def finalize(self)
_info( "content of StoreGate..." ) self.sg.dump()
std::vector< std::vector< unsigned int > > m_in
static std::string find_file(const std::string &logical_file_name, const std::string &search_path, SearchType search_type=LocalSearch)
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setInterceptInner setEtaMap setEtaBin setIsTgcFailure setDeltaPt deltaPhi
unsigned int m_vNei[N_SEG_CONNS]
virtual double dzdrMinus() const =0
return the gradients
virtual double dzdrPlus() const =0
void generatePhiIndexing(float)
std::vector< std::pair< float, unsigned int > > m_vPhiNodes
::StatusCode StatusCode
StatusCode definition for legacy code.
bool dPhi(const xAOD::TauJet &tau, const xAOD::TauTrack &track, double &out)
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
TrigFTF_GNN_EtaBin & getEtaBin(int idx)
int loadPixelGraphNodes(short, const std::vector< TrigFTF_GNN_Node > &, bool)
float getMaxBinRadius() const
class TrigFTF_GNN_TrackingFilter TrigFTF_GNN_TRACKING_FILTER
int nStrips(const MuonGM::TgcReadoutElement &readoutEle, int layer)
void initializeNodes(bool)
StatusCode initialize(bool used=true)
Eigen::Matrix< double, 3, 1 > Vector3D
virtual const T * indexFindPtr(IdentifierHash hashId) const override final
return pointer on the found entry or null if out of range using hashed index - fast version,...
virtual double zedPlus() const =0
the zed and eta values at the most forward and most rear ends of the RoI
void sort(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, const Compare &comp)
Specialization of sort for DataVector/List.
#define ATH_MSG_WARNING(x)
int loadStripGraphNodes(short, const std::vector< TrigFTF_GNN_Node > &)
virtual double zedMinus() const =0
std::vector< const TrigFTF_GNN_Node * > m_vn
size_type size() const noexcept
Returns the number of elements in the collection.
float getMinBinRadius() const
std::vector< std::array< float, 5 > > m_params