Skip to content

Commit

Permalink
Fix box and gun pythia executables (#103)
Browse files Browse the repository at this point in the history
- Fix seed for background
- Add more decays to bck event

- Update cleaning script

- Linking also summary file in current directory
  • Loading branch information
njacazio authored Aug 9, 2021
1 parent f78d25d commit 3598232
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions examples/scripts/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ fwdRes/fwdRes.C
lutWrite*.cc
*.hepmc
HistoManager.h
lutCovm.hh
3 changes: 2 additions & 1 deletion examples/scripts/clean.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ rm *.cfg *.log *.txt
rm *.so *.d *.pcm
rm *ACLiC*
rm *.tcl
rm -f lutCovm.el.dat lutCovm.mu.dat lutCovm.pi.dat lutCovm.ka.dat lutCovm.pr.dat
rm -f ./lutCovm.*.dat
rm *.C *.h
rm *.pdf *.swp
rm dpl-config.json imgui.ini
Expand All @@ -18,3 +18,4 @@ rm lutWrite*.cc
rm DetectorK.*
rm -r fwdRes
rm -r __pycache__
rm lutCovm.hh
1 change: 1 addition & 0 deletions examples/scripts/createO2tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,7 @@ def write_config(entry, prefix=""):
run_cmd(f"cat {summaryfile} >> {s}")
else:
run_cmd(f"mv {summaryfile} {output_path}")
run_cmd(f"ln -s {output_path}/{summaryfile} ./")

if qa:
msg(" --- running test analysis", color=bcolors.HEADER)
Expand Down
6 changes: 5 additions & 1 deletion rpythia8/rpythia8-box.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

using namespace Pythia8;

int main(int argc, char **argv)
int main(int argc, char** argv)
{

int nevents, pdg, seed;
Expand Down Expand Up @@ -114,6 +114,8 @@ int main(int argc, char **argv)
std::cout << "Error: could not read config file \"" << background_config << "\"" << std::endl;
return 1;
}
pythia_bkg->readString("Random:setSeed = on");
pythia_bkg->readString("Random:seed =" + std::to_string(seed));
pythia_bkg->init();
}

Expand Down Expand Up @@ -148,6 +150,8 @@ int main(int argc, char **argv)
// background
if (pythia_bkg) {
pythia_bkg->next();
if (decay)
pythia_bkg->moreDecays();
pythia.event += pythia_bkg->event;
}

Expand Down
4 changes: 4 additions & 0 deletions rpythia8/rpythia8-gun.cc
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ int main(int argc, char** argv)
std::cout << "Error: could not read config file \"" << background_config << "\"" << std::endl;
return 1;
}
pythia_bkg->readString("Random:setSeed = on");
pythia_bkg->readString("Random:seed =" + std::to_string(seed));
pythia_bkg->init();
}

Expand All @@ -131,6 +133,8 @@ int main(int argc, char** argv)
// background
if (pythia_bkg) {
pythia_bkg->next();
if (decay)
pythia_bkg->moreDecays();
pythia.event += pythia_bkg->event;
}

Expand Down

0 comments on commit 3598232

Please sign in to comment.