From fb4b0df244056cbe2f0cf66765d416f53e4298aa Mon Sep 17 00:00:00 2001 From: jose-luis-rs Date: Sat, 3 Jan 2026 14:43:14 +0100 Subject: [PATCH] feat(r3bsource/alpide):Added new data structure for 202507 beamtime Update alpide r3bsource classes Minor change Minor change Minor change Added more sensorIds Update alpide classes for SFRS beamtime Minor change Minor change Added positions for the experiments performed in 2025 Minor change --- alpide/calibration/R3BAlpideCal2Hit.cxx | 156 ++++++++++++-- alpide/calibration/R3BAlpideCal2Hit.h | 4 +- alpide/calibration/R3BAlpideMapped2Cal.cxx | 18 +- alpide/calibration/R3BAlpideMapped2Cal.h | 10 +- r3bsource/CMakeLists.txt | 3 +- r3bsource/SourceLinkDef.h | 3 +- r3bsource/alpide/R3BMosaicReader.cxx | 101 ++++++++- r3bsource/alpide/R3BMosaicReader.h | 15 +- r3bsource/alpide/ext_h101_mosaic202506.h | 2 +- r3bsource/alpide/ext_h101_mosaic202507.h | 239 +++++++++++++++++++++ 10 files changed, 500 insertions(+), 51 deletions(-) create mode 100644 r3bsource/alpide/ext_h101_mosaic202507.h diff --git a/alpide/calibration/R3BAlpideCal2Hit.cxx b/alpide/calibration/R3BAlpideCal2Hit.cxx index 9fd580ef5..5e61476f9 100644 --- a/alpide/calibration/R3BAlpideCal2Hit.cxx +++ b/alpide/calibration/R3BAlpideCal2Hit.cxx @@ -1,6 +1,6 @@ /****************************************************************************** * Copyright (C) 2022 GSI Helmholtzzentrum für Schwerionenforschung GmbH * - * Copyright (C) 2022-2025 Members of R3B Collaboration * + * Copyright (C) 2022-2026 Members of R3B Collaboration * * * * This software is distributed under the terms of the * * GNU General Public Licence (GPL) version 3, * @@ -459,6 +459,68 @@ void R3BAlpideCal2Hit::FindClustersDefault() localpos.Y()); } } + else if (fGeoversion == 202507) + { + for (size_t s = 0; s < fNbSensors; s++) + for (size_t i = 0; i < nHits; i++) + if (mult[s][i] > 0) + { + nbcluster++; + + TVector3 localpos; + localpos.SetXYZ(meancol[s][i] / double(mult[s][i]) * fPixelSize_ls, + meanrow[s][i] / double(mult[s][i]) * fPixelSize_ss, + 0.0); + + TVector3 labpos; + + double Z_flex1 = 0.; + + double Z_flex2 = 7.; + + double Z_flex3 = 14.; + + // Mosaic-3 + if (s < 3) + labpos.SetXYZ(-45. + localpos.X() + 30. * s, -localpos.Y(), Z_flex1); + else if (s < 6) + labpos.SetXYZ(45. - localpos.X() - 30. * (s - 3), localpos.Y(), Z_flex1); + // Mosaic-4 + else if (s < 9) + labpos.SetXYZ(-45. + localpos.X() + 30. * s, -localpos.Y(), Z_flex1); + else if (s < 12) + labpos.SetXYZ(45. - localpos.X() - 30. * (s - 3), localpos.Y(), Z_flex1); + // Mosaic-5 + else if (s < 15) + labpos.SetXYZ(-45. + localpos.X() + 30. * s, -localpos.Y(), Z_flex2); + else if (s < 18) + labpos.SetXYZ(45. - localpos.X() - 30. * (s - 3), localpos.Y(), Z_flex2); + // Mosaic-9 + else if (s < 21) + labpos.SetXYZ(-45. + localpos.X() + 30. * s, -localpos.Y(), Z_flex2); + else if (s < 24) + labpos.SetXYZ(45. - localpos.X() - 30. * (s - 3), localpos.Y(), Z_flex2); + // Mosaic-10 + else if (s < 27) + labpos.SetXYZ(-45. + localpos.X() + 30. * s, -localpos.Y(), Z_flex3); + else + labpos.SetXYZ(45. - localpos.X() - 30. * (s - 3), localpos.Y(), Z_flex3); + + AddHitData(s + 1, + mult[s][i], + 0, + 0, + nullMajor, + 0, + 0, + nullHu, + labpos.X(), + labpos.Y(), + labpos.Z(), + localpos.X(), + localpos.Y()); + } + } R3BLOG(debug, "Number of clusters: " << nbcluster); return; @@ -467,21 +529,21 @@ void R3BAlpideCal2Hit::FindClustersDefault() // ----- Alternatvie methods: Flood fill --------------------------- void R3BAlpideCal2Hit::FindClustersFloodFill() { - Int_t nHits = fAlpideCluster->GetEntriesFast(); + auto nHits = fAlpideCluster->GetEntriesFast(); if (nHits == 0) return; - std::map>> sensorPixels; - for (Int_t i = 0; i < nHits; i++) + std::map>> sensorPixels; + for (auto i = 0; i < nHits; i++) { auto cluster = dynamic_cast(fAlpideCluster->At(i)); - Int_t sen = cluster->GetSensorId() - 1; + auto sen = cluster->GetSensorId() - 1; sensorPixels[sen].emplace_back(cluster->GetCol(), cluster->GetRow()); } for (auto& sp : sensorPixels) { - Int_t senId = sp.first; + auto senId = sp.first; auto& pixels = sp.second; // Determine bounds with padding @@ -493,8 +555,8 @@ void R3BAlpideCal2Hit::FindClustersFloodFill() minRow = std::min(minRow, p.second); maxRow = std::max(maxRow, p.second); } - Int_t nCols = maxCol - minCol + 3; - Int_t nRows = maxRow - minRow + 3; + auto nCols = maxCol - minCol + 3; + auto nRows = maxRow - minRow + 3; std::vector> map(nCols, std::vector(nRows, false)); std::vector> visited(nCols, std::vector(nRows, false)); @@ -502,8 +564,8 @@ void R3BAlpideCal2Hit::FindClustersFloodFill() map[p.first - minCol + 1][p.second - minRow + 1] = true; // Flood-fill function - std::function>&)> fill; - fill = [&](Int_t x, Int_t y, std::vector>& clusterPixels) + std::function>&)> fill; + fill = [&](int x, int y, std::vector>& clusterPixels) { if (x < 0 || x >= nCols || y < 0 || y >= nRows) return; @@ -518,14 +580,14 @@ void R3BAlpideCal2Hit::FindClustersFloodFill() }; // Process all pixels - for (Int_t x = 0; x < nCols; x++) + for (auto x = 0; x < nCols; x++) { - for (Int_t y = 0; y < nRows; y++) + for (auto y = 0; y < nRows; y++) { if (!map[x][y] || visited[x][y]) continue; - std::vector> clusterPixels; + std::vector> clusterPixels; fill(x, y, clusterPixels); // ================== Hole Detection ================== @@ -782,6 +844,29 @@ void R3BAlpideCal2Hit::FindClustersFloodFill() else labUnit.SetXYZ(+localUnit.X(), +localUnit.Y(), 0.0); } + else if (fGeoversion == 202507) + { + if (senId < 3) + labUnit.SetXYZ(localUnit.X(), localUnit.Y(), 0.0); + else if (senId < 6) + labUnit.SetXYZ(-localUnit.X(), -localUnit.Y(), 0.0); + else if (senId < 9) + labUnit.SetXYZ(localUnit.X(), localUnit.Y(), 0.0); + else if (senId < 12) + labUnit.SetXYZ(-localUnit.X(), -localUnit.Y(), 0.0); + else if (senId < 15) + labUnit.SetXYZ(localUnit.X(), localUnit.Y(), 0.0); + else if (senId < 18) + labUnit.SetXYZ(-localUnit.X(), -localUnit.Y(), 0.0); + else if (senId < 21) + labUnit.SetXYZ(localUnit.X(), localUnit.Y(), 0.0); + else if (senId < 24) + labUnit.SetXYZ(-localUnit.X(), -localUnit.Y(), 0.0); + else if (senId < 27) + labUnit.SetXYZ(localUnit.X(), localUnit.Y(), 0.0); + else + labUnit.SetXYZ(-localUnit.X(), -localUnit.Y(), 0.0); + } // Protect from NaN && Inf ->Set to non physical units where possible for later analysis. if (!std::isfinite(localUnit.X())) @@ -958,14 +1043,51 @@ void R3BAlpideCal2Hit::FindClustersFloodFill() } else if (fGeoversion == 202506) { + const double Z_alpide1 = -1732.88; + const double Z_alpide2 = -1659.88; + + const double z1_off = -0.837843; + const double z2_off = -2.69759; + + const double rx = 0.0225419; + const double ry = 0.0137131; + const double rz[12] = { 0.00595207, 0.00815014, 0.0102531, 0.00857714, 0.00909736, 0.0015223, + 0.0133541, 0.00969408, 0.0134827, 0.000125173, 0.00982907, 0.021181 }; + + array pos_offset = { + TVector3(0.231386, 0.18477, z1_off), TVector3(0.03624, 0.0145723, z1_off), + TVector3(-0.162212, -0.217339, z1_off), TVector3(-0.157992, -0.31182, z1_off), + TVector3(0.0596373, -0.07224198, z1_off), TVector3(0.2458, 0.131979, z1_off), + TVector3(0.713162, 0.203712, z2_off), TVector3(0.5620141, -0.18166828, z2_off), + TVector3(0.316365, -0.445912, z2_off), TVector3(0.323927, -0.298097, z2_off), + TVector3(0.5504176, -0.2855743, z2_off), TVector3(0.781553, -0.0369948, z2_off) + }; + + TRotation Rloc; + Rloc.RotateZ(rz[senId]); + TVector3 local_rot = Rloc * localpos; + if (senId < 3) - labpos.SetXYZ(45. - localpos.X() - 30. * senId, -localpos.Y(), 0.); + labpos.SetXYZ(45. - local_rot.X() - 30. * senId, -local_rot.Y(), Z_alpide1); else if (senId < 6) - labpos.SetXYZ(-45. + localpos.X() + 30. * (senId - 3), localpos.Y(), 0.); + labpos.SetXYZ(-45. + local_rot.X() + 30. * (senId - 3), local_rot.Y(), Z_alpide1); else if (senId < 9) - labpos.SetXYZ(45. - localpos.X() - 30. * (senId - 6), -localpos.Y(), 73.); + labpos.SetXYZ(45. - local_rot.X() - 30. * (senId - 6), -local_rot.Y(), Z_alpide2); + else + labpos.SetXYZ(-45. + local_rot.X() + 30. * (senId - 9), local_rot.Y(), Z_alpide2); + + TVector3 center; + if (senId < 6) + center.SetXYZ(0., 0., Z_alpide1); else - labpos.SetXYZ(-45. + localpos.X() + 30. * (senId - 9), localpos.Y(), 73.); + center.SetXYZ(0., 0., Z_alpide2); + + TRotation R; + R.RotateX(rx); + R.RotateY(ry); + + labpos = R * (labpos - center) + center; + labpos += pos_offset[senId]; } if (std::isnan(elongation) || std::isinf(elongation)) diff --git a/alpide/calibration/R3BAlpideCal2Hit.h b/alpide/calibration/R3BAlpideCal2Hit.h index 6e514049e..b5687e7aa 100644 --- a/alpide/calibration/R3BAlpideCal2Hit.h +++ b/alpide/calibration/R3BAlpideCal2Hit.h @@ -1,6 +1,6 @@ /****************************************************************************** * Copyright (C) 2022 GSI Helmholtzzentrum für Schwerionenforschung GmbH * - * Copyright (C) 2022-2025 Members of R3B Collaboration * + * Copyright (C) 2022-2026 Members of R3B Collaboration * * * * This software is distributed under the terms of the * * GNU General Public Licence (GPL) version 3, * @@ -58,7 +58,7 @@ class R3BAlpideCal2Hit : public FairTask InitStatus ReInit() override; // Method to setup online mode - inline void SetOnline(bool option = true) { fOnline = option; } + void SetOnline(bool option = true) { fOnline = option; } void SetAlgorithm(const std::string& algo) { fAlgorithm = algo; } diff --git a/alpide/calibration/R3BAlpideMapped2Cal.cxx b/alpide/calibration/R3BAlpideMapped2Cal.cxx index 782358839..fd03e63cc 100644 --- a/alpide/calibration/R3BAlpideMapped2Cal.cxx +++ b/alpide/calibration/R3BAlpideMapped2Cal.cxx @@ -1,6 +1,6 @@ /****************************************************************************** * Copyright (C) 2022 GSI Helmholtzzentrum für Schwerionenforschung GmbH * - * Copyright (C) 2022-2024 Members of R3B Collaboration * + * Copyright (C) 2022-2026 Members of R3B Collaboration * * * * This software is distributed under the terms of the * * GNU General Public Licence (GPL) version 3, * @@ -136,22 +136,6 @@ void R3BAlpideMapped2Cal::Exec(Option_t*) return; } -// ----- Private method GetCol ----------------------------------------------- -int R3BAlpideMapped2Cal::GetCol(int reg, int dcol, int ads) -{ - int col = reg * 32 + dcol * 2; - int lr = ((ads % 4) < 2 ? 1 : 0); - col += lr; - return col; -} - -// ----- Private method GetRow ----------------------------------------------- -int R3BAlpideMapped2Cal::GetRow(int ads) -{ - // This is OK for pixels within a group of 4 - return ads / 2; -} - // ----- Public method Reset ------------------------------------------------ void R3BAlpideMapped2Cal::Reset() { diff --git a/alpide/calibration/R3BAlpideMapped2Cal.h b/alpide/calibration/R3BAlpideMapped2Cal.h index 71716adad..a7c76e7c0 100644 --- a/alpide/calibration/R3BAlpideMapped2Cal.h +++ b/alpide/calibration/R3BAlpideMapped2Cal.h @@ -1,6 +1,6 @@ /****************************************************************************** * Copyright (C) 2022 GSI Helmholtzzentrum für Schwerionenforschung GmbH * - * Copyright (C) 2022-2024 Members of R3B Collaboration * + * Copyright (C) 2022-2026 Members of R3B Collaboration * * * * This software is distributed under the terms of the * * GNU General Public Licence (GPL) version 3, * @@ -54,16 +54,14 @@ class R3BAlpideMapped2Cal : public FairTask InitStatus ReInit() override; // Method to setup online mode - inline void SetOnline(bool option) { fOnline = option; } + void SetOnline(bool option = true) { fOnline = option; } private: void SetParameter(); - int GetCol(int reg, int dcol, int ads); - int GetRow(int ads); bool fOnline = false; // Don't store data for online - R3BAlpideMappingPar* fMap_Par = nullptr; /**< Parameter container. >*/ + R3BAlpideMappingPar* fMap_Par = nullptr; // Parameter container TClonesArray* fAlpideMappedData = nullptr; // Array with Alpide Mapped input data TClonesArray* fAlpideCalData = nullptr; // Array with Alpide Cal output data @@ -72,5 +70,5 @@ class R3BAlpideMapped2Cal : public FairTask public: // Class definition - ClassDefOverride(R3BAlpideMapped2Cal, 1) + ClassDefOverride(R3BAlpideMapped2Cal, 1); // NOLINT }; diff --git a/r3bsource/CMakeLists.txt b/r3bsource/CMakeLists.txt index 3868e70b5..e7240db6c 100644 --- a/r3bsource/CMakeLists.txt +++ b/r3bsource/CMakeLists.txt @@ -1,6 +1,6 @@ ############################################################################## # Copyright (C) 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH # -# Copyright (C) 2019-2025 Members of R3B Collaboration # +# Copyright (C) 2019-2026 Members of R3B Collaboration # # # # This software is distributed under the terms of the # # GNU General Public Licence (GPL) version 3, # @@ -170,6 +170,7 @@ set(STRUCT_HEADERS alpide/ext_h101_alpide.h alpide/ext_h101_mosaic202402.h alpide/ext_h101_mosaic202506.h + alpide/ext_h101_mosaic202507.h alpide/ext_h101_hmp.h music/ext_h101_music.h twim/ext_h101_twim.h diff --git a/r3bsource/SourceLinkDef.h b/r3bsource/SourceLinkDef.h index 47b8d3753..75c052e46 100644 --- a/r3bsource/SourceLinkDef.h +++ b/r3bsource/SourceLinkDef.h @@ -2,7 +2,7 @@ /****************************************************************************** * Copyright (C) 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH * - * Copyright (C) 2019-2025 Members of R3B Collaboration * + * Copyright (C) 2019-2026 Members of R3B Collaboration * * * * This software is distributed under the terms of the * * GNU General Public Licence (GPL) version 3, * @@ -148,6 +148,7 @@ #pragma link C++ class EXT_STR_h101_SYNC_CHECK_t; #pragma link C++ class EXT_STR_h101_MOSAIC202402_onion_t; #pragma link C++ class EXT_STR_h101_MOSAIC202506_onion_t; +#pragma link C++ class EXT_STR_h101_MOSAIC202507_onion_t; #pragma link C++ class EXT_STR_h101_HMP_onion_t; #pragma link C++ class EXT_STR_h101_ACTAF2023_onion_t; #pragma link C++ class EXT_STR_h101_ACTAF2025_onion_t; diff --git a/r3bsource/alpide/R3BMosaicReader.cxx b/r3bsource/alpide/R3BMosaicReader.cxx index f5345d2db..36b97a1ad 100644 --- a/r3bsource/alpide/R3BMosaicReader.cxx +++ b/r3bsource/alpide/R3BMosaicReader.cxx @@ -1,6 +1,6 @@ /****************************************************************************** * Copyright (C) 2024 GSI Helmholtzzentrum für Schwerionenforschung GmbH * - * Copyright (C) 2024-2025 Members of R3B Collaboration * + * Copyright (C) 2024-2026 Members of R3B Collaboration * * * * This software is distributed under the terms of the * * GNU General Public Licence (GPL) version 3, * @@ -32,6 +32,7 @@ extern "C" #include "ext_data_client.h" #include "ext_h101_mosaic202402.h" #include "ext_h101_mosaic202506.h" +#include "ext_h101_mosaic202507.h" } R3BMosaicReader::R3BMosaicReader(EXT_STR_h101_MOSAIC202402_onion* data, size_t offset) @@ -53,6 +54,16 @@ R3BMosaicReader::R3BMosaicReader(EXT_STR_h101_MOSAIC202506_onion* data, size_t o { } +R3BMosaicReader::R3BMosaicReader(EXT_STR_h101_MOSAIC202507_onion* data, size_t offset) + : R3BReader("R3BMosaicReader") + , fData2507(data) + , fOffset(offset) + , fArray(new TClonesArray("R3BAlpideMappedData")) + , fArray_TS(new TClonesArray("R3BWRData")) + , fVersion(UnpackerMosaicVersion::v202507) +{ +} + R3BMosaicReader::~R3BMosaicReader() { if (fArray) @@ -80,12 +91,17 @@ Bool_t R3BMosaicReader::Init(ext_data_struct_info* a_struct_info) EXT_STR_h101_MOSAIC202506_ITEMS_INFO(okay, *a_struct_info, fOffset, EXT_STR_h101_MOSAIC202506, 0); memset(fData2506, 0, sizeof(*fData2506)); } + else if (fVersion == UnpackerMosaicVersion::v202507) + { + EXT_STR_h101_MOSAIC202507_ITEMS_INFO(okay, *a_struct_info, fOffset, EXT_STR_h101_MOSAIC202507, 0); + memset(fData2507, 0, sizeof(*fData2507)); + } R3BLOG_IF(fatal, !okay, "Failed to setup structure information."); // Register output array in tree FairRootManager::Instance()->Register("AlpideMappedData", "ALPIDE_Map", fArray, !fOnline); - FairRootManager::Instance()->Register("WRAlpideData", "WRAlpide", fArray_TS, true); + FairRootManager::Instance()->Register("WRAlpideData", "WRAlpide", fArray_TS, !fOnline); Reset(); return kTRUE; @@ -103,6 +119,10 @@ Bool_t R3BMosaicReader::R3BRead() { return R3BRead202506(); } + else if (fVersion == UnpackerMosaicVersion::v202507) + { + return R3BRead202507(); + } else { return kFALSE; @@ -168,6 +188,83 @@ bool R3BMosaicReader::R3BRead202506() return kTRUE; } +bool R3BMosaicReader::R3BRead202507() +{ + // MOSAIC-3 corresponds to the first flex + for (int hits = 0; hits < fData2507->MOSAIC3CHIP; hits++) + { + int fChipId = fData2507->MOSAIC3CHIPv[hits]; + + int fAlpideId = fChipId + 1; // 1-base + R3BLOG_IF(error, fAlpideId < 1, "Wrong fAlpideId: " << fAlpideId); + + new ((*fArray)[fArray->GetEntriesFast()]) + R3BAlpideMappedData(fAlpideId, 0, 1, fChipId, fData2507->MOSAIC3ROWv[hits], fData2507->MOSAIC3COLv[hits]); + } + + // MOSAIC-4 corresponds to the second flex + for (int hits = 0; hits < fData2507->MOSAIC4CHIP; hits++) + { + int fChipId = fData2507->MOSAIC4CHIPv[hits]; + + int fAlpideId = fNb_sensors_flex + (fChipId + 1); // 1-base + R3BLOG_IF(error, fAlpideId < 1, "Wrong fAlpideId: " << fAlpideId); + + new ((*fArray)[fArray->GetEntriesFast()]) + R3BAlpideMappedData(fAlpideId, 0, 2, fChipId, fData2507->MOSAIC4ROWv[hits], fData2507->MOSAIC4COLv[hits]); + } + + // MOSAIC-5 corresponds to the 3rd flex + for (int hits = 0; hits < fData2507->MOSAIC5CHIP; hits++) + { + int fChipId = fData2507->MOSAIC5CHIPv[hits]; + + int fAlpideId = 2 * fNb_sensors_flex + (fChipId + 1); // 1-base + R3BLOG_IF(error, fAlpideId < 1, "Wrong fAlpideId: " << fAlpideId); + + new ((*fArray)[fArray->GetEntriesFast()]) + R3BAlpideMappedData(fAlpideId, 0, 3, fChipId, fData2507->MOSAIC5ROWv[hits], fData2507->MOSAIC5COLv[hits]); + } + + // MOSAIC-9 corresponds to the 4th flex + for (int hits = 0; hits < fData2507->MOSAIC9CHIP; hits++) + { + int fChipId = fData2507->MOSAIC9CHIPv[hits]; + + int fAlpideId = 3 * fNb_sensors_flex + (fChipId + 1); // 1-base + R3BLOG_IF(error, fAlpideId < 1, "Wrong fAlpideId: " << fAlpideId); + + new ((*fArray)[fArray->GetEntriesFast()]) + R3BAlpideMappedData(fAlpideId, 0, 4, fChipId, fData2507->MOSAIC9ROWv[hits], fData2507->MOSAIC9COLv[hits]); + } + + // MOSAIC-10 corresponds to the 5th flex + for (int hits = 0; hits < fData2507->MOSAIC10CHIP; hits++) + { + int fChipId = fData2507->MOSAIC10CHIPv[hits]; + + int fAlpideId = 4 * fNb_sensors_flex + (fChipId + 1); // 1-base + R3BLOG_IF(error, fAlpideId < 1, "Wrong fAlpideId: " << fAlpideId); + + new ((*fArray)[fArray->GetEntriesFast()]) + R3BAlpideMappedData(fAlpideId, 0, 5, fChipId, fData2507->MOSAIC10ROWv[hits], fData2507->MOSAIC10COLv[hits]); + } + + // reading timestamps + uint64_t timestamp_m3 = ((uint64_t)fData2507->MOSAIC3T_HI << 32) | (fData2507->MOSAIC3T_LO); + uint64_t timestamp_m4 = ((uint64_t)fData2507->MOSAIC4T_HI << 32) | (fData2507->MOSAIC4T_LO); + uint64_t timestamp_m5 = ((uint64_t)fData2507->MOSAIC5T_HI << 32) | (fData2507->MOSAIC5T_LO); + uint64_t timestamp_m9 = ((uint64_t)fData2507->MOSAIC9T_HI << 32) | (fData2507->MOSAIC9T_LO); + uint64_t timestamp_m10 = ((uint64_t)fData2507->MOSAIC10T_HI << 32) | (fData2507->MOSAIC10T_LO); + new ((*fArray_TS)[fArray_TS->GetEntriesFast()]) R3BWRData(timestamp_m3, 3); + new ((*fArray_TS)[fArray_TS->GetEntriesFast()]) R3BWRData(timestamp_m4, 4); + new ((*fArray_TS)[fArray_TS->GetEntriesFast()]) R3BWRData(timestamp_m5, 5); + new ((*fArray_TS)[fArray_TS->GetEntriesFast()]) R3BWRData(timestamp_m9, 9); + new ((*fArray_TS)[fArray_TS->GetEntriesFast()]) R3BWRData(timestamp_m10, 10); + + return kTRUE; +} + void R3BMosaicReader::Reset() { // Reset the output array diff --git a/r3bsource/alpide/R3BMosaicReader.h b/r3bsource/alpide/R3BMosaicReader.h index 560213bad..6f20a1738 100644 --- a/r3bsource/alpide/R3BMosaicReader.h +++ b/r3bsource/alpide/R3BMosaicReader.h @@ -1,6 +1,6 @@ /****************************************************************************** * Copyright (C) 2024 GSI Helmholtzzentrum für Schwerionenforschung GmbH * - * Copyright (C) 2024-2025 Members of R3B Collaboration * + * Copyright (C) 2024-2026 Members of R3B Collaboration * * * * This software is distributed under the terms of the * * GNU General Public Licence (GPL) version 3, * @@ -30,6 +30,9 @@ typedef struct EXT_STR_h101_MOSAIC202402_onion_t EXT_STR_h101_MOSAIC202402_onion struct EXT_STR_h101_MOSAIC202506_t; typedef struct EXT_STR_h101_MOSAIC202506_onion_t EXT_STR_h101_MOSAIC202506_onion; +struct EXT_STR_h101_MOSAIC202507_t; +typedef struct EXT_STR_h101_MOSAIC202507_onion_t EXT_STR_h101_MOSAIC202507_onion; + class ext_data_struct_info; class R3BMosaicReader : public R3BReader @@ -38,6 +41,7 @@ class R3BMosaicReader : public R3BReader // Standard constructor R3BMosaicReader(EXT_STR_h101_MOSAIC202402_onion*, size_t); R3BMosaicReader(EXT_STR_h101_MOSAIC202506_onion*, size_t); + R3BMosaicReader(EXT_STR_h101_MOSAIC202507_onion*, size_t); // Destructor virtual ~R3BMosaicReader(); @@ -67,19 +71,22 @@ class R3BMosaicReader : public R3BReader enum class UnpackerMosaicVersion : int { v202402 = 202402, - v202505 = 202505, - v202506 = 202506 + v202506 = 202506, + v202507 = 202507 }; - // Read data from S091 setup + // Read data from S091, S118 and S111 setups auto R3BRead202402() -> bool; // Read data from G249 setup auto R3BRead202506() -> bool; + // Read data from Super-FRS setup + auto R3BRead202507() -> bool; // An event counter unsigned int fNEvent = 1; // Reader specific data structure from ucesb EXT_STR_h101_MOSAIC202402_onion* fData2402 = nullptr; EXT_STR_h101_MOSAIC202506_onion* fData2506 = nullptr; + EXT_STR_h101_MOSAIC202507_onion* fData2507 = nullptr; // Number of Mosaics int fNbMosaic = 1; // Data offset diff --git a/r3bsource/alpide/ext_h101_mosaic202506.h b/r3bsource/alpide/ext_h101_mosaic202506.h index bcbceb982..a137b9f15 100644 --- a/r3bsource/alpide/ext_h101_mosaic202506.h +++ b/r3bsource/alpide/ext_h101_mosaic202506.h @@ -1,6 +1,6 @@ /****************************************************************************** * Copyright (C) 2025 GSI Helmholtzzentrum für Schwerionenforschung GmbH * - * Copyright (C) 2025 Members of R3B Collaboration * + * Copyright (C) 2025-2026 Members of R3B Collaboration * * * * This software is distributed under the terms of the * * GNU General Public Licence (GPL) version 3, * diff --git a/r3bsource/alpide/ext_h101_mosaic202507.h b/r3bsource/alpide/ext_h101_mosaic202507.h new file mode 100644 index 000000000..4aa1d419d --- /dev/null +++ b/r3bsource/alpide/ext_h101_mosaic202507.h @@ -0,0 +1,239 @@ +/****************************************************************************** + * Copyright (C) 2026 GSI Helmholtzzentrum für Schwerionenforschung GmbH * + * Copyright (C) 2026 Members of R3B Collaboration * + * * + * This software is distributed under the terms of the * + * GNU General Public Licence (GPL) version 3, * + * copied verbatim in the file "LICENSE". * + * * + * In applying this license GSI does not waive the privileges and immunities * + * granted to it by virtue of its status as an Intergovernmental Organization * + * or submit itself to any jurisdiction. * + ******************************************************************************/ + +/******************************************************** + * + * Structure for ext_data_fetch_event() filling. + * + * Do not edit - automatically generated. + */ + +#pragma once + +#ifndef __CINT__ +#include +#else +/* For CINT (old version trouble with stdint.h): */ +#ifndef uint32_t +typedef unsigned int uint32_t; +typedef int int32_t; +#endif +#endif +#ifndef EXT_STRUCT_CTRL +#define EXT_STRUCT_CTRL(x) +#endif + +/******************************************************** + * + * Plain structure (layout as ntuple/root file): + */ + +typedef struct EXT_STR_h101_MOSAIC202507_t +{ + /* RAW */ + uint32_t MOSAIC3T_HI /* [-1,-1] */; + uint32_t MOSAIC3T_LO /* [-1,-1] */; + uint32_t MOSAIC3TRIG_SYNC /* [0,65535] */; + uint32_t MOSAIC3CHIP /* [0,32767] */; + uint32_t MOSAIC3CHIPv[32767 EXT_STRUCT_CTRL(MOSAIC3CHIP)] /* [0,255] */; + uint32_t MOSAIC3ROW /* [0,32767] */; + uint32_t MOSAIC3ROWv[32767 EXT_STRUCT_CTRL(MOSAIC3ROW)] /* [0,65535] */; + uint32_t MOSAIC3COL /* [0,32767] */; + uint32_t MOSAIC3COLv[32767 EXT_STRUCT_CTRL(MOSAIC3COL)] /* [0,65535] */; + uint32_t MOSAIC4T_HI /* [-1,-1] */; + uint32_t MOSAIC4T_LO /* [-1,-1] */; + uint32_t MOSAIC4TRIG_SYNC /* [0,65535] */; + uint32_t MOSAIC4CHIP /* [0,32767] */; + uint32_t MOSAIC4CHIPv[32767 EXT_STRUCT_CTRL(MOSAIC4CHIP)] /* [0,255] */; + uint32_t MOSAIC4ROW /* [0,32767] */; + uint32_t MOSAIC4ROWv[32767 EXT_STRUCT_CTRL(MOSAIC4ROW)] /* [0,65535] */; + uint32_t MOSAIC4COL /* [0,32767] */; + uint32_t MOSAIC4COLv[32767 EXT_STRUCT_CTRL(MOSAIC4COL)] /* [0,65535] */; + uint32_t MOSAIC5T_HI /* [-1,-1] */; + uint32_t MOSAIC5T_LO /* [-1,-1] */; + uint32_t MOSAIC5TRIG_SYNC /* [0,65535] */; + uint32_t MOSAIC5CHIP /* [0,32767] */; + uint32_t MOSAIC5CHIPv[32767 EXT_STRUCT_CTRL(MOSAIC5CHIP)] /* [0,255] */; + uint32_t MOSAIC5ROW /* [0,32767] */; + uint32_t MOSAIC5ROWv[32767 EXT_STRUCT_CTRL(MOSAIC5ROW)] /* [0,65535] */; + uint32_t MOSAIC5COL /* [0,32767] */; + uint32_t MOSAIC5COLv[32767 EXT_STRUCT_CTRL(MOSAIC5COL)] /* [0,65535] */; + uint32_t MOSAIC9T_HI /* [-1,-1] */; + uint32_t MOSAIC9T_LO /* [-1,-1] */; + uint32_t MOSAIC9TRIG_SYNC /* [0,65535] */; + uint32_t MOSAIC9CHIP /* [0,32767] */; + uint32_t MOSAIC9CHIPv[32767 EXT_STRUCT_CTRL(MOSAIC9CHIP)] /* [0,255] */; + uint32_t MOSAIC9ROW /* [0,32767] */; + uint32_t MOSAIC9ROWv[32767 EXT_STRUCT_CTRL(MOSAIC9ROW)] /* [0,65535] */; + uint32_t MOSAIC9COL /* [0,32767] */; + uint32_t MOSAIC9COLv[32767 EXT_STRUCT_CTRL(MOSAIC9COL)] /* [0,65535] */; + uint32_t MOSAIC10T_HI /* [-1,-1] */; + uint32_t MOSAIC10T_LO /* [-1,-1] */; + uint32_t MOSAIC10TRIG_SYNC /* [0,65535] */; + uint32_t MOSAIC10CHIP /* [0,32767] */; + uint32_t MOSAIC10CHIPv[32767 EXT_STRUCT_CTRL(MOSAIC10CHIP)] /* [0,255] */; + uint32_t MOSAIC10ROW /* [0,32767] */; + uint32_t MOSAIC10ROWv[32767 EXT_STRUCT_CTRL(MOSAIC10ROW)] /* [0,65535] */; + uint32_t MOSAIC10COL /* [0,32767] */; + uint32_t MOSAIC10COLv[32767 EXT_STRUCT_CTRL(MOSAIC10COL)] /* [0,65535] */; + +} EXT_STR_h101_MOSAIC202507; + +/******************************************************** + * + * Structure with multiple levels of arrays (partially) + * recovered (recommended): + */ + +typedef struct EXT_STR_h101_MOSAIC202507_onion_t +{ + /* RAW */ + uint32_t MOSAIC3T_HI; + uint32_t MOSAIC3T_LO; + uint32_t MOSAIC3TRIG_SYNC; + uint32_t MOSAIC3CHIP; + uint32_t MOSAIC3CHIPv[32767 /* MOSAIC3CHIP */]; + uint32_t MOSAIC3ROW; + uint32_t MOSAIC3ROWv[32767 /* MOSAIC3ROW */]; + uint32_t MOSAIC3COL; + uint32_t MOSAIC3COLv[32767 /* MOSAIC3COL */]; + uint32_t MOSAIC4T_HI; + uint32_t MOSAIC4T_LO; + uint32_t MOSAIC4TRIG_SYNC; + uint32_t MOSAIC4CHIP; + uint32_t MOSAIC4CHIPv[32767 /* MOSAIC4CHIP */]; + uint32_t MOSAIC4ROW; + uint32_t MOSAIC4ROWv[32767 /* MOSAIC4ROW */]; + uint32_t MOSAIC4COL; + uint32_t MOSAIC4COLv[32767 /* MOSAIC4COL */]; + uint32_t MOSAIC5T_HI; + uint32_t MOSAIC5T_LO; + uint32_t MOSAIC5TRIG_SYNC; + uint32_t MOSAIC5CHIP; + uint32_t MOSAIC5CHIPv[32767 /* MOSAIC5CHIP */]; + uint32_t MOSAIC5ROW; + uint32_t MOSAIC5ROWv[32767 /* MOSAIC5ROW */]; + uint32_t MOSAIC5COL; + uint32_t MOSAIC5COLv[32767 /* MOSAIC5COL */]; + uint32_t MOSAIC9T_HI; + uint32_t MOSAIC9T_LO; + uint32_t MOSAIC9TRIG_SYNC; + uint32_t MOSAIC9CHIP; + uint32_t MOSAIC9CHIPv[32767 /* MOSAIC9CHIP */]; + uint32_t MOSAIC9ROW; + uint32_t MOSAIC9ROWv[32767 /* MOSAIC9ROW */]; + uint32_t MOSAIC9COL; + uint32_t MOSAIC9COLv[32767 /* MOSAIC9COL */]; + uint32_t MOSAIC10T_HI; + uint32_t MOSAIC10T_LO; + uint32_t MOSAIC10TRIG_SYNC; + uint32_t MOSAIC10CHIP; + uint32_t MOSAIC10CHIPv[32767 /* MOSAIC10CHIP */]; + uint32_t MOSAIC10ROW; + uint32_t MOSAIC10ROWv[32767 /* MOSAIC10ROW */]; + uint32_t MOSAIC10COL; + uint32_t MOSAIC10COLv[32767 /* MOSAIC10COL */]; + +} EXT_STR_h101_MOSAIC202507_onion; + +/*******************************************************/ + +#define EXT_STR_h101_MOSAIC202507_ITEMS_INFO(ok, si, offset, struct_t, printerr) \ + do \ + { \ + ok = 1; \ + /* RAW */ \ + EXT_STR_ITEM_INFO2(ok, si, offset, struct_t, printerr, MOSAIC3T_HI, UINT32, "MOSAIC3T_HI", 0 /*flags*/); \ + EXT_STR_ITEM_INFO2(ok, si, offset, struct_t, printerr, MOSAIC3T_LO, UINT32, "MOSAIC3T_LO", 0 /*flags*/); \ + EXT_STR_ITEM_INFO2_LIM( \ + ok, si, offset, struct_t, printerr, MOSAIC3TRIG_SYNC, UINT32, "MOSAIC3TRIG_SYNC", 65535, 0 /*flags*/); \ + EXT_STR_ITEM_INFO2_LIM( \ + ok, si, offset, struct_t, printerr, MOSAIC3CHIP, UINT32, "MOSAIC3CHIP", 32767, 0 /*flags*/); \ + EXT_STR_ITEM_INFO2_ZZP( \ + ok, si, offset, struct_t, printerr, MOSAIC3CHIPv, UINT32, "MOSAIC3CHIPv", "MOSAIC3CHIP", 0 /*flags*/); \ + EXT_STR_ITEM_INFO2_LIM( \ + ok, si, offset, struct_t, printerr, MOSAIC3ROW, UINT32, "MOSAIC3ROW", 32767, 0 /*flags*/); \ + EXT_STR_ITEM_INFO2_ZZP( \ + ok, si, offset, struct_t, printerr, MOSAIC3ROWv, UINT32, "MOSAIC3ROWv", "MOSAIC3ROW", 0 /*flags*/); \ + EXT_STR_ITEM_INFO2_LIM( \ + ok, si, offset, struct_t, printerr, MOSAIC3COL, UINT32, "MOSAIC3COL", 32767, 0 /*flags*/); \ + EXT_STR_ITEM_INFO2_ZZP( \ + ok, si, offset, struct_t, printerr, MOSAIC3COLv, UINT32, "MOSAIC3COLv", "MOSAIC3COL", 0 /*flags*/); \ + EXT_STR_ITEM_INFO2(ok, si, offset, struct_t, printerr, MOSAIC4T_HI, UINT32, "MOSAIC4T_HI", 0 /*flags*/); \ + EXT_STR_ITEM_INFO2(ok, si, offset, struct_t, printerr, MOSAIC4T_LO, UINT32, "MOSAIC4T_LO", 0 /*flags*/); \ + EXT_STR_ITEM_INFO2_LIM( \ + ok, si, offset, struct_t, printerr, MOSAIC4TRIG_SYNC, UINT32, "MOSAIC4TRIG_SYNC", 65535, 0 /*flags*/); \ + EXT_STR_ITEM_INFO2_LIM( \ + ok, si, offset, struct_t, printerr, MOSAIC4CHIP, UINT32, "MOSAIC4CHIP", 32767, 0 /*flags*/); \ + EXT_STR_ITEM_INFO2_ZZP( \ + ok, si, offset, struct_t, printerr, MOSAIC4CHIPv, UINT32, "MOSAIC4CHIPv", "MOSAIC4CHIP", 0 /*flags*/); \ + EXT_STR_ITEM_INFO2_LIM( \ + ok, si, offset, struct_t, printerr, MOSAIC4ROW, UINT32, "MOSAIC4ROW", 32767, 0 /*flags*/); \ + EXT_STR_ITEM_INFO2_ZZP( \ + ok, si, offset, struct_t, printerr, MOSAIC4ROWv, UINT32, "MOSAIC4ROWv", "MOSAIC4ROW", 0 /*flags*/); \ + EXT_STR_ITEM_INFO2_LIM( \ + ok, si, offset, struct_t, printerr, MOSAIC4COL, UINT32, "MOSAIC4COL", 32767, 0 /*flags*/); \ + EXT_STR_ITEM_INFO2_ZZP( \ + ok, si, offset, struct_t, printerr, MOSAIC4COLv, UINT32, "MOSAIC4COLv", "MOSAIC4COL", 0 /*flags*/); \ + EXT_STR_ITEM_INFO2(ok, si, offset, struct_t, printerr, MOSAIC5T_HI, UINT32, "MOSAIC5T_HI", 0 /*flags*/); \ + EXT_STR_ITEM_INFO2(ok, si, offset, struct_t, printerr, MOSAIC5T_LO, UINT32, "MOSAIC5T_LO", 0 /*flags*/); \ + EXT_STR_ITEM_INFO2_LIM( \ + ok, si, offset, struct_t, printerr, MOSAIC5TRIG_SYNC, UINT32, "MOSAIC5TRIG_SYNC", 65535, 0 /*flags*/); \ + EXT_STR_ITEM_INFO2_LIM( \ + ok, si, offset, struct_t, printerr, MOSAIC5CHIP, UINT32, "MOSAIC5CHIP", 32767, 0 /*flags*/); \ + EXT_STR_ITEM_INFO2_ZZP( \ + ok, si, offset, struct_t, printerr, MOSAIC5CHIPv, UINT32, "MOSAIC5CHIPv", "MOSAIC5CHIP", 0 /*flags*/); \ + EXT_STR_ITEM_INFO2_LIM( \ + ok, si, offset, struct_t, printerr, MOSAIC5ROW, UINT32, "MOSAIC5ROW", 32767, 0 /*flags*/); \ + EXT_STR_ITEM_INFO2_ZZP( \ + ok, si, offset, struct_t, printerr, MOSAIC5ROWv, UINT32, "MOSAIC5ROWv", "MOSAIC5ROW", 0 /*flags*/); \ + EXT_STR_ITEM_INFO2_LIM( \ + ok, si, offset, struct_t, printerr, MOSAIC5COL, UINT32, "MOSAIC5COL", 32767, 0 /*flags*/); \ + EXT_STR_ITEM_INFO2_ZZP( \ + ok, si, offset, struct_t, printerr, MOSAIC5COLv, UINT32, "MOSAIC5COLv", "MOSAIC5COL", 0 /*flags*/); \ + EXT_STR_ITEM_INFO2(ok, si, offset, struct_t, printerr, MOSAIC9T_HI, UINT32, "MOSAIC9T_HI", 0 /*flags*/); \ + EXT_STR_ITEM_INFO2(ok, si, offset, struct_t, printerr, MOSAIC9T_LO, UINT32, "MOSAIC9T_LO", 0 /*flags*/); \ + EXT_STR_ITEM_INFO2_LIM( \ + ok, si, offset, struct_t, printerr, MOSAIC9TRIG_SYNC, UINT32, "MOSAIC9TRIG_SYNC", 65535, 0 /*flags*/); \ + EXT_STR_ITEM_INFO2_LIM( \ + ok, si, offset, struct_t, printerr, MOSAIC9CHIP, UINT32, "MOSAIC9CHIP", 32767, 0 /*flags*/); \ + EXT_STR_ITEM_INFO2_ZZP( \ + ok, si, offset, struct_t, printerr, MOSAIC9CHIPv, UINT32, "MOSAIC9CHIPv", "MOSAIC9CHIP", 0 /*flags*/); \ + EXT_STR_ITEM_INFO2_LIM( \ + ok, si, offset, struct_t, printerr, MOSAIC9ROW, UINT32, "MOSAIC9ROW", 32767, 0 /*flags*/); \ + EXT_STR_ITEM_INFO2_ZZP( \ + ok, si, offset, struct_t, printerr, MOSAIC9ROWv, UINT32, "MOSAIC9ROWv", "MOSAIC9ROW", 0 /*flags*/); \ + EXT_STR_ITEM_INFO2_LIM( \ + ok, si, offset, struct_t, printerr, MOSAIC9COL, UINT32, "MOSAIC9COL", 32767, 0 /*flags*/); \ + EXT_STR_ITEM_INFO2_ZZP( \ + ok, si, offset, struct_t, printerr, MOSAIC9COLv, UINT32, "MOSAIC9COLv", "MOSAIC9COL", 0 /*flags*/); \ + EXT_STR_ITEM_INFO2(ok, si, offset, struct_t, printerr, MOSAIC10T_HI, UINT32, "MOSAIC10T_HI", 0 /*flags*/); \ + EXT_STR_ITEM_INFO2(ok, si, offset, struct_t, printerr, MOSAIC10T_LO, UINT32, "MOSAIC10T_LO", 0 /*flags*/); \ + EXT_STR_ITEM_INFO2_LIM( \ + ok, si, offset, struct_t, printerr, MOSAIC10TRIG_SYNC, UINT32, "MOSAIC10TRIG_SYNC", 65535, 0 /*flags*/); \ + EXT_STR_ITEM_INFO2_LIM( \ + ok, si, offset, struct_t, printerr, MOSAIC10CHIP, UINT32, "MOSAIC10CHIP", 32767, 0 /*flags*/); \ + EXT_STR_ITEM_INFO2_ZZP( \ + ok, si, offset, struct_t, printerr, MOSAIC10CHIPv, UINT32, "MOSAIC10CHIPv", "MOSAIC10CHIP", 0 /*flags*/); \ + EXT_STR_ITEM_INFO2_LIM( \ + ok, si, offset, struct_t, printerr, MOSAIC10ROW, UINT32, "MOSAIC10ROW", 32767, 0 /*flags*/); \ + EXT_STR_ITEM_INFO2_ZZP( \ + ok, si, offset, struct_t, printerr, MOSAIC10ROWv, UINT32, "MOSAIC10ROWv", "MOSAIC10ROW", 0 /*flags*/); \ + EXT_STR_ITEM_INFO2_LIM( \ + ok, si, offset, struct_t, printerr, MOSAIC10COL, UINT32, "MOSAIC10COL", 32767, 0 /*flags*/); \ + EXT_STR_ITEM_INFO2_ZZP( \ + ok, si, offset, struct_t, printerr, MOSAIC10COLv, UINT32, "MOSAIC10COLv", "MOSAIC10COL", 0 /*flags*/); \ + \ + } while (0); + +/*******************************************************/