You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Next »


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. Copy the relevant code-directory from /project/ptgroup/Akbar (please see the screenshot below for the file location and the content inside a folder called "DY_Target_script")

    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 .

      Step to run the code:

  1. Setup the environment using: source /project/ptgroup/spinquest/this-e1039.sh
  2. After you have the script/folder, go to the folder then 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)

  3. Using "squeue -u cee9hc", you can check the status of your jobs (or use the "Active Jobs" tab on your UVA OpenOnDemand web page).
  4. Once the job is finished, then you can find your output folder in "/scratch/<your_UVA_id>/MC  (Note: if you don't have a folder called "MC" on /scratch/<user_name> then create one by "mkdir MC" at /scratch/user_name location).

  5. Copy /project/ptgroup/Akbar/analysis/histo_v2.C to your directory. This file (histo_v2.C) create around 11 histograms to check the quality of your generated MC. All you need to do is copy this file and change/input the location of your root files. See if it make sense. Especially, see the x,y and z vertex origin. In the screen you will also see the number of accepted events.
  6. Navigate to "/project/ptgroup/"  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
  7. 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
  8. Use the label.C file in the "/project/ptgroup/spinquest/MC_storage" to add summary description of your MC .root file.
  9. Fill this table

MC events generation log-book

DateProcessVertex LocationNumber of Total events generatedNumber of accepted events<>





diff /project/ptgroup/Ishara/singMup_x2y2z300/Fun4Sim.C /home/bhy7tf/tmp/20210819_ishara/Fun4Sim.C












Unsorted Info

Kenichi and anyone write down some possibly-useful info here (rather than e-mail).  The info may be moved to a proper section when made use of.

  • When you generate single-muon events, you have to change the condition of `SQGeomAcc` in `Fun4Sim.C`.
    • SQGeomAcc skips (i.e. not save) an event in which a muon or a muon pair doesn't pass through the spectrometer acceptance, because such event is useless for analysis.
    • By default, SQGeomAcc requires a muon pair per event; "geom_acc->SetMuonMode(SQGeomAcc::PAIR);"
    • When you generate single-muon events, you have to modify `Fun4Sim.C` as follows, so that SQGeomAcc requires a muon per event;

      geom_acc->SetMuonMode(SQGeomAcc::SINGLE);

        or

      geom_acc->SetMuonMode(nmu_plus+nmu_minus==1 ? SQGeomAcc::SINGLE : SQGeomAcc::PAIR);

  • Better configurations for J/psi and psi' are available in the E1039-Collaboration/e1039-analysis repository.  Zulkaida could make use of them in "/project/ptgroup/Akbar/*/Fun4Sim.C".
  • reco_vz
    • reco_vz is the reconstructed position of track (not dimuon) at the target position (i.e. z = -300 cm). Therefore "reco_vz" is always -300 cm
    • The meaning of "reco_vz" is defined in "AnaTrkQA".  Actually the present naming is misleading.
    • When dimuon events are produced in the dump, each track should make the closest approach to the z-axis in the dump region. But "reco_vz" is not the position of the closest approach but the position of the track at z = -300 cm by definition.  "reco_vx" and "reco_vy" are not peaked at 0 cm.
  • Others??
  • No labels