diff --git a/algo/ca/core/CMakeLists.txt b/algo/ca/core/CMakeLists.txt index b255a4bfdb7436a96d8393efbbcd8dd86513603f..5d1b64b61810191ffe2bc5feba0d5b36f23e4043 100644 --- a/algo/ca/core/CMakeLists.txt +++ b/algo/ca/core/CMakeLists.txt @@ -78,55 +78,55 @@ install(DIRECTORY pars TYPE INCLUDE FILES_MATCHING PATTERN "*.h") install( FILES - data/CaDataManager.h - data/CaGridEntry.h - data/CaHit.h - data/CaInputData.h - data/CaTrackParam.h - data/CaTrack.h - data/CaMeasurementU.h - data/CaMeasurementXy.h - data/CaMeasurementTime.h - data/CaWindowData.h - pars/CaConfigReader.h - data/CaGridEntry.h - data/CaGrid.h - data/CaGridArea.h - data/CaTriplet.h - data/CaBranch.h - data/CaWindowData.h - data/CaTimesliceHeader.h - pars/CaConstants.h - pars/CaField.h - pars/CaInitManager.h - pars/CaIteration.h - pars/CaMaterialMap.h - pars/CaMaterialMonitor.h - pars/CaParameters.h - pars/CaSearchWindow.h - pars/CaStation.h - pars/CaStationInitializer.h + #data/CaDataManager.h + #data/CaGridEntry.h + #data/CaHit.h + #data/CaInputData.h + #data/CaTrackParam.h + #data/CaTrack.h + #data/CaMeasurementU.h + #data/CaMeasurementXy.h + #data/CaMeasurementTime.h + #data/CaWindowData.h + #pars/CaConfigReader.h + #data/CaGridEntry.h + #data/CaGrid.h + #data/CaGridArea.h + #data/CaTriplet.h + #data/CaBranch.h + #data/CaWindowData.h + #data/CaTimesliceHeader.h + #pars/CaConstants.h + #pars/CaField.h + #pars/CaInitManager.h + #pars/CaIteration.h + #pars/CaMaterialMap.h + #pars/CaMaterialMonitor.h + #pars/CaParameters.h + #pars/CaSearchWindow.h + #pars/CaStation.h + #pars/CaStationInitializer.h - utils/CaTrackingMonitor.h - utils/CaEnumArray.h - utils/CaMonitor.h - utils/CaMonitorData.h - utils/CaObjectInitController.h - utils/CaSimd.h - utils/CaSimdVc.h - utils/CaSimdPseudo.h - utils/CaTimer.h - utils/CaVector.h - utils/CaUtils.h - utils/CaDefines.h - tracking/CaCloneMerger.h - tracking/CaFramework.h - tracking/CaTrackExtender.h - tracking/CaTrackFinder.h - tracking/CaTrackFinderWindow.h - tracking/CaTrackFit.h - tracking/CaTrackFitter.h - tracking/CaTripletConstructor.h + #utils/CaTrackingMonitor.h + #utils/CaEnumArray.h + #utils/CaMonitor.h + #utils/CaMonitorData.h + #utils/CaObjectInitController.h + #utils/CaSimd.h + #utils/CaSimdVc.h + #utils/CaSimdPseudo.h + #utils/CaTimer.h + #utils/CaVector.h + #utils/CaUtils.h + #utils/CaDefines.h + #tracking/CaCloneMerger.h + #tracking/CaFramework.h + #tracking/CaTrackExtender.h + #tracking/CaTrackFinder.h + #tracking/CaTrackFinderWindow.h + #tracking/CaTrackFit.h + #tracking/CaTrackFitter.h + #tracking/CaTripletConstructor.h DESTINATION include/ ) diff --git a/algo/ca/core/data/CaTrack.h b/algo/ca/core/data/CaTrack.h index c1ed2828012608c47cf984ab8eb0b2f1577ca6a1..6c623a9533e5a5ccd14d1651c0ba4d4182a11c86 100644 --- a/algo/ca/core/data/CaTrack.h +++ b/algo/ca/core/data/CaTrack.h @@ -7,7 +7,8 @@ /// \since 02.06.2022 /// \author S.Zharko <s.zharko@gsi.de> -#pragma once // include this header only once per compilation unit +#ifndef CA_CORE_CaTrack_h +#define CA_CORE_CaTrack_h 1 #include "CaConstants.h" #include "CaSimd.h" @@ -47,3 +48,5 @@ namespace cbm::algo::ca }; } // namespace cbm::algo::ca + +#endif // CA_CORE_CaTrack_h diff --git a/algo/ca/core/data/CaTrackParam.h b/algo/ca/core/data/CaTrackParam.h index 8dbc71b78d008f4e08ec3cc1c555a5952582afb4..1e3f859fbd204419bbfb1fd5855ec5a9061aa78b 100644 --- a/algo/ca/core/data/CaTrackParam.h +++ b/algo/ca/core/data/CaTrackParam.h @@ -8,7 +8,8 @@ /// \since 02.06.2022 /// \author Sergey Gorbunov -#pragma once // include this header only once per compilation unit +#ifndef CA_CORE_CaTrackParam_h +#define CA_CORE_CaTrackParam_h 1 #include "CaConstants.h" #include "CaSimd.h" @@ -759,3 +760,5 @@ namespace cbm::algo::ca } } // namespace cbm::algo::ca + +#endif // CA_CORE_CaTrackParam_h diff --git a/algo/ca/core/utils/CaVector.h b/algo/ca/core/utils/CaVector.h index de24b82564d7f8e084fd68c76495e101da9817d8..16fee44c40f0ccb15a052db5a5a6bbd557b99b82 100644 --- a/algo/ca/core/utils/CaVector.h +++ b/algo/ca/core/utils/CaVector.h @@ -6,8 +6,10 @@ /// \author Sergey Gorbunov /// \date 2021-06-16 -#pragma once // include this header only once per compilation unit +//#pragma once // include this header only once per compilation unit (not robust) +#ifndef CA_CORE_CaVector_h +#define CA_CORE_CaVector_h 1 #ifndef FAST_CODE #include "AlgoFairloggerCompat.h" @@ -295,3 +297,5 @@ namespace cbm::algo::ca class Vector<bool> { }; } // namespace cbm::algo::ca + +#endif // CA_CORE_CaVector_h diff --git a/macro/qa/run_recoQa.C b/macro/qa/run_recoQa.C index a5774ec2a0f80279245f03e57f5eb6f52999798d..141ea7d536fafd40394071fa95643764824a24f9 100644 --- a/macro/qa/run_recoQa.C +++ b/macro/qa/run_recoQa.C @@ -147,13 +147,14 @@ void run_recoQa(Int_t nEvents = -1, TString recFile = "2391_node8_0_0000.rec.roo //pCaOutputQa->ReadParameters(caParFile.Data()); // L1 CA track finder setup - auto l1 = new CbmL1("CA"); - l1->SetMcbmMode(); - // TODO: add l1->SetInitMode(CbmL1::EInitMode::Param), after !1862 will be merged + auto pCa = new CbmL1("CA"); + pCa->SetInitMode(CbmL1::EInitMode::Param); + pCa->SetMcbmMode(); + // TODO: add pCa->SetInitMode(CbmL1::EInitMode::Param), after !1862 will be merged // User configuration example for CA: - //l1->SetConfigUser(srcDir + "/macro/L1/configs/ca_params_user_example.yaml"); - run->AddTask(l1); + //pCa->SetConfigUser(srcDir + "/macro/L1/configs/ca_params_user_example.yaml"); + run->AddTask(pCa); // ----- Reco QA -------------------------------------------- CbmRecoQaTask::Detector* det(nullptr); diff --git a/reco/L1/CbmL1.cxx b/reco/L1/CbmL1.cxx index 493e306ea0f41d3e9971524e9d014aa0c9edeed7..a2d72bd140ba02da0aad2bf5a4a4595f6df6f2df 100644 --- a/reco/L1/CbmL1.cxx +++ b/reco/L1/CbmL1.cxx @@ -519,6 +519,11 @@ try { } } + if (fInitMode == EInitMode::Param) { + auto parameters = fInitManager.TakeParameters(); + LOG(info) << '\n' << parameters.ToString(1); + return kSUCCESS; + } // Init L1 algo core @@ -962,7 +967,9 @@ void CbmL1::DefineSTAPNames(const char* dirName) // void CbmL1::WriteSTAPParamObject() { - TString filename = fSTAPDataDir + "/" + fSTAPDataPrefix + "." + TString(kSTAPParamSuffix.data()); + TString filename = fSTAPParamFile.IsNull() + ? fSTAPDataDir + "/" + fSTAPDataPrefix + "." + TString(kSTAPParamSuffix.data()) + : fSTAPParamFile; fInitManager.WriteParametersObject(filename.Data()); } diff --git a/reco/L1/CbmL1.h b/reco/L1/CbmL1.h index f488fddca823fc7a9f315f1f3f6ccbcdf618f780..76bde7f9730f38c549eb78b678ab8d6b6217427c 100644 --- a/reco/L1/CbmL1.h +++ b/reco/L1/CbmL1.h @@ -125,6 +125,11 @@ class CbmL1 : public FairTask { friend class CbmL1MCTrack; friend class CbmL1PFFitter; + enum class EInitMode + { + Full, ///< Full initialization (default) + Param ///< Parameter initialization (when algorithm execution is not required) + }; // ********************************** // ** Member functions declaration ** @@ -190,6 +195,10 @@ class CbmL1 : public FairTask { /// Possible entries of Detector ID are listed in CbmL1DetectorID.h. void DisableTrackingStation(ca::EDetectorID detID, int iSt); + /// \brief Sets initialization mode + /// \param mode A CbmL1::EInitMode enumeration entry + void SetInitMode(EInitMode mode) { fInitMode = mode; } + /// Sets safe but slow material initialisation to get around potential problems in TGeoVoxelFinder /// (use it only in case of a crash at the initialisation of material maps) void SetSafeMaterialInitialization(bool val = true) { fDoSafeMaterialInitialization = val; } @@ -221,6 +230,10 @@ class CbmL1 : public FairTask { /// \param filename Name of the input tracking configuration file void SetOutputConfigName(const char* filename) { fInitManager.SetOutputConfigName(std::string(filename)); } + /// \brief Sets a name for the ca-parameter file + /// \param filename Name of the parameter file + void SetParameterFilename(const char* filename) { fSTAPParamFile = TString(filename); } + /// \brief Sets output file for MC triplets tree /// If the filename is empty string, tree is not filled /// \param filename Name of the output file name @@ -456,8 +469,8 @@ class CbmL1 : public FairTask { int fSTAPDataMode = 4; ///< Option to work with files for the standalone mode TString fSTAPDataDir = "."; ///< Name of input/output directory for running in a STAP mode - TString fSTAPDataPrefix = "test"; ///< Name of input/output file prefix. The prefix is defined by output TTree file + TString fSTAPParamFile = ""; ///< Name of the parameter file (generated automatically, if not provided manually) /// Extension for IO of the L1Parameters object static constexpr std::string_view kSTAPParamSuffix = "ca.par"; @@ -522,6 +535,8 @@ class CbmL1 : public FairTask { int fMatBudgetNrays{3}; ///< material budget n rays per dimansion in each bin double fMatBudgetPitch{0.1}; ///< material budget minimal bin size in cm + EInitMode fInitMode = EInitMode::Full; ///< Initialization mode + bool fMatBudgetParallelProjection{false}; ///< Calculate material budget with rays, parallel to Z axis ///< Only needed in debug mode to produce detailed picture of the material diff --git a/reco/steer/CbmSourceDigiTimeslice.cxx b/reco/steer/CbmSourceDigiTimeslice.cxx index f2d9479a9493cec6bfbe431f7ad5dd723dede39a..780d1d25e12727cd3ff76252ae4315e8c802d5cc 100644 --- a/reco/steer/CbmSourceDigiTimeslice.cxx +++ b/reco/steer/CbmSourceDigiTimeslice.cxx @@ -65,12 +65,12 @@ Bool_t CbmSourceDigiTimeslice::Init() auto* pEvtHeader = FairRun::Instance()->GetEventHeader(); - //if (!(fTsEventHeader = dynamic_cast<CbmTsEventHeader*>(FairRun::Instance()->GetEventHeader()))) { - // LOG(fatal) - // << "CbmSourceDigiTimeslice::Init() no CbmTsEventHeader was added to the run. Without it, we can not store the UTC of the " - // "Timeslices correctly. Hence, this causes a fatal. Please add it in the steering macro to the Run."; - // return kFALSE; - //} + if (!(fTsEventHeader = dynamic_cast<CbmTsEventHeader*>(FairRun::Instance()->GetEventHeader()))) { + LOG(fatal) << "CbmSourceDigiTimeslice::Init() no CbmTsEventHeader was added to the run. Without it, we can not " + "store the UTC of the " + "Timeslices correctly. Hence, this causes a fatal. Please add it in the steering macro to the Run."; + return kFALSE; + } // TimeSlice. branch initialization if (ioman->GetObject("TimeSlice.")) { @@ -158,8 +158,8 @@ Int_t CbmSourceDigiTimeslice::ReadEvent(UInt_t) /// FIXME: Add PSD and FSD to the output of RawDigis in algo/global and reco/app // << " PSD=" << results->StsDigis().size() << " FSD=" << results->StsDigis().size(); - //fTsEventHeader->SetTsIndex(results->TsIndex()); - //fTsEventHeader->SetTsStartTime(results->TsStartTime()); + fTsEventHeader->SetTsIndex(results->TsIndex()); + fTsEventHeader->SetTsStartTime(results->TsStartTime()); fTimeslice->SetStartTime(results->TsStartTime());