Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
9cc1e3f
first_primaryTree(testing)
Jul 2, 2025
0f89d7d
adding barcode file
Jul 2, 2025
c0d4592
test
Jul 2, 2025
ed1a4d1
Merge branch 'main' into output_flare
Jul 2, 2025
cd615b9
primaries working
Jul 3, 2025
f6e9491
primaries tree working.
Jul 3, 2025
81a5285
added energy to primaries
Jul 3, 2025
a6193ac
added flare hit tree
Jul 9, 2025
5dc97ba
added flare directory
Jul 10, 2025
a175183
changes before merging main
Jul 10, 2025
ee714fa
resolved merge conflict + added had hits
Jul 10, 2025
7e5930e
made flare boxes have more copy numbers
Jul 10, 2025
a1b77eb
fixed small issue
koolz2151 Jul 11, 2025
847f026
output overhaul and clean-up
mvicenzi Jul 12, 2025
fdc4f89
update histo to out
mvicenzi Jul 12, 2025
c8bd289
fix segfault from ROOT subdirectories
mvicenzi Jul 12, 2025
87897ab
Merge branch 'output_flare' of https://github.com/FPFSoftware/FPFSim …
mvicenzi Jul 13, 2025
b4446bc
fix conflicts
mvicenzi Jul 13, 2025
29eec5c
remove duplicate
mvicenzi Jul 13, 2025
af2439d
size-saving measures: move to float + edep cut
mvicenzi Jul 13, 2025
a6f5e99
add jobs submission scripts for sdcc
Jun 14, 2025
d700dee
simplify flare geometry
mvicenzi Aug 14, 2025
0e73ae2
build primary ancestor association
mvicenzi Aug 14, 2025
ae05319
final update for flare output
mvicenzi Aug 14, 2025
c05f5ac
write pseudo-reco tree
mvicenzi Aug 14, 2025
818ef12
update .mac parameters
mvicenzi Aug 14, 2025
a2ccd48
fix file path
mvicenzi Aug 14, 2025
bb3ba4f
fix naming pattern for member variables
mvicenzi Aug 18, 2025
0370e07
h5 file only if flare enabled, output override flag for flare
mvicenzi Aug 18, 2025
29becc8
update readme with new parameter
mvicenzi Aug 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions FPFSim.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ using namespace std;
* - run macros
* - start interactive UI mode (no arguments)
*/
int main(int argc, char** argv) {
std::cout<<"Application starting..."<<std::endl;
// G4long myseed = 345354;
// CLHEP::HepRandom::setTheSeed(myseed);
int main(int argc, char** argv)
{
G4cout<< " FPFSim starting..." << G4endl;
//G4long myseed = 345354;
//CLHEP::HepRandom::setTheSeed(myseed);

// invoke analysis manager before ui manager to invoke analysis manager messenger
AnalysisManager* analysis = AnalysisManager::GetInstance();
Expand All @@ -44,7 +45,7 @@ int main(int argc, char** argv) {
G4UImanager* UImanager = G4UImanager::GetUIpointer();

// Parse command line arguments
if (argc==1) {
if ( argc==1 ){
G4UIExecutive* ui = new G4UIExecutive(argc, argv);
UImanager->ApplyCommand("/control/execute macros/vis.mac");
ui->SessionStart();
Expand All @@ -61,7 +62,7 @@ int main(int argc, char** argv) {
ui->SessionStart();
delete ui;
} else {
std::cout<<"Please specify the second argument as vis to visualize the event"<<std::endl;
G4cout << "Please specify the second argument as vis to visualize the event" << G4endl;
return 0;
}
}
Expand All @@ -70,7 +71,7 @@ int main(int argc, char** argv) {
delete visManager;
delete runManager;

std::cout<<"Application sucessfully ended.\nBye :-)"<<std::endl;
G4cout << "Application sucessfully ended.\nBye :-)" << G4endl;

return 0;
}
12 changes: 6 additions & 6 deletions GridUtils/dune-gpvms/nue/nue_job.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ cat << EOF >> temp.mac
/gen/genie/genieInput nue_kling_ar40_e5000.ghep.root
/gen/genie/genieIStart ${istart}

/histo/addDiffusion false
/histo/saveHit false
/histo/save3DEvd true
/histo/save2DEvd false
/histo/circleFit true
/histo/fileName ${outputfile}
/out/flare/addDiffusion false

/out/flare/save3DEvd true
/out/flare/save2DEvd false

/out/fileName ${outputfile}

/run/beamOn ${num_evt_per_file}
EOF
Expand Down
55 changes: 31 additions & 24 deletions GridUtils/dune-gpvms/numu/README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,32 @@
# Description

This directory contains scripts for submitting batch jobs to simulate numu interactions in FLArE.
* `batch_script.sh` is the script that is actually being submitted and executed on the worker nodes.
Worker nodes have a limited scope, so the script takes care of:
1. copying over from `pnfs` all inputs (including the executable);
2. running the executable;
3. copying back to `pnfs` output and log files.

* `submit.sh` is the script that handles the job submission by calling `jobsub_submit`.
It sets the required computing resources and passes the input filepaths to `batch_script.sh`.
- `batch_script.sh` is the script that is actually being submitted and executed on the worker nodes.
Worker nodes have a limited scope, so the script takes care of:

* `numu_job.sh` is the main script:
1. it sets production parameters (number of files, number of events) and paths;
2. it generates several `.mac` files starting from a template, keeping track of them in a list;
3. it passes the lists of configuration files and other paths to `submit.sh`.
1. copying over from `pnfs` all inputs (including the executable);
2. running the executable;
3. copying back to `pnfs` output and log files.

* `glob_output.sh` is the script that retrieves all the job output files in `/pnfs/dune/scratch`.
The files are copied over to `dune\data` for storage.
- `submit.sh` is the script that handles the job submission by calling `jobsub_submit`.
It sets the required computing resources and passes the input filepaths to `batch_script.sh`.

* `merge_outputs.sh` is the script that merges all the output files into a single one.
- `numu_job.sh` is the main script:

1. it sets production parameters (number of files, number of events) and paths;
2. it generates several `.mac` files starting from a template, keeping track of them in a list;
3. it passes the lists of configuration files and other paths to `submit.sh`.

- `glob_output.sh` is the script that retrieves all the job output files in `/pnfs/dune/scratch`.
The files are copied over to `dune\data` for storage.

- `merge_outputs.sh` is the script that merges all the output files into a single one.

## Instructions:
* The `.mac` template is

- The `.mac` template is

```
/control/execute ${geomacro}

Expand All @@ -32,19 +37,21 @@ This directory contains scripts for submitting batch jobs to simulate numu inter
/genie/genieInput numu_kling_ar40_e5000.ghep.root
/genie/genieIStart ${istart}

/histo/saveEvd false
/histo/saveHit false
/histo/circleFit true
/histo/fileName ${outputfile}
/out/saveEvd false


/out/fileName ${outputfile}

/run/beamOn ${num_evt_per_file}
```
```

The script relies on GENIE-simulated numu neutrino vertices stored in `numu_kling_ar40_e5000.ghep.root`.
In order for this file to be visibile on the worker nodes, `batch_script.sh` copies it over from an hardcoded `pnfs` location:

```
ifdh cp /pnfs/dune/persistent/users/mvicenzi/numu/numu_kling_ar40_e5000.ghep.root numu_kling_ar40_e5000.ghep.root
```
* The current implementation requires the user to provide the name of the geometry macro from `macro\geometry_options` by writing it in `numu_job.sh`. The name of this file is used to create the output directory as well as for the filenames themselves. It is the only argument that is needed by `glob_output.sh` and `merge_outputs.sh`.
* `${istart}` is set according to the number of files requested and the number of events per file chosen, in order to avoid using the same events.
* Most of the paths are currently hardcoded to point to `/pnfs/dune/scratch/users/mvicenzi` to store (temporary) submission files as well as the output files. They can be changed as necessary, but they need to be on `pnfs` to be accessible by the worker nodes with `ifdh cp`.

- The current implementation requires the user to provide the name of the geometry macro from `macro\geometry_options` by writing it in `numu_job.sh`. The name of this file is used to create the output directory as well as for the filenames themselves. It is the only argument that is needed by `glob_output.sh` and `merge_outputs.sh`.
- `${istart}` is set according to the number of files requested and the number of events per file chosen, in order to avoid using the same events.
- Most of the paths are currently hardcoded to point to `/pnfs/dune/scratch/users/mvicenzi` to store (temporary) submission files as well as the output files. They can be changed as necessary, but they need to be on `pnfs` to be accessible by the worker nodes with `ifdh cp`.
6 changes: 3 additions & 3 deletions GridUtils/dune-gpvms/numu/numu_job.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ cat << EOF >> temp.mac
/gen/genie/genieInput numu_kling_ar40_e5000.ghep.root
/gen/genie/genieIStart ${istart}

/histo/saveHit false
/histo/circleFit true
/histo/fileName ${outputfile}


/out/fileName ${outputfile}

/run/beamOn ${num_evt_per_file}
EOF
Expand Down
12 changes: 6 additions & 6 deletions GridUtils/dune-gpvms/nutau/nutau_job.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ cat << EOF >> temp.mac
/gen/genie/genieInput nutau_bai_ar40_e2000.ghep.root
/gen/genie/genieIStart ${istart}

/histo/addDiffusion false
/histo/saveHit false
/histo/save3DEvd true
/histo/save2DEvd false
/histo/circleFit true
/histo/fileName ${outputfile}
/out/flare/addDiffusion false

/out/flare/save3DEvd true
/out/flare/save2DEvd false

/out/fileName ${outputfile}

/run/beamOn ${num_evt_per_file}
EOF
Expand Down
4 changes: 2 additions & 2 deletions GridUtils/dune-gpvms/single_particle/gen_jobfile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ cat << EOF >> ${filename}
/gps/particle ${particle}
/gps/ene/mono ${particle_kin} GeV

/histo/saveEvd false
/histo/fileName ${outputfile}
/out/flare/save2DEvd false
/out/fileName ${outputfile}

/run/beamOn ${num_evt_per_file}
EOF
Expand Down
8 changes: 4 additions & 4 deletions GridUtils/dune-gpvms/single_particle/gen_muons.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ cat << EOF >> ${filename}
/gps/particle ${particle}
/gps/ene/mono ${particle_kin} GeV

/histo/saveEvd false
/histo/saveHit false
/histo/circleFit true
/histo/fileName ${outputfile}
/out/flare/save2DEvd false


/out/fileName ${outputfile}

/run/beamOn ${num_evt_per_file}
EOF
Expand Down
12 changes: 6 additions & 6 deletions GridUtils/lxplus/nujobs/nu_job.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,12 @@ function generate_macros {
/gen/genie/genieInput ${gst}
/gen/genie/genieIStart ${istart}

/histo/save3DEvd false
/histo/save2DEvd false
/histo/saveHit false
/histo/addDiffusion false
/histo/circleFit true
/histo/fileName ${outputfile}
/out/flare/save3DEvd false
/out/flare/save2DEvd false

/out/flare/addDiffusion false

/out/fileName ${outputfile}

/run/beamOn ${n_evt_per_job}
EOF
Expand Down
26 changes: 26 additions & 0 deletions GridUtils/sdcc/bkgjobs/batch_bkg_script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

cluster=$1
process=$2
fpfsim=$3
macrolist=$4
setup=$5

echo "Executing JOBID ${cluster}.${process}"

# source the environment
source $setup

# select the macro file
let num=$((${process}+1))
echo "Selecting macro from line ${num} in list:"

macropath=$(tail -n+${num} ${macrolist} | head -n1)
macro=`basename "$macropath"`
echo "$macro"

# running !!
echo "Running ${fpfsim} ${macropath}"
${fpfsim} ${macropath}

echo "Completed JOBID ${cluster}.${process}"
Loading