Generate, digitize and reconstruct two signal events with decays

Bd->J/Psi(mumu)Kshort

This tutorial shows you how to simulate, digitize and reconstruct signal events so that they can be analyzed in DaVinci. The versions of the code quoted are available in early 2010 and replace the version numbers with more recent ones if required.

Using Gauss to simulate events

The slides that explain what the program Gauss does are here.

Make an executable version of Gauss available in your lxplus area.

SetupProject Gauss v38r0p1 --build-env
getpack Sim/Gauss v38r0p1
cd Sim/Gauss/cmt
cmt make
SetupProject Gauss v38r0p1
cd ../options
emacs -nw Gauss-Job.py

This makes a directory under ~/cmtuser called Gauss_v38r0p1 to hold this version of Gauss and changes to that directory (the first SetupProject), then downloads the source files for Gauss into Sim/Gauss (the getpack line), lastly cmt make compiles the Gauss package.

The second SetupProject sets the environment variables to run Gauss.

Note: you only need to run SetupProject Package vNrP --build-env once to make the directory. However you need to run =SetupProject Package vNrP= every time you wish to start using the package.

Edit Gauss-Job.py to simulate the required events

Change the 5 in line

nEvts = 5
so that Gauss generates two events.

Change the name of the output file from the default (Gauss writes it for you) to something that will help you remember the content; for example

idFile = 'BsJPsiKs-2evt'
Remeber to uncomment the lines that set the histogram file name and OutputStream file name.

Save the file and quit emacs

Find out the event type for Bd->J/Psi(mumu)Kshort

Go into the EvtGen web page linked from that of DecFiles and find out the event type for the decay you want to simulate. You will want to generate events with the decay products in the acceptance so pick one with DecProdCut in the name (the table is at the end). For Bd->J/Psi(mumu)Kshort this means you will pick either 11144101 or 11144103 depending if you want to simulate your event without or with CP violation.

Run Gauss and look at the monitoring output

To run Gauss you will use the command gaudirun.py and specify that you want

  • a standard Gauss jobs with the MC09 geometry
  • the event type you have chosen
  • what is specific to your job (i.e. number of events, name of output file,...)
You will do so providing the appropriate arguments to the command, as in this case
gaudirun.py $GAUSSOPTS/Gauss-MC09.py $DECFILESROOT/options/11144101.opts $GAUSSOPTS/Gauss-Job.py | tee BsJPsiKs-2evt.log 

Wait while Gauss configures itself, Pythia, EvtGen and GEANT4, then generates two events.

You should see a very long file produced, the bit where it tells you about the B measons generated is here:

Generation.SignalRepe...   INFO *************   Signal counters   ****************
Number of events for generator level cut, before : 22, after : 3
Efficiency of the generator level cut : 0.13636 +/- 0.073165
Number of z-inverted events : 2

Number of events for generator particle level cut, before : 7, after : 1
Efficiency of the generator particle level cut : 0.14286 +/- 0.13226
Number of events for generator anti-particle level cut, before : 15, after : 2
Efficiency of the generator anti-particle level cut : 0.13333 +/- 0.087771

Number of signal B0 in sample : 1 [fraction : 0.2 +/- 0.17889]
Number of signal B~0 in sample : 4 [fraction : 0.8 +/- 0.17889]

Number of accepted B0 : 2 [fraction : 0.5 +/- 0.25]
Number of accepted B+ : 2 [fraction : 0.5 +/- 0.25]
Number of accepted Bs0 : 0 [fraction : 0 +/- 0]
Number of accepted b-Baryon : 0 [fraction : 0 +/- 0]
Number of accepted Bc+ : 0 [fraction : 0 +/- 0]
Number of accepted anti-B0 : 1 [fraction : 1 +/- 0]
Number of accepted B- : 0 [fraction : 0 +/- 0]
Number of accepted anti-Bs0 : 0 [fraction : 0 +/- 0]
Number of accepted anti-b-Baryon : 0 [fraction : 0 +/- 0]
Number of accepted Bc- : 0 [fraction : 0 +/- 0]
Number of accepted (bb) : 0

Number of accepted D0 : 0 [fraction : 0 +/- 0]
Number of accepted D+ : 0 [fraction : 0 +/- 0]
Number of accepted Ds+ : 1 [fraction : 1 +/- 0]
Number of accepted c-Baryon : 0 [fraction : 0 +/- 0]
Number of accepted anti-D0 : 2 [fraction : 1 +/- 0]
Number of accepted D- : 0 [fraction : 0 +/- 0]
Number of accepted Ds- : 0 [fraction : 0 +/- 0]
Number of accepted anti-c-Baryon : 0 [fraction : 0 +/- 0]
Number of accepted (cc) : 0

Number of accepted B : 0 [fraction : 0 +/- 0]
Number of accepted B* : 4 [fraction : 0.8 +/- 0.17889]
Number of accepted B** : 1 [fraction : 0.2 +/- 0.17889]

Number of accepted D : 0 [fraction : 0 +/- 0]
Number of accepted D* : 5 [fraction : 1 +/- 0]
Number of accepted D** : 0 [fraction : 0 +/- 0]
showing the number of "signal" particle types created in each event. Note this is not the end of the log file and may have scrolled off the top of the screen. The | tee bit of above command means there is a copy of the output file in BsJPsiKs-2evt.log.

Look at the histogram file produced called something like BsJPsiKs-2evt-histos.root and check there are hits in the VELO, RICH etc.

Digitize the two decays made in Gauss

Make an executable version of Boole in your lxplus area

SetupProject Boole v20r0 --build-env
getpack Digi/Boole v20r0
cd Digi/Boole/cmt
cmt make
SetupProject Boole v20r0
cd ../options

Edit MC09-Files.py to setup Boole to digitize the events generated earlier

Change the input data file to the BsJPsiKs-2evt.sim file you generated earlier in Gauss.

So make the following changes to MC09-Files.p

datasetname = 'BsJPsiKs-2evt'
EventSelector().Input = ["DATAFILE='PFN:$HOME/cmtuser/Gauss_v38r0p1/Sim/Gauss/options/" + datasetName + ".sim' TYP='POOL_ROOTTREE' OPT='READ'"]

Run Boole and check the output

Run Boole with gaudirun.py Boole-MC09-WithTruth.py MC09-Files.py | tee BsJPsiKs-2evt_Boole.log

Look at the histograms produced by Boole in BsJPsiKs-2evt-histos.root, check there are entries in the histograms.

Use Brunel to reconstruct the events digitized with Boole

Use the same instructions as for Gauss and Boole to setup, getpack and compile Brunel v35r11, note the location of the Brunel package for getpack is Rec/Brunel.

In the options directory set the input file to the output produced by Boole, i.e. BsJPsiKs-2evt.digi, in MC09-Files.py. Note the file name to change is the last one which is by default "30000000-100ev-20090407-MC09" and the EventSelector line just underneath that yo have the correct path.

Then run Brunel with gaudirun.py Brunel-MC09-WithTruth.py MC09-Files.py | tee BsJPsiKs-2evt_Brunel.log

Again check the output log file and the histograms produced.

-- DavidHutchcroft - 04 Jan 2010

Edit | Attach | Watch | Print version | History: r19 | r14 < r13 < r12 < r11 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r12 - 2010-01-04 - DavidHutchcroft
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    LHCb All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback