Skip to content

Commit 7146960

Browse files
pkurashalibuild
authored andcommitted
FD detector (#13476)
* basic geometry and data format for new detector * fixed geometry and json * fixed hits * updated geometry and detector source code * updated geometry and detector source code * minor fixes * sensitive volumes * geometry update * geometry update * enable hits * enable hits * enable hits * fix channel ids * More flexible confgurable parameters * More flexible confgurable parameters * update parameters and geometry * fixed ring sizes * merge conflict * GPU * fix conflicts * resolve conflicts * head * GPU * added Constants.h to store constants * Adding Constants.h and correcting formatting issues * Adding Constants.h and correcting formatting issues * Adding Constants.h and correcting formatting issues * Adding Constants.h and correcting formatting issues * Adding Constants.h and correcting formatting issues * Adding Constants.h and correcting formatting issues * created new namespace * created new namespace * created new namespace * change name of the detector * change name of the detector * check errors * check errors * Flexible ring radii, a new Boolean switch for module A, module coverage in eta independent of their position * correct default number of ring of A side * Modified default parameters * Hits from charged tracks only * Fixed hit merging * return to the previous choice * updated eta min/max definitions * updated eta definitions * remove spurious files * Update CMake * removed GPU file * Add FD detector * including aluminium containers * including aluminium containers * including aluminium containers * including aluminium containers * including aluminium containers * Please consider the following formatting changes * Updated Readme * introduced FD hit data format * introduced FD hit data format * corrected copyright notice * corrected copyright notice * corrected copyright notice * Finding detId from fMC * colors * change detector name * change detector name * change detector name * change detector name * Fix formatting in CMakeLists.txt for FD3Simulation --------- Co-authored-by: ALICE Action Bot <alibuild@cern.ch>
1 parent 26a12a6 commit 7146960

File tree

28 files changed

+1131
-11
lines changed

28 files changed

+1131
-11
lines changed

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] != "FD3") {
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] == "FD3") {
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::FD3 ||
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::FD3 && 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 FD3 = 26;
91+
static constexpr ID Last = FD3;
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", "FD3", 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::gDataOriginFD3
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::FD3))
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
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Copyright 2019-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+
add_subdirectory(FD3)
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Copyright 2019-2020 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+
o2_add_library(DataFormatsFD3
13+
SOURCES src/Hit.cxx
14+
PUBLIC_LINK_LIBRARIES O2::FD3Base
15+
O2::SimulationDataFormat
16+
O2::CommonDataFormat
17+
Microsoft.GSL::GSL
18+
O2::DetectorsCommonDataFormats
19+
)
20+
21+
o2_target_root_dictionary(DataFormatsFD3
22+
HEADERS include/DataFormatsFD3/Hit.h
23+
)
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
// Copyright 2019-2020 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 Hit.h
13+
/// \brief Definition of the FD3 Hit class (based on ITSMFT and FV0)
14+
15+
#ifndef ALICEO2_FVD_HIT_H_
16+
#define ALICEO2_FVD_HIT_H_
17+
18+
#include <iosfwd>
19+
#include "SimulationDataFormat/BaseHits.h" // for BasicXYZEHit
20+
#include "Rtypes.h" // for Bool_t, Double_t, int, Double32_t, etc
21+
#include "TVector3.h" // for TVector3
22+
#include "CommonUtils/ShmAllocator.h"
23+
24+
namespace o2
25+
{
26+
namespace fd3
27+
{
28+
29+
class Hit : public o2::BasicXYZEHit<float, float>
30+
{
31+
public:
32+
/// Default constructor
33+
Hit() = default;
34+
35+
/// Class Constructor
36+
/// \param trackID Index of MCTrack
37+
/// \param cellID Cell ID
38+
/// \param startPos Coordinates at entrance to active volume [cm]
39+
/// \param endPos Coordinates to active volume [cm]
40+
/// \param startMom Momentum of track at entrance [GeV]
41+
/// \param startE Energy of track at entrance [GeV]
42+
/// \param endTime Final time [ns]
43+
/// \param eLoss Energy deposit [GeV]
44+
/// \param particlePdg PDG code of the partcile associated with the track
45+
inline Hit(int trackID,
46+
int cellID,
47+
const math_utils::Point3D<float>& startPos,
48+
const math_utils::Point3D<float>& endPos,
49+
const math_utils::Vector3D<float>& startMom,
50+
double startE,
51+
double endTime,
52+
double eLoss,
53+
int particlePdg);
54+
55+
// Entrance position getters
56+
math_utils::Point3D<float> const& GetPosStart() const { return mPositionStart; }
57+
float GetStartX() const { return mPositionStart.X(); }
58+
float GetStartY() const { return mPositionStart.Y(); }
59+
float GetStartZ() const { return mPositionStart.Z(); }
60+
template <typename F>
61+
void GetStartPosition(F& x, F& y, F& z) const
62+
{
63+
x = GetStartX();
64+
y = GetStartY();
65+
z = GetStartZ();
66+
}
67+
68+
// Momentum getters
69+
math_utils::Vector3D<float> const& GetMomentum() const { return mMomentumStart; }
70+
math_utils::Vector3D<float>& GetMomentum() { return mMomentumStart; }
71+
float GetPx() const { return mMomentumStart.X(); }
72+
float GetPy() const { return mMomentumStart.Y(); }
73+
float GetPz() const { return mMomentumStart.Z(); }
74+
float GetE() const { return mEnergyStart; }
75+
float GetTotalEnergyAtEntrance() const { return GetE(); }
76+
int GetParticlePdg() const { return mParticlePdg; }
77+
78+
void Print(const Option_t* opt) const;
79+
80+
private:
81+
math_utils::Vector3D<float> mMomentumStart; ///< momentum at entrance
82+
math_utils::Point3D<float> mPositionStart; ///< position at entrance (base mPos give position on exit)
83+
float mEnergyStart; ///< total energy at entrance
84+
int mParticlePdg; ///< PDG code of the particle associated with this track
85+
86+
ClassDefNV(Hit, 1);
87+
};
88+
89+
Hit::Hit(int trackID,
90+
int detID,
91+
const math_utils::Point3D<float>& startPos,
92+
const math_utils::Point3D<float>& endPos,
93+
const math_utils::Vector3D<float>& startMom,
94+
double startE,
95+
double endTime,
96+
double eLoss,
97+
int particlePdg)
98+
: BasicXYZEHit(endPos.X(),
99+
endPos.Y(),
100+
endPos.Z(),
101+
endTime,
102+
eLoss,
103+
trackID,
104+
detID),
105+
mMomentumStart(startMom.X(), startMom.Y(), startMom.Z()),
106+
mPositionStart(startPos.X(), startPos.Y(), startPos.Z()),
107+
mEnergyStart(startE),
108+
mParticlePdg(particlePdg)
109+
{
110+
}
111+
112+
} // namespace fd3
113+
} // namespace o2
114+
115+
#ifdef USESHM
116+
namespace std
117+
{
118+
template <>
119+
class allocator<o2::fd3::Hit> : public o2::utils::ShmAllocator<o2::fd3::Hit>
120+
{
121+
};
122+
123+
} // namespace std
124+
#endif /* USESHM */
125+
#endif /* ALICEO2_FD3_HIT_H_ */
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Copyright 2019-2020 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+
#ifdef __CLING__
13+
14+
#pragma link off all globals;
15+
#pragma link off all classes;
16+
#pragma link off all functions;
17+
18+
#pragma link C++ class o2::fd3::Hit + ;
19+
#pragma link C++ class vector < o2::fd3::Hit> + ;
20+
21+
#endif
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// Copyright 2019-2020 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 Hit.cxx
13+
/// \brief Implementation of the Hit class
14+
15+
#include "DataFormatsFD3/Hit.h"
16+
#include <iostream>
17+
18+
ClassImp(o2::fd3::Hit);
19+
20+
namespace o2
21+
{
22+
namespace fd3
23+
{
24+
25+
void Hit::Print(const Option_t* opt) const
26+
{
27+
printf(
28+
"Det: %5d Track: %6d E.loss: %.3e P: %+.3e %+.3e %+.3e\n"
29+
"PosIn: %+.3e %+.3e %+.3e PosOut: %+.3e %+.3e %+.3e\n",
30+
GetDetectorID(), GetTrackID(), GetEnergyLoss(), GetPx(), GetPy(), GetPz(),
31+
GetStartX(), GetStartY(), GetStartZ(), GetX(), GetY(), GetZ());
32+
}
33+
34+
} // namespace fd3
35+
} // namespace o2

DataFormats/Detectors/Upgrades/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2019-2020 CERN and copyright holders of ALICE O2.
1+
# Copyright 2019-2025 CERN and copyright holders of ALICE O2.
22
# See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
33
# All rights not expressly granted are reserved.
44
#
@@ -10,3 +10,4 @@
1010
# or submit itself to any jurisdiction.
1111

1212
message(STATUS "Building dataformats for upgrades")
13+
add_subdirectory(ALICE3)

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 gDataOriginFD3{"FD3"}; // upgrades
591592

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

0 commit comments

Comments
 (0)