Skip to content

Commit

Permalink
ALICE 3: Add ECal detector (AliceO2Group#12682)
Browse files Browse the repository at this point in the history
* Resize Magnet accoding to SD

* Add ECal as Pb Cylinder

* Update GeometryTGeo.h
  • Loading branch information
mconcas authored Feb 15, 2024
1 parent 05d2989 commit 144a9aa
Show file tree
Hide file tree
Showing 20 changed files with 625 additions and 13 deletions.
8 changes: 4 additions & 4 deletions Common/SimConfig/src/SimConfig.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,14 @@ void SimConfig::determineActiveModules(std::vector<std::string> const& inputargs
if (activeModules[0] != "all") {
if (isUpgrade) {
for (int i = 0; i < activeModules.size(); ++i) {
if (activeModules[i] != "IT3" && activeModules[i] != "TRK" && activeModules[i] != "FT3" && activeModules[i] != "FCT" && activeModules[i] != "A3IP" && activeModules[i] != "TF3" && activeModules[i] != "RCH" && activeModules[i] != "MI3") {
if (activeModules[i] != "IT3" && activeModules[i] != "TRK" && activeModules[i] != "FT3" && activeModules[i] != "FCT" && activeModules[i] != "A3IP" && activeModules[i] != "TF3" && activeModules[i] != "RCH" && activeModules[i] != "MI3" && activeModules[i] != "ECL") {
LOGP(fatal, "List of active modules contains {}, which is not a module from the upgrades.", activeModules[i]);
}
}
}
if (!isUpgrade) {
for (int i = 0; i < activeModules.size(); ++i) {
if (activeModules[i] == "TRK" || activeModules[i] == "FT3" || activeModules[i] == "FCT" || activeModules[i] == "A3IP" && activeModules[i] == "TF3" && activeModules[i] == "RCH" && activeModules[i] == "MI3") {
if (activeModules[i] == "TRK" || activeModules[i] == "FT3" || activeModules[i] == "FCT" || activeModules[i] == "A3IP" && activeModules[i] == "TF3" && activeModules[i] == "RCH" && activeModules[i] == "MI3" && activeModules[i] == "ECL") {
LOGP(fatal, "List of active modules contains {}, which is not a run 3 module", activeModules[i]);
}
}
Expand All @@ -93,7 +93,7 @@ void SimConfig::determineActiveModules(std::vector<std::string> const& inputargs
#ifdef ENABLE_UPGRADES
if (isUpgrade) {
for (int d = DetID::First; d <= DetID::Last; ++d) {
if (d == DetID::TRK || d == DetID::FT3 || d == DetID::FCT || d == DetID::TF3 || d == DetID::RCH) {
if (d == DetID::TRK || d == DetID::FT3 || d == DetID::FCT || d == DetID::TF3 || d == DetID::RCH || d == DetID::ECL) {
activeModules.emplace_back(DetID::getName(d));
}
}
Expand All @@ -112,7 +112,7 @@ void SimConfig::determineActiveModules(std::vector<std::string> const& inputargs
activeModules.emplace_back("SHIL");
for (int d = DetID::First; d <= DetID::Last; ++d) {
#ifdef ENABLE_UPGRADES
if (d != DetID::IT3 && d != DetID::TRK && d != DetID::FT3 && d != DetID::FCT && d != DetID::TF3 && d != DetID::RCH && d != DetID::MI3) {
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) {
activeModules.emplace_back(DetID::getName(d));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ class DetID
static constexpr ID TF3 = 22;
static constexpr ID RCH = 23;
static constexpr ID MI3 = 24;
static constexpr ID Last = MI3;
static constexpr ID ECL = 25;
static constexpr ID Last = ECL;
#else
static constexpr ID Last = FOC; ///< if extra detectors added, update this !!!
#endif
Expand Down Expand Up @@ -180,7 +181,7 @@ class DetID
// detector names, will be defined in DataSources
static constexpr const char* sDetNames[nDetectors + 1] = ///< defined detector names
#ifdef ENABLE_UPGRADES
{"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", nullptr};
{"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};
#else
{"ITS", "TPC", "TRD", "TOF", "PHS", "CPV", "EMC", "HMP", "MFT", "MCH", "MID", "ZDC", "FT0", "FV0", "FDD", "TST", "CTP", "FOC", nullptr};
#endif
Expand All @@ -194,7 +195,7 @@ class DetID
#ifdef ENABLE_UPGRADES
,
o2h::gDataOriginIT3, o2h::gDataOriginTRK, o2h::gDataOriginFT3, o2h::gDataOriginFCT, o2h::gDataOriginTF3,
o2h::gDataOriginRCH, o2h::gDataOriginMI3
o2h::gDataOriginRCH, o2h::gDataOriginMI3, o2h::gDataOriginECL
#endif
};
#endif // GPUCA_GPUCODE_DEVICE
Expand All @@ -213,7 +214,7 @@ GPUconstexpr() DetID::mask_t sMasks[DetID::nDetectors] = ///< detectot masks
#ifdef ENABLE_UPGRADES
,
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)),
DetID::mask_t(math_utils::bit2Mask(DetID::RCH)), DetID::mask_t(math_utils::bit2Mask(DetID::MI3))
DetID::mask_t(math_utils::bit2Mask(DetID::RCH)), DetID::mask_t(math_utils::bit2Mask(DetID::MI3)), DetID::mask_t(math_utils::bit2Mask(DetID::ECL))
#endif
};
} // namespace detid_internal
Expand Down
3 changes: 2 additions & 1 deletion DataFormats/Headers/include/Headers/DataHeader.h
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,8 @@ constexpr o2::header::DataOrigin gDataOriginFT3{"FT3"};
constexpr o2::header::DataOrigin gDataOriginFCT{"FCT"};
constexpr o2::header::DataOrigin gDataOriginTF3{"TF3"};
constexpr o2::header::DataOrigin gDataOriginRCH{"RCH"};
constexpr o2::header::DataOrigin gDataOriginMI3{"MI3"}; // upgrades
constexpr o2::header::DataOrigin gDataOriginMI3{"MI3"};
constexpr o2::header::DataOrigin gDataOriginECL{"ECL"}; // upgrades

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

Expand Down
1 change: 1 addition & 0 deletions Detectors/Upgrades/ALICE3/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

add_subdirectory(Passive)
add_subdirectory(TRK)
add_subdirectory(ECal)
add_subdirectory(FT3)
add_subdirectory(FCT)
add_subdirectory(AOD)
Expand Down
13 changes: 13 additions & 0 deletions Detectors/Upgrades/ALICE3/ECal/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2019-2020 CERN and copyright holders of ALICE O2.
# See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
# All rights not expressly granted are reserved.
#
# This software is distributed under the terms of the GNU General Public
# License v3 (GPL Version 3), copied verbatim in the file "COPYING".
#
# In applying this license CERN does not waive the privileges and immunities
# granted to it by virtue of its status as an Intergovernmental Organization
# or submit itself to any jurisdiction.

add_subdirectory(base)
add_subdirectory(simulation)
10 changes: 10 additions & 0 deletions Detectors/Upgrades/ALICE3/ECal/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!-- doxy
\page refDetectorsUpgradesALICE3TRK Tracker
/doxy -->

# ALICE 3 Electromagnetic Calorimenter

This is top page for the ECL detector documentation.

<!-- doxy
/doxy -->
19 changes: 19 additions & 0 deletions Detectors/Upgrades/ALICE3/ECal/base/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2019-2020 CERN and copyright holders of ALICE O2.
# See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
# All rights not expressly granted are reserved.
#
# This software is distributed under the terms of the GNU General Public
# License v3 (GPL Version 3), copied verbatim in the file "COPYING".
#
# In applying this license CERN does not waive the privileges and immunities
# granted to it by virtue of its status as an Intergovernmental Organization
# or submit itself to any jurisdiction.

o2_add_library(ECalBase
SOURCES src/GeometryTGeo.cxx
src/ECalBaseParam.cxx
PUBLIC_LINK_LIBRARIES O2::DetectorsBase)

o2_target_root_dictionary(ECalBase
HEADERS include/ECalBase/GeometryTGeo.h
include/ECalBase/ECalBaseParam.h)
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

#ifndef O2_ECAL_BASEPARAM_H
#define O2_ECAL_BASEPARAM_H

#include "CommonUtils/ConfigurableParam.h"
#include "CommonUtils/ConfigurableParamHelper.h"

namespace o2
{
namespace ecal
{
struct ECalBaseParam : public o2::conf::ConfigurableParamHelper<ECalBaseParam> {
float rMin = 125.0; // cm
float rMax = 155.0; // cm
float zLength = 350.0; // cm

O2ParamDef(ECalBaseParam, "ECalBase");
};

} // namespace ecal
} // end namespace o2

#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

#ifndef ALICEO2_ECAL_GEOMETRYTGEO_H
#define ALICEO2_ECAL_GEOMETRYTGEO_H

#include <DetectorsCommonDataFormats/DetMatrixCache.h>

namespace o2
{
namespace ecal
{
class GeometryTGeo : public o2::detectors::DetMatrixCache
{
public:
GeometryTGeo(bool build = false, int loadTrans = 0);
void Build(int loadTrans);
void fillMatrixCache(int mask);
static GeometryTGeo* Instance();

static const char* getECalVolPattern() { return sVolumeName.c_str(); }
static const char* getECalSensorPattern() { return sSensorName.c_str(); }

static const char* composeSymNameECal()
{
return Form("%s_%d", o2::detectors::DetID(o2::detectors::DetID::ECL).getName(), 0);
}
static const char* composeSymNameSensor(); // A single sensor for the moment

protected:
static std::string sVolumeName;
static std::string sSensorName;

private:
static std::unique_ptr<o2::ecal::GeometryTGeo> sInstance;
};
} // namespace ecal
} // namespace o2
#endif
22 changes: 22 additions & 0 deletions Detectors/Upgrades/ALICE3/ECal/base/src/ECalBaseLinkDef.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

#ifdef __CLING__

#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;

#pragma link C++ class o2::ecal::GeometryTGeo +
#pragma link C++ class o2::ecal::ECalBaseParam + ;
#pragma link C++ class o2::conf::ConfigurableParamHelper < o2::ecal::ECalBaseParam> + ;

#endif
14 changes: 14 additions & 0 deletions Detectors/Upgrades/ALICE3/ECal/base/src/ECalBaseParam.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

#include "ECalBase/ECalBaseParam.h"

O2ParamImpl(o2::ecal::ECalBaseParam);
66 changes: 66 additions & 0 deletions Detectors/Upgrades/ALICE3/ECal/base/src/GeometryTGeo.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

#include <ECalBase/GeometryTGeo.h>
#include <TGeoManager.h>

namespace o2
{
namespace ecal
{
std::unique_ptr<o2::ecal::GeometryTGeo> GeometryTGeo::sInstance;

std::string GeometryTGeo::sVolumeName = "ECALV";
std::string GeometryTGeo::sSensorName = "ECALSensor";

GeometryTGeo::GeometryTGeo(bool build, int loadTrans) : DetMatrixCache()
{
if (sInstance) {
LOGP(fatal, "Invalid use of public constructor: o2::ecal::GeometryTGeo instance exists");
}
if (build) {
Build(loadTrans);
}
}

void GeometryTGeo::Build(int loadTrans)
{
if (isBuilt()) {
LOGP(warning, "Already built");
return; // already initialized
}

if (!gGeoManager) {
LOGP(fatal, "Geometry is not loaded");
}

fillMatrixCache(loadTrans);
}

void GeometryTGeo::fillMatrixCache(int mask)
{
}

GeometryTGeo* GeometryTGeo::Instance()
{
if (!sInstance) {
sInstance = std::unique_ptr<GeometryTGeo>(new GeometryTGeo(true, 0));
}
return sInstance.get();
}

const char* GeometryTGeo::composeSymNameSensor()
{
return Form("%s/%d", composeSymNameECal(), 0);
}

} // namespace ecal
} // namespace o2
18 changes: 18 additions & 0 deletions Detectors/Upgrades/ALICE3/ECal/simulation/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright 2019-2020 CERN and copyright holders of ALICE O2.
# See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
# All rights not expressly granted are reserved.
#
# This software is distributed under the terms of the GNU General Public
# License v3 (GPL Version 3), copied verbatim in the file "COPYING".
#
# In applying this license CERN does not waive the privileges and immunities
# granted to it by virtue of its status as an Intergovernmental Organization
# or submit itself to any jurisdiction.

o2_add_library(ECalSimulation
SOURCES src/Detector.cxx
PUBLIC_LINK_LIBRARIES O2::ECalBase
O2::ITSMFTSimulation)

o2_target_root_dictionary(ECalSimulation
HEADERS include/ECalSimulation/Detector.h)
Loading

0 comments on commit 144a9aa

Please sign in to comment.