Skip to content

Commit fb4b0df

Browse files
committed
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
1 parent 5ae5eba commit fb4b0df

10 files changed

Lines changed: 500 additions & 51 deletions

alpide/calibration/R3BAlpideCal2Hit.cxx

Lines changed: 139 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/******************************************************************************
22
* Copyright (C) 2022 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
3-
* Copyright (C) 2022-2025 Members of R3B Collaboration *
3+
* Copyright (C) 2022-2026 Members of R3B Collaboration *
44
* *
55
* This software is distributed under the terms of the *
66
* GNU General Public Licence (GPL) version 3, *
@@ -459,6 +459,68 @@ void R3BAlpideCal2Hit::FindClustersDefault()
459459
localpos.Y());
460460
}
461461
}
462+
else if (fGeoversion == 202507)
463+
{
464+
for (size_t s = 0; s < fNbSensors; s++)
465+
for (size_t i = 0; i < nHits; i++)
466+
if (mult[s][i] > 0)
467+
{
468+
nbcluster++;
469+
470+
TVector3 localpos;
471+
localpos.SetXYZ(meancol[s][i] / double(mult[s][i]) * fPixelSize_ls,
472+
meanrow[s][i] / double(mult[s][i]) * fPixelSize_ss,
473+
0.0);
474+
475+
TVector3 labpos;
476+
477+
double Z_flex1 = 0.;
478+
479+
double Z_flex2 = 7.;
480+
481+
double Z_flex3 = 14.;
482+
483+
// Mosaic-3
484+
if (s < 3)
485+
labpos.SetXYZ(-45. + localpos.X() + 30. * s, -localpos.Y(), Z_flex1);
486+
else if (s < 6)
487+
labpos.SetXYZ(45. - localpos.X() - 30. * (s - 3), localpos.Y(), Z_flex1);
488+
// Mosaic-4
489+
else if (s < 9)
490+
labpos.SetXYZ(-45. + localpos.X() + 30. * s, -localpos.Y(), Z_flex1);
491+
else if (s < 12)
492+
labpos.SetXYZ(45. - localpos.X() - 30. * (s - 3), localpos.Y(), Z_flex1);
493+
// Mosaic-5
494+
else if (s < 15)
495+
labpos.SetXYZ(-45. + localpos.X() + 30. * s, -localpos.Y(), Z_flex2);
496+
else if (s < 18)
497+
labpos.SetXYZ(45. - localpos.X() - 30. * (s - 3), localpos.Y(), Z_flex2);
498+
// Mosaic-9
499+
else if (s < 21)
500+
labpos.SetXYZ(-45. + localpos.X() + 30. * s, -localpos.Y(), Z_flex2);
501+
else if (s < 24)
502+
labpos.SetXYZ(45. - localpos.X() - 30. * (s - 3), localpos.Y(), Z_flex2);
503+
// Mosaic-10
504+
else if (s < 27)
505+
labpos.SetXYZ(-45. + localpos.X() + 30. * s, -localpos.Y(), Z_flex3);
506+
else
507+
labpos.SetXYZ(45. - localpos.X() - 30. * (s - 3), localpos.Y(), Z_flex3);
508+
509+
AddHitData(s + 1,
510+
mult[s][i],
511+
0,
512+
0,
513+
nullMajor,
514+
0,
515+
0,
516+
nullHu,
517+
labpos.X(),
518+
labpos.Y(),
519+
labpos.Z(),
520+
localpos.X(),
521+
localpos.Y());
522+
}
523+
}
462524

463525
R3BLOG(debug, "Number of clusters: " << nbcluster);
464526
return;
@@ -467,21 +529,21 @@ void R3BAlpideCal2Hit::FindClustersDefault()
467529
// ----- Alternatvie methods: Flood fill ---------------------------
468530
void R3BAlpideCal2Hit::FindClustersFloodFill()
469531
{
470-
Int_t nHits = fAlpideCluster->GetEntriesFast();
532+
auto nHits = fAlpideCluster->GetEntriesFast();
471533
if (nHits == 0)
472534
return;
473535

474-
std::map<Int_t, std::vector<std::pair<Int_t, Int_t>>> sensorPixels;
475-
for (Int_t i = 0; i < nHits; i++)
536+
std::map<int, std::vector<std::pair<int, int>>> sensorPixels;
537+
for (auto i = 0; i < nHits; i++)
476538
{
477539
auto cluster = dynamic_cast<R3BAlpideCluster*>(fAlpideCluster->At(i));
478-
Int_t sen = cluster->GetSensorId() - 1;
540+
auto sen = cluster->GetSensorId() - 1;
479541
sensorPixels[sen].emplace_back(cluster->GetCol(), cluster->GetRow());
480542
}
481543

482544
for (auto& sp : sensorPixels)
483545
{
484-
Int_t senId = sp.first;
546+
auto senId = sp.first;
485547
auto& pixels = sp.second;
486548

487549
// Determine bounds with padding
@@ -493,17 +555,17 @@ void R3BAlpideCal2Hit::FindClustersFloodFill()
493555
minRow = std::min(minRow, p.second);
494556
maxRow = std::max(maxRow, p.second);
495557
}
496-
Int_t nCols = maxCol - minCol + 3;
497-
Int_t nRows = maxRow - minRow + 3;
558+
auto nCols = maxCol - minCol + 3;
559+
auto nRows = maxRow - minRow + 3;
498560

499561
std::vector<std::vector<bool>> map(nCols, std::vector<bool>(nRows, false));
500562
std::vector<std::vector<bool>> visited(nCols, std::vector<bool>(nRows, false));
501563
for (auto& p : pixels)
502564
map[p.first - minCol + 1][p.second - minRow + 1] = true;
503565

504566
// Flood-fill function
505-
std::function<void(Int_t, Int_t, std::vector<std::pair<Int_t, Int_t>>&)> fill;
506-
fill = [&](Int_t x, Int_t y, std::vector<std::pair<Int_t, Int_t>>& clusterPixels)
567+
std::function<void(int, int, std::vector<std::pair<int, int>>&)> fill;
568+
fill = [&](int x, int y, std::vector<std::pair<int, int>>& clusterPixels)
507569
{
508570
if (x < 0 || x >= nCols || y < 0 || y >= nRows)
509571
return;
@@ -518,14 +580,14 @@ void R3BAlpideCal2Hit::FindClustersFloodFill()
518580
};
519581

520582
// Process all pixels
521-
for (Int_t x = 0; x < nCols; x++)
583+
for (auto x = 0; x < nCols; x++)
522584
{
523-
for (Int_t y = 0; y < nRows; y++)
585+
for (auto y = 0; y < nRows; y++)
524586
{
525587
if (!map[x][y] || visited[x][y])
526588
continue;
527589

528-
std::vector<std::pair<Int_t, Int_t>> clusterPixels;
590+
std::vector<std::pair<int, int>> clusterPixels;
529591
fill(x, y, clusterPixels);
530592

531593
// ================== Hole Detection ==================
@@ -782,6 +844,29 @@ void R3BAlpideCal2Hit::FindClustersFloodFill()
782844
else
783845
labUnit.SetXYZ(+localUnit.X(), +localUnit.Y(), 0.0);
784846
}
847+
else if (fGeoversion == 202507)
848+
{
849+
if (senId < 3)
850+
labUnit.SetXYZ(localUnit.X(), localUnit.Y(), 0.0);
851+
else if (senId < 6)
852+
labUnit.SetXYZ(-localUnit.X(), -localUnit.Y(), 0.0);
853+
else if (senId < 9)
854+
labUnit.SetXYZ(localUnit.X(), localUnit.Y(), 0.0);
855+
else if (senId < 12)
856+
labUnit.SetXYZ(-localUnit.X(), -localUnit.Y(), 0.0);
857+
else if (senId < 15)
858+
labUnit.SetXYZ(localUnit.X(), localUnit.Y(), 0.0);
859+
else if (senId < 18)
860+
labUnit.SetXYZ(-localUnit.X(), -localUnit.Y(), 0.0);
861+
else if (senId < 21)
862+
labUnit.SetXYZ(localUnit.X(), localUnit.Y(), 0.0);
863+
else if (senId < 24)
864+
labUnit.SetXYZ(-localUnit.X(), -localUnit.Y(), 0.0);
865+
else if (senId < 27)
866+
labUnit.SetXYZ(localUnit.X(), localUnit.Y(), 0.0);
867+
else
868+
labUnit.SetXYZ(-localUnit.X(), -localUnit.Y(), 0.0);
869+
}
785870

786871
// Protect from NaN && Inf ->Set to non physical units where possible for later analysis.
787872
if (!std::isfinite(localUnit.X()))
@@ -958,14 +1043,51 @@ void R3BAlpideCal2Hit::FindClustersFloodFill()
9581043
}
9591044
else if (fGeoversion == 202506)
9601045
{
1046+
const double Z_alpide1 = -1732.88;
1047+
const double Z_alpide2 = -1659.88;
1048+
1049+
const double z1_off = -0.837843;
1050+
const double z2_off = -2.69759;
1051+
1052+
const double rx = 0.0225419;
1053+
const double ry = 0.0137131;
1054+
const double rz[12] = { 0.00595207, 0.00815014, 0.0102531, 0.00857714, 0.00909736, 0.0015223,
1055+
0.0133541, 0.00969408, 0.0134827, 0.000125173, 0.00982907, 0.021181 };
1056+
1057+
array<TVector3, 12> pos_offset = {
1058+
TVector3(0.231386, 0.18477, z1_off), TVector3(0.03624, 0.0145723, z1_off),
1059+
TVector3(-0.162212, -0.217339, z1_off), TVector3(-0.157992, -0.31182, z1_off),
1060+
TVector3(0.0596373, -0.07224198, z1_off), TVector3(0.2458, 0.131979, z1_off),
1061+
TVector3(0.713162, 0.203712, z2_off), TVector3(0.5620141, -0.18166828, z2_off),
1062+
TVector3(0.316365, -0.445912, z2_off), TVector3(0.323927, -0.298097, z2_off),
1063+
TVector3(0.5504176, -0.2855743, z2_off), TVector3(0.781553, -0.0369948, z2_off)
1064+
};
1065+
1066+
TRotation Rloc;
1067+
Rloc.RotateZ(rz[senId]);
1068+
TVector3 local_rot = Rloc * localpos;
1069+
9611070
if (senId < 3)
962-
labpos.SetXYZ(45. - localpos.X() - 30. * senId, -localpos.Y(), 0.);
1071+
labpos.SetXYZ(45. - local_rot.X() - 30. * senId, -local_rot.Y(), Z_alpide1);
9631072
else if (senId < 6)
964-
labpos.SetXYZ(-45. + localpos.X() + 30. * (senId - 3), localpos.Y(), 0.);
1073+
labpos.SetXYZ(-45. + local_rot.X() + 30. * (senId - 3), local_rot.Y(), Z_alpide1);
9651074
else if (senId < 9)
966-
labpos.SetXYZ(45. - localpos.X() - 30. * (senId - 6), -localpos.Y(), 73.);
1075+
labpos.SetXYZ(45. - local_rot.X() - 30. * (senId - 6), -local_rot.Y(), Z_alpide2);
1076+
else
1077+
labpos.SetXYZ(-45. + local_rot.X() + 30. * (senId - 9), local_rot.Y(), Z_alpide2);
1078+
1079+
TVector3 center;
1080+
if (senId < 6)
1081+
center.SetXYZ(0., 0., Z_alpide1);
9671082
else
968-
labpos.SetXYZ(-45. + localpos.X() + 30. * (senId - 9), localpos.Y(), 73.);
1083+
center.SetXYZ(0., 0., Z_alpide2);
1084+
1085+
TRotation R;
1086+
R.RotateX(rx);
1087+
R.RotateY(ry);
1088+
1089+
labpos = R * (labpos - center) + center;
1090+
labpos += pos_offset[senId];
9691091
}
9701092

9711093
if (std::isnan(elongation) || std::isinf(elongation))

alpide/calibration/R3BAlpideCal2Hit.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/******************************************************************************
22
* Copyright (C) 2022 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
3-
* Copyright (C) 2022-2025 Members of R3B Collaboration *
3+
* Copyright (C) 2022-2026 Members of R3B Collaboration *
44
* *
55
* This software is distributed under the terms of the *
66
* GNU General Public Licence (GPL) version 3, *
@@ -58,7 +58,7 @@ class R3BAlpideCal2Hit : public FairTask
5858
InitStatus ReInit() override;
5959

6060
// Method to setup online mode
61-
inline void SetOnline(bool option = true) { fOnline = option; }
61+
void SetOnline(bool option = true) { fOnline = option; }
6262

6363
void SetAlgorithm(const std::string& algo) { fAlgorithm = algo; }
6464

alpide/calibration/R3BAlpideMapped2Cal.cxx

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/******************************************************************************
22
* Copyright (C) 2022 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
3-
* Copyright (C) 2022-2024 Members of R3B Collaboration *
3+
* Copyright (C) 2022-2026 Members of R3B Collaboration *
44
* *
55
* This software is distributed under the terms of the *
66
* GNU General Public Licence (GPL) version 3, *
@@ -136,22 +136,6 @@ void R3BAlpideMapped2Cal::Exec(Option_t*)
136136
return;
137137
}
138138

139-
// ----- Private method GetCol -----------------------------------------------
140-
int R3BAlpideMapped2Cal::GetCol(int reg, int dcol, int ads)
141-
{
142-
int col = reg * 32 + dcol * 2;
143-
int lr = ((ads % 4) < 2 ? 1 : 0);
144-
col += lr;
145-
return col;
146-
}
147-
148-
// ----- Private method GetRow -----------------------------------------------
149-
int R3BAlpideMapped2Cal::GetRow(int ads)
150-
{
151-
// This is OK for pixels within a group of 4
152-
return ads / 2;
153-
}
154-
155139
// ----- Public method Reset ------------------------------------------------
156140
void R3BAlpideMapped2Cal::Reset()
157141
{

alpide/calibration/R3BAlpideMapped2Cal.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/******************************************************************************
22
* Copyright (C) 2022 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
3-
* Copyright (C) 2022-2024 Members of R3B Collaboration *
3+
* Copyright (C) 2022-2026 Members of R3B Collaboration *
44
* *
55
* This software is distributed under the terms of the *
66
* GNU General Public Licence (GPL) version 3, *
@@ -54,16 +54,14 @@ class R3BAlpideMapped2Cal : public FairTask
5454
InitStatus ReInit() override;
5555

5656
// Method to setup online mode
57-
inline void SetOnline(bool option) { fOnline = option; }
57+
void SetOnline(bool option = true) { fOnline = option; }
5858

5959
private:
6060
void SetParameter();
61-
int GetCol(int reg, int dcol, int ads);
62-
int GetRow(int ads);
6361

6462
bool fOnline = false; // Don't store data for online
6563

66-
R3BAlpideMappingPar* fMap_Par = nullptr; /**< Parameter container. >*/
64+
R3BAlpideMappingPar* fMap_Par = nullptr; // Parameter container
6765
TClonesArray* fAlpideMappedData = nullptr; // Array with Alpide Mapped input data
6866
TClonesArray* fAlpideCalData = nullptr; // Array with Alpide Cal output data
6967

@@ -72,5 +70,5 @@ class R3BAlpideMapped2Cal : public FairTask
7270

7371
public:
7472
// Class definition
75-
ClassDefOverride(R3BAlpideMapped2Cal, 1)
73+
ClassDefOverride(R3BAlpideMapped2Cal, 1); // NOLINT
7674
};

r3bsource/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
##############################################################################
22
# Copyright (C) 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH #
3-
# Copyright (C) 2019-2025 Members of R3B Collaboration #
3+
# Copyright (C) 2019-2026 Members of R3B Collaboration #
44
# #
55
# This software is distributed under the terms of the #
66
# GNU General Public Licence (GPL) version 3, #
@@ -170,6 +170,7 @@ set(STRUCT_HEADERS
170170
alpide/ext_h101_alpide.h
171171
alpide/ext_h101_mosaic202402.h
172172
alpide/ext_h101_mosaic202506.h
173+
alpide/ext_h101_mosaic202507.h
173174
alpide/ext_h101_hmp.h
174175
music/ext_h101_music.h
175176
twim/ext_h101_twim.h

r3bsource/SourceLinkDef.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
/******************************************************************************
44
* Copyright (C) 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
5-
* Copyright (C) 2019-2025 Members of R3B Collaboration *
5+
* Copyright (C) 2019-2026 Members of R3B Collaboration *
66
* *
77
* This software is distributed under the terms of the *
88
* GNU General Public Licence (GPL) version 3, *
@@ -148,6 +148,7 @@
148148
#pragma link C++ class EXT_STR_h101_SYNC_CHECK_t;
149149
#pragma link C++ class EXT_STR_h101_MOSAIC202402_onion_t;
150150
#pragma link C++ class EXT_STR_h101_MOSAIC202506_onion_t;
151+
#pragma link C++ class EXT_STR_h101_MOSAIC202507_onion_t;
151152
#pragma link C++ class EXT_STR_h101_HMP_onion_t;
152153
#pragma link C++ class EXT_STR_h101_ACTAF2023_onion_t;
153154
#pragma link C++ class EXT_STR_h101_ACTAF2025_onion_t;

0 commit comments

Comments
 (0)