Skip to content

Commit 5f8d73c

Browse files
committed
Make Upgrades optional
1 parent 7e2b26f commit 5f8d73c

44 files changed

Lines changed: 318 additions & 753 deletions

Some content is hidden

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

DataFormats/Detectors/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,6 @@ add_subdirectory(CPV)
2424

2525
if(ENABLE_UPGRADES)
2626
add_subdirectory(Upgrades)
27+
else()
28+
message(STATUS "Not building dataformats for upgrades")
2729
endif()

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

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,13 @@ class DetID
6868
static constexpr ID FV0 = 13;
6969
static constexpr ID FDD = 14;
7070
static constexpr ID ACO = 15;
71-
static constexpr ID ITS3 = 16;
71+
#ifdef ENABLE_UPGRADES
72+
static constexpr ID IT3 = 16;
73+
static constexpr ID Last = IT3;
74+
#else
75+
static constexpr ID Last = ACO; ///< if extra detectors added, update this !!!
76+
#endif
7277
static constexpr ID First = ITS;
73-
static constexpr ID Last = ITS3; ///< if extra detectors added, update this !!!
7478

7579
static constexpr int nDetectors = Last + 1; ///< number of defined detectors
7680

@@ -127,20 +131,33 @@ class DetID
127131
ID mID = First; ///< detector ID
128132

129133
static constexpr const char* sDetNames[nDetectors + 1] = ///< defined detector names
130-
131-
{"ITS", "TPC", "TRD", "TOF", "PHS", "CPV", "EMC", "HMP", "MFT", "MCH", "MID", "ZDC", "FT0", "FV0", "FDD", "ACO", "ITS3", nullptr};
132-
134+
#ifdef ENABLE_UPGRADES
135+
{"ITS", "TPC", "TRD", "TOF", "PHS", "CPV", "EMC", "HMP", "MFT", "MCH", "MID", "ZDC", "FT0", "FV0", "FDD", "ACO", "IT3", nullptr};
136+
#else
137+
{"ITS", "TPC", "TRD", "TOF", "PHS", "CPV", "EMC", "HMP", "MFT", "MCH", "MID", "ZDC", "FT0", "FV0", "FDD", "ACO", nullptr};
138+
#endif
133139
// detector names, will be defined in DataSources
134140
static constexpr std::array<mask_t, nDetectors> sMasks = ///< detectot masks
135141
{utils::bit2Mask(ITS), utils::bit2Mask(TPC), utils::bit2Mask(TRD), utils::bit2Mask(TOF), utils::bit2Mask(PHS),
136142
utils::bit2Mask(CPV), utils::bit2Mask(EMC), utils::bit2Mask(HMP), utils::bit2Mask(MFT), utils::bit2Mask(MCH),
137143
utils::bit2Mask(MID), utils::bit2Mask(ZDC), utils::bit2Mask(FT0), utils::bit2Mask(FV0), utils::bit2Mask(FDD),
138-
utils::bit2Mask(ACO), utils::bit2Mask(ITS3)};
144+
utils::bit2Mask(ACO)
145+
#ifdef ENABLE_UPGRADES
146+
,
147+
utils::bit2Mask(IT3)
148+
#endif
149+
};
139150

140-
static constexpr std::array<o2h::DataOrigin, nDetectors> sOrigins = ///< detector data origins
151+
static constexpr std::array<o2h::DataOrigin, nDetectors>
152+
sOrigins = ///< detector data origins
141153
{o2h::gDataOriginITS, o2h::gDataOriginTPC, o2h::gDataOriginTRD, o2h::gDataOriginTOF, o2h::gDataOriginPHS,
142154
o2h::gDataOriginCPV, o2h::gDataOriginEMC, o2h::gDataOriginHMP, o2h::gDataOriginMFT, o2h::gDataOriginMCH,
143-
o2h::gDataOriginMID, o2h::gDataOriginZDC, o2h::gDataOriginFT0, o2h::gDataOriginFV0, o2h::gDataOriginFDD, o2h::gDataOriginACO};
155+
o2h::gDataOriginMID, o2h::gDataOriginZDC, o2h::gDataOriginFT0, o2h::gDataOriginFV0, o2h::gDataOriginFDD, o2h::gDataOriginACO
156+
#ifdef ENABLE_UPGRADES
157+
,
158+
o2h::gDataOriginIT3
159+
#endif
160+
};
144161

145162
ClassDefNV(DetID, 1);
146163
};

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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,11 @@ class SimTraits
8686
/*FT0*/ VS{ "FT0Hit" },
8787
/*FV0*/ VS{ "FV0Hit" },
8888
/*FDD*/ VS{ "FDDHit" },
89-
/*ACO*/ VS{ "ACOHit" },
90-
/*ITS3*/ VS{ "ITS3Hit" }
89+
/*ACO*/ VS{ "ACOHit" }
90+
#ifdef ENABLE_UPGRADES
91+
,
92+
/*IT3*/ VS{ "ITS3Hit" }
93+
#endif
9194
};
9295
// clang-format on
9396

@@ -218,10 +221,12 @@ template <>
218221
struct DetIDToHitTypes<o2::detectors::DetID::TPC> {
219222
using HitType = o2::tpc::HitGroup;
220223
};
224+
#ifdef ENABLE_UPGRADES
221225
template <>
222-
struct DetIDToHitTypes<o2::detectors::DetID::ITS3> {
226+
struct DetIDToHitTypes<o2::detectors::DetID::IT3> {
223227
using HitType = o2::itsmft::Hit;
224228
};
229+
#endif
225230

226231
} // namespace detectors
227232

DataFormats/Detectors/Common/src/DetID.cxx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ constexpr std::array<DetID::mask_t, DetID::nDetectors> DetID::sMasks;
2828
constexpr DetID::ID DetID::ITS, DetID::TPC, DetID::TRD, DetID::TOF, DetID::PHS, DetID::CPV, DetID::EMC,
2929
DetID::HMP, DetID::MFT, DetID::MCH, DetID::MID, DetID::ZDC, DetID::FT0, DetID::FV0, DetID::FDD, DetID::ACO, DetID::First, DetID::Last;
3030

31+
#ifdef ENABLE_UPGRADES
32+
constexpr DetID::ID DetID::IT3;
33+
#endif
34+
3135
constexpr int DetID::nDetectors;
3236

3337
/// detector masks from any non-alpha-num delimiter-separated list (empty if NONE is supplied)

DataFormats/Headers/include/Headers/DataHeader.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@
4242
#include "MemoryResources/Types.h"
4343
#include <cerrno>
4444

45+
#define ENABLE_UPGRADES
46+
4547
namespace o2
4648
{
4749
namespace header
@@ -632,6 +634,9 @@ constexpr o2::header::DataOrigin gDataOriginTOF{"TOF"};
632634
constexpr o2::header::DataOrigin gDataOriginTPC{"TPC"};
633635
constexpr o2::header::DataOrigin gDataOriginTRD{"TRD"};
634636
constexpr o2::header::DataOrigin gDataOriginZDC{"ZDC"};
637+
#ifdef ENABLE_UPGRADES
638+
constexpr o2::header::DataOrigin gDataOriginIT3{"IT3"};
639+
#endif
635640

636641
//possible data types
637642
constexpr o2::header::DataDescription gDataDescriptionAny{"***************"};

Detectors/Base/include/DetectorsBase/GeometryManager.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,12 @@ class GeometryManager : public TObject
128128
static Bool_t getOriginalMatrixFromPath(const char* path, TGeoHMatrix& m);
129129

130130
private:
131-
/// sensitive volume identifier composed from (det_mask<<sDetOffset)|(sensid&sSensorMask)
131+
/// sensitive volume identifier composed from (det_mask<<sDetOffset)|(sensid&sSensorMask)
132+
#ifdef ENABLE_UPGRADES
132133
static constexpr UInt_t sDetOffset = 14; /// detector identifier will start from this bit
134+
#else
135+
static constexpr UInt_t sDetOffset = 15; /// detector identifier will start from this bit
136+
#endif
133137
static constexpr UInt_t sSensorMask =
134138
(0x1 << sDetOffset) - 1; /// mask=max sensitive volumes allowed per detector (0xffff)
135139

Detectors/Base/src/GeometryManager.cxx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ Bool_t GeometryManager::getOriginalMatrix(const char* symname, TGeoHMatrix& m)
5151

5252
if (!gGeoManager || !gGeoManager->IsClosed()) {
5353
LOG(ERROR) << "No active geometry or geometry not yet closed!";
54-
;
5554
return kFALSE;
5655
}
5756

Detectors/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ add_subdirectory(GlobalTrackingWorkflow)
3434
add_subdirectory(Vertexing)
3535

3636
add_subdirectory(Calibration)
37-
add_subdirectory(Upgrade)
3837

3938
if(BUILD_SIMULATION)
4039
add_subdirectory(gconfig)
@@ -45,4 +44,6 @@ o2_data_file(COPY Geometry DESTINATION Detectors)
4544

4645
if(ENABLE_UPGRADES)
4746
add_subdirectory(Upgrades)
47+
else()
48+
message(STATUS "Not building detectors for upgrades")
4849
endif()

Detectors/Upgrade/ITS3/base/include/ITS3Base/ContainerFactory.h

Lines changed: 0 additions & 53 deletions
This file was deleted.

Detectors/Upgrade/ITS3/base/src/ContainerFactory.cxx

Lines changed: 0 additions & 54 deletions
This file was deleted.

0 commit comments

Comments
 (0)