Skip to content

Commit 7eeb149

Browse files
committed
Add FD detector
1 parent 81dad27 commit 7eeb149

File tree

97 files changed

+2105
-516
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+2105
-516
lines changed

.github/workflows/clean-test.yml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ name: Clean PR checks
1919
# Warning: the check_* keys are magic and must consist of the string
2020
# "check_" followed by the applicable check name exactly. The
2121
# "description" field is only the human-readable label for the input.
22-
'check_build/O2/o2':
23-
description: build/O2/o2
24-
type: boolean
25-
default: true
2622
'check_build/AliceO2/O2/o2/macOS':
2723
description: build/AliceO2/O2/o2/macOS
2824
type: boolean
@@ -31,14 +27,10 @@ name: Clean PR checks
3127
description: build/AliceO2/O2/o2/macOS-arm
3228
type: boolean
3329
default: true
34-
'check_build/O2/fullCI':
30+
'check_build/O2/fullCI_slc9':
3531
description: build/O2/fullCI
3632
type: boolean
3733
default: true
38-
'check_build/O2/o2-cs8':
39-
description: build/O2/o2-cs8
40-
type: boolean
41-
default: true
4234
'check_build/O2/o2-dataflow-cs8':
4335
description: build/O2/o2-dataflow-cs8
4436
type: boolean

Common/SimConfig/src/SimConfig.cxx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ void SimConfig::determineActiveModules(std::vector<std::string> const& inputargs
9898
activeModules[i] != "TF3" &&
9999
activeModules[i] != "RCH" &&
100100
activeModules[i] != "MI3" &&
101-
activeModules[i] != "ECL") {
101+
activeModules[i] != "ECL" &&
102+
activeModules[i] != "FD") {
102103
LOGP(fatal, "List of active modules contains {}, which is not a module from the upgrades.", activeModules[i]);
103104
}
104105
}
@@ -112,7 +113,8 @@ void SimConfig::determineActiveModules(std::vector<std::string> const& inputargs
112113
activeModules[i] == "TF3" ||
113114
activeModules[i] == "RCH" ||
114115
activeModules[i] == "MI3" ||
115-
activeModules[i] == "ECL") {
116+
activeModules[i] == "ECL" ||
117+
activeModules[i] == "FD") {
116118
LOGP(fatal, "List of active modules contains {}, which is not a run 3 module", activeModules[i]);
117119
}
118120
}
@@ -130,6 +132,7 @@ void SimConfig::determineActiveModules(std::vector<std::string> const& inputargs
130132
d == DetID::TF3 ||
131133
d == DetID::RCH ||
132134
d == DetID::ECL ||
135+
d == DetID::FD ||
133136
d == DetID::MI3) {
134137
activeModules.emplace_back(DetID::getName(d));
135138
}
@@ -149,7 +152,7 @@ void SimConfig::determineActiveModules(std::vector<std::string> const& inputargs
149152
activeModules.emplace_back("SHIL");
150153
for (int d = DetID::First; d <= DetID::Last; ++d) {
151154
#ifdef ENABLE_UPGRADES
152-
if (d != DetID::IT3 && d != DetID::TRK && d != DetID::FT3 && d != DetID::FCT && d != DetID::TF3 && d != DetID::RCH && d != DetID::ECL && d != DetID::MI3) {
155+
if (d != DetID::IT3 && d != DetID::TRK && d != DetID::FT3 && d != DetID::FCT && d != DetID::TF3 && d != DetID::RCH && d != DetID::ECL && d != DetID::FD && d != DetID::MI3) {
153156
activeModules.emplace_back(DetID::getName(d));
154157
}
155158
}

DataFormats/Detectors/Common/include/DetectorsCommonDataFormats/DetID.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ class DetID
8787
static constexpr ID RCH = 23;
8888
static constexpr ID MI3 = 24;
8989
static constexpr ID ECL = 25;
90-
static constexpr ID Last = ECL;
90+
static constexpr ID FD = 26;
91+
static constexpr ID Last = FD;
9192
#else
9293
static constexpr ID Last = FOC; ///< if extra detectors added, update this !!!
9394
#endif
@@ -181,7 +182,7 @@ class DetID
181182
// detector names, will be defined in DataSources
182183
static constexpr const char* sDetNames[nDetectors + 1] = ///< defined detector names
183184
#ifdef ENABLE_UPGRADES
184-
{"ITS", "TPC", "TRD", "TOF", "PHS", "CPV", "EMC", "HMP", "MFT", "MCH", "MID", "ZDC", "FT0", "FV0", "FDD", "TST", "CTP", "FOC", "IT3", "TRK", "FT3", "FCT", "TF3", "RCH", "MI3", "ECL", nullptr};
185+
{"ITS", "TPC", "TRD", "TOF", "PHS", "CPV", "EMC", "HMP", "MFT", "MCH", "MID", "ZDC", "FT0", "FV0", "FDD", "TST", "CTP", "FOC", "IT3", "TRK", "FT3", "FCT", "TF3", "RCH", "MI3", "ECL", "FD", nullptr};
185186
#else
186187
{"ITS", "TPC", "TRD", "TOF", "PHS", "CPV", "EMC", "HMP", "MFT", "MCH", "MID", "ZDC", "FT0", "FV0", "FDD", "TST", "CTP", "FOC", nullptr};
187188
#endif
@@ -195,7 +196,7 @@ class DetID
195196
#ifdef ENABLE_UPGRADES
196197
,
197198
o2h::gDataOriginIT3, o2h::gDataOriginTRK, o2h::gDataOriginFT3, o2h::gDataOriginFCT, o2h::gDataOriginTF3,
198-
o2h::gDataOriginRCH, o2h::gDataOriginMI3, o2h::gDataOriginECL
199+
o2h::gDataOriginRCH, o2h::gDataOriginMI3, o2h::gDataOriginECL, o2h::gDataOriginFD
199200
#endif
200201
};
201202
#endif // GPUCA_GPUCODE_DEVICE
@@ -211,10 +212,11 @@ GPUconstexpr() DetID::mask_t sMasks[DetID::nDetectors] = ///< detectot masks
211212
DetID::mask_t(math_utils::bit2Mask(DetID::CPV)), DetID::mask_t(math_utils::bit2Mask(DetID::EMC)), DetID::mask_t(math_utils::bit2Mask(DetID::HMP)), DetID::mask_t(math_utils::bit2Mask(DetID::MFT)), DetID::mask_t(math_utils::bit2Mask(DetID::MCH)),
212213
DetID::mask_t(math_utils::bit2Mask(DetID::MID)), DetID::mask_t(math_utils::bit2Mask(DetID::ZDC)), DetID::mask_t(math_utils::bit2Mask(DetID::FT0)), DetID::mask_t(math_utils::bit2Mask(DetID::FV0)), DetID::mask_t(math_utils::bit2Mask(DetID::FDD)),
213214
DetID::mask_t(math_utils::bit2Mask(DetID::TST)), DetID::mask_t(math_utils::bit2Mask(DetID::CTP)), DetID::mask_t(math_utils::bit2Mask(DetID::FOC))
215+
214216
#ifdef ENABLE_UPGRADES
215217
,
216218
DetID::mask_t(math_utils::bit2Mask(DetID::IT3)), DetID::mask_t(math_utils::bit2Mask(DetID::TRK)), DetID::mask_t(math_utils::bit2Mask(DetID::FT3)), DetID::mask_t(math_utils::bit2Mask(DetID::FCT)), DetID::mask_t(math_utils::bit2Mask(DetID::TF3)),
217-
DetID::mask_t(math_utils::bit2Mask(DetID::RCH)), DetID::mask_t(math_utils::bit2Mask(DetID::MI3)), DetID::mask_t(math_utils::bit2Mask(DetID::ECL))
219+
DetID::mask_t(math_utils::bit2Mask(DetID::RCH)), DetID::mask_t(math_utils::bit2Mask(DetID::MI3)), DetID::mask_t(math_utils::bit2Mask(DetID::ECL)), DetID::mask_t(math_utils::bit2Mask(DetID::FD))
218220
#endif
219221
};
220222
} // namespace detid_internal

DataFormats/Detectors/Common/include/DetectorsCommonDataFormats/SimTraits.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ class SimTraits
9999
/*TF3*/ VS{ "TF3Hit" },
100100
/*RCH*/ VS{ "RCHHit" },
101101
/*MI3*/ VS{ "MI3Hit" },
102-
/*ECL*/ VS{ "ECLHit" }
102+
/*ECL*/ VS{ "ECLHit" },
103+
/*FD */ VS{ "FDHit" }
103104
#endif
104105
};
105106
// clang-format on

DataFormats/Headers/include/Headers/DataHeader.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,7 @@ constexpr o2::header::DataOrigin gDataOriginTF3{"TF3"};
588588
constexpr o2::header::DataOrigin gDataOriginRCH{"RCH"};
589589
constexpr o2::header::DataOrigin gDataOriginMI3{"MI3"};
590590
constexpr o2::header::DataOrigin gDataOriginECL{"ECL"}; // upgrades
591+
constexpr o2::header::DataOrigin gDataOriginFD{"FD"}; // upgrades
591592

592593
constexpr o2::header::DataOrigin gDataOriginGPU{"GPU"};
593594

Detectors/FIT/FT0/macros/FT0Misaligner.C

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,30 @@
1+
// Copyright 2021-2025 CERN and copyright holders of ALICE O2.
2+
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3+
// All rights not expressly granted are reserved.
4+
//
5+
// This software is distributed under the terms of the GNU General Public
6+
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7+
//
8+
// In applying this license CERN does not waive the privileges and immunities
9+
// granted to it by virtue of its status as an Intergovernmental Organization
10+
// or submit itself to any jurisdiction.
11+
12+
/// \file FT0Misaligner.C
13+
/// \brief ROOT macro for creating an FT0 geometry alignment object. Based on ITSMisaligner.C
14+
///
15+
/// \author Andreas Molander andreas.molander@cern.ch, Alla Maevskaya
16+
117
#if !defined(__CLING__) || defined(__ROOTCLING__)
2-
//#define ENABLE_UPGRADES
18+
19+
#include "CCDB/CcdbApi.h"
320
#include "DetectorsCommonDataFormats/DetID.h"
421
#include "DetectorsCommonDataFormats/DetectorNameConf.h"
522
#include "DetectorsCommonDataFormats/AlignParam.h"
6-
#include "DetectorsBase/GeometryManager.h"
7-
#include "CCDB/CcdbApi.h"
8-
#include "FT0Base/Geometry.h"
9-
#include <TRandom.h>
23+
1024
#include <TFile.h>
1125
#include <vector>
1226
#include <fmt/format.h>
27+
1328
#endif
1429

1530
using AlgPar = std::array<double, 6>;
@@ -23,19 +38,15 @@ void FT0Misaligner(const std::string& ccdbHost = "http://ccdb-test.cern.ch:8080"
2338
const std::string& fileName = "FT0Alignment.root")
2439
{
2540
std::vector<o2::detectors::AlignParam> params;
26-
o2::base::GeometryManager::loadGeometry("", false);
27-
// auto geom = o2::ft0::Geometry::Instance();
2841
AlgPar pars;
2942
bool glo = true;
3043

3144
o2::detectors::DetID detFT0("FT0");
3245

33-
// FT0 detector
34-
//set A side
3546
std::string symNameA = "FT0A";
3647
pars = generateMisalignment(xA, yA, zA, psiA, thetaA, phiA);
3748
params.emplace_back(symNameA.c_str(), -1, pars[0], pars[1], pars[2], pars[3], pars[4], pars[5], glo);
38-
//set C side
49+
3950
std::string symNameC = "FT0C";
4051
pars = generateMisalignment(xC, yC, zC, psiC, thetaC, phiC);
4152
params.emplace_back(symNameC.c_str(), -1, pars[0], pars[1], pars[2], pars[3], pars[4], pars[5], glo);
@@ -57,14 +68,15 @@ void FT0Misaligner(const std::string& ccdbHost = "http://ccdb-test.cern.ch:8080"
5768
algFile.Close();
5869
}
5970
}
71+
6072
AlgPar generateMisalignment(double x, double y, double z, double psi, double theta, double phi)
6173
{
6274
AlgPar pars;
63-
pars[0] = gRandom->Gaus(0, x);
64-
pars[1] = gRandom->Gaus(0, y);
65-
pars[2] = gRandom->Gaus(0, z);
66-
pars[3] = gRandom->Gaus(0, psi);
67-
pars[4] = gRandom->Gaus(0, theta);
68-
pars[5] = gRandom->Gaus(0, phi);
75+
pars[0] = x;
76+
pars[1] = y;
77+
pars[2] = z;
78+
pars[3] = psi;
79+
pars[4] = theta;
80+
pars[5] = phi;
6981
return std::move(pars);
7082
}

Detectors/FIT/FV0/base/include/FV0Base/Geometry.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,16 @@ class Geometry
133133
return o2::base::GeometryManager::getPNEntry(getDetID(), index);
134134
}
135135

136+
static std::string getDetectorRightSymName()
137+
{
138+
return sDetectorRightName + "_0";
139+
}
140+
141+
static std::string getDetectorLeftSymName()
142+
{
143+
return sDetectorLeftName + "_1";
144+
}
145+
136146
/// Get the density of the PMTs.
137147
static constexpr float getPmtDensity()
138148
{
@@ -143,6 +153,8 @@ class Geometry
143153
explicit Geometry(EGeoType initType);
144154

145155
inline static const std::string sDetectorName = "FV0";
156+
inline static const std::string sDetectorRightName = sDetectorName + "RIGHT";
157+
inline static const std::string sDetectorLeftName = sDetectorName + "LEFT";
146158

147159
// General geometry constants
148160
static constexpr float sEpsilon = 0.01; ///< Used to make one spatial dimension infinitesimally larger than other

Detectors/FIT/FV0/macros/FV0Misaligner.C

Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,32 @@
1+
// Copyright 2021-2025 CERN and copyright holders of ALICE O2.
2+
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3+
// All rights not expressly granted are reserved.
4+
//
5+
// This software is distributed under the terms of the GNU General Public
6+
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7+
//
8+
// In applying this license CERN does not waive the privileges and immunities
9+
// granted to it by virtue of its status as an Intergovernmental Organization
10+
// or submit itself to any jurisdiction.
11+
12+
/// \file FV0Misaligner.C
13+
/// \brief ROOT macro for creating an FV0 geometry alignment object. The alignment object will align both
14+
/// detector halves in the same way. Based on ITSMisaligner.C
15+
///
16+
/// \author Andreas Molander andreas.molander@cern.ch, Alla Maevskaya
17+
118
#if !defined(__CLING__) || defined(__ROOTCLING__)
19+
20+
#include "CCDB/CcdbApi.h"
221
#include "DetectorsCommonDataFormats/DetID.h"
322
#include "DetectorsCommonDataFormats/DetectorNameConf.h"
423
#include "DetectorsCommonDataFormats/AlignParam.h"
5-
#include "DetectorsBase/GeometryManager.h"
6-
#include "CCDB/CcdbApi.h"
7-
#include <TRandom.h>
24+
#include "FV0Base/Geometry.h"
25+
826
#include <TFile.h>
927
#include <vector>
1028
#include <fmt/format.h>
29+
1130
#endif
1231

1332
using AlgPar = std::array<double, 6>;
@@ -20,16 +39,14 @@ void FV0Misaligner(const std::string& ccdbHost = "http://ccdb-test.cern.ch:8080"
2039
const std::string& fileName = "FV0Alignment.root")
2140
{
2241
std::vector<o2::detectors::AlignParam> params;
23-
o2::base::GeometryManager::loadGeometry("", false);
2442
AlgPar pars;
2543
bool glo = true;
2644

2745
o2::detectors::DetID detFV0("FV0");
2846

29-
// FV0 detector
30-
for (int ihalf = 1; ihalf < 3; ihalf++) {
31-
std::string symName = Form("FV0half_%i", ihalf);
32-
pars = generateMisalignment(x, y, z, psi, theta, phi);
47+
pars = generateMisalignment(x, y, z, psi, theta, phi);
48+
49+
for (auto& symName : {o2::fv0::Geometry::getDetectorRightSymName(), o2::fv0::Geometry::getDetectorLeftSymName()}) {
3350
params.emplace_back(symName.c_str(), -1, pars[0], pars[1], pars[2], pars[3], pars[4], pars[5], glo);
3451
}
3552

@@ -50,14 +67,15 @@ void FV0Misaligner(const std::string& ccdbHost = "http://ccdb-test.cern.ch:8080"
5067
algFile.Close();
5168
}
5269
}
70+
5371
AlgPar generateMisalignment(double x, double y, double z, double psi, double theta, double phi)
5472
{
5573
AlgPar pars;
56-
pars[0] = gRandom->Gaus(0, x);
57-
pars[1] = gRandom->Gaus(0, y);
58-
pars[2] = gRandom->Gaus(0, z);
59-
pars[3] = gRandom->Gaus(0, psi);
60-
pars[4] = gRandom->Gaus(0, theta);
61-
pars[5] = gRandom->Gaus(0, phi);
74+
pars[0] = x;
75+
pars[1] = y;
76+
pars[2] = z;
77+
pars[3] = psi;
78+
pars[4] = theta;
79+
pars[5] = phi;
6280
return std::move(pars);
6381
}

Detectors/FIT/FV0/simulation/src/Detector.cxx

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,7 @@ void Detector::ConstructGeometry()
280280
// mGeometry->enableComponent(Geometry::eAluminiumContainer, false);
281281
mGeometry->buildGeometry();
282282
}
283+
283284
void Detector::addAlignableVolumes() const
284285
{
285286
//
@@ -292,19 +293,19 @@ void Detector::addAlignableVolumes() const
292293
LOG(info) << "FV0: Add alignable volumes";
293294

294295
if (!gGeoManager) {
295-
LOG(fatal) << "TGeoManager doesn't exist !";
296+
LOG(fatal) << "TGeoManager doesn't exist!";
296297
return;
297298
}
298299

299-
TString volPath, symName;
300-
for (auto& half : {"RIGHT_0", "LEFT_1"}) {
301-
volPath = Form("/cave_1/barrel_1/FV0_1/FV0%s", half);
302-
symName = Form("FV0%s", half);
303-
LOG(info) << "FV0: Add alignable volume: " << symName << ": " << volPath;
304-
if (!gGeoManager->SetAlignableEntry(symName.Data(), volPath.Data())) {
305-
LOG(fatal) << "FV0: Unable to set alignable entry! " << symName << ": " << volPath;
300+
auto addAlignabelVolume = [](const std::string& volPath, const std::string& symName) -> void {
301+
LOG(info) << "FV0: Add alignable volume: " << symName << " <-> " << volPath;
302+
if (!gGeoManager->SetAlignableEntry(symName.c_str(), volPath.c_str())) {
303+
LOG(fatal) << "FV0: Unable to set alignable entry! " << symName << " <-> " << volPath;
306304
}
307-
}
305+
};
306+
307+
addAlignabelVolume("/cave_1/barrel_1/FV0_1/FV0RIGHT_0", Geometry::getDetectorRightSymName());
308+
addAlignabelVolume("/cave_1/barrel_1/FV0_1/FV0LEFT_1", Geometry::getDetectorLeftSymName());
308309
}
309310

310311
o2::fv0::Hit* Detector::addHit(Int_t trackId, Int_t cellId,

Detectors/FIT/macros/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,9 @@ o2_add_test_root_macro(compareRecPoints.C
4545
O2::DataFormatsFIT
4646
LABELS fit)
4747

48+
o2_add_test_root_macro(readAlignParam.C
49+
PUBLIC_LINK_LIBRARIES O2::CCDB
50+
LABELS fit)
51+
4852
o2_data_file(COPY readFITDCSdata.C DESTINATION Detectors/FIT/macros/)
4953
o2_data_file(COPY readFITDeadChannelMap.C DESTINATION Detectors/FIT/macros/)

0 commit comments

Comments
 (0)