macro/scrut -------------- In this directory macro/scrut are files necessary to run the fast simulation and perform some analysis, suitable for the investigations for the PANDA scrutiny process. - simfast.C: macro for running fast simulation (for details see below) - psi2s_jpsi2mu_2pi.dec: decay file for example channel psi(2S) -> J/psi (mu+ mu-) pi+ pi- - ana_jpsi.C: analysis macro for the example decay, creating ntuple output - CMakeLists.txt, scrutLinkDef.h, PndScrutAnaTask.cxx, PndScrutAnaTask.h, ana_jpsi_task.C, ana_task_mult.C: Files needed to run the example analysis in a task. The line 'add_subdirectory (macro/scrut)' needs to be added in the root CMakeLists.txt. Compile in build/macro/scrut by executing 'make', and run macro with 'ana_jpsi_task.C("")'. ana_task_mult.C allows to analyse several input files at once. - job_fsim.sge, job_ana.sge: job scripts for using Prometheus cluster ************************************************** CONTENTS: - Preface: Documentation about PandaROOT and Rho - Configuration of Fast Sim - Running Fast Sim - Trying the Example - PID Arrays in Analysis - Detector Options - Using Prometheus Farm ************************************************** ############################################### Preface: Documentation about PandaROOT and Rho ############################################### For general info about doing simulation and analysis with PandaROOT and Rho, please consult the following links: 1. https://panda-wiki.gsi.de/foswiki/bin/view/Computing/PandaRoot (PandaROOT Wiki) 2. https://panda-wiki.gsi.de/foswiki/bin/view/Computing/PandaRootRhoTutorial (Simulation/Analysis Tutorial) 3. https://panda-wiki.gsi.de/foswiki/bin/view/Computing/PandaRootAnalysisJuly13 (Rho Class Dokumentation) 4. https://panda-wiki.gsi.de/foswiki/bin/view/Computing/PandaRootSimulationPrometheus (Using Prometheus Cluster @ GSI) ########################## Configuration of Fast Sim ########################## The fast simulation is executed by running the macro 'simfast.C'. It can be steered in a limited way and already contains some options for various detectors. When adding clonable detectors (ScSttAlone, EmcBarrel, EmcPidBarrel) one has to take care, that all detectors have unique names. Otherwise parameters will be overwritten, without detectors being added. This can be simply done by appending arbitrary strings like ScSttAlone2, ScSttAlone3, etc. There are four different types of detectors: 1. Tracking detectors: ----------------------- The setup of tracking is driven by the coverage of polar angle regions, not by single subdetectors. In particular the detectors *should not overlap in theta*, which leads to unrealistic mergeing of resolutions. The tracking detectors basically provide momentum/angular smearing, and a tracking efficiency. Also momentum or pt thresholds can be set. *PID information is not* generated! Example configurations are: Complete detector: ------------------ fastSim->AddDetector("ScSttAlone", "thtMin=145. thtMax=159.5 ptmin=0.1 pmin=0.0 pRes=0.04 thtRes=0.001 phiRes=0.001 efficiency=0.25"); fastSim->AddDetector("ScSttMvd", "thtMin=20.9 thtMax=145. ptmin=0.1 pmin=0.0 pRes=0.02 thtRes=0.001 phiRes=0.001 efficiency=0.85"); fastSim->AddDetector("ScSttMvdGem", "thtMin=7.8 thtMax=20.9 ptmin=0.1 pmin=0.0 pRes=0.02 thtRes=0.001 phiRes=0.001 efficiency=0.85"); fastSim->AddDetector("ScMvdGem", "thtMin=5. thtMax=7.8 ptmin=0.1 pmin=0.0 pRes=0.03 thtRes=0.001 phiRes=0.001 efficiency=0.60"); fastSim->AddDetector("ScFts", "thtMin=0. thtMax=5. ptmin=0.0 pmin=0.5 pRes=0.05 thtRes=0.002 phiRes=0.002 efficiency=0.80"); OPTION: Forward tracking setups ------------------------------------------------ fastSim->AddDetector("ScMvdGemFts", "thtMin=5. thtMax=7.8 ptmin=0.1 pmin=0.0 pRes=0.03 thtRes=0.001 phiRes=0.001 efficiency=0.80"); or fastSim->AddDetector("ScMvdFts", "thtMin=5. thtMax=10 ptmin=0.0 pmin=0.0 pRes=0.05 thtRes=0.002 phiRes=0.002 efficiency=0.80"); or fastSim->AddDetector("ScGemFts", "thtMin=3. thtMax=10 ptmin=0.0 pmin=0.0 pRes=0.05 thtRes=0.002 phiRes=0.002 efficiency=0.80"); OPTION: STT alone: ------------------- fastSim->AddDetector("ScSttAlone", "thtMin=133.6 thtMax=159.5 ptmin=0.1 pmin=0.0 pRes=0.030 thtRes=0.06 phiRes=0.1 efficiency=0.25"); fastSim->AddDetector("ScSttAlone2", "thtMin=20.9 thtMax=133.6 ptmin=0.1 pmin=0.0 pRes=0.026 thtRes=0.06 phiRes=0.1 efficiency=0.80"); fastSim->AddDetector("ScSttAlone3", "thtMin=7.8 thtMax=20.9 ptmin=0.1 pmin=0.0 pRes=0.026 thtRes=0.06 phiRes=0.1 efficiency=0.25"); 2. Vertexing detectors: ------------------------ These only smear the vertex information. Without fitting possibly has no impact anyways. fastSim->AddDetector("ScVtxMvd", "thtMin=5. thtMax=145. ptmin=0.1 vtxRes=0.005 efficiency=1."); // efficiency=1: all tracks found in trackers will get a vertex information fastSim->AddDetector("ScVtxNoMvd", "thtMin=0. thtMax=5. ptmin=0.0 vtxRes=0.05 efficiency=1."); // efficiency=1: all tracks found in trackers will get a vertex information 3. Electro magnetic calorimeters: ---------------------------------- The EMC detectors provide a certain energy/angular smearing for neutrals, and energy threshold can be set. No PID information is generated! In order to study EMC barrel slices in phi, also phiMin and phiMax are available, and EmcBarrel is clonable as e.g. EmcBarrel1, EmcBarrel2, etc for different phi regions. Be aware that this has to be made consistently with the PID version EmcPidBarrel (see below)! fastSim->AddDetector("EmcBarrel","thtMin=22.0 thtMax=140.0 Emin=0.01 barrelRadius=0.5"); fastSim->AddDetector("EmcFwCap", "thtMin=5.0 thtMax=22.0 Emin=0.01 dist=2.5"); fastSim->AddDetector("EmcBwCap", "thtMin=140.0 thtMax=170.0 Emin=0.01 dist=0.7"); fastSim->AddDetector("EmcFS", "thtMin=0.05 thtMax=5.0 aPar=0.02 bPar=0.0274 Emin=0.01 dist=8.0"); 4. PID detectors: ------------------ Besides the 'PID only'-detectors like the Cherenkov counters and muon detectors, also PID info for trackers and EMCs is generated, separated from the tracking and neutral simulation. TOF in priniciple is available, but the concept is not realistic without start detector. // Based on dE/dx from trackers fastSim->AddDetector("MvdPid","thtMin=5. thtMax=133.6 ptmin=0.1 dEdxResMulti=1. efficiency=1."); //Note: A Bethe-Bloch-Landau-Gauss Prametrization from 2008 fastSim->AddDetector("SttPid","thtMin=7.8 thtMax=159.5 ptmin=0.1 dEdxRes=1. efficiency=1."); //Note: A dEdX parametrization from 2008 // Based on theta_C from Cherenkovs fastSim->AddDetector("DrcBarrel","thtMin=22.0 thtMax=140.0 dthtc=0.01 nPhotMin=5 effNPhotons=0.075"); fastSim->AddDetector("DrcDisc","thtMin=5.0 thtMax=22.0 dthtc=0.01 nPhotMin=5 effNPhotons=0.075"); fastSim->AddDetector("Rich","angleXMax=5.0 EXAMPLE 1: root -l -b -q 'simfast.C("psi2s", "psi2s_jpsi2mu_2pi.dec", 6.232069, 10000, "psi(2S)") angleYMax=10.0 dthtc=0.01 nPhotMin=5 effNPhotons=0.075"); // Based on flat eff(mu) & misid(pi) from muon detectors fastSim->AddDetector("ScMdtPidBarrel", "thtMin=10.0 thtMax=130.0 pMin=1.0 efficiency=0.95 misId=0.01"); fastSim->AddDetector("ScMdtPidForward","thtMin=0.0 thtMax=10.0 pMin=1.5 efficiency=0.95 misId=0.01"); // Based on deposited energy from EMCs fastSim->AddDetector("ScEmcPidFS", "thtMin=0.5 thtMax=10.0 ptmin=0.0 pmin=0.5 efficiency=1.0"); fastSim->AddDetector("ScEmcPidFwCap", "thtMin=10.0 thtMax=22.0 ptmin=0.0 pmin=0.0 efficiency=1.0"); fastSim->AddDetector("ScEmcPidBarrel", "thtMin=22.0 thtMax=142.0 ptmin=0.2 pmin=0.0 efficiency=1.0"); fastSim->AddDetector("ScEmcPidBwCap", "thtMin=142.0 thtMax=160.0 ptmin=0.0 pmin=0.0 efficiency=1.0"); ################## Running Fast Sim ################## The macro simfast.C accepts several parameters: USAGE: root -l -b -q 'simfast.C("","",,,"",)' : Prefix for output file. : Name of local decay file for EvtGen. Setting it to 'DPM' will run dpm events, 'BOX' the box generator : EvtGen and DPM: momentum of pbar; BOX: upper momentum of single particles : number of events to process : optional, only for EvtGen: name of initial resonance, e.g. "psi(2S)" or "pbarpSystem0" : optional, only for Box Generator: pdgcode for particles to be produced (mult=1) EXAMPLE 1: root -l -b -q 'simfast.C("psi2s", "psi2s_jpsi2mu_2pi.dec", 6.232069, 10000, "psi(2S)") Creates output 'psi2s_fast.root', containing 10k events of psi(2S) -> J/psi pi+ pi- EXAMPLE 2: root -l -b -q 'simfast.C("dpm", "DPM", 6.232069, 100000)' Creates output 'dpm_fast.root', containing 100k DPM events as background for upper case. EXAMPLE 3: root -l -b -q 'simfast.C("singlemu", "BOX", 8.0, 100000, "", 13)' Creates output 'singlemu_fast.root', containing 100k single mu- events (pdg=13) with 0.1 < p < 8.0 GeV, isotropic in theta and phi. For different phase space coverage or multiplicities, the macro has to be modified. #################### Trying the example #################### In order to run the example, the following steps are needed: 1. Compile the task: - Add the line 'add_subdirectory (macro/scrut)' in CMakeLists.txt in trunk. - Invoke 'make' in build-directory 2. Run fast simulation for signal channel (10k events) macro/scrut > root -l -b -q 'simfast.C("psi2s", "psi2s_jpsi2mu_2pi.dec", 6.232069, 10000, "psi(2S)")' 3. Run fast simulation for DPM (100k events) macro/scrut > root -l -b -q 'simfast.C("dpm", "DPM", 6.232069, 100000)' 4. Analyse the signal events with macro/scrut > root -l -b -q 'ana_jpsi_task.C("psi2s_fast.root")' 5. Analyse the DPM events with macro/scrut > root -l -b -q 'ana_jpsi_task.C("dpm_fast.root")' 6. Inspect results for signal in 'psi2s_fast.root_taskana.root', and for DPM in 'dpm_fast.root_taskana.root'. E.g. plot the invariant J/psi mass with macro/scrut > root psi2s_fast.root_taskana.root dpm_fast.root_taskana.root ... root [2] _file0.cd(); ntp1.Draw("jm") root [3] _file1.cd(); ntp1.Draw("jm","","same") ######################## PID Arrays in analysis ######################## In addition to the complete PID information in 'PidChargedProbability', each PID detector provides an individual PID array, which can be used in the same way as the PID algorithms in Full Simulation analysis. The available arrays are - ScEmcPidFSProbability : EMC in Forward Spectrometer - ScEmcPidFwCapProbability : EMC Forward Endcap - ScEmcPidBarrelProbability : EMC Barrel - ScEmcPidBwCapProbability : EMC Backward Endcap - ScMdtPidBarrelProbability : MUO Barrel - ScMdtPidForwardProbability : MUO in Forward Spectrometer - MvdPidProbability : MVD - SttPidProbability : STT - RichProbability : RICH in Forward Spectrometer - DrcBarrelProbability : Barrel DIRC - DrcDiscProbability : Disc DIRC They can be used and combined as usual like e.g.: fAnalysis->FillList(kaonplus, "KaonLoosePlus", "DrcBarrelProbability;DrcDiscProbability;RichProbability"); #################### Detector Options #################### For testing different detector options, a modified macro 'simfast_opt.C' is provided. There some standard detector configurations can be controlled via a parameter string. USAGE: root -l -b -q 'simfast_opt.C("","",,,"",,"")' The first parameters are the same as above; the parameter can be used in the following way: detopt : Appearance of each parameter is a *positive* switch! Default value is ="MvdGem EmcBar Drc Dsc FwdSpec" (shortcut:"12345") for the complete detector. Detectors always being enabled are: Stt (FsmSimpleTracker), SttPid, EmcFwd, EmcBw, EmcPidFwd, EmcPidBw, MdtPidBarrel - MvdGem (or 1) : Enable MVD and GEM for central tracking in addition to STT (MvdPid, VtxMvd, better tracking) - EmcBarrel (or 2) : Enable EMC barrel for calorimetry (neutral detection and PID component) (EmcBarrel, EmcPidBarrel) - Drc (or 3) : Enable Barrel DIRC for PID (DrcBarrel) - Dsc (or 4) : Enable Disc DIRC for PID (DrcDisc) - FwdSpec (or 5) : Enable complete Forward Spectrometer (= FTS, EmcFS, EmcPidFS, MdtPidForward, Rich) ####################### Using Prometheus farm ####################### For users working on Hera/Prometheus some job scripts have been prepared allowing an easy way to submit simulation and analysis jobs to the Prometheus cluster. General information about setup for using Prometheus can be found https://wiki.gsi.de/cgi-bin/view/Linux/GridEngine https://panda-wiki.gsi.de/foswiki/bin/view/Computing/PandaRootSimulationPrometheus (Using Prometheus Cluster @ GSI) ------------------- Running Simulation ------------------- In order to submit simulation jobs to the cluster, the script job_fsim.sge (using simfast_opt.C) can be used. The parameters are as in simfast_opt.C. Usage is like: - EXAMPLE 1: qsub -t 1-20 job_fsim.sge dpmbkg DPM 6.232069 100000 Runs 20 jobs with 100000 DPM events each. Output files dpmbkg_1_fast.root, ... , dpmbkg_20_fast.root are in $VMCWORKDIR/macro/scrut/data. - EXAMPLE 2: qsub -t 1-20 job_fsim.sge psi2s psi2s_jpsi2mu_2pi.dec 6.232069 100000 "psi(2S)" Runs 20 jobs with 100000 signal events each. Output files psi2s_1_fast.root, ... , dpmbkg_20_fast.root are in $VMCWORKDIR/macro/scrut/data. - EXAMPLE 3: qsub -t 1-20 job_fsim.sge single_e BOX 10 100000 0 11 Runs 20 jobs with 100000 single electron events events each. Output files single_e_1_fast.root, ... , single_e_20_fast.root are in $VMCWORKDIR/macro/scrut/data. - EXAMPLE 4: qsub -t 1-20 job_fsim.sge psi2s_opt1 psi2s_jpsi2mu_2pi.dec 6.232069 100000 "psi(2S)" 0 1234 Runs 20 jobs with 100000 signal events each, detector setup without Forward Spectrometer (1234, see above section). Output files are in $VMCWORKDIR/macro/scrut/data. ------------------- Running Analysis ------------------- To submit analysis jobs, e.g. one per simulation job output, the script job_ana.sge (using ana_jpsi_task.C) can be used. The default output path is $VMCWORKDIR/macro/scrut/data, but can be set in the analysis task macro for individual preference (see ana_jpsi_task.C how this should be done!) - EXAMPLE 1: qsub -t 1-20 job_ana.sge /hera/panda/scrutdata/det_full/dpm40_full Runs 20 analysis jobs based on input files /hera/panda/scrutdata/det_full/dpm40_full_1_fast.root, ... , /hera/panda/scrutdata/det_full/dpm40_full_20_fast.root. Output files dpm40_full_1_fana.root, ... , dpm40_full_20_fana.root are stored in $VMCWORKDIR/macro/scrut/data.