diff --git a/SDL/EndcapGeometry.h b/SDL/EndcapGeometry.h index df9d7ef7..61ae01fc 100644 --- a/SDL/EndcapGeometry.h +++ b/SDL/EndcapGeometry.h @@ -9,7 +9,11 @@ #include #include +#ifdef LST_IS_CMSSW_PACKAGE +#include "RecoTracker/LSTCore/interface/alpaka/Constants.h" +#else #include "Constants.h" +#endif #include "HeterogeneousCore/AlpakaInterface/interface/host.h" diff --git a/SDL/Event.h b/SDL/Event.h index 408ffc2e..7c799dcb 100644 --- a/SDL/Event.h +++ b/SDL/Event.h @@ -1,8 +1,15 @@ #ifndef Event_cuh #define Event_cuh -#include "Hit.h" +#ifdef LST_IS_CMSSW_PACKAGE +#include "RecoTracker/LSTCore/interface/alpaka/Constants.h" +#include "RecoTracker/LSTCore/interface/alpaka/Module.h" +#else +#include "Constants.h" #include "Module.h" +#endif + +#include "Hit.h" #include "ModuleMethods.h" #include "Segment.h" #include "Triplet.h" @@ -11,7 +18,6 @@ #include "MiniDoublet.h" #include "PixelTriplet.h" #include "TrackCandidate.h" -#include "Constants.h" #include "HeterogeneousCore/AlpakaInterface/interface/host.h" @@ -179,9 +185,7 @@ namespace SDL { modulesBuffer* getModules(bool isFull = false); //read from file and init - static void initModules(QueueAcc& queue, - const MapPLStoLayer& pLStoLayer, - const char* moduleMetaDataFilePath); + static void initModules(QueueAcc& queue, const MapPLStoLayer& pLStoLayer, const char* moduleMetaDataFilePath); }; } // namespace SDL diff --git a/SDL/Globals.h b/SDL/Globals.h index 4aa5f95c..9366405f 100644 --- a/SDL/Globals.h +++ b/SDL/Globals.h @@ -1,8 +1,14 @@ #ifndef Globals_h #define Globals_h +#ifdef LST_IS_CMSSW_PACKAGE +#include "RecoTracker/LSTCore/interface/alpaka/Constants.h" +#include "RecoTracker/LSTCore/interface/alpaka/Module.h" +#else #include "Constants.h" #include "Module.h" +#endif + #include "TiltedGeometry.h" #include "EndcapGeometry.h" #include "ModuleConnectionMap.h" diff --git a/SDL/Hit.h b/SDL/Hit.h index 49cfb7cd..22699955 100644 --- a/SDL/Hit.h +++ b/SDL/Hit.h @@ -1,8 +1,13 @@ #ifndef Hit_cuh #define Hit_cuh +#ifdef LST_IS_CMSSW_PACKAGE +#include "RecoTracker/LSTCore/interface/alpaka/Constants.h" +#include "RecoTracker/LSTCore/interface/alpaka/Module.h" +#else #include "Constants.h" #include "Module.h" +#endif namespace SDL { struct hits { diff --git a/SDL/Kernels.h b/SDL/Kernels.h index 909ee561..6ee85f3f 100644 --- a/SDL/Kernels.h +++ b/SDL/Kernels.h @@ -1,14 +1,20 @@ #ifndef Kernels_cuh #define Kernels_cuh +#ifdef LST_IS_CMSSW_PACKAGE +#include "RecoTracker/LSTCore/interface/alpaka/Constants.h" +#include "RecoTracker/LSTCore/interface/alpaka/Module.h" +#else +#include "Constants.h" #include "Module.h" +#endif + #include "Hit.h" #include "MiniDoublet.h" #include "Segment.h" #include "Triplet.h" #include "Quintuplet.h" #include "PixelTriplet.h" -#include "Constants.h" namespace SDL { ALPAKA_FN_ACC ALPAKA_FN_INLINE void rmQuintupletFromMemory(struct SDL::quintuplets& quintupletsInGPU, diff --git a/SDL/LST.cc b/SDL/LST.cc index 8b6da5ef..776663ea 100644 --- a/SDL/LST.cc +++ b/SDL/LST.cc @@ -1,4 +1,9 @@ +#ifdef LST_IS_CMSSW_PACKAGE +#include "RecoTracker/LSTCore/interface/alpaka/LST.h" +#else #include "LST.h" +#endif + #include "Event.h" #include "Globals.h" @@ -6,7 +11,19 @@ using XYZVector = ROOT::Math::XYZVector; namespace { - std::string trackLooperDir() { return getenv("LST_BASE"); } + std::string trackLooperDir() { + const char* path = std::getenv("LST_BASE"); + std::string path_str; + if (path != nullptr) { + path_str = path; + } else { + // FIXME: temporary solution, will need to pass a value from FileInPath or CMSSW search path + // in the `LSTProducer` or a related ES producer + path_str = std::getenv("CMSSW_BASE"); + path_str += "/src/RecoTracker/LSTCore/TrackLooper"; + } + return path_str; + } std::string get_absolute_path_after_check_file_exists(const std::string name) { std::filesystem::path fullpath = std::filesystem::absolute(name.c_str()); diff --git a/SDL/LST.h b/SDL/LST.h index 4e467ebc..a0360932 100644 --- a/SDL/LST.h +++ b/SDL/LST.h @@ -1,7 +1,11 @@ #ifndef LST_H #define LST_H +#ifdef LST_IS_CMSSW_PACKAGE +#include "RecoTracker/LSTCore/interface/alpaka/Constants.h" +#else #include "Constants.h" +#endif #include #include diff --git a/SDL/MiniDoublet.h b/SDL/MiniDoublet.h index 01035229..aa63d513 100644 --- a/SDL/MiniDoublet.h +++ b/SDL/MiniDoublet.h @@ -1,9 +1,15 @@ #ifndef MiniDoublet_cuh #define MiniDoublet_cuh +#ifdef LST_IS_CMSSW_PACKAGE +#include "RecoTracker/LSTCore/interface/alpaka/Constants.h" +#include "RecoTracker/LSTCore/interface/alpaka/Module.h" +#else #include "Constants.h" -#include "EndcapGeometry.h" #include "Module.h" +#endif + +#include "EndcapGeometry.h" #include "Hit.h" namespace SDL { diff --git a/SDL/Module.h b/SDL/Module.h index b6498f48..a6b86e78 100644 --- a/SDL/Module.h +++ b/SDL/Module.h @@ -2,7 +2,12 @@ #define Module_cuh #include + +#ifdef LST_IS_CMSSW_PACKAGE +#include "RecoTracker/LSTCore/interface/alpaka/Constants.h" +#else #include "Constants.h" +#endif namespace SDL { enum SubDet { InnerPixel = 0, Barrel = 5, Endcap = 4 }; diff --git a/SDL/ModuleConnectionMap.h b/SDL/ModuleConnectionMap.h index 48290007..45d629a7 100644 --- a/SDL/ModuleConnectionMap.h +++ b/SDL/ModuleConnectionMap.h @@ -8,7 +8,11 @@ #include #include +#ifdef LST_IS_CMSSW_PACKAGE +#include "RecoTracker/LSTCore/interface/alpaka/Constants.h" +#else #include "Constants.h" +#endif namespace SDL { //FIXME: move to non-alpaka single arch build diff --git a/SDL/ModuleMethods.h b/SDL/ModuleMethods.h index 442068cd..e7d781ec 100644 --- a/SDL/ModuleMethods.h +++ b/SDL/ModuleMethods.h @@ -4,8 +4,14 @@ #include #include +#ifdef LST_IS_CMSSW_PACKAGE +#include "RecoTracker/LSTCore/interface/alpaka/Constants.h" +#include "RecoTracker/LSTCore/interface/alpaka/Module.h" +#else #include "Constants.h" #include "Module.h" +#endif + #include "TiltedGeometry.h" #include "EndcapGeometry.h" #include "ModuleConnectionMap.h" diff --git a/SDL/NeuralNetwork.h b/SDL/NeuralNetwork.h index 431251f5..a786e249 100644 --- a/SDL/NeuralNetwork.h +++ b/SDL/NeuralNetwork.h @@ -1,11 +1,17 @@ #ifndef NeuralNetwork_cuh #define NeuralNetwork_cuh +#ifdef LST_IS_CMSSW_PACKAGE +#include "RecoTracker/LSTCore/interface/alpaka/Constants.h" +#include "RecoTracker/LSTCore/interface/alpaka/Module.h" +#else #include "Constants.h" +#include "Module.h" +#endif + #include "NeuralNetworkWeights.h" #include "Segment.h" #include "MiniDoublet.h" -#include "Module.h" #include "Hit.h" #include "Triplet.h" diff --git a/SDL/PixelMap.h b/SDL/PixelMap.h index 01a58cb0..d6cbdffe 100644 --- a/SDL/PixelMap.h +++ b/SDL/PixelMap.h @@ -4,7 +4,11 @@ #include #include +#ifdef LST_IS_CMSSW_PACKAGE +#include "RecoTracker/LSTCore/interface/alpaka/Constants.h" +#else #include "Constants.h" +#endif namespace SDL { // PixelMap is never allocated on the device. diff --git a/SDL/PixelTriplet.h b/SDL/PixelTriplet.h index 087762ee..26ad87e1 100644 --- a/SDL/PixelTriplet.h +++ b/SDL/PixelTriplet.h @@ -1,11 +1,17 @@ #ifndef PixelTriplet_cuh #define PixelTriplet_cuh +#ifdef LST_IS_CMSSW_PACKAGE +#include "RecoTracker/LSTCore/interface/alpaka/Constants.h" +#include "RecoTracker/LSTCore/interface/alpaka/Module.h" +#else #include "Constants.h" +#include "Module.h" +#endif + #include "Triplet.h" #include "Segment.h" #include "MiniDoublet.h" -#include "Module.h" #include "Hit.h" #include "Quintuplet.h" @@ -1878,10 +1884,16 @@ namespace SDL { #ifndef PixelQuintuplet_cuh #define PixelQuintuplet_cuh +#ifdef LST_IS_CMSSW_PACKAGE +#include "RecoTracker/LSTCore/interface/alpaka/Constants.h" +#include "RecoTracker/LSTCore/interface/alpaka/Module.h" +#else #include "Constants.h" +#include "Module.h" +#endif + #include "Segment.h" #include "MiniDoublet.h" -#include "Module.h" #include "Hit.h" #include "Triplet.h" #include "Quintuplet.h" diff --git a/SDL/Quintuplet.h b/SDL/Quintuplet.h index 13e34d68..894f4a71 100644 --- a/SDL/Quintuplet.h +++ b/SDL/Quintuplet.h @@ -1,12 +1,18 @@ #ifndef Quintuplet_cuh #define Quintuplet_cuh +#ifdef LST_IS_CMSSW_PACKAGE +#include "RecoTracker/LSTCore/interface/alpaka/Constants.h" +#include "RecoTracker/LSTCore/interface/alpaka/Module.h" +#else #include "Constants.h" +#include "Module.h" +#endif + #include "NeuralNetwork.h" #include "EndcapGeometry.h" #include "Segment.h" #include "MiniDoublet.h" -#include "Module.h" #include "Hit.h" #include "Triplet.h" diff --git a/SDL/Segment.h b/SDL/Segment.h index 40b61a3c..61e91eef 100644 --- a/SDL/Segment.h +++ b/SDL/Segment.h @@ -1,10 +1,16 @@ #ifndef Segment_cuh #define Segment_cuh +#ifdef LST_IS_CMSSW_PACKAGE +#include "RecoTracker/LSTCore/interface/alpaka/Constants.h" +#include "RecoTracker/LSTCore/interface/alpaka/Module.h" +#else #include "Constants.h" +#include "Module.h" +#endif + #include "EndcapGeometry.h" #include "MiniDoublet.h" -#include "Module.h" #include "Hit.h" namespace SDL { diff --git a/SDL/TiltedGeometry.h b/SDL/TiltedGeometry.h index 68d55880..578d2ca8 100644 --- a/SDL/TiltedGeometry.h +++ b/SDL/TiltedGeometry.h @@ -9,7 +9,11 @@ #include #include +#ifdef LST_IS_CMSSW_PACKAGE +#include "RecoTracker/LSTCore/interface/alpaka/Constants.h" +#else #include "Constants.h" +#endif namespace SDL { template diff --git a/SDL/TrackCandidate.h b/SDL/TrackCandidate.h index 94628a17..d6546494 100644 --- a/SDL/TrackCandidate.h +++ b/SDL/TrackCandidate.h @@ -1,13 +1,19 @@ #ifndef TrackCandidate_cuh #define TrackCandidate_cuh +#ifdef LST_IS_CMSSW_PACKAGE +#include "RecoTracker/LSTCore/interface/alpaka/Constants.h" +#include "RecoTracker/LSTCore/interface/alpaka/Module.h" +#else #include "Constants.h" +#include "Module.h" +#endif + #include "Triplet.h" #include "Segment.h" #include "MiniDoublet.h" #include "PixelTriplet.h" #include "Quintuplet.h" -#include "Module.h" #include "Hit.h" namespace SDL { diff --git a/SDL/Triplet.h b/SDL/Triplet.h index 7bb937c6..92ed04a5 100644 --- a/SDL/Triplet.h +++ b/SDL/Triplet.h @@ -1,10 +1,16 @@ #ifndef Triplet_cuh #define Triplet_cuh +#ifdef LST_IS_CMSSW_PACKAGE +#include "RecoTracker/LSTCore/interface/alpaka/Constants.h" +#include "RecoTracker/LSTCore/interface/alpaka/Module.h" +#else #include "Constants.h" +#include "Module.h" +#endif + #include "Segment.h" #include "MiniDoublet.h" -#include "Module.h" #include "Hit.h" namespace SDL {