57 m_trackMaker(
"InDet::SiTrackMaker_xk/InDetTrigSiTrackMaker"),
58 m_trigInDetTrackFitter(
"TrigInDetTrackFitter"),
59 m_trigZFinder(
"TrigZFinder/TrigZFinder", this ),
60 m_trackSummaryTool(
"Trk::ITrackSummaryTool/ITrackSummaryTool"),
61 m_disTrkFitter(
"Trk::GlobalChi2Fitter/InDetTrackFitter"),
64 m_doZFinderOnly(false),
65 m_storeZFinderVertices(false),
68 m_countRoIwithEnoughHits(0),
69 m_countRoIwithTracks(0),
73 m_particleHypothesis(
Trk::
pion),
74 m_useNewLayerNumberScheme(false),
81 m_doDisappearingTrk(false),
83 m_standaloneMode(false)
94 declareProperty(
"zVertexResolution",
m_tcs.
m_zvError = 10.0,
" Half-width (mm) in z of z region used to filter seeds when doFastZVertexSeeding enabled" );
95 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" );
145 "TrackCollection name");
149 "TrackCollection name");
251 ATH_MSG_INFO(
" FTF configures in Large Radius Tracking Mode");
261 float lut_range[4] = {0.0,3.0,0.0,9.0};
265 if (lut_fileName.empty()) {
266 ATH_MSG_ERROR(
"Cannot find TrigSeedML LUT file " << lut_fileName);
267 return StatusCode::FAILURE;
271 std::ifstream ifs(lut_fileName.c_str());
274 ifs >>
row >> col0 >> col1;
358 return StatusCode::SUCCESS;
375 const std::vector<TrigInDetSiLayer>* pVL =
m_numberingTool->layerGeometry();
381 return StatusCode::SUCCESS;
389 outputTracks = std::make_unique<TrackCollection>();
414 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" );
416 if ( roiCollection->
size()==0) {
418 return StatusCode::FAILURE;
431 return StatusCode::SUCCESS;
440 const EventContext& ctx)
const {
444 std::vector<int> vec_seedSize;
460 auto monTime =
Monitored::Group(
m_monTool, mnt_roi_nTracks, mnt_roi_nSPs, mnt_timer_Total, mnt_timer_SpacePointConversion,
461 mnt_timer_PatternReco, mnt_timer_TripletMaking, mnt_timer_CombTracking, mnt_timer_TrackFitter,
462 mnt_timer_dEdxTrk, mnt_timer_disTrkZVertex, mnt_timer_disTrk);
467 mnt_timer_Total.start();
468 mnt_timer_SpacePointConversion.start();
471 mnt_roi_lastStageExecuted = 1;
473 std::vector<TrigSiSpacePointBase> convertedSpacePoints;
475 convertedSpacePoints.reserve(5000);
477 std::map<Identifier, std::vector<long int> > siClusterMap;
485 long int trackIndex=0;
490 ATH_CHECK(
m_spacePointTool->getSpacePoints(roi, convertedSpacePoints, mnt_roi_nSPsPIX, mnt_roi_nSPsSCT, ctx, &siClusterMap));
498 mnt_timer_SpacePointConversion.stop();
499 mnt_roi_nSPs = mnt_roi_nSPsPIX + mnt_roi_nSPsSCT;
504 ATH_MSG_DEBUG(
"REGTEST / Found " << mnt_roi_nSPs <<
" space points.");
505 ATH_MSG_DEBUG(
"REGTEST / Found " << mnt_roi_nSPsPIX <<
" Pixel space points.");
506 ATH_MSG_DEBUG(
"REGTEST / Found " << mnt_roi_nSPsSCT <<
" SCT space points.");
507 ATH_MSG_DEBUG(
"REGTEST / converted space points size = " << convertedSpacePoints.size());
511 ATH_MSG_DEBUG(
"No tracks found - too few hits in ROI to run " << mnt_roi_nSPs);
513 return StatusCode::SUCCESS;
517 mnt_roi_lastStageExecuted = 2;
520 std::unique_ptr<TrigRoiDescriptor> tmpRoi = std::make_unique<TrigRoiDescriptor>(roi);
523 auto vertices = std::make_unique<TrigVertexCollection>();
524 std::vector<float> vZv;
529 mnt_timer_ZFinder.start();
532 tmpRoi = std::make_unique<TrigRoiDescriptor>(
true);
535 vertices = std::make_unique<TrigVertexCollection>(*
m_trigZFinder->findZ( convertedSpacePoints, roi));
541 vZv.reserve(vertices->size());
542 for (
const auto vertex : *vertices) {
545 float zMinus =
z - 7.0;
546 float zPlus =
z + 7.0;
556 mnt_timer_ZFinder.stop();
564 return StatusCode::SUCCESS;
569 mnt_roi_lastStageExecuted = 3;
571 mnt_timer_PatternReco.start();
573 mnt_timer_TripletMaking.start();
575 std::vector<TrigInDetTriplet> triplets;
577 std::vector<TrigInDetTracklet> new_tracklets;
587 mnt_roi_nSPs = mnt_roi_nSPsPIX + mnt_roi_nSPsSCT;
590 ATH_MSG_DEBUG(
"REGTEST / Found " << mnt_roi_nSPs <<
" space points.");
591 ATH_MSG_DEBUG(
"REGTEST / Found " << mnt_roi_nSPsPIX <<
" Pixel space points.");
592 ATH_MSG_DEBUG(
"REGTEST / Found " << mnt_roi_nSPsSCT <<
" SCT space points.");
596 ATH_MSG_DEBUG(
"No tracks found - too few hits in ROI to run " << mnt_roi_nSPs);
598 return StatusCode::SUCCESS;
604 seedGen.loadSpacePoints(convertedSpacePoints);
607 seedGen.createSeeds(tmpRoi.get(), vZv);
610 seedGen.createSeeds(tmpRoi.get());
613 seedGen.getSeeds(triplets);
624 unsigned int nTrackSeeds =
m_useTracklets ? new_tracklets.size() : triplets.size();
628 mnt_timer_TripletMaking.stop();
629 mnt_roi_lastStageExecuted = 4;
631 mnt_timer_CombTracking.start();
635 std::vector<std::tuple<bool, double,Trk::Track*>> qualityTracks;
636 qualityTracks.reserve(nTrackSeeds);
641 long int trackIndex=0;
649 std::vector<Trk::Track*> disFailTrks;
650 std::vector<Trk::Track*> disCombTrks;
651 std::vector<std::tuple<bool, double, Trk::Track*>> qualityDisFailTrks;
652 std::vector<std::tuple<bool, double, Trk::Track*>> qualityDisCombTrks;
653 int disTrk_n_disCombTrks=0;
654 int disTrk_n_disCombTrks_cleaning=0;
655 int disTrk_n_disFailTrks=0;
656 int disTrk_n_disFailTrks_cleaning=0;
660 for(
unsigned int seedIdx=0;seedIdx!=nTrackSeeds;seedIdx++) {
662 std::vector<const Trk::SpacePoint*> spVec;
665 spVec = new_tracklets[seedIdx].seed();
674 spVec = {osp1, osp2, osp3};
679 std::vector<Identifier> clusterIds;
689 std::list<Trk::Track*> tracks;
690 std::list<Trk::Track*> tracksFail;
691 std::list<Trk::Track*> tracksAll =
m_trackMaker->getTracks(ctx, trackEventData, spVec);
697 tracksFail = tracksAll;
701 ATH_MSG_VERBOSE(
"size of tracks=" << tracks.size() <<
", tracksFail=" << tracksFail.size() <<
": resultCode=" << resultCode);
703 for(std::list<Trk::Track*>::const_iterator
t=tracks.begin();
t!=tracks.end(); ++
t) {
704 if( ! (*
t) )
continue;
706 disTrk_n_disCombTrks++;
709 disTrk_n_disCombTrks_cleaning++;
710 disCombTrks.push_back((*
t));
711 qualityDisCombTrks.emplace_back(std::make_tuple(
true, -
disTrackQuality((*
t)), (*
t)));
714 for(std::list<Trk::Track*>::const_iterator
t=tracksFail.begin();
t!=tracksFail.end(); ++
t) {
715 if( ! (*
t) )
continue;
717 disTrk_n_disFailTrks++;
720 disTrk_n_disFailTrks_cleaning++;
721 disFailTrks.push_back((*
t));
722 qualityDisFailTrks.emplace_back(std::make_tuple(
true, -
disTrackQuality((*
t)), (*
t)));
730 for(std::list<Trk::Track*>::const_iterator
t=tracks.begin();
t!=tracks.end(); ++
t) {
732 float d0 = (*t)->perigeeParameters()==0 ? 10000.0 : (*t)->perigeeParameters()->parameters()[
Trk::d0];
735 qualityTracks.push_back(std::make_tuple(
false,0,(*
t)));
743 qualityTracks.push_back(std::make_tuple(
true, -
trackQuality((*
t)), (*
t)));
746 qualityTracks.push_back(std::make_tuple(
true, 0, (*
t)));
754 ATH_MSG_DEBUG(
"===> nr of disFailTrks=" << disTrk_n_disFailTrks <<
" -> cleaning pass=" << disTrk_n_disFailTrks_cleaning);
755 ATH_MSG_DEBUG(
"===> nr of disCombTrks=" << disTrk_n_disCombTrks <<
" -> cleaning pass=" << disTrk_n_disCombTrks_cleaning);
772 initialTracks.
reserve(qualityTracks.size());
778 std::vector<unsigned int> indexDisCombTrk;
779 for(
const auto&
q : qualityTracks) {
780 bool needed_for_disCombTrk =
false;
783 for(
const auto& qdis : qualityDisCombTrks ) {
784 if( std::get<2>(qdis) == trk_q ) {
785 needed_for_disCombTrk = std::get<0>(qdis);
789 if( needed_for_disCombTrk)
ATH_MSG_VERBOSE(
"idx=" <<
idx <<
" ===> neded for disCombTrk");
791 if (std::get<0>(
q)==
true) {
797 delete std::get<2>(
q);
800 if( needed_for_disCombTrk ) {
805 delete std::get<2>(
q);
811 qualityTracks.clear();
816 mnt_timer_CombTracking.stop();
817 mnt_timer_PatternReco.stop();
819 mnt_roi_lastStageExecuted = 5;
821 mnt_timer_TrackFitter.start();
829 outputTracks = std::move(initialTracks);
838 mnt_timer_dEdxTrk.start();
846 if( outputTracks.
empty() ) {
851 bool do_recoverDisCombTrk =
true;
853 ATH_MSG_DEBUG(
"part of initialTracks fails in fitting. do not try to recover DisCombTracks");
854 do_recoverDisCombTrk =
false;
858 fittedExtraDisCombTracks.
reserve(extraDisCombTracks.
size());
862 if( extraDisCombTracks.
size() > 0 ) {
865 for (
auto fittedTrack = fittedExtraDisCombTracks.
begin(); fittedTrack!=fittedExtraDisCombTracks.
end(); ++fittedTrack) {
868 fittedDisCombTrks.
push_back(*fittedTrack);
875 for (
auto fittedTrack = outputTracks.
begin(); fittedTrack!=outputTracks.
end(); ) {
876 if ((*fittedTrack)->perigeeParameters()) {
877 float d0 = (*fittedTrack)->perigeeParameters()->parameters()[
Trk::d0];
878 float z0 = (*fittedTrack)->perigeeParameters()->parameters()[
Trk::z0];
881 ATH_MSG_DEBUG(
"REGTEST / Reject track after fit with d0 = " <<
d0 <<
" z0= " <<
z0
888 fittedTrack = outputTracks.
erase(fittedTrack);
897 fittedTrack = outputTracks.
erase(fittedTrack);
906 if(std::abs((*fittedTrack)->perigeeParameters()->parameters()[
Trk::qOverP]) >= 1
e-9){
907 trkPt =
std::sin((*fittedTrack)->perigeeParameters()->parameters()[
Trk::theta])/std::abs((*fittedTrack)->perigeeParameters()->parameters()[
Trk::qOverP]);
911 fittedTrack = outputTracks.
erase(fittedTrack);
921 mnt_timer_TrackFitter.stop();
928 for (
auto fittedTrack = outputTracks.
begin();fittedTrack!=outputTracks.
end();++fittedTrack) {
938 if(
std::find(indexDisCombTrk.begin(),indexDisCombTrk.end(),
idx)!=indexDisCombTrk.end() ) {
940 fittedDisCombTrks.
push_back(*fittedTrack);
948 if( outputTracks.
empty() ) {
951 mnt_roi_lastStageExecuted = 6;
953 mnt_roi_nTracks = outputTracks.
size();
956 std::vector<double> disTrk_v_xVtx;
957 std::vector<double> disTrk_v_yVtx;
958 std::vector<double> disTrk_v_zVtx;
960 mnt_timer_disTrkZVertex.start();
962 mnt_timer_disTrkZVertex.stop();
967 mnt_timer_disTrk.start();
968 ATH_CHECK(
findDisTracks(ctx,outputTracks,qualityDisFailTrks,qualityDisCombTrks,fittedDisCombTrks,disTrk_v_xVtx,disTrk_v_yVtx,disTrk_v_zVtx) );
969 mnt_timer_disTrk.stop();
975 if( !outputTracks.
empty() )
979 fillMon(outputTracks, *vertices, roi, ctx);
981 mnt_roi_lastStageExecuted = 7;
983 mnt_timer_Total.stop();
985 return StatusCode::SUCCESS;
994 double quality = 0. ;
995 const double W = 17.;
1013 std::set<const Trk::PrepRawData*>
clusters;
1017 std::sort(QT.begin(), QT.end(),
1018 [](
const std::tuple<bool, double, Trk::Track*>& lhs,
const std::tuple<bool, double, Trk::Track*>& rhs) {
1019 return std::get<1>(lhs) < std::get<1>(rhs); } );
1021 for (
auto&
q : QT) {
1023 m = std::get<2>(
q)->measurementsOnTrack()->begin(),
1024 me = std::get<2>(
q)->measurementsOnTrack()->end ();
1027 for(;
m!=me; ++
m ) {
1039 std::get<0>(
q) =
false;
1049 ATH_MSG_INFO(
"=========================================================");
1050 ATH_MSG_INFO(
"TrigFastTrackFinder::finalize() - TrigFastTrackFinder Statistics: ");
1054 ATH_MSG_INFO(
"=========================================================");
1056 return StatusCode::SUCCESS;
1065 if (siCLOT==
nullptr)
continue;
1067 if (siCL==
nullptr)
continue;
1072 if(pixCL==
nullptr)
continue;
1076 clusterMap[
id].push_back(trackIdx);
1082 if(pCL!=
nullptr) vIds.push_back(pCL->
identify());
1085 if(pCL!=
nullptr) vIds.push_back(pCL->
identify());
1090 std::vector<long int> xSection;
1092 std::map<Identifier, std::vector<long int> >
::iterator itm0 = clusterMap.find(*vIds.begin());
1093 if(itm0 == clusterMap.end())
return false;
1094 xSection.reserve((*itm0).second.size());
1095 std::copy((*itm0).second.begin(), (*itm0).second.end(), std::back_inserter(xSection));
1096 std::vector<Identifier>::const_iterator
it = vIds.begin();++
it;
1097 for(;
it!=vIds.end();++
it) {
1098 std::map<Identifier, std::vector<long int> >
::iterator itm1 = clusterMap.find(*
it);
1099 if(itm1 == clusterMap.end())
return false;
1100 std::vector<long int>
tmp;
1101 std::set_intersection(xSection.begin(), xSection.end(), (*itm1).second.begin(),(*itm1).second.end(), std::back_inserter(
tmp));
1102 if(
tmp.empty())
return false;
1105 xSection.reserve(
tmp.size());
1108 return !xSection.empty();
1125 auto monRoI =
Monitored::Group(
m_monTool, mnt_roi_eta, mnt_roi_phi, mnt_roi_etaWidth, mnt_roi_phiWidth, mnt_roi_z, mnt_roi_zWidth);
1128 for(
unsigned int i=0;
i<roi.
size();
i++) {
1131 mnt_roi_eta = subroi->
eta();
1132 mnt_roi_phi = subroi->
phi();
1135 mnt_roi_z = subroi->
zed();
1142 mnt_roi_eta = roi.
eta();
1143 mnt_roi_phi = roi.
phi();
1146 mnt_roi_z = roi.
zed();
1150 std::vector<float> mnt_trk_pt;
1151 std::vector<float> mnt_trk_a0;
1152 std::vector<float> mnt_trk_z0;
1153 std::vector<float> mnt_trk_phi0;
1154 std::vector<float> mnt_trk_eta;
1155 std::vector<float> mnt_trk_chi2dof;
1156 std::vector<float> mnt_trk_nSiHits;
1157 std::vector<float> mnt_trk_nPIXHits;
1158 std::vector<float> mnt_trk_nSCTHits;
1159 std::vector<float> mnt_trk_a0beam;
1160 std::vector<float> mnt_trk_z0beam;
1161 std::vector<float> mnt_trk_dPhi0;
1162 std::vector<float> mnt_trk_dEta;
1178 mon_nSiHits, mon_nPIXHits, mon_nSCTHits, mon_a0beam, mon_z0beam, mon_dPhi0, mon_dEta);
1180 std::vector<float> mnt_roi_zVertices;
1184 mon_roi_nZvertices = vertices.
size();
1185 for (
const auto vertex : vertices) {
1186 mnt_roi_zVertices.push_back(
vertex->z());
1189 for (
auto track : tracks) {
1191 if(trackPars==
nullptr) {
1195 if(trackPars->covariance()==
nullptr) {
1199 float a0 = trackPars->parameters()[
Trk::d0];
1200 float z0 = trackPars->parameters()[
Trk::z0];
1204 mnt_trk_a0.push_back(
a0);
1205 mnt_trk_z0.push_back(
z0);
1206 mnt_trk_phi0.push_back(
phi0);
1209 mnt_trk_eta.push_back(
eta);
1210 for(
unsigned int i=0;
i<roi.
size();
i++) {
1212 mnt_trk_dEta.push_back(
eta - (roi.
at(
i))->eta());
1231 mnt_trk_pt.push_back(
pT);
1232 mnt_trk_chi2dof.push_back(
chi2);
1236 for(
auto tSOS =
track->trackStateOnSurfaces()->begin();
1237 tSOS!=
track->trackStateOnSurfaces()->end(); ++tSOS) {
1246 mnt_trk_nPIXHits.push_back(nPix);
1247 mnt_trk_nSCTHits.push_back(nSct/2);
1248 mnt_trk_nSiHits.push_back(nPix + nSct/2);
1250 ATH_MSG_DEBUG(
"REGTEST / track npix/nsct/phi0/pt/eta/d0/z0/chi2: " <<
1260 bool goodTrack = std::fabs(
pT)>1000. && (nPix + nSct/2) > 3 && nSct > 0;
1269 std::vector<float> mnt_layer_IBL;
1270 std::vector<float> mnt_layer_PixB;
1271 std::vector<float> mnt_layer_PixE;
1272 std::vector<float> mnt_layer_SCTB;
1273 std::vector<float> mnt_layer_SCTE;
1274 std::vector<float> mnt_hit_IBLPhiResidual;
1275 std::vector<float> mnt_hit_IBLEtaResidual;
1276 std::vector<float> mnt_hit_IBLPhiPull;
1277 std::vector<float> mnt_hit_IBLEtaPull;
1278 std::vector<float> mnt_hit_PIXBarrelPhiResidual;
1279 std::vector<float> mnt_hit_PIXBarrelEtaResidual;
1280 std::vector<float> mnt_hit_PIXBarrelPhiPull;
1281 std::vector<float> mnt_hit_PIXBarrelEtaPull;
1282 std::vector<float> mnt_hit_SCTBarrelResidual;
1283 std::vector<float> mnt_hit_SCTBarrelPull;
1284 std::vector<float> mnt_hit_PIXEndcapPhiResidual;
1285 std::vector<float> mnt_hit_PIXEndcapEtaResidual;
1286 std::vector<float> mnt_hit_PIXEndcapPhiPull;
1287 std::vector<float> mnt_hit_PIXEndcapEtaPull;
1288 std::vector<float> mnt_hit_SCTEndcapResidual;
1289 std::vector<float> mnt_hit_SCTEndcapPull;
1290 std::vector<float> mnt_hit_PIXBarrelL1PhiResidual;
1291 std::vector<float> mnt_hit_PIXBarrelL1EtaResidual;
1292 std::vector<float> mnt_hit_PIXBarrelL2PhiResidual;
1293 std::vector<float> mnt_hit_PIXBarrelL2EtaResidual;
1294 std::vector<float> mnt_hit_PIXBarrelL3PhiResidual;
1295 std::vector<float> mnt_hit_PIXBarrelL3EtaResidual;
1296 std::vector<float> mnt_hit_PIXEndcapL1PhiResidual;
1297 std::vector<float> mnt_hit_PIXEndcapL1EtaResidual;
1298 std::vector<float> mnt_hit_PIXEndcapL2PhiResidual;
1299 std::vector<float> mnt_hit_PIXEndcapL2EtaResidual;
1300 std::vector<float> mnt_hit_PIXEndcapL3PhiResidual;
1301 std::vector<float> mnt_hit_PIXEndcapL3EtaResidual;
1302 std::vector<float> mnt_hit_SCTBarrelL1PhiResidual;
1303 std::vector<float> mnt_hit_SCTBarrelL2PhiResidual;
1304 std::vector<float> mnt_hit_SCTBarrelL3PhiResidual;
1305 std::vector<float> mnt_hit_SCTBarrelL4PhiResidual;
1306 std::vector<float> mnt_hit_SCTEndcapL1PhiResidual;
1307 std::vector<float> mnt_hit_SCTEndcapL2PhiResidual;
1308 std::vector<float> mnt_hit_SCTEndcapL3PhiResidual;
1309 std::vector<float> mnt_hit_SCTEndcapL4PhiResidual;
1310 std::vector<float> mnt_hit_SCTEndcapL5PhiResidual;
1311 std::vector<float> mnt_hit_SCTEndcapL6PhiResidual;
1312 std::vector<float> mnt_hit_SCTEndcapL7PhiResidual;
1313 std::vector<float> mnt_hit_SCTEndcapL8PhiResidual;
1314 std::vector<float> mnt_hit_SCTEndcapL9PhiResidual;
1324 auto mon_hit_PIXBarrelPhiResidual =
Monitored::Collection(
"hit_PIXBarrelPhiResidual",mnt_hit_PIXBarrelPhiResidual);
1325 auto mon_hit_PIXBarrelEtaResidual =
Monitored::Collection(
"hit_PIXBarrelEtaResidual",mnt_hit_PIXBarrelEtaResidual);
1326 auto mon_hit_PIXBarrelPhiPull =
Monitored::Collection(
"hit_PIXBarrelPhiPull",mnt_hit_PIXBarrelPhiPull);
1327 auto mon_hit_PIXBarrelEtaPull =
Monitored::Collection(
"hit_PIXBarrelEtaPull",mnt_hit_PIXBarrelEtaPull);
1328 auto mon_hit_SCTBarrelResidual =
Monitored::Collection(
"hit_SCTBarrelResidual",mnt_hit_SCTBarrelResidual);
1330 auto mon_hit_PIXEndcapPhiResidual =
Monitored::Collection(
"hit_PIXEndcapPhiResidual",mnt_hit_PIXEndcapPhiResidual);
1331 auto mon_hit_PIXEndcapEtaResidual =
Monitored::Collection(
"hit_PIXEndcapEtaResidual",mnt_hit_PIXEndcapEtaResidual);
1332 auto mon_hit_PIXEndcapPhiPull =
Monitored::Collection(
"hit_PIXEndcapPhiPull",mnt_hit_PIXEndcapPhiPull);
1333 auto mon_hit_PIXEndcapEtaPull =
Monitored::Collection(
"hit_PIXEndcapEtaPull",mnt_hit_PIXEndcapEtaPull);
1334 auto mon_hit_SCTEndcapResidual =
Monitored::Collection(
"hit_SCTEndcapResidual",mnt_hit_SCTEndcapResidual);
1336 auto mon_hit_PIXBarrelL1PhiResidual =
Monitored::Collection(
"hit_PIXBarrelL1PhiResidual",mnt_hit_PIXBarrelL1PhiResidual);
1337 auto mon_hit_PIXBarrelL1EtaResidual =
Monitored::Collection(
"hit_PIXBarrelL1EtaResidual",mnt_hit_PIXBarrelL1EtaResidual);
1338 auto mon_hit_PIXBarrelL2PhiResidual =
Monitored::Collection(
"hit_PIXBarrelL2PhiResidual",mnt_hit_PIXBarrelL2PhiResidual);
1339 auto mon_hit_PIXBarrelL2EtaResidual =
Monitored::Collection(
"hit_PIXBarrelL2EtaResidual",mnt_hit_PIXBarrelL2EtaResidual);
1340 auto mon_hit_PIXBarrelL3PhiResidual =
Monitored::Collection(
"hit_PIXBarrelL3PhiResidual",mnt_hit_PIXBarrelL3PhiResidual);
1341 auto mon_hit_PIXBarrelL3EtaResidual =
Monitored::Collection(
"hit_PIXBarrelL3EtaResidual",mnt_hit_PIXBarrelL3EtaResidual);
1342 auto mon_hit_PIXEndcapL1PhiResidual =
Monitored::Collection(
"hit_PIXEndcapL1PhiResidual",mnt_hit_PIXEndcapL1PhiResidual);
1343 auto mon_hit_PIXEndcapL1EtaResidual =
Monitored::Collection(
"hit_PIXEndcapL1EtaResidual",mnt_hit_PIXEndcapL1EtaResidual);
1344 auto mon_hit_PIXEndcapL2PhiResidual =
Monitored::Collection(
"hit_PIXEndcapL2PhiResidual",mnt_hit_PIXEndcapL2PhiResidual);
1345 auto mon_hit_PIXEndcapL2EtaResidual =
Monitored::Collection(
"hit_PIXEndcapL2EtaResidual",mnt_hit_PIXEndcapL2EtaResidual);
1346 auto mon_hit_PIXEndcapL3PhiResidual =
Monitored::Collection(
"hit_PIXEndcapL3PhiResidual",mnt_hit_PIXEndcapL3PhiResidual);
1347 auto mon_hit_PIXEndcapL3EtaResidual =
Monitored::Collection(
"hit_PIXEndcapL3EtaResidual",mnt_hit_PIXEndcapL3EtaResidual);
1348 auto mon_hit_SCTBarrelL1PhiResidual =
Monitored::Collection(
"hit_SCTBarrelL1PhiResidual",mnt_hit_SCTBarrelL1PhiResidual);
1349 auto mon_hit_SCTBarrelL2PhiResidual =
Monitored::Collection(
"hit_SCTBarrelL2PhiResidual",mnt_hit_SCTBarrelL2PhiResidual);
1350 auto mon_hit_SCTBarrelL3PhiResidual =
Monitored::Collection(
"hit_SCTBarrelL3PhiResidual",mnt_hit_SCTBarrelL3PhiResidual);
1351 auto mon_hit_SCTBarrelL4PhiResidual =
Monitored::Collection(
"hit_SCTBarrelL4PhiResidual",mnt_hit_SCTBarrelL4PhiResidual);
1352 auto mon_hit_SCTEndcapL1PhiResidual =
Monitored::Collection(
"hit_SCTEndcapL1PhiResidual",mnt_hit_SCTEndcapL1PhiResidual);
1353 auto mon_hit_SCTEndcapL2PhiResidual =
Monitored::Collection(
"hit_SCTEndcapL2PhiResidual",mnt_hit_SCTEndcapL2PhiResidual);
1354 auto mon_hit_SCTEndcapL3PhiResidual =
Monitored::Collection(
"hit_SCTEndcapL3PhiResidual",mnt_hit_SCTEndcapL3PhiResidual);
1355 auto mon_hit_SCTEndcapL4PhiResidual =
Monitored::Collection(
"hit_SCTEndcapL4PhiResidual",mnt_hit_SCTEndcapL4PhiResidual);
1356 auto mon_hit_SCTEndcapL5PhiResidual =
Monitored::Collection(
"hit_SCTEndcapL5PhiResidual",mnt_hit_SCTEndcapL5PhiResidual);
1357 auto mon_hit_SCTEndcapL6PhiResidual =
Monitored::Collection(
"hit_SCTEndcapL6PhiResidual",mnt_hit_SCTEndcapL6PhiResidual);
1358 auto mon_hit_SCTEndcapL7PhiResidual =
Monitored::Collection(
"hit_SCTEndcapL7PhiResidual",mnt_hit_SCTEndcapL7PhiResidual);
1359 auto mon_hit_SCTEndcapL8PhiResidual =
Monitored::Collection(
"hit_SCTEndcapL8PhiResidual",mnt_hit_SCTEndcapL8PhiResidual);
1360 auto mon_hit_SCTEndcapL9PhiResidual =
Monitored::Collection(
"hit_SCTEndcapL9PhiResidual",mnt_hit_SCTEndcapL9PhiResidual);
1362 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);
1364 std::vector<TrigL2HitResidual> vResid;
1367 if(!scRes.isSuccess())
return;
1373 switch(
it->regionId()) {
1375 mnt_layer_PixB.push_back(pixlayer);
1376 mnt_hit_PIXBarrelPhiResidual.push_back(
it->phiResidual());
1377 mnt_hit_PIXBarrelPhiPull.push_back(
it->phiPull());
1378 mnt_hit_PIXBarrelEtaResidual.push_back(
it->etaResidual());
1379 mnt_hit_PIXBarrelEtaPull.push_back(
it->etaPull());
1380 if (pixlayer == 1) {
1381 mnt_hit_PIXBarrelL1PhiResidual.push_back(
it->phiResidual());
1382 mnt_hit_PIXBarrelL1EtaResidual.push_back(
it->etaResidual());
1384 if (pixlayer == 2) {
1385 mnt_hit_PIXBarrelL2PhiResidual.push_back(
it->phiResidual());
1386 mnt_hit_PIXBarrelL2EtaResidual.push_back(
it->etaResidual());
1388 if (pixlayer == 3) {
1389 mnt_hit_PIXBarrelL3PhiResidual.push_back(
it->phiResidual());
1390 mnt_hit_PIXBarrelL3EtaResidual.push_back(
it->etaResidual());
1395 mnt_layer_PixE.push_back(pixlayer);
1396 mnt_hit_PIXEndcapPhiResidual.push_back(
it->phiResidual());
1397 mnt_hit_PIXEndcapPhiPull.push_back(
it->phiPull());
1398 mnt_hit_PIXEndcapEtaResidual.push_back(
it->etaResidual());
1399 mnt_hit_PIXEndcapEtaPull.push_back(
it->etaPull());
1400 if (pixlayer == 0) {
1401 mnt_hit_PIXEndcapL1PhiResidual.push_back(
it->phiResidual());
1402 mnt_hit_PIXEndcapL1EtaResidual.push_back(
it->etaResidual());
1404 if (pixlayer == 1) {
1405 mnt_hit_PIXEndcapL2PhiResidual.push_back(
it->phiResidual());
1406 mnt_hit_PIXEndcapL2EtaResidual.push_back(
it->etaResidual());
1408 if (pixlayer == 2) {
1409 mnt_hit_PIXEndcapL3PhiResidual.push_back(
it->phiResidual());
1410 mnt_hit_PIXEndcapL3EtaResidual.push_back(
it->etaResidual());
1414 mnt_layer_SCTB.push_back(sctlayer);
1415 mnt_hit_SCTBarrelResidual.push_back(
it->phiResidual());
1416 mnt_hit_SCTBarrelPull.push_back(
it->phiPull());
1417 if (sctlayer == 0) {
1418 mnt_hit_SCTBarrelL1PhiResidual.push_back(
it->phiResidual());
1420 if (sctlayer == 1) {
1421 mnt_hit_SCTBarrelL2PhiResidual.push_back(
it->phiResidual());
1423 if (sctlayer == 2) {
1424 mnt_hit_SCTBarrelL3PhiResidual.push_back(
it->phiResidual());
1426 if (sctlayer == 3) {
1427 mnt_hit_SCTBarrelL4PhiResidual.push_back(
it->phiResidual());
1432 mnt_layer_SCTE.push_back(sctlayer);
1433 mnt_hit_SCTEndcapResidual.push_back(
it->phiResidual());
1434 mnt_hit_SCTEndcapPull.push_back(
it->phiPull());
1435 if (sctlayer == 0) {
1436 mnt_hit_SCTEndcapL1PhiResidual.push_back(
it->phiResidual());
1438 if (sctlayer == 1) {
1439 mnt_hit_SCTEndcapL2PhiResidual.push_back(
it->phiResidual());
1441 if (sctlayer == 2) {
1442 mnt_hit_SCTEndcapL3PhiResidual.push_back(
it->phiResidual());
1444 if (sctlayer == 3) {
1445 mnt_hit_SCTEndcapL4PhiResidual.push_back(
it->phiResidual());
1447 if (sctlayer == 4) {
1448 mnt_hit_SCTEndcapL5PhiResidual.push_back(
it->phiResidual());
1450 if (sctlayer == 5) {
1451 mnt_hit_SCTEndcapL6PhiResidual.push_back(
it->phiResidual());
1453 if (sctlayer == 6) {
1454 mnt_hit_SCTEndcapL7PhiResidual.push_back(
it->phiResidual());
1456 if (sctlayer == 7) {
1457 mnt_hit_SCTEndcapL8PhiResidual.push_back(
it->phiResidual());
1459 if (sctlayer == 8) {
1460 mnt_hit_SCTEndcapL9PhiResidual.push_back(
it->phiResidual());
1464 mnt_layer_IBL.push_back(pixlayer);
1466 mnt_hit_IBLPhiResidual.push_back(
it->phiResidual());
1467 mnt_hit_IBLPhiPull.push_back(
it->phiPull());
1468 mnt_hit_IBLEtaResidual.push_back(
it->etaResidual());
1469 mnt_hit_IBLEtaPull.push_back(
it->etaPull());
1473 mnt_hit_PIXBarrelPhiResidual.push_back(
it->phiResidual());
1474 mnt_hit_PIXBarrelPhiPull.push_back(
it->phiPull());
1475 mnt_hit_PIXBarrelEtaResidual.push_back(
it->etaResidual());
1476 mnt_hit_PIXBarrelEtaPull.push_back(
it->etaPull());
1493 size_t actualSize =
m_accelTool->exportSeedMakingJob(tcs, roi, vsp, *dataBuffer);
1495 ATH_MSG_DEBUG(
"SeedMakingJob is ready, data size for transfer = " <<actualSize);
1497 std::shared_ptr<TrigAccel::OffloadBuffer> pBuff = std::make_shared<TrigAccel::OffloadBuffer>(dataBuffer);
1506 std::shared_ptr<TrigAccel::OffloadBuffer> pOB = pJob->
getOutput();
1521 ATH_CHECK( dEdxTrkHandle.
record(std::make_unique<xAOD::TrigCompositeContainer>(), std::make_unique<xAOD::TrigCompositeAuxContainer>()) );
1524 ATH_CHECK( dEdxHitHandle.
record(std::make_unique<xAOD::TrigCompositeContainer>(), std::make_unique<xAOD::TrigCompositeAuxContainer>()) );
1528 ATH_CHECK( disTrkCandHandle.
record(std::make_unique<xAOD::TrigCompositeContainer>(), std::make_unique<xAOD::TrigCompositeAuxContainer>()) );
1530 return StatusCode::SUCCESS;
1536 float abseta = std::fabs(
eta);
1547 const float PixBR6limit = 1.29612;
1548 const float PixBR5limit = 1.45204;
1549 const float PixBR4limit = 1.64909;
1550 const float PixBR3limit = 1.90036;
1551 const float PixBR2limit = 2.2146;
1557 if( abseta > PixBR2limit )
return 2;
1565 if( abseta > PixBR2limit )
return 2;
1580 if( abseta < PixBR6limit )
return 7;
1581 else if( abseta < PixBR5limit )
return 6;
1589 if( abseta < PixBR5limit )
return 7;
1590 else if( abseta < PixBR4limit )
return 6;
1598 if( abseta < PixBR4limit )
return 7;
1606 if( abseta < PixBR4limit )
return 6;
1607 else if( abseta < PixBR3limit )
return 6;
1615 if( abseta < PixBR3limit )
return 7;
1623 if( abseta < PixBR3limit )
return 6;
1631 if( abseta < PixBR3limit )
return 7;
1639 if( abseta < PixBR3limit )
return 7;
1657 ATH_CHECK( dEdxTrkHandle.
record(std::make_unique<xAOD::TrigCompositeContainer>(), std::make_unique<xAOD::TrigCompositeAuxContainer>()) );
1658 auto dEdxTrkContainer = dEdxTrkHandle.
ptr();
1662 ATH_CHECK( dEdxHitHandle.
record(std::make_unique<xAOD::TrigCompositeContainer>(), std::make_unique<xAOD::TrigCompositeAuxContainer>()) );
1663 auto dEdxHitContainer = dEdxHitHandle.
ptr();
1665 std::vector<float> mnt_dedx;
1666 std::vector<int> mnt_dedx_nusedhits;
1676 static constexpr
float TRKCUT_PTGEV_LOOSE = 3.0;
1677 static constexpr
float TRKCUT_PTGEV_TIGHT = 10.0;
1678 static constexpr
float TRKCUT_DEDX_LOOSE = 1.25;
1679 static constexpr
float TRKCUT_DEDX_TIGHT = 1.55;
1681 for (
const auto track: outputTracks) {
1683 float shift_x = 0;
float shift_y = 0;
1694 if (not igt) {
continue;}
1697 int pixelhits=0;
int n_usedhits=0;
1698 std::vector<float> v_pixhit_dedx; std::vector<float> v_pixhit_tot; std::vector<float> v_pixhit_trkchi2; std::vector<float> v_pixhit_trkndof;
1699 std::vector<int> v_pixhit_iblovfl; std::vector<int> v_pixhit_loc; std::vector<int> v_pixhit_layer;
1700 float dedx =
dEdx(
track,pixelhits,n_usedhits,v_pixhit_dedx,v_pixhit_tot,v_pixhit_trkchi2,v_pixhit_trkndof,
1701 v_pixhit_iblovfl,v_pixhit_loc,v_pixhit_layer);
1704 mnt_dedx.push_back(dedx);
1705 mnt_dedx_nusedhits.push_back(n_usedhits);
1707 bool hpt = (theTrackInfo.
ptGeV >= TRKCUT_PTGEV_TIGHT && dedx >= TRKCUT_DEDX_LOOSE);
1708 bool lpt = (theTrackInfo.
ptGeV >= TRKCUT_PTGEV_LOOSE && dedx >= TRKCUT_DEDX_TIGHT);
1709 if( ! hpt && ! lpt )
continue;
1712 dEdxTrkContainer->push_back(dEdxTrk);
1713 dEdxTrk->
setDetail<
int> (
"dEdxTrk_id", i_track);
1715 dEdxTrk->
setDetail<
float>(
"dEdxTrk_eta", theTrackInfo.
eta);
1716 dEdxTrk->
setDetail<
float>(
"dEdxTrk_phi", theTrackInfo.
phi0);
1718 dEdxTrk->
setDetail<
float>(
"dEdxTrk_dedx", dedx);
1719 dEdxTrk->
setDetail<
int> (
"dEdxTrk_dedx_n_usedhits", n_usedhits);
1725 for(
unsigned int i=0;
i<v_pixhit_dedx.size();
i++) {
1727 dEdxHitContainer->push_back(dEdxHit);
1728 dEdxHit->
setDetail<
int> (
"dEdxHit_trkid", i_track);
1729 dEdxHit->
setDetail<
float>(
"dEdxHit_dedx", v_pixhit_dedx[
i]);
1730 dEdxHit->
setDetail<
float>(
"dEdxHit_tot", v_pixhit_tot[
i]);
1731 dEdxHit->
setDetail<
float>(
"dEdxHit_trkchi2", v_pixhit_trkchi2[
i]);
1732 dEdxHit->
setDetail<
float>(
"dEdxHit_trkndof", v_pixhit_trkndof[
i]);
1733 dEdxHit->
setDetail<
int> (
"dEdxHit_iblovfl", v_pixhit_iblovfl[
i]);
1734 dEdxHit->
setDetail<
int> (
"dEdxHit_loc", v_pixhit_loc[
i]);
1735 dEdxHit->
setDetail<
int> (
"dEdxHit_layer", v_pixhit_layer[
i]);
1738 return StatusCode::SUCCESS;
1744 std::vector<float>& v_pixhit_dedx, std::vector<float>& v_pixhit_tot,
1745 std::vector<float>& v_pixhit_trkchi2, std::vector<float>& v_pixhit_trkndof,
1746 std::vector<int>& v_pixhit_iblovfl, std::vector<int>& v_pixhit_loc, std::vector<int>& v_pixhit_layer)
const
1748 const float Pixel_sensorthickness=.025;
1749 const float IBL_3D_sensorthickness=.023;
1750 const float IBL_PLANAR_sensorthickness=.020;
1752 const float energyPair = 3.68e-6;
1753 const float sidensity = 2.329;
1755 float conversion_factor=energyPair/sidensity;
1762 v_pixhit_dedx.clear();
1763 v_pixhit_tot.clear();
1764 v_pixhit_trkchi2.clear();
1765 v_pixhit_trkndof.clear();
1766 v_pixhit_iblovfl.clear();
1767 v_pixhit_loc.clear();
1768 v_pixhit_layer.clear();
1770 const int PIXLOC_IBL_PL = 0;
1771 const int PIXLOC_IBL_3D = 1;
1772 const int PIXLOC_PIX_LY = 2;
1773 const int PIXLOC_PIX_EC = 3;
1774 const int PIXLOC_IBL_UNKNOWN = 4;
1775 const int PIXLOC_PIX_UNKNOWN = 5;
1777 std::multimap<float,int> dEdxMap;
1778 float dEdxValue = 0;
1782 if (recoTrackStates) {
1790 for ( ; tsosIter != tsosIterEnd; ++tsosIter) {
1795 if ( measurement ==
nullptr ) {
1800 if(
tp ==
nullptr ) {
1805 if ( pixclus ==
nullptr ) {
1810 if( prd ==
nullptr ) {
1815 float dotProd =
tp->momentum().dot(
tp->associatedSurface().normal());
1816 float cosalpha = std::abs(dotProd/
tp->momentum().mag());
1817 ATH_MSG_VERBOSE(
"dotProd / cosalpha = " << dotProd <<
" / " << cosalpha);
1818 if (std::abs(cosalpha)<.16)
continue;
1820 const std::vector<int>& v_tots = prd->
totList();
1845 const float overflowIBLToT = 16;
1846 for (
int pixToT : v_tots) {
1847 if (pixToT >= overflowIBLToT) {
1854 if(((eta_module>=-10 && eta_module<=-7)||(eta_module>=6 && eta_module<=9)) && (std::abs(locy)<10. && (locx>-8.33 && locx <8.3)) ){
1855 thickness = IBL_3D_sensorthickness;
1856 loc = PIXLOC_IBL_3D;
1858 else if((eta_module>=-6 && eta_module<=5) && (std::abs(locy)<20. &&( locx >-8.33 && locx <8.3 )) ){
1859 thickness = IBL_PLANAR_sensorthickness;
1860 loc = PIXLOC_IBL_PL;
1864 loc = PIXLOC_IBL_UNKNOWN;
1867 else if(
bec==0 && std::abs(locy)<30. && (( locx > -8.20 && locx < -0.60 ) || ( locx > 0.50 && locx < 8.10 ) ) ){
1868 thickness = Pixel_sensorthickness;
1869 loc = PIXLOC_PIX_LY;
1871 else if(std::abs(
bec) == 2 && std::abs(locy)<30. && ( ( locx > -8.15 && locx < -0.55 ) || ( locx > 0.55 && locx < 8.15 ) ) ) {
1872 thickness = Pixel_sensorthickness;
1873 loc = PIXLOC_PIX_EC;
1877 loc = PIXLOC_IBL_UNKNOWN;
1881 if( loc != PIXLOC_IBL_UNKNOWN && loc != PIXLOC_PIX_UNKNOWN ) {
1882 dEdxValue =
charge*conversion_factor/thickness;
1883 dEdxMap.insert(std::pair<float,int>(dEdxValue, iblOverflow));
1887 v_pixhit_dedx.push_back(dEdxValue); v_pixhit_tot.push_back(tot);
1888 v_pixhit_trkchi2.push_back(
chi2); v_pixhit_trkndof.push_back(
ndof);
1889 v_pixhit_iblovfl.push_back(iblOverflow); v_pixhit_loc.push_back(loc); v_pixhit_layer.push_back(
layer);
1896 float averagedEdx=0.;
1901 for (std::pair<float,int> itdEdx : dEdxMap) {
1903 if(itdEdx.second==0){
1905 averagedEdx += itdEdx.first;
1908 if(itdEdx.second > 0){
1913 if (((
int)pixelhits >= 5) and ((
int)n_usedhits >= (
int)pixelhits-2)) {
1919 if((
int)IBLOverflow>0 and ((
int)pixelhits==3) and (
int)n_usedhits==1) {
1923 if((
int)IBLOverflow>0 and ((
int)pixelhits==4) and (
int)n_usedhits==2) {
1928 if (((
int)pixelhits > 1) and ((
int)n_usedhits >=(
int)pixelhits-1)) {
1933 if((
int)IBLOverflow>0 and (
int)pixelhits==1){
1935 averagedEdx=itdEdx.first;
1940 if (n_usedhits > 0 or (n_usedhits==0 and(
int)IBLOverflow>0 and (
int)pixelhits==1)) {
1941 if(n_usedhits > 0) averagedEdx = averagedEdx / n_usedhits;
1943 ATH_MSG_DEBUG(
"=====> averaged dEdx = " << averagedEdx <<
" =====>");;
1944 ATH_MSG_DEBUG(
" +++ Used hits: " << n_usedhits <<
", IBL overflows: " << IBLOverflow );;
1945 ATH_MSG_DEBUG(
" +++ Original number of measurements = " << pixelhits <<
" (map size = " << dEdxMap.size() <<
") ");
1956 const float PT_CUT = 3.0;
1958 const double FAIL_CHI2_OV_NDOF_CUT = 20.0;
1960 const int COMB_N_HITS_IBL_OR_BL_CUT = 1;
1961 const int COMB_N_HITS_PIX_BR_CUT = 3;
1962 const double COMB_CHI2_OV_NDOF_PIX_BR_CUT = 3.0;
1963 const int COMB_N_GOOD_HITS_SCT_BR_CUT = 2;
1964 const int COMB_N_GOOD_DOUBLEHITS_SCT_BR_CUT = 0;
1967 if( trk==
nullptr )
return false;
1969 if( trk->
fitQuality()==
nullptr )
return false;
1972 if( !seed.s1().isPixel() || !seed.s2().isPixel() || !seed.s3().isPixel() )
return false;
1973 float s1_z = seed.s1().z();
1974 float s2_z = seed.s2().z();
1975 float s3_z = seed.s3().z();
1976 const float PIXEL_BARREL_Z = 410.0;
1977 if( std::abs(s1_z) > PIXEL_BARREL_Z || std::abs(s2_z) > PIXEL_BARREL_Z || std::abs(s3_z) > PIXEL_BARREL_Z )
return false;
1978 ATH_MSG_VERBOSE(
"FTF::isCleaningPassDisTrack> ... barrel cut passed");
1985 if(
pt/1000.0 < PT_CUT )
return false;
1992 if( std::abs(
ndof) < 1
e-12 )
return false;
1993 if(
chi2/
ndof > FAIL_CHI2_OV_NDOF_CUT )
return false;
1994 ATH_MSG_VERBOSE(
"FTF::isCleaningPassDisTrack> ... (failTrk) Chi2 cut passed");
2000 int n_hits_iblbl = barrelInfo[0].nHits + barrelInfo[1].nHits;
2001 if( n_hits_iblbl < COMB_N_HITS_IBL_OR_BL_CUT )
return false;
2004 int n_hits_pixbr = 0;
2005 double chi2_pixbr = 0;
2007 for(
unsigned int ily=0; ily<=3; ily++) {
2008 n_hits_pixbr += barrelInfo[ily].nHits;
2009 chi2_pixbr += barrelInfo[ily].chiSq;
2010 ndof_pixbr += barrelInfo[ily].nDof;
2012 if( n_hits_pixbr < COMB_N_HITS_PIX_BR_CUT )
return false;
2013 if( ndof_pixbr < 1 )
return false;
2014 double chi2_ov_ndof_pixbr = chi2_pixbr / ndof_pixbr;
2015 if( chi2_ov_ndof_pixbr > COMB_CHI2_OV_NDOF_PIX_BR_CUT )
return false;
2016 ATH_MSG_VERBOSE(
"FTF::isCleaningPassDisTrack> ... (combTrk) Pix cut passed");
2019 int n_hits_sctbr_good = 0;
2020 int n_doublehits_sctbr_good = 0;
2021 for(
unsigned int ily=4; ily<=7; ily++) {
2022 n_hits_sctbr_good += barrelInfo[ily].nGood;
2023 if( barrelInfo[ily].
nGood >= 2 ) n_doublehits_sctbr_good++;
2025 if( n_hits_sctbr_good > COMB_N_GOOD_HITS_SCT_BR_CUT )
return false;
2026 if( n_doublehits_sctbr_good > COMB_N_GOOD_DOUBLEHITS_SCT_BR_CUT )
return false;
2027 ATH_MSG_VERBOSE(
"FTF::isCleaningPassDisTrack> ... (combTrk) SCT cut passed");
2034 std::array<TrigFastTrackFinder::OneLayerInfo_t, TrigFastTrackFinder::N_BARREL_LAYERS>
2037 static constexpr
double CHI2_GOOD_CUT = 3.0;
2039 std::array<TrigFastTrackFinder::OneLayerInfo_t, TrigFastTrackFinder::N_BARREL_LAYERS>
result{};
2043 if (recoTrackStates) {
2046 for ( ; tsosIter != tsosIterEnd; ++tsosIter) {
2054 bool chi2_good = (
x2 <= CHI2_GOOD_CUT);
2057 if (pixclus!=
nullptr) {
2072 if (sctclus!=
nullptr) {
2098 double quality_pixel = 0. ;
2099 double quality_sct = 0. ;
2101 const double W = 17.;
2116 if( pixclus !=0 ) quality_pixel +=
q;
2117 else quality_sct +=
q;
2122 double quality = quality_pixel;
2123 quality -= quality_sct;
2124 if( quality < 0. ) quality = 0.;
2138 double xVTX =
vertex.x();
2139 double yVTX =
vertex.y();
2140 double tiltXZ = beamSpotHandle->beamTilt(0);
2141 double tiltYZ = beamSpotHandle->beamTilt(1);
2144 const double CLUSTCUT_DIST_SIGMA = 5.0;
2145 const double CLUSTCUT_DIST = 2.5;
2146 const double CLUSTCUT_SEED_PT = 3.0;
2148 const int VTXCUT_N_TRACKS = 3;
2149 const int VTXCUT_ALGO = 1;
2151 std::vector<std::tuple<int,double,double,Trk::Track*>> QT;
2152 QT.reserve(tracks.
size());
2154 for (
auto t=tracks.
begin();
t!=tracks.
end(); ++
t) {
2162 QT.emplace_back(std::make_tuple(-1,
pt,
pt,(*
t)));
2166 std::sort(QT.begin(), QT.end(),
2167 [](
const std::tuple<int,double,double,Trk::Track*>& lhs,
const std::tuple<int,double,double,Trk::Track*>& rhs) {
2168 return std::get<1>(lhs) > std::get<1>(rhs); } );
2171 std::vector<int> cluster_ntrk;
2172 std::vector<double> cluster_ptsum;
2173 std::vector<double> cluster_z;
2174 std::vector<double> cluster_wsum;
2175 std::vector<double> cluster_zerr;
2176 std::vector<double> cluster_w2sum;
2178 for(
unsigned int i=0;
i<QT.size(); ++
i) {
2180 double z =
t->perigeeParameters()->parameters()[
Trk::z0];
2181 double zerr = sqrt((*(
t->perigeeParameters()->covariance()))(
Trk::z0,
Trk::z0));
2182 double w = std::get<2>(QT[
i]);
2183 double pt = std::get<1>(QT[
i]);
2185 cluster_ntrk.push_back(1); cluster_ptsum.push_back(
pt);
2186 cluster_z.push_back(
w*
z); cluster_wsum.push_back(
w);
2187 cluster_zerr.push_back(
w*zerr*
w*zerr); cluster_w2sum.push_back(
w*
w);
2191 const int IDX_INITIAL = 100;
2192 double dist_min = 100.0;
2194 for(
unsigned j=0; j<cluster_z.size(); ++j) {
2195 double dist = std::abs(
z - cluster_z[j]/cluster_wsum[j]);
2196 if( dist < dist_min ) {
2201 int match_idx = IDX_INITIAL;
2202 if(
idx_min != IDX_INITIAL ) {
2203 double c_zerr_min = std::sqrt(cluster_zerr[
idx_min]/cluster_w2sum[
idx_min]);
2204 double err = std::sqrt(zerr*zerr+c_zerr_min*c_zerr_min);
2205 if( std::abs(
err) < 1
e-12 )
err = 1
e-12;
2206 double dist = dist_min /
err;
2207 if( dist < CLUSTCUT_DIST_SIGMA && dist_min < CLUSTCUT_DIST ) { match_idx =
idx_min; }
2210 if( match_idx == IDX_INITIAL ) {
2211 if(
pt > CLUSTCUT_SEED_PT && dist_min > CLUSTCUT_DIST ) {
2212 cluster_ntrk.push_back(1); cluster_ptsum.push_back(
pt);
2213 cluster_z.push_back(
w*
z); cluster_wsum.push_back(
w);
2214 cluster_zerr.push_back(
w*zerr*
w*zerr); cluster_w2sum.push_back(
w*
w);
2218 int new_n = cluster_ntrk[match_idx] + 1;
2219 double new_ptsum = cluster_ptsum[match_idx] +
pt;
2220 double new_z = cluster_z[match_idx] +
w*
z;
2221 double new_wsum = cluster_wsum[match_idx] +
w;
2222 double new_zerr = cluster_zerr[match_idx] +
w*zerr*
w*zerr;
2223 double new_w2sum = cluster_w2sum[match_idx] +
w*
w;
2224 cluster_ntrk[match_idx] = new_n;
2225 cluster_ptsum[match_idx] = new_ptsum;
2226 cluster_z[match_idx] = new_z;
2227 cluster_wsum[match_idx] = new_wsum;
2228 cluster_zerr[match_idx] = new_zerr;
2229 cluster_w2sum[match_idx] = new_w2sum;
2234 std::vector<std::tuple<double,double,double,int>> zVtx;
2235 zVtx.reserve(tracks.
size());
2236 for(
unsigned int i=0;
i<cluster_z.size();
i++) {
2237 if( cluster_ntrk[
i] < VTXCUT_N_TRACKS )
continue;
2238 double z = cluster_z[
i] / cluster_wsum[
i];
2239 double zerr = std::sqrt(cluster_zerr[
i] / cluster_w2sum[
i]);
2240 zVtx.push_back(std::make_tuple(cluster_ptsum[
i],
z,zerr,cluster_ntrk[
i]));
2243 if( VTXCUT_ALGO == 1 ) {
2244 std::sort(zVtx.begin(), zVtx.end(),
2245 [](
const std::tuple<double,double,double,int>& lhs,
const std::tuple<double,double,double,int>& rhs) {
2246 return std::get<0>(lhs) > std::get<0>(rhs); } );
2248 ATH_MSG_VERBOSE(
"disTrkZVtertex> ===== looping zVtx size: " << zVtx.size());
2249 for(
unsigned int i=0;
i<zVtx.size();
i++) {
2250 double z = std::get<1>(zVtx[
i]);
2251 double zerr = std::get<2>(zVtx[
i]);
2252 double pt = std::get<0>(zVtx[
i]);
2253 int n = std::get<3>(zVtx[
i]);
2254 v_zvtx.push_back(
z);
2255 v_xvtx.push_back(xVTX - tiltXZ*
z);
2256 v_yvtx.push_back(yVTX - tiltYZ*
z);
2257 ATH_MSG_VERBOSE(
"disTrkZVtertex> Vertex cand i=" <<
i <<
": z = " <<
z <<
" +- " << zerr <<
", sum n / pt = " <<
n <<
" / " <<
pt);
2266 mnt_disTrk_nVtx = v_zvtx.size();
2267 if(v_zvtx.size()>0) {
2268 mnt_disTrk_xVtx = v_xvtx[0];
2269 mnt_disTrk_yVtx = v_yvtx[0];
2270 mnt_disTrk_zVtx = v_zvtx[0];
2276 const double TRKCUT_CHI2_OV_NDOF = 3.0;
2277 const double TRKCUT_PT = 1.0;
2278 const double TRKCUT_D0 = 2.0;
2279 const int TRKCUT_N_HITS_INNER = 1;
2280 const int TRKCUT_N_HITS_PIX = 3;
2281 const int TRKCUT_N_HITS = 7;
2284 if ( !
t->perigeeParameters() )
return false;
2285 if ( !
t->fitQuality() )
return false;
2286 if (
t->trackSummary()==0 ) {
2288 if (
t->trackSummary()==0 )
return false;
2292 double chi2 =
t->fitQuality()->chiSquared();
2293 double ndof =
t->fitQuality()->doubleNumberDoF();
2294 if( std::abs(
ndof) < 1
e-2 )
return false;
2296 if( chi2_ov_ndof > TRKCUT_CHI2_OV_NDOF )
return false;
2304 if(
pt < TRKCUT_PT )
return false;
2307 double d0 =
t->perigeeParameters()->parameters()[
Trk::d0];
2308 if( std::abs(
d0) > TRKCUT_D0 )
return false;
2313 int n_hits_inner = n_hits_innermost + n_hits_next_to_innermost;
2316 if( n_hits_inner < TRKCUT_N_HITS_INNER )
return false;
2317 if( n_hits_pix < TRKCUT_N_HITS_PIX )
return false;
2318 if( (n_hits_pix+n_hits_sct) < TRKCUT_N_HITS )
return false;
2326 const int N_FREE_PIX_HITS_CUT = 2;
2328 std::set<const Trk::PrepRawData*>
clusters;
2332 std::sort(QT.begin(), QT.end(),
2333 [](
const std::tuple<bool, double, Trk::Track*>& lhs,
const std::tuple<bool, double, Trk::Track*>& rhs) {
2334 return std::get<1>(lhs) < std::get<1>(rhs); } );
2336 for (
auto&
q : QT) {
2338 m = std::get<2>(
q)->measurementsOnTrack()->begin(),
2339 me = std::get<2>(
q)->measurementsOnTrack()->end ();
2342 for(;
m!=me; ++
m ) {
2352 if((nf >= N_FREE_PIX_HITS_CUT) || (nf ==
nc) ) {
2356 std::get<0>(
q) =
false;
2363 std::vector<std::tuple<bool, double, Trk::Track*>>& qualityDisFailTrks,
2364 std::vector<std::tuple<bool, double, Trk::Track*>>& qualityDisCombTrks,
2366 const std::vector<double>& v_xvtx,
2367 const std::vector<double>& v_yvtx,
2368 const std::vector<double>& v_zvtx)
const
2371 ATH_CHECK( disTrkCandHandle.
record(std::make_unique<xAOD::TrigCompositeContainer>(), std::make_unique<xAOD::TrigCompositeAuxContainer>()) );
2372 auto disTrkCandContainer = disTrkCandHandle.
ptr();
2381 auto monDisTrk =
Monitored::Group(
m_monTool, mnt_disFailTrk_n, mnt_disFailTrk_nclone, mnt_disFailTrk_ncand, mnt_disCombTrk_n, mnt_disCombTrk_nclone, mnt_disCombTrk_ncand);
2384 std::vector<Trk::Track*> tracksForIso;
2385 for (
auto t=tracks.
begin();
t!=tracks.
end(); ++
t) {
2390 const std::string
prefix =
"disTrkCand";
2394 initialDisFailTrks.
reserve(qualityDisFailTrks.size());
2395 std::vector<int> resultCodes;
2396 for(
const auto&
q : qualityDisFailTrks) {
2397 if (std::get<0>(
q)==
true) {
2401 delete std::get<2>(
q);
2404 ATH_MSG_VERBOSE(
"===> nr of disFailTrk=" << qualityDisFailTrks.size() <<
" -> clone removal=" << initialDisFailTrks.
size());
2408 int n_disFailTrkCands =
recoAndFillDisTrkCand(
prefix, &fittedDisFailTrks, tracksForIso, disTrkCandContainer, v_xvtx, v_yvtx, v_zvtx,
true, ctx);
2411 mnt_disFailTrk_n = qualityDisFailTrks.size();
2412 mnt_disFailTrk_nclone = initialDisFailTrks.
size();
2413 mnt_disFailTrk_ncand = n_disFailTrkCands;
2416 ATH_MSG_VERBOSE(
"===> nr of disCombTrk=" << qualityDisCombTrks.size() <<
" -> clone removal=" << fittedDisCombTrks.
size());
2417 int n_disCombTrkCands =
recoAndFillDisTrkCand(
prefix, &fittedDisCombTrks, tracksForIso, disTrkCandContainer, v_xvtx, v_yvtx, v_zvtx,
false, ctx);
2420 mnt_disCombTrk_n = qualityDisCombTrks.size();
2421 mnt_disCombTrk_nclone = fittedDisCombTrks.
size();
2422 mnt_disCombTrk_ncand = n_disCombTrkCands;
2424 return StatusCode::SUCCESS;
2429 const float PRESEL_PT_GEV = 5.0;
2430 const float PRESEL_REFIT_PT_GEV_P3S1 = 10.0;
2431 const double PRESEL_D0_WRTVTX = 5.0;
2432 const double PRESEL_Z0_WRTVTX = 50.0;
2435 if( trk ==
nullptr )
return false;
2438 if( cat==DisTrkCategory::Pix4l_Sct1p || cat==DisTrkCategory::Pix3l_Sct1p ) {
if( refitTrk ==
nullptr )
return false; }
2441 if( std::abs(refit_d0_wrtVtx) > PRESEL_D0_WRTVTX )
return false;
2444 if( std::abs(refit_z0_wrtVtx) > PRESEL_Z0_WRTVTX )
return false;
2447 std::vector<float> v_ptGeV;
2448 std::vector<Trk::Track*> v_trk;
2449 v_trk.push_back(trk);
2450 if( refitTrk !=
nullptr ) v_trk.push_back(refitTrk);
2451 for(
auto t : v_trk) {
2456 v_ptGeV.push_back(ptGeV);
2458 bool isLowPt =
true;
2459 for(
auto pt : v_ptGeV) {
2460 if(
pt > PRESEL_PT_GEV ) { isLowPt =
false;
break; }
2462 if( isLowPt )
return false;
2465 if( cat==DisTrkCategory::Pix3l_Sct1p ) {
2466 float refitPt = v_ptGeV[1];
2467 if( refitPt < PRESEL_REFIT_PT_GEV_P3S1 )
return false;
2476 const double PRESEL_D0_WRTVTX = 5.0;
2477 const double PRESEL_Z0_WRTVTX = 50.0;
2478 const int PRESEL_N_GOOD_BR_LAYERS_PIX = 3;
2479 const double PRESEL_CHI2_OV_NDOF_PIX_BR_CUT = 5.0;
2482 if( trk ==
nullptr )
return false;
2489 double chi2_pixbr = 0.0;
2491 int n_good_brlayers_pix = 0;
2492 for(
unsigned int ily=0; ily<=3; ily++) {
2493 if( barrelLayerInfo[ily].
nGood >= 1 ) n_good_brlayers_pix++;
2494 chi2_pixbr += barrelLayerInfo[ily].chiSq;
2495 ndof_pixbr += barrelLayerInfo[ily].nDof;
2497 if( n_good_brlayers_pix < PRESEL_N_GOOD_BR_LAYERS_PIX )
return false;
2499 if( ndof_pixbr < 1 )
return false;
2500 double chi2_ov_ndof_pixbr = chi2_pixbr / ndof_pixbr;
2501 if( chi2_ov_ndof_pixbr > PRESEL_CHI2_OV_NDOF_PIX_BR_CUT )
return false;
2504 if( std::abs(d0_wrtVtx) > PRESEL_D0_WRTVTX )
return false;
2507 if( std::abs(z0_wrtVtx) > PRESEL_Z0_WRTVTX )
return false;
2514 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
2519 float trk_z0 =
t->perigeeParameters()->parameters()[
Trk::z0];
2520 float z0_min = 9999;
2521 for(
unsigned int i_vtx=0; i_vtx<v_zvtx.size(); i_vtx++) {
2522 float z = v_zvtx[i_vtx];
2523 if( std::abs(trk_z0-
z) < z0_min ) {
2524 z0_min = std::abs(trk_z0-
z);
2526 vtx_x = v_xvtx[i_vtx];
2527 vtx_y = v_yvtx[i_vtx];
2533 std::unique_ptr<const Trk::TrackParameters>
tmp =
2534 m_extrapolator->extrapolateDirectly(ctx, (*(
t->perigeeParameters())), persf);
2545 int n_good_brlayers_pix = 0;
2547 for(
unsigned int ily=0; ily<8; ily++) {
2548 if( ily<=3 &&
result[ily].
nGood >= 1 ) n_good_brlayers_pix++;
2550 n_hits_sct +=
result[ily].nHits;
2557 if( n_good_brlayers_pix == 4 ) {
2558 if( n_hits_sct==0 ) { cat=DisTrkCategory::Pix4l_Sct0; }
2559 else { cat=DisTrkCategory::Pix4l_Sct1p; }
2561 else if( n_good_brlayers_pix == 3 ) {
2562 if( n_hits_sct==0 ) { cat=DisTrkCategory::Pix3l_Sct0; }
2563 else { cat=DisTrkCategory::Pix3l_Sct1p; }
2570 std::vector<Trk::Track*> vtmp;
2575 bool fillIso, std::vector<Trk::Track*>& tracksForIso)
const
2583 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;
2584 if( trk !=
nullptr ) {
2600 n_hits_inner = n_hits_innermost + n_hits_next_to_innermost;
2616 float theta_wrtVtx=0;
float eta_wrtVtx=0;
float pt_wrtVtx=0;
float d0_wrtVtx=0;
float z0_wrtVtx=0;
float phi_wrtVtx=0;
2617 if( vertexPerigee !=
nullptr ) {
2618 theta_wrtVtx = vertexPerigee->parameters()[
Trk::theta];
2620 float qOverP_wrtVtx = std::abs(vertexPerigee->parameters()[
Trk::qOverP]);
2621 if ( qOverP_wrtVtx < 1
e-12 ) qOverP_wrtVtx = 1
e-12;
2622 pt_wrtVtx =
std::sin(theta_wrtVtx)/qOverP_wrtVtx;
2623 d0_wrtVtx = vertexPerigee->parameters()[
Trk::d0];
2624 z0_wrtVtx = vertexPerigee->parameters()[
Trk::z0];
2625 phi_wrtVtx = vertexPerigee->parameters()[
Trk::phi];
2627 comp->setDetail<
float>(
prefix+
"_pt_wrtVtx", pt_wrtVtx);
2628 comp->setDetail<
float>(
prefix+
"_eta_wrtVtx", eta_wrtVtx);
2629 comp->setDetail<
float>(
prefix+
"_phi_wrtVtx", phi_wrtVtx);
2630 comp->setDetail<
float>(
prefix+
"_d0_wrtVtx", d0_wrtVtx);
2631 comp->setDetail<
float>(
prefix+
"_z0_wrtVtx", z0_wrtVtx);
2634 std::array<OneLayerInfo_t, N_BARREL_LAYERS> barrelInfo{};
2636 comp->setDetail<
float>(
prefix+
"_chi2sum_br_ibl", barrelInfo[0].chiSq);
2637 comp->setDetail<
float>(
prefix+
"_chi2sum_br_pix1", barrelInfo[1].chiSq);
2638 comp->setDetail<
float>(
prefix+
"_chi2sum_br_pix2", barrelInfo[2].chiSq);
2639 comp->setDetail<
float>(
prefix+
"_chi2sum_br_pix3", barrelInfo[3].chiSq);
2640 comp->setDetail<
float>(
prefix+
"_chi2sum_br_sct1", barrelInfo[4].chiSq);
2641 comp->setDetail<
float>(
prefix+
"_chi2sum_br_sct2", barrelInfo[5].chiSq);
2642 comp->setDetail<
float>(
prefix+
"_chi2sum_br_sct3", barrelInfo[6].chiSq);
2643 comp->setDetail<
float>(
prefix+
"_chi2sum_br_sct4", barrelInfo[7].chiSq);
2644 comp->setDetail<
float>(
prefix+
"_ndofsum_br_ibl", barrelInfo[0].nDof);
2645 comp->setDetail<
float>(
prefix+
"_ndofsum_br_pix1", barrelInfo[1].nDof);
2646 comp->setDetail<
float>(
prefix+
"_ndofsum_br_pix2", barrelInfo[2].nDof);
2647 comp->setDetail<
float>(
prefix+
"_ndofsum_br_pix3", barrelInfo[3].nDof);
2648 comp->setDetail<
float>(
prefix+
"_ndofsum_br_sct1", barrelInfo[4].nDof);
2649 comp->setDetail<
float>(
prefix+
"_ndofsum_br_sct2", barrelInfo[5].nDof);
2650 comp->setDetail<
float>(
prefix+
"_ndofsum_br_sct3", barrelInfo[6].nDof);
2651 comp->setDetail<
float>(
prefix+
"_ndofsum_br_sct4", barrelInfo[7].nDof);
2655 const float ISOL_CALC_Z0_DIFF_CUT = 2.5;
2656 const float ISOL_CALC_DR_CUT_TO_AVOID_ZERO = 0.015;
2657 float iso1_dr01=0;
float iso1_dr02=0;
2658 float iso2_dr01=0;
float iso2_dr02=0;
2659 float iso3_dr01=0;
float iso3_dr02=0;
2660 for(
auto t=tracksForIso.begin();
t!=tracksForIso.end();
t++) {
2661 float z0_t = (*t)->perigeeParameters()->parameters()[
Trk::z0];
2662 if( std::abs(z0_t -
z0) <= ISOL_CALC_Z0_DIFF_CUT ) {
2663 float theta_t = (*t)->perigeeParameters()->parameters()[
Trk::theta];
2664 float qOverP_t= std::abs((*t)->perigeeParameters()->parameters()[
Trk::qOverP]);
2665 if ( qOverP_t < 1
e-12 ) qOverP_t = 1
e-12;
2666 float pt_t =
std::sin(theta_t)/qOverP_t;
2667 float phi_t = (*t)->perigeeParameters()->parameters()[
Trk::phi];
2669 float deta = eta_t -
eta;
2670 float dphi = std::abs(phi_t -
phi);
2672 float dr = std::sqrt(deta*deta + dphi*dphi);
2673 if(
dr > ISOL_CALC_DR_CUT_TO_AVOID_ZERO && dr<0.1 && pt_t > 1.0*
Gaudi::Units::GeV ) iso1_dr01 += pt_t;
2674 if(
dr > ISOL_CALC_DR_CUT_TO_AVOID_ZERO && dr<0.2 && pt_t > 1.0*
Gaudi::Units::GeV ) iso1_dr02 += pt_t;
2676 if(
dr > ISOL_CALC_DR_CUT_TO_AVOID_ZERO && dr<0.1 && pt_t > 2.0*
Gaudi::Units::GeV ) iso2_dr01 += pt_t;
2677 if(
dr > ISOL_CALC_DR_CUT_TO_AVOID_ZERO && dr<0.2 && pt_t > 2.0*
Gaudi::Units::GeV ) iso2_dr02 += pt_t;
2679 if(
dr > ISOL_CALC_DR_CUT_TO_AVOID_ZERO && dr<0.1 && pt_t > 3.0*
Gaudi::Units::GeV ) iso3_dr01 += pt_t;
2680 if(
dr > ISOL_CALC_DR_CUT_TO_AVOID_ZERO && dr<0.2 && pt_t > 3.0*
Gaudi::Units::GeV ) iso3_dr02 += pt_t;
2683 comp->setDetail<
float>(
prefix+
"_iso1_dr01", iso1_dr01);
2684 comp->setDetail<
float>(
prefix+
"_iso1_dr02", iso1_dr02);
2685 comp->setDetail<
float>(
prefix+
"_iso2_dr01", iso2_dr01);
2686 comp->setDetail<
float>(
prefix+
"_iso2_dr02", iso2_dr02);
2687 comp->setDetail<
float>(
prefix+
"_iso3_dr01", iso3_dr01);
2688 comp->setDetail<
float>(
prefix+
"_iso3_dr02", iso3_dr02);
2695 const std::vector<double>& v_xvtx,
2696 const std::vector<double>& v_yvtx,
2697 const std::vector<double>& v_zvtx,
2699 const EventContext& ctx)
const
2703 int n_stored_tracks = 0;
2705 for (
auto trk = tracks->
begin(); trk!=tracks->
end(); ++trk) {
2709 if( ptrk ==
nullptr )
continue;
2713 std::unique_ptr<const Trk::TrackParameters> vertexPerigee =
extrapolateDisTrackToBS(ptrk,v_xvtx,v_yvtx,v_zvtx, ctx);
2716 double d0_wrtVtx = 0;
2717 double z0_wrtVtx = 0;
2718 if( vertexPerigee !=
nullptr ) {
2719 d0_wrtVtx = vertexPerigee->parameters()[
Trk::d0];
2720 z0_wrtVtx = vertexPerigee->parameters()[
Trk::z0];
2731 std::unique_ptr<Trk::Track> refit_trk =
disTrk_refit(ptrk, ctx);
2735 double refit_d0 = 0;
2736 double refit_z0 = 0;
2737 double refit_d0_wrtVtx = 0;
2738 double refit_z0_wrtVtx = 0;
2739 std::unique_ptr<const Trk::TrackParameters> refitVertexPerigee =
nullptr;
2740 if( refit_trk !=
nullptr ) {
2742 if( refitVertexPerigee ==
nullptr ) {
2748 refit_d0_wrtVtx = refitVertexPerigee->parameters()[
Trk::d0];
2749 refit_z0_wrtVtx = refitVertexPerigee->parameters()[
Trk::z0];
2750 ATH_MSG_VERBOSE(
"refit trk d0 : " << refit_d0 <<
" -> extrapolate -> " << refit_d0_wrtVtx);
2751 ATH_MSG_VERBOSE(
"refit trk z0 : " << refit_z0 <<
" -> extrapolate -> " << refit_z0_wrtVtx);
2762 comp->makePrivateStore();
2766 int is_fail = isFail ? 1 : 0;
2774 prefix = base_prefix +
"_refit";
2775 if( refit_trk !=
nullptr ) {
2788 return n_stored_tracks;
2793 std::unique_ptr<Trk::Track> newtrack =
nullptr;
2795 if(
t ==
nullptr )
return newtrack;
2802 if( origPerigee ==
nullptr )
return newtrack;
2806 std::vector<const Trk::MeasurementBase*>
vec;
2807 int n_measurements = 0;
2808 int n_measurements_refit = 0;
2810 if (recoTrackStates) {
2813 for ( ; tsosIter != tsosIterEnd; ++tsosIter) {
2820 if ( !pixclus && sctclus ) to_add =
false;
2822 vec.push_back(measurement);
2823 n_measurements_refit++;
2828 ATH_MSG_VERBOSE(
"... Nr of measurments / refit = " << n_measurements <<
" / " << n_measurements_refit);
2833 if( newtrack!=0 && newtrack.get() ) {
2848 chi2 =
t->fitQuality()->chiSquared();
2849 ndof =
t->fitQuality()->doubleNumberDoF();
2850 d0 =
t->perigeeParameters()->parameters()[
Trk::d0];
2851 z0 =
t->perigeeParameters()->parameters()[
Trk::z0];