Skip to content

Commit 98be4e6

Browse files
committed
Add legacy root compatibility
1 parent 5158161 commit 98be4e6

3 files changed

Lines changed: 13 additions & 1 deletion

File tree

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@ target_include_directories(Pluto PRIVATE
9797
inc
9898
)
9999

100+
SET(ROOT_VERSION_LEGACY 6.22.00)
101+
if (${ROOT_VERSION} VERSION_LESS ${ROOT_VERSION_LEGACY})
102+
target_compile_definitions(LEGACY_ROOT)
103+
endif()
104+
100105
#---Create a main program using the library
101106
#add_executable(Main MainEvent.cxx)
102107
#target_link_libraries(Main Event)

src/PAngularDistribution.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,11 @@ PAngularDistribution::PAngularDistribution(const Char_t *id,const Char_t *de) :
8080
fParErrors.resize(fNpar);
8181
fParMin.resize(fNpar);
8282
fParMax.resize(fNpar);
83+
#ifdef LEGACY_ROOT
84+
fParams = new TF1Parameters(fNpar);
85+
#else
8386
fParams = std::move(std::make_unique<TF1Parameters>(fNpar));
84-
87+
#endif
8588
fParErrors[0] = 0;
8689
fParMin[0] = 0;
8790
fParMax[0] = 0;

src/PChannelModel.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,11 @@ PChannelModel::PChannelModel(const Char_t *id, const Char_t *de, Int_t key) :
181181
fParErrors.resize(fNpar);
182182
fParMin.resize(fNpar);
183183
fParMax.resize(fNpar);
184+
#ifdef LEGACY_ROOT
185+
fParams = new TF1Parameters(fNpar);
186+
#else
184187
fParams = std::move(std::make_unique<TF1Parameters>(fNpar));
188+
#endif
185189
for (int i = 0; i < fNpar; i++) {
186190
fParErrors[i] = 0;
187191
fParMin[i] = 0;

0 commit comments

Comments
 (0)