Offline Simulation Software CMSSW_7_0_4 - getting started

This document will explain how to use TOTEM offline software.

IMPORTANT This version contain new RP geometry with near station relocated to ~210m


  • SLC6 Linux 64bit with AFS access. Can be lxplus.
  • Totem SVN access.
  • 9GB Free disk space.

For experts

If you know what to do, use following instruction (if not, read whole page):

export SCRAM_ARCH=slc6_amd64_gcc481
source /afs/
scram project CMSSW CMSSW_7_0_4
svn co svn+ssh:// CMSSW_7_0_4/src/
cd CMSSW_7_0_4/src
scram build -j 15
cd MergingSoftware/MergeCMSTOTEMNTuples/Merge/
make -j8
cd ../../../../

Stand-alone configs

The software works with both CMS and TOTEM configs. All you have to do is choose the file you're interested in.

TOTEM RP config:

cmsRun src/Configuration/TotemStandardSequences/test/RP/

TOTEM T1T2 minimum bias config:

cmsRun src/Configuration/TotemStandardSequences/test/T1T2/

TOTEM RPT1T2 single diffraction config:

cmsRun src/Configuration/TotemStandardSequences/test/RPT1T2/

Combined configs (CMS + T1 + T2)

The only major difference with respect to running a single config is that you need to generate a root file with events that will serve as input to other configs.

Generate events used by both CMS and TOTEM configs (Pythia) [input: NONE, output: MinbiasTest_GEN.root]

cmsRun src/Configuration/TotemStandardSequences/test/T1T2CMS/

Run common Geant4 simulation, including TOTEM Smearing Generator: [input: MinbiasTest_GEN.root, output: MinbiasTest_SIM.root]

cmsRun src/Configuration/TotemStandardSequences/test/T1T2CMS/

Run TOTEM reconstruction of T1 and T2 events: [input: MinbiasTest_GEN.root, output: MinbiasTest_RECO_TOTEM.root]

cmsRun src/Configuration/TotemStandardSequences/test/T1T2CMS/

Run CMS reconstruction, it goes in two steps: [input: MinbiasTest_GEN.root, output: MinbiasTest_RECO_CMS.root]

cmsRun src/Configuration/TotemStandardSequences/test/T1T2CMS/
cmsRun src/Configuration/TotemStandardSequences/test/T1T2CMS/ 

Run TOTEM ntuplizer: [input: MinbiasTest_RECO_TOTEM.root, output: MinbiasTest_NTUPLE_TOTEM.root]

cmsRun src/Configuration/TotemStandardSequences/test/T1T2CMS/

Run CMS ntuplizer: [input: MinbiasTest_RECO_CMS.root, output: MinbiasTest_NTuple_CMS.root]

cmsRun src/Configuration/TotemStandardSequences/test/T1T2CMS/

Run merging of ntuple files: [input: MinbiasTest_NTUPLE_TOTEM.root and MinbiasTest_NTuple_CMS.root output: MinbiasTest_NTUPLE_COMBINED.root]

In order to run the merging software after the compilation, don't forget to set the paths for CMSDataFormat and TOTEMDataFormat:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`/src/MergingSoftware/MergeCMSTOTEMNTuples/CMSdataFormat/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`/src/MergingSoftware/MergeCMSTOTEMNTuples/TOTEMdataFormat/lib
cd src/MergingSoftware/MergeCMSTOTEMNTuples/Merge 
./mergeMCNtuples ../../../../MinbiasTest_NTUPLE_TOTEM.root ../../../../MinbiasTest_NTuple_CMS.root ../../../../MinbiasTest_NTUPLE_COMBINED.root



Let us login via ssh to some remote machine with SLC6 operating system. It might be lxplus.

ssh -X yourLogin@server

So for example:

ssh -X

STEP 1. Getting source

Let us create some temporary directory

mkdir tmp
cd tmp

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.

Machine Directory Comments
lxplus, lxbatch, machines with AFS access /afs/ CMS installation
Let us use default CMS installation, type in bash:
source /afs/

Now we have access to scram command. We can check that by typing:

scram help

STEP 2. Building

We will compile our software from sources.

First we initialize CMSSW project area:

scram project CMSSW CMSSW_7_0_4

After that your workspace called CMSSW_7_0_4 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_7_0_4

We can see that after that command following directory structure emerged:

[brakoczy@lxplus0130  tmp]$ ls CMSSW_7_0_4/
bin  cfipython  config  doc  include  lib  logs  objs  python  src  test  tmp

Our sources shall go to CMSSW_7_0_4/src subdirectory, so let us first check out the code from Totem SVN to that directory. If you have source code already stored in another place, do no to try to make any links from CMSSW_7_0_4/src there, as some strange unexpected problems might appear.

[brakoczy@lxplus0130 tmp]$ svn co svn+ssh:// CMSSW_7_0_4/src/
[brakoczy@lxplus0130 tmp]$ ls CMSSW_7_0_4/src/
Configuration    doxyStyle.css       RecoTotemRP     TotemAnalysis
DataFormats      GeneratorInterface  RecoTotemT1T2   TotemCondFormats
Documentation    Geometry            SimG4CMS        TotemRawData
Doxyfile         IOMC                SimG4Core       TotemRPValidation
doxyFooter.html  L1TriggerTotem      SimTotem        TotemT1T2Validation
doxyHeader.html  pytotem             TotemAlignment

Now let us start compilation. Using 15 threads (-j 15) it takes 10-15 minutes.

cd CMSSW_7_0_4/
scram build (or scram b)
[ scram b -j 15 is another option to run build which will use 15 threads to compile the code. ]

STEP 3. Running example

Firstly, set environment variables to use your CMSSW installation and get access to cmsRun script. This is done by calling cmsenv in workspace directory.


Some example configuration files are in CMSSW_7_0_4/src/Configuration/TotemStandardSequences/test/ Some of them might not work properly in the newest version of software, please refer to the sections below for working examples. Let us take example configuration file:


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:prodRPelasticBeta90Energy6500GeV.root")'

Check sequence of modules to execute:

process.p1 = cms.Path(process.generator*

Now we can run that file:

cmsRun src/Configuration/TotemStandardSequences/test/RP/

If everything went OK, then we can find output file:

[brakoczy@lxplus0130 CMSSW_7_0_4]$ ls -l *root
-rw-r--r--. 1 brakoczy zj 54963 07-14 17:00 prodRPelasticBeta90Energy6500GeV.root

STEP 4. Generating plots

Now we can generate some plots.

We can start root session, to see plots:

[brakoczy@lxplus0130 CMSSW_7_0_4]$ root -l
root [0] TBrowser t

-- BartoszRakoczy - 21 Sep 2014

Edit | Attach | Watch | Print version | History: r18 < r17 < r16 < r15 < r14 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r18 - 2015-02-26 - LeszekGrzanka
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    TOTEM All webs login

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