Running the simulation in Velo-only mode

Heath warning - This page is not necessarily upto date, advice on which version of packages to use should always be sought from offical pages. Furthermore, please forgive the pejorative nature of this page, it is written with beginners in mind...

The LHCb reconstruction (the Brunel executable) runs .digi files (decoded data). These files replicate output of the electronics of the real detector. To get a .digi file, we must run two programs. The first is called Gauss, it start by generating 14TeV proton-proton collisions and transports the particles resulting from this collision though the detector geometry. The detector geometry is a huge collection of cuboids, cylinders and other 3D shapes that [fairly] accurately describe LHCb. The .sim file produced by Gauss is a record, for every event, of all particles and the (x,y,z) points where these particles entered and exited each bit of detector they traverse.

Then we run Boole on this .sim file. Boole looks though all the entry and exit points and works out if the volune the particle has just passed through is a piece of active material (like a VELO sensor) or a piece of inactive material (like the VELO metal vacuum tank). If it is an active material it works out how much charge that particle would deposit and were and figures out what response the electronics would give and writes this to the output .digi file. This is how we try to replicate LHCb in simulation.

The next step is to run Brunel which reconstructs the electronic response of the detector (either real or simulated) to figure out where the particles went. But you know all this as its your and Tomas' domain.

Running Gauss

Look on the Gauss webpage to check what is the latest version of Gauss to use:

Logon to a lxplus node, check out Gauss set the linux environment variables, compile....

setenvGauss *version*    (where *version* is, say, v30r2)
getpack Sim/Gauss *version*
cd Sim/Gauss/*version*/cmt
cmt config
source setup.csh
cmt br make

Edit the main options file ( ../options/Gauss.opts ) and set the number of events to just 2

uncomment line 92 so requiring minimum bias generation (this means any and all LHC collisions, no preference for any particular events)

Run Gauss:

../$BINDIR/Gauss.exe ../options/Gauss.opts
You will observe that it is SLLOOOOWWWWWW. This because we are simulating the particles flying through all of LHCb. Look at your output you will see stuff like:
GiGaGetEventAlg            INFO  Number of extracted MCParticles 'MC/Particles'         1502
GiGaGetEventAlg            INFO  Number of extracted MCvertices  'MC/Vertices'          1624
GiGaGetHitsAlg             INFO Number of extracted MCHits      'MC/Velo/Hits'          928
GiGaGetHitsAlg             INFO Number of extracted MCHits      'MC/PuVeto/Hits'        60
GiGaGetHitsAlg             INFO Number of extracted MCHits      'MC/TT/Hits'    267
GiGaGetHitsAlg             INFO Number of extracted MCHits      'MC/IT/Hits'    233
GiGaGetHitsAlg             INFO Number of extracted MCHits      'MC/OT/Hits'    669
GiGaGetHitsAlg             INFO Number of extracted MCRichHits  'MC/Rich/Hits'  2080
GiGaGetHitsAlg             INFO Number of extracted MCCaloHits  'MC/Spd/Hits'   1279
GiGaGetHitsAlg             INFO Number of extracted MCCaloHits  'MC/Prs/Hits'   2329
GiGaGetHitsAlg             INFO Number of extracted MCCaloHits  'MC/Ecal/Hits'  3287
GiGaGetHitsAlg             INFO Number of extracted MCCaloHits  'MC/Hcal/Hits'  463
GiGaGetHitsAlg             INFO Number of extracted MCHits      'MC/Muon/Hits'          313
Look at how many particles have been traced though the IT, OT, Rcich, Ecal, Hcal and Muon detector... We don't care about that! So we edit the options file again: add to the end of ../options/Gauss.opts
GiGa.RunSeq.TrCuts.MinZ =  -400 ;
GiGa.RunSeq.TrCuts.MaxZ =   800 ;
GiGa.RunSeq.TrCuts.MinX =   -55 ;
GiGa.RunSeq.TrCuts.MaxX =    55 ;
GiGa.RunSeq.TrCuts.MinY =   -55 ;
GiGa.RunSeq.TrCuts.MaxY =    55 ;
These lines kill all particles after they leave the defined volume that contains all the VELO silicon detectors: 1.2m long,12cm high,12cm wide. Now rerun with perhaps 20 events. This job will be a lot quicker and the output will now say:
GiGaGetEventAlg            INFO  Number of extracted MCParticles 'MC/Particles'         1417
GiGaGetEventAlg            INFO  Number of extracted MCvertices  'MC/Vertices'          1423
GiGaGetHitsAlg             INFO Number of extracted MCHits      'MC/Velo/Hits'          1128
GiGaGetHitsAlg             INFO Number of extracted MCHits      'MC/PuVeto/Hits'        73
GiGaGetHitsAlg             INFO Number of extracted MCHits      'MC/TT/Hits'    0
GiGaGetHitsAlg             INFO Number of extracted MCHits      'MC/IT/Hits'    0
GiGaGetHitsAlg             INFO Number of extracted MCHits      'MC/OT/Hits'    0
GiGaGetHitsAlg             INFO Number of extracted MCRichHits  'MC/Rich/Hits'  0
GiGaGetHitsAlg             INFO Number of extracted MCCaloHits  'MC/Spd/Hits'   0
GiGaGetHitsAlg             INFO Number of extracted MCCaloHits  'MC/Prs/Hits'   0
GiGaGetHitsAlg             INFO Number of extracted MCCaloHits  'MC/Ecal/Hits'  0
GiGaGetHitsAlg             INFO Number of extracted MCCaloHits  'MC/Hcal/Hits'  0
GiGaGetHitsAlg             INFO Number of extracted MCHits      'MC/Muon/Hits'          0
i.e. we are only simulating the VELO. Do a 'ls -lrt' in your directory. You should see that you have produced a .sim file and a .root file. Look quickly at the .root file with root:
root GaussHistos.root
[0] TBrowser b
and look in the Velo directory in this file and have a look some of the histograms.

Running Boole

OK - So you have a .sim file. Now we run Boole. Open a new window (not 'necessary', but it keep things separate and simple)

Look on the Boole webpage to find out what is the latest version:

Check out Boole, set the environment, compile ...

setenvBoole *version*
getpack Digi/Boole *version*
cd Digi/Boole/*version*/cmt
cmt config
source setup.csh
cmt br make

Edit the main options file so that it picks up your nice, new .sim file and give a sensible name to the output files:

line 34:
HistogramPersistencySvc.OutputFile = "BooleHistos.root"; // Monitoring histos

line 53:
   "DATAFILE='PFN:$HOME/cmtuser/Sim/Gauss/v12r1/cmt/Gauss.sim' TYP='POOL_ROOTTREE' OPT='READ'"

line 59:
DigiWriter.Output = "DATAFILE='PFN:Boole.digi' TYP='POOL_ROOTTREE' OPT='REC'";

Run Boole:

../$BINDIR/Boole.exe ../options/Boole.opts

This gives you a digi file on which you should be able to run Brunel on. Check this now...

Simulation of the open the VELO.

We do this by changing the VELO "conditions" in the package XmlConditions. First look on theGauss webpage to see what version of XmlConditions was used with this version of Gauss. Then check it out:

cd ~/cmtuser
getpack Det/XmlConditions v1r7
cd Sim/Gauss/*version*/cmt
echo $XMLCONDITIONSROOT
source setup.csh
echo $XMLCONDITIONSROOT
Note that the environment variable $XMLCONDITIONSROOT has changed so to point to your local copy.

Now edit the VELO condtions to open the left half of the VELO 5mm and the right half 7mm:

in $XMLCONDITIONSROOT/DDDB/Local/Velo/alignment.xml, line 13:
      <paramVector name="dPosXYZ" type="double">-7 0 0</paramVector>

in $XMLCONDITIONSROOT/DDDB/Local/Velo/alignment.xml, line 19:
      <paramVector name="dPosXYZ" type="double">+5 0 0</paramVector>

and in $GAUSSROOT/options/SimGeometry.opts, comment line 44 and uncomment line 46 so it reads:

//Geo.StreamItems      += {"/dd/Structure/LHCb/BeforeMagnetRegion/Velo"};  
// Uncomment following line to enable misaligneable VELO
#include "$GAUSSOPTS/SimVeloGeometry.opts"

Save, rerun Gauss and look again at the histograms in the GaussHistos.root file. You should a change in the MChit distributions illustrated below.

  • Scatter plots of the MC hits (1) with VELO closed and (2) with VELO open 5mm (left) 7mm (right):

Finally, make sure that your Boole and Brunel environments also have $XMLCONDITIONSROOT correctly defined to point to your local copy. (Achieved by resourcing their setup.csh)

Simulating lots of events and storing the data on CASTOR

If all is OK lets generate many, many more events by using the batch farm; instead of 'running' Gauss and Boole as I've described above, you will do:

bsub -q 8nh -o myGauss.log ../$BINDIR/Gauss.exe ../options/Gauss.opts
you can check the progress of your job with the bjobs and bpeek commands.

BUT, the files you are going to generate are too large to store on your area do before running, change the some filesnames in (Gauss.opts and v200601.opts) so that the large .sim and .digi files are written to the central CERN mass storage system which is called CASTOR.

in Gauss.opts, line 83:
GaussTape.Output = "DATAFILE='PFN:rfio:/castor/cern.ch/user/m/mjohn/Gauss_0mm0mm.sim' TYP='POOL_ROOTTREE' OPT='RECREATE'";

in v200601.opts, line 53:
  "DATAFILE='PFN:rfio:/castor/cern.ch/user/m/mjohn/Gauss_0mm0mm.sim' TYP='POOL_ROOTTREE' OPT='READ'"

in v200601.opts, line 59:
DigiWriter.Output = "DATAFILE='PFN:rfio:/castor/cern.ch/user/m/mjohn/Boole_0mm0mm.digi' TYP='POOL_ROOTTREE' OPT='REC'";
where "m/mjohn" needs replacing (obviously!)

-- Main.mjohn - 12 Jun 2007

Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r3 - 2007-06-12 - MalcolmJohn
 
    • 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