Compute RoI.
55 static const float nonZeroInvP = 1
e-9;
58 std::vector<InDet::IZWindowRoISeedTool::ZWindow> listRoIs;
64 if ( not tracks.isValid() ) {
68 ATH_MSG_DEBUG(
"Input track collection size "<<tracks->size());
71 std::vector<Trk::Track*> selectedTracks;
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());
97 for (
Trk::Track *trkLeading : selectedTracks ) {
99 float thetaLeading = trkLeading->perigeeParameters()->parameters()[
Trk::theta];
100 float ptInvLeading = std::abs(trkLeading->perigeeParameters()->parameters()[
Trk::qOverP]) /
std::sin(thetaLeading);
102 if (std::abs(ptInvLeading) > nonZeroInvP) {
103 float pt = 1. / ptInvLeading;
110 float z0Leading = trkLeading->perigeeParameters()->parameters()[
Trk::z0];
111 float z0 = trk->perigeeParameters()->parameters()[
Trk::z0];
115 auto leadAtBeam =
m_trackToVertex->perigeeAtBeamline(ctx, *trkLeading, *beamSpotHandle);
116 auto subleadAtBeam =
m_trackToVertex->perigeeAtBeamline(ctx, *trk, *beamSpotHandle);
117 float z0LeadingBeam = leadAtBeam->parameters()[
Trk::z0];
118 float z0Beam = subleadAtBeam->parameters()[
Trk::z0];
120 if ( std::abs(z0LeadingBeam - z0Beam) >
m_maxDeltaZ )
continue;
122 float z0TrkReference = subleadAtBeam->associatedSurface().center().z();
123 float z0TrkLeadingReference = leadAtBeam->associatedSurface().center().z();
124 RoI.
zReference = (z0Beam + z0TrkReference + z0LeadingBeam + z0TrkLeadingReference) / 2;
130 listRoIs.push_back(RoI);
135 if( listRoIs.empty() ){
136 for(
Trk::Track* trkLeading : selectedTracks ){
138 float thetaLeading = trkLeading->perigeeParameters()->parameters()[
Trk::theta];
139 float ptInvLeading = std::abs(trkLeading->perigeeParameters()->parameters()[
Trk::qOverP]) /
std::sin(thetaLeading);
141 if (std::abs(ptInvLeading) > nonZeroInvP) {
142 float pt = 1. / ptInvLeading;
146 auto leadAtBeam =
m_trackToVertex->perigeeAtBeamline(ctx, *trkLeading, *beamSpotHandle);
147 float z0LeadingBeam = leadAtBeam->parameters()[
Trk::z0];
150 float z0TrkLeadingReference = leadAtBeam->associatedSurface().center().z();
151 RoI.
zReference = z0LeadingBeam + z0TrkLeadingReference;
156 listRoIs.push_back(RoI);