[[%ATTACHURL%/GaussValidation.pdf][GaussValidation.pdf]] ---+ LHCb Simulation Validation LHCb Birmingham has an ongoing participation in the development of the experiment's simulation framework, a large part of which involes the validation of new versions of Geant4 physics lists. These are validated independantly of Gauss and as part of the Gauss software. ---++ Geant4 in LHCb The LHCb Gauss framework uses Geant4 to simulate the passage of particles through matter. The descriptions of particle behaviours are determined by "physics lists" which are compositions of physics models. What model is invoked to describe the behaviour depends on the physical process, particle energy and random number generators for continuity at model boundaries. ---+++ Hadronic Physics Lists: ---++++++ LHEP (Low and High Energy Paramerterisation) These Physics Lists are based on a parametrised modeling for all hadronic interactions for all particles. The parametrised model is an improved version of the Geisha model. This list combines the high energy parametrised model (HEP) and the low energy one (LEP) describing hadronic interactions. There is a sharp switch from the low to high energy model at 25 GeV. The modeling of elastic scattering off a nucleus and of capture of negative stopped particles and neutrons proceeds via parametrised models. ---++++++ FTFP_BERT * Bertini cascade (BERT) model, which simulates the intra-nuclear cascade, followed by pre-equilibrium and evaporation phases of the residual nucleus, for protons, neutron, pion and kaons interaction with nuclei at kinetic energies below 9.9 GeV. The Bertini model produces more secondary neutrons and protons than the LEP model, yielding a better agreement with experiment data. * Fritiof (FTF) model for protons, neutrons, pions, kaons interactions with nuclei at high energies. The change between the two models happens with a shaded shift from BERT to FTF that starts at 4 GeV and ends at 5 GeV. ---++++++ QGSP_BERT Bertini cascade at low energy, switching to LEP at ~9.5GeV and QGSP at 25GeV. ---+++ Electromagnetc Physics Lists The electromagnetic physics list constructors are described on the Geant4 webpage: http://geant4.web.cern.ch/geant4/collaboration/working_groups/electromagnetic/physlist.shtml LHCb has a private list "EmLHCb" tailored for use with the experiment, and "EmNoCuts" which is "EmLHCb" without the production cuts. ---++ Documentation of Recent Validation Studies For the incorporation of Geant4 v9.5 into Gauss, hadronic and electromagnetic validation studies were undertaken. The documented results can be found here: [[%ATTACHURL%/LHCb-INT-2013-026_.pdf][LHCb-INT-2013-026_.pdf]] 23/05/2013 --- ---+ Validation software Installation and use --- ---++ Electromagnetic Physics dE/dx Tools This tool analyses the passage of muons, electrons and pions from simulated particle guns through the silicon of the Velo to investigate the energy loss due to electromagnetic interactions. A .root file is produced containing histograms for MPV, FWHM and MPV/FWHM for all the specified combinations of lists and versions. The code currently works for Sim06b and Sim07 productions for energies of 0.1, 0.2, 0.4, 1, 5, 10, 17, 34, 50, 100, 120 and 168 GeV. However it is designed to be easily modified for the incorporation of new productions to validate new versions and lists. This tool requires you have Gauss installed along with the "VeloGauss" tool. A modified version of the " =VeloGaussMoni.cpp= " script is required and can currently be found at <blockquote> =/afs/cern.ch/work/p/pgriffit/public/EMPhys/VeloGaussMoni= </blockquote> and should be placed in =Velo/VeloGauss/src= of your Gauss directory and VeloGauss compiled. In this script one can specify what path lengths are required and will produce, among other information, the energy loss distributions for all specified path lengths. For example, in the current script, histogram "1002" is energy deposited between 290 and 310 microns, while "1003" is for paths greater than 300 microns. ---++++++ Installing the package Firstly, Gauss and VeloGauss must be installed (see relevant LHCB Twiki page) with the modified VeloGaussMoni script The package consists of a several python and C++ script. They can currently be found at <blockquote> =/afs/cern.ch/work/p/pgriffit/public/EMPhys/scripts/= </blockquote> navigating to this directory and running <blockquote> =python Setupdedx.py= </blockquote> will create the relevant directories (if they do not exist) and copy the scripts into the required locations in your userspace, for instance: <blockquote> =~/myganga= will contain the scripts =ganga_dedx.py= and =ganga_dedx_copy_histos.py= </blockquote> " =ganga_dedx.py= " is designed to be executed in the frontend software for the LCG, "ganga" and is used to submit Gauss jobs to extract the required information from the particle gun productions. " =ganga_dedx_copy_histos.py= " merges the job outputs in your "gangadir" and organises them in a useable way in the directories: <blockquote> =~/GaussTests/dEdx/histos/Sim07/dEdx/G4PL_LHEP_Em *+list+particle* /= </blockquote> with a root file for each gun energy and named in the same convention as in particle gun productions, such as: <blockquote> =MCDEVParticleGunMagDown *+ list +* Sim *+ version + particle code + energy code +* SIM.root= </blockquote> where: <table align="center" border="0"><tbody><tr><td> *Particle* <br /></td><td> *Code* <br /></td></tr><tr><td>electrons</td><td>512 <br /></td></tr><tr><td>muons<br /></td><td>522</td></tr><tr><td>pions <br /></td><td>532 <br /></td></tr></tbody></table> and <table align="center" border="0"><tbody><tr><td> *Energy (GeV)* <br /></td><td> *Code* <br /></td></tr><tr><td> 0.1</td><td> 30100</td></tr><tr><td> 0.2</td><td> 30200</td></tr><tr><td> 0.4</td><td> 30400</td></tr><tr><td> 1</td><td> 10001</td></tr><tr><td> 5</td><td> 10005</td></tr><tr><td> 10</td><td> 10010</td></tr><tr><td> 17</td><td> 10017</td></tr><tr><td> 34</td><td> 10034</td></tr><tr><td> 50</td><td> 10050</td></tr><tr><td> 100</td><td> 10100</td></tr><tr><td> 120</td><td> 10120</td></tr><tr><td> 168</td><td> 10168</td></tr></tbody></table> The files used to analyse the data are <blockquote> =~/GaussTests/dEdx/analyse.py= =~/GaussTests/dEdx/makeplots.cpp= </blockquote> analyse.py calls on the scripts =landauGenn.C= and =landau4new.C= adopted from Mathew Needham which are used to analyse the distributions, fitting the peak with a parabolic fit to estimate the MPV and linear interplolation to estimate the FWHM. These results are stored as an (x,y) point in a TGraph alongside the full energy loss distributions in .root files in the same directory. =makeplots.cpp= is used to plot the results and contains functions to plot the desired combinations. It must be compiled with the line: <blockquote> =g++ -o makeplots makeplots.c `root-config --cflags --glibs`= </blockquote> ---++++++ Running This code now functions properly in ganga 6 (but there is a deprecated ganga 5 setup script (.sh and .csh) included in code) Firstly, set up the environment for ganga 6: <blockquote> =SetupGanga= </blockquote> In ganga, run the " =~/myganga/ganga_dedx.py= " script to submit jobs to the Grid. Particle gun type, simulation version and physics list <br />will need to be defined beforehand in the ganga python interpreter. i.e: <blockquote> =sim = '06b', '07'<br /><br />particle = 'muon', 'pion', 'electron'<br /><br />pl = 'EmNoCuts', 'EmLHCb', 'EmOpt1', 'EmOpt3', 'EmStd'= </blockquote> Either single strings or lists of strings may be used for all variables. Using a list of more than one string will cause the script to loop over all possible combinations of the variables defined and submit ganga jobs (split with 100 files per subjob) and 1 job per particle gun energy. The script makes use of ganga's "jobtree" method and will create the required job directories if they do not exist, based on the list, particle and sim version. <br />Once the jobs have completed and auto-merged, running <blockquote> =ganga_dedx_copy_histos.py= </blockquote> in the ganga prompt will give output files useful names and move them to the relevant directories. It loops over a given range of job numbers, which needs to be set in the script. <br /><br />To analyse the data produced, run <blockquote> ~/GaussTests/dEdx/analyse.py <sim> <list> <particle> </blockquote> where the naming convention is the same as when sim, physics list and particle names are defined in ganga. More than one combination can be run with a simple shell loop, for example, in tcshell: <blockquote> =foreach sim (06b 07)= =foreach pl (EmNoCuts EmLHCb EmOpt1 EmOpt3 EmStd)= =foreach particle (muon electron pion)= =python analyse.py $sim $pl $particle= =end= =end= =end= </blockquote> Will run for all combinations provided the required root files exist. Any missing data will cause that combination to be skipped. The script calls upon the landau4new.C to fit the distributions. Which distribution is used is set in the landau4new.C script. By default it is histogram "1002" which is for path lengths of 290< x < 300 microns. The data files created by analyse.py in the same directory can be extracted and plotted with =makeplots= program. In here, there are functions that will automatically set colours and styles of lines and points depending on the version, list and particle and plot these on TGraphs and TMultigraphs <blockquote> =MakeGraph(): Takes in string options to create plot for specific sim version particle and physics list. Returns 1D vector of MPV, FWHM and MPV/FWHM= </blockquote> <blockquote> =MakeMG() : Takes in a 2D vector of the graphs you want to plot and a title string, <br /> returns a vector of 3 multigraphs for MPV, FWHM, MPV/FWHM= </blockquote><blockquote> =DrawCanv(): Takes in the vector returned by MakeMG(), auto sets titles, axis options etc <br /> and draws each graph and saves them as .png's in ~/GaussTests/dEdx/plots= </blockquote> To create a graph for a specific combination use MakeGraph(), which returns a vector of MPV, FWHM and MPV/FWHM graphs like so: <blockquote> =MakeGraph(string 'particle', string 'version', string 'cut')= </blockquote> eg: <blockquote> =vector v_NoCutsmm_07 = MakeGraph("muons","07","EmNoCuts");= =vector v_LHCbmm_07 = MakeGraph("muons","07","EmLHCb");= </blockquote> To then plot several graphs together, they must be pushed back into a 2D vector of TGraphs which is taken by =MakeMG()= and a further vector of TMultigraphs is returned, for MPV, FWHM and MPV/FWHM. eg: <blockquote> <pre> =V.push_back(V_NoCutsee_07);= </pre> =V.push_back(V_NoCutsee_07);= <pre> =vector mgl = MakeMG(Vl, "Sim 07 muons, EmNoCuts vs EmLHCb");= </pre></blockquote> which will return the multigraphs for the comparison of EmNoCuts muons and EmLHCb muons in sim07, with the specified title. .png files of these can be created with, for example <blockquote> =DrawCanv(mg, "Sim07 muons EmNoCuts vs EmLHCb","Sim07LHCbNoCutsmm");= </blockquote> which would draw a canvas for each graph with the title "Sim07 muons EmNoCuts vs EmLHCb" + <graph type> and file name "Sim07LHCbNoCutsmm.png" All plots are also saved in " =dedx_out.root= " as TGraphs and TMultiGraphs for manual editing. ---++++++ Modifying for future validations Most of the scripts determine parameters such as file locations, names and titles based on string concatenation of inputs, so assuming no drastic changes to the LHCb book keeping structure, using the scripts for new lists and version should not require any modification. makeplots requires very minor changes such as new options to be added into =MakeGraph()= as it chooses visual options based on the current physics lists, particles and only for sim06b and sim07. ---++ Hadronic Physics Multiplicity Tool <em>Here is a copy of the README file included in the package. Until it is officially released all the files can be found at "/afs/cern.ch/work/p/pluca/public/MultiplicityTool" on the LxPlus afs. Here I report the README file you can find in the folder<br /></em><br />The analysis is divided in two steps creating tuples and analysing them. This is all done using a simplified geometry made of target planes. Until is properly released the geometry can be found in the "fakeGeomOnly" folder.<br /><br />This README will assume you already installed Gauss ans GaussTools package.<br /><br />1) WHAT DO YOU NEED<br /><br />In order to CREATE tuples you need:<br /><br />- the "Multiplicity" tool in Gauss ( =Multiplicity.cpp Multiplicity.h= ):<br /> These should be already present in the folder <blockquote> =cmtuser/Gauss_(version)/Sim/GaussTools/src/Components/= </blockquote> <br /><br /> Until is properly released an updated copy is among my files.<br /> You must copy them in the folder said above and remake GaussTools<br /><br />- the python option file =Hadphyiscs.py=:<br /> tells Gauss to activate the Multiplicity tool and use the particular geometry <br /> and contains options for the energy and ID of the incoming particles<br /> Furthermore you'll need =Gauss-Job.py= <br /> (Gauss standard you can find one at =\$GAUSSOPTS=)<br /><br /><br />1) HOW TO RUN THE ANALYSIS<br /><br />In order to create tuples: <blockquote> =SetupGauss= (to be sure it is the right version)</blockquote> <blockquote> =source LbLogin.sh -c x86_64-slc5-gcc43-opt= <br /> =source SetupProject.sh Gauss (version)= </blockquote> <br /> <br /> <br /> (you can edit the =myGaussSetup.sh= included in my package and source it <br /> if you prefer. DO NOT FORGET TO SET THE ENVIRONMENT)<br /><br />- go inside the =runAll.py= script and modify the options at the beginning <br />(inside the available values reported)<br /> Remember to set =useganga=False= or it will fail running locally.<br /><br />- run it typing: <blockquote>python runAll.py</blockquote> In order to ANALYSE the tuples:<br /><br />The =runAll.py= script created an option file named " =option.txt= " <br />(this is created in the folder you set as output)<br />This option file can be modified to obtain different analysis output <br />(e.g. not plot all the particles on a single plot) * Compile the analyser: * Go in the Analysis folder * type <blockquote> =SetupProject root= </blockquote> * compile by typing <blockquote> =make= </blockquote> <br /> you may also use the following command: <blockquote> =g++ Multi.cpp Filereader.cpp options.cpp Multi_classes.cpp -o= <br /> =Multi.out `root-config --cflags --glibs`= </blockquote> * run the analysis by typing: <blockquote> =./Multi.out= </blockquote> The =Multi.exe= program reads the " =options.txt= " file and runs with those options, <br />allowing to draw different histos of total, inelastic cross secion or <br />multiplicity of different particles as a funcion of energy and more.<br /><br /> Allows to run in sequence many energies, materials, incoming particles and so on.<br /><br />All files are provided in the "CreateTuples" folder<br /><br />In order to analyse the tuples:<br /><br />All following files provided in the "Analysis" folder together with a =Makefile= ---+ Simulation Links Gauss Nightly Build Configurations (Environment Information) <a rel="noreferrer" target="_blank" href="https://gitlab.cern.ch/lhcb-core/LHCbNightlyConf/blob/master/Gauss.py#L113" style="box-sizing: border-box; background-color: rgba(61, 60, 64, 0.05); color: #2389d7; text-decoration-line: none; word-break: break-word; font-family: 'Open Sans', sans-serif; font-size: 13.5px; white-space: pre-wrap">https://gitlab.cern.ch/lhcb-core/LHCbNightlyConf/blob/master/Gauss.py</a> <br />LHCb Progress & Regression (LHCbPR2) https://lblhcbpr.cern.ch Scheduling of the tests in LHCbPR: <a href="https://gitlab.cern.ch/lhcb-core/LHCbNightlyConf/blob/master/test_schedule2.xml">https://gitlab.cern.ch/lhcb-core/LHCbNightlyConf/blob/master/test_schedule2.xml</a> LHCb Nightlies <a rel="noreferrer" target="_blank" href="https://lbnightlies.cern.ch/" style="background-color: #ffffff; box-sizing: border-box; color: #2389d7; text-decoration-line: none; word-break: break-word; font-family: 'Open Sans', sans-serif; font-size: 14px; white-space: nowrap">https://lbnightlies.cern.ch/</a>
Attachments
Attachments
Topic attachments
I
Attachment
History
Action
Size
Date
Who
Comment
pdf
LHCb-INT-2013-026_.pdf
r1
manage
2111.6 K
24 May 2013 - 09:53
UnknownUser
This topic: LHCb
>
LHCb
?
>
LHCbSimulationValidation
Topic revision: r4 - 16 Feb 2018 - _47DC_61ch_47DC_61cern_47OU_61Organic_32Units_47OU_61Users_47CN_61rcalladi_47CN_61811521_47CN_61Ryan_32Calladine
Copyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback