Offline Simulation Software CMSSW_3_1_1 - getting started
This document will explain how to use TOTEM offline software.
Documentation
STEP 0.
Let us login via ssh to some remote machine. It might be
lxplus
, but we will use our own PC
pctotem31.cern.ch
(4 processors, most of the time stands free).
ssh -X grzanka@pctotem31.cern.ch
Mine account on
pctotem31
(
grzanka
) differs from my normal CERN account (
lgrzanka
), so I will request kerberos ticket, in order to have access to distributed AFS disk space.
kinit lgrzanka
STEP 1.
Let us create some temporary directory
mkdir -p tmp/offlineSWTest
cd tmp/offlineSWTest
We have to load default set of environment variables which are necessary for work with CMSSW.
Script containing these variables is stored in the directory where CMSSW framework and all necessary libraries are installed.
There are two places where you can find CMSSW_3_1_1 framework installed:
Machine |
Directory |
Comments |
lxplus, lxbatch, machines with AFS access |
/afs/cern.ch/exp/totem/soft/local_cmssw_slc4/ |
TOTEM installation |
lxplus, lxbatch, machines with AFS access |
/afs/cern.ch/exp/totem/scratch/Release/cmssw/ |
TOTEM installation |
pctotem31.cern.ch |
/home/grzanka/usr/cmssw/ |
TOTEM local installation |
IMPORTANT In January 2012 CMS installation has been removed from AFS (/afs/cern.ch/cms/sw/
), please use TOTEM installation
When working on hosts with SLC5 or higher, this is necessary:
export SCRAM_ARCH=slc4_ia32_gcc345
Let us use TOTEM installation, type in bash:
source /afs/cern.ch/exp/totem/soft/local_cmssw_slc4/cmsset_default.sh
Now we have access to
scram
command. We can check that by typing:
scram help
STEP 2.
We will compile our software from sources.
First we initialize CMSSW project area:
scram project CMSSW CMSSW_3_1_1
After that your workspace called
CMSSW_3_1_1
is created, this is the default name for the working directory. It is also possible to specify another directory as your workspace by:
scram project -n <your_given_name> CMSSW CMSSW_3_1_1
We can see that after that command following directory structure emerged:
[pctotem31] /home/grzanka/tmp/offlineSWTest > ls CMSSW_3_1_1/
bin config doc include lib logs module python share src test
IMPORTANT There is a bug in standard version of Geant4 shipped with CMSSW_3_1_1,
which is causing simulation to crash with energy 3.5 TeV, so in this case
please follow instruction provided
here
to install correct version of Geant4.
Our sources shall go to
CMSSW_3_1_1/src
subdirectory, so let us first check out the code from Totem SVN to that directory.
You might need to add the username in SVN path (use simply
svn+ssh://lgrzanka@svn.cern.ch
):
[pctotem31] /home/grzanka/tmp/offlineSWTest > svn co svn+ssh://svn.cern.ch/reps/totem/branches/CMSSW_3_1_1/cmssw/src CMSSW_3_1_1/src/
[pctotem31] /home/grzanka/tmp/offlineSWTest > ls CMSSW_3_1_1/src/
Configuration Doxyfile doxyStyle.css IOMC RecoTotemT1T2 SimG4Core TotemAnalysis TotemDatabaseService TotemRPValidation
DataFormats doxyFooter.html EventFilter L1TriggerTotem SimDataFormats SimTotem TotemBackground TotemDQM TotemT1T2Validation
Documentation doxyHeader.html Geometry RecoTotemRP SimG4CMS TotemAlignment TotemCondFormats TotemRawData Visualisation
Some example configuration files you can find in
CMSSW_3_1_1/src/Configuration/TotemStandardSequences/test/
Now let us start compilation. Our machine has 4 processors, so we can run compilation in 8 threads to speedup this process. Still this will take some time (10-15 minutes).
cd CMSSW_3_1_1/src
scram build (or scram b)
[ scram b -j 8 is another option to run build which will use 8 threads to compile the code. However this will use too much resource on pctotem31.
So please only use this command late in a day such as in the evening. ]
Now we need to setup runtime environment. Before executing following command be sure to be in some subdirectory of CMSSW_3_1_1 :
eval `scram runtime -sh`
This will enable us to use
cmsRun
command.
cmsRun --help
Now we can go back to
~/tmp/offlineSWTest
directory
cd ~/tmp/offlineSWTest
STEP 3.
Let us take example configuration file:
CMSSW_3_1_1/src/Configuration/TotemStandardSequences/test/RP/prodRPelasticBeta90Energy7TeV_cfg.py
Check number of events to generate:
process.maxEvents = cms.untracked.PSet(
input = cms.untracked.int32(10)
)
Check output file:
exec 'process.' + str(process.outpath) + '.fileName = cms.untracked.string("file:prodRPelasticBeta90Energy7TeV.root")'
Check sequence of modules to execute:
process.p1 = cms.Path(process.generator*
process.SmearingGenerator*
process.OptInfo*
process.g4SimHits*
process.mix*
process.RPSiDetDigitizer*
process.RPClustProd*
process.RPHecoHitProd*
process.RPSinglTrackCandFind*
process.RPSingleTrackCandCollFit*
process.ElasticReconstruction*
process.RPCC)
Now we can run that file:
CMSSW_3_1_1/src/Configuration/TotemStandardSequences/test/RP/
cmsRun prodRPelasticBeta90Energy7TeV_cfg.py
If everything went OK, then we can find output file:
[pctotem31] /home/grzanka/tmp/offlineSWTest > ls -l *root
-rw-rw-r-- 1 grzanka grzanka 286512 Aug 7 20:14 prodRPelasticBeta90Energy7TeV.root
STEP 4.
Now we can generate some plots.
We can start root session, to see plots:
[pctotem31] /home/grzanka/tmp/offlineSWTest > root -l
root [0] TBrowser t
--
LeszekGrzanka - 16-Jan-2012