61 m_trackMaker(
"InDet::SiTrackMaker_xk/InDetTrigSiTrackMaker"),
62 m_trigInDetTrackFitter(
"TrigInDetTrackFitter"),
63 m_trigZFinder(
"TrigZFinder/TrigZFinder", this ),
64 m_trackSummaryTool(
"Trk::ITrackSummaryTool/ITrackSummaryTool"),
65 m_disTrkFitter(
"Trk::GlobalChi2Fitter/InDetTrackFitter"),
68 m_doZFinderOnly(false),
69 m_storeZFinderVertices(false),
72 m_countRoIwithEnoughHits(0),
73 m_countRoIwithTracks(0),
77 m_particleHypothesis(
Trk::
pion),
78 m_useNewLayerNumberScheme(false),
85 m_doDisappearingTrk(false),
87 m_standaloneMode(false)
98 declareProperty(
"zVertexResolution",
m_tcs.
m_zvError = 10.0,
" Half-width (mm) in z of z region used to filter seeds when doFastZVertexSeeding enabled" );
99 declareProperty(
"zVertexResolutionEndcap",
m_tcs.
m_zvErrorEndcap = -1,
" Half-width (mm) in z of region used to filter seeds when doFastZVertexSeeding enabled, for endcap pixels; set to zVertexResolution value later if left negative" );
149 "TrackCollection name");
153 "TrackCollection name");
253 ATH_MSG_INFO(
" FTF configures in Large Radius Tracking Mode");
263 float lut_range[4] = {0.0,3.0,0.0,9.0};
267 if (lut_fileName.empty()) {
268 ATH_MSG_ERROR(
"Cannot find TrigSeedML LUT file " << lut_fileName);
269 return StatusCode::FAILURE;
273 std::ifstream ifs(lut_fileName.c_str());
276 ifs >>
row >> col0 >> col1;
289 ATH_MSG_FATAL(
"Cannot find layer connections file " << conn_fileName);
290 return StatusCode::FAILURE;
294 std::ifstream ifs(conn_fileName.c_str());
298 ATH_MSG_INFO(
"Layer connections are initialized from file " << conn_fileName);
371 return StatusCode::SUCCESS;
388 const std::vector<TrigInDetSiLayer>* pVL =
m_numberingTool->layerGeometry();
399 return StatusCode::SUCCESS;
406 outputTracks = std::make_unique<TrackCollection>();
431 if ( roiCollection->
size()>1 )
ATH_MSG_WARNING(
"More than one Roi in the collection: " <<
m_roiCollectionKey <<
", this is not supported - use a composite Roi: Using the first Roi ONLY" );
433 if ( roiCollection->
size()==0) {
435 return StatusCode::FAILURE;
448 return StatusCode::SUCCESS;
457 const EventContext& ctx)
const {
461 std::vector<int> vec_seedSize;
477 auto monTime =
Monitored::Group(
m_monTool, mnt_roi_nTracks, mnt_roi_nSPs, mnt_timer_Total, mnt_timer_SpacePointConversion,
478 mnt_timer_PatternReco, mnt_timer_TripletMaking, mnt_timer_CombTracking, mnt_timer_TrackFitter,
479 mnt_timer_dEdxTrk, mnt_timer_disTrkZVertex, mnt_timer_disTrk);
484 mnt_timer_Total.start();
485 mnt_timer_SpacePointConversion.start();
488 mnt_roi_lastStageExecuted = 1;
490 std::vector<TrigSiSpacePointBase> convertedSpacePoints;
491 convertedSpacePoints.reserve(5000);
493 std::map<Identifier, std::vector<long int> > siClusterMap;
499 long int trackIndex=0;
504 ATH_CHECK(
m_spacePointTool->getSpacePoints(roi, convertedSpacePoints, mnt_roi_nSPsPIX, mnt_roi_nSPsSCT, ctx, &siClusterMap));
510 mnt_timer_SpacePointConversion.stop();
511 mnt_roi_nSPs = mnt_roi_nSPsPIX + mnt_roi_nSPsSCT;
514 ATH_MSG_DEBUG(
"REGTEST / Found " << mnt_roi_nSPs <<
" space points.");
515 ATH_MSG_DEBUG(
"REGTEST / Found " << mnt_roi_nSPsPIX <<
" Pixel space points.");
516 ATH_MSG_DEBUG(
"REGTEST / Found " << mnt_roi_nSPsSCT <<
" SCT space points.");
517 ATH_MSG_DEBUG(
"REGTEST / converted space points size = " << convertedSpacePoints.size());
521 ATH_MSG_DEBUG(
"No tracks found - too few hits in ROI to run " << mnt_roi_nSPs);
523 return StatusCode::SUCCESS;
526 mnt_roi_lastStageExecuted = 2;
530 std::unique_ptr<TrigRoiDescriptor> tmpRoi = std::make_unique<TrigRoiDescriptor>(roi);
533 auto vertices = std::make_unique<TrigVertexCollection>();
534 std::vector<float> vZv;
539 mnt_timer_ZFinder.start();
542 tmpRoi = std::make_unique<TrigRoiDescriptor>(
true);
545 vertices = std::make_unique<TrigVertexCollection>(*
m_trigZFinder->findZ( convertedSpacePoints, roi));
551 vZv.reserve(vertices->size());
552 for (
const auto vertex : *vertices) {
555 float zMinus =
z - 7.0;
556 float zPlus =
z + 7.0;
566 mnt_timer_ZFinder.stop();
574 return StatusCode::SUCCESS;
579 mnt_roi_lastStageExecuted = 3;
581 mnt_timer_PatternReco.start();
583 mnt_timer_TripletMaking.start();
585 std::vector<TrigInDetTriplet> triplets;
586 std::vector<GNN_TrigTracklet> tracklets;
591 seedGen.loadSpacePoints(convertedSpacePoints);
596 std::vector<GNN_TrigTracklet> vGNN_Tracks;
599 vec_seedSize.reserve(tracklets.size());
600 for(
auto&
track : tracklets) {
601 vec_seedSize.push_back(
track.m_track.size());
604 for(
auto&
track : tracklets) {
605 for(
auto& seed :
track.m_seeds) {
606 triplets.emplace_back(seed);
609 vec_seedSize.push_back(
track.m_seeds.size());
616 seedGen.loadSpacePoints(convertedSpacePoints);
619 seedGen.createSeeds(tmpRoi.get(), vZv);
622 seedGen.createSeeds(tmpRoi.get());
625 seedGen.getSeeds(triplets);
636 unsigned int nTrackSeeds =
m_useTracklets ? tracklets.size() : triplets.size();
640 mnt_timer_TripletMaking.stop();
641 mnt_roi_lastStageExecuted = 4;
643 mnt_timer_CombTracking.start();
647 std::vector<std::tuple<bool, double,Trk::Track*>> qualityTracks;
648 qualityTracks.reserve(nTrackSeeds);
653 long int trackIndex=0;
661 std::vector<Trk::Track*> disFailTrks;
662 std::vector<Trk::Track*> disCombTrks;
663 std::vector<std::tuple<bool, double, Trk::Track*>> qualityDisFailTrks;
664 std::vector<std::tuple<bool, double, Trk::Track*>> qualityDisCombTrks;
665 int disTrk_n_disCombTrks=0;
666 int disTrk_n_disCombTrks_cleaning=0;
667 int disTrk_n_disFailTrks=0;
668 int disTrk_n_disFailTrks_cleaning=0;
672 for(
unsigned int seedIdx=0;seedIdx!=nTrackSeeds;seedIdx++) {
674 std::vector<const Trk::SpacePoint*> spVec;
677 for(
const auto& sp : tracklets[seedIdx].m_track) {
678 spVec.push_back(sp->offlineSpacePoint());
688 spVec = {osp1, osp2, osp3};
693 std::vector<Identifier> clusterIds;
703 std::list<Trk::Track*> tracks;
704 std::list<Trk::Track*> tracksFail;
705 std::list<Trk::Track*> tracksAll =
m_trackMaker->getTracks(ctx, trackEventData, spVec);
711 tracksFail = tracksAll;
715 ATH_MSG_VERBOSE(
"size of tracks=" << tracks.size() <<
", tracksFail=" << tracksFail.size() <<
": resultCode=" << resultCode);
717 for(std::list<Trk::Track*>::const_iterator
t=tracks.begin();
t!=tracks.end(); ++
t) {
718 if( ! (*
t) )
continue;
720 disTrk_n_disCombTrks++;
723 disTrk_n_disCombTrks_cleaning++;
724 disCombTrks.push_back((*
t));
725 qualityDisCombTrks.emplace_back(std::make_tuple(
true, -
disTrackQuality((*
t)), (*
t)));
728 for(std::list<Trk::Track*>::const_iterator
t=tracksFail.begin();
t!=tracksFail.end(); ++
t) {
729 if( ! (*
t) )
continue;
731 disTrk_n_disFailTrks++;
734 disTrk_n_disFailTrks_cleaning++;
735 disFailTrks.push_back((*
t));
736 qualityDisFailTrks.emplace_back(std::make_tuple(
true, -
disTrackQuality((*
t)), (*
t)));
744 for(std::list<Trk::Track*>::const_iterator
t=tracks.begin();
t!=tracks.end(); ++
t) {
746 float d0 = (*t)->perigeeParameters()==0 ? 10000.0 : (*t)->perigeeParameters()->parameters()[
Trk::d0];
749 qualityTracks.push_back(std::make_tuple(
false,0,(*
t)));
757 qualityTracks.push_back(std::make_tuple(
true, -
trackQuality((*
t)), (*
t)));
760 qualityTracks.push_back(std::make_tuple(
true, 0, (*
t)));
768 ATH_MSG_DEBUG(
"===> nr of disFailTrks=" << disTrk_n_disFailTrks <<
" -> cleaning pass=" << disTrk_n_disFailTrks_cleaning);
769 ATH_MSG_DEBUG(
"===> nr of disCombTrks=" << disTrk_n_disCombTrks <<
" -> cleaning pass=" << disTrk_n_disCombTrks_cleaning);
786 initialTracks.
reserve(qualityTracks.size());
792 std::vector<unsigned int> indexDisCombTrk;
793 for(
const auto&
q : qualityTracks) {
794 bool needed_for_disCombTrk =
false;
797 for(
const auto& qdis : qualityDisCombTrks ) {
798 if( std::get<2>(qdis) == trk_q ) {
799 needed_for_disCombTrk = std::get<0>(qdis);
803 if( needed_for_disCombTrk)
ATH_MSG_VERBOSE(
"idx=" <<
idx <<
" ===> neded for disCombTrk");
805 if (std::get<0>(
q)==
true) {
811 delete std::get<2>(
q);
814 if( needed_for_disCombTrk ) {
819 delete std::get<2>(
q);
825 qualityTracks.clear();
830 mnt_timer_CombTracking.stop();
831 mnt_timer_PatternReco.stop();
833 mnt_roi_lastStageExecuted = 5;
835 mnt_timer_TrackFitter.start();
843 outputTracks = std::move(initialTracks);
852 mnt_timer_dEdxTrk.start();
860 if( outputTracks.
empty() ) {
865 bool do_recoverDisCombTrk =
true;
867 ATH_MSG_DEBUG(
"part of initialTracks fails in fitting. do not try to recover DisCombTracks");
868 do_recoverDisCombTrk =
false;
872 fittedExtraDisCombTracks.
reserve(extraDisCombTracks.
size());
876 if( extraDisCombTracks.
size() > 0 ) {
879 for (
auto fittedTrack = fittedExtraDisCombTracks.
begin(); fittedTrack!=fittedExtraDisCombTracks.
end(); ++fittedTrack) {
882 fittedDisCombTrks.
push_back(*fittedTrack);
889 for (
auto fittedTrack = outputTracks.
begin(); fittedTrack!=outputTracks.
end(); ) {
890 if ((*fittedTrack)->perigeeParameters()) {
891 float d0 = (*fittedTrack)->perigeeParameters()->parameters()[
Trk::d0];
892 float z0 = (*fittedTrack)->perigeeParameters()->parameters()[
Trk::z0];
895 ATH_MSG_DEBUG(
"REGTEST / Reject track after fit with d0 = " <<
d0 <<
" z0= " <<
z0
902 fittedTrack = outputTracks.
erase(fittedTrack);
911 fittedTrack = outputTracks.
erase(fittedTrack);
920 if(std::abs((*fittedTrack)->perigeeParameters()->parameters()[
Trk::qOverP]) >= 1
e-9){
921 trkPt =
std::sin((*fittedTrack)->perigeeParameters()->parameters()[
Trk::theta])/std::abs((*fittedTrack)->perigeeParameters()->parameters()[
Trk::qOverP]);
925 fittedTrack = outputTracks.
erase(fittedTrack);
935 mnt_timer_TrackFitter.stop();
942 for (
auto fittedTrack = outputTracks.
begin();fittedTrack!=outputTracks.
end();++fittedTrack) {
952 if(
std::find(indexDisCombTrk.begin(),indexDisCombTrk.end(),
idx)!=indexDisCombTrk.end() ) {
954 fittedDisCombTrks.
push_back(*fittedTrack);
962 if( outputTracks.
empty() ) {
965 mnt_roi_lastStageExecuted = 6;
967 mnt_roi_nTracks = outputTracks.
size();
970 std::vector<double> disTrk_v_xVtx;
971 std::vector<double> disTrk_v_yVtx;
972 std::vector<double> disTrk_v_zVtx;
974 mnt_timer_disTrkZVertex.start();
976 mnt_timer_disTrkZVertex.stop();
981 mnt_timer_disTrk.start();
982 ATH_CHECK(
findDisTracks(ctx,outputTracks,qualityDisFailTrks,qualityDisCombTrks,fittedDisCombTrks,disTrk_v_xVtx,disTrk_v_yVtx,disTrk_v_zVtx) );
983 mnt_timer_disTrk.stop();
989 if( !outputTracks.
empty() )
993 fillMon(outputTracks, *vertices, roi, ctx);
995 mnt_roi_lastStageExecuted = 7;
997 mnt_timer_Total.stop();
999 return StatusCode::SUCCESS;
1008 double quality = 0. ;
1009 const double W = 17.;
1027 std::set<const Trk::PrepRawData*>
clusters;
1031 std::sort(QT.begin(), QT.end(),
1032 [](
const std::tuple<bool, double, Trk::Track*>& lhs,
const std::tuple<bool, double, Trk::Track*>& rhs) {
1033 return std::get<1>(lhs) < std::get<1>(rhs); } );
1035 for (
auto&
q : QT) {
1037 m = std::get<2>(
q)->measurementsOnTrack()->begin(),
1038 me = std::get<2>(
q)->measurementsOnTrack()->end ();
1041 for(;
m!=me; ++
m ) {
1053 std::get<0>(
q) =
false;
1063 ATH_MSG_INFO(
"=========================================================");
1064 ATH_MSG_INFO(
"TrigFastTrackFinder::finalize() - TrigFastTrackFinder Statistics: ");
1068 ATH_MSG_INFO(
"=========================================================");
1070 return StatusCode::SUCCESS;
1079 if (siCLOT==
nullptr)
continue;
1081 if (siCL==
nullptr)
continue;
1086 if(pixCL==
nullptr)
continue;
1090 clusterMap[
id].push_back(trackIdx);
1096 if(pCL!=
nullptr) vIds.push_back(pCL->
identify());
1099 if(pCL!=
nullptr) vIds.push_back(pCL->
identify());
1104 std::vector<long int> xSection;
1106 std::map<Identifier, std::vector<long int> >
::iterator itm0 = clusterMap.find(*vIds.begin());
1107 if(itm0 == clusterMap.end())
return false;
1108 xSection.reserve((*itm0).second.size());
1109 std::copy((*itm0).second.begin(), (*itm0).second.end(), std::back_inserter(xSection));
1110 std::vector<Identifier>::const_iterator
it = vIds.begin();++
it;
1111 for(;
it!=vIds.end();++
it) {
1112 std::map<Identifier, std::vector<long int> >
::iterator itm1 = clusterMap.find(*
it);
1113 if(itm1 == clusterMap.end())
return false;
1114 std::vector<long int>
tmp;
1115 std::set_intersection(xSection.begin(), xSection.end(), (*itm1).second.begin(),(*itm1).second.end(), std::back_inserter(
tmp));
1116 if(
tmp.empty())
return false;
1119 xSection.reserve(
tmp.size());
1122 return !xSection.empty();
1139 auto monRoI =
Monitored::Group(
m_monTool, mnt_roi_eta, mnt_roi_phi, mnt_roi_etaWidth, mnt_roi_phiWidth, mnt_roi_z, mnt_roi_zWidth);
1142 for(
unsigned int i=0;
i<roi.
size();
i++) {
1145 mnt_roi_eta = subroi->
eta();
1146 mnt_roi_phi = subroi->
phi();
1149 mnt_roi_z = subroi->
zed();
1156 mnt_roi_eta = roi.
eta();
1157 mnt_roi_phi = roi.
phi();
1160 mnt_roi_z = roi.
zed();
1164 std::vector<float> mnt_trk_pt;
1165 std::vector<float> mnt_trk_a0;
1166 std::vector<float> mnt_trk_z0;
1167 std::vector<float> mnt_trk_phi0;
1168 std::vector<float> mnt_trk_eta;
1169 std::vector<float> mnt_trk_chi2dof;
1170 std::vector<float> mnt_trk_nSiHits;
1171 std::vector<float> mnt_trk_nPIXHits;
1172 std::vector<float> mnt_trk_nSCTHits;
1173 std::vector<float> mnt_trk_a0beam;
1174 std::vector<float> mnt_trk_z0beam;
1175 std::vector<float> mnt_trk_dPhi0;
1176 std::vector<float> mnt_trk_dEta;
1192 mon_nSiHits, mon_nPIXHits, mon_nSCTHits, mon_a0beam, mon_z0beam, mon_dPhi0, mon_dEta);
1194 std::vector<float> mnt_roi_zVertices;
1198 mon_roi_nZvertices = vertices.
size();
1199 for (
const auto vertex : vertices) {
1200 mnt_roi_zVertices.push_back(
vertex->z());
1203 for (
auto track : tracks) {
1205 if(trackPars==
nullptr) {
1209 if(trackPars->covariance()==
nullptr) {
1213 float a0 = trackPars->parameters()[
Trk::d0];
1214 float z0 = trackPars->parameters()[
Trk::z0];
1218 mnt_trk_a0.push_back(
a0);
1219 mnt_trk_z0.push_back(
z0);
1220 mnt_trk_phi0.push_back(
phi0);
1223 mnt_trk_eta.push_back(
eta);
1224 for(
unsigned int i=0;
i<roi.
size();
i++) {
1226 mnt_trk_dEta.push_back(
eta - (roi.
at(
i))->eta());
1245 mnt_trk_pt.push_back(
pT);
1246 mnt_trk_chi2dof.push_back(
chi2);
1250 for(
auto tSOS =
track->trackStateOnSurfaces()->begin();
1251 tSOS!=
track->trackStateOnSurfaces()->end(); ++tSOS) {
1260 mnt_trk_nPIXHits.push_back(nPix);
1261 mnt_trk_nSCTHits.push_back(nSct/2);
1262 mnt_trk_nSiHits.push_back(nPix + nSct/2);
1264 ATH_MSG_DEBUG(
"REGTEST / track npix/nsct/phi0/pt/eta/d0/z0/chi2: " <<
1274 bool goodTrack = std::fabs(
pT)>1000. && (nPix + nSct/2) > 3 && nSct > 0;
1283 std::vector<float> mnt_layer_IBL;
1284 std::vector<float> mnt_layer_PixB;
1285 std::vector<float> mnt_layer_PixE;
1286 std::vector<float> mnt_layer_SCTB;
1287 std::vector<float> mnt_layer_SCTE;
1288 std::vector<float> mnt_hit_IBLPhiResidual;
1289 std::vector<float> mnt_hit_IBLEtaResidual;
1290 std::vector<float> mnt_hit_IBLPhiPull;
1291 std::vector<float> mnt_hit_IBLEtaPull;
1292 std::vector<float> mnt_hit_PIXBarrelPhiResidual;
1293 std::vector<float> mnt_hit_PIXBarrelEtaResidual;
1294 std::vector<float> mnt_hit_PIXBarrelPhiPull;
1295 std::vector<float> mnt_hit_PIXBarrelEtaPull;
1296 std::vector<float> mnt_hit_SCTBarrelResidual;
1297 std::vector<float> mnt_hit_SCTBarrelPull;
1298 std::vector<float> mnt_hit_PIXEndcapPhiResidual;
1299 std::vector<float> mnt_hit_PIXEndcapEtaResidual;
1300 std::vector<float> mnt_hit_PIXEndcapPhiPull;
1301 std::vector<float> mnt_hit_PIXEndcapEtaPull;
1302 std::vector<float> mnt_hit_SCTEndcapResidual;
1303 std::vector<float> mnt_hit_SCTEndcapPull;
1304 std::vector<float> mnt_hit_PIXBarrelL1PhiResidual;
1305 std::vector<float> mnt_hit_PIXBarrelL1EtaResidual;
1306 std::vector<float> mnt_hit_PIXBarrelL2PhiResidual;
1307 std::vector<float> mnt_hit_PIXBarrelL2EtaResidual;
1308 std::vector<float> mnt_hit_PIXBarrelL3PhiResidual;
1309 std::vector<float> mnt_hit_PIXBarrelL3EtaResidual;
1310 std::vector<float> mnt_hit_PIXEndcapL1PhiResidual;
1311 std::vector<float> mnt_hit_PIXEndcapL1EtaResidual;
1312 std::vector<float> mnt_hit_PIXEndcapL2PhiResidual;
1313 std::vector<float> mnt_hit_PIXEndcapL2EtaResidual;
1314 std::vector<float> mnt_hit_PIXEndcapL3PhiResidual;
1315 std::vector<float> mnt_hit_PIXEndcapL3EtaResidual;
1316 std::vector<float> mnt_hit_SCTBarrelL1PhiResidual;
1317 std::vector<float> mnt_hit_SCTBarrelL2PhiResidual;
1318 std::vector<float> mnt_hit_SCTBarrelL3PhiResidual;
1319 std::vector<float> mnt_hit_SCTBarrelL4PhiResidual;
1320 std::vector<float> mnt_hit_SCTEndcapL1PhiResidual;
1321 std::vector<float> mnt_hit_SCTEndcapL2PhiResidual;
1322 std::vector<float> mnt_hit_SCTEndcapL3PhiResidual;
1323 std::vector<float> mnt_hit_SCTEndcapL4PhiResidual;
1324 std::vector<float> mnt_hit_SCTEndcapL5PhiResidual;
1325 std::vector<float> mnt_hit_SCTEndcapL6PhiResidual;
1326 std::vector<float> mnt_hit_SCTEndcapL7PhiResidual;
1327 std::vector<float> mnt_hit_SCTEndcapL8PhiResidual;
1328 std::vector<float> mnt_hit_SCTEndcapL9PhiResidual;
1338 auto mon_hit_PIXBarrelPhiResidual =
Monitored::Collection(
"hit_PIXBarrelPhiResidual",mnt_hit_PIXBarrelPhiResidual);
1339 auto mon_hit_PIXBarrelEtaResidual =
Monitored::Collection(
"hit_PIXBarrelEtaResidual",mnt_hit_PIXBarrelEtaResidual);
1340 auto mon_hit_PIXBarrelPhiPull =
Monitored::Collection(
"hit_PIXBarrelPhiPull",mnt_hit_PIXBarrelPhiPull);
1341 auto mon_hit_PIXBarrelEtaPull =
Monitored::Collection(
"hit_PIXBarrelEtaPull",mnt_hit_PIXBarrelEtaPull);
1342 auto mon_hit_SCTBarrelResidual =
Monitored::Collection(
"hit_SCTBarrelResidual",mnt_hit_SCTBarrelResidual);
1344 auto mon_hit_PIXEndcapPhiResidual =
Monitored::Collection(
"hit_PIXEndcapPhiResidual",mnt_hit_PIXEndcapPhiResidual);
1345 auto mon_hit_PIXEndcapEtaResidual =
Monitored::Collection(
"hit_PIXEndcapEtaResidual",mnt_hit_PIXEndcapEtaResidual);
1346 auto mon_hit_PIXEndcapPhiPull =
Monitored::Collection(
"hit_PIXEndcapPhiPull",mnt_hit_PIXEndcapPhiPull);
1347 auto mon_hit_PIXEndcapEtaPull =
Monitored::Collection(
"hit_PIXEndcapEtaPull",mnt_hit_PIXEndcapEtaPull);
1348 auto mon_hit_SCTEndcapResidual =
Monitored::Collection(
"hit_SCTEndcapResidual",mnt_hit_SCTEndcapResidual);
1350 auto mon_hit_PIXBarrelL1PhiResidual =
Monitored::Collection(
"hit_PIXBarrelL1PhiResidual",mnt_hit_PIXBarrelL1PhiResidual);
1351 auto mon_hit_PIXBarrelL1EtaResidual =
Monitored::Collection(
"hit_PIXBarrelL1EtaResidual",mnt_hit_PIXBarrelL1EtaResidual);
1352 auto mon_hit_PIXBarrelL2PhiResidual =
Monitored::Collection(
"hit_PIXBarrelL2PhiResidual",mnt_hit_PIXBarrelL2PhiResidual);
1353 auto mon_hit_PIXBarrelL2EtaResidual =
Monitored::Collection(
"hit_PIXBarrelL2EtaResidual",mnt_hit_PIXBarrelL2EtaResidual);
1354 auto mon_hit_PIXBarrelL3PhiResidual =
Monitored::Collection(
"hit_PIXBarrelL3PhiResidual",mnt_hit_PIXBarrelL3PhiResidual);
1355 auto mon_hit_PIXBarrelL3EtaResidual =
Monitored::Collection(
"hit_PIXBarrelL3EtaResidual",mnt_hit_PIXBarrelL3EtaResidual);
1356 auto mon_hit_PIXEndcapL1PhiResidual =
Monitored::Collection(
"hit_PIXEndcapL1PhiResidual",mnt_hit_PIXEndcapL1PhiResidual);
1357 auto mon_hit_PIXEndcapL1EtaResidual =
Monitored::Collection(
"hit_PIXEndcapL1EtaResidual",mnt_hit_PIXEndcapL1EtaResidual);
1358 auto mon_hit_PIXEndcapL2PhiResidual =
Monitored::Collection(
"hit_PIXEndcapL2PhiResidual",mnt_hit_PIXEndcapL2PhiResidual);
1359 auto mon_hit_PIXEndcapL2EtaResidual =
Monitored::Collection(
"hit_PIXEndcapL2EtaResidual",mnt_hit_PIXEndcapL2EtaResidual);
1360 auto mon_hit_PIXEndcapL3PhiResidual =
Monitored::Collection(
"hit_PIXEndcapL3PhiResidual",mnt_hit_PIXEndcapL3PhiResidual);
1361 auto mon_hit_PIXEndcapL3EtaResidual =
Monitored::Collection(
"hit_PIXEndcapL3EtaResidual",mnt_hit_PIXEndcapL3EtaResidual);
1362 auto mon_hit_SCTBarrelL1PhiResidual =
Monitored::Collection(
"hit_SCTBarrelL1PhiResidual",mnt_hit_SCTBarrelL1PhiResidual);
1363 auto mon_hit_SCTBarrelL2PhiResidual =
Monitored::Collection(
"hit_SCTBarrelL2PhiResidual",mnt_hit_SCTBarrelL2PhiResidual);
1364 auto mon_hit_SCTBarrelL3PhiResidual =
Monitored::Collection(
"hit_SCTBarrelL3PhiResidual",mnt_hit_SCTBarrelL3PhiResidual);
1365 auto mon_hit_SCTBarrelL4PhiResidual =
Monitored::Collection(
"hit_SCTBarrelL4PhiResidual",mnt_hit_SCTBarrelL4PhiResidual);
1366 auto mon_hit_SCTEndcapL1PhiResidual =
Monitored::Collection(
"hit_SCTEndcapL1PhiResidual",mnt_hit_SCTEndcapL1PhiResidual);
1367 auto mon_hit_SCTEndcapL2PhiResidual =
Monitored::Collection(
"hit_SCTEndcapL2PhiResidual",mnt_hit_SCTEndcapL2PhiResidual);
1368 auto mon_hit_SCTEndcapL3PhiResidual =
Monitored::Collection(
"hit_SCTEndcapL3PhiResidual",mnt_hit_SCTEndcapL3PhiResidual);
1369 auto mon_hit_SCTEndcapL4PhiResidual =
Monitored::Collection(
"hit_SCTEndcapL4PhiResidual",mnt_hit_SCTEndcapL4PhiResidual);
1370 auto mon_hit_SCTEndcapL5PhiResidual =
Monitored::Collection(
"hit_SCTEndcapL5PhiResidual",mnt_hit_SCTEndcapL5PhiResidual);
1371 auto mon_hit_SCTEndcapL6PhiResidual =
Monitored::Collection(
"hit_SCTEndcapL6PhiResidual",mnt_hit_SCTEndcapL6PhiResidual);
1372 auto mon_hit_SCTEndcapL7PhiResidual =
Monitored::Collection(
"hit_SCTEndcapL7PhiResidual",mnt_hit_SCTEndcapL7PhiResidual);
1373 auto mon_hit_SCTEndcapL8PhiResidual =
Monitored::Collection(
"hit_SCTEndcapL8PhiResidual",mnt_hit_SCTEndcapL8PhiResidual);
1374 auto mon_hit_SCTEndcapL9PhiResidual =
Monitored::Collection(
"hit_SCTEndcapL9PhiResidual",mnt_hit_SCTEndcapL9PhiResidual);
1376 auto monRes =
Monitored::Group(
m_monTool, mon_layer_IBL, mon_layer_PixB, mon_layer_PixE, mon_layer_SCTB, mon_layer_SCTE, mon_hit_IBLPhiResidual, mon_hit_IBLEtaResidual, mon_hit_IBLPhiPull, mon_hit_IBLEtaPull, mon_hit_PIXBarrelPhiResidual, mon_hit_PIXBarrelEtaResidual, mon_hit_PIXBarrelPhiPull, mon_hit_PIXBarrelEtaPull, mon_hit_SCTBarrelResidual, mon_hit_SCTBarrelPull, mon_hit_PIXEndcapPhiResidual, mon_hit_PIXEndcapEtaResidual, mon_hit_PIXEndcapPhiPull, mon_hit_PIXEndcapEtaPull, mon_hit_SCTEndcapResidual, mon_hit_SCTEndcapPull, mon_hit_PIXBarrelL1PhiResidual, mon_hit_PIXBarrelL1EtaResidual, mon_hit_PIXBarrelL2PhiResidual, mon_hit_PIXBarrelL2EtaResidual, mon_hit_PIXBarrelL3PhiResidual, mon_hit_PIXBarrelL3EtaResidual, mon_hit_PIXEndcapL1PhiResidual, mon_hit_PIXEndcapL1EtaResidual, mon_hit_PIXEndcapL2PhiResidual, mon_hit_PIXEndcapL2EtaResidual, mon_hit_PIXEndcapL3PhiResidual, mon_hit_PIXEndcapL3EtaResidual, mon_hit_SCTBarrelL1PhiResidual, mon_hit_SCTBarrelL2PhiResidual, mon_hit_SCTBarrelL3PhiResidual, mon_hit_SCTBarrelL4PhiResidual, mon_hit_SCTEndcapL1PhiResidual, mon_hit_SCTEndcapL2PhiResidual, mon_hit_SCTEndcapL3PhiResidual, mon_hit_SCTEndcapL4PhiResidual, mon_hit_SCTEndcapL5PhiResidual, mon_hit_SCTEndcapL6PhiResidual, mon_hit_SCTEndcapL7PhiResidual, mon_hit_SCTEndcapL8PhiResidual, mon_hit_SCTEndcapL9PhiResidual);
1378 std::vector<TrigL2HitResidual> vResid;
1381 if(!scRes.isSuccess())
return;
1387 switch(
it->regionId()) {
1389 mnt_layer_PixB.push_back(pixlayer);
1390 mnt_hit_PIXBarrelPhiResidual.push_back(
it->phiResidual());
1391 mnt_hit_PIXBarrelPhiPull.push_back(
it->phiPull());
1392 mnt_hit_PIXBarrelEtaResidual.push_back(
it->etaResidual());
1393 mnt_hit_PIXBarrelEtaPull.push_back(
it->etaPull());
1394 if (pixlayer == 1) {
1395 mnt_hit_PIXBarrelL1PhiResidual.push_back(
it->phiResidual());
1396 mnt_hit_PIXBarrelL1EtaResidual.push_back(
it->etaResidual());
1398 if (pixlayer == 2) {
1399 mnt_hit_PIXBarrelL2PhiResidual.push_back(
it->phiResidual());
1400 mnt_hit_PIXBarrelL2EtaResidual.push_back(
it->etaResidual());
1402 if (pixlayer == 3) {
1403 mnt_hit_PIXBarrelL3PhiResidual.push_back(
it->phiResidual());
1404 mnt_hit_PIXBarrelL3EtaResidual.push_back(
it->etaResidual());
1409 mnt_layer_PixE.push_back(pixlayer);
1410 mnt_hit_PIXEndcapPhiResidual.push_back(
it->phiResidual());
1411 mnt_hit_PIXEndcapPhiPull.push_back(
it->phiPull());
1412 mnt_hit_PIXEndcapEtaResidual.push_back(
it->etaResidual());
1413 mnt_hit_PIXEndcapEtaPull.push_back(
it->etaPull());
1414 if (pixlayer == 0) {
1415 mnt_hit_PIXEndcapL1PhiResidual.push_back(
it->phiResidual());
1416 mnt_hit_PIXEndcapL1EtaResidual.push_back(
it->etaResidual());
1418 if (pixlayer == 1) {
1419 mnt_hit_PIXEndcapL2PhiResidual.push_back(
it->phiResidual());
1420 mnt_hit_PIXEndcapL2EtaResidual.push_back(
it->etaResidual());
1422 if (pixlayer == 2) {
1423 mnt_hit_PIXEndcapL3PhiResidual.push_back(
it->phiResidual());
1424 mnt_hit_PIXEndcapL3EtaResidual.push_back(
it->etaResidual());
1428 mnt_layer_SCTB.push_back(sctlayer);
1429 mnt_hit_SCTBarrelResidual.push_back(
it->phiResidual());
1430 mnt_hit_SCTBarrelPull.push_back(
it->phiPull());
1431 if (sctlayer == 0) {
1432 mnt_hit_SCTBarrelL1PhiResidual.push_back(
it->phiResidual());
1434 if (sctlayer == 1) {
1435 mnt_hit_SCTBarrelL2PhiResidual.push_back(
it->phiResidual());
1437 if (sctlayer == 2) {
1438 mnt_hit_SCTBarrelL3PhiResidual.push_back(
it->phiResidual());
1440 if (sctlayer == 3) {
1441 mnt_hit_SCTBarrelL4PhiResidual.push_back(
it->phiResidual());
1446 mnt_layer_SCTE.push_back(sctlayer);
1447 mnt_hit_SCTEndcapResidual.push_back(
it->phiResidual());
1448 mnt_hit_SCTEndcapPull.push_back(
it->phiPull());
1449 if (sctlayer == 0) {
1450 mnt_hit_SCTEndcapL1PhiResidual.push_back(
it->phiResidual());
1452 if (sctlayer == 1) {
1453 mnt_hit_SCTEndcapL2PhiResidual.push_back(
it->phiResidual());
1455 if (sctlayer == 2) {
1456 mnt_hit_SCTEndcapL3PhiResidual.push_back(
it->phiResidual());
1458 if (sctlayer == 3) {
1459 mnt_hit_SCTEndcapL4PhiResidual.push_back(
it->phiResidual());
1461 if (sctlayer == 4) {
1462 mnt_hit_SCTEndcapL5PhiResidual.push_back(
it->phiResidual());
1464 if (sctlayer == 5) {
1465 mnt_hit_SCTEndcapL6PhiResidual.push_back(
it->phiResidual());
1467 if (sctlayer == 6) {
1468 mnt_hit_SCTEndcapL7PhiResidual.push_back(
it->phiResidual());
1470 if (sctlayer == 7) {
1471 mnt_hit_SCTEndcapL8PhiResidual.push_back(
it->phiResidual());
1473 if (sctlayer == 8) {
1474 mnt_hit_SCTEndcapL9PhiResidual.push_back(
it->phiResidual());
1478 mnt_layer_IBL.push_back(pixlayer);
1480 mnt_hit_IBLPhiResidual.push_back(
it->phiResidual());
1481 mnt_hit_IBLPhiPull.push_back(
it->phiPull());
1482 mnt_hit_IBLEtaResidual.push_back(
it->etaResidual());
1483 mnt_hit_IBLEtaPull.push_back(
it->etaPull());
1487 mnt_hit_PIXBarrelPhiResidual.push_back(
it->phiResidual());
1488 mnt_hit_PIXBarrelPhiPull.push_back(
it->phiPull());
1489 mnt_hit_PIXBarrelEtaResidual.push_back(
it->etaResidual());
1490 mnt_hit_PIXBarrelEtaPull.push_back(
it->etaPull());
1507 size_t actualSize =
m_accelTool->exportSeedMakingJob(tcs, roi, vsp, *dataBuffer);
1509 ATH_MSG_DEBUG(
"SeedMakingJob is ready, data size for transfer = " <<actualSize);
1511 std::shared_ptr<TrigAccel::OffloadBuffer> pBuff = std::make_shared<TrigAccel::OffloadBuffer>(dataBuffer);
1520 std::shared_ptr<TrigAccel::OffloadBuffer> pOB = pJob->
getOutput();
1535 ATH_CHECK( dEdxTrkHandle.
record(std::make_unique<xAOD::TrigCompositeContainer>(), std::make_unique<xAOD::TrigCompositeAuxContainer>()) );
1538 ATH_CHECK( dEdxHitHandle.
record(std::make_unique<xAOD::TrigCompositeContainer>(), std::make_unique<xAOD::TrigCompositeAuxContainer>()) );
1542 ATH_CHECK( disTrkCandHandle.
record(std::make_unique<xAOD::TrigCompositeContainer>(), std::make_unique<xAOD::TrigCompositeAuxContainer>()) );
1544 return StatusCode::SUCCESS;
1550 float abseta = std::fabs(
eta);
1561 const float PixBR6limit = 1.29612;
1562 const float PixBR5limit = 1.45204;
1563 const float PixBR4limit = 1.64909;
1564 const float PixBR3limit = 1.90036;
1565 const float PixBR2limit = 2.2146;
1571 if( abseta > PixBR2limit )
return 2;
1579 if( abseta > PixBR2limit )
return 2;
1594 if( abseta < PixBR6limit )
return 7;
1595 else if( abseta < PixBR5limit )
return 6;
1603 if( abseta < PixBR5limit )
return 7;
1604 else if( abseta < PixBR4limit )
return 6;
1612 if( abseta < PixBR4limit )
return 7;
1620 if( abseta < PixBR4limit )
return 6;
1621 else if( abseta < PixBR3limit )
return 6;
1629 if( abseta < PixBR3limit )
return 7;
1637 if( abseta < PixBR3limit )
return 6;
1645 if( abseta < PixBR3limit )
return 7;
1653 if( abseta < PixBR3limit )
return 7;
1671 ATH_CHECK( dEdxTrkHandle.
record(std::make_unique<xAOD::TrigCompositeContainer>(), std::make_unique<xAOD::TrigCompositeAuxContainer>()) );
1672 auto dEdxTrkContainer = dEdxTrkHandle.
ptr();
1676 ATH_CHECK( dEdxHitHandle.
record(std::make_unique<xAOD::TrigCompositeContainer>(), std::make_unique<xAOD::TrigCompositeAuxContainer>()) );
1677 auto dEdxHitContainer = dEdxHitHandle.
ptr();
1679 std::vector<float> mnt_dedx;
1680 std::vector<int> mnt_dedx_nusedhits;
1690 static constexpr
float TRKCUT_PTGEV_LOOSE = 3.0;
1691 static constexpr
float TRKCUT_PTGEV_TIGHT = 10.0;
1692 static constexpr
float TRKCUT_DEDX_LOOSE = 1.25;
1693 static constexpr
float TRKCUT_DEDX_TIGHT = 1.55;
1695 for (
const auto track: outputTracks) {
1697 float shift_x = 0;
float shift_y = 0;
1708 if (not igt) {
continue;}
1711 int pixelhits=0;
int n_usedhits=0;
1712 std::vector<float> v_pixhit_dedx; std::vector<float> v_pixhit_tot; std::vector<float> v_pixhit_trkchi2; std::vector<float> v_pixhit_trkndof;
1713 std::vector<int> v_pixhit_iblovfl; std::vector<int> v_pixhit_loc; std::vector<int> v_pixhit_layer;
1714 float dedx =
dEdx(
track,pixelhits,n_usedhits,v_pixhit_dedx,v_pixhit_tot,v_pixhit_trkchi2,v_pixhit_trkndof,
1715 v_pixhit_iblovfl,v_pixhit_loc,v_pixhit_layer);
1718 mnt_dedx.push_back(dedx);
1719 mnt_dedx_nusedhits.push_back(n_usedhits);
1721 bool hpt = (theTrackInfo.
ptGeV >= TRKCUT_PTGEV_TIGHT && dedx >= TRKCUT_DEDX_LOOSE);
1722 bool lpt = (theTrackInfo.
ptGeV >= TRKCUT_PTGEV_LOOSE && dedx >= TRKCUT_DEDX_TIGHT);
1723 if( ! hpt && ! lpt )
continue;
1726 dEdxTrkContainer->push_back(dEdxTrk);
1727 dEdxTrk->
setDetail<
int> (
"dEdxTrk_id", i_track);
1729 dEdxTrk->
setDetail<
float>(
"dEdxTrk_eta", theTrackInfo.
eta);
1730 dEdxTrk->
setDetail<
float>(
"dEdxTrk_phi", theTrackInfo.
phi0);
1732 dEdxTrk->
setDetail<
float>(
"dEdxTrk_dedx", dedx);
1733 dEdxTrk->
setDetail<
int> (
"dEdxTrk_dedx_n_usedhits", n_usedhits);
1739 for(
unsigned int i=0;
i<v_pixhit_dedx.size();
i++) {
1741 dEdxHitContainer->push_back(dEdxHit);
1742 dEdxHit->
setDetail<
int> (
"dEdxHit_trkid", i_track);
1743 dEdxHit->
setDetail<
float>(
"dEdxHit_dedx", v_pixhit_dedx[
i]);
1744 dEdxHit->
setDetail<
float>(
"dEdxHit_tot", v_pixhit_tot[
i]);
1745 dEdxHit->
setDetail<
float>(
"dEdxHit_trkchi2", v_pixhit_trkchi2[
i]);
1746 dEdxHit->
setDetail<
float>(
"dEdxHit_trkndof", v_pixhit_trkndof[
i]);
1747 dEdxHit->
setDetail<
int> (
"dEdxHit_iblovfl", v_pixhit_iblovfl[
i]);
1748 dEdxHit->
setDetail<
int> (
"dEdxHit_loc", v_pixhit_loc[
i]);
1749 dEdxHit->
setDetail<
int> (
"dEdxHit_layer", v_pixhit_layer[
i]);
1752 return StatusCode::SUCCESS;
1758 std::vector<float>& v_pixhit_dedx, std::vector<float>& v_pixhit_tot,
1759 std::vector<float>& v_pixhit_trkchi2, std::vector<float>& v_pixhit_trkndof,
1760 std::vector<int>& v_pixhit_iblovfl, std::vector<int>& v_pixhit_loc, std::vector<int>& v_pixhit_layer)
const
1762 const float Pixel_sensorthickness=.025;
1763 const float IBL_3D_sensorthickness=.023;
1764 const float IBL_PLANAR_sensorthickness=.020;
1766 const float energyPair = 3.68e-6;
1767 const float sidensity = 2.329;
1769 float conversion_factor=energyPair/sidensity;
1776 v_pixhit_dedx.clear();
1777 v_pixhit_tot.clear();
1778 v_pixhit_trkchi2.clear();
1779 v_pixhit_trkndof.clear();
1780 v_pixhit_iblovfl.clear();
1781 v_pixhit_loc.clear();
1782 v_pixhit_layer.clear();
1784 const int PIXLOC_IBL_PL = 0;
1785 const int PIXLOC_IBL_3D = 1;
1786 const int PIXLOC_PIX_LY = 2;
1787 const int PIXLOC_PIX_EC = 3;
1788 const int PIXLOC_IBL_UNKNOWN = 4;
1789 const int PIXLOC_PIX_UNKNOWN = 5;
1791 std::multimap<float,int> dEdxMap;
1792 float dEdxValue = 0;
1796 if (recoTrackStates) {
1804 for ( ; tsosIter != tsosIterEnd; ++tsosIter) {
1809 if ( measurement ==
nullptr ) {
1814 if(
tp ==
nullptr ) {
1819 if ( pixclus ==
nullptr ) {
1824 if( prd ==
nullptr ) {
1829 float dotProd =
tp->momentum().dot(
tp->associatedSurface().normal());
1830 float cosalpha = std::abs(dotProd/
tp->momentum().mag());
1831 ATH_MSG_VERBOSE(
"dotProd / cosalpha = " << dotProd <<
" / " << cosalpha);
1832 if (std::abs(cosalpha)<.16)
continue;
1834 const std::vector<int>& v_tots = prd->
totList();
1859 const float overflowIBLToT = 16;
1860 for (
int pixToT : v_tots) {
1861 if (pixToT >= overflowIBLToT) {
1868 if(((eta_module>=-10 && eta_module<=-7)||(eta_module>=6 && eta_module<=9)) && (std::abs(locy)<10. && (locx>-8.33 && locx <8.3)) ){
1869 thickness = IBL_3D_sensorthickness;
1870 loc = PIXLOC_IBL_3D;
1872 else if((eta_module>=-6 && eta_module<=5) && (std::abs(locy)<20. &&( locx >-8.33 && locx <8.3 )) ){
1873 thickness = IBL_PLANAR_sensorthickness;
1874 loc = PIXLOC_IBL_PL;
1878 loc = PIXLOC_IBL_UNKNOWN;
1881 else if(
bec==0 && std::abs(locy)<30. && (( locx > -8.20 && locx < -0.60 ) || ( locx > 0.50 && locx < 8.10 ) ) ){
1882 thickness = Pixel_sensorthickness;
1883 loc = PIXLOC_PIX_LY;
1885 else if(std::abs(
bec) == 2 && std::abs(locy)<30. && ( ( locx > -8.15 && locx < -0.55 ) || ( locx > 0.55 && locx < 8.15 ) ) ) {
1886 thickness = Pixel_sensorthickness;
1887 loc = PIXLOC_PIX_EC;
1891 loc = PIXLOC_IBL_UNKNOWN;
1895 if( loc != PIXLOC_IBL_UNKNOWN && loc != PIXLOC_PIX_UNKNOWN ) {
1896 dEdxValue =
charge*conversion_factor/thickness;
1897 dEdxMap.insert(std::pair<float,int>(dEdxValue, iblOverflow));
1901 v_pixhit_dedx.push_back(dEdxValue); v_pixhit_tot.push_back(
tot);
1902 v_pixhit_trkchi2.push_back(
chi2); v_pixhit_trkndof.push_back(
ndof);
1903 v_pixhit_iblovfl.push_back(iblOverflow); v_pixhit_loc.push_back(loc); v_pixhit_layer.push_back(
layer);
1910 float averagedEdx=0.;
1915 for (std::pair<float,int> itdEdx : dEdxMap) {
1917 if(itdEdx.second==0){
1919 averagedEdx += itdEdx.first;
1922 if(itdEdx.second > 0){
1927 if (((
int)pixelhits >= 5) and ((
int)n_usedhits >= (
int)pixelhits-2)) {
1933 if((
int)IBLOverflow>0 and ((
int)pixelhits==3) and (
int)n_usedhits==1) {
1937 if((
int)IBLOverflow>0 and ((
int)pixelhits==4) and (
int)n_usedhits==2) {
1942 if (((
int)pixelhits > 1) and ((
int)n_usedhits >=(
int)pixelhits-1)) {
1947 if((
int)IBLOverflow>0 and (
int)pixelhits==1){
1949 averagedEdx=itdEdx.first;
1954 if (n_usedhits > 0 or (n_usedhits==0 and(
int)IBLOverflow>0 and (
int)pixelhits==1)) {
1955 if(n_usedhits > 0) averagedEdx = averagedEdx / n_usedhits;
1957 ATH_MSG_DEBUG(
"=====> averaged dEdx = " << averagedEdx <<
" =====>");;
1958 ATH_MSG_DEBUG(
" +++ Used hits: " << n_usedhits <<
", IBL overflows: " << IBLOverflow );;
1959 ATH_MSG_DEBUG(
" +++ Original number of measurements = " << pixelhits <<
" (map size = " << dEdxMap.size() <<
") ");
1970 const float PT_CUT = 3.0;
1972 const double FAIL_CHI2_OV_NDOF_CUT = 20.0;
1974 const int COMB_N_HITS_IBL_OR_BL_CUT = 1;
1975 const int COMB_N_HITS_PIX_BR_CUT = 3;
1976 const double COMB_CHI2_OV_NDOF_PIX_BR_CUT = 3.0;
1977 const int COMB_N_GOOD_HITS_SCT_BR_CUT = 2;
1978 const int COMB_N_GOOD_DOUBLEHITS_SCT_BR_CUT = 0;
1981 if( trk==
nullptr )
return false;
1983 if( trk->
fitQuality()==
nullptr )
return false;
1986 if( !seed.s1().isPixel() || !seed.s2().isPixel() || !seed.s3().isPixel() )
return false;
1987 float s1_z = seed.s1().z();
1988 float s2_z = seed.s2().z();
1989 float s3_z = seed.s3().z();
1990 const float PIXEL_BARREL_Z = 410.0;
1991 if( std::abs(s1_z) > PIXEL_BARREL_Z || std::abs(s2_z) > PIXEL_BARREL_Z || std::abs(s3_z) > PIXEL_BARREL_Z )
return false;
1992 ATH_MSG_VERBOSE(
"FTF::isCleaningPassDisTrack> ... barrel cut passed");
1999 if(
pt/1000.0 < PT_CUT )
return false;
2006 if( std::abs(
ndof) < 1
e-12 )
return false;
2007 if(
chi2/
ndof > FAIL_CHI2_OV_NDOF_CUT )
return false;
2008 ATH_MSG_VERBOSE(
"FTF::isCleaningPassDisTrack> ... (failTrk) Chi2 cut passed");
2014 int n_hits_iblbl = barrelInfo[0].nHits + barrelInfo[1].nHits;
2015 if( n_hits_iblbl < COMB_N_HITS_IBL_OR_BL_CUT )
return false;
2018 int n_hits_pixbr = 0;
2019 double chi2_pixbr = 0;
2021 for(
unsigned int ily=0; ily<=3; ily++) {
2022 n_hits_pixbr += barrelInfo[ily].nHits;
2023 chi2_pixbr += barrelInfo[ily].chiSq;
2024 ndof_pixbr += barrelInfo[ily].nDof;
2026 if( n_hits_pixbr < COMB_N_HITS_PIX_BR_CUT )
return false;
2027 if( ndof_pixbr < 1 )
return false;
2028 double chi2_ov_ndof_pixbr = chi2_pixbr / ndof_pixbr;
2029 if( chi2_ov_ndof_pixbr > COMB_CHI2_OV_NDOF_PIX_BR_CUT )
return false;
2030 ATH_MSG_VERBOSE(
"FTF::isCleaningPassDisTrack> ... (combTrk) Pix cut passed");
2033 int n_hits_sctbr_good = 0;
2034 int n_doublehits_sctbr_good = 0;
2035 for(
unsigned int ily=4; ily<=7; ily++) {
2036 n_hits_sctbr_good += barrelInfo[ily].nGood;
2037 if( barrelInfo[ily].
nGood >= 2 ) n_doublehits_sctbr_good++;
2039 if( n_hits_sctbr_good > COMB_N_GOOD_HITS_SCT_BR_CUT )
return false;
2040 if( n_doublehits_sctbr_good > COMB_N_GOOD_DOUBLEHITS_SCT_BR_CUT )
return false;
2041 ATH_MSG_VERBOSE(
"FTF::isCleaningPassDisTrack> ... (combTrk) SCT cut passed");
2048 std::array<TrigFastTrackFinder::OneLayerInfo_t, TrigFastTrackFinder::N_BARREL_LAYERS>
2051 static constexpr
double CHI2_GOOD_CUT = 3.0;
2053 std::array<TrigFastTrackFinder::OneLayerInfo_t, TrigFastTrackFinder::N_BARREL_LAYERS>
result{};
2057 if (recoTrackStates) {
2060 for ( ; tsosIter != tsosIterEnd; ++tsosIter) {
2068 bool chi2_good = (
x2 <= CHI2_GOOD_CUT);
2071 if (pixclus!=
nullptr) {
2086 if (sctclus!=
nullptr) {
2112 double quality_pixel = 0. ;
2113 double quality_sct = 0. ;
2115 const double W = 17.;
2130 if( pixclus !=0 ) quality_pixel +=
q;
2131 else quality_sct +=
q;
2136 double quality = quality_pixel;
2137 quality -= quality_sct;
2138 if( quality < 0. ) quality = 0.;
2152 double xVTX =
vertex.x();
2153 double yVTX =
vertex.y();
2154 double tiltXZ = beamSpotHandle->beamTilt(0);
2155 double tiltYZ = beamSpotHandle->beamTilt(1);
2158 const double CLUSTCUT_DIST_SIGMA = 5.0;
2159 const double CLUSTCUT_DIST = 2.5;
2160 const double CLUSTCUT_SEED_PT = 3.0;
2162 const int VTXCUT_N_TRACKS = 3;
2163 const int VTXCUT_ALGO = 1;
2165 std::vector<std::tuple<int,double,double,Trk::Track*>> QT;
2166 QT.reserve(tracks.
size());
2168 for (
auto t=tracks.
begin();
t!=tracks.
end(); ++
t) {
2176 QT.emplace_back(std::make_tuple(-1,
pt,
pt,(*
t)));
2180 std::sort(QT.begin(), QT.end(),
2181 [](
const std::tuple<int,double,double,Trk::Track*>& lhs,
const std::tuple<int,double,double,Trk::Track*>& rhs) {
2182 return std::get<1>(lhs) > std::get<1>(rhs); } );
2185 std::vector<int> cluster_ntrk;
2186 std::vector<double> cluster_ptsum;
2187 std::vector<double> cluster_z;
2188 std::vector<double> cluster_wsum;
2189 std::vector<double> cluster_zerr;
2190 std::vector<double> cluster_w2sum;
2192 for(
unsigned int i=0;
i<QT.size(); ++
i) {
2194 double z =
t->perigeeParameters()->parameters()[
Trk::z0];
2195 double zerr = sqrt((*(
t->perigeeParameters()->covariance()))(
Trk::z0,
Trk::z0));
2196 double w = std::get<2>(QT[
i]);
2197 double pt = std::get<1>(QT[
i]);
2199 cluster_ntrk.push_back(1); cluster_ptsum.push_back(
pt);
2200 cluster_z.push_back(
w*
z); cluster_wsum.push_back(
w);
2201 cluster_zerr.push_back(
w*zerr*
w*zerr); cluster_w2sum.push_back(
w*
w);
2205 const int IDX_INITIAL = 100;
2206 double dist_min = 100.0;
2208 for(
unsigned j=0; j<cluster_z.size(); ++j) {
2209 double dist = std::abs(
z - cluster_z[j]/cluster_wsum[j]);
2210 if( dist < dist_min ) {
2215 int match_idx = IDX_INITIAL;
2216 if(
idx_min != IDX_INITIAL ) {
2217 double c_zerr_min = std::sqrt(cluster_zerr[
idx_min]/cluster_w2sum[
idx_min]);
2218 double err = std::sqrt(zerr*zerr+c_zerr_min*c_zerr_min);
2219 if( std::abs(
err) < 1
e-12 )
err = 1
e-12;
2220 double dist = dist_min /
err;
2221 if( dist < CLUSTCUT_DIST_SIGMA && dist_min < CLUSTCUT_DIST ) { match_idx =
idx_min; }
2224 if( match_idx == IDX_INITIAL ) {
2225 if(
pt > CLUSTCUT_SEED_PT && dist_min > CLUSTCUT_DIST ) {
2226 cluster_ntrk.push_back(1); cluster_ptsum.push_back(
pt);
2227 cluster_z.push_back(
w*
z); cluster_wsum.push_back(
w);
2228 cluster_zerr.push_back(
w*zerr*
w*zerr); cluster_w2sum.push_back(
w*
w);
2232 int new_n = cluster_ntrk[match_idx] + 1;
2233 double new_ptsum = cluster_ptsum[match_idx] +
pt;
2234 double new_z = cluster_z[match_idx] +
w*
z;
2235 double new_wsum = cluster_wsum[match_idx] +
w;
2236 double new_zerr = cluster_zerr[match_idx] +
w*zerr*
w*zerr;
2237 double new_w2sum = cluster_w2sum[match_idx] +
w*
w;
2238 cluster_ntrk[match_idx] = new_n;
2239 cluster_ptsum[match_idx] = new_ptsum;
2240 cluster_z[match_idx] = new_z;
2241 cluster_wsum[match_idx] = new_wsum;
2242 cluster_zerr[match_idx] = new_zerr;
2243 cluster_w2sum[match_idx] = new_w2sum;
2248 std::vector<std::tuple<double,double,double,int>> zVtx;
2249 zVtx.reserve(tracks.
size());
2250 for(
unsigned int i=0;
i<cluster_z.size();
i++) {
2251 if( cluster_ntrk[
i] < VTXCUT_N_TRACKS )
continue;
2252 double z = cluster_z[
i] / cluster_wsum[
i];
2253 double zerr = std::sqrt(cluster_zerr[
i] / cluster_w2sum[
i]);
2254 zVtx.push_back(std::make_tuple(cluster_ptsum[
i],
z,zerr,cluster_ntrk[
i]));
2257 if( VTXCUT_ALGO == 1 ) {
2258 std::sort(zVtx.begin(), zVtx.end(),
2259 [](
const std::tuple<double,double,double,int>& lhs,
const std::tuple<double,double,double,int>& rhs) {
2260 return std::get<0>(lhs) > std::get<0>(rhs); } );
2262 ATH_MSG_VERBOSE(
"disTrkZVtertex> ===== looping zVtx size: " << zVtx.size());
2263 for(
unsigned int i=0;
i<zVtx.size();
i++) {
2264 double z = std::get<1>(zVtx[
i]);
2265 double zerr = std::get<2>(zVtx[
i]);
2266 double pt = std::get<0>(zVtx[
i]);
2267 int n = std::get<3>(zVtx[
i]);
2268 v_zvtx.push_back(
z);
2269 v_xvtx.push_back(xVTX - tiltXZ*
z);
2270 v_yvtx.push_back(yVTX - tiltYZ*
z);
2271 ATH_MSG_VERBOSE(
"disTrkZVtertex> Vertex cand i=" <<
i <<
": z = " <<
z <<
" +- " << zerr <<
", sum n / pt = " <<
n <<
" / " <<
pt);
2280 mnt_disTrk_nVtx = v_zvtx.size();
2281 if(v_zvtx.size()>0) {
2282 mnt_disTrk_xVtx = v_xvtx[0];
2283 mnt_disTrk_yVtx = v_yvtx[0];
2284 mnt_disTrk_zVtx = v_zvtx[0];
2290 const double TRKCUT_CHI2_OV_NDOF = 3.0;
2291 const double TRKCUT_PT = 1.0;
2292 const double TRKCUT_D0 = 2.0;
2293 const int TRKCUT_N_HITS_INNER = 1;
2294 const int TRKCUT_N_HITS_PIX = 3;
2295 const int TRKCUT_N_HITS = 7;
2298 if ( !
t->perigeeParameters() )
return false;
2299 if ( !
t->fitQuality() )
return false;
2300 if (
t->trackSummary()==0 ) {
2302 if (
t->trackSummary()==0 )
return false;
2306 double chi2 =
t->fitQuality()->chiSquared();
2307 double ndof =
t->fitQuality()->doubleNumberDoF();
2308 if( std::abs(
ndof) < 1
e-2 )
return false;
2310 if( chi2_ov_ndof > TRKCUT_CHI2_OV_NDOF )
return false;
2318 if(
pt < TRKCUT_PT )
return false;
2321 double d0 =
t->perigeeParameters()->parameters()[
Trk::d0];
2322 if( std::abs(
d0) > TRKCUT_D0 )
return false;
2327 int n_hits_inner = n_hits_innermost + n_hits_next_to_innermost;
2330 if( n_hits_inner < TRKCUT_N_HITS_INNER )
return false;
2331 if( n_hits_pix < TRKCUT_N_HITS_PIX )
return false;
2332 if( (n_hits_pix+n_hits_sct) < TRKCUT_N_HITS )
return false;
2340 const int N_FREE_PIX_HITS_CUT = 2;
2342 std::set<const Trk::PrepRawData*>
clusters;
2346 std::sort(QT.begin(), QT.end(),
2347 [](
const std::tuple<bool, double, Trk::Track*>& lhs,
const std::tuple<bool, double, Trk::Track*>& rhs) {
2348 return std::get<1>(lhs) < std::get<1>(rhs); } );
2350 for (
auto&
q : QT) {
2352 m = std::get<2>(
q)->measurementsOnTrack()->begin(),
2353 me = std::get<2>(
q)->measurementsOnTrack()->end ();
2356 for(;
m!=me; ++
m ) {
2366 if((nf >= N_FREE_PIX_HITS_CUT) || (nf ==
nc) ) {
2370 std::get<0>(
q) =
false;
2377 std::vector<std::tuple<bool, double, Trk::Track*>>& qualityDisFailTrks,
2378 std::vector<std::tuple<bool, double, Trk::Track*>>& qualityDisCombTrks,
2380 const std::vector<double>& v_xvtx,
2381 const std::vector<double>& v_yvtx,
2382 const std::vector<double>& v_zvtx)
const
2385 ATH_CHECK( disTrkCandHandle.
record(std::make_unique<xAOD::TrigCompositeContainer>(), std::make_unique<xAOD::TrigCompositeAuxContainer>()) );
2386 auto disTrkCandContainer = disTrkCandHandle.
ptr();
2395 auto monDisTrk =
Monitored::Group(
m_monTool, mnt_disFailTrk_n, mnt_disFailTrk_nclone, mnt_disFailTrk_ncand, mnt_disCombTrk_n, mnt_disCombTrk_nclone, mnt_disCombTrk_ncand);
2398 std::vector<Trk::Track*> tracksForIso;
2399 for (
auto t=tracks.
begin();
t!=tracks.
end(); ++
t) {
2404 const std::string
prefix =
"disTrkCand";
2408 initialDisFailTrks.
reserve(qualityDisFailTrks.size());
2409 std::vector<int> resultCodes;
2410 for(
const auto&
q : qualityDisFailTrks) {
2411 if (std::get<0>(
q)==
true) {
2415 delete std::get<2>(
q);
2418 ATH_MSG_VERBOSE(
"===> nr of disFailTrk=" << qualityDisFailTrks.size() <<
" -> clone removal=" << initialDisFailTrks.
size());
2422 int n_disFailTrkCands =
recoAndFillDisTrkCand(
prefix, &fittedDisFailTrks, tracksForIso, disTrkCandContainer, v_xvtx, v_yvtx, v_zvtx,
true, ctx);
2425 mnt_disFailTrk_n = qualityDisFailTrks.size();
2426 mnt_disFailTrk_nclone = initialDisFailTrks.
size();
2427 mnt_disFailTrk_ncand = n_disFailTrkCands;
2430 ATH_MSG_VERBOSE(
"===> nr of disCombTrk=" << qualityDisCombTrks.size() <<
" -> clone removal=" << fittedDisCombTrks.
size());
2431 int n_disCombTrkCands =
recoAndFillDisTrkCand(
prefix, &fittedDisCombTrks, tracksForIso, disTrkCandContainer, v_xvtx, v_yvtx, v_zvtx,
false, ctx);
2434 mnt_disCombTrk_n = qualityDisCombTrks.size();
2435 mnt_disCombTrk_nclone = fittedDisCombTrks.
size();
2436 mnt_disCombTrk_ncand = n_disCombTrkCands;
2438 return StatusCode::SUCCESS;
2443 const float PRESEL_PT_GEV = 5.0;
2444 const float PRESEL_REFIT_PT_GEV_P3S1 = 10.0;
2445 const double PRESEL_D0_WRTVTX = 5.0;
2446 const double PRESEL_Z0_WRTVTX = 50.0;
2449 if( trk ==
nullptr )
return false;
2452 if( cat==DisTrkCategory::Pix4l_Sct1p || cat==DisTrkCategory::Pix3l_Sct1p ) {
if( refitTrk ==
nullptr )
return false; }
2455 if( std::abs(refit_d0_wrtVtx) > PRESEL_D0_WRTVTX )
return false;
2458 if( std::abs(refit_z0_wrtVtx) > PRESEL_Z0_WRTVTX )
return false;
2461 std::vector<float> v_ptGeV;
2462 std::vector<Trk::Track*> v_trk;
2463 v_trk.push_back(trk);
2464 if( refitTrk !=
nullptr ) v_trk.push_back(refitTrk);
2465 for(
auto t : v_trk) {
2470 v_ptGeV.push_back(ptGeV);
2472 bool isLowPt =
true;
2473 for(
auto pt : v_ptGeV) {
2474 if(
pt > PRESEL_PT_GEV ) { isLowPt =
false;
break; }
2476 if( isLowPt )
return false;
2479 if( cat==DisTrkCategory::Pix3l_Sct1p ) {
2480 float refitPt = v_ptGeV[1];
2481 if( refitPt < PRESEL_REFIT_PT_GEV_P3S1 )
return false;
2490 const double PRESEL_D0_WRTVTX = 5.0;
2491 const double PRESEL_Z0_WRTVTX = 50.0;
2492 const int PRESEL_N_GOOD_BR_LAYERS_PIX = 3;
2493 const double PRESEL_CHI2_OV_NDOF_PIX_BR_CUT = 5.0;
2496 if( trk ==
nullptr )
return false;
2503 double chi2_pixbr = 0.0;
2505 int n_good_brlayers_pix = 0;
2506 for(
unsigned int ily=0; ily<=3; ily++) {
2507 if( barrelLayerInfo[ily].
nGood >= 1 ) n_good_brlayers_pix++;
2508 chi2_pixbr += barrelLayerInfo[ily].chiSq;
2509 ndof_pixbr += barrelLayerInfo[ily].nDof;
2511 if( n_good_brlayers_pix < PRESEL_N_GOOD_BR_LAYERS_PIX )
return false;
2513 if( ndof_pixbr < 1 )
return false;
2514 double chi2_ov_ndof_pixbr = chi2_pixbr / ndof_pixbr;
2515 if( chi2_ov_ndof_pixbr > PRESEL_CHI2_OV_NDOF_PIX_BR_CUT )
return false;
2518 if( std::abs(d0_wrtVtx) > PRESEL_D0_WRTVTX )
return false;
2521 if( std::abs(z0_wrtVtx) > PRESEL_Z0_WRTVTX )
return false;
2528 Trk::Track*
t,
const std::vector<double>& v_xvtx,
const std::vector<double>& v_yvtx,
const std::vector<double>& v_zvtx,
const EventContext& ctx)
const
2533 float trk_z0 =
t->perigeeParameters()->parameters()[
Trk::z0];
2534 float z0_min = 9999;
2535 for(
unsigned int i_vtx=0; i_vtx<v_zvtx.size(); i_vtx++) {
2536 float z = v_zvtx[i_vtx];
2537 if( std::abs(trk_z0-
z) < z0_min ) {
2538 z0_min = std::abs(trk_z0-
z);
2540 vtx_x = v_xvtx[i_vtx];
2541 vtx_y = v_yvtx[i_vtx];
2547 std::unique_ptr<const Trk::TrackParameters>
tmp =
2548 m_extrapolator->extrapolateDirectly(ctx, (*(
t->perigeeParameters())), persf);
2559 int n_good_brlayers_pix = 0;
2561 for(
unsigned int ily=0; ily<8; ily++) {
2562 if( ily<=3 &&
result[ily].
nGood >= 1 ) n_good_brlayers_pix++;
2564 n_hits_sct +=
result[ily].nHits;
2571 if( n_good_brlayers_pix == 4 ) {
2572 if( n_hits_sct==0 ) { cat=DisTrkCategory::Pix4l_Sct0; }
2573 else { cat=DisTrkCategory::Pix4l_Sct1p; }
2575 else if( n_good_brlayers_pix == 3 ) {
2576 if( n_hits_sct==0 ) { cat=DisTrkCategory::Pix3l_Sct0; }
2577 else { cat=DisTrkCategory::Pix3l_Sct1p; }
2584 std::vector<Trk::Track*> vtmp;
2589 bool fillIso, std::vector<Trk::Track*>& tracksForIso)
const
2597 int n_hits_innermost=-1;
int n_hits_next_to_innermost=-1;
int n_hits_inner=-1;
int n_hits_pix=-1;
int n_hits_sct=-1;
2598 if( trk !=
nullptr ) {
2614 n_hits_inner = n_hits_innermost + n_hits_next_to_innermost;
2630 float theta_wrtVtx=0;
float eta_wrtVtx=0;
float pt_wrtVtx=0;
float d0_wrtVtx=0;
float z0_wrtVtx=0;
float phi_wrtVtx=0;
2631 if( vertexPerigee !=
nullptr ) {
2632 theta_wrtVtx = vertexPerigee->parameters()[
Trk::theta];
2634 float qOverP_wrtVtx = std::abs(vertexPerigee->parameters()[
Trk::qOverP]);
2635 if ( qOverP_wrtVtx < 1
e-12 ) qOverP_wrtVtx = 1
e-12;
2636 pt_wrtVtx =
std::sin(theta_wrtVtx)/qOverP_wrtVtx;
2637 d0_wrtVtx = vertexPerigee->parameters()[
Trk::d0];
2638 z0_wrtVtx = vertexPerigee->parameters()[
Trk::z0];
2639 phi_wrtVtx = vertexPerigee->parameters()[
Trk::phi];
2641 comp->setDetail<
float>(
prefix+
"_pt_wrtVtx", pt_wrtVtx);
2642 comp->setDetail<
float>(
prefix+
"_eta_wrtVtx", eta_wrtVtx);
2643 comp->setDetail<
float>(
prefix+
"_phi_wrtVtx", phi_wrtVtx);
2644 comp->setDetail<
float>(
prefix+
"_d0_wrtVtx", d0_wrtVtx);
2645 comp->setDetail<
float>(
prefix+
"_z0_wrtVtx", z0_wrtVtx);
2648 std::array<OneLayerInfo_t, N_BARREL_LAYERS> barrelInfo{};
2650 comp->setDetail<
float>(
prefix+
"_chi2sum_br_ibl", barrelInfo[0].chiSq);
2651 comp->setDetail<
float>(
prefix+
"_chi2sum_br_pix1", barrelInfo[1].chiSq);
2652 comp->setDetail<
float>(
prefix+
"_chi2sum_br_pix2", barrelInfo[2].chiSq);
2653 comp->setDetail<
float>(
prefix+
"_chi2sum_br_pix3", barrelInfo[3].chiSq);
2654 comp->setDetail<
float>(
prefix+
"_chi2sum_br_sct1", barrelInfo[4].chiSq);
2655 comp->setDetail<
float>(
prefix+
"_chi2sum_br_sct2", barrelInfo[5].chiSq);
2656 comp->setDetail<
float>(
prefix+
"_chi2sum_br_sct3", barrelInfo[6].chiSq);
2657 comp->setDetail<
float>(
prefix+
"_chi2sum_br_sct4", barrelInfo[7].chiSq);
2658 comp->setDetail<
float>(
prefix+
"_ndofsum_br_ibl", barrelInfo[0].nDof);
2659 comp->setDetail<
float>(
prefix+
"_ndofsum_br_pix1", barrelInfo[1].nDof);
2660 comp->setDetail<
float>(
prefix+
"_ndofsum_br_pix2", barrelInfo[2].nDof);
2661 comp->setDetail<
float>(
prefix+
"_ndofsum_br_pix3", barrelInfo[3].nDof);
2662 comp->setDetail<
float>(
prefix+
"_ndofsum_br_sct1", barrelInfo[4].nDof);
2663 comp->setDetail<
float>(
prefix+
"_ndofsum_br_sct2", barrelInfo[5].nDof);
2664 comp->setDetail<
float>(
prefix+
"_ndofsum_br_sct3", barrelInfo[6].nDof);
2665 comp->setDetail<
float>(
prefix+
"_ndofsum_br_sct4", barrelInfo[7].nDof);
2669 const float ISOL_CALC_Z0_DIFF_CUT = 2.5;
2670 const float ISOL_CALC_DR_CUT_TO_AVOID_ZERO = 0.015;
2671 float iso1_dr01=0;
float iso1_dr02=0;
2672 float iso2_dr01=0;
float iso2_dr02=0;
2673 float iso3_dr01=0;
float iso3_dr02=0;
2674 for(
auto t=tracksForIso.begin();
t!=tracksForIso.end();
t++) {
2675 float z0_t = (*t)->perigeeParameters()->parameters()[
Trk::z0];
2676 if( std::abs(z0_t -
z0) <= ISOL_CALC_Z0_DIFF_CUT ) {
2677 float theta_t = (*t)->perigeeParameters()->parameters()[
Trk::theta];
2678 float qOverP_t= std::abs((*t)->perigeeParameters()->parameters()[
Trk::qOverP]);
2679 if ( qOverP_t < 1
e-12 ) qOverP_t = 1
e-12;
2680 float pt_t =
std::sin(theta_t)/qOverP_t;
2681 float phi_t = (*t)->perigeeParameters()->parameters()[
Trk::phi];
2683 float deta = eta_t -
eta;
2684 float dphi = std::abs(phi_t -
phi);
2686 float dr = std::sqrt(deta*deta + dphi*dphi);
2687 if(
dr > ISOL_CALC_DR_CUT_TO_AVOID_ZERO && dr<0.1 && pt_t > 1.0*
Gaudi::Units::GeV ) iso1_dr01 += pt_t;
2688 if(
dr > ISOL_CALC_DR_CUT_TO_AVOID_ZERO && dr<0.2 && pt_t > 1.0*
Gaudi::Units::GeV ) iso1_dr02 += pt_t;
2690 if(
dr > ISOL_CALC_DR_CUT_TO_AVOID_ZERO && dr<0.1 && pt_t > 2.0*
Gaudi::Units::GeV ) iso2_dr01 += pt_t;
2691 if(
dr > ISOL_CALC_DR_CUT_TO_AVOID_ZERO && dr<0.2 && pt_t > 2.0*
Gaudi::Units::GeV ) iso2_dr02 += pt_t;
2693 if(
dr > ISOL_CALC_DR_CUT_TO_AVOID_ZERO && dr<0.1 && pt_t > 3.0*
Gaudi::Units::GeV ) iso3_dr01 += pt_t;
2694 if(
dr > ISOL_CALC_DR_CUT_TO_AVOID_ZERO && dr<0.2 && pt_t > 3.0*
Gaudi::Units::GeV ) iso3_dr02 += pt_t;
2697 comp->setDetail<
float>(
prefix+
"_iso1_dr01", iso1_dr01);
2698 comp->setDetail<
float>(
prefix+
"_iso1_dr02", iso1_dr02);
2699 comp->setDetail<
float>(
prefix+
"_iso2_dr01", iso2_dr01);
2700 comp->setDetail<
float>(
prefix+
"_iso2_dr02", iso2_dr02);
2701 comp->setDetail<
float>(
prefix+
"_iso3_dr01", iso3_dr01);
2702 comp->setDetail<
float>(
prefix+
"_iso3_dr02", iso3_dr02);
2709 const std::vector<double>& v_xvtx,
2710 const std::vector<double>& v_yvtx,
2711 const std::vector<double>& v_zvtx,
2713 const EventContext& ctx)
const
2717 int n_stored_tracks = 0;
2719 for (
auto trk = tracks->
begin(); trk!=tracks->
end(); ++trk) {
2723 if( ptrk ==
nullptr )
continue;
2727 std::unique_ptr<const Trk::TrackParameters> vertexPerigee =
extrapolateDisTrackToBS(ptrk,v_xvtx,v_yvtx,v_zvtx, ctx);
2730 double d0_wrtVtx = 0;
2731 double z0_wrtVtx = 0;
2732 if( vertexPerigee !=
nullptr ) {
2733 d0_wrtVtx = vertexPerigee->parameters()[
Trk::d0];
2734 z0_wrtVtx = vertexPerigee->parameters()[
Trk::z0];
2745 std::unique_ptr<Trk::Track> refit_trk =
disTrk_refit(ptrk, ctx);
2749 double refit_d0 = 0;
2750 double refit_z0 = 0;
2751 double refit_d0_wrtVtx = 0;
2752 double refit_z0_wrtVtx = 0;
2753 std::unique_ptr<const Trk::TrackParameters> refitVertexPerigee =
nullptr;
2754 if( refit_trk !=
nullptr ) {
2756 if( refitVertexPerigee ==
nullptr ) {
2762 refit_d0_wrtVtx = refitVertexPerigee->parameters()[
Trk::d0];
2763 refit_z0_wrtVtx = refitVertexPerigee->parameters()[
Trk::z0];
2764 ATH_MSG_VERBOSE(
"refit trk d0 : " << refit_d0 <<
" -> extrapolate -> " << refit_d0_wrtVtx);
2765 ATH_MSG_VERBOSE(
"refit trk z0 : " << refit_z0 <<
" -> extrapolate -> " << refit_z0_wrtVtx);
2776 comp->makePrivateStore();
2780 int is_fail = isFail ? 1 : 0;
2788 prefix = base_prefix +
"_refit";
2789 if( refit_trk !=
nullptr ) {
2802 return n_stored_tracks;
2807 std::unique_ptr<Trk::Track> newtrack =
nullptr;
2809 if(
t ==
nullptr )
return newtrack;
2816 if( origPerigee ==
nullptr )
return newtrack;
2820 std::vector<const Trk::MeasurementBase*>
vec;
2821 int n_measurements = 0;
2822 int n_measurements_refit = 0;
2824 if (recoTrackStates) {
2827 for ( ; tsosIter != tsosIterEnd; ++tsosIter) {
2834 if ( !pixclus && sctclus ) to_add =
false;
2836 vec.push_back(measurement);
2837 n_measurements_refit++;
2842 ATH_MSG_VERBOSE(
"... Nr of measurments / refit = " << n_measurements <<
" / " << n_measurements_refit);
2847 if( newtrack!=0 && newtrack.get() ) {
2862 chi2 =
t->fitQuality()->chiSquared();
2863 ndof =
t->fitQuality()->doubleNumberDoF();
2864 d0 =
t->perigeeParameters()->parameters()[
Trk::d0];
2865 z0 =
t->perigeeParameters()->parameters()[
Trk::z0];