diff --git a/RecoTracker/LST/plugins/alpaka/LSTProducer.cc b/RecoTracker/LST/plugins/alpaka/LSTProducer.cc index 4aca0528539ef..e9c9bc0883be4 100644 --- a/RecoTracker/LST/plugins/alpaka/LSTProducer.cc +++ b/RecoTracker/LST/plugins/alpaka/LSTProducer.cc @@ -30,7 +30,9 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { lstPhase2OTHitsInputToken_{ consumes(config.getParameter("phase2OTHitsInput"))}, lstESToken_{esConsumes()}, - verbose_(config.getParameter("verbose")), + verbose_(config.getParameter("verbose")), + nopLSDupClean_(config.getParameter("nopLSDupClean")), + tcpLSTriplets_(config.getParameter("tcpLSTriplets")), lstOutputToken_{produces()} {} void acquire(device::Event const& event, device::EventSetup const& setup) override { @@ -61,7 +63,9 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { phase2OTHits.detId(), phase2OTHits.x(), phase2OTHits.y(), - phase2OTHits.z()); + phase2OTHits.z(), + nopLSDupClean_, + tcpLSTriplets_); } void produce(device::Event& event, device::EventSetup const&) override { @@ -76,7 +80,9 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { edm::ParameterSetDescription desc; desc.add("pixelSeedInput", edm::InputTag{"lstPixelSeedInputProducer"}); desc.add("phase2OTHitsInput", edm::InputTag{"lstPhase2OTHitsInputProducer"}); - desc.add("verbose", 0); + desc.add("verbose", false); + desc.add("nopLSDupClean", false); + desc.add("tcpLSTriplets", false); descriptions.addWithDefaultLabel(desc); } @@ -84,7 +90,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { edm::EDGetTokenT lstPixelSeedInputToken_; edm::EDGetTokenT lstPhase2OTHitsInputToken_; device::ESGetToken, TrackerRecoGeometryRecord> lstESToken_; - const int verbose_; + const bool verbose_, nopLSDupClean_, tcpLSTriplets_; edm::EDPutTokenT lstOutputToken_; SDL::LST lst_; diff --git a/RecoTracker/LSTCore/interface/alpaka/LST.h b/RecoTracker/LSTCore/interface/alpaka/LST.h index 7d9d11745ab3c..a95f9343daf89 100644 --- a/RecoTracker/LSTCore/interface/alpaka/LST.h +++ b/RecoTracker/LSTCore/interface/alpaka/LST.h @@ -47,7 +47,9 @@ namespace SDL { const std::vector ph2_detId, const std::vector ph2_x, const std::vector ph2_y, - const std::vector ph2_z); + const std::vector ph2_z, + bool no_pls_dupclean, + bool tc_pls_triplets); std::vector> hits() { return out_tc_hitIdxs_; } std::vector len() { return out_tc_len_; } std::vector seedIdx() { return out_tc_seedIdx_; } diff --git a/RecoTracker/LSTCore/src/alpaka/Event.dev.cc b/RecoTracker/LSTCore/src/alpaka/Event.dev.cc index d539a02b80bf5..785cd3e35be01 100644 --- a/RecoTracker/LSTCore/src/alpaka/Event.dev.cc +++ b/RecoTracker/LSTCore/src/alpaka/Event.dev.cc @@ -617,7 +617,7 @@ void SDL::Event::createTriplets() { } } -void SDL::Event::createTrackCandidates() { +void SDL::Event::createTrackCandidates(bool no_pls_dupclean, bool tc_pls_triplets) { if (trackCandidatesInGPU == nullptr) { trackCandidatesInGPU = new SDL::trackCandidates(); trackCandidatesBuffers = new SDL::trackCandidatesBuffer( @@ -709,18 +709,18 @@ void SDL::Event::createTrackCandidates() { alpaka::enqueue(queue, addT5asTrackCandidateInGPUTask); -#ifndef NOPLSDUPCLEAN - Vec const threadsPerBlockCheckHitspLS = createVec(1, 16, 16); - Vec const blocksPerGridCheckHitspLS = createVec(1, MAX_BLOCKS * 4, MAX_BLOCKS / 4); - WorkDiv const checkHitspLS_workDiv = - createWorkDiv(blocksPerGridCheckHitspLS, threadsPerBlockCheckHitspLS, elementsPerThread); + if (!no_pls_dupclean) { + Vec const threadsPerBlockCheckHitspLS = createVec(1, 16, 16); + Vec const blocksPerGridCheckHitspLS = createVec(1, MAX_BLOCKS * 4, MAX_BLOCKS / 4); + WorkDiv const checkHitspLS_workDiv = + createWorkDiv(blocksPerGridCheckHitspLS, threadsPerBlockCheckHitspLS, elementsPerThread); - SDL::checkHitspLS checkHitspLS_kernel; - auto const checkHitspLSTask(alpaka::createTaskKernel( - checkHitspLS_workDiv, checkHitspLS_kernel, *modulesBuffers_->data(), *segmentsInGPU, true)); + SDL::checkHitspLS checkHitspLS_kernel; + auto const checkHitspLSTask(alpaka::createTaskKernel( + checkHitspLS_workDiv, checkHitspLS_kernel, *modulesBuffers_->data(), *segmentsInGPU, true)); - alpaka::enqueue(queue, checkHitspLSTask); -#endif + alpaka::enqueue(queue, checkHitspLSTask); + } Vec const threadsPerBlock_crossCleanpLS = createVec(1, 16, 32); Vec const blocksPerGrid_crossCleanpLS = createVec(1, 4, 20); @@ -751,7 +751,8 @@ void SDL::Event::createTrackCandidates() { addpLSasTrackCandidateInGPU_kernel, nLowerModules_, *trackCandidatesInGPU, - *segmentsInGPU)); + *segmentsInGPU, + tc_pls_triplets)); alpaka::enqueue(queue, addpLSasTrackCandidateInGPUTask); @@ -990,20 +991,20 @@ void SDL::Event::createQuintuplets() { } } -void SDL::Event::pixelLineSegmentCleaning() { -#ifndef NOPLSDUPCLEAN - Vec const threadsPerBlockCheckHitspLS = createVec(1, 16, 16); - Vec const blocksPerGridCheckHitspLS = createVec(1, MAX_BLOCKS * 4, MAX_BLOCKS / 4); - WorkDiv const checkHitspLS_workDiv = - createWorkDiv(blocksPerGridCheckHitspLS, threadsPerBlockCheckHitspLS, elementsPerThread); +void SDL::Event::pixelLineSegmentCleaning(bool no_pls_dupclean) { + if (!no_pls_dupclean) { + Vec const threadsPerBlockCheckHitspLS = createVec(1, 16, 16); + Vec const blocksPerGridCheckHitspLS = createVec(1, MAX_BLOCKS * 4, MAX_BLOCKS / 4); + WorkDiv const checkHitspLS_workDiv = + createWorkDiv(blocksPerGridCheckHitspLS, threadsPerBlockCheckHitspLS, elementsPerThread); - SDL::checkHitspLS checkHitspLS_kernel; - auto const checkHitspLSTask(alpaka::createTaskKernel( - checkHitspLS_workDiv, checkHitspLS_kernel, *modulesBuffers_->data(), *segmentsInGPU, false)); + SDL::checkHitspLS checkHitspLS_kernel; + auto const checkHitspLSTask(alpaka::createTaskKernel( + checkHitspLS_workDiv, checkHitspLS_kernel, *modulesBuffers_->data(), *segmentsInGPU, false)); - alpaka::enqueue(queue, checkHitspLSTask); - alpaka::wait(queue); -#endif + alpaka::enqueue(queue, checkHitspLSTask); + alpaka::wait(queue); + } } void SDL::Event::createPixelQuintuplets() { diff --git a/RecoTracker/LSTCore/src/alpaka/Event.h b/RecoTracker/LSTCore/src/alpaka/Event.h index 3d301c2c65069..2b02efe6e5485 100644 --- a/RecoTracker/LSTCore/src/alpaka/Event.h +++ b/RecoTracker/LSTCore/src/alpaka/Event.h @@ -148,12 +148,12 @@ namespace SDL { void createTriplets(); void createPixelTracklets(); void createPixelTrackletsWithMap(); - void createTrackCandidates(); + void createTrackCandidates(bool no_pls_dupclean, bool tc_pls_triplets); void createExtendedTracks(); void createQuintuplets(); void createPixelTriplets(); void createPixelQuintuplets(); - void pixelLineSegmentCleaning(); + void pixelLineSegmentCleaning(bool no_pls_dupclean); unsigned int getNumberOfHits(); unsigned int getNumberOfHitsByLayer(unsigned int layer); diff --git a/RecoTracker/LSTCore/src/alpaka/LST.dev.cc b/RecoTracker/LSTCore/src/alpaka/LST.dev.cc index 9eb11503123df..cf2e73c25b410 100644 --- a/RecoTracker/LSTCore/src/alpaka/LST.dev.cc +++ b/RecoTracker/LSTCore/src/alpaka/LST.dev.cc @@ -30,7 +30,9 @@ void SDL::LST::run(SDL::QueueAcc& queue, const std::vector ph2_detId, const std::vector ph2_x, const std::vector ph2_y, - const std::vector ph2_z) { + const std::vector ph2_z, + bool no_pls_dupclean, + bool tc_pls_triplets) { auto event = SDL::Event(verbose, queue, deviceESData); prepareInput(see_px, see_py, @@ -135,7 +137,7 @@ void SDL::LST::run(SDL::QueueAcc& queue, printf("# of Quintuplets produced endcap layer 5: %d\n", event.getNumberOfQuintupletsByLayerEndcap(4)); } - event.pixelLineSegmentCleaning(); + event.pixelLineSegmentCleaning(no_pls_dupclean); event.createPixelQuintuplets(); if (verbose) @@ -145,7 +147,7 @@ void SDL::LST::run(SDL::QueueAcc& queue, if (verbose) printf("# of Pixel T3s produced: %d\n", event.getNumberOfPixelTriplets()); - event.createTrackCandidates(); + event.createTrackCandidates(no_pls_dupclean, tc_pls_triplets); if (verbose) { printf("# of TrackCandidates produced: %d\n", event.getNumberOfTrackCandidates()); printf(" # of Pixel TrackCandidates produced: %d\n", event.getNumberOfPixelTrackCandidates()); diff --git a/RecoTracker/LSTCore/src/alpaka/TrackCandidate.h b/RecoTracker/LSTCore/src/alpaka/TrackCandidate.h index d65464944ab52..60cefedc751f9 100644 --- a/RecoTracker/LSTCore/src/alpaka/TrackCandidate.h +++ b/RecoTracker/LSTCore/src/alpaka/TrackCandidate.h @@ -491,18 +491,15 @@ namespace SDL { ALPAKA_FN_ACC void operator()(TAcc const& acc, uint16_t nLowerModules, struct SDL::trackCandidates trackCandidatesInGPU, - struct SDL::segments segmentsInGPU) const { + struct SDL::segments segmentsInGPU, + bool tc_pls_triplets) const { auto const globalThreadIdx = alpaka::getIdx(acc); auto const gridThreadExtent = alpaka::getWorkDiv(acc); unsigned int nPixels = segmentsInGPU.nSegments[nLowerModules]; for (unsigned int pixelArrayIndex = globalThreadIdx[2]; pixelArrayIndex < nPixels; pixelArrayIndex += gridThreadExtent[2]) { -#ifdef TC_PLS_TRIPLETS - if (segmentsInGPU.isDup[pixelArrayIndex]) -#else - if ((!segmentsInGPU.isQuad[pixelArrayIndex]) || (segmentsInGPU.isDup[pixelArrayIndex])) -#endif + if ((tc_pls_triplets ? 0 : !segmentsInGPU.isQuad[pixelArrayIndex]) || (segmentsInGPU.isDup[pixelArrayIndex])) continue; unsigned int trackCandidateIdx = diff --git a/RecoTracker/LSTCore/standalone/SDL/Makefile b/RecoTracker/LSTCore/standalone/SDL/Makefile index 688e868d1b999..6160ec6c80136 100644 --- a/RecoTracker/LSTCore/standalone/SDL/Makefile +++ b/RecoTracker/LSTCore/standalone/SDL/Makefile @@ -91,13 +91,13 @@ CUTVALUEFLAG = CUTVALUEFLAG_FLAGS = -DCUT_VALUE_DEBUG %_cpu.o: ../../src/alpaka/%.dev.cc - $(COMPILE_CMD_CPU) $(CXXFLAGS_CPU) $(ROOTINCLUDE) $(PRINTFLAG) $(CACHEFLAG) $(CUTVALUEFLAG) $(LSTWARNINGSFLAG) $(CMSSW_WERRORS_CPU) $(T5CUTFLAGS) $(NOPLSDUPCLEANFLAG) $(TCPLSTRIPLETSFLAG) $(PTCUTFLAG) $(DUPLICATES) $(ALPAKAINCLUDE) $(ALPAKABACKEND_CPU) $< -o $@ + $(COMPILE_CMD_CPU) $(CXXFLAGS_CPU) $(ROOTINCLUDE) $(PRINTFLAG) $(CACHEFLAG) $(CUTVALUEFLAG) $(LSTWARNINGSFLAG) $(CMSSW_WERRORS_CPU) $(T5CUTFLAGS) $(PTCUTFLAG) $(DUPLICATES) $(ALPAKAINCLUDE) $(ALPAKABACKEND_CPU) $< -o $@ %_cuda.o: ../../src/alpaka/%.dev.cc - $(COMPILE_CMD_CUDA) $(CXXFLAGS_CUDA) $(ROOTINCLUDE) $(PRINTFLAG) $(CACHEFLAG) $(CUTVALUEFLAG) $(LSTWARNINGSFLAG) $(CMSSW_WERRORS_CUDA) $(T5CUTFLAGS) $(NOPLSDUPCLEANFLAG) $(TCPLSTRIPLETSFLAG) $(PTCUTFLAG) $(DUPLICATES) $(ALPAKAINCLUDE) $(ALPAKABACKEND_CUDA) $< -o $@ + $(COMPILE_CMD_CUDA) $(CXXFLAGS_CUDA) $(ROOTINCLUDE) $(PRINTFLAG) $(CACHEFLAG) $(CUTVALUEFLAG) $(LSTWARNINGSFLAG) $(CMSSW_WERRORS_CUDA) $(T5CUTFLAGS) $(PTCUTFLAG) $(DUPLICATES) $(ALPAKAINCLUDE) $(ALPAKABACKEND_CUDA) $< -o $@ %_rocm.o: ../../src/alpaka/%.dev.cc - $(COMPILE_CMD_ROCM) $(CXXFLAGS_ROCM) $(ROOTINCLUDE) $(PRINTFLAG) $(CACHEFLAG) $(CUTVALUEFLAG) $(LSTWARNINGSFLAG) $(CMSSW_WERRORS_ROCM) $(T5CUTFLAGS) $(NOPLSDUPCLEANFLAG) $(TCPLSTRIPLETSFLAG) $(PTCUTFLAG) $(DUPLICATES) $(ALPAKAINCLUDE) $(ALPAKABACKEND_ROCM) $< -o $@ + $(COMPILE_CMD_ROCM) $(CXXFLAGS_ROCM) $(ROOTINCLUDE) $(PRINTFLAG) $(CACHEFLAG) $(CUTVALUEFLAG) $(LSTWARNINGSFLAG) $(CMSSW_WERRORS_ROCM) $(T5CUTFLAGS) $(PTCUTFLAG) $(DUPLICATES) $(ALPAKAINCLUDE) $(ALPAKABACKEND_ROCM) $< -o $@ $(LIB_CPU): $(CCOBJECTS_CPU) $(LSTOBJECTS_CPU) $(LD_CPU) $(SOFLAGS_CPU) $^ -o $@ diff --git a/RecoTracker/LSTCore/standalone/bin/sdl.cc b/RecoTracker/LSTCore/standalone/bin/sdl.cc index 3aed3e3c4d3b7..ce1b0f12461ed 100644 --- a/RecoTracker/LSTCore/standalone/bin/sdl.cc +++ b/RecoTracker/LSTCore/standalone/bin/sdl.cc @@ -52,18 +52,19 @@ int main(int argc, char **argv) { "N,nmatch", "N match for MTV-like matching", cxxopts::value()->default_value("9"))( "n,nevents", "N events to loop over", cxxopts::value()->default_value("-1"))( "x,event_index", "specific event index to process", cxxopts::value()->default_value("-1"))( - "g,pdg_id", "The simhit pdgId match option (default = 0)", cxxopts::value()->default_value("0"))( + "g,pdg_id", "The simhit pdgId match option", cxxopts::value()->default_value("0"))( "v,verbose", "Verbose mode (0: no print, 1: only final timing, 2: object multiplitcity", cxxopts::value()->default_value("0"))( "w,write_ntuple", "Write Ntuple", cxxopts::value()->default_value("1"))( - "s,streams", "Set number of streams (default=1)", cxxopts::value()->default_value("1"))( + "s,streams", "Set number of streams", cxxopts::value()->default_value("1"))( "d,debug", "Run debug job. i.e. overrides output option to 'debug.root' and 'recreate's the file.")( "l,lower_level", "write lower level objects ntuple results")("G,gnn_ntuple", "write gnn input variable ntuple")( "j,nsplit_jobs", "Enable splitting jobs by N blocks (--job_index must be set)", cxxopts::value())( "I,job_index", "job_index of split jobs (--nsplit_jobs must be set. index starts from 0. i.e. 0, 1, 2, 3, etc...)", - cxxopts::value())("h,help", "Print help"); + cxxopts::value())("3,tc_pls_triplets", "Allow triplet pLSs in TC collection")( + "2,no_pls_dupclean", "Disable pLS duplicate cleaning (both steps)")("h,help", "Print help"); auto result = options.parse(argc, argv); @@ -242,6 +243,14 @@ int main(int argc, char **argv) { ana.gnn_ntuple = false; } + //_______________________________________________________________________________ + // --tc_pls_triplets + ana.tc_pls_triplets = result["tc_pls_triplets"].as(); + + //_______________________________________________________________________________ + // --no_pls_dupclean + ana.no_pls_dupclean = result["no_pls_dupclean"].as(); + // Printing out the option settings overview std::cout << "=========================================================" << std::endl; std::cout << " Running for Acc = " << alpaka::getAccName() << std::endl; @@ -258,6 +267,8 @@ int main(int argc, char **argv) { std::cout << " ana.streams: " << ana.streams << std::endl; std::cout << " ana.verbose: " << ana.verbose << std::endl; std::cout << " ana.nmatch_threshold: " << ana.nmatch_threshold << std::endl; + std::cout << " ana.tc_pls_triplets: " << ana.tc_pls_triplets << std::endl; + std::cout << " ana.no_pls_dupclean: " << ana.no_pls_dupclean << std::endl; std::cout << "=========================================================" << std::endl; // Create the TChain that holds the TTree's of the baby ntuples @@ -430,10 +441,10 @@ void run_sdl() { timing_LS = runSegment(events.at(omp_get_thread_num())); timing_T3 = runT3(events.at(omp_get_thread_num())); timing_T5 = runQuintuplet(events.at(omp_get_thread_num())); - timing_pLS = runPixelLineSegment(events.at(omp_get_thread_num())); + timing_pLS = runPixelLineSegment(events.at(omp_get_thread_num()), ana.no_pls_dupclean); timing_pT5 = runPixelQuintuplet(events.at(omp_get_thread_num())); timing_pT3 = runpT3(events.at(omp_get_thread_num())); - timing_TC = runTrackCandidate(events.at(omp_get_thread_num())); + timing_TC = runTrackCandidate(events.at(omp_get_thread_num()), ana.no_pls_dupclean, ana.tc_pls_triplets); if (ana.verbose == 4) { #pragma omp critical diff --git a/RecoTracker/LSTCore/standalone/bin/sdl.h b/RecoTracker/LSTCore/standalone/bin/sdl.h index 23be7ee4418cc..78545c3f55269 100644 --- a/RecoTracker/LSTCore/standalone/bin/sdl.h +++ b/RecoTracker/LSTCore/standalone/bin/sdl.h @@ -14,10 +14,6 @@ #include "rooutil.h" #include "cxxopts.h" -#include "Event.h" // SDL::Event -#include "Module.h" // SDL::Module -#include "EndcapGeometry.h" // SDL::EndcapGeometr -#include "ModuleConnectionMap.h" // SDL::ModuleConnectionMap #include "Event.h" #include "LST.h" diff --git a/RecoTracker/LSTCore/standalone/bin/sdl_make_tracklooper b/RecoTracker/LSTCore/standalone/bin/sdl_make_tracklooper index 6c34156550c50..ae4678ec18892 100755 --- a/RecoTracker/LSTCore/standalone/bin/sdl_make_tracklooper +++ b/RecoTracker/LSTCore/standalone/bin/sdl_make_tracklooper @@ -24,7 +24,6 @@ usage() echo " -m make clean binaries (Make clean binaries before remake. e.g. when header files changed in SDL/*.h)" echo " -d cut value ntuple (With extra variables in a debug ntuple file)" echo " -p primitive object ntuple (With extra variables related to primitive objects)" - echo " -3 TC pLS triplets (Allow triplet pLSs in TC collection)" echo " -N neural networks (Toggle LST neural networks)" echo " -C CPU serial backend (Compile for CPU)" echo " -G GPU (CUDA) backend (Compile for CUDA)" @@ -32,7 +31,6 @@ usage() echo " -A All backends (Compile for all backends, including ROCm)" echo " -P PT Cut Value (In GeV, Default is 0.8, Works only for standalone version of code)" echo " -w Warning mode (Print extra warning outputs)" - echo " -2 no pLS duplicate cleaning (Don't perform the pLS duplicate cleaning step)" echo exit } @@ -45,13 +43,11 @@ while getopts ":cxgsmdp3NCGRA2ehwP:" OPTION; do m) MAKECLEANBINARIES=true;; d) MAKECUTVALUES=true;; p) PRIMITIVE=true;; - 3) TCPLSTRIPLETS=true;; N) DONTUSENN=true;; G) CUDABACKEND=true;; C) CPUBACKEND=true;; R) ROCMBACKEND=true;; A) ALLBACKENDS=true;; - 2) NOPLSDUPCLEAN=true;; w) PRINTWARNINGS=true;; P) PTCUTVALUE=$OPTARG;; h) usage;; @@ -65,13 +61,11 @@ if [ -z ${SHOWLOG} ]; then SHOWLOG=false; fi if [ -z ${MAKECLEANBINARIES} ]; then MAKECLEANBINARIES=false; fi if [ -z ${MAKECUTVALUES} ]; then MAKECUTVALUES=false; fi if [ -z ${PRIMITIVE} ]; then PRIMITIVE=false; fi -if [ -z ${TCPLSTRIPLETS} ]; then TCPLSTRIPLETS=false; fi if [ -z ${DONTUSENN} ]; then DONTUSENN=false; fi if [ -z ${CPUBACKEND} ]; then CPUBACKEND=false; fi if [ -z ${CUDABACKEND} ]; then CUDABACKEND=false; fi if [ -z ${ROCMBACKEND} ]; then ROCMBACKEND=false; fi if [ -z ${ALLBACKENDS} ]; then ALLBACKENDS=false; fi -if [ -z ${NOPLSDUPCLEAN} ]; then NOPLSDUPCLEAN=false; fi if [ -z ${PRINTWARNINGS} ]; then PRINTWARNINGS=false; fi if [ -z ${PTCUTVALUE} ]; then PTCUTVALUE=0.8; fi @@ -107,12 +101,10 @@ echo " SHOWLOG : ${SHOWLOG}" | tee -a ${LOG} echo " MAKECLEANBINARIES : ${MAKECLEANBINARIES}" | tee -a ${LOG} echo " MAKECUTVALUES : ${MAKECUTVALUES}" | tee -a ${LOG} echo " PRIMITIVE : ${PRIMITIVE}" | tee -a ${LOG} -echo " TCPLSTRIPLETS : ${TCPLSTRIPLETS}" | tee -a ${LOG} echo " DONTUSENN : ${DONTUSENN}" | tee -a ${LOG} echo " CPUBACKEND : ${CPUBACKEND}" | tee -a ${LOG} echo " CUDABACKEND : ${CUDABACKEND}" | tee -a ${LOG} echo " ROCMBACKEND : ${ROCMBACKEND}" | tee -a ${LOG} -echo " NOPLSDUPCLEAN : ${NOPLSDUPCLEAN}" | tee -a ${LOG} echo " PRINTWARNINGS : ${PRINTWARNINGS}" | tee -a ${LOG} echo " PTCUTVALUE : ${PTCUTVALUE} GeV" | tee -a ${LOG} echo "" | tee -a ${LOG} @@ -149,11 +141,6 @@ if $PRIMITIVE; then echo "debug : MAKETARGET=${MAKETARGET}" fi -TCPLSTRIPLETSOPT= -if $TCPLSTRIPLETS; then - TCPLSTRIPLETSOPT="TCPLSTRIPLETSFLAG=-DTC_PLS_TRIPLETS" -fi - T5CUTOPT= if $DONTUSENN; then T5CUTOPT="T5RZCHI2FLAG=-DUSE_RZCHI2 T5RPHICHI2FLAG=-DUSE_RPHICHI2" @@ -181,11 +168,6 @@ else fi fi -NOPLSDUPCLEANOPT= -if $NOPLSDUPCLEAN; then - NOPLSDUPCLEANOPT="NOPLSDUPCLEANFLAG=-DNOPLSDUPCLEAN" -fi - PRINTWARNINGSOPT= if $PRINTWARNINGS; then PRINTWARNINGSOPT="LSTWARNINGSFLAG=-DWarnings" @@ -205,9 +187,9 @@ echo "-------------------------------------------------------------------------- echo "---------------------------------------------------------------------------------------------" >> ${LOG} 2>&1 echo "---------------------------------------------------------------------------------------------" >> ${LOG} 2>&1 if $SHOWLOG; then - (cd SDL && make clean && make ${TCPLSTRIPLETSOPT} ${T5CUTOPT} ${BACKENDOPT} ${PRINTWARNINGSOPT} ${NOPLSDUPCLEANOPT} ${PTCUTOPT} -j 32 ${MAKETARGET} && cd -) 2>&1 | tee -a ${LOG} + (cd SDL && make clean && make ${T5CUTOPT} ${BACKENDOPT} ${PRINTWARNINGSOPT} ${PTCUTOPT} -j 32 ${MAKETARGET} && cd -) 2>&1 | tee -a ${LOG} else - (cd SDL && make clean && make ${TCPLSTRIPLETSOPT} ${T5CUTOPT} ${BACKENDOPT} ${PRINTWARNINGSOPT} ${NOPLSDUPCLEANOPT} ${PTCUTOPT} -j 32 ${MAKETARGET} && cd -) >> ${LOG} 2>&1 + (cd SDL && make clean && make ${T5CUTOPT} ${BACKENDOPT} ${PRINTWARNINGSOPT} ${PTCUTOPT} -j 32 ${MAKETARGET} && cd -) >> ${LOG} 2>&1 fi if ([[ "$BACKENDOPT" == *"all"* ]] || [[ "$BACKENDOPT" == *"cpu"* ]]) && [ ! -f SDL/libsdl_cpu.so ]; then diff --git a/RecoTracker/LSTCore/standalone/bin/sdl_run b/RecoTracker/LSTCore/standalone/bin/sdl_run index 32a1cc6f62701..2ed9c20fb7949 100755 --- a/RecoTracker/LSTCore/standalone/bin/sdl_run +++ b/RecoTracker/LSTCore/standalone/bin/sdl_run @@ -25,6 +25,7 @@ usage() echo " -t tag for this run (Tag for this run)" echo " -d delete previous output (Delete the previous outputs and re-run)" echo " -b backend (Select a backend: cuda or cpu; default cuda)" + echo " -a arguments (Add command line arguments to the sdl command)" echo exit } @@ -32,13 +33,14 @@ usage() DELETE=false # Parsing command-line opts -while getopts ":f:s:n:t:b:dh" OPTION; do +while getopts ":f:s:n:t:b:a:dh" OPTION; do case $OPTION in f) FLAGS=${OPTARG};; s) SAMPLE=${OPTARG};; n) NEVENTS=${OPTARG};; t) TAG=${OPTARG};; b) BACKEND=${OPTARG};; + a) ARGUMENTS=${OPTARG};; d) DELETE=true;; h) usage;; :) usage;; @@ -51,6 +53,7 @@ if [ -z ${SAMPLE} ]; then usage; fi if [ -z ${NEVENTS} ]; then NEVENTS=-1; fi if [ -z ${TAG} ]; then usage; fi if [ -z ${BACKEND} ]; then BACKEND="default"; fi +if [ -z ${ARGUMENTS} ]; then ARGUMENTS=""; fi # Check that the FLAGS start with "-" character if [[ ${PRECOMPILED} == true ]] || [[ ${FLAGS:0:1} == "-" ]]; then @@ -85,6 +88,7 @@ echo " NEVENTS : ${NEVENTS}" echo " TAG : ${TAG}" echo " DELETE : ${DELETE}" echo " BACKEND : ${BACKEND}" +echo " ARGUMENTS : ${ARGUMENTS}" echo "" echo " (cf. Run > sh $(basename $0) -h to see all options)" echo "" @@ -162,7 +166,7 @@ else fi echo "Running LST code..." -sdl -i ${SAMPLE} -o ${LSTOUTPUTDIR}/${JOBTAG}__LSTNtuple.root -n ${NEVENTS} >> ${LSTOUTPUTDIR}/${JOBTAG}__LSTRun.log 2>&1 || { echo 'ERROR: sdl command failed!' ; exit 1; } +sdl -i ${SAMPLE} -o ${LSTOUTPUTDIR}/${JOBTAG}__LSTNtuple.root -n ${NEVENTS} ${ARGUMENTS} >> ${LSTOUTPUTDIR}/${JOBTAG}__LSTRun.log 2>&1 || { echo 'ERROR: sdl command failed!' ; exit 1; } echo "Creating performance histograms..." createPerfNumDenHists -i ${LSTOUTPUTDIR}/${JOBTAG}__LSTNtuple.root -o ${LSTOUTPUTDIR}/${JOBTAG}__LSTNumDen.root >> ${LSTOUTPUTDIR}/${JOBTAG}__LSTRun.log 2>&1 || { echo 'ERROR: createPerfNumDenHists command failed!' ; exit 1; } echo "Creating plots..." diff --git a/RecoTracker/LSTCore/standalone/code/core/AnalysisConfig.h b/RecoTracker/LSTCore/standalone/code/core/AnalysisConfig.h index 9040b327ed011..14b3df631c6c8 100644 --- a/RecoTracker/LSTCore/standalone/code/core/AnalysisConfig.h +++ b/RecoTracker/LSTCore/standalone/code/core/AnalysisConfig.h @@ -122,6 +122,12 @@ class AnalysisConfig { // Path to the TrackLooper code directory TString full_cmd_line; + + // Boolean to allow pLS triplets to be included in the TCs + bool tc_pls_triplets; + + // Boolean to disable pLS duplicate cleaning + bool no_pls_dupclean; }; extern AnalysisConfig ana; diff --git a/RecoTracker/LSTCore/standalone/code/core/trkCore.cc b/RecoTracker/LSTCore/standalone/code/core/trkCore.cc index d33a0c28c08c7..d16394cc06f98 100644 --- a/RecoTracker/LSTCore/standalone/code/core/trkCore.cc +++ b/RecoTracker/LSTCore/standalone/code/core/trkCore.cc @@ -165,9 +165,6 @@ float runpT3(SDL::Event *event) { return pt3_elapsed; } -//___________________________________________________________________________________________________________________________________________________________________________________________ -float runTrackCandidate(SDL::Event *event) { return runTrackCandidateTest_v2(event); } - //___________________________________________________________________________________________________________________________________________________________________________________________ float runQuintuplet(SDL::Event *event) { TStopwatch my_timer; @@ -214,12 +211,12 @@ float runQuintuplet(SDL::Event *event) { } //___________________________________________________________________________________________________________________________________________________________________________________________ -float runPixelLineSegment(SDL::Event *event) { +float runPixelLineSegment(SDL::Event *event, bool no_pls_dupclean) { TStopwatch my_timer; if (ana.verbose >= 2) std::cout << "Reco Pixel Line Segment start" << std::endl; my_timer.Start(); - event->pixelLineSegmentCleaning(); + event->pixelLineSegmentCleaning(no_pls_dupclean); float pls_elapsed = my_timer.RealTime(); if (ana.verbose >= 2) std::cout << "Reco Pixel Line Segment processing time: " << pls_elapsed << " secs" << std::endl; @@ -244,12 +241,12 @@ float runPixelQuintuplet(SDL::Event *event) { } //___________________________________________________________________________________________________________________________________________________________________________________________ -float runTrackCandidateTest_v2(SDL::Event *event) { +float runTrackCandidate(SDL::Event *event, bool no_pls_dupclean, bool tc_pls_triplets) { TStopwatch my_timer; if (ana.verbose >= 2) std::cout << "Reco TrackCandidate start" << std::endl; my_timer.Start(); - event->createTrackCandidates(); + event->createTrackCandidates(no_pls_dupclean, tc_pls_triplets); float tc_elapsed = my_timer.RealTime(); if (ana.verbose >= 2) std::cout << "Reco TrackCandidate processing time: " << tc_elapsed << " secs" << std::endl; diff --git a/RecoTracker/LSTCore/standalone/code/core/trkCore.h b/RecoTracker/LSTCore/standalone/code/core/trkCore.h index 73d006975be4a..a407f303cf1a6 100644 --- a/RecoTracker/LSTCore/standalone/code/core/trkCore.h +++ b/RecoTracker/LSTCore/standalone/code/core/trkCore.h @@ -20,11 +20,10 @@ float runT4(SDL::Event *event); float runT4x(SDL::Event *event); float runpT4(SDL::Event *event); float runT3(SDL::Event *event); -float runTrackCandidate(SDL::Event *event); -float runTrackCandidateTest_v2(SDL::Event *event); +float runTrackCandidate(SDL::Event *event, bool no_pls_dupclean, bool tc_pls_triplets); float runQuintuplet(SDL::Event *event); float runPixelQuintuplet(SDL::Event *event); -float runPixelLineSegment(SDL::Event *event); +float runPixelLineSegment(SDL::Event *event, bool no_pls_dupclean); float runpT3(SDL::Event *event); // --------------------- ======================== ---------------------