Skip to content

Commit 805a3d7

Browse files
committed
Move FairRoot simulation infrastructure into O2
This is a step in the long-term refactoring towards a native Geant4 simulation. It decouples O2 from FairRoot by moving the simulation infrastructure that o2-sim depends on into the O2 repository. The imported classes retain their existing interfaces, so no changes are required in the current simulation code. The runtime parameter database, analysis framework, and other components that are unused by O2 are not imported, as their functionality is already provided by CCDB and ConfigurableParam. Owning these classes locally will allow future refactoring and cleanup without changing the current simulation behaviour. The imported sources keep their upstream formatting and licence headers, so they live under a 3rdparty directory and are excluded from clang-format. Requires the corresponding alidist update (fairroot.sh removal from o2.sh) to avoid duplicate ROOT dictionaries. Tested with o2-sim and o2-sim-serial; hits, MC tracks, and event headers are unchanged.
1 parent 383674d commit 805a3d7

220 files changed

Lines changed: 24479 additions & 1749 deletions

File tree

Some content is hidden

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

‎.clang-format-ignore‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
*.json
2+
# vendored FairRoot sources: keep upstream formatting
3+
Detectors/3rdparty/FairRootBase/**

‎Common/Field/CMakeLists.txt‎

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,17 @@
1010
# or submit itself to any jurisdiction.
1111

1212
o2_add_library(Field
13-
SOURCES src/MagFieldContFact.cxx
14-
src/MagFieldFact.cxx
15-
src/MagFieldFast.cxx
16-
src/MagFieldParam.cxx
13+
SOURCES src/MagFieldFast.cxx
1714
src/MagneticField.cxx
1815
src/MagneticWrapperChebyshev.cxx
1916
src/FieldOriginBiasParam.cxx
2017
src/ALICE3MagneticField.cxx
21-
PUBLIC_LINK_LIBRARIES O2::MathUtils FairRoot::Base O2::CommonUtils)
18+
PUBLIC_LINK_LIBRARIES O2::MathUtils O2::FairRootBase O2::CommonUtils)
2219

2320
o2_target_root_dictionary(Field
2421
HEADERS include/Field/MagneticWrapperChebyshev.h
2522
include/Field/MagneticField.h
26-
include/Field/MagFieldParam.h
27-
include/Field/MagFieldContFact.h
2823
include/Field/MagFieldFast.h
29-
include/Field/MagFieldFact.h
3024
include/Field/FieldOriginBiasParam.h
3125
include/Field/ALICE3MagneticField.h)
3226

‎Common/Field/include/Field/MagFieldContFact.h‎

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

‎Common/Field/include/Field/MagFieldFact.h‎

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

‎Common/Field/include/Field/MagFieldParam.h‎

Lines changed: 9 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,24 @@
1010
// or submit itself to any jurisdiction.
1111

1212
/// \file MagFieldParam.h
13-
/// \brief Definition of the MagFieldParam: container for ALICE mag. field parameters
13+
/// \brief Definition of the MagFieldParam: ALICE mag. field type enumerations
1414
/// \author ruben.shahoyan@cern.ch
1515

1616
#ifndef ALICEO2_FIELD_MAGFIELDPARAM_H_
1717
#define ALICEO2_FIELD_MAGFIELDPARAM_H_
1818

19-
#include "FairParGenericSet.h"
20-
#include <TString.h>
21-
22-
class FairParamList;
23-
2419
namespace o2
2520
{
2621
namespace field
2722
{
2823

29-
class MagneticField;
30-
31-
class MagFieldParam : public FairParGenericSet
32-
{
33-
public:
24+
/// Field map and beam type enumerations.
25+
///
26+
/// This used to be a FairParGenericSet container written into the FairRoot
27+
/// runtime database. That path was never populated nor read back in production
28+
/// (field settings come from CCDB/SimConfig via SimFieldUtils), so only the
29+
/// enumerations - which are used throughout O2 - are kept.
30+
struct MagFieldParam {
3431
enum BMap_t {
3532
k2kG,
3633
k5kG,
@@ -44,35 +41,8 @@ class MagFieldParam : public FairParGenericSet
4441
kBeamTypepA,
4542
kBeamTypeAp
4643
};
47-
48-
MagFieldParam(const char* name = "", const char* title = "", const char* context = "");
49-
50-
void SetParam(const MagneticField* field);
51-
52-
BMap_t GetMapType() const { return mMapType; }
53-
BeamType_t GetBeamType() const { return mBeamType; }
54-
Int_t GetDefInt() const { return mDefaultIntegration; }
55-
Double_t GetFactorSol() const { return mFactorSol; }
56-
Double_t GetFactorDip() const { return mFactorDip; }
57-
Double_t GetBeamEnergy() const { return mBeamEnergy; }
58-
Double_t GetMaxField() const { return mMaxField; }
59-
const char* GetMapPath() const { return mMapPath.Data(); }
60-
61-
void putParams(FairParamList* list) override;
62-
Bool_t getParams(FairParamList* list) override;
63-
64-
private:
65-
BMap_t mMapType; ///< map type ID
66-
BeamType_t mBeamType; ///< beam type ID
67-
Int_t mDefaultIntegration; ///< field integration type for MC
68-
Double_t mFactorSol; ///< solenoid current factor
69-
Double_t mFactorDip; ///< dipole current factor
70-
Double_t mBeamEnergy; ///< beam energy
71-
Double_t mMaxField; ///< max field for geant
72-
TString mMapPath; ///< path to map file
73-
74-
ClassDefOverride(MagFieldParam, 1);
7544
};
45+
7646
} // namespace field
7747
} // namespace o2
7848

‎Common/Field/include/Field/MagneticField.h‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@
2525
#include "TNamed.h" // for TNamed
2626
#include <memory> // for str::unique_ptr
2727

28-
class FairParamList;
29-
3028
namespace o2
3129
{
3230
namespace field
@@ -63,8 +61,6 @@ class MagneticField : public FairField
6361
MagFieldParam::BeamType_t btype = MagFieldParam::kBeamTypepp, Double_t benergy = -1, Int_t integ = 2,
6462
Double_t fmax = 15, const std::string path = "$(O2_ROOT)/share/Common/maps/mfchebKGI_sym.root");
6563

66-
MagneticField(const MagFieldParam& param);
67-
6864
MagneticField& operator=(const MagneticField& src);
6965

7066
/// Default destructor
@@ -147,9 +143,6 @@ class MagneticField : public FairField
147143
/// 3d field query alias for Alias Method to calculate the field at point xyz
148144
void GetBxyz(const Double_t p[3], Double_t* b) override { MagneticField::Field(p, b); }
149145

150-
/// Fill Paramater
151-
void FillParContainer() override;
152-
153146
/// Method to calculate the integral_0^z of br,bt,bz
154147
void getTPCIntegral(const Double_t* xyz, Double_t* b) const;
155148

‎Common/Field/src/FieldLinkDef.h‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616

1717
#pragma link C++ class o2::field::MagneticField + ;
1818
#pragma link C++ class o2::field::MagneticWrapperChebyshev + ;
19-
#pragma link C++ class o2::field::MagFieldParam + ;
20-
#pragma link C++ class o2::field::MagFieldContFact + ;
21-
#pragma link C++ class o2::field::MagFieldFact + ;
2219
#pragma link C++ class o2::field::MagFieldFast + ;
2320
#pragma link C++ class o2::field::ALICE3MagneticField + ;
2421

‎Common/Field/src/MagFieldContFact.cxx‎

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

‎Common/Field/src/MagFieldFact.cxx‎

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

0 commit comments

Comments
 (0)