Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standalone mostly reincarnated. #73

Merged
merged 3 commits into from
Jan 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion RecoTracker/MkFit/plugins/MkFitProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// mkFit includes
#include "RecoTracker/MkFitCore/interface/ConfigWrapper.h"
#include "RecoTracker/MkFitCMS/interface/LayerNumberConverter.h"
#include "RecoTracker/MkFitCMS/interface/buildtestMPlex.h"
#include "RecoTracker/MkFitCMS/interface/runFunctions.h"
#include "RecoTracker/MkFitCore/interface/IterationConfig.h"
#include "RecoTracker/MkFitCore/interface/MkBuilderWrapper.h"

Expand Down
3 changes: 0 additions & 3 deletions RecoTracker/MkFitCMS/interface/MkStdSeqs.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@

namespace mkfit {

// CCCC class Event;
class EventOfHits;
class IterationConfig;
class TrackerInfo;

namespace StdSeq {
// CCCC void LoadHitsAndBeamSpot(Event &ev, EventOfHits &eoh);

void LoadDeads(EventOfHits &eoh, const std::vector<DeadVec> &deadvectors);

Expand All @@ -30,7 +28,6 @@ namespace mkfit {

void find_duplicates(TrackVec &tracks);
void remove_duplicates(TrackVec &tracks);
// CCCC void handle_duplicates(Event *m_event);

void find_duplicates_sharedhits(TrackVec &tracks, const float fraction);
void find_duplicates_sharedhits_pixelseed(TrackVec &tracks,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef RecoTracker_MkFitCMS_interface_buildtestMPlex_h
#define RecoTracker_MkFitCMS_interface_buildtestMPlex_h
#ifndef RecoTracker_MkFitCMS_interface_runFunctions_h
#define RecoTracker_MkFitCMS_interface_runFunctions_h

#include "RecoTracker/MkFitCore/interface/Track.h"

Expand Down
78 changes: 0 additions & 78 deletions RecoTracker/MkFitCMS/src/MkStdSeqs.cc
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#include "RecoTracker/MkFitCMS/interface/MkStdSeqs.h"

// CCCC #include "Event.h"

#include "RecoTracker/MkFitCore/interface/HitStructures.h"
#include "RecoTracker/MkFitCore/interface/IterationConfig.h"

Expand All @@ -17,24 +15,6 @@ namespace mkfit {
// Hit processing
//=========================================================================

/* CCCC
void LoadHitsAndBeamSpot(Event &ev, EventOfHits &eoh)
{
eoh.Reset();

// fill vector of hits in each layer
// XXXXMT: Does it really makes sense to multi-thread this?
tbb::parallel_for(tbb::blocked_range<int>(0, ev.layerHits_.size()),
[&](const tbb::blocked_range<int> &layers) {
for (int ilay = layers.begin(); ilay < layers.end(); ++ilay)
{
eoh.SuckInHits(ilay, ev.layerHits_[ilay]);
}
});
eoh.SetBeamSpot(ev.beamSpot_);
}
*/

void LoadDeads(EventOfHits &eoh, const std::vector<DeadVec> &deadvectors) {
for (size_t il = 0; il < deadvectors.size(); il++) {
eoh.SuckInDeads(int(il), deadvectors[il]);
Expand Down Expand Up @@ -418,27 +398,6 @@ void LoadHitsAndBeamSpot(Event &ev, EventOfHits &eoh)
tracks.end());
}

/* CCCC
void handle_duplicates(Event *m_event)
{
// Mark tracks as duplicates; if within CMSSW, remove duplicate tracks from fit or candidate track collection
if (Config::removeDuplicates)
{
if (Config::quality_val || Config::sim_val || Config::cmssw_val)
{
find_duplicates(m_event->candidateTracks_);
if (Config::backwardFit) find_duplicates(m_event->fitTracks_);
}
// For the MEIF benchmarks and the stress tests, no validation flags are set so we will enter this block
else
{
// Only care about the candidate tracks here; no need to run the duplicate removal on both candidate and fit tracks
find_duplicates(m_event->candidateTracks_);
}
}
}
*/

//=========================================================================
// SHARED HITS DUPLICATE CLEANING
//=========================================================================
Expand Down Expand Up @@ -623,42 +582,5 @@ void handle_duplicates(Event *m_event)
#endif
}

//=========================================================================
// Random stuff
//=========================================================================

/* CCCC

void dump_simtracks(Event *m_event)
{
// Ripped out of MkBuilder::begin_event, ifdefed under DEBUG

std::vector<Track>& simtracks = m_event->simTracks_;

for (int itrack = 0; itrack < (int) simtracks.size(); ++itrack)
{
// bool debug = true;
Track track = simtracks[itrack];
// if (track.label() != itrack) {
// dprintf("Bad label for simtrack %d -- %d\n", itrack, track.label());
// }

dprint("MX - simtrack with nHits=" << track.nFoundHits() << " chi2=" << track.chi2()
<< " pT=" << track.pT() <<" phi="<< track.momPhi() <<" eta=" << track.momEta());
}

for (int itrack = 0; itrack < (int) simtracks.size(); ++itrack)
{
for (int ihit = 0; ihit < simtracks[itrack].nFoundHits(); ++ihit)
{
dprint("track #" << itrack << " hit #" << ihit
<< " hit pos=" << simtracks[itrack].hitsVector(m_event->layerHits_)[ihit].position()
<< " phi=" << simtracks[itrack].hitsVector(m_event->layerHits_)[ihit].phi());
}
}
}

*/

} // namespace StdSeq
} // namespace mkfit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "RecoTracker/MkFitCMS/interface/buildtestMPlex.h"
#include "RecoTracker/MkFitCMS/interface/runFunctions.h"
#include "RecoTracker/MkFitCore/interface/MkBuilder.h"
#include "RecoTracker/MkFitCMS/interface/MkStdSeqs.h"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef RecoTracker_MkFitCMS_standalone_CMS - 2017 - HitSelectionWindows_h
#define RecoTracker_MkFitCMS_standalone_CMS -2017 - HitSelectionWindows_h
#ifndef RecoTracker_MkFitCMS_standalone_CMS_2017_HitSelectionWindows_h
#define RecoTracker_MkFitCMS_standalone_CMS_2017_HitSelectionWindows_h

namespace mkfit {

Expand Down
47 changes: 47 additions & 0 deletions RecoTracker/MkFitCMS/standalone/Geoms/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
include ${SADIR}/Makefile.config

CPPEXTRA := ${USER_CPPFLAGS} ${DEFS} -I${SRCDIR} -I../mkFit-external
LDEXTRA := ${USER_LDFLAGS}

CPPFLAGS := ${CPPEXTRA} ${CPPFLAGS}
CXXFLAGS += -fPIC ${USER_CXXFLAGS}
LDFLAGS += ${LDEXTRA}

CPPFLAGS_NO_ROOT := ${CPPEXTRA} ${CPPFLAGS_NO_ROOT}

.PHONY: all clean distclean echo

SRCS := ${SACMS}/Geoms/CMS-2017.cc
SRCB := $(notdir ${SRCS})
DEPS := $(SRCB:.cc=.d)
OBJS := $(SRCB:.cc=.o)

TGTS := $(basename ${OBJS})
TGTS := $(addprefix ../, $(addsuffix .so, ${TGTS}))

vpath %.cc ${SACMS}/Geoms

all: ${TGTS}

%.o: %.cc %.d
${CXX} ${CPPFLAGS} ${CXXFLAGS} ${VEC_HOST} -c -o $@ $<

%.d: %.cc
${MAKEDEPEND} -o $@ $<

../%.so: %.o
${CXX} -shared -L.. -lMicCore -o $@ $<

ifeq ($(filter clean distclean, ${MAKECMDGOALS}),)
include ${DEPS}
endif

clean:
rm -f *.so *.o *.om *.d *.optrpt

distclean: clean

echo:
@echo SRCS = ${SRCS}
@echo DEPS = ${DEPS}
@echo OBJS = ${OBJS}
69 changes: 69 additions & 0 deletions RecoTracker/MkFitCMS/standalone/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
include ${SADIR}/Makefile.config

CPPFLAGS := -I. -I${SRCDIR} -I../mkFit-external ${CPPFLAGS}

CMS_DIR := ${SRCDIR}/RecoTracker/MkFitCMS

LIB_CMS := ../libMicCMS.so
MAIN := ../mkFit

TGTS := ${LIB_CORE} ${MAIN}

.PHONY: all clean distclean

all: ${TGTS}

SRCS := $(wildcard ${CMS_DIR}/src/*.cc) $(wildcard ${SACMS}/*.cc)
SRCB := $(notdir ${SRCS})
DEPS := $(SRCB:.cc=.d)
OBJS := $(SRCB:.cc=.o)

CMS_OBJS := $(filter-out mkFit.o, ${OBJS})

vpath %.cc ${CMS_DIR}/src ${SACMS}

ifeq ($(filter clean-local clean distclean, ${MAKECMDGOALS}),)
include ${DEPS}
endif

clean-local:
-rm -f ${TGTS} *.d *.o *.om *.so
-rm -rf main.dSYM
-rm -rf plotting/*.so plotting/*.d plotting/*.pcm

clean: clean-local

distclean: clean-local
-rm -f *.optrpt
-rm -rf lib

${LIB_CMS}: ${CMS_OBJS}
@mkdir -p $(@D)
${CXX} ${CXXFLAGS} ${VEC_HOST} ${CMS_OBJS} -shared -o $@ ${LDFLAGS_HOST} ${LDFLAGS}

${MAIN}: ${LIB_CMS} mkFit.o
${CXX} ${CXXFLAGS} ${VEC_HOST} ${LDFLAGS} mkFit.o -o $@ ${LDFLAGS_HOST} -ltbb -L.. -lMicCore -lMicCMS -Wl,-rpath,..,-rpath,.

${OBJS}: %.o: %.cc %.d
${CXX} ${CPPFLAGS} ${CXXFLAGS} ${VEC_HOST} -c -o $@ $<

%.d: %.cc
${MAKEDEPEND} -o $@ $<

echo:
@echo "CXX=${CXX}"
@echo SRCS = ${SRCS}
@echo DEPS = ${DEPS}
@echo OBJS = ${OBJS}

echo_cc_defs:
${CXX} -dM -E -mavx2 - < /dev/null

echo-srcs:
@echo ${SRCS}

echo-flags:
@echo "CPPFLAGS=${CPPFLAGS}"

echo-tbb:
@echo "TBB_GCC=${TBB_GCC}, TBB_PREFIX=${TBB_PREFIX}, TBB_ROOT=${TBB_ROOT}"
Loading