Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various small changes #1485

Merged
merged 11 commits into from
Jan 8, 2025
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ message("${BoldBlue}C++ version set to: ${CMAKE_CXX_STANDARD}\n${ColourReset}")
set(CMAKE_CXX_STANDARD_REQUIRED True)

#----------------------------------------------------------------------------
# configure the include directories and set other variables (could mayme have just one include_directories for both linux and macOS?)
# configure the include directories and set other variables (could maybe have just one include_directories for both linux and macOS?)
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
include_directories(${PROJECT_SOURCE_DIR}/include ${ROOT_INCLUDE_DIRS} ${X11_INCLUDE_DIR})
add_compile_options(-DOS_DARWIN)
Expand Down Expand Up @@ -450,6 +450,6 @@ endif()
#----------------------------------------------------------------------------
# create a compile_commands.json file which can be used for clang-tidy
if(NOT DEFINED ENV{CMAKE_EXPORT_COMPILE_COMMANDS})
message("ENV(CMAKE_EXPORT_COMPILE_COMMANDS) NOT DEFINED")
set($ENV{CMAKE_EXPORT_COMPILE_COMMANDS} TRUE)
message("ENV(CMAKE_EXPORT_COMPILE_COMMANDS) NOT DEFINED, setting it to TRUE")
set($ENV{CMAKE_EXPORT_COMPILE_COMMANDS} TRUE)
endif()
10 changes: 2 additions & 8 deletions include/GH2D.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,8 @@ class GH2D : public TH2D, public GH2Base {

void Draw(Option_t* opt = "") override;
virtual void Draw(TCutG*);

#if ROOT_VERSION_CODE < ROOT_VERSION(6, 0, 0)
TH1* DrawCopy(Option_t* opt = "") const;
#else
TH1* DrawCopy(Option_t* opt = "", const char* name_postfix = "_copy") const override;
#endif

TH1* DrawNormalized(Option_t* opt = "", Double_t norm = 1) const override;
TH1* DrawCopy(Option_t* opt = "", const char* name_postfix = "_copy") const override;
TH1* DrawNormalized(Option_t* opt = "", Double_t norm = 1) const override;

void Clear(Option_t* opt = "") override;
void Print(Option_t* opt = "") const override;
Expand Down
6 changes: 0 additions & 6 deletions include/GH2I.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,7 @@ class GH2I : public TH2I, public GH2Base {
~GH2I();

void Draw(Option_t* opt = "") override;

#if ROOT_VERSION_CODE < ROOT_VERSION(6, 0, 0)
TH1* DrawCopy(Option_t* opt = "") const;
#else
TH1* DrawCopy(Option_t* opt = "", const char* name_postfix = "_copy") const override;
#endif

TH1* DrawNormalized(Option_t* opt = "", Double_t norm = 1) const override;

void Clear(Option_t* opt = "") override;
Expand Down
19 changes: 5 additions & 14 deletions include/TEfficiencyCalibrator.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class TEfficiencyTab {
kAB3Peak = 2,
kGauss = 3 };

TEfficiencyTab(TEfficiencyDatatypeTab* parent, TNucleus* nucleus, std::tuple<TH1*, TH2*, TH2*> hists, TGCompositeFrame* frame, const int& verboseLevel = 0);
TEfficiencyTab(TEfficiencyDatatypeTab* parent, TNucleus* nucleus, std::tuple<TH1*, TH2*, TH2*> hists, TGCompositeFrame* frame);
TEfficiencyTab(const TEfficiencyTab&) = default;
TEfficiencyTab(TEfficiencyTab&&) noexcept = default;
TEfficiencyTab& operator=(const TEfficiencyTab&) = default;
Expand All @@ -75,8 +75,6 @@ class TEfficiencyTab {
void Disconnect();
void Status(Int_t event, Int_t px, Int_t py, TObject* selected);

void VerboseLevel(int val) { fVerboseLevel = val; }

// getters
std::vector<std::tuple<TTransition*, double, double, double, double, double, double, double, double>> Peaks() const { return fPeaks; }
const char* GetName() const { return fNucleus->GetName(); }
Expand Down Expand Up @@ -105,7 +103,6 @@ class TEfficiencyTab {
std::vector<std::tuple<TTransition*, double, double, double, double, double, double, double, double>> fPeaks;
std::vector<TObject*> fFitFunctions; ///< vector with all fits of the singles histogram
std::vector<TObject*> fRemovedFitFunctions; ///< vector with all removed fits of the singles histogram
int fVerboseLevel{0}; ///< Changes verbosity from 0 (quiet) to 4 (very verbose)
};

class TEfficiencyDatatypeTab {
Expand All @@ -131,7 +128,7 @@ class TEfficiencyDatatypeTab {
kPlotSummingInCheck,
kPlotSummingOutCheck };

TEfficiencyDatatypeTab(TEfficiencyCalibrator* parent, std::vector<TNucleus*> nucleus, std::vector<std::tuple<TH1*, TH2*, TH2*>> hists, TGCompositeFrame* frame, const std::string& dataType, TGHProgressBar* progressBar, const int& verboseLevel = 0);
TEfficiencyDatatypeTab(TEfficiencyCalibrator* parent, std::vector<TNucleus*> nucleus, std::vector<std::tuple<TH1*, TH2*, TH2*>> hists, TGCompositeFrame* frame, const std::string& dataType, TGHProgressBar* progressBar);
TEfficiencyDatatypeTab(const TEfficiencyDatatypeTab&) = default;
TEfficiencyDatatypeTab(TEfficiencyDatatypeTab&&) noexcept = default;
TEfficiencyDatatypeTab& operator=(const TEfficiencyDatatypeTab&) = default;
Expand All @@ -142,12 +139,6 @@ class TEfficiencyDatatypeTab {
void MakeConnections();
void Disconnect();

void VerboseLevel(int val)
{
fVerboseLevel = val;
for(auto& tab : fEfficiencyTab) { tab->VerboseLevel(val); }
}

void Status(Int_t event, Int_t px, Int_t py, TObject* selected);
void DrawGraph();
void UpdateEfficiencyGraph();
Expand Down Expand Up @@ -203,7 +194,6 @@ class TEfficiencyDatatypeTab {
std::vector<TNucleus*> fNucleus; ///< the source nuclei
TEfficiencyCalibrator* fParent; ///< the parent of this tab
std::string fDataType; ///< data type of this tab
int fVerboseLevel{0}; ///< Changes verbosity from 0 (quiet) to 4 (very verbose)
TCalibrationGraphSet* fEfficiencyGraph{nullptr}; ///< the combined efficiency graph from all sources
TCalibrationGraphSet* fUncorrEfficiencyGraph{nullptr}; ///< the combined uncorrected efficiency graph from all sources
TCalibrationGraphSet* fPeakAreaGraph{nullptr}; ///< the combined peak area graph from all sources
Expand Down Expand Up @@ -291,7 +281,8 @@ class TEfficiencyCalibrator : public TGMainFrame {
static int LineHeight() { return fLineHeight; }
static int WindowWidth() { return fWindowWidth; }

void VerboseLevel(int val) { fVerboseLevel = val; }
static int VerboseLevel() { return fVerboseLevel; }
static void VerboseLevel(int val) { fVerboseLevel = val; }

std::vector<TCalibrationGraphSet*> EfficiencyGraphs() { return fEfficiencyGraph; }
size_t NumberOfEfficiencyGraphs() { return fEfficiencyGraph.size(); }
Expand All @@ -307,7 +298,7 @@ class TEfficiencyCalibrator : public TGMainFrame {
void MakeSecondConnections();
void DisconnectSecond();

int fVerboseLevel{4}; ///< Changes verbosity from 0 (quiet) to 4 (very verbose)
static int fVerboseLevel; ///< Changes verbosity from 0 (quiet) to 4 (very verbose)
static double fRange;
static double fThreshold;
static int fBgParam; ///< the bg parameter used to determine the background in the gamma spectra
Expand Down
2 changes: 1 addition & 1 deletion libraries/GROOT/GCanvas.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ bool GCanvas::Process1DKeyboardPress(Event_t*, const UInt_t* keysym)
break;

case kKey_g:
if(GausFit(hists.back(), fMarkers.at(fMarkers.size() - 2)->GetLocalX(), fMarkers.back()->GetLocalX()) != nullptr) {
if(!hists.empty() && GetNMarkers() > 1 && GausFit(hists.back(), fMarkers.at(fMarkers.size() - 2)->GetLocalX(), fMarkers.back()->GetLocalX()) != nullptr) {
edited = true;
}
break;
Expand Down
6 changes: 0 additions & 6 deletions libraries/GROOT/GH2D.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,9 @@ void GH2D::Draw(TCutG* cut)
TH2D::Draw(option.c_str());
}

#if ROOT_VERSION_CODE < ROOT_VERSION(6, 0, 0)
TH1* GH2D::DrawCopy(Option_t* opt) const
{
TH1* hist = TH2D::DrawCopy(opt);
#else
TH1* GH2D::DrawCopy(Option_t* opt, const char* name_postfix) const
{
TH1* hist = TH2D::DrawCopy(opt, name_postfix);
#endif
if(gPad != nullptr) {
gPad->Update();
gPad->GetFrame()->SetBit(TBox::kCannotMove);
Expand Down
6 changes: 0 additions & 6 deletions libraries/GROOT/GH2I.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,9 @@ void GH2I::Draw(Option_t* opt)
}
}

#if ROOT_VERSION_CODE < ROOT_VERSION(6, 0, 0)
TH1* GH2I::DrawCopy(Option_t* opt) const
{
TH1* hist = TH2I::DrawCopy(opt);
#else
TH1* GH2I::DrawCopy(Option_t* opt, const char* name_postfix) const
{
TH1* hist = TH2I::DrawCopy(opt, name_postfix);
#endif
if(gPad) {
gPad->Update();
gPad->GetFrame()->SetBit(TBox::kCannotMove);
Expand Down
2 changes: 2 additions & 0 deletions libraries/GROOT/GRootCommands.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
#include "TObject.h"
#include "TObjArray.h"
#include "TH1.h"
#ifdef HAS_CORRECT_PYTHON_VERSION
#include "TPython.h"
#endif
#include "TTimer.h"
#include "TF1.h"

Expand Down
Loading
Loading