From 755d1d41bce9abd859a01334a4a7490f7b205981 Mon Sep 17 00:00:00 2001 From: Gregory J Ottino Date: Thu, 7 May 2026 18:07:40 -0400 Subject: [PATCH 1/2] update to fit Si or TPC only tracks with track pruner --- offline/packages/trackbase/ActsSurfaceMaps.cc | 5 + offline/packages/trackbase/ActsSurfaceMaps.h | 7 + .../packages/trackreco/MakeActsGeometry.cc | 6 + offline/packages/trackreco/PHActsTrkFitter.cc | 37 +++- offline/packages/trackreco/PHActsTrkFitter.h | 6 + .../trackreco/PHSimpleVertexFinder.cc | 204 ++++++++++-------- .../packages/trackreco/PHSimpleVertexFinder.h | 11 +- 7 files changed, 172 insertions(+), 104 deletions(-) diff --git a/offline/packages/trackbase/ActsSurfaceMaps.cc b/offline/packages/trackbase/ActsSurfaceMaps.cc index d92e387ca0..69cd94ece6 100644 --- a/offline/packages/trackbase/ActsSurfaceMaps.cc +++ b/offline/packages/trackbase/ActsSurfaceMaps.cc @@ -34,6 +34,11 @@ bool ActsSurfaceMaps::isTpcSurface(const Acts::Surface* surface) const return m_tpcVolumeIds.find(surface->geometryId().volume()) != m_tpcVolumeIds.end(); } +bool ActsSurfaceMaps::isSiSurface(const Acts::Surface* surface) const +{ + return m_siVolumeIds.find(surface->geometryId().volume()) != m_siVolumeIds.end(); +} + bool ActsSurfaceMaps::isMicromegasSurface(const Acts::Surface* surface) const { return m_micromegasVolumeIds.find(surface->geometryId().volume()) != m_micromegasVolumeIds.end(); diff --git a/offline/packages/trackbase/ActsSurfaceMaps.h b/offline/packages/trackbase/ActsSurfaceMaps.h index 94c327be79..e90263c49a 100644 --- a/offline/packages/trackbase/ActsSurfaceMaps.h +++ b/offline/packages/trackbase/ActsSurfaceMaps.h @@ -37,6 +37,9 @@ struct ActsSurfaceMaps //! true if given surface corresponds to TPC bool isTpcSurface(const Acts::Surface* surface) const; + //! true if given surface corresponds to the silicon + bool isSiSurface(const Acts::Surface* surface) const; + //! true if given surface corresponds to Micromegas bool isMicromegasSurface(const Acts::Surface* surface) const; @@ -65,6 +68,10 @@ struct ActsSurfaceMaps /** it is used to quickly tell if a given Acts Surface belongs to the TPC */ std::set m_tpcVolumeIds; + //! stores all acts volume ids relevant to the Silicon + /** it is used to quickly tell if a given Acts Surface belongs to the Silicon */ + std::set m_siVolumeIds; + //! stores all acts volume ids relevant to the micromegas /** it is used to quickly tell if a given Acts Surface belongs to micromegas */ std::set m_micromegasVolumeIds; diff --git a/offline/packages/trackreco/MakeActsGeometry.cc b/offline/packages/trackreco/MakeActsGeometry.cc index 07f3dbe71c..366510574c 100644 --- a/offline/packages/trackreco/MakeActsGeometry.cc +++ b/offline/packages/trackreco/MakeActsGeometry.cc @@ -283,6 +283,12 @@ int MakeActsGeometry::InitRun(PHCompositeNode *topNode) } } + // fill Si volume ids + for (const auto &[hitsetid, surface] : m_clusterSurfaceMapSilicon) + { + surfMaps.m_siVolumeIds.insert(surface->geometryId().volume()); + } + // fill Micromegas volume ids for (const auto &[hitsetid, surface] : m_clusterSurfaceMapMmEdit) { diff --git a/offline/packages/trackreco/PHActsTrkFitter.cc b/offline/packages/trackreco/PHActsTrkFitter.cc index d0006ac25c..72647a2295 100644 --- a/offline/packages/trackreco/PHActsTrkFitter.cc +++ b/offline/packages/trackreco/PHActsTrkFitter.cc @@ -526,11 +526,11 @@ void PHActsTrkFitter::loopTracks(Acts::Logging::Level logLevel) // position comes from the silicon seed, unless there is no silicon seed Acts::Vector3 position(0, 0, 0); - if (siseed) + if (siseed && !m_ignoreSilicon) { position = TrackSeedHelper::get_xyz(siseed) * Acts::UnitConstants::cm; } - if (!siseed || !is_valid(position) || m_ignoreSilicon) + if (!siseed || !is_valid(position) || m_forceTpcOnlyFit) { position = TrackSeedHelper::get_xyz(tpcseed) * Acts::UnitConstants::cm; } @@ -574,6 +574,13 @@ void PHActsTrkFitter::loopTracks(Acts::Logging::Level logLevel) continue; } } + //else if (m_forceTpcOnlyFit) + //{ + // if (surface_apr->geometryId().volume() < 14) + // { + // continue; + // } + //} bool pop_flag = false; if (surface_apr->geometryId().approach() == 1) { @@ -643,7 +650,7 @@ void PHActsTrkFitter::loopTracks(Acts::Logging::Level logLevel) float seedphi = 0; float seedtheta = 0; float seedeta = 0; - if (siseed) + if (siseed && !m_forceTpcOnlyFit) { seedphi = siseed->get_phi(); seedtheta = siseed->get_theta(); @@ -984,6 +991,9 @@ SourceLinkVec PHActsTrkFitter::filterSourceLinks(const SourceLinkVec& sourceLink if (m_forceSiOnlyFit && (m_tGeometry->maps().isMicromegasSurface(surf) || m_tGeometry->maps().isTpcSurface(surf)) ) { continue; } + if (m_forceTpcOnlyFit && (m_tGeometry->maps().isMicromegasSurface(surf) || m_tGeometry->maps().isSiSurface(surf)) ) + { continue; } + // update vectors filtered.push_back(sl); } @@ -1070,7 +1080,7 @@ void PHActsTrkFitter::updateSvtxTrack( track->identify(); } - if (!m_fitSiliconMMs && !m_forceSiOnlyFit) + if (!m_fitSiliconMMs && !m_forceSiOnlyFit && !m_forceTpcOnlyFit) { track->clear_states(); } @@ -1097,9 +1107,20 @@ void PHActsTrkFitter::updateSvtxTrack( track->set_y(params.position(m_transient_geocontext)(1) / Acts::UnitConstants::cm); track->set_z(params.position(m_transient_geocontext)(2) / Acts::UnitConstants::cm); - track->set_px(params.momentum()(0)); - track->set_py(params.momentum()(1)); - track->set_pz(params.momentum()(2)); + auto* seed = track->get_tpc_seed(); + + if(!m_forceSiOnlyFit) + { + track->set_px(params.momentum()(0)); + track->set_py(params.momentum()(1)); + track->set_pz(params.momentum()(2)); + } + else + { + track->set_px(seed->get_px()); + track->set_py(seed->get_py()); + track->set_pz(seed->get_pz()); + } track->set_charge(params.charge()); track->set_chisq(trajState.chi2Sum); @@ -1134,7 +1155,7 @@ void PHActsTrkFitter::updateSvtxTrack( // in using silicon mm fit also extrapolate track parameters to all TPC surfaces with clusters // get all tpc clusters - auto* seed = track->get_tpc_seed(); + if (m_fitSiliconMMs && seed) { // acts propagator diff --git a/offline/packages/trackreco/PHActsTrkFitter.h b/offline/packages/trackreco/PHActsTrkFitter.h index 056c3e88b3..8d0cf352a8 100644 --- a/offline/packages/trackreco/PHActsTrkFitter.h +++ b/offline/packages/trackreco/PHActsTrkFitter.h @@ -84,6 +84,11 @@ class PHActsTrkFitter : public SubsysReco m_forceSiOnlyFit = forceSiOnlyFit; } + void forceTpcOnlyFit(bool forceTpcOnlyFit) + { + m_forceTpcOnlyFit = forceTpcOnlyFit; + } + /// require micromegas in SiliconMM fits void setUseMicromegas(bool value) { @@ -217,6 +222,7 @@ class PHActsTrkFitter : public SubsysReco bool m_fitSiliconMMs = false; bool m_forceSiOnlyFit = false; + bool m_forceTpcOnlyFit = false; /// requires micromegas present when fitting silicon-MM surfaces bool m_useMicromegas = true; diff --git a/offline/packages/trackreco/PHSimpleVertexFinder.cc b/offline/packages/trackreco/PHSimpleVertexFinder.cc index 954e790ba6..5f9340d8f6 100644 --- a/offline/packages/trackreco/PHSimpleVertexFinder.cc +++ b/offline/packages/trackreco/PHSimpleVertexFinder.cc @@ -515,13 +515,34 @@ void PHSimpleVertexFinder::checkDCAs(SvtxTrackMap *track_map) { continue; } - if (_require_mvtx && !passClusterRequirement(tr1, "MVTX")) + if (_require_mvtx) { - continue; - } - if (_require_intt && !passClusterRequirement(tr1, "INTT")) - { - continue; + unsigned int nmvtx = 0; + TrackSeed *siliconseed = tr1->get_silicon_seed(); + if (!siliconseed) + { + continue; + } + + for (auto clusit = siliconseed->begin_cluster_keys(); clusit != siliconseed->end_cluster_keys(); ++clusit) + { + if (TrkrDefs::getTrkrId(*clusit) == TrkrDefs::mvtxId) + { + nmvtx++; + } + if (nmvtx >= _nmvtx_required) + { + break; + } + } + if (nmvtx < _nmvtx_required) + { + continue; + } + if (Verbosity() > 3) + { + std::cout << " tr1 id " << id1 << " has nmvtx at least " << nmvtx << std::endl; + } } // look for close DCA matches with all other such tracks @@ -533,13 +554,34 @@ void PHSimpleVertexFinder::checkDCAs(SvtxTrackMap *track_map) { continue; } - if (_require_mvtx && !passClusterRequirement(tr2, "MVTX")) + if (_require_mvtx) { - continue; - } - if (_require_intt && !passClusterRequirement(tr2, "INTT")) - { - continue; + unsigned int nmvtx = 0; + TrackSeed *siliconseed = tr2->get_silicon_seed(); + if (!siliconseed) + { + continue; + } + + for (auto clusit = siliconseed->begin_cluster_keys(); clusit != siliconseed->end_cluster_keys(); ++clusit) + { + if (TrkrDefs::getTrkrId(*clusit) == TrkrDefs::mvtxId) + { + nmvtx++; + } + if (nmvtx >= _nmvtx_required) + { + break; + } + } + if (nmvtx < _nmvtx_required) + { + continue; + } + if (Verbosity() > 3) + { + std::cout << " tr2 id " << id2 << " has nmvtx at least " << nmvtx << std::endl; + } } // find DCA of these two tracks @@ -574,20 +616,13 @@ void PHSimpleVertexFinder::checkDCAsZF(SvtxTrackMap *track_map) // tr1->identify(); TrackSeed *siliconseed = tr1->get_silicon_seed(); - const bool needs_mvtx_seed = _require_mvtx && _nmvtx_required > 0; - const bool needs_intt_seed = _require_intt && _nintt_required > 0; - if ((needs_mvtx_seed || needs_intt_seed) && !siliconseed) - { - continue; - } - if (_require_mvtx && !passClusterRequirement(tr1, "MVTX")) - { - continue; - } - if (_require_intt && !passClusterRequirement(tr1, "INTT")) - { - continue; - } + if (_require_mvtx) + { + if (!siliconseed) + { + continue; + } + } TrackSeed *tpcseed = tr1->get_tpc_seed(); std::vector global_vec; @@ -762,13 +797,34 @@ void PHSimpleVertexFinder::checkDCAs() { continue; } - if (_require_mvtx && !passClusterRequirement(tr1, "MVTX")) + if (_require_mvtx) { - continue; - } - if (_require_intt && !passClusterRequirement(tr1, "INTT")) - { - continue; + unsigned int nmvtx = 0; + TrackSeed *siliconseed = tr1->get_silicon_seed(); + if (!siliconseed) + { + continue; + } + + for (auto clusit = siliconseed->begin_cluster_keys(); clusit != siliconseed->end_cluster_keys(); ++clusit) + { + if (TrkrDefs::getTrkrId(*clusit) == TrkrDefs::mvtxId) + { + nmvtx++; + } + if (nmvtx >= _nmvtx_required) + { + break; + } + } + if (nmvtx < _nmvtx_required) + { + continue; + } + if (Verbosity() > 3) + { + std::cout << " tr1 id " << id1 << " has nmvtx at least " << nmvtx << std::endl; + } } // look for close DCA matches with all other such tracks @@ -780,14 +836,36 @@ void PHSimpleVertexFinder::checkDCAs() { continue; } - if (_require_mvtx && !passClusterRequirement(tr2, "MVTX")) - { - continue; - } - if (_require_intt && !passClusterRequirement(tr2, "INTT")) + if (_require_mvtx) { - continue; + unsigned int nmvtx = 0; + TrackSeed *siliconseed = tr2->get_silicon_seed(); + if (!siliconseed) + { + continue; + } + + for (auto clusit = siliconseed->begin_cluster_keys(); clusit != siliconseed->end_cluster_keys(); ++clusit) + { + if (TrkrDefs::getTrkrId(*clusit) == TrkrDefs::mvtxId) + { + nmvtx++; + } + if (nmvtx >= _nmvtx_required) + { + break; + } + } + if (nmvtx < _nmvtx_required) + { + continue; + } + if (Verbosity() > 3) + { + std::cout << " tr2 id " << id2 << " has nmvtx at least " << nmvtx << std::endl; + } } + // find DCA of these two tracks if (Verbosity() > 3) { @@ -1246,53 +1324,3 @@ double PHSimpleVertexFinder::getAverage(std::vector &v) return avge; } - -bool PHSimpleVertexFinder::passClusterRequirement(SvtxTrack *track, const std::string &type) -{ - bool pass = false; - - std::vector acceptable_types = {"MVTX", "INTT"}; - bool accept_this_type = std::find(acceptable_types.begin(), acceptable_types.end(), type) != acceptable_types.end(); - - if (!accept_this_type) - { - if (Verbosity() > 3) - { - std::cout << "type " << type << " was not recognised" << std::endl; - } - return false; - } - - unsigned int _nclus_required = type == "MVTX" ? _nmvtx_required : _nintt_required; - if (_nclus_required == 0) - { - return true; - } - - TrackSeed *siliconseed = track->get_silicon_seed(); - if (!siliconseed) - { - return false; - } - - unsigned int nclus = 0; - for (auto clusit = siliconseed->begin_cluster_keys(); clusit != siliconseed->end_cluster_keys(); ++clusit) - { - uint8_t trkrId = type == "MVTX" ? TrkrDefs::mvtxId : TrkrDefs::inttId; - if (TrkrDefs::getTrkrId(*clusit) == trkrId) - { - nclus++; - } - if (nclus >= _nclus_required) - { - pass = true; - } - } - - if (Verbosity() > 3) - { - std::cout << " track id " << track->get_id() << " has " << nclus << " clusters for " << type << std::endl; - } - - return pass; -} diff --git a/offline/packages/trackreco/PHSimpleVertexFinder.h b/offline/packages/trackreco/PHSimpleVertexFinder.h index 6520174937..de5cff940b 100644 --- a/offline/packages/trackreco/PHSimpleVertexFinder.h +++ b/offline/packages/trackreco/PHSimpleVertexFinder.h @@ -46,18 +46,16 @@ class PHSimpleVertexFinder : public SubsysReco void setBeamSpotCutY(const double cutlo, const double cuthi) { _beamline_y_cut_lo = cutlo; _beamline_y_cut_hi = cuthi; } void setDcaCut(const double cut) { _base_dcacut = cut; } void setTrackQualityCut(double cut) { _qual_cut = cut; } - void setRequireMVTX(bool set = true) { _require_mvtx = set; } + void setRequireMVTX(bool set) { _require_mvtx = set; } void setNmvtxRequired(unsigned int n) { _nmvtx_required = n; } - void setRequireINTT(bool set = true) { _require_intt = set; } - void setNinttRequired(unsigned int n) { _nintt_required = n; } void setTrackPtCut(const double cut) { _track_pt_cut = cut; } // void setUseTrackCovariance(bool set) {_use_track_covariance = set;} void setOutlierPairCut(const double cut) { _outlier_cut = cut; } void setTrackMapName(const std::string &name) { _track_map_name = name; } void setVertexMapName(const std::string &name) { _vertex_map_name = name; } - void zeroField(const bool flag = true) { _zero_field = flag; } + void zeroField(const bool flag) { _zero_field = flag; } void setTrkrClusterContainerName(const std::string &name){ m_clusterContainerName = name; } - void set_pp_mode(bool mode = true) { _pp_mode = mode; } + void set_pp_mode(bool mode) { _pp_mode = mode; } private: int GetNodes(PHCompositeNode *topNode); @@ -77,7 +75,6 @@ class PHSimpleVertexFinder : public SubsysReco void removeOutlierTrackPairs(); double getMedian(std::vector &v); double getAverage(std::vector &v); - bool passClusterRequirement(SvtxTrack *track, const std::string &type = "MVTX"); SvtxTrackMap *_track_map{nullptr}; TrkrClusterContainer* _cluster_map{nullptr}; @@ -94,9 +91,7 @@ class PHSimpleVertexFinder : public SubsysReco double _beamline_y_cut_hi = 0.2; double _qual_cut = 10.0; bool _require_mvtx = true; - bool _require_intt = false; unsigned int _nmvtx_required = 2; - unsigned int _nintt_required = 1; double _track_pt_cut = 0.0; double _outlier_cut = 0.015; From 6e22dc7803ed03d4b03c2dbc355030b7f1748d25 Mon Sep 17 00:00:00 2001 From: Gregory J Ottino Date: Thu, 7 May 2026 18:13:24 -0400 Subject: [PATCH 2/2] restoring vertex finder to current master --- .../trackreco/PHSimpleVertexFinder.cc | 204 ++++++++---------- .../packages/trackreco/PHSimpleVertexFinder.h | 11 +- 2 files changed, 96 insertions(+), 119 deletions(-) diff --git a/offline/packages/trackreco/PHSimpleVertexFinder.cc b/offline/packages/trackreco/PHSimpleVertexFinder.cc index 5f9340d8f6..954e790ba6 100644 --- a/offline/packages/trackreco/PHSimpleVertexFinder.cc +++ b/offline/packages/trackreco/PHSimpleVertexFinder.cc @@ -515,34 +515,13 @@ void PHSimpleVertexFinder::checkDCAs(SvtxTrackMap *track_map) { continue; } - if (_require_mvtx) + if (_require_mvtx && !passClusterRequirement(tr1, "MVTX")) { - unsigned int nmvtx = 0; - TrackSeed *siliconseed = tr1->get_silicon_seed(); - if (!siliconseed) - { - continue; - } - - for (auto clusit = siliconseed->begin_cluster_keys(); clusit != siliconseed->end_cluster_keys(); ++clusit) - { - if (TrkrDefs::getTrkrId(*clusit) == TrkrDefs::mvtxId) - { - nmvtx++; - } - if (nmvtx >= _nmvtx_required) - { - break; - } - } - if (nmvtx < _nmvtx_required) - { - continue; - } - if (Verbosity() > 3) - { - std::cout << " tr1 id " << id1 << " has nmvtx at least " << nmvtx << std::endl; - } + continue; + } + if (_require_intt && !passClusterRequirement(tr1, "INTT")) + { + continue; } // look for close DCA matches with all other such tracks @@ -554,34 +533,13 @@ void PHSimpleVertexFinder::checkDCAs(SvtxTrackMap *track_map) { continue; } - if (_require_mvtx) + if (_require_mvtx && !passClusterRequirement(tr2, "MVTX")) { - unsigned int nmvtx = 0; - TrackSeed *siliconseed = tr2->get_silicon_seed(); - if (!siliconseed) - { - continue; - } - - for (auto clusit = siliconseed->begin_cluster_keys(); clusit != siliconseed->end_cluster_keys(); ++clusit) - { - if (TrkrDefs::getTrkrId(*clusit) == TrkrDefs::mvtxId) - { - nmvtx++; - } - if (nmvtx >= _nmvtx_required) - { - break; - } - } - if (nmvtx < _nmvtx_required) - { - continue; - } - if (Verbosity() > 3) - { - std::cout << " tr2 id " << id2 << " has nmvtx at least " << nmvtx << std::endl; - } + continue; + } + if (_require_intt && !passClusterRequirement(tr2, "INTT")) + { + continue; } // find DCA of these two tracks @@ -616,13 +574,20 @@ void PHSimpleVertexFinder::checkDCAsZF(SvtxTrackMap *track_map) // tr1->identify(); TrackSeed *siliconseed = tr1->get_silicon_seed(); - if (_require_mvtx) - { - if (!siliconseed) - { - continue; - } - } + const bool needs_mvtx_seed = _require_mvtx && _nmvtx_required > 0; + const bool needs_intt_seed = _require_intt && _nintt_required > 0; + if ((needs_mvtx_seed || needs_intt_seed) && !siliconseed) + { + continue; + } + if (_require_mvtx && !passClusterRequirement(tr1, "MVTX")) + { + continue; + } + if (_require_intt && !passClusterRequirement(tr1, "INTT")) + { + continue; + } TrackSeed *tpcseed = tr1->get_tpc_seed(); std::vector global_vec; @@ -797,34 +762,13 @@ void PHSimpleVertexFinder::checkDCAs() { continue; } - if (_require_mvtx) + if (_require_mvtx && !passClusterRequirement(tr1, "MVTX")) { - unsigned int nmvtx = 0; - TrackSeed *siliconseed = tr1->get_silicon_seed(); - if (!siliconseed) - { - continue; - } - - for (auto clusit = siliconseed->begin_cluster_keys(); clusit != siliconseed->end_cluster_keys(); ++clusit) - { - if (TrkrDefs::getTrkrId(*clusit) == TrkrDefs::mvtxId) - { - nmvtx++; - } - if (nmvtx >= _nmvtx_required) - { - break; - } - } - if (nmvtx < _nmvtx_required) - { - continue; - } - if (Verbosity() > 3) - { - std::cout << " tr1 id " << id1 << " has nmvtx at least " << nmvtx << std::endl; - } + continue; + } + if (_require_intt && !passClusterRequirement(tr1, "INTT")) + { + continue; } // look for close DCA matches with all other such tracks @@ -836,36 +780,14 @@ void PHSimpleVertexFinder::checkDCAs() { continue; } - if (_require_mvtx) + if (_require_mvtx && !passClusterRequirement(tr2, "MVTX")) { - unsigned int nmvtx = 0; - TrackSeed *siliconseed = tr2->get_silicon_seed(); - if (!siliconseed) - { - continue; - } - - for (auto clusit = siliconseed->begin_cluster_keys(); clusit != siliconseed->end_cluster_keys(); ++clusit) - { - if (TrkrDefs::getTrkrId(*clusit) == TrkrDefs::mvtxId) - { - nmvtx++; - } - if (nmvtx >= _nmvtx_required) - { - break; - } - } - if (nmvtx < _nmvtx_required) - { - continue; - } - if (Verbosity() > 3) - { - std::cout << " tr2 id " << id2 << " has nmvtx at least " << nmvtx << std::endl; - } + continue; + } + if (_require_intt && !passClusterRequirement(tr2, "INTT")) + { + continue; } - // find DCA of these two tracks if (Verbosity() > 3) { @@ -1324,3 +1246,53 @@ double PHSimpleVertexFinder::getAverage(std::vector &v) return avge; } + +bool PHSimpleVertexFinder::passClusterRequirement(SvtxTrack *track, const std::string &type) +{ + bool pass = false; + + std::vector acceptable_types = {"MVTX", "INTT"}; + bool accept_this_type = std::find(acceptable_types.begin(), acceptable_types.end(), type) != acceptable_types.end(); + + if (!accept_this_type) + { + if (Verbosity() > 3) + { + std::cout << "type " << type << " was not recognised" << std::endl; + } + return false; + } + + unsigned int _nclus_required = type == "MVTX" ? _nmvtx_required : _nintt_required; + if (_nclus_required == 0) + { + return true; + } + + TrackSeed *siliconseed = track->get_silicon_seed(); + if (!siliconseed) + { + return false; + } + + unsigned int nclus = 0; + for (auto clusit = siliconseed->begin_cluster_keys(); clusit != siliconseed->end_cluster_keys(); ++clusit) + { + uint8_t trkrId = type == "MVTX" ? TrkrDefs::mvtxId : TrkrDefs::inttId; + if (TrkrDefs::getTrkrId(*clusit) == trkrId) + { + nclus++; + } + if (nclus >= _nclus_required) + { + pass = true; + } + } + + if (Verbosity() > 3) + { + std::cout << " track id " << track->get_id() << " has " << nclus << " clusters for " << type << std::endl; + } + + return pass; +} diff --git a/offline/packages/trackreco/PHSimpleVertexFinder.h b/offline/packages/trackreco/PHSimpleVertexFinder.h index de5cff940b..6520174937 100644 --- a/offline/packages/trackreco/PHSimpleVertexFinder.h +++ b/offline/packages/trackreco/PHSimpleVertexFinder.h @@ -46,16 +46,18 @@ class PHSimpleVertexFinder : public SubsysReco void setBeamSpotCutY(const double cutlo, const double cuthi) { _beamline_y_cut_lo = cutlo; _beamline_y_cut_hi = cuthi; } void setDcaCut(const double cut) { _base_dcacut = cut; } void setTrackQualityCut(double cut) { _qual_cut = cut; } - void setRequireMVTX(bool set) { _require_mvtx = set; } + void setRequireMVTX(bool set = true) { _require_mvtx = set; } void setNmvtxRequired(unsigned int n) { _nmvtx_required = n; } + void setRequireINTT(bool set = true) { _require_intt = set; } + void setNinttRequired(unsigned int n) { _nintt_required = n; } void setTrackPtCut(const double cut) { _track_pt_cut = cut; } // void setUseTrackCovariance(bool set) {_use_track_covariance = set;} void setOutlierPairCut(const double cut) { _outlier_cut = cut; } void setTrackMapName(const std::string &name) { _track_map_name = name; } void setVertexMapName(const std::string &name) { _vertex_map_name = name; } - void zeroField(const bool flag) { _zero_field = flag; } + void zeroField(const bool flag = true) { _zero_field = flag; } void setTrkrClusterContainerName(const std::string &name){ m_clusterContainerName = name; } - void set_pp_mode(bool mode) { _pp_mode = mode; } + void set_pp_mode(bool mode = true) { _pp_mode = mode; } private: int GetNodes(PHCompositeNode *topNode); @@ -75,6 +77,7 @@ class PHSimpleVertexFinder : public SubsysReco void removeOutlierTrackPairs(); double getMedian(std::vector &v); double getAverage(std::vector &v); + bool passClusterRequirement(SvtxTrack *track, const std::string &type = "MVTX"); SvtxTrackMap *_track_map{nullptr}; TrkrClusterContainer* _cluster_map{nullptr}; @@ -91,7 +94,9 @@ class PHSimpleVertexFinder : public SubsysReco double _beamline_y_cut_hi = 0.2; double _qual_cut = 10.0; bool _require_mvtx = true; + bool _require_intt = false; unsigned int _nmvtx_required = 2; + unsigned int _nintt_required = 1; double _track_pt_cut = 0.0; double _outlier_cut = 0.015;