Skip to content

Commit

Permalink
Merge pull request #1427 from VinzenzBildstein/main
Browse files Browse the repository at this point in the history
Got mega-linter to apply its fixes
  • Loading branch information
VinzenzBildstein authored Jun 12, 2024
2 parents 61d9462 + 8f07f31 commit d034e1c
Show file tree
Hide file tree
Showing 12 changed files with 115 additions and 168 deletions.
18 changes: 1 addition & 17 deletions .github/workflows/mega-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ env:

# Decide which event triggers application of fixes in a commit or a PR
# (pull_request, push, all)
APPLY_FIXES_EVENT: pull_request
APPLY_FIXES_EVENT: all

# If APPLY_FIXES is used, defines if the fixes are directly committed (commit)
# or posted in a PR (pull_request)
Expand Down Expand Up @@ -107,22 +107,6 @@ jobs:
# Set APPLY_FIXES_IF var for use in future steps
- name: Set APPLY_FIXES_IF var
run: |
echo "steps.ml.outputs.has_updated_sources = " ${{steps.ml.outputs.has_updated_sources}} ", github.event_name = " ${{github.event_name}} ", github.event.pull_request.head.repo.full_name = " ${{github.event.pull_request.head.repo.full_name}} ", github.repository = " ${{github.repository}} ", env.APPLY_FIXES_EVENT = " ${{env.APPLY_FIXES_EVENT}}
echo "${{
steps.ml.outputs.has_updated_sources == 1
}}"
echo "${{
(
env.APPLY_FIXES_EVENT == 'all' ||
env.APPLY_FIXES_EVENT == github.event_name
)
}}"
echo "${{
(
github.event_name == 'push' ||
github.event.pull_request.head.repo.full_name == github.repository
)
}}"
printf 'APPLY_FIXES_IF=%s\n' "${{
steps.ml.outputs.has_updated_sources == 1 &&
(
Expand Down
38 changes: 0 additions & 38 deletions .github/workflows/super-linter.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ grsi_logon.C
*Data
.grsirc
wiki
megalinter-reports
8 changes: 4 additions & 4 deletions include/GCube.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ class GCube : public TH1 {
void FillRandom(const char* fname, Int_t ntimes = 5000, TRandom* rng = nullptr);
void FillRandom(TH1* h, Int_t ntimes = 5000, TRandom* rng = nullptr);
#else
void FillRandom(const char* fname, Int_t ntimes = 5000, TRandom* rng = nullptr) override;
void FillRandom(TH1* h, Int_t ntimes = 5000, TRandom* rng = nullptr) override;
void FillRandom(const char* fname, Int_t ntimes = 5000, TRandom* rng = nullptr) override;
void FillRandom(TH1* h, Int_t ntimes = 5000, TRandom* rng = nullptr) override;
#endif
#if ROOT_VERSION_CODE < ROOT_VERSION(6, 18, 0)
Int_t FindFirstBinAbove(Double_t threshold = 0, Int_t axis = 1) const override
Expand All @@ -52,8 +52,8 @@ class GCube : public TH1 {
Int_t FindFirstBinAbove(Double_t threshold = 0, Int_t axis = 1, Int_t firstBin = 1, Int_t lastBin = -1) const;
Int_t FindLastBinAbove(Double_t threshold = 0, Int_t axis = 1, Int_t firstBin = 1, Int_t lastBin = -1) const;
#else
Int_t FindFirstBinAbove(Double_t threshold = 0, Int_t axis = 1, Int_t firstBin = 1, Int_t lastBin = -1) const override;
Int_t FindLastBinAbove(Double_t threshold = 0, Int_t axis = 1, Int_t firstBin = 1, Int_t lastBin = -1) const override;
Int_t FindFirstBinAbove(Double_t threshold = 0, Int_t axis = 1, Int_t firstBin = 1, Int_t lastBin = -1) const override;
Int_t FindLastBinAbove(Double_t threshold = 0, Int_t axis = 1, Int_t firstBin = 1, Int_t lastBin = -1) const override;
#endif
virtual void FitSlicesZ(TF1* f1 = nullptr, Int_t binminx = 0, Int_t binmaxx = -1, Int_t binminy = 0,
Int_t binmaxy = -1, Int_t cut = 0, Option_t* option = "QNR");
Expand Down
8 changes: 4 additions & 4 deletions include/GHSym.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ class GHSym : public TH1 {
void FillRandom(const char* fname, Int_t ntimes = 5000, TRandom* rng = nullptr);
void FillRandom(TH1* h, Int_t ntimes = 5000, TRandom* rng = nullptr);
#else
void FillRandom(const char* fname, Int_t ntimes = 5000, TRandom* rng = nullptr) override;
void FillRandom(TH1* h, Int_t ntimes = 5000, TRandom* rng = nullptr) override;
void FillRandom(const char* fname, Int_t ntimes = 5000, TRandom* rng = nullptr) override;
void FillRandom(TH1* h, Int_t ntimes = 5000, TRandom* rng = nullptr) override;
#endif
#if ROOT_VERSION_CODE < ROOT_VERSION(6, 18, 0)
Int_t FindFirstBinAbove(Double_t threshold = 0, Int_t axis = 1) const override
Expand All @@ -49,8 +49,8 @@ class GHSym : public TH1 {
Int_t FindFirstBinAbove(Double_t threshold = 0, Int_t axis = 1, Int_t firstBin = 1, Int_t lastBin = -1) const;
Int_t FindLastBinAbove(Double_t threshold = 0, Int_t axis = 1, Int_t firstBin = 1, Int_t lastBin = -1) const;
#else
Int_t FindFirstBinAbove(Double_t threshold = 0, Int_t axis = 1, Int_t firstBin = 1, Int_t lastBin = -1) const override;
Int_t FindLastBinAbove(Double_t threshold = 0, Int_t axis = 1, Int_t firstBin = 1, Int_t lastBin = -1) const override;
Int_t FindFirstBinAbove(Double_t threshold = 0, Int_t axis = 1, Int_t firstBin = 1, Int_t lastBin = -1) const override;
Int_t FindLastBinAbove(Double_t threshold = 0, Int_t axis = 1, Int_t firstBin = 1, Int_t lastBin = -1) const override;
#endif
virtual void FitSlices(TF1* f1 = nullptr, Int_t firstbin = 0, Int_t lastbin = -1, Int_t cut = 0,
Option_t* option = "QNR", TObjArray* arr = nullptr);
Expand Down
18 changes: 9 additions & 9 deletions include/TLMFitter.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ NRVec<T>& NRVec<T>::operator=(const NRVec<T>& rhs)
if(this != &rhs) {
if(nn != rhs.nn) {
if(v != 0) {
delete[](v);
delete[] (v);
}
nn = rhs.nn;
v = new T[nn];
Expand Down Expand Up @@ -144,7 +144,7 @@ template <class T>
NRVec<T>::~NRVec()
{
if(v != nullptr) {
delete[](v);
delete[] (v);
}
}

Expand Down Expand Up @@ -245,8 +245,8 @@ NRMat<T>& NRMat<T>::operator=(const NRMat<T>& rhs)
int i, j;
if(nn != rhs.nn || mm != rhs.mm) {
if(v != 0) {
delete[](v[0]);
delete[](v);
delete[] (v[0]);
delete[] (v);
}
nn = rhs.nn;
mm = rhs.mm;
Expand Down Expand Up @@ -304,8 +304,8 @@ template <class T>
NRMat<T>::~NRMat()
{
if(v != nullptr) {
delete[](v[0]);
delete[](v);
delete[] (v[0]);
delete[] (v);
}
}

Expand Down Expand Up @@ -385,9 +385,9 @@ template <class T>
NRMat3d<T>::~NRMat3d()
{
if(v != 0) {
delete[](v[0][0]);
delete[](v[0]);
delete[](v);
delete[] (v[0][0]);
delete[] (v[0]);
delete[] (v);
}
}

Expand Down
4 changes: 2 additions & 2 deletions libraries/GROOT/GCube.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ void GCube::FillRandom(const char* fname, Int_t ntimes, TRandom* rng)
#if ROOT_VERSION_CODE < ROOT_VERSION(6, 24, 0)
void GCube::FillRandom(TH1* h, Int_t ntimes, TRandom*)
#else
void GCube::FillRandom(TH1* h, Int_t ntimes, TRandom* rng)
void GCube::FillRandom(TH1* h, Int_t ntimes, TRandom* rng)
#endif
{
///*-*-*-*-*-*-*Fill histogram following distribution in histogram h*-*-*-*
Expand Down Expand Up @@ -1305,7 +1305,7 @@ Double_t GCube::IntegralAndError(Int_t firstxbin, Int_t lastxbin, Int_t firstybi
#if ROOT_VERSION_CODE < ROOT_VERSION(6, 20, 0)
Double_t GCube::Interpolate(Double_t)
#else
Double_t GCube::Interpolate(Double_t) const
Double_t GCube::Interpolate(Double_t) const
#endif
{
// illegal for a TH3
Expand Down
4 changes: 2 additions & 2 deletions libraries/GROOT/GHSym.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ void GHSym::FillRandom(const char* fname, Int_t ntimes, TRandom* rng)
#if ROOT_VERSION_CODE < ROOT_VERSION(6, 24, 0)
void GHSym::FillRandom(TH1* h, Int_t ntimes, TRandom*)
#else
void GHSym::FillRandom(TH1* h, Int_t ntimes, TRandom* rng)
void GHSym::FillRandom(TH1* h, Int_t ntimes, TRandom* rng)
#endif
{
//*-*-*-*-*-*-*Fill histogram following distribution in histogram h*-*-*-*
Expand Down Expand Up @@ -1137,7 +1137,7 @@ Double_t GHSym::IntegralAndError(Int_t firstxbin, Int_t lastxbin, Int_t firstybi
#if ROOT_VERSION_CODE < ROOT_VERSION(6, 20, 0)
Double_t GHSym::Interpolate(Double_t)
#else
Double_t GHSym::Interpolate(Double_t) const
Double_t GHSym::Interpolate(Double_t) const
#endif
{
// illegal for a TH2
Expand Down
12 changes: 6 additions & 6 deletions libraries/GROOT/GRootCanvas.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,12 @@ enum ERootCanvasCommands {

static const char* gOpenTypes[] = {"ROOT files", "*.root", "All files", "*", nullptr, nullptr};

static const char* gSaveAsTypes[] = {"PDF", "*.pdf", "PostScript", "*.ps", "Encapsulated PostScript",
"*.eps", "SVG", "*.svg", "TeX", "*.tex",
"GIF", "*.gif", "ROOT macros", "*.C", "ROOT files",
"*.root", "XML", "*.xml", "PNG", "*.png",
"XPM", "*.xpm", "JPEG", "*.jpg", "TIFF",
"*.tiff", "XCF", "*.xcf", "All files", "*",
static const char* gSaveAsTypes[] = {"PDF", "*.pdf", "PostScript", "*.ps", "Encapsulated PostScript",
"*.eps", "SVG", "*.svg", "TeX", "*.tex",
"GIF", "*.gif", "ROOT macros", "*.C", "ROOT files",
"*.root", "XML", "*.xml", "PNG", "*.png",
"XPM", "*.xpm", "JPEG", "*.jpg", "TIFF",
"*.tiff", "XCF", "*.xcf", "All files", "*",
nullptr, nullptr};

static ToolBarData_t gToolBarData[] = {
Expand Down
17 changes: 9 additions & 8 deletions scripts/DroppedData.C
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
void DroppedData(TFile *file) {
void DroppedData(TFile* file)
{
//Finds the number of dropped Midas events as well as the number of lost events over the network.
TTree* tree = (TTree*) file->Get("FragmentTree");
TTree* tree = (TTree*)file->Get("FragmentTree");

long entries = tree->GetEntries();
double packetRatio = ((double)entries)/((double)(tree->GetMaximum("NetworkPacketNumber") - tree->GetMinimum("NetworkPacketNumber")));
// double filterRatio = ((double)entries)/((double)(tree->GetMaximum("MidasId") - tree->GetMinimum("MidasId")));
long entries = tree->GetEntries();
double packetRatio = ((double)entries) / ((double)(tree->GetMaximum("NetworkPacketNumber") - tree->GetMinimum("NetworkPacketNumber")));
// double filterRatio = ((double)entries)/((double)(tree->GetMaximum("MidasId") - tree->GetMinimum("MidasId")));

double packetLost = tree->GetMaximum("NetworkPacketNumber") - tree->GetMinimum("NetworkPacketNumber") - entries;
// double filterLost = tree->GetMaximum("MidasId") - tree->GetMinimum("MidasId") - entries;
// double filterLost = tree->GetMaximum("MidasId") - tree->GetMinimum("MidasId") - entries;

std::cout<<"Got "<<packetRatio*100.<<" % of the network packets (lost "<<packetLost<<" packets"<<std::endl;
// std::cout<<"Got "<<packetRatio*100.<<" % of the network packets and "<<filterRatio*100.<<" % of the primary filter IDs (lost "<<packetLost<<" packets and "<<filterLost<<" IDs)"<<std::endl;
std::cout << "Got " << packetRatio * 100. << " % of the network packets (lost " << packetLost << " packets" << std::endl;
// std::cout<<"Got "<<packetRatio*100.<<" % of the network packets and "<<filterRatio*100.<<" % of the primary filter IDs (lost "<<packetLost<<" packets and "<<filterLost<<" IDs)"<<std::endl;
}
Loading

0 comments on commit d034e1c

Please sign in to comment.