13 #include "GaudiKernel/EventContext.h"
27 (
const std::string&
t,
const std::string&
n,
const IInterface*
p)
55 static const float nonZeroInvP = 1
e-9;
58 std::vector<InDet::IZWindowRoISeedTool::ZWindow> listRoIs;
68 ATH_MSG_DEBUG(
"Input track collection size "<<tracks->size());
71 std::vector<Trk::Track*> selectedTracks;
73 float theta = trk->perigeeParameters()->parameters()[
Trk::theta];
74 float ptinv = std::abs(trk->perigeeParameters()->parameters()[
Trk::qOverP]) /
std::sin(theta);
77 if ( std::abs(ptinv) > nonZeroInvP ) {
78 float pt = 1. / ptinv;
86 float d0 = trk->perigeeParameters()->parameters()[
Trk::d0];
90 selectedTracks.push_back(trk);
94 ATH_MSG_DEBUG(
"Selected track collection size "<<selectedTracks.size());
98 for (
Trk::Track *trkLeading : selectedTracks ) {
100 float thetaLeading = trkLeading->perigeeParameters()->parameters()[
Trk::theta];
101 float ptInvLeading = std::abs(trkLeading->perigeeParameters()->parameters()[
Trk::qOverP]) /
std::sin(thetaLeading);
103 if (std::abs(ptInvLeading) > nonZeroInvP) {
104 float pt = 1. / ptInvLeading;
111 float z0Leading = trkLeading->perigeeParameters()->parameters()[
Trk::z0];
112 float z0 = trk->perigeeParameters()->parameters()[
Trk::z0];
116 auto leadAtBeam =
m_trackToVertex->perigeeAtBeamline(ctx, *trkLeading, *beamSpotHandle);
117 auto subleadAtBeam =
m_trackToVertex->perigeeAtBeamline(ctx, *trk, *beamSpotHandle);
118 float z0LeadingBeam = leadAtBeam->parameters()[
Trk::z0];
119 float z0Beam = subleadAtBeam->parameters()[
Trk::z0];
121 if ( std::abs(z0LeadingBeam - z0Beam) >
m_maxDeltaZ )
continue;
123 float z0TrkReference = subleadAtBeam->associatedSurface().center().z();
124 float z0TrkLeadingReference = leadAtBeam->associatedSurface().center().z();
125 RoI.
zReference = (z0Beam + z0TrkReference + z0LeadingBeam + z0TrkLeadingReference) / 2;
131 listRoIs.push_back(RoI);
136 if( listRoIs.empty() ){
137 for(
Trk::Track* trkLeading : selectedTracks ){
139 float thetaLeading = trkLeading->perigeeParameters()->parameters()[
Trk::theta];
140 float ptInvLeading = std::abs(trkLeading->perigeeParameters()->parameters()[
Trk::qOverP]) /
std::sin(thetaLeading);
142 if (std::abs(ptInvLeading) > nonZeroInvP) {
143 float pt = 1. / ptInvLeading;
147 auto leadAtBeam =
m_trackToVertex->perigeeAtBeamline(ctx, *trkLeading, *beamSpotHandle);
148 float z0LeadingBeam = leadAtBeam->parameters()[
Trk::z0];
151 float z0TrkLeadingReference = leadAtBeam->associatedSurface().center().z();
152 RoI.
zReference = z0LeadingBeam + z0TrkLeadingReference;
157 listRoIs.push_back(RoI);