Difference: SimDigiReconTutorial (1 vs. 19)

Revision 192014-05-19 - NathanaelFarley

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"

Generate, digitize and reconstruct two signal events with decays

Bd->J/Psi(mumu)Kshort
Line: 60 to 60
 

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

Go into the

Changed:
<
<
[[http://lhcb-release-area.web.cern.ch/LHCb-release-area/DOC/gauss/generator/evtgen.php] [EvtGen web page]] linked from that of
>
>
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

Revision 182013-07-25 - DavidHutchcroft

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"

Generate, digitize and reconstruct two signal events with decays

Bd->J/Psi(mumu)Kshort
Line: 173 to 173
 

Use Moore to simulate the trigger for the events

Use the same instructions as for Gauss and Boole to setup Moore

Changed:
<
<
version v14r12.
>
>
version v14r8p1. Note in general you have to match a TCK version to a specific Moore version. One way to find compatible versions is to check the bookkeeping for what was used in official productions.
  Setup an configuration file for Moore, which sets the trigger TCK to configure a consistent trigger: Save the following to a file called
Line: 181 to 183
  %SYNTAX{ syntax="python" }% from Configurables import Moore
Added:
>
>
# match the DDDB and CondBD tags to the events
 Moore().DDDBtag = "Sim08-20130503-1" Moore().CondDBtag = "Sim08-20130503-1-vc-md100"
Added:
>
>
# Load the files that configure the full L0 & HLT emulation # The TCK version number sets the trigger conditions # this is the same as adding the files to the gaudirun.py command from Gaudi.Configuration import importOptions importOptions("$APPCONFIGOPTS/Moore/MooreSimProductionWithL0Emulation.py") importOptions("$APPCONFIGOPTS/Conditions/TCK-0x409f0045.py") importOptions("$APPCONFIGOPTS/Moore/DataType-2012.py") importOptions("$APPCONFIGOPTS/L0/L0TCK-0x0045.py")
 fileList = ['Boole-11144103-2ev-20130724.digi'] Moore().inputFiles = fileList # output filename is same as input file with Boole->Moore (both .digi)
Line: 193 to 205
  then run with

%SYNTAX{ syntax="bash" }%

Changed:
<
<
gaudirun.py Moore-2012.py $APPCONFIGOPTS/Moore/DataType-2012.py | tee BsJPsiKs-2evt_Moore.log
>
>
gaudirun.py Moore-2012.py | tee BsJPsiKs-2evt_Moore.log
 %ENDSYNTAX%

Note the output will be very long as we have a lot of trigger lines.

Line: 212 to 224
 LHCbApp().DDDBtag = "Sim08-20130503-1" LHCbApp().CondDBtag = "Sim08-20130503-1-vc-md100"
Changed:
<
<
#-- Event input

inputFiles = ['Moore-11144103-2ev-20130724.sim'] # wants a list of files

>
>
inputFiles = ['Moore-11144103-2ev-20130724.digi']
 from GaudiConf import IOHelper IOHelper('ROOT').inputFiles(inputFiles)
Deleted:
<
<
# name the ouput file the same as the first input file with Gauss->Boole
 # sets output and histogram file names Brunel().DatasetName = inputFiles[0].replace('Moore','Brunel').replace('.digi','') Brunel().DataType = '2012' # sets the 2011 configuration of Brunel

Revision 172013-07-24 - DavidHutchcroft

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"

Generate, digitize and reconstruct two signal events with decays

Bd->J/Psi(mumu)Kshort
Line: 6 to 6
  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 July 2013 and replace the version
Changed:
<
<
numbers with more recent ones if required. This is setup to generate Sim08 2011 events.
>
>
numbers with more recent ones if required. This is setup to generate Sim08 2012 events.
 
Line: 16 to 17
 

Setup a version of Gauss from the default installation at your site (or CERN)

Changed:
<
<
Log in to lxplus or if it is installed locally any computer with access to the LHCb software. If CVMFS is available it is the recommended way to access the LHCb software, setup with
>
>
Log in to lxplus or if it is installed locally any computer with access to the LHCb software. If CVMFS is available it is the recommended way to access the LHCb software, setup with
 
<!-- SyntaxHighlightingPlugin -->
export VO_LHCB_SW_DIR=/cvmfs/lhcb.cern.ch
source $VO_LHCB_SW_DIR/lib/LbLogin.sh -c x86_64-slc5-gcc46-opt
<!-- end SyntaxHighlightingPlugin -->
Changed:
<
<
this uses the code in slc5 compatibility mode as at the time of writing the slc6 versions are not available.
>
>
this uses the code in slc5 compatibility mode as at the time of writing the slc6 versions are not available.
  %SYNTAX{ syntax="sh" }% cd SomeDirectory
Line: 30 to 36
 emacs -nw Gauss-Job.py %ENDSYNTAX%
Changed:
<
<
The SetupProject sets the environment variables to run Gauss with the specific version. That line must always be executed each session before Gauss is run, although it is only needed once per terminal. SomeDirectory is a directory where the options, outputs and log files for the jobs will be stored. You should probably create this using mkdir if you do not have a suitable place already. The emacs line can be replaced with an editor of your choice.
>
>
The SetupProject sets the environment variables to run Gauss with the specific version. That line must always be executed each session before Gauss is run, although it is only needed once per terminal. SomeDirectory is a directory where the options, outputs and log files for the jobs will be stored. You should probably create this using mkdir if you do not have a suitable place already. The emacs line can be replaced with an editor of your choice.
 

Edit Gauss-Job.py to simulate the required events

Line: 42 to 51
 
<!-- SyntaxHighlightingPlugin -->
nEvts = 5
<!-- end SyntaxHighlightingPlugin -->
so that Gauss generates two events.
Changed:
<
<
The output file name will be automatically generated by Gauss, override this if you want by uncommenting the appropriate lines.
>
>
The output file name will be automatically generated by Gauss, override this if you want by uncommenting the appropriate lines.
  Save the file and quit emacs
Line: 50 to 60
 

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

Go into the

Changed:
<
<
EvtGen web page linked from that of
>
>
[[http://lhcb-release-area.web.cern.ch/LHCb-release-area/DOC/gauss/generator/evtgen.php] [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
Changed:
<
<
Bd->J/Psi(mumu)Kshort this means you will pick 11144103. Clicking on the number of the decay will take you to the official file in python detailing how the decay will be generated.
>
>
Bd->J/Psi(mumu)Kshort this means you will pick 11144103. Clicking on the number of the decay will take you to the official file in python detailing how the decay will be generated.
 

Run Gauss and look at the monitoring output

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

Changed:
<
<
  • a standard Gauss jobs with the 2011 geometry
>
>
  • a standard Gauss jobs with the 2012 geometry
 
  • the event type you have chosen
Changed:
<
<
  • what is specific to your job (i.e. number of events, name of output file,...)
>
>
  • what is specific to your job (i.e. number of events, run and first event numbers, name of output file,...)
 You will do so providing the appropriate arguments to the command, as in this case
gaudirun.py Gauss-Job.py $GAUSSOPTS/Gauss-2011.py $DECFILESROOT/options/11144103.py | tee BsJPsiKs-2evt_Gauss.log 
Changed:
<
<
Wait while Gauss configures itself, Pythia, EvtGen and GEANT4, then generates two events.
>
>
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 particles generated is here:
======================== Generators Statistics ====================
=                                                                 =
Changed:
<
<
= Number of particles generated: 948
>
>
= Number of particles generated: 1330
 = Number of events: 2
Changed:
<
<
= Mean multiplicity: 474
>
>
= Mean multiplicity: 665
 = =
Changed:
<
<
= Number of pseudo stable particles generated: 819
>
>
= Number of pseudo stable particles generated: 1120
 = Number of events: 2
Changed:
<
<
= Mean pseudo stable multiplicity: 409.5
>
>
= Mean pseudo stable multiplicity: 560
 = =
Changed:
<
<
= Number of charged stable particles generated: 240
>
>
= Number of charged stable particles generated: 344
 = Number of events: 2
Changed:
<
<
= Mean charged stable multiplicity: 120
>
>
= Mean charged stable multiplicity: 172
 = =
Changed:
<
<
= Number of charged stable particles in LHCb eta 60
>
>
= Number of charged stable particles in LHCb eta 79
 = Number of events: 2
Changed:
<
<
= Mean charged stable multiplicity in LHCb eta: 30
>
>
= Mean charged stable multiplicity in LHCb eta: 39.5
 = =
Added:
>
>
===============================================================
 
Changed:
<
<
showing the number of 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.
>
>
showing the number of 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 Gauss-11144103-2ev-20130724-histos.root and check there are hits in the VELO, RICH etc. The number of hits is also listed in the output log file.

 
Changed:
<
<
Look at the histogram file produced called something like Gauss-11144103-2ev-20130724-histos.root and check there are hits in the VELO, RICH etc.
>
>
    Counter     |     #     |    sum     | mean/eff^* | rms/err^*  |
"#VeloPU MCHits |         2 |        121 |     60.500 |     35.500 |
"#MCRichTracks" |         2 |        227 |     113.50 |     63.500 |
"#MCRichSegment |         2 |        301 |     150.50 |     82.500 |
...
 

Digitize the two decays made in Gauss

Line: 104 to 133
  %SYNTAX{ syntax="sh" }% SetupProject Boole v26r6
Deleted:
<
<
cp $BOOLEOPTS/MC11-Files.py ./Boole-2011-Files.py
 %ENDSYNTAX%
Changed:
<
<

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

>
>

Create Boole-2012.py to setup Boole to digitize the events generated earlier

 
Changed:
<
<
Change the input data file to the Gauss-11144103-2ev-20130724.sim file you generated earlier in Gauss (note the date part will be different to this one!). Also you must always make the DDDBtag and CondDBtag values match as these control the detector geometry and alignment. This must be the same in Gauss and Boole, the values used in Gauss can be found from the file Gauss-2011.py which you copied earlier.
>
>
Write the file Boole-2012.py containg
 
Deleted:
<
<
So make the following changes to Boole2-2011-Files.py
 %SYNTAX{ syntax="python" }%
Changed:
<
<
#-- Event input LHCbApp().DDDBtag = "Sim08-20130503" LHCbApp().CondDBtag = "Sim08-20130503-vc-md100"

datasetName = "Gauss-11144103-2ev-20130724" EventSelector().Input = ["DATAFILE='PFN:" + datasetName + ".sim'"] %ENDSYNTAX%

>
>
from Configurables import Boole Boole().DataType = "2012" from Configurables import LHCbApp LHCbApp().DDDBtag = "Sim08-20130503-1" LHCbApp().CondDBtag = "Sim08-20130503-1-vc-md100" inputFiles = ['Gauss-11144103-2ev-20130724.sim'] # wants a list of files from GaudiConf import IOHelper IOHelper('ROOT').inputFiles(inputFiles) # name the ouput file the same as the first input file with Gauss->Boole # DatasetName also sets histogram output file name Boole().DatasetName = inputFiles[0].replace('Gauss','Boole').replace('.sim','') %ENDSYNTAX%

Change the input data file to the Gauss-11144103-2ev-20130724.sim file you generated earlier in Gauss (note the date part will be different to this one!). Also you must always make the DDDBtag and CondDBtag values match as these control the detector geometry and alignment. This must be the same in Gauss and Boole, the values used in Gauss can be found from the file $GAUSSOPTS/Gauss-2012.py which you used earlier and is also in the Gauss log file near the top. Check the values above are still correct.

 

Run Boole and check the output

Run Boole with

Changed:
<
<
gaudirun.py Boole-2011-Files.py | tee BsJPsiKs-2evt_Boole.log
>
>
gaudirun.py Boole-2012.py | tee BsJPsiKs-2evt_Boole.log
 

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

Line: 134 to 172
 

Use Moore to simulate the trigger for the events

Changed:
<
<
Moore is very localized, only a few versions work with each TCK, for 2011 simulation the last compatible version is v12r9p5 (if a trigger expert knows better please correct this). That version predates releases on gcc46 so setup gcc43:

source $VO_LHCB_SW_DIR/lib/LbLogin.sh -c x86_64-slc5-gcc43-opt or on lxplus just source LbLogin.sh -c x86_64-slc5-gcc43-opt

Use the same instructions as for Gauss and Boole to setup Moore version v12r9p5 after setting the environment to gcc43.

>
>
Use the same instructions as for Gauss and Boole to setup Moore version v14r12.
 
Changed:
<
<
Setup an configuration file for Moore, which sets the trigger TCK to configure a consistent trigger: Save the following to a file called Moore-2011.py (correct the input file name to the one Boole created).
>
>
Setup an configuration file for Moore, which sets the trigger TCK to configure a consistent trigger: Save the following to a file called Moore-2012.py (correct the input file name to the one Boole created).
  %SYNTAX{ syntax="python" }% from Configurables import Moore
Changed:
<
<
Moore().UseTCK = True # provide an invalid TCK here so one is forced to append eg. Conditions/TCK-0x00051810.py Moore().InitialTCK = '0x40760037' Moore().L0 = True Moore().ReplaceL0BanksWithEmulated = True Moore().UseDBSnapshot = False Moore().EnableRunChangeHandler = False Moore().CheckOdin = False Moore().WriterRequires = [] Moore().Simulation = True from Configurables import L0MuonAlg L0MuonAlg( "L0Muon" ).L0DUConfigProviderType = "L0DuConfigProvider"

from Configurables import Moore Moore().DDDBtag = "Sim08-20130503" Moore().CondDBtag = "Sim08-20130503-vc-md100"

fileList = ['Gauss-11144103-2ev-20130724.digi']

>
>
Moore().DDDBtag = "Sim08-20130503-1" Moore().CondDBtag = "Sim08-20130503-1-vc-md100"
 
Added:
>
>
fileList = ['Boole-11144103-2ev-20130724.digi']
 Moore().inputFiles = fileList
Added:
>
>
# output filename is same as input file with Boole->Moore (both .digi)
 Moore().outputFile = Moore().inputFiles[0].replace('Boole','Moore') %ENDSYNTAX%

then run with

Changed:
<
<
gaudirun.py Moore-2011.py | tee BsJPsiKs-2evt_Moore.log
>
>
<!-- SyntaxHighlightingPlugin -->
gaudirun.py Moore-2012.py $APPCONFIGOPTS/Moore/DataType-2012.py | tee BsJPsiKs-2evt_Moore.log
<!-- end SyntaxHighlightingPlugin -->

Note the output will be very long as we have a lot of trigger lines.

 

Use Brunel to reconstruct the events digitized with Boole

Line: 183 to 209
 %SYNTAX{ syntax="python" }% from Gaudi.Configuration import * from Configurables import Brunel, LHCbApp
Added:
>
>
LHCbApp().DDDBtag = "Sim08-20130503-1" LHCbApp().CondDBtag = "Sim08-20130503-1-vc-md100"
  #-- Event input
Deleted:
<
<
LHCbApp().DDDBtag = "Sim08-20130503" LHCbApp().CondDBtag = "Sim08-20130503-vc-md100"

datasetName = "Moore-11144103-2ev-20130724"

EventSelector().Input = ["DATAFILE='PFN:" + datasetName + ".digi?svcClass=default' TYP='POOL_ROOTTREE' OPT='READ'"]

 
Changed:
<
<
Brunel().DatasetName = datasetName # sets output and histogram file names Brunel().DataType = '2011' # sets the 2011 configuration of Brunel
>
>
inputFiles = ['Moore-11144103-2ev-20130724.sim'] # wants a list of files from GaudiConf import IOHelper IOHelper('ROOT').inputFiles(inputFiles) # name the ouput file the same as the first input file with Gauss->Boole # sets output and histogram file names Brunel().DatasetName = inputFiles[0].replace('Moore','Brunel').replace('.digi','') Brunel().DataType = '2012' # sets the 2011 configuration of Brunel
 Brunel().InputType = "DIGI" # input has the format digi Brunel().WithMC = True # use the MC truth information in the digi file %ENDSYNTAX%
Changed:
<
<
Save the above in Brunel-2011-Files.py to set up Brunel.
>
>
Save the above in Brunel-2012.py to set up Brunel.
  Then run Brunel with
Changed:
<
<
gaudirun.py Brunel-2011-Files.py | tee BsJPsiKs-2evt_Brunel.log
>
>
gaudirun.py Brunel-2012.py | tee BsJPsiKs-2evt_Brunel.log
  Again check the output log file and the histograms produced.

Revision 162013-07-24 - DavidHutchcroft

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"

Generate, digitize and reconstruct two signal events with decays

Bd->J/Psi(mumu)Kshort
Line: 132 to 132
 Look at the histograms produced by Boole in BsJPsiKs-2evt-histos.root, check there are entries in the histograms.
Added:
>
>

Use Moore to simulate the trigger for the events

Moore is very localized, only a few versions work with each TCK, for 2011 simulation the last compatible version is v12r9p5 (if a trigger expert knows better please correct this). That version predates releases on gcc46 so setup gcc43:

source $VO_LHCB_SW_DIR/lib/LbLogin.sh -c x86_64-slc5-gcc43-opt or on lxplus just source LbLogin.sh -c x86_64-slc5-gcc43-opt

Use the same instructions as for Gauss and Boole to setup Moore version v12r9p5 after setting the environment to gcc43.

Setup an configuration file for Moore, which sets the trigger TCK to configure a consistent trigger: Save the following to a file called Moore-2011.py (correct the input file name to the one Boole created).

<!-- SyntaxHighlightingPlugin -->
from Configurables import Moore
Moore().UseTCK = True # provide an invalid TCK here so one is forced to append eg. Conditions/TCK-0x00051810.py
Moore().InitialTCK = '0x40760037'
Moore().L0 = True
Moore().ReplaceL0BanksWithEmulated = True
Moore().UseDBSnapshot = False
Moore().EnableRunChangeHandler = False
Moore().CheckOdin = False
Moore().WriterRequires = []
Moore().Simulation = True
from Configurables import L0MuonAlg
L0MuonAlg( "L0Muon" ).L0DUConfigProviderType = "L0DuConfigProvider"


from Configurables import Moore
Moore().DDDBtag   = "Sim08-20130503"
Moore().CondDBtag = "Sim08-20130503-vc-md100"

fileList = ['Gauss-11144103-2ev-20130724.digi']

Moore().inputFiles = fileList
Moore().outputFile = Moore().inputFiles[0].replace('Boole','Moore')
<!-- end SyntaxHighlightingPlugin -->

then run with

gaudirun.py Moore-2011.py | tee BsJPsiKs-2evt_Moore.log

 

Use Brunel to reconstruct the events digitized with Boole

Changed:
<
<
Use the same instructions as for Gauss and Boole to setup Brunel version v44r5.
>
>
Setup Brunel version v44r5.
  The Brunel options required to run the job are the values of DDDBtag and CondDBtag, the input file name and type and the required output from Brunel.
Line: 148 to 188
 LHCbApp().DDDBtag = "Sim08-20130503" LHCbApp().CondDBtag = "Sim08-20130503-vc-md100"
Changed:
<
<
datasetName = "Gauss-11144103-2ev-20130724"
>
>
datasetName = "Moore-11144103-2ev-20130724"
  EventSelector().Input = ["DATAFILE='PFN:" + datasetName + ".digi?svcClass=default' TYP='POOL_ROOTTREE' OPT='READ'"]

Revision 152013-07-24 - DavidHutchcroft

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"

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

Changed:
<
<
the code quoted are available in December 2011 and replace the version numbers with more recent ones if required. This is setup to generate MC11a events which are the latest version at the time of writing but will probably be depreciated by the time you read this.
>
>
the code quoted are available in July 2013 and replace the version numbers with more recent ones if required. This is setup to generate Sim08 2011 events.
 
Line: 17 to 16
 

Setup a version of Gauss from the default installation at your site (or CERN)

Changed:
<
<
Log in to lxplus or if it is installed locally any computer with access to the LHCb software.
>
>
Log in to lxplus or if it is installed locally any computer with access to the LHCb software. If CVMFS is available it is the recommended way to access the LHCb software, setup with
<!-- SyntaxHighlightingPlugin -->
export VO_LHCB_SW_DIR=/cvmfs/lhcb.cern.ch
source $VO_LHCB_SW_DIR/lib/LbLogin.sh -c x86_64-slc5-gcc46-opt
<!-- end SyntaxHighlightingPlugin -->
this uses the code in slc5 compatibility mode as at the time of writing the slc6 versions are not available.
  %SYNTAX{ syntax="sh" }% cd SomeDirectory
Changed:
<
<
SetupProject Gauss v41r0
>
>
SetupProject Gauss v45r3
 cp $GAUSSOPTS/Gauss-Job.py ./
Deleted:
<
<
cp $GAUSSOPTS/Gauss-MC11a.py ./
 emacs -nw Gauss-Job.py %ENDSYNTAX%
Line: 39 to 42
 
<!-- SyntaxHighlightingPlugin -->
nEvts = 5
<!-- end SyntaxHighlightingPlugin -->
so that Gauss generates two events.
Changed:
<
<
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
<!-- SyntaxHighlightingPlugin -->
idFile = 'BsJPsiKs-2evt'
<!-- end SyntaxHighlightingPlugin -->
Remeber to uncomment the lines that set the histogram file name and OutputStream file name.
>
>
The output file name will be automatically generated by Gauss, override this if you want by uncommenting the appropriate lines.
  Save the file and quit emacs
Line: 62 to 61
 

Run Gauss and look at the monitoring output

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

Changed:
<
<
  • a standard Gauss jobs with the MC11a geometry
>
>
  • a standard Gauss jobs with the 2011 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
Changed:
<
<
gaudirun.py Gauss-Job.py Gauss-MC11a.py $DECFILESROOT/options/11144103.py | tee BsJPsiKs-2evt_Gauss.log 
>
>
gaudirun.py Gauss-Job.py $GAUSSOPTS/Gauss-2011.py $DECFILESROOT/options/11144103.py | tee BsJPsiKs-2evt_Gauss.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

Changed:
<
<
about the B mesons generated is here:
>
>
about the particles generated is here:
 
Changed:
<
<
SignalRepe... INFO *********** Signal counters ************** Number of events for generator level cut, before : 3, after : 0 Efficiency of the generator level cut : 0 +/- 0 Number of z-inverted events : 2

Number of events for generator anti-particle level cut, before : 3, after : 0 Efficiency of the generator anti-particle level cut : 0 +/- 0

Number of signal B0 in sample : 0 [fraction : 0 +/- 0] Number of signal B~0 in sample : 2 [fraction : 1 +/- 0]

Number of accepted B0 : 2 [fraction : 0.66667 +/- 0.27217] Number of accepted B+ : 0 [fraction : 0 +/- 0] Number of accepted Bs0 : 1 [fraction : 0.33333 +/- 0.27217] Number of accepted b-Baryon : 0 [fraction : 0 +/- 0] Number of accepted Bc+ : 0 [fraction : 0 +/- 0] Number of accepted anti-B0 : 0 [fraction : 0 +/- 0] Number of accepted B- : 1 [fraction : 1 +/- 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 : 1 [fraction : 0.5 +/- 0.35355] Number of accepted D+ : 0 [fraction : 0 +/- 0] Number of accepted Ds+ : 1 [fraction : 0.5 +/- 0.35355] Number of accepted c-Baryon : 0 [fraction : 0 +/- 0] Number of accepted anti-D0 : 0 [fraction : nan +/- nan] Number of accepted D- : 0 [fraction : nan +/- nan] Number of accepted Ds- : 0 [fraction : nan +/- nan] Number of accepted anti-c-Baryon : 0 [fraction : nan +/- nan] Number of accepted (cc) : 0

Number of accepted B : 0 [fraction : 0 +/- 0] Number of accepted B* : 2 [fraction : 1 +/- 0] Number of accepted B** : 0 [fraction : 0 +/- 0]

Number of accepted D : 0 [fraction : 0 +/- 0] Number of accepted D* : 2 [fraction : 1 +/- 0] Number of accepted D** : 0 [fraction : 0 +/- 0]

>
>
==================== Generators Statistics ================ = = = Number of particles generated: 948 = Number of events: 2 = Mean multiplicity: 474 = = = Number of pseudo stable particles generated: 819 = Number of events: 2 = Mean pseudo stable multiplicity: 409.5 = = = Number of charged stable particles generated: 240 = Number of events: 2 = Mean charged stable multiplicity: 120 = = = Number of charged stable particles in LHCb eta 60 = Number of events: 2 = Mean charged stable multiplicity in LHCb eta: 30 = =
 
Changed:
<
<
showing the number of "signal" particle types created in each
>
>
showing the number of 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.
Changed:
<
<
Look at the histogram file produced called something like BsJPsiKs-2evt-histos.root and check there are hits in the VELO, RICH etc.
>
>
Look at the histogram file produced called something like Gauss-11144103-2ev-20130724-histos.root and check there are hits in the VELO, RICH etc.
 

Digitize the two decays made in Gauss

Setup access to a version of Boole

%SYNTAX{ syntax="sh" }%

Changed:
<
<
SetupProject Boole v23r1 cp $BOOLEOPTS/MC11-Files.py ./Boole-MC11a-Files.py
>
>
SetupProject Boole v26r6 cp $BOOLEOPTS/MC11-Files.py ./Boole-2011-Files.py
 %ENDSYNTAX%
Changed:
<
<

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

>
>

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

 
Changed:
<
<
Change the input data file to the BsJPsiKs-2evt.sim file you generated earlier in Gauss. Also you must always make
>
>
Change the input data file to the Gauss-11144103-2ev-20130724.sim file you generated earlier in Gauss (note the date part will be different to this one!). Also you must always make
 the DDDBtag and CondDBtag values match as these control the detector geometry and alignment. This must be the same in
Changed:
<
<
Gauss and Boole, the values used in Gauss can be found from the file Gauss-MC11a.py which you copied earlier.
>
>
Gauss and Boole, the values used in Gauss can be found from the file Gauss-2011.py which you copied earlier.
 
Changed:
<
<
So make the following changes to Boole-MC11a-Files.py
>
>
So make the following changes to Boole2-2011-Files.py
 %SYNTAX{ syntax="python" }% #-- Event input
Changed:
<
<
LHCbApp().DDDBtag = "MC11-20111102" LHCbApp().CondDBtag = "sim-20111111-vc-md100"
>
>
LHCbApp().DDDBtag = "Sim08-20130503" LHCbApp().CondDBtag = "Sim08-20130503-vc-md100"
 
Changed:
<
<
datasetName = 'BsJPsiKs-2evt'
>
>
datasetName = "Gauss-11144103-2ev-20130724"
 EventSelector().Input = ["DATAFILE='PFN:" + datasetName + ".sim'"] %ENDSYNTAX%

Run Boole and check the output

Run Boole with

Changed:
<
<
gaudirun.py Boole-MC11a-Files.py | tee BsJPsiKs-2evt_Boole.log
>
>
gaudirun.py Boole-2011-Files.py | tee BsJPsiKs-2evt_Boole.log
 

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

Line: 157 to 134
 

Use Brunel to reconstruct the events digitized with Boole

Changed:
<
<
Use the same instructions as for Gauss and Boole to setup Brunel version v41r2.
>
>
Use the same instructions as for Gauss and Boole to setup Brunel version v44r5.
  The Brunel options required to run the job are the values of DDDBtag and CondDBtag, the input file name and type and the required output from Brunel.
Line: 168 to 145
 from Configurables import Brunel, LHCbApp

#-- Event input

Changed:
<
<
LHCbApp().DDDBtag = "MC11-20111102" LHCbApp().CondDBtag = "sim-20111111-vc-md100"
>
>
LHCbApp().DDDBtag = "Sim08-20130503" LHCbApp().CondDBtag = "Sim08-20130503-vc-md100"
 
Changed:
<
<
datasetName = 'BsJPsiKs-2evt'
>
>
datasetName = "Gauss-11144103-2ev-20130724"
  EventSelector().Input = ["DATAFILE='PFN:" + datasetName + ".digi?svcClass=default' TYP='POOL_ROOTTREE' OPT='READ'"]
Line: 181 to 158
 Brunel().WithMC = True # use the MC truth information in the digi file %ENDSYNTAX%
Changed:
<
<
Save the above in Brunel-MC11a-Files.py to set up Brunel.
>
>
Save the above in Brunel-2011-Files.py to set up Brunel.
  Then run Brunel with
Changed:
<
<
gaudirun.py Brunel-MC11a-Files.py | tee BsJPsiKs-2evt_Brunel.log
>
>
gaudirun.py Brunel-2011-Files.py | tee BsJPsiKs-2evt_Brunel.log
  Again check the output log file and the histograms produced.
Changed:
<
<
-- DavidHutchcroft - 02-Dec-2011
>
>
-- DavidHutchcroft - 24-Jul-2013

Revision 142011-12-02 - DavidHutchcroft

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"

Generate, digitize and reconstruct two signal events with decays

Bd->J/Psi(mumu)Kshort
Line: 17 to 17
 

Setup a version of Gauss from the default installation at your site (or CERN)

Added:
>
>
Log in to lxplus or if it is installed locally any computer with access to the LHCb software.
 %SYNTAX{ syntax="sh" }% cd SomeDirectory SetupProject Gauss v41r0
Line: 28 to 30
 The SetupProject sets the environment variables to run Gauss with the specific version. That line must always be executed each session before Gauss is run, although it is only needed once per terminal. SomeDirectory is a directory where the options, outputs and log files for the jobs will be stored. You should
Changed:
<
<
probably create this using mkdir if you do not have a suitable place already.
>
>
probably create this using mkdir if you do not have a suitable place already. The emacs line can be replaced with an editor of your choice.
 

Edit Gauss-Job.py to simulate the required events

Line: 54 to 56
 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
Changed:
<
<
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. Clicking on the number of the decay will take you to the official file in python detailing how the decay will be generated.
>
>
Bd->J/Psi(mumu)Kshort this means you will pick 11144103. Clicking on the number of the decay will take you to the official file in python detailing how the decay will be generated.
 

Run Gauss and look at the monitoring output

Line: 65 to 66
 
  • 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
Changed:
<
<
gaudirun.py Gauss-Job.py Gauss-MC11a.py $DECFILESROOT/options/11144001.py | tee BsJPsiKs-2evt_Guass.log 
>
>
gaudirun.py Gauss-Job.py Gauss-MC11a.py $DECFILESROOT/options/11144103.py | tee BsJPsiKs-2evt_Gauss.log 
  Wait while Gauss configures itself, Pythia, EvtGen and GEANT4, then generates two events.
Line: 129 to 130
 cp $BOOLEOPTS/MC11-Files.py ./Boole-MC11a-Files.py %ENDSYNTAX%
Changed:
<
<

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

>
>

Edit Boole-MC11a-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. Also you must always make the DDDBtag and CondDBtag values match as these control the detector geometry and alignment. This must be the same in

Revision 132011-12-02 - DavidHutchcroft

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"

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

Changed:
<
<
the code quoted are available in early 2010 and replace the version numbers with more recent ones if required.
>
>
the code quoted are available in December 2011 and replace the version numbers with more recent ones if required. This is setup to generate MC11a events which are the latest version at the time of writing but will probably be depreciated by the time you read this.
 
Line: 14 to 15
  The slides that explain what the program Gauss does are here.
Changed:
<
<

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

>
>

Setup a version of Gauss from the default installation at your site (or CERN)

  %SYNTAX{ syntax="sh" }%
Changed:
<
<
SetupProject Gauss v38r0p1 --build-env getpack Sim/Gauss v38r0p1 cd Sim/Gauss/cmt cmt make SetupProject Gauss v38r0p1 cd ../options
>
>
cd SomeDirectory SetupProject Gauss v41r0 cp $GAUSSOPTS/Gauss-Job.py ./ cp $GAUSSOPTS/Gauss-MC11a.py ./
 emacs -nw Gauss-Job.py %ENDSYNTAX%
Changed:
<
<
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.

>
>
The SetupProject sets the environment variables to run Gauss with the specific version. That line must always be executed each session before Gauss is run, although it is only needed once per terminal. SomeDirectory is a directory where the options, outputs and log files for the jobs will be stored. You should probably create this using mkdir if you do not have a suitable place already.
 

Edit Gauss-Job.py to simulate the required events

Line: 62 to 56
 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
Changed:
<
<
CP violation.
>
>
CP violation. Clicking on the number of the decay will take you to the official file in python detailing how the decay will be generated.
 

Run Gauss and look at the monitoring output

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

Changed:
<
<
  • a standard Gauss jobs with the MC09 geometry
>
>
  • a standard Gauss jobs with the MC11a 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
Changed:
<
<
gaudirun.py $GAUSSOPTS/Gauss-MC09.py $DECFILESROOT/options/11144101.opts $GAUSSOPTS/Gauss-Job.py | tee BsJPsiKs-2evt.log 
>
>
gaudirun.py Gauss-Job.py Gauss-MC11a.py $DECFILESROOT/options/11144001.py | tee BsJPsiKs-2evt_Guass.log 
 
Changed:
<
<
Wait while Gauss configures itself, Pythia, EvtGen and GEANT4, then generates two events.
>
>
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
Changed:
<
<
about the B measons generated is here:
>
>
about the B mesons generated is here:
 
Generation.SignalRepe...   INFO *************   Signal counters   ****************
Changed:
<
<
Number of events for generator level cut, before : 22, after : 3 Efficiency of the generator level cut : 0.13636 +/- 0.073165
>
>
Number of events for generator level cut, before : 3, after : 0 Efficiency of the generator level cut : 0 +/- 0
 Number of z-inverted events : 2
Changed:
<
<
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 events for generator anti-particle level cut, before : 3, after : 0 Efficiency of the generator anti-particle level cut : 0 +/- 0

Number of signal B0 in sample : 0 [fraction : 0 +/- 0] Number of signal B~0 in sample : 2 [fraction : 1 +/- 0]

Number of accepted B0 : 2 [fraction : 0.66667 +/- 0.27217] Number of accepted B+ : 0 [fraction : 0 +/- 0] Number of accepted Bs0 : 1 [fraction : 0.33333 +/- 0.27217]

 Number of accepted b-Baryon : 0 [fraction : 0 +/- 0] Number of accepted Bc+ : 0 [fraction : 0 +/- 0]
Changed:
<
<
Number of accepted anti-B0 : 1 [fraction : 1 +/- 0] Number of accepted B- : 0 [fraction : 0 +/- 0]
>
>
Number of accepted anti-B0 : 0 [fraction : 0 +/- 0] Number of accepted B- : 1 [fraction : 1 +/- 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
Changed:
<
<
Number of accepted D0 : 0 [fraction : 0 +/- 0]
>
>
Number of accepted D0 : 1 [fraction : 0.5 +/- 0.35355]
 Number of accepted D+ : 0 [fraction : 0 +/- 0]
Changed:
<
<
Number of accepted Ds+ : 1 [fraction : 1 +/- 0]
>
>
Number of accepted Ds+ : 1 [fraction : 0.5 +/- 0.35355]
 Number of accepted c-Baryon : 0 [fraction : 0 +/- 0]
Changed:
<
<
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 anti-D0 : 0 [fraction : nan +/- nan] Number of accepted D- : 0 [fraction : nan +/- nan] Number of accepted Ds- : 0 [fraction : nan +/- nan] Number of accepted anti-c-Baryon : 0 [fraction : nan +/- nan]
 Number of accepted (cc) : 0

Number of accepted B : 0 [fraction : 0 +/- 0]

Changed:
<
<
Number of accepted B* : 4 [fraction : 0.8 +/- 0.17889] Number of accepted B** : 1 [fraction : 0.2 +/- 0.17889]
>
>
Number of accepted B* : 2 [fraction : 1 +/- 0] Number of accepted B** : 0 [fraction : 0 +/- 0]
  Number of accepted D : 0 [fraction : 0 +/- 0]
Changed:
<
<
Number of accepted D* : 5 [fraction : 1 +/- 0]
>
>
Number of accepted D* : 2 [fraction : 1 +/- 0]
 Number of accepted D** : 0 [fraction : 0 +/- 0] showing the number of "signal" particle types created in each
Line: 130 to 122
 

Digitize the two decays made in Gauss

Changed:
<
<

Make an executable version of Boole in your lxplus area

>
>

Setup access to a version of Boole

  %SYNTAX{ syntax="sh" }%
Changed:
<
<
SetupProject Boole v20r0 --build-env getpack Digi/Boole v20r0 cd Digi/Boole/cmt cmt make SetupProject Boole v20r0 cd ../options
>
>
SetupProject Boole v23r1 cp $BOOLEOPTS/MC11-Files.py ./Boole-MC11a-Files.py
 %ENDSYNTAX%
Changed:
<
<

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

>
>

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

 
Changed:
<
<
Change the input data file to the BsJPsiKs-2evt.sim file you generated earlier in Gauss.
>
>
Change the input data file to the BsJPsiKs-2evt.sim file you generated earlier in Gauss. Also you must always make the DDDBtag and CondDBtag values match as these control the detector geometry and alignment. This must be the same in Gauss and Boole, the values used in Gauss can be found from the file Gauss-MC11a.py which you copied earlier.
 
Changed:
<
<
So make the following changes to MC09-Files.p
>
>
So make the following changes to Boole-MC11a-Files.py
 %SYNTAX{ syntax="python" }%
Changed:
<
<
datasetname = 'BsJPsiKs-2evt' EventSelector().Input = ["DATAFILE='PFN:$HOME/cmtuser/Gauss_v38r0p1/Sim/Gauss/options/" + datasetName + ".sim' TYP='POOL_ROOTTREE' OPT='READ'"]
>
>
#-- Event input LHCbApp().DDDBtag = "MC11-20111102" LHCbApp().CondDBtag = "sim-20111111-vc-md100"

datasetName = 'BsJPsiKs-2evt' EventSelector().Input = ["DATAFILE='PFN:" + datasetName + ".sim'"]

 %ENDSYNTAX%

Run Boole and check the output

Run Boole with

Changed:
<
<
gaudirun.py Boole-MC09-WithTruth.py MC09-Files.py | tee BsJPsiKs-2evt_Boole.log
>
>
gaudirun.py Boole-MC11a-Files.py | tee BsJPsiKs-2evt_Boole.log
 

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

Line: 162 to 156
 

Use Brunel to reconstruct the events digitized with Boole

Changed:
<
<
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.

>
>
Use the same instructions as for Gauss and Boole to setup Brunel version v41r2.

The Brunel options required to run the job are the values of DDDBtag and CondDBtag, the input file name and type and the required output from Brunel.

We can write a file that sets all of this:

<!-- SyntaxHighlightingPlugin -->
from Gaudi.Configuration import *
from Configurables import Brunel, LHCbApp

#-- Event input
LHCbApp().DDDBtag   = "MC11-20111102"
LHCbApp().CondDBtag = "sim-20111111-vc-md100"

datasetName = 'BsJPsiKs-2evt'

EventSelector().Input = ["DATAFILE='PFN:" + datasetName + ".digi?svcClass=default' TYP='POOL_ROOTTREE' OPT='READ'"]

Brunel().DatasetName = datasetName # sets output and histogram file names
Brunel().DataType = '2011'  # sets the 2011 configuration of Brunel
Brunel().InputType = "DIGI" # input has the format digi
Brunel().WithMC    = True   # use the MC truth information in the digi file
<!-- end SyntaxHighlightingPlugin -->

Save the above in Brunel-MC11a-Files.py to set up Brunel.

  Then run Brunel with
Changed:
<
<
gaudirun.py Brunel-MC09-WithTruth.py MC09-Files.py | tee BsJPsiKs-2evt_Brunel.log
>
>
gaudirun.py Brunel-MC11a-Files.py | tee BsJPsiKs-2evt_Brunel.log
  Again check the output log file and the histograms produced.
Changed:
<
<
-- DavidHutchcroft - 04 Jan 2010
>
>
-- DavidHutchcroft - 02-Dec-2011

Revision 122010-01-04 - DavidHutchcroft

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"
Changed:
<
<

Generate, digitize and reconstruct two signal events with decays Bd->J/Psi(mumu)Kshort

>
>

Generate, digitize and reconstruct two signal events with decays

Bd->J/Psi(mumu)Kshort
 
Changed:
<
<
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 2009 and may not be the final version used for the main productions in 2009.
>
>
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

Changed:
<
<
The slides that explain what the program Gauss does are here.
>
>
The slides that explain what the program Gauss does are here.
 

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

%SYNTAX{ syntax="sh" }%

Changed:
<
<
SetupProject Gauss v36r0 --build-env getpack Sim/Gauss v36r0
>
>
SetupProject Gauss v38r0p1 --build-env getpack Sim/Gauss v38r0p1
 cd Sim/Gauss/cmt
Changed:
<
<
SetupProject Gauss v36r0 gmake
>
>
cmt make SetupProject Gauss v38r0p1
 cd ../options emacs -nw Gauss-Job.py %ENDSYNTAX%
Changed:
<
<
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.
>
>
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

Line: 30 to 43
 
<!-- SyntaxHighlightingPlugin -->
nEvts = 5
<!-- end SyntaxHighlightingPlugin -->
so that Gauss generates two events.
Changed:
<
<
Change the name of the output file from GaussExample to something that will help you remember the content; for example
>
>
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
 
<!-- SyntaxHighlightingPlugin -->
idFile = 'BsJPsiKs-2evt'
<!-- end SyntaxHighlightingPlugin -->
Added:
>
>
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

Changed:
<
<
Go into the EvtGen web page linked from that of Gauss 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.
>
>
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

Changed:
<
<
  • a standard Gauss jobs with the latest geometry
>
>
  • 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
Changed:
<
<
gaudirun.py $GAUSSOPTS/Gauss-2008.py $DECFILESROOT/options/11144101.opts $GAUSSOPTS/Gauss-Job.py
>
>
gaudirun.py $GAUSSOPTS/Gauss-MC09.py $DECFILESROOT/options/11144101.opts $GAUSSOPTS/Gauss-Job.py | tee BsJPsiKs-2evt.log 
 
Changed:
<
<
Wait while Gauss configures itself, Pythia, EvtGen and GEANT4, then generates two events.
>
>
Wait while Gauss configures itself, Pythia, EvtGen and GEANT4, then generates two events.
 
Changed:
<
<
You should see something like this:
>
>
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   ****************
Changed:
<
<
Number of events for generator level cut, before : 2, after : 1 Efficiency of the generator level cut : 0.5 +/- 0.35355 Number of z-inverted events : 1

Number of events for generator particle level cut, before : 2, after : 1 Efficiency of the generator particle level cut : 0.5 +/- 0.35355

Number of signal B0 in sample : 2 [fraction : 1 +/- 0] Number of signal B~0 in sample : 0 [fraction : 0 +/- 0]

Number of accepted B0 : 0 [fraction : nan +/- nan] Number of accepted B+ : 0 [fraction : nan +/- nan] Number of accepted Bs0 : 0 [fraction : nan +/- nan] Number of accepted b-Baryon : 0 [fraction : nan +/- nan] Number of accepted Bc+ : 0 [fraction : nan +/- nan] Number of accepted anti-B0 : 2 [fraction : 1 +/- 0]

>
>
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
Changed:
<
<
Number of accepted D0 : 1 [fraction : 1 +/- 0]
>
>
Number of accepted D0 : 0 [fraction : 0 +/- 0]
 Number of accepted D+ : 0 [fraction : 0 +/- 0]
Changed:
<
<
Number of accepted Ds+ : 0 [fraction : 0 +/- 0]
>
>
Number of accepted Ds+ : 1 [fraction : 1 +/- 0]
 Number of accepted c-Baryon : 0 [fraction : 0 +/- 0]
Changed:
<
<
Number of accepted anti-D0 : 1 [fraction : 1 +/- 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]

Changed:
<
<
Number of accepted B* : 2 [fraction : 1 +/- 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]
Changed:
<
<
Number of accepted D* : 2 [fraction : 1 +/- 0]
>
>
Number of accepted D* : 5 [fraction : 1 +/- 0]
 Number of accepted D** : 0 [fraction : 0 +/- 0]
Changed:
<
<
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. In general send the output of any program to a log file to be able to read it later.
>
>
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.
Line: 103 to 133
 

Make an executable version of Boole in your lxplus area

%SYNTAX{ syntax="sh" }%

Changed:
<
<
SetupProject Boole v17r1 --build-env getpack Digi/Boole v17r1
>
>
SetupProject Boole v20r0 --build-env getpack Digi/Boole v20r0
 cd Digi/Boole/cmt
Changed:
<
<
SetupProject Boole v17r1 gmake
>
>
cmt make SetupProject Boole v20r0
 cd ../options
Deleted:
<
<
 %ENDSYNTAX%
Changed:
<
<

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

>
>

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

 
Changed:
<
<
Change the input data file to the BsJPsiKs-2evt.sim file you generated earlier in Gauss. Do not bother with spillover for these events.
>
>
Change the input data file to the BsJPsiKs-2evt.sim file you generated earlier in Gauss.
 
Changed:
<
<
So make the following changes to 2008-Files.py
>
>
So make the following changes to MC09-Files.p
 %SYNTAX{ syntax="python" }% datasetname = 'BsJPsiKs-2evt'
Changed:
<
<
EventSelector().Input = ["DATAFILE='PFN:$HOME/cmtuser/Gauss_v36r0/Sim/Gauss/options/" + datasetName + ".sim' TYP='POOL_ROOTTREE' OPT='READ'"]
>
>
EventSelector().Input = ["DATAFILE='PFN:$HOME/cmtuser/Gauss_v38r0p1/Sim/Gauss/options/" + datasetName + ".sim' TYP='POOL_ROOTTREE' OPT='READ'"]
 %ENDSYNTAX%

Run Boole and check the output

Run Boole with

Changed:
<
<
gaudirun.py Boole-2008.py 2008-Files.py
>
>
gaudirun.py Boole-MC09-WithTruth.py MC09-Files.py | tee BsJPsiKs-2evt_Boole.log
 
Changed:
<
<
Look at the histograms produced by Boole in BsJPsiKs-2evt-histos.root, check there are entries in the histograms.
>
>
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

Changed:
<
<
Use the same instructions as for Gauss and Boole to setup, getpack and compile Brunel v34r0, 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. 11144103-2ev-20090109.digi, in 2008-Files.py.

>
>
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
Changed:
<
<
gaudirun.py Brunel-2008-MC.py 2008-Files.py
>
>
gaudirun.py Brunel-MC09-WithTruth.py MC09-Files.py | tee BsJPsiKs-2evt_Brunel.log
  Again check the output log file and the histograms produced.
Deleted:
<
<
-- DavidHutchcroft - 09 Jan 2009
 \ No newline at end of file
Added:
>
>
-- DavidHutchcroft - 04 Jan 2010

Revision 112009-06-16 - RuggeroTurra

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"

Generate, digitize and reconstruct two signal events with decays Bd->J/Psi(mumu)Kshort

Line: 119 to 119
 So make the following changes to 2008-Files.py %SYNTAX{ syntax="python" }% datasetname = 'BsJPsiKs-2evt'
Changed:
<
<
EventSelector().Input = ["DATAFILE='PFN:$HOME/cmtuser/Gauss_v36r0/Sim/Gauss/v30r5/options/" + datasetName + ".sim' TYP='POOL_ROOTTREE' OPT='READ'"]
>
>
EventSelector().Input = ["DATAFILE='PFN:$HOME/cmtuser/Gauss_v36r0/Sim/Gauss/options/" + datasetName + ".sim' TYP='POOL_ROOTTREE' OPT='READ'"]
 %ENDSYNTAX%

Run Boole and check the output

Revision 102009-02-05 - MarcoCattaneo

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"

Generate, digitize and reconstruct two signal events with decays Bd->J/Psi(mumu)Kshort

Line: 136 to 136
  In the options directory set the input file to the output produced by Boole, i.e. 11144103-2ev-20090109.digi, in 2008-Files.py.
Changed:
<
<
Also in Brunel-2008.py change the default to match the simulated data (Brunel defaults to real data taken in 2008):
<!-- SyntaxHighlightingPlugin -->
Brunel().InputType = "DIGI" 
#Brunel().SpecialData = ["fieldOff"] # All 2008 real data was taken with Magnet OFF 
<!-- end SyntaxHighlightingPlugin -->

Run Brunel with gaudirun.py Brunel-2008.py 2008-Files.py

>
>
Then run Brunel with gaudirun.py Brunel-2008-MC.py 2008-Files.py
  Again check the output log file and the histograms produced.

Revision 92009-01-20 - DavidHutchcroft

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"

Generate, digitize and reconstruct two signal events with decays Bd->J/Psi(mumu)Kshort

Line: 19 to 19
 SetupProject Gauss v36r0 gmake cd ../options
Changed:
<
<
xemacs -nw Gauss-Job.py
>
>
emacs -nw Gauss-Job.py
 %ENDSYNTAX%

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.

Line: 33 to 33
 Change the name of the output file from GaussExample to something that will help you remember the content; for example
<!-- SyntaxHighlightingPlugin -->
idFile = 'BsJPsiKs-2evt'
<!-- end SyntaxHighlightingPlugin -->
Changed:
<
<
Save the file and quit xemacs
>
>
Save the file and quit emacs
 

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

Line: 94 to 94
 Number of accepted D* : 2 [fraction : 1 +/- 0] Number of accepted D** : 0 [fraction : 0 +/- 0]
Changed:
<
<
showing the number of "signal" particle types created in each event.
>
>
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. In general send the output of any program to a log file to be able to read it later.
  Look at the histogram file produced called something like BsJPsiKs-2evt-histos.root and check there are hits in the VELO, RICH etc.

Revision 82009-01-15 - DavidHutchcroft

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"

Generate, digitize and reconstruct two signal events with decays Bd->J/Psi(mumu)Kshort

Line: 14 to 14
  %SYNTAX{ syntax="sh" }% SetupProject Gauss v36r0 --build-env
Deleted:
<
<
SetupProject Gauss v36r0
 getpack Sim/Gauss v36r0 cd Sim/Gauss/cmt
Added:
>
>
SetupProject Gauss v36r0
 gmake cd ../options xemacs -nw Gauss-Job.py
Line: 104 to 104
  %SYNTAX{ syntax="sh" }% SetupProject Boole v17r1 --build-env
Deleted:
<
<
SetupProject Boole v17r1
 getpack Digi/Boole v17r1 cd Digi/Boole/cmt
Added:
>
>
SetupProject Boole v17r1
 gmake cd ../options

Revision 72009-01-12 - DavidHutchcroft

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"

Generate, digitize and reconstruct two signal events with decays Bd->J/Psi(mumu)Kshort

Line: 30 to 30
 
<!-- SyntaxHighlightingPlugin -->
nEvts = 5
<!-- end SyntaxHighlightingPlugin -->
so that Gauss generates two events.
Changed:
<
<
Change the name of the output file from GaussExample to something that will help you remeber the content; for example
>
>
Change the name of the output file from GaussExample to something that will help you remember the content; for example
 
<!-- SyntaxHighlightingPlugin -->
idFile = 'BsJPsiKs-2evt'
<!-- end SyntaxHighlightingPlugin -->

Save the file and quit xemacs

Revision 62009-01-12 - DavidHutchcroft

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"

Generate, digitize and reconstruct two signal events with decays Bd->J/Psi(mumu)Kshort

Line: 17 to 17
 SetupProject Gauss v36r0 getpack Sim/Gauss v36r0 cd Sim/Gauss/cmt
Deleted:
<
<
SetupProject Gauss v36r0
 gmake cd ../options xemacs -nw Gauss-Job.py %ENDSYNTAX%
Added:
>
>
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

<!-- SyntaxHighlightingPlugin -->
nEvts = 5
<!-- end SyntaxHighlightingPlugin -->
so that Gauss generates two events.
Added:
>
>
Change the name of the output file from GaussExample to something that will help you remeber the content; for example
<!-- SyntaxHighlightingPlugin -->
idFile = 'BsJPsiKs-2evt'
<!-- end SyntaxHighlightingPlugin -->
 Save the file and quit xemacs
Line: 92 to 96
  showing the number of "signal" particle types created in each event.
Changed:
<
<
Look at the histogram file produced called something like 11144103-2ev-20090109-histos.root (the date part will obviously be different for your file) and check there are hits in the VELO, RICH etc.
>
>
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

Line: 110 to 114
 

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

Changed:
<
<
Change the input data file to the 11144103-2ev-20090109.sim file you generated earlier in Gauss. Do not bother with spillover for these events.
>
>
Change the input data file to the BsJPsiKs-2evt.sim file you generated earlier in Gauss. Do not bother with spillover for these events.
  So make the following changes to 2008-Files.py %SYNTAX{ syntax="python" }%
Changed:
<
<
datasetname = '11144103-2ev-20090109'
>
>
datasetname = 'BsJPsiKs-2evt'
 EventSelector().Input = ["DATAFILE='PFN:$HOME/cmtuser/Gauss_v36r0/Sim/Gauss/v30r5/options/" + datasetName + ".sim' TYP='POOL_ROOTTREE' OPT='READ'"] %ENDSYNTAX%
Line: 124 to 128
 gaudirun.py Boole-2008.py 2008-Files.py
Changed:
<
<
Look at the histograms produced by Boole in 11144103-2ev-20090109-histos.root, check there are entries in the histograms.
>
>
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

Revision 52009-01-09 - GloriaCorti

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"
Changed:
<
<

Generate, digitize and reconstruct two signal events with decays Bs->J/Psi(mumu)Kshort

>
>

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 2009 and may not be the final version used for the main productions in 2009.
Line: 17 to 17
 SetupProject Gauss v36r0 getpack Sim/Gauss v36r0 cd Sim/Gauss/cmt
Changed:
<
<
SetupProject Gauss v30r5
>
>
SetupProject Gauss v36r0
 gmake cd ../options
Changed:
<
<
xemacs -nw EvtType.py
>
>
xemacs -nw Gauss-Job.py
 %ENDSYNTAX%
Changed:
<
<

Edit EvtType.py to simulate the required events

>
>

Edit Gauss-Job.py to simulate the required events

  Change the 5 in line
<!-- SyntaxHighlightingPlugin -->
nEvts = 5
<!-- end SyntaxHighlightingPlugin -->
so that Gauss generates two events.
Deleted:
<
<
Comment the line
<!-- SyntaxHighlightingPlugin -->
eventType = '30000000'
<!-- end SyntaxHighlightingPlugin -->
and uncomment the one for Bs->J/Psi(mumu)Kshort, to determine what event type you are using check the $DECFILESROOT/options/ directory to see which .opts file is being selected and what it contains. The comment in the first lines of 11144103.opts is
<!-- SyntaxHighlightingPlugin -->
// Event Type:11144103 
// 
// ASCII decay Descriptor: [B0 -> (KS0 -> pi+ pi-) (J/psi(1S) -> mu+ mu- {,gamma} {,gamma}) ]cc 
<!-- end SyntaxHighlightingPlugin -->
 Save the file and quit xemacs
Added:
>
>

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

Go into the EvtGen web page linked from that of Gauss 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

Changed:
<
<
The run Gauss with the command gaudirun.py Gauss-2008.py EvtType.py
>
>
To run Gauss you will use the command gaudirun.py and specify that you want
  • a standard Gauss jobs with the latest 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-2008.py $DECFILESROOT/options/11144101.opts $GAUSSOPTS/Gauss-Job.py
  Wait while Gauss configures itself, Pythia, EvtGen and GEANT4, then generates two events.

Revision 42009-01-09 - DavidHutchcroft

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"

Generate, digitize and reconstruct two signal events with decays Bs->J/Psi(mumu)Kshort

Changed:
<
<
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 early 2008 releases which have 64 bit versions ready. They are not production quality and will be replaced in due course with the pre-data taking tuned versions.
>
>
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 2009 and may not be the final version used for the main productions in 2009.
 

Using Gauss to simulate events

Changed:
<
<
The slides that explain what the program Gauss does are here.
>
>
The slides that explain what the program Gauss does are here.
 

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

%SYNTAX{ syntax="sh" }%

Changed:
<
<
setenvGauss v30r5 getpack Sim/Gauss v30r5 cd Sim/Gauss/v30r5/cmt
>
>
SetupProject Gauss v36r0 --build-env SetupProject Gauss v36r0 getpack Sim/Gauss v36r0 cd Sim/Gauss/cmt
 SetupProject Gauss v30r5 gmake cd ../options
Changed:
<
<
xemacs -nw Gauss.opts
>
>
xemacs -nw EvtType.py
 %ENDSYNTAX%
Changed:
<
<

Edit Gauss.opts to simulate the required events

>
>

Edit EvtType.py to simulate the required events

 
Changed:
<
<
Change the 10 in line
<!-- SyntaxHighlightingPlugin -->
ApplicationMgr.EvtMax     = 10; 
<!-- end SyntaxHighlightingPlugin -->
>
>
Change the 5 in line
<!-- SyntaxHighlightingPlugin -->
nEvts = 5
<!-- end SyntaxHighlightingPlugin -->
 so that Gauss generates two events.
Deleted:
<
<
Change
<!-- SyntaxHighlightingPlugin -->
GaussTape.Output = "DATAFILE='PFN:Gauss_500bbInc.sim' TYP='POOL_ROOTTREE' OPT='RECREATE'"; 
<!-- end SyntaxHighlightingPlugin -->
to output to the file Gauss_2evt_BsJPsiKs.sim, and
<!-- SyntaxHighlightingPlugin -->
HistogramPersistencySvc.OutputFile = "GaussHistos_500bbInc.root";
<!-- end SyntaxHighlightingPlugin -->
to set the name of the histogram file to match.
 Comment the line
Changed:
<
<
<!-- SyntaxHighlightingPlugin -->
#include "$DECFILESROOT/options/10000000.opts"  // Generic b-b~ events
<!-- end SyntaxHighlightingPlugin -->
and uncomment the one for Bs->J/Psi(mumu)Kshort
>
>
<!-- SyntaxHighlightingPlugin -->
eventType = '30000000'
<!-- end SyntaxHighlightingPlugin -->
and uncomment the one for Bs->J/Psi(mumu)Kshort, to determine what event type you are using check the $DECFILESROOT/options/ directory to see which .opts file is being selected and what it contains. The comment in the first lines of 11144103.opts is
<!-- SyntaxHighlightingPlugin -->
// Event Type:11144103 
// 
// ASCII decay Descriptor: [B0 -> (KS0 -> pi+ pi-) (J/psi(1S) -> mu+ mu- {,gamma} {,gamma}) ]cc 
<!-- end SyntaxHighlightingPlugin -->
 Save the file and quit xemacs
Changed:
<
<

Run Gauss.exe and look at the monitoring output

>
>

Run Gauss and look at the monitoring output

 
Changed:
<
<
The run Gauss with the command ../slc4_amd64_gcc34/Gauss.exe v200601.opts
>
>
The run Gauss with the command gaudirun.py Gauss-2008.py EvtType.py
 
Changed:
<
<
Wait while Gauss configures itself, Pythia, EvtGen and GEANT4, then generates two events.
>
>
Wait while Gauss configures itself, Pythia, EvtGen and GEANT4, then generates two events.
 
Changed:
<
<
You should see something like this twice:
>
>
You should see something like this:
 
Changed:
<
<
GiGaGetEventAlg INFO Number of extracted MCParticles 'MC/Particles' 1025 GiGaGetEventAlg INFO Number of extracted MCvertices 'MC/Vertices' 1118 GiGaGetHitsAlg INFO Number of extracted MCHits 'MC/Velo/Hits' 429 GiGaGetHitsAlg INFO Number of extracted MCHits 'MC/PuVeto/Hits' 26 GiGaGetHitsAlg INFO Number of extracted MCHits 'MC/TT/Hits' 187 GiGaGetHitsAlg INFO Number of extracted MCHits 'MC/IT/Hits' 156 GiGaGetHitsAlg INFO Number of extracted MCHits 'MC/OT/Hits' 412 GiGaGetHitsAlg INFO Number of extracted MCRichHits 'MC/Rich/Hits' 822 GiGaGetHitsAlg INFO Number of extracted MCCaloHits 'MC/Spd/Hits' 634 GiGaGetHitsAlg INFO Number of extracted MCCaloHits 'MC/Prs/Hits' 1405 GiGaGetHitsAlg INFO Number of extracted MCCaloHits 'MC/Ecal/Hits' 1554 GiGaGetHitsAlg INFO Number of extracted MCCaloHits 'MC/Hcal/Hits' 134 GiGaGetHitsAlg INFO Number of extracted MCHits 'MC/Muon/Hits' 182
>
>
SignalRepe... INFO *********** Signal counters ************** Number of events for generator level cut, before : 2, after : 1 Efficiency of the generator level cut : 0.5 +/- 0.35355 Number of z-inverted events : 1

Number of events for generator particle level cut, before : 2, after : 1 Efficiency of the generator particle level cut : 0.5 +/- 0.35355

Number of signal B0 in sample : 2 [fraction : 1 +/- 0] Number of signal B~0 in sample : 0 [fraction : 0 +/- 0]

Number of accepted B0 : 0 [fraction : nan +/- nan] Number of accepted B+ : 0 [fraction : nan +/- nan] Number of accepted Bs0 : 0 [fraction : nan +/- nan] Number of accepted b-Baryon : 0 [fraction : nan +/- nan] Number of accepted Bc+ : 0 [fraction : nan +/- nan] Number of accepted anti-B0 : 2 [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 : 1 [fraction : 1 +/- 0] Number of accepted D+ : 0 [fraction : 0 +/- 0] Number of accepted Ds+ : 0 [fraction : 0 +/- 0] Number of accepted c-Baryon : 0 [fraction : 0 +/- 0] Number of accepted anti-D0 : 1 [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* : 2 [fraction : 1 +/- 0] Number of accepted B** : 0 [fraction : 0 +/- 0]

Number of accepted D : 0 [fraction : 0 +/- 0] Number of accepted D* : 2 [fraction : 1 +/- 0] Number of accepted D** : 0 [fraction : 0 +/- 0]

 
Changed:
<
<
showing the number of MCParticles and MCHits created in each event.
>
>
showing the number of "signal" particle types created in each event.
 
Changed:
<
<
Look at the histogram file produced (you named it above) and check there are hits in the VELO, RICH etc.
>
>
Look at the histogram file produced called something like 11144103-2ev-20090109-histos.root (the date part will obviously be different for your file) 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

%SYNTAX{ syntax="sh" }%

Changed:
<
<
setenvBoole v14r10 getpack Digi/Boole v14r10 cd Digi/Boole/v14r10/cmt SetupProject Boole v14r10
>
>
SetupProject Boole v17r1 --build-env SetupProject Boole v17r1 getpack Digi/Boole v17r1 cd Digi/Boole/cmt
 gmake cd ../options
Changed:
<
<
xemacs -nw v200601.py
>
>
 %ENDSYNTAX%
Changed:
<
<

Edit v200601.py to setup Boole to digitize the events generated earlier

>
>

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

 
Changed:
<
<
Change the input data file to the Gauss_2evt_BsJPsiKs.sim file you generated earlier in Gauss. Do not bother with spillover for these events.
>
>
Change the input data file to the 11144103-2ev-20090109.sim file you generated earlier in Gauss. Do not bother with spillover for these events.
 
Changed:
<
<
So make the following changes to v200601.py
<!-- SyntaxHighlightingPlugin -->
Boole().useSpillover    = False
Boole().datasetName = 'Gauss_2evt_BsJPsiKs'
EventSelector().Input = ["DATAFILE='PFN:$HOME/cmtuser/Gauss_v30r5/Sim/Gauss/v30r5/options/" + datasetName + ".sim' TYP='POOL_ROOTTREE' OPT='READ'"]
<!-- end SyntaxHighlightingPlugin -->
also comment out the spillover input lines:
>
>
So make the following changes to 2008-Files.py
 %SYNTAX{ syntax="python" }%
Changed:
<
<
#-- Spillover events ("SpilloverSelector").Input = [ # "DATAFILE='PFN:castor:/castor/cern.ch/grid/lhcb/production/DC06/phys-v2-lumi2/00001820/SIM/0000/" + datasetName + "_2.sim' TYP='POOL_ROOTTREE' OPT='READ'" # ,"DATAFILE='PFN:castor:/castor/cern.ch/grid/lhcb/production/DC06/phys-v2-lumi2/00001820/SIM/0000/" + datasetName + "_3.sim' TYP='POOL_ROOTTREE' OPT='READ'" # ]
>
>
datasetname = '11144103-2ev-20090109' EventSelector().Input = ["DATAFILE='PFN:$HOME/cmtuser/Gauss_v36r0/Sim/Gauss/v30r5/options/" + datasetName + ".sim' TYP='POOL_ROOTTREE' OPT='READ'"]
 %ENDSYNTAX%

Run Boole and check the output

Run Boole with

Changed:
<
<
gaudirun.py ../options/BooleCommon.py ../options/v200601.py
>
>
gaudirun.py Boole-2008.py 2008-Files.py
 
Changed:
<
<
Look at the histograms produced by Boole in Gauss_2evt_BsJPsiKs-histos.root, check there are entries in the histograms.
>
>
Look at the histograms produced by Boole in 11144103-2ev-20090109-histos.root, check there are entries in the histograms.
 

Use Brunel to reconstruct the events digitized with Boole

Changed:
<
<
Use the same instructions as for Gauss and Boole to setup, getpack and compile Brunel v32r4, note the location of the Brunel package for getpack is Rec/Brunel.
>
>
Use the same instructions as for Gauss and Boole to setup, getpack and compile Brunel v34r0, 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. 11144103-2ev-20090109.digi, in 2008-Files.py.

 
Changed:
<
<
In the options directory set the input file to the output produced by Boole, i.e. Gauss_2evt_BsJPsiKs.digi, in v200601.py.
>
>
Also in Brunel-2008.py change the default to match the simulated data (Brunel defaults to real data taken in 2008):
<!-- SyntaxHighlightingPlugin -->
Brunel().InputType = "DIGI" 
#Brunel().SpecialData = ["fieldOff"] # All 2008 real data was taken with Magnet OFF 
<!-- end SyntaxHighlightingPlugin -->
  Run Brunel with
Changed:
<
<
gaudirun.py ../options/v200601.py
>
>
gaudirun.py Brunel-2008.py 2008-Files.py
  Again check the output log file and the histograms produced.
Deleted:
<
<
-- DavidHutchcroft - 07 Apr 2008
 \ No newline at end of file
Added:
>
>
-- DavidHutchcroft - 09 Jan 2009

Revision 32008-04-14 - DavidHutchcroft

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"

Generate, digitize and reconstruct two signal events with decays Bs->J/Psi(mumu)Kshort

Line: 108 to 108
 

Use Brunel to reconstruct the events digitized with Boole

Changed:
<
<
Use the same instructions as for Gauss and Boole to setup, getpack and compile Brunel v32r4.
>
>
Use the same instructions as for Gauss and Boole to setup, getpack and compile Brunel v32r4, 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. Gauss_2evt_BsJPsiKs.digi, in v200601.py.

Revision 22008-04-08 - DavidHutchcroft

Line: 1 to 1
 
META TOPICPARENT name="LHCbSoftwareTutorials"

Generate, digitize and reconstruct two signal events with decays Bs->J/Psi(mumu)Kshort

Changed:
<
<
This tutorial show you how to simulate, digitize and reconstruct signal events so that they can be analyzed in DaVinci. The versions of the code quoted are early 2008 releases which have 64 bit versions ready. They are not production quality and will be replaced in due course with the pre-data tuned versions.
>
>
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 early 2008 releases which have 64 bit versions ready. They are not production quality and will be replaced in due course with the pre-data taking tuned versions.
 
Line: 16 to 16
 setenvGauss v30r5 getpack Sim/Gauss v30r5 cd Sim/Gauss/v30r5/cmt
Changed:
<
<
source setup.csh [or source setup.sh for bash shells]
>
>
SetupProject Gauss v30r5
 gmake cd ../options xemacs -nw Gauss.opts
Line: 43 to 43
  The run Gauss with the command ../slc4_amd64_gcc34/Gauss.exe v200601.opts
Changed:
<
<
Wait while Gauss configures tself, Pythia, EvtGen and GEANT4, then generates two events.
>
>
Wait while Gauss configures itself, Pythia, EvtGen and GEANT4, then generates two events.
  You should see something like this twice:
Line: 73 to 73
 setenvBoole v14r10 getpack Digi/Boole v14r10 cd Digi/Boole/v14r10/cmt
Changed:
<
<
source setup.csh [or setup.sh]
>
>
SetupProject Boole v14r10
 gmake cd ../options xemacs -nw v200601.py
Line: 98 to 98
 # ] %ENDSYNTAX%
Changed:
<
<

Run Boole and check ouput

>
>

Run Boole and check the output

  Run Boole with gaudirun.py ../options/BooleCommon.py ../options/v200601.py
Line: 108 to 108
 

Use Brunel to reconstruct the events digitized with Boole

Changed:
<
<
Use the same sets as for Gauss and Boole to setup, getpack and compile Brunel v32r4.
>
>
Use the same instructions as for Gauss and Boole to setup, getpack and compile Brunel v32r4.
 
Changed:
<
<
In the options directory set the input file to the output produced by Boole [=Gauss_2evt_BsJPsiKs.digi=] in v200601.py.
>
>
In the options directory set the input file to the output produced by Boole, i.e. Gauss_2evt_BsJPsiKs.digi, in v200601.py.
  Run Brunel with
Changed:
<
<
gaudirun.py ../options/BrunelCommon.py ../options/v200601.py
>
>
gaudirun.py ../options/v200601.py
  Again check the output log file and the histograms produced.

Revision 12008-04-07 - DavidHutchcroft

Line: 1 to 1
Added:
>
>
META TOPICPARENT name="LHCbSoftwareTutorials"

Generate, digitize and reconstruct two signal events with decays Bs->J/Psi(mumu)Kshort

This tutorial show you how to simulate, digitize and reconstruct signal events so that they can be analyzed in DaVinci. The versions of the code quoted are early 2008 releases which have 64 bit versions ready. They are not production quality and will be replaced in due course with the pre-data tuned versions.

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.

<!-- SyntaxHighlightingPlugin -->
setenvGauss v30r5
getpack Sim/Gauss v30r5
cd Sim/Gauss/v30r5/cmt
source setup.csh      [or source setup.sh for bash shells]
gmake
cd ../options
xemacs -nw Gauss.opts
<!-- end SyntaxHighlightingPlugin -->

Edit Gauss.opts to simulate the required events

Change the 10 in line

<!-- SyntaxHighlightingPlugin -->
ApplicationMgr.EvtMax     = 10; 
<!-- end SyntaxHighlightingPlugin -->
so that Gauss generates two events.

Change

<!-- SyntaxHighlightingPlugin -->
GaussTape.Output = "DATAFILE='PFN:Gauss_500bbInc.sim' TYP='POOL_ROOTTREE' OPT='RECREATE'"; 
<!-- end SyntaxHighlightingPlugin -->
to output to the file Gauss_2evt_BsJPsiKs.sim, and
<!-- SyntaxHighlightingPlugin -->
HistogramPersistencySvc.OutputFile = "GaussHistos_500bbInc.root";
<!-- end SyntaxHighlightingPlugin -->
to set the name of the histogram file to match.

Comment the line

<!-- SyntaxHighlightingPlugin -->
#include "$DECFILESROOT/options/10000000.opts"  // Generic b-b~ events
<!-- end SyntaxHighlightingPlugin -->
and uncomment the one for Bs->J/Psi(mumu)Kshort Save the file and quit xemacs

Run Gauss.exe and look at the monitoring output

The run Gauss with the command ../slc4_amd64_gcc34/Gauss.exe v200601.opts

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

You should see something like this twice:

GiGaGetEventAlg            INFO  Number of extracted MCParticles 'MC/Particles'         1025
GiGaGetEventAlg            INFO  Number of extracted MCvertices  'MC/Vertices'          1118
GiGaGetHitsAlg             INFO Number of extracted MCHits      'MC/Velo/Hits'          429
GiGaGetHitsAlg             INFO Number of extracted MCHits      'MC/PuVeto/Hits'        26
GiGaGetHitsAlg             INFO Number of extracted MCHits      'MC/TT/Hits'    187
GiGaGetHitsAlg             INFO Number of extracted MCHits      'MC/IT/Hits'    156
GiGaGetHitsAlg             INFO Number of extracted MCHits      'MC/OT/Hits'    412
GiGaGetHitsAlg             INFO Number of extracted MCRichHits  'MC/Rich/Hits'  822
GiGaGetHitsAlg             INFO Number of extracted MCCaloHits  'MC/Spd/Hits'   634
GiGaGetHitsAlg             INFO Number of extracted MCCaloHits  'MC/Prs/Hits'   1405
GiGaGetHitsAlg             INFO Number of extracted MCCaloHits  'MC/Ecal/Hits'  1554
GiGaGetHitsAlg             INFO Number of extracted MCCaloHits  'MC/Hcal/Hits'  134
GiGaGetHitsAlg             INFO Number of extracted MCHits      'MC/Muon/Hits'          182
showing the number of MCParticles and MCHits created in each event.

Look at the histogram file produced (you named it above) 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

<!-- SyntaxHighlightingPlugin -->
setenvBoole v14r10
getpack Digi/Boole v14r10
cd Digi/Boole/v14r10/cmt
source setup.csh [or setup.sh]
gmake
cd ../options
xemacs -nw v200601.py
<!-- end SyntaxHighlightingPlugin -->

Edit v200601.py to setup Boole to digitize the events generated earlier

Change the input data file to the Gauss_2evt_BsJPsiKs.sim file you generated earlier in Gauss. Do not bother with spillover for these events.

So make the following changes to v200601.py

<!-- SyntaxHighlightingPlugin -->
Boole().useSpillover    = False
Boole().datasetName = 'Gauss_2evt_BsJPsiKs'
EventSelector().Input = ["DATAFILE='PFN:$HOME/cmtuser/Gauss_v30r5/Sim/Gauss/v30r5/options/" + datasetName + ".sim' TYP='POOL_ROOTTREE' OPT='READ'"]
<!-- end SyntaxHighlightingPlugin -->
also comment out the spillover input lines:
<!-- SyntaxHighlightingPlugin -->
#-- Spillover events
#EventSelector("SpilloverSelector").Input = [
#    "DATAFILE='PFN:castor:/castor/cern.ch/grid/lhcb/production/DC06/phys-v2-lumi2/00001820/SIM/0000/" + datasetName + "_2.sim' TYP='POOL_ROOTTREE' OPT='READ'"
#   ,"DATAFILE='PFN:castor:/castor/cern.ch/grid/lhcb/production/DC06/phys-v2-lumi2/00001820/SIM/0000/" + datasetName + "_3.sim' TYP='POOL_ROOTTREE' OPT='READ'"
#    ]
<!-- end SyntaxHighlightingPlugin -->

Run Boole and check ouput

Run Boole with gaudirun.py ../options/BooleCommon.py ../options/v200601.py

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

Use Brunel to reconstruct the events digitized with Boole

Use the same sets as for Gauss and Boole to setup, getpack and compile Brunel v32r4.

In the options directory set the input file to the output produced by Boole [=Gauss_2evt_BsJPsiKs.digi=] in v200601.py.

Run Brunel with gaudirun.py ../options/BrunelCommon.py ../options/v200601.py

Again check the output log file and the histograms produced.

-- DavidHutchcroft - 07 Apr 2008

 
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