How to generate MC events on Rivanna?

  1. Login to Rivanna
  2. Create a folder under your name on /project/ptgroup/
  3. There are various script to generate Monte Carlo (MC) events on Rivanna depend on the channel (reaction) and the vertex or location where the events are generated.
  4. Those scripts are located under /project/ptgroup/Akbar. There are 20 folders containing the required script. The name of the folder is <channel>_<vertex origin>_scripts. 



  5. Option for <channel> are : Drell-Yan (DY), Jpsi and Psi prime (JPsi), Pion background (Pion), Random-multi muons (MultiMuon)
  6. Option for <Vertex origin> : target (Target), Beam Dump (Dump), Everything that seen by the beam (All), The gap between the target and dump (TargetDumpGap), and arbitrary vertex origin (Manual)
  7. For example, if you want to generate Drell Yan events from the target, then the folder that you need is DY_Target_scripts under /project/ptgroup/Akbar
  8. Currently, we need various MC events for Neural-network training. The list is inside /project/ptgroup/spinquest/MC_storage/README. The script require to generate this list of MC is summarized in this table
  9.  Create a directory called "MC" on /scratch/<user_name>  by "mkdir MC", and then navigate back to your directory inside /project/ptgroup/YourFolder/
  10. Copy the relevant code-directory from /project/ptgroup/Akbar (please refer to the screenshot above) to your directory.

    1. Here is a simple way of copying a folder ("DY_Target_script" for example) except "scratch";

      cd /project/ptgroup/YourFolder

      rsync -av --exclude scratch /project/ptgroup/Akbar/DY_Target_script .


  11. Navigate to the directory that you want to run the script.
  12. Setup the environment using: source /project/ptgroup/spinquest/this-e1039.sh  command
  13. Submit your job using the following command.

    $ ./jobscript.sh <Output_folder_name>  <No_of_jobs> <No_of_events_per_job>
    $ ./jobscript.sh DY_Target_1M  100  10000       (Here we need to generate ~1M events. The accepted events depend on the channel). Strongly recommended not to exceed 10K events per job.

    Following table shows useful information on how much events & jobs you need to submit

    MC type#of events generate#of events gets through the acceptance
    DY Target1000 jobs x 10000 events per job = 10M events~ 500k  events
    J/Psi Target

    DY Dump

    J/Psi Dump

    DY air-gap

    J/Psi air-gap




  14. Using "squeue -u cee9hc", you can check the status of your jobs (or use the "Active Jobs" tab on your UVA OpenOnDemand web page).
  15. Once the job is finished, then you can find your output folder in "/scratch/<your_UVA_id>/MC 
  16. Copy /project/ptgroup/Akbar/analysis/histo_v2.C to your directory. Modify it with the correct path to your generated MC (eg: /scratch/Your_UVA_ID/MC/Folder_Name).
    Then run the macro by $ root -l histo_v2.C

    This file (histo_v2.C) create around 11 histograms to check the quality of your generated MC. Check whether the plots make sense; especially, see the x,y and z vertex origin. In the screen you will also see the number of accepted events.
  17.  Navigate to "/project/ptgroup/script"  and then implement the following command (this script by-default will skip bad-files/corrupted-files/etc.)
    $ ./merge_mc_prod.sh /scratch/<your_MC_output_file_location>

    This will create a folder inside /project/ptgrpup/spinquest/MC_merge_files" with the same name as your MC_output_folder

  18. Copy the "merged_trackQA_v2.root" file from the folder that you've newly generated by ./merge_mc_prod.sh and copy it to "/project/ptgroup/spinquest/MC_storage" location. Rename the file into <Channel>_<Vertex Origin>_<Number of accepted event>.root. for example: JPsi_Dump_300K.root

  19. Use the label.C file in the "/project/ptgroup/spinquest/MC_storage" to add summary description of your MC .root file

Other Important Notes:



MC events generation log-book


Please check the required/needed list of MC (at the moment) in the README file: "/project/ptgroup/spinquest/MC_storage/README"


ProcessVertexEvents neededFilename(s) generatedNotes                      
Drell-Yan (DY)




Target300K, 100K, 250KDY_target_300K,   DY_target_100K, DY_target_250K
Dump300KDY_Dump_498K.root
Air Gap
DY_AirGap_386K.root
No Target300K
Require more modification in Fun4Sim.C (Zulkaida)
All (proper target dimensions)300K
Zulkaida
Just Target (proper target dimensions)300K

Zulkaida

All except Target







JpsiTarget300K, 70K, 130KJPsi_target_300K,  JPsi_target_70K,  Jpsi_target_130K
Dump130K, 300KJPsi_Dump_130k
Air Gap
JPsi_AirGap_99k.root
No Target300K
Zulkaida
All (proper target dimensions)300K
Zulkaida
Just Target (proper target dimensions)300K 
Zulkaida
All except Target







Di-MuonTarget100K, 300KDimuon_target_100K
Dump300KDimuon_Dump_329k.root
Air Gap2.5MDimuon_x15y15z300_2.5Mx=15, y=15, z=300
Note: 2.5M accepted events were generated out of 6M events
No Target


All (proper target dimensions)


Just Target (proper target dimensions)


All except Target







Single-Muon



Target300K
Jay is working on this
Dump


Air Gap


No Target


All (proper target dimensions)


Just Target (proper target dimensions)


All except Target







Single-Muon plus




Target


Dump


Air Gap300KsingMup_x2y2z300_370K.rootNote: ~370K accepted events were generated out of 750K events
No Target


All (proper target dimensions)


Just Target (proper target dimensions)


All except Target







Single-Muon minus





Target


Dump


Air Gap300KsingMum_x2y2z300_370K.rootNote: ~350K accepted events were generated out of 750K events
No Target


All (proper target dimensions)


Just Target (proper target dimensions)


All except Target







Questions

Please record any questions that you find when generating/analyzing MC events.  We try to answer each and/or write up a comprehensive document based on them.