Skip to content

Commit 2101aa7

Browse files
authored
Adding FT3 detector for ALICE3 EndCaps simulation (#5526)
* Adding ALICE EC0 Detector (EndCaps) Created simple forward layers to get started with ALICE 3 endcaps simulation. Based on the ITSMFT classes, much like the ALICE TRK detector. * Make clang-format happy * Make codecheck happy * Naming ALICE 3 Forward Tracker (end caps): FT3 * Adding symmetric tracker at forward and backward directions FT3 is now composed of symmetric forward and backward layers. This commit also removes unused methods.
1 parent 960f272 commit 2101aa7

File tree

25 files changed

+1133
-12
lines changed

25 files changed

+1133
-12
lines changed

Common/SimConfig/src/SimConfig.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ bool SimConfig::resetFromParsedMap(boost::program_options::variables_map const&
6060
active.clear();
6161
for (int d = DetID::First; d <= DetID::Last; ++d) {
6262
#ifdef ENABLE_UPGRADES
63-
if (d != DetID::IT3 && d != DetID::TRK) {
63+
if (d != DetID::IT3 && d != DetID::TRK && d != DetID::FT3) {
6464
active.emplace_back(DetID::getName(d));
6565
}
6666
#else

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ class DetID
7171
#ifdef ENABLE_UPGRADES
7272
static constexpr ID IT3 = 16;
7373
static constexpr ID TRK = 17;
74-
static constexpr ID Last = TRK;
74+
static constexpr ID FT3 = 18;
75+
static constexpr ID Last = FT3;
7576
#else
7677
static constexpr ID Last = ACO; ///< if extra detectors added, update this !!!
7778
#endif
@@ -134,7 +135,7 @@ class DetID
134135

135136
static constexpr const char* sDetNames[nDetectors + 1] = ///< defined detector names
136137
#ifdef ENABLE_UPGRADES
137-
{"ITS", "TPC", "TRD", "TOF", "PHS", "CPV", "EMC", "HMP", "MFT", "MCH", "MID", "ZDC", "FT0", "FV0", "FDD", "ACO", "IT3", "TRK", nullptr};
138+
{"ITS", "TPC", "TRD", "TOF", "PHS", "CPV", "EMC", "HMP", "MFT", "MCH", "MID", "ZDC", "FT0", "FV0", "FDD", "ACO", "IT3", "TRK", "FT3", nullptr};
138139
#else
139140
{"ITS", "TPC", "TRD", "TOF", "PHS", "CPV", "EMC", "HMP", "MFT", "MCH", "MID", "ZDC", "FT0", "FV0", "FDD", "ACO", nullptr};
140141
#endif
@@ -146,7 +147,7 @@ class DetID
146147
math_utils::bit2Mask(ACO)
147148
#ifdef ENABLE_UPGRADES
148149
,
149-
math_utils::bit2Mask(IT3), math_utils::bit2Mask(TRK)
150+
math_utils::bit2Mask(IT3), math_utils::bit2Mask(TRK), math_utils::bit2Mask(FT3)
150151
#endif
151152
};
152153

@@ -157,7 +158,7 @@ class DetID
157158
o2h::gDataOriginMID, o2h::gDataOriginZDC, o2h::gDataOriginFT0, o2h::gDataOriginFV0, o2h::gDataOriginFDD, o2h::gDataOriginACO
158159
#ifdef ENABLE_UPGRADES
159160
,
160-
o2h::gDataOriginIT3, o2h::gDataOriginTRK
161+
o2h::gDataOriginIT3, o2h::gDataOriginTRK, o2h::gDataOriginFT3
161162
#endif
162163
};
163164

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ class SimTraits
3535
// initialization fragile since depends on correct order. Can we do better?
3636

3737
// clang-format off
38-
static inline const std::array<std::vector<std::string>, DetID::nDetectors> DETECTORBRANCHNAMES =
39-
{ /*ITS*/ VS{ "ITSHit" },
38+
static inline const std::array<std::vector<std::string>, DetID::nDetectors> DETECTORBRANCHNAMES =
39+
{ /*ITS*/ VS{ "ITSHit" },
4040
/*TPC*/ VS{ "TPCHitsShiftedSector0",
4141
"TPCHitsShiftedSector1",
4242
"TPCHitsShiftedSector2",
@@ -90,7 +90,8 @@ class SimTraits
9090
#ifdef ENABLE_UPGRADES
9191
,
9292
/*IT3*/ VS{ "IT3Hit" },
93-
/*TRK*/ VS{ "TRKHit" }
93+
/*TRK*/ VS{ "TRKHit" },
94+
/*FT3*/ VS{ "FT3Hit" }
9495
#endif
9596
};
9697
// clang-format on
@@ -227,11 +228,14 @@ template <>
227228
struct DetIDToHitTypes<o2::detectors::DetID::IT3> {
228229
using HitType = o2::itsmft::Hit;
229230
};
230-
231231
template <>
232232
struct DetIDToHitTypes<o2::detectors::DetID::TRK> {
233233
using HitType = o2::itsmft::Hit;
234234
};
235+
template <>
236+
struct DetIDToHitTypes<o2::detectors::DetID::FT3> {
237+
using HitType = o2::itsmft::Hit;
238+
};
235239
#endif
236240

237241
} // namespace detectors

DataFormats/Detectors/Common/src/DetID.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ constexpr DetID::ID DetID::ITS, DetID::TPC, DetID::TRD, DetID::TOF, DetID::PHS,
3131
#ifdef ENABLE_UPGRADES
3232
constexpr DetID::ID DetID::IT3;
3333
constexpr DetID::ID DetID::TRK;
34+
constexpr DetID::ID DetID::FT3;
3435
#endif
3536

3637
constexpr int DetID::nDetectors;

DataFormats/Headers/include/Headers/DataHeader.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -638,6 +638,8 @@ constexpr o2::header::DataOrigin gDataOriginZDC{"ZDC"};
638638
#ifdef ENABLE_UPGRADES
639639
constexpr o2::header::DataOrigin gDataOriginIT3{"IT3"};
640640
constexpr o2::header::DataOrigin gDataOriginTRK{"TRK"};
641+
constexpr o2::header::DataOrigin gDataOriginFT3{"FT3"};
642+
641643
#endif
642644

643645
//possible data types

Detectors/Upgrades/ALICE3/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@
1010

1111
add_subdirectory(Passive)
1212
add_subdirectory(TRK)
13-
add_subdirectory(AOD)
13+
add_subdirectory(FT3)
14+
add_subdirectory(AOD)
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Copyright CERN and copyright holders of ALICE O2. This software is distributed
2+
# under the terms of the GNU General Public License v3 (GPL Version 3), copied
3+
# verbatim in the file "COPYING".
4+
#
5+
# See http://alice-o2.web.cern.ch/license for full licensing information.
6+
#
7+
# In applying this license CERN does not waive the privileges and immunities
8+
# granted to it by virtue of its status as an Intergovernmental Organization or
9+
# submit itself to any jurisdiction.
10+
11+
add_subdirectory(simulation)
12+
add_subdirectory(base)
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!-- doxy
2+
\page refDetectorsPostLS4 EndCaps
3+
/doxy -->
4+
5+
# PostLS4EndCaps
6+
7+
This is a top page for the PostLS4EndCaps detector documentation.
8+
9+
<!-- doxy
10+
/doxy -->
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Copyright CERN and copyright holders of ALICE O2. This software is distributed
2+
# under the terms of the GNU General Public License v3 (GPL Version 3), copied
3+
# verbatim in the file "COPYING".
4+
#
5+
# See http://alice-o2.web.cern.ch/license for full licensing information.
6+
#
7+
# In applying this license CERN does not waive the privileges and immunities
8+
# granted to it by virtue of its status as an Intergovernmental Organization or
9+
# submit itself to any jurisdiction.
10+
11+
o2_add_library(FT3Base
12+
SOURCES src/GeometryTGeo.cxx
13+
PUBLIC_LINK_LIBRARIES O2::DetectorsBase O2::ITSMFTBase)
14+
15+
o2_target_root_dictionary(FT3Base
16+
HEADERS include/FT3Base/GeometryTGeo.h)
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
// Copyright CERN and copyright holders of ALICE O2. This software is
2+
// distributed under the terms of the GNU General Public License v3 (GPL
3+
// Version 3), copied verbatim in the file "COPYING".
4+
//
5+
// See http://alice-o2.web.cern.ch/license for full licensing information.
6+
//
7+
// In applying this license CERN does not waive the privileges and immunities
8+
// granted to it by virtue of its status as an Intergovernmental Organization
9+
// or submit itself to any jurisdiction.
10+
11+
/// \file GeometryTGeo.h
12+
/// \brief Definition of the GeometryTGeo class
13+
/// \author cvetan.cheshkov@cern.ch - 15/02/2007
14+
/// \author ruben.shahoyan@cern.ch - adapted to ITSupg 18/07/2012
15+
/// \author rafael.pezzi@cern.ch - adapted to PostLS4EndCaps 25/06/2020
16+
17+
#ifndef ALICEO2_FT3_GEOMETRYTGEO_H_
18+
#define ALICEO2_FT3_GEOMETRYTGEO_H_
19+
20+
#include <TGeoMatrix.h> // for TGeoHMatrix
21+
#include <TObject.h> // for TObject
22+
#include <array>
23+
#include <string>
24+
#include <vector>
25+
#include "DetectorsBase/GeometryManager.h"
26+
#include "DetectorsCommonDataFormats/DetID.h"
27+
#include "ITSMFTBase/GeometryTGeo.h"
28+
#include "MathUtils/Utils.h"
29+
#include "Rtypes.h" // for Int_t, Double_t, Bool_t, UInt_t, etc
30+
31+
class TGeoPNEntry;
32+
33+
namespace o2
34+
{
35+
namespace ft3
36+
{
37+
/// GeometryTGeo is a simple interface class to TGeoManager. It is used in the simulation
38+
/// in order to query the TGeo FT3 geometry.
39+
/// RS: In order to preserve the static character of the class but make it dynamically access
40+
/// geometry, we need to check in every method if the structures are initialized. To be converted
41+
/// to singleton at later stage.
42+
43+
class GeometryTGeo : public o2::itsmft::GeometryTGeo
44+
{
45+
public:
46+
typedef o2::math_utils::Transform3D Mat3D;
47+
using DetMatrixCache::getMatrixL2G;
48+
using DetMatrixCache::getMatrixT2GRot;
49+
using DetMatrixCache::getMatrixT2L;
50+
// this method is not advised for ITS: for barrel detectors whose tracking frame is just a rotation
51+
// it is cheaper to use T2GRot
52+
using DetMatrixCache::getMatrixT2G;
53+
54+
static GeometryTGeo* Instance()
55+
{
56+
// get (create if needed) a unique instance of the object
57+
if (!sInstance) {
58+
sInstance = std::unique_ptr<GeometryTGeo>(new GeometryTGeo(true, 0));
59+
}
60+
return sInstance.get();
61+
}
62+
63+
// adopt the unique instance from external raw pointer (to be used only to read saved instance from file)
64+
static void adopt(GeometryTGeo* raw);
65+
66+
// constructor
67+
// ATTENTION: this class is supposed to behave as a singleton, but to make it root-persistent
68+
// we must define public default constructor.
69+
// NEVER use it, it will throw exception if the class instance was already created
70+
// Use GeometryTGeo::Instance() instead
71+
GeometryTGeo(bool build = kFALSE, int loadTrans = 0
72+
/*o2::base::utils::bit2Mask(o2::TransformType::T2L, // default transformations to load
73+
o2::TransformType::T2G,
74+
o2::TransformType::L2G)*/
75+
);
76+
77+
/// Default destructor
78+
~GeometryTGeo() override = default;
79+
80+
GeometryTGeo(const GeometryTGeo& src) = delete;
81+
GeometryTGeo& operator=(const GeometryTGeo& geom) = delete;
82+
83+
// implement filling of the matrix cache
84+
using o2::itsmft::GeometryTGeo::fillMatrixCache;
85+
void fillMatrixCache(int mask) override;
86+
87+
/// Exract FT3 parameters from TGeo
88+
void Build(int loadTrans = 0) override;
89+
90+
void Print(Option_t* opt = "") const;
91+
static const char* getFT3VolPattern() { return sVolumeName.c_str(); }
92+
static const char* getFT3LayerPattern() { return sLayerName.c_str(); }
93+
static const char* getFT3ChipPattern() { return sChipName.c_str(); }
94+
static const char* getFT3SensorPattern() { return sSensorName.c_str(); }
95+
96+
static const char* composeSymNameFT3(Int_t d) { return Form("%s_%d", o2::detectors::DetID(o2::detectors::DetID::FT3).getName(), d); }
97+
static const char* composeSymNameLayer(Int_t d, Int_t lr);
98+
static const char* composeSymNameChip(Int_t d, Int_t lr);
99+
static const char* composeSymNameSensor(Int_t d, Int_t lr);
100+
101+
protected:
102+
static constexpr int MAXLAYERS = 15; ///< max number of active layers
103+
104+
Int_t mNumberOfLayers; ///< number of layers
105+
static std::string sVolumeName; ///< Mother volume name
106+
static std::string sLayerName; ///< Layer name
107+
static std::string sChipName; ///< Chip name
108+
109+
static std::string sSensorName; ///< Sensor name
110+
111+
private:
112+
static std::unique_ptr<o2::ft3::GeometryTGeo> sInstance; ///< singletone instance
113+
114+
ClassDefOverride(GeometryTGeo, 1); // FT3 geometry based on TGeo
115+
};
116+
} // namespace ft3
117+
} // namespace o2
118+
119+
#endif

0 commit comments

Comments
 (0)