Skip to content

Commit

Permalink
Merge pull request #1436 from GRIFFINCollaboration/create-pull-reques…
Browse files Browse the repository at this point in the history
…t/patch

[MegaLinter] Apply linters automatic fixes
  • Loading branch information
VinzenzBildstein authored Jul 10, 2024
2 parents 60338ce + 9c16e67 commit bebe5d8
Show file tree
Hide file tree
Showing 85 changed files with 1,336 additions and 1,298 deletions.
10 changes: 5 additions & 5 deletions GRSIProof/grsiproof.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ void Analyze(const char* treeType)
}

// Delete the proof chain now that we are done with it.
delete proofChain;
delete proofChain;
}

void AtExitHandler()
Expand All @@ -114,8 +114,8 @@ void AtExitHandler()
std::cout << "getting session logs ..." << std::endl;
TProofLog* pl = TProof::Mgr("proof://__lite__")->GetSessionLogs();
if(pl != nullptr) {
Int_t runNumber = TRunInfo::RunNumber();
Int_t subRunNumber = TRunInfo::SubRunNumber();
Int_t runNumber = TRunInfo::RunNumber();
Int_t subRunNumber = TRunInfo::SubRunNumber();

std::string firstMacro;
if(!gGRSIOpt->MacroInputFiles().empty()) { firstMacro = gGRSIOpt->MacroInputFiles().at(0); }
Expand Down Expand Up @@ -164,7 +164,7 @@ void HandleSignal(int)

static void CatchSignals()
{
struct sigaction action{};
struct sigaction action {};
action.sa_handler = HandleSignal;
action.sa_flags = 0;
sigemptyset(&action.sa_mask);
Expand Down Expand Up @@ -309,7 +309,7 @@ int main(int argc, char** argv)
}

gGRSIProof->SetBit(TProof::kUsingSessionGui);
TGRSIProof::AddEnvVar("GRSISYS", pPath);
TGRSIProof::AddEnvVar("GRSISYS", pPath);
gInterpreter->AddIncludePath(Form("%s/include", pPath));
gGRSIProof->AddIncludePath(Form("%s/include", pPath));
gGRSIProof->AddDynamicPath(Form("%s/lib", pPath));
Expand Down
2 changes: 1 addition & 1 deletion include/GH2Base.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class GH2Base {
};

iterator begin() { return {this, false}; }
iterator end() { return {this, true}; }
iterator end() { return {this, true}; }

private:
void Init();
Expand Down
2 changes: 1 addition & 1 deletion include/GValue.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class GValue : public TNamed {
GValue(const GValue& val);

double GetValue() const { return fValue; }
const char* GetInfo() const { return info.c_str(); }
const char* GetInfo() const { return info.c_str(); }

void SetValue(double value) { fValue = value; }
void SetInfo(const char* temp) { info.assign(temp); }
Expand Down
5 changes: 2 additions & 3 deletions include/StoppableThread.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@ class StoppableThread {
static void status_out();

protected:

// these are used directly by the various loops, but we could provided setters and getters and make them private?
// these are used directly by the various loops, but we could provided setters and getters and make them private?
#ifndef __CINT__
std::atomic_size_t fItemsPopped{0}; ///< number of items popped from input queue
std::atomic_long fInputSize{0}; ///< number of items in the input (queue), only updated within Iteration(), so not
Expand All @@ -106,7 +105,7 @@ class StoppableThread {

static std::map<std::string, StoppableThread*> fThreadMap;

static bool fStatusThreadOn;
static bool fStatusThreadOn;
#ifndef __CINT__
static std::thread fStatusThread;
std::thread fThread;
Expand Down
8 changes: 4 additions & 4 deletions include/TBGSubtraction.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,12 @@ class TBGSubtraction : public TGMainFrame {

public:
explicit TBGSubtraction(TH2* mat, const char* gate_axis = "x", int maxBinning = 20);
TBGSubtraction(const TBGSubtraction&) = delete;
TBGSubtraction(TBGSubtraction&&) = delete;
TBGSubtraction(const TBGSubtraction&) = delete;
TBGSubtraction(TBGSubtraction&&) = delete;
~TBGSubtraction() override;

TBGSubtraction& operator=(const TBGSubtraction&) = delete;
TBGSubtraction& operator=(TBGSubtraction&&) = delete;
TBGSubtraction& operator=(const TBGSubtraction&) = delete;
TBGSubtraction& operator=(TBGSubtraction&&) = delete;

void AxisComboSelected();
void PeakComboSelected();
Expand Down
6 changes: 3 additions & 3 deletions include/TBadFragment.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ class TBadFragment : public TFragment {
TBadFragment(TFragment& fragment, uint32_t* data, int size, int failedWord, bool multipleErrors);
explicit TBadFragment(TFragment& fragment);
TBadFragment(const TBadFragment&) = default;
TBadFragment(TBadFragment&&) = default;
~TBadFragment() = default;
TBadFragment(TBadFragment&&) = default;
~TBadFragment() = default;

TBadFragment& operator=(const TBadFragment&) = default;
TBadFragment& operator=(TBadFragment&&) = default;
TBadFragment& operator=(TBadFragment&&) = default;

std::vector<uint32_t> GetData() const { return fData; }
int GetFailedWord() const { return fFailedWord; }
Expand Down
4 changes: 2 additions & 2 deletions include/TBetaDecay.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ class TBetaDecay : public TNamed {
TBetaDecay(Int_t Z, Int_t N);
~TBetaDecay() override;

TBetaDecay(const TBetaDecay&) = delete;
TBetaDecay(TBetaDecay&&) = delete;
TBetaDecay(const TBetaDecay&) = delete;
TBetaDecay(TBetaDecay&&) = delete;
TBetaDecay& operator=(const TBetaDecay&) = delete;
TBetaDecay& operator=(TBetaDecay&&) = delete;

Expand Down
2 changes: 1 addition & 1 deletion include/TBgo.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class TBgo : public TDetector {
#ifndef __CINT__
void AddFragment(const std::shared_ptr<const TFragment>& frag, TChannel* chan) override; //!<!
#endif
void BuildHits() override {} // no need to build any hits, everything already done in AddFragment
void BuildHits() override {} // no need to build any hits, everything already done in AddFragment

TBgo& operator=(const TBgo&); //!<!
TBgo& operator=(TBgo&&); //!<!
Expand Down
4 changes: 2 additions & 2 deletions include/TBgoHit.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ class TBgoHit : public TDetectorHit {
TBgoHit();
TBgoHit(const TBgoHit&);
TBgoHit(TBgoHit&&);
// this is problematic as this means we're slicing the TFragment object to fit the
// TDetectorHit argument of the base constructor
// this is problematic as this means we're slicing the TFragment object to fit the
// TDetectorHit argument of the base constructor
explicit TBgoHit(const TFragment& frag) : TDetectorHit(frag) {}
~TBgoHit() override;

Expand Down
10 changes: 5 additions & 5 deletions include/TChannel.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ class TChannel : public TNamed {
TChannel(const TChannel&);
TChannel(TChannel&&);

TChannel& operator=(const TChannel& rhs);
TChannel& operator=(TChannel&&);
TChannel& operator=(const TChannel& rhs);
TChannel& operator=(TChannel&&);

~TChannel() override;

Expand Down Expand Up @@ -249,10 +249,10 @@ class TChannel : public TNamed {
fENGChi2.Address()->at(range) = tmp.Value();
}
}
inline void SetCFDChi2(const TPriorityValue<double>& tmp) { fCFDChi2 = tmp; }
inline void SetLEDChi2(const TPriorityValue<double>& tmp) { fLEDChi2 = tmp; }
inline void SetCFDChi2(const TPriorityValue<double>& tmp) { fCFDChi2 = tmp; }
inline void SetLEDChi2(const TPriorityValue<double>& tmp) { fLEDChi2 = tmp; }
inline void SetTIMEChi2(const TPriorityValue<double>& tmp) { fTIMEChi2 = tmp; }
inline void SetEFFChi2(const TPriorityValue<double>& tmp) { fEFFChi2 = tmp; }
inline void SetEFFChi2(const TPriorityValue<double>& tmp) { fEFFChi2 = tmp; }

inline void SetWaveRise(const double& temp)
{
Expand Down
10 changes: 5 additions & 5 deletions include/TDataFrameLibrary.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ class TDataFrameLibrary : public TSingleton<TDataFrameLibrary> {
}

private:
TDataFrameLibrary() = default;
TDataFrameLibrary(const TDataFrameLibrary&) = default;
TDataFrameLibrary(TDataFrameLibrary&&) = default;
TDataFrameLibrary& operator=(const TDataFrameLibrary&) = default;
TDataFrameLibrary& operator=(TDataFrameLibrary&&) = default;
TDataFrameLibrary() = default;
TDataFrameLibrary(const TDataFrameLibrary&) = default;
TDataFrameLibrary(TDataFrameLibrary&&) = default;
TDataFrameLibrary& operator=(const TDataFrameLibrary&) = default;
TDataFrameLibrary& operator=(TDataFrameLibrary&&) = default;

static void Compile(std::string& path, const size_t& dot, const size_t& slash);

Expand Down
2 changes: 1 addition & 1 deletion include/TDataParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class TDataParser {
virtual std::string OutputQueueStatus();

protected:
// TODO consider making all of these private with protected access functions
// TODO consider making all of these private with protected access functions
#ifndef __CINT__
std::vector<std::shared_ptr<ThreadsafeQueue<std::shared_ptr<const TFragment>>>> fGoodOutputQueues;
std::shared_ptr<ThreadsafeQueue<std::shared_ptr<const TBadFragment>>> fBadOutputQueue;
Expand Down
4 changes: 2 additions & 2 deletions include/TDetectorHit.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class TDetectorHit : public TObject {

explicit TDetectorHit(const int& Address = 0xffffffff);
TDetectorHit(const TDetectorHit&, bool copywave = true);
//TDetectorHit(const TFragment& frag) { Class()->IgnoreTObjectStreamer(); CopyFragment(frag); }
//TDetectorHit(const TFragment& frag) { Class()->IgnoreTObjectStreamer(); CopyFragment(frag); }
//void CopyFragment(const TFragment&);
// void CopyWaveform(const TFragment&);
~TDetectorHit() override;
Expand Down Expand Up @@ -137,7 +137,7 @@ class TDetectorHit : public TObject {
}

virtual TVector3 GetPosition(Double_t) const { return GetPosition(); } //!<!
virtual TVector3 GetPosition() const { return {0., 0., 0.}; } //!<!
virtual TVector3 GetPosition() const { return {0., 0., 0.}; } //!<!
virtual double GetEnergy(Option_t* opt = "") const;
virtual Double_t GetEnergyNonlinearity(double energy) const;
virtual Long64_t GetTimeStamp(Option_t* = "") const { return fTimeStamp; }
Expand Down
20 changes: 10 additions & 10 deletions include/TEpicsFrag.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

class TEpicsFrag : public TObject {
public:
TEpicsFrag() = default;
TEpicsFrag() = default;
~TEpicsFrag() override = default;

size_t GetSize() const { return fData.size(); }
Expand All @@ -39,7 +39,7 @@ class TEpicsFrag : public TObject {
if(index >= fData.size()) {
return fData.back();
}
return fData[index];
return fData[index];
}

void Clear(Option_t* opt = "") override; //!<!
Expand All @@ -57,18 +57,18 @@ class TEpicsFrag : public TObject {
static TEpicsFrag* GetScalerAtTime(Long64_t time);

// setters
void DaqTimeStamp(time_t val) { fDaqTimeStamp = val; }
void DaqId(Int_t val) { fDaqId = val; }
void Data(std::vector<float> val) { fData = val; }
void DaqTimeStamp(time_t val) { fDaqTimeStamp = val; }
void DaqId(Int_t val) { fDaqId = val; }
void Data(std::vector<float> val) { fData = val; }
void Name(std::vector<std::string> val) { fName = val; }

void AddData(float val) { fData.push_back(val); }
void AddData(float val) { fData.push_back(val); }
void AddName(std::string val) { fName.push_back(val); }

// getters
time_t DaqTimeStamp() { return fDaqTimeStamp; }
Int_t DaqId() { return fDaqId; }
std::vector<float> Data() { return fData; }
// getters
time_t DaqTimeStamp() { return fDaqTimeStamp; }
Int_t DaqId() { return fDaqId; }
std::vector<float> Data() { return fData; }
std::vector<std::string> Name() { return fName; }

private:
Expand Down
2 changes: 1 addition & 1 deletion include/TEventBuildingLoop.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class TEventBuildingLoop : public StoppableThread {
size_t GetItemsCurrent() override { return fOutputQueue->Size(); }
size_t GetRate() override { return 0; }

void SetBuildWindow(uint64_t val) { fBuildWindow = val; }
void SetBuildWindow(uint64_t val) { fBuildWindow = val; }
uint64_t GetBuildWindow() const { return fBuildWindow; }

void SetSortDepth(unsigned int val) { fSortingDepth = val; }
Expand Down
6 changes: 3 additions & 3 deletions include/TFragment.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ class TFragment : public TDetectorHit {
public:
TFragment();
TFragment(const TFragment&) = default;
TFragment(TFragment&&) = default;
~TFragment() = default;
TFragment(TFragment&&) = default;
~TFragment() = default;

TFragment& operator=(const TFragment&) = default; // use default assignment operator (to shut up gcc 9.1)
TFragment& operator=(TFragment&&) = default; // use default move assignment operator (to shut up gcc 9.1)
TFragment& operator=(TFragment&&) = default; // use default move assignment operator (to shut up gcc 9.1)

//////////////////// basic setter functions ////////////////////

Expand Down
4 changes: 2 additions & 2 deletions include/TGRSIHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ class TGRSIHelper : public TObject {
std::string fPrefix{"TGRSIHelper"}; //!<! name of this action (used as prefix)

private:
static constexpr int fSizeLimit = 1073741822; //!<! 1 GB size limit for objects in ROOT
void CheckSizes(unsigned int slot, const char* usage);
static constexpr int fSizeLimit = 1073741822; //!<! 1 GB size limit for objects in ROOT
void CheckSizes(unsigned int slot, const char* usage);

public:
/// This type is a requirement for every helper.
Expand Down
10 changes: 5 additions & 5 deletions include/TGRSIMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ template <typename key_type, typename mapped_type, typename key_compare = std::l
typename allocator_type = std::allocator<std::pair<const key_type, mapped_type>>>
class TGRSIMap {
public:
TGRSIMap() = default;
TGRSIMap() = default;
~TGRSIMap() = default;

void Print()
Expand Down Expand Up @@ -57,10 +57,10 @@ class TGRSIMap {
const mapped_type& operator[](const key_type& key) const { return fMap[key]; }

using map_t = std::map<key_type, mapped_type, key_compare, allocator_type>;
typename map_t::iterator begin() { return fMap.begin(); }
typename map_t::const_iterator begin() const { return fMap.begin(); }
typename map_t::iterator end() { return fMap.end(); }
typename map_t::const_iterator end() const { return fMap.end(); }
typename map_t::iterator begin() { return fMap.begin(); }
typename map_t::const_iterator begin() const { return fMap.begin(); }
typename map_t::iterator end() { return fMap.end(); }
typename map_t::const_iterator end() const { return fMap.end(); }

// capacity functions of std::map
bool empty() const noexcept { return fMap.empty(); }
Expand Down
2 changes: 1 addition & 1 deletion include/TGRSIProof.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const char* const nulFileName = "/dev/null";

class TGRSIProof : public TProof {
public:
TGRSIProof() = default;
TGRSIProof() = default;
~TGRSIProof() override = default;

static TGRSIProof* Open(const char* worker = "")
Expand Down
6 changes: 3 additions & 3 deletions include/TGRSISelector.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,15 @@ class TGRSISelector : public TSelector {
int64_t fEntry{0}; //!<! entry number currently being processed

private:
static constexpr int fSizeLimit = 1073741822; //!<! 1 GB size limit for objects in ROOT
static constexpr int fSizeLimit = 1073741822; //!<! 1 GB size limit for objects in ROOT

TTree* fChain{nullptr}; //!<! pointer to the analyzed TTree or TChain

void CheckSizes(const char* usage); ///< Function to check size of objects in output list
std::string fOutputPrefix; //!<! pre-fix for output files
TAnalysisOptions* fAnalysisOptions{nullptr}; //!<! pointer to analysis options
Int_t fFirstRunNumber{-1}; //!<! run number of first file
Int_t fFirstSubRunNumber{-1}; //!<! sub-run number of first file
Int_t fFirstRunNumber{-1}; //!<! run number of first file
Int_t fFirstSubRunNumber{-1}; //!<! sub-run number of first file

ClassDefOverride(TGRSISelector, 3);
};
Expand Down
2 changes: 1 addition & 1 deletion include/TGRSISortInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class TGRSISortList : public TObject {
using infoMap = std::map<Int_t, std::map<Int_t, TGRSISortInfo*>>;

public:
TGRSISortList() = default;
TGRSISortList() = default;
~TGRSISortList() override = default;

Bool_t AddSortInfo(TGRSISortInfo* info, Option_t* opt = "");
Expand Down
2 changes: 1 addition & 1 deletion include/TGRSIUtilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ int GetSubRunNumber(const std::string&);
inline size_t FindFileSize(const char* fname)
{
std::ifstream temp(fname, std::ios::in | std::ios::ate);
size_t fsize = temp.tellg();
size_t fsize = temp.tellg();
temp.close();
return fsize;
}
Expand Down
14 changes: 7 additions & 7 deletions include/TGRSIint.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ class TGRSIint : public TRint {
~TGRSIint() override;

static void PrintHelp(bool);
void PrintLogo(bool) override;
bool HandleTermInput() override;
int TabCompletionHook(char*, int*, std::ostream&) override;
void PrintLogo(bool) override;
bool HandleTermInput() override;
int TabCompletionHook(char*, int*, std::ostream&) override;

TFile* OpenRootFile(const std::string& filename, Option_t* opt = "read");
TRawFile* OpenRawFile(const std::string& filename);
Expand All @@ -72,12 +72,12 @@ class TGRSIint : public TRint {
void DelayedProcessLine_Action();

private:
void SetupPipeline();
void LoopUntilDone();
void ApplyOptions();
void SetupPipeline();
void LoopUntilDone();
void ApplyOptions();
static void DrawLogo();
static void LoadGROOTGraphics();
void LoadExtraClasses();
void LoadExtraClasses();

Long_t DelayedProcessLine(std::string command);

Expand Down
2 changes: 1 addition & 1 deletion include/TGauss.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class TGauss : public TSinglePeak {
public:
// ctors and dtors
~TGauss() override = default;
TGauss() = default;
TGauss() = default;
explicit TGauss(Double_t centroid, Double_t relativeLimit = -1.);

void InitParNames() override;
Expand Down
Loading

0 comments on commit bebe5d8

Please sign in to comment.