Skip to content

Commit

Permalink
For now use raw pointers to avoid breaking changes
Browse files Browse the repository at this point in the history
  • Loading branch information
KSkwarczynski committed Feb 24, 2025
1 parent 317e5ab commit f39d22b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions samplePDF/samplePDFBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ samplePDFBase::samplePDFBase()
rnd = new TRandom3(0);
dathist = NULL;
dathist2d = NULL;
Modes = nullptr;
}

samplePDFBase::~samplePDFBase()
{
if(dathist != NULL) delete dathist;
if(dathist2d != NULL) delete dathist2d;
if(Modes != nullptr) delete Modes;
delete rnd;
}

Expand Down
4 changes: 2 additions & 2 deletions samplePDF/samplePDFBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class samplePDFBase
virtual inline double getSampleLikelihood(const int isample){(void) isample; return GetLikelihood();};

/// @brief Return pointer to MaCh3 modes
MaCh3Modes* GetMaCh3Modes() const { return Modes.get(); }
MaCh3Modes* GetMaCh3Modes() const { return Modes; }

TH1D* get1DHist();
TH2D* get2DHist();
Expand Down Expand Up @@ -108,7 +108,7 @@ class samplePDFBase
std::vector<std::string> SampleName;

/// Holds information about used Generator and MaCh3 modes
std::unique_ptr<MaCh3Modes> Modes;
MaCh3Modes* Modes;

TH1D *dathist; // tempstore for likelihood calc
TH2D *dathist2d;
Expand Down
2 changes: 1 addition & 1 deletion samplePDF/samplePDFFDBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ samplePDFFDBase::~samplePDFFDBase()
void samplePDFFDBase::ReadSampleConfig()
{
auto ModeName = Get<std::string>(SampleManager->raw()["MaCh3ModeConfig"], __FILE__ , __LINE__);
Modes = std::make_unique<MaCh3Modes>(ModeName);
Modes = new MaCh3Modes(ModeName);
samplename = Get<std::string>(SampleManager->raw()["SampleName"], __FILE__ , __LINE__);
SampleDetID = Get<std::string>(SampleManager->raw()["DetID"], __FILE__ , __LINE__);
NuOscillatorConfigFile = Get<std::string>(SampleManager->raw()["NuOsc"]["NuOscConfigFile"], __FILE__ , __LINE__);
Expand Down

0 comments on commit f39d22b

Please sign in to comment.