diff --git a/macro/beamtime/mcbm2024/mcbm_event_reco_L1.C b/macro/beamtime/mcbm2024/mcbm_event_reco_L1.C index ff008712b5ae49bf335e4f23355ffa02fbc04e30..f8a71483f7ccce7db5a885fbd73f6f85f81b50d4 100644 --- a/macro/beamtime/mcbm2024/mcbm_event_reco_L1.C +++ b/macro/beamtime/mcbm2024/mcbm_event_reco_L1.C @@ -9,9 +9,9 @@ // // -------------------------------------------------------------------------- -#include <math.h> -#include <stdio.h> -#include <string.h> +#include <cmath> +#include <cstdio> +#include <string> /// FIXME: Disable clang formatting to keep easy parameters overview /* clang-format off */ @@ -427,20 +427,6 @@ Bool_t mcbm_event_reco_L1(UInt_t uRunId = 3105, Int_t stsAddress10 = CbmStsAddress::GetAddress(2, 2, 1, 1, 0, 0); // U2 L2 M1 6 cm Int_t stsAddress11 = CbmStsAddress::GetAddress(2, 2, 1, 2, 0, 0); // U2 L2 M2 6 cm - // // setup available up to sts_v22f. Available if reconstructing from tsa files (AB 14.05.2024) - // Int_t stsAddress00 = 0; - // Int_t stsAddress01 = CbmStsAddress::GetAddress(0, 0, 1, 0, 0, 0); // U0 L0 M0 6 cm - // Int_t stsAddress02 = CbmStsAddress::GetAddress(0, 0, 1, 1, 0, 0); // U0 L0 M1 6 cm - // Int_t stsAddress03 = CbmStsAddress::GetAddress(0, 1, 1, 0, 0, 0); // U0 L1 M0 6 cm - // Int_t stsAddress04 = CbmStsAddress::GetAddress(0, 1, 1, 1, 0, 0); // U0 L1 M1 6 cm - // Int_t stsAddress05 = CbmStsAddress::GetAddress(1, 0, 1, 0, 0, 0); // U1 L0 M0 6 cm - // Int_t stsAddress06 = CbmStsAddress::GetAddress(1, 0, 1, 1, 0, 0); // U1 L0 M1 12 cm - // Int_t stsAddress07 = CbmStsAddress::GetAddress(1, 1, 1, 0, 0, 0); // U1 L1 M0 6 cm - // Int_t stsAddress08 = CbmStsAddress::GetAddress(1, 1, 1, 1, 0, 0); // U1 L1 M1 12 cm - // Int_t stsAddress09 = CbmStsAddress::GetAddress(1, 2, 1, 0, 0, 0); // U1 L2 M0 6 cm - // Int_t stsAddress10 = CbmStsAddress::GetAddress(1, 2, 1, 1, 0, 0); // U1 L2 M1 6 cm - // Int_t stsAddress11 = CbmStsAddress::GetAddress(1, 2, 1, 2, 0, 0); // U1 L2 M2 6 cm - std::cout << "STS address00 " << std::dec << stsAddress00 << " " << std::hex << stsAddress00 << std::endl; std::cout << "STS address01 " << std::dec << stsAddress01 << " " << std::hex << stsAddress01 << std::endl; std::cout << "STS address02 " << std::dec << stsAddress02 << " " << std::hex << stsAddress02 << std::endl; diff --git a/macro/qa/configs/qa_tasks_config_mcbm.yaml b/macro/qa/configs/qa_tasks_config_mcbm.yaml index 42b8cec662481e105baf2ac30881f6c5bfd6fad1..610491e9673dabfba166de4571637d2f0ba93d2f 100644 --- a/macro/qa/configs/qa_tasks_config_mcbm.yaml +++ b/macro/qa/configs/qa_tasks_config_mcbm.yaml @@ -19,11 +19,15 @@ qa: pull_station_%_pull_x: false CbmCaInputQaSts: # Specific configuration, provided in the Config structure of the QA-task - specific: - PullMeanThrsh: 0.1 - PullWidthThrsh: 2.0 - EffThrsh: 0.5 - MaxDiffZStHit: 1.0 + #specific: + # McTrackCuts: + # MinMom: 0.1 # [GeV/c] + # MaxTheta: 60. # [grad] + # IsPrimary: true + # PullMeanThrsh: 0.1 + # PullWidthThrsh: 2.0 + # EffThrsh: 0.5 + # MaxDiffZStHit: 1.0 check_list: station_position_ordering: true station_position_hit_delta_z: false diff --git a/macro/qa/run_recoQa.C b/macro/qa/run_recoQa.C index b93f19c8b6e2106c34af7d810c34fc09f35d3069..a5774ec2a0f80279245f03e57f5eb6f52999798d 100644 --- a/macro/qa/run_recoQa.C +++ b/macro/qa/run_recoQa.C @@ -149,6 +149,7 @@ void run_recoQa(Int_t nEvents = -1, TString recFile = "2391_node8_0_0000.rec.roo // L1 CA track finder setup auto l1 = new CbmL1("CA"); l1->SetMcbmMode(); + // TODO: add l1->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"); diff --git a/macro/run/CMakeLists.txt b/macro/run/CMakeLists.txt index 6f12f249203d96b2ad038de8b45c60b72f42096a..b8427e5223e86809c97c5fac8fd5620cb6e32605 100644 --- a/macro/run/CMakeLists.txt +++ b/macro/run/CMakeLists.txt @@ -604,7 +604,7 @@ EndIf() # If(DEFINED ENV{RAW_DATA_PATH} ) # ============================================================================ Install(FILES .rootrc run_tra_file.C run_tra_beam.C run_digi.C run_reco.C run_qa.C run_unpack_online.C run_unpack_tsa.C create_mcbm_geo_setup.C - qa_config.cbm.yaml + run_inspect_digievents.C run_inspect_digi_timeslice.C qa_config.cbm.yaml DESTINATION share/cbmroot/macro/run ) Install(PROGRAMS run_tests.sh diff --git a/macro/run/run_inspect_digi_timeslice.C b/macro/run/run_inspect_digi_timeslice.C index 36ed95289cc553af13bf0d2bbb78e70c143798db..83607a31a9fb0ddf0516edc6537acb56403f666f 100644 --- a/macro/run/run_inspect_digi_timeslice.C +++ b/macro/run/run_inspect_digi_timeslice.C @@ -13,6 +13,7 @@ #if !defined(__CLING__) #include "CbmSourceDigiTimeslice.h" #include "CbmTaskInspectDigiEvents.h" +#include "CbmTsEventHeader.h" #include <FairRunAna.h> #include <FairSystemInfo.h> @@ -55,6 +56,7 @@ void run_inspect_digi_timeslice(TString inputFileName, TString outputFileName, U // ----- FairRunAna --------------------------------------------------- FairRunOnline* run = new FairRunOnline(); + run->SetEventHeader(new CbmTsEventHeader{}); FairSource* source = new CbmSourceDigiTimeslice(inputFileName); run->SetSource(source); auto sink = new FairRootFileSink(outputFileName); diff --git a/reco/L1/CbmCaMCModule.h b/reco/L1/CbmCaMCModule.h index d2cb8ed62e068f20ed037c55c697ed86cdf4f136..a7c6eb2f4af3eefc437a46f6cafc91e9e0abfe7b 100644 --- a/reco/L1/CbmCaMCModule.h +++ b/reco/L1/CbmCaMCModule.h @@ -399,6 +399,7 @@ namespace cbm::ca // ----- Reject MC points falling out of the time slice // STS, MuCh, TRD, TOF if constexpr (DetID != ca::EDetectorID::kMvd) { + // TODO: SZh 18.06.2024: Avoid dependency from CbmTimeSlice, if possible (no TimeSlice branch in the online unpack) double startT = fpTimeSlice->GetStartTime(); double endT = fpTimeSlice->GetEndTime(); diff --git a/reco/steer/CbmSourceDigiTimeslice.cxx b/reco/steer/CbmSourceDigiTimeslice.cxx index d01d7d77e2684224d9acec326707fc72dcee8b5a..f2d9479a9493cec6bfbe431f7ad5dd723dede39a 100644 --- a/reco/steer/CbmSourceDigiTimeslice.cxx +++ b/reco/steer/CbmSourceDigiTimeslice.cxx @@ -4,7 +4,11 @@ #include "CbmSourceDigiTimeslice.h" +#include "CbmTimeSlice.h" +#include "CbmTsEventHeader.h" + #include <FairRootManager.h> +#include <FairRun.h> #include <Logger.h> #include <utility> @@ -59,6 +63,26 @@ Bool_t CbmSourceDigiTimeslice::Init() FairRootManager* ioman = FairRootManager::Instance(); assert(ioman); + 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; + //} + + // TimeSlice. branch initialization + if (ioman->GetObject("TimeSlice.")) { + LOG(fatal) << "Source: Branch TimeSlice. already exists!"; + return kFALSE; + } + else { + // NOTE: the max time of timeslice is 1.28e8, taken from CbmRecoUnpack.cxx + fTimeslice = new CbmTimeSlice(0., 1.28e8 + 1.28e6); + ioman->Register("TimeSlice.", "DAQ", fTimeslice, kTRUE); + } + fBmonDigis = new std::vector<CbmBmonDigi>(); if (kFALSE == RegisterVector<CbmBmonDigi>(ioman, fBmonDigis)) { return kFALSE; @@ -134,6 +158,11 @@ 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()); + + fTimeslice->SetStartTime(results->TsStartTime()); + std::move(results->BmonDigis().begin(), results->BmonDigis().end(), std::back_inserter(*fBmonDigis)); std::move(results->StsDigis().begin(), results->StsDigis().end(), std::back_inserter(*fStsDigis)); std::move(results->MuchDigis().begin(), results->MuchDigis().end(), std::back_inserter(*fMuchDigis)); diff --git a/reco/steer/CbmSourceDigiTimeslice.h b/reco/steer/CbmSourceDigiTimeslice.h index e9dc667630b3aaf120e520d7e22bf767bfd1da91..023cf816b21e0adfed30d66e4e2cd86a5786cfd7 100644 --- a/reco/steer/CbmSourceDigiTimeslice.h +++ b/reco/steer/CbmSourceDigiTimeslice.h @@ -14,6 +14,8 @@ #include <string> #include <vector> +class CbmTimeSlice; +class CbmTsEventHeader; class FairRootManager; /** @class CbmSourceDigiTimeslice @@ -102,6 +104,15 @@ class CbmSourceDigiTimeslice : public FairSource { **/ Source_Type fSourceType = Source_Type::kONLINE; + /** Time-slice header (old version) + * @remark The CbmTimeSlice class is about to be deprecated, one should use the CbmTsEventHeader class instead. + **/ + CbmTimeSlice* fTimeslice = nullptr; + + /** Time-slice event header **/ + CbmTsEventHeader* fTsEventHeader = nullptr; + + /** Time-slice counter **/ size_t fNumTs = 0;