Skip to content

Commit

Permalink
Add stubs for iteration specific seed cleaning, filtering and duplica…
Browse files Browse the repository at this point in the history
…te cleaning.
  • Loading branch information
osschar committed Oct 6, 2022
1 parent a273b50 commit 393a9cc
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 9 deletions.
Expand Up @@ -233,7 +233,7 @@ std::unique_ptr<mkfit::IterationConfig> MkFitIterationConfigESProducer::produce(
auto it_conf = cj.load_File(configFile_);
it_conf->m_params.minPtCut = minPtCut_;
it_conf->m_backward_params.minPtCut = minPtCut_;
it_conf->m_partition_seeds = partitionSeeds1;
it_conf->m_seed_partitioner = partitionSeeds1;
it_conf->m_params.maxClusterSize = maxClusterSize_;
it_conf->m_backward_params.maxClusterSize = maxClusterSize_;
return it_conf;
Expand Down
7 changes: 7 additions & 0 deletions RecoTracker/MkFitCMS/standalone/Geoms/CMS-2029.cc
@@ -0,0 +1,7 @@
//-------------------
// CMS 2029 geometry
//-------------------

// Redirect to external geometry creator function.

#include "mkfit-geom-cms-2029/CMS-2029.cc"
8 changes: 6 additions & 2 deletions RecoTracker/MkFitCMS/standalone/Geoms/Makefile
Expand Up @@ -4,7 +4,7 @@ CPPFLAGS := -I${SRCDIR} -I../mkFit-external ${CPPFLAGS}

.PHONY: all clean distclean echo

SRCS := ${SACMS}/Geoms/CMS-2017.cc
SRCS := ${SACMS}/Geoms/CMS-2017.cc ${SACMS}/Geoms/CMS-2029.cc
SRCB := $(notdir ${SRCS})
DEPS := $(SRCB:.cc=.d)
OBJS := $(SRCB:.cc=.o)
Expand All @@ -13,10 +13,11 @@ TGTS := $(basename ${OBJS})
TGTS := $(addprefix ../, $(addsuffix .so, ${TGTS}))

GEO_2017_BIN = ../CMS-2017.bin
GEO_2029_BIN = ../CMS-2029.bin

vpath %.cc ${SACMS}/Geoms

all: ${TGTS} ${GEO_2017_BIN}
all: ${TGTS} ${GEO_2017_BIN} ${GEO_2029_BIN}

%.o: %.cc %.d
${CXX} ${CPPFLAGS} ${CXXFLAGS} ${VEC_HOST} -c -o $@ $<
Expand All @@ -30,6 +31,9 @@ all: ${TGTS} ${GEO_2017_BIN}
${GEO_2017_BIN}:
curl http://xrd-cache-1.t2.ucsd.edu/matevz/PKF/CMS-2017.bin -o $@

${GEO_2029_BIN}:
curl http://xrd-cache-1.t2.ucsd.edu/matevz/PKF/CMS-2029.bin -o $@

ifeq ($(filter clean distclean, ${MAKECMDGOALS}),)
include ${DEPS}
endif
Expand Down
24 changes: 21 additions & 3 deletions RecoTracker/MkFitCore/interface/IterationConfig.h
Expand Up @@ -140,11 +140,17 @@ namespace mkfit {

class IterationConfig {
public:
using clean_seeds_foo = void(const TrackerInfo &, const IterationConfig &, const TrackVec &, const EventOfHits &);

using partition_seeds_foo = void(const TrackerInfo &,
const TrackVec &,
const EventOfHits &,
IterationSeedPartition &);

using filter_candidates_foo = void(); // XXXX Determine args

using filter_duplicates_foo = void(); // XXXX Determine args

int m_iteration_index = -1;
int m_track_algorithm = -1;

Expand All @@ -166,7 +172,19 @@ namespace mkfit {
std::vector<SteeringParams> m_steering_params;
std::vector<IterationLayerConfig> m_layer_configs;

std::function<partition_seeds_foo> m_partition_seeds;
std::function<partition_seeds_foo> m_seed_partitioner;
std::function<clean_seeds_foo> m_seed_cleaner;
std::function<filter_candidates_foo> m_pre_bkfit_filter, m_post_bkfit_filter;
std::function<filter_duplicates_foo> m_duplicate_cleaner;

// Names for functions that get saved to / loaded from JSON.
// XXXX Need a place where those can be registered and looked up,
// like a mkfit::FunctorStore that can get filled up with static object initializers.
std::string m_seed_partitioner_name;
std::string m_seed_cleaner_name;
std::string m_pre_bkfit_filter_name, m_post_bkfit_filter_name;
std::string m_duplicate_cleaner_name;
// XXXX Add these strings to JSON schema.

//----------------------------------------------------------------------------

Expand All @@ -191,7 +209,7 @@ namespace mkfit {
m_steering_params = o.m_steering_params;
m_layer_configs = o.m_layer_configs;

m_partition_seeds = o.m_partition_seeds;
m_seed_partitioner = o.m_seed_partitioner;
}

void set_iteration_index_and_track_algorithm(int idx, int trk_alg) {
Expand Down Expand Up @@ -361,7 +379,7 @@ namespace mkfit {
// Load a single iteration from JSON file.
// This leaves IterationConfig data-members that are not registered
// in JSON schema at their default values.
// The only such member is std::function m_partition_seeds.
// There are several std::function members like this.
// Assumes JSON file has been saved WITHOUT iteration-info preamble.
// Returns a unique_ptr to the cloned IterationConfig.
std::unique_ptr<IterationConfig> load_File(const std::string &fname);
Expand Down
2 changes: 1 addition & 1 deletion RecoTracker/MkFitCore/src/IterationConfig.cc
Expand Up @@ -99,7 +99,7 @@ namespace mkfit {
/* vector<int> */ m_region_order,
/* vector<mkfit::SteeringParams> */ m_steering_params,
/* vector<mkfit::IterationLayerConfig> */ m_layer_configs
// /* function<void(const TrackerInfo&,const TrackVec&,const EventOfHits&,IterationSeedPartition&)> */ m_partition_seeds
// /* function<void(const TrackerInfo&,const TrackVec&,const EventOfHits&,IterationSeedPartition&)> */ m_seed_partitioner
)

ITCONF_DEFINE_TYPE_NON_INTRUSIVE(mkfit::IterationsInfo,
Expand Down
4 changes: 2 additions & 2 deletions RecoTracker/MkFitCore/src/MkBuilder.cc
Expand Up @@ -244,11 +244,11 @@ namespace mkfit {
part.m_phi_eta_foo = [&](float phi, float eta) { phi_eta_binnor.register_entry_safe(phi, eta); };

phi_eta_binnor.begin_registration(size);
m_job->m_iter_config.m_partition_seeds(m_job->m_trk_info, in_seeds, m_job->m_event_of_hits, part);
m_job->m_iter_config.m_seed_partitioner(m_job->m_trk_info, in_seeds, m_job->m_event_of_hits, part);
phi_eta_binnor.finalize_registration();
ranks.swap(phi_eta_binnor.m_ranks);
} else {
m_job->m_iter_config.m_partition_seeds(m_job->m_trk_info, in_seeds, m_job->m_event_of_hits, part);
m_job->m_iter_config.m_seed_partitioner(m_job->m_trk_info, in_seeds, m_job->m_event_of_hits, part);
}

for (int i = 0; i < size; ++i) {
Expand Down

0 comments on commit 393a9cc

Please sign in to comment.