macro/softrig ---------------------------------------------------------- In this directory are several files to run the complete simulation chain + soft-trigger task and submit jobs to the cluster. ************************** *** Procedure of usage *** ************************** 1. create EvtGen decay files: > ./create_decfiles.pl decays.txt 2. check prod_fsim.C/prod_sof.C to configure PndSoftTriggerTask - Define QA's to write out (default should be fine in the first place) - Comment out stTask->ApplyFullSelection(); (we want to find the selection!) 3. submit jobs to prometheus for various energies for signal and DPM > ./submit(_fsim).pl > ./submit(_fsim).pl 10000 100 399 DPM 4. after all jobs complete go to data directory and merge data > cd data > ../merge.pl mct NOTE: An easy way to check beforehand which jobs failed is to list them sorted by file size > ls -lS *root Files with just a couple of bytes size need to be resubmitted; e.g. for M380222002_1_fsim.root and M240900_251_fsim.root: > cd .. > ./submit_fsim.pl 3.8 10000 1 1 222002 > ./submit_fsim.pl 2.4 10000 251 251 DPM 5. after merge completed, compress files (switch off branches and apply precuts) for speedup > ../compress.pl M 6. do autocut optimization > mkdir shr > mv M*shr.root shr > cd shr > ../../autocut.pl M 7. apply selection to prod_fsim.C / prod_sof.C and enable full selection TString selectioncfg = TString(gSystem->Getenv("VMCWORKDIR"))+"/macro/softrig/data/shr/selection_M.cfg"; stTask->ApplyFullSelection() 8. just enable event QA (ntpev) for speed and restart all jobs like under 3. Therefore modify prod_fsim.C or prod_sof.C: --- if (modeshort==900) { stTask->SetQAAll(false); } else { stTask->SetQAAll(false); stTask->SetQAMctOnly(); } stTask->SetQAEvent(true); // event info stTask->SetQAMc(false); --- 9. merge and compress the ntpev tuples of the output files energy-wise > cd data > . ../mergeall_ntpev.sh > . ../compressall_ntpev.sh 10. create file with cross tag histos (each run adds histos to common output 'crosstag_histos.root') > ../crosstagall_ntpev.sh 11. create evaluation plots > root -l -b -q '../evaltrig.C("crosstag_histos.root",1)' ---------------------------------------------------------- ---------------------------------------------------------- Files in this directory: ------------------------- - data/ : empty directory to store simulation data in - decfiles/M...dec: EvtGen decay files for defined Soft-Trigger modes. Names have structure M<6 digits mode>.decfiles. Files must be created with 'create_decfiles.pl decays.txt' - decfiles/mode_codes_softtrigger.txt: Description of modes - decays.txt: Config file for production of decay files; should be synchronized with softrig/triggerlines(_fsim).cfg! ---------------------------------------------------------- *** *** ROOT Macros *** - prod_sim.C, prod_dig.C, prod_rec.C, prod_pid.C, prod_sof.C : files to run full simulation chain and in addition PndSoftTriggerTask - prod_fsim.C : run fast simulation together with softtrigger task at once; simulation data is not stored - qa_softtrig.C : macro to run only PndSoftTriggerTask over multiple input pid.root files - cutfinderx.C : helper macro to find good cuts for a signal mode - autocutx.C : automatic selection finder for one signal mode; in principle re-iterates cutfinderx.C (-> used by autocut.pl) - crosstag.C : evaluates the output in ntuple 'ntpev' after running with full trigger selection (apply to merged file of all modes for specific energy) - evaltrig.C : create final performance histos for all modes and energies (apply after running crosstag.C for all energies separately) *** some helper macros - compress.C : compressed a root file by switching off branches and applying a pre-cut (-> used by compress.pl) - merge(mct).C : merges a TTree from up to five sources of ROOT files with using wildcards (-> used by merge.pl) mergemct.C requires criterion "xmct==true || mode%1000==900" (basically to keep only mct matched signals) - getpars.C : takes root file name as input and determines sigma and mean of the MC truth matched distribution of 'xm' (and 'xmdif' if D* mode) filename needs to contain nXXX with XXX being the triggerline code. - sizetree.C : takes root file name as input and prints a list of the TTrees sorted by memory consumption. *** *** Scripts *** - autocut.pl : Applies autocutx.C to multiple files in directory - autotmva.pl : Applies autocutx.C to multiple files in directory - merge.pl : automatically merges the relevant files for various modes; uses merge(mct).C - submit(_fsim).pl : submits fast or full sim jobs to prometheus cluster - printvars.pl : prints all variables used in a certain selection file (useful for PndSoftTriggerTask) - runall_sof.sh : runs full selection - ---------------------------------------------------------- *** *** Running Simulation and PndSoftTriggerTask *** ################# - runall_sof.sh: Run complete macro sequence (sim, digi, reco, pid, soft-trigger) from above USAGE: ./runall_sof.sh : E_cms shortcut (24,38,45,55)+, e.g. 38201 : J/psi(->mu mu) pi pi @ sqrt(s) = 3.77 GeV : number of events to run : decay file name; keyword 'DPM' instead produces DPM events; in that case is ignored : pbar momentum : initial resonance in decay file (default = pbarpSystem0) EXAMPLE 1: ./runall_sof.h 38201 1000 decfiles/M201_Jpsi2pi.dec 6.56903 pbarpSystem0 EXAMPLE 2: ./runall_sof.h 38900 10000 DPM 6.56903 ################# - prod_fsim.C: Run fast simulation + softrigger; doesn't persist simulation data, just stores QA from soft trigger task USAGE: root -l -b -q prod_fsim.C(, , , , , , , : Prefix for output file : decay file name; keyword 'DPM' instead produces DPM events; in that case is ignored : pbar momentum : number of events to run : initial resonance in decay file (default = pbarpSystem0, shortcut 'pbp0') : mode code; should be 9 digit code ABCDEFGHI for signal (see mode_codes_softtrigger.txt), 6 digits for DPM ('ABC900') : arbitrary run number; important for mergeing multiple outputs to disentangle events : selection to be applied for full trigger (in case there are different); default = "loose" ################# - job_sof(_fsim).sge: Script like runall_sof.sh, but to be used to submit jobs with qsub; need to have PandaROOT installation on /hera/... and being logged in to pro.hpc.gsi.de USAGE: qsub -t - job_sof.sge : minimum number of array job : maximum number of array job : E_cms shortcut (24,38,45,55)+, e.g. 38201 : J/psi(->mu mu) pi pi @ sqrt(s) = 3.77 GeV : number of events to run per job : decay file name; keyword 'DPM' instead produces DPM events; in that case is ignored : pbar momentum : initial resonance in decay file (default = pbarpSystem0) EXAMPLE 1: qsub -t 1-10 job_sof.sge 38201 1000 decfiles/M201_Jpsi2pi.dec 6.56903 pbarpSystem0 EXAMPLE 2: qsub -t 1-10 job_sof.sge 38900 10000 DPM 6.56903 ################# - qa_softtrig.C: macro to run only PndSoftTriggerTask over multiple input pid.root files (w/o running simulation) USAGE: root -l -b -q 'qa_softtrig.C("",,,,,)' : Prefix for input files, e.g. "data/M55900" : Mode number to be stored in ntuples, e.g. 55900 : pbar momentum : minium job file number : maximum job file number : number of events to process, 0=all=default EXAMPLE: root -l -b -q 'qa_softtrig.C("data/M55900", 55900, 15.153, 1, 10)' Input = data/M55900_1_pid.root ... data/M55900_10_pid.root, Output = data/M55900_1_10_sof.root ################# - job_sof_only.sge: Script to submit a single job running qa_softtrig.C macro for multiple input files USAGE: qsub job_sof_only.sge : Mode number defining prefix and to be stored in ntuples, e.g. 55900 -> prefix = "data/M55900", mode = 55900 : pbar momentum : minium job file number : maximum job file number EXAMPLE: qsub job_sof_only.sge 55900 15.153 1 10 Submits the example for qa_softtrig.C from above as a job ---------------------------------------------------------- *** *** Submitting jobs and mergeing output *** ################# - submit(_fsim).pl: Submit several arrays of signal jobs to prometheus cluster; needs PandaROOT installation on /hera/... and being logged in to pro.hpc.gsi.de USAGE: ./submit(_fsim).pl : E_cms (e.g. 4.5) ; produces all modes accessible up to this energy taking into account various recoils : number of events per job (default = 10000); nevts = 0 just list the jobs to be submitted w/o actual submission : minimum job number : maximum job number : only submit modes staring with ; e.g. 22 would just submit modes with codes 22xxxxx; keyword 'DPM' starts one array of DPM jobs EXAMPLE 1: submit.pl 3.8 Submits 1 full sim job at 3.8GeV for each mode accessible up to 3.8GeV (in total 117 jobs x 10000 events) EXAMPLE 2: submit_fsim.pl 4.5 1000 1 10 4 Submits 10 fast sim jobs at sqrts = 4.5 GeV for each signal mode staring with 4 (in total 20x10 jobs x 1000 events) EXAMPLE 3: submit_fsim.pl 5.5 10000 100 199 DPM Submits 100 fast sim DPM jobs (run numbers 100-199) at 5.5 GeV (in total 100 jobs x 10000 events) ################# - merge.pl : automatically merges the relevant files for various modes; uses merge(mct).C; to be execute in the directory containing the sofftrigger data files USAGE: ../merge.pl : option = all (merges all signals), mct (mct requirement), test (only lists merge commands to be executed) : prefix for energy, e.g. 550 for M550...root files produced at 5.5 GeV : prefif for modes EXAMPLE 1: ../merge.pl (merges everything) EXAMPLE 2: ../merge.pl 450 22 (merges modes '22xxxx' @ 4.5 GeV) ---------------------------------------------------------- *********************** * Deprecated stuff * *********************** ################# - submit.sh: Submit several arrays of signal jobs to prometheus cluster; need to have PandaROOT installation on /hera/... and being logged in to pro.hpc.gsi.de USAGE: ./submit.sh : E_cms shortcut (24,38,45,55); produces all modes assigned to this energy (can be many!!) : minimum job number : maximum job number; if not given, array numbers 0 - are submitted : number of events per job (default = 2000) EXAMPLE 1: ./submit.sh 45 20 # submits 20 jobs (numbers 1-20) at sqrt(s) = 4.5 GeV with 2000 events per job for each mode EXAMPLE 2: ./submit.sh 38 10 19 1000 # submits 10 jobs (numbers 10-19) at sqrt(s) = 3.77 GeV with 1000 events for each mode EXAMPLE 2: ./submit.sh 55 # submits 1 job (numbers 1-1) at sqrt(s) = 5.5 GeV with 2000 events for each mode ################# - submit_bg.sh: Submit an array of DPM jobs to prometheus cluster; need to have PandaROOT installation on /hera/... and being logged in to pro.hpc.gsi.de USAGE: parameters like above EXAMPLE 1: ./submit_bg.sh 45 20 # submits 20 DPM jobs (numbers 1-20) at sqrt(s) = 4.5 GeV with 2000 events per job EXAMPLE 2: ./submit_bg.sh 38 10 19 1000 # submits 10 DPM jobs (numbers 10-19) at sqrt(s) = 3.77 GeV with 1000 events EXAMPLE 2: ./submit_bg.sh 55 # submits 1 DPM job (numbers 1-1) at sqrt(s) = 5.5 GeV with 2000 events