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

Requirements

  • 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/cern.ch/cms/cmsset_default.sh
scram project CMSSW CMSSW_7_0_4
svn co svn+ssh://svn.cern.ch/reps/totem/branches/CMSSW_7_0_4/offline/cmssw/src/ CMSSW_7_0_4/src/
cd CMSSW_7_0_4/src
cmsenv
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/prodRPinelasticBeta90Energy6500GeV_cfg.py

TOTEM T1T2 minimum bias config:

cmsRun src/Configuration/TotemStandardSequences/test/T1T2/prodT1T2phojetMBbeta90energy6500eV_cfg.py

TOTEM RPT1T2 single diffraction config:

cmsRun src/Configuration/TotemStandardSequences/test/RPT1T2/prodRPT1T2pythiaSDbeta90energy6500GeV_cfg.py

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/step0_Pythia.py

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

cmsRun src/Configuration/TotemStandardSequences/test/T1T2CMS/step1_Geant4_SIM.py

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

cmsRun src/Configuration/TotemStandardSequences/test/T1T2CMS/step2a_TOTEM_DIGI_RECO.py

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

cmsRun src/Configuration/TotemStandardSequences/test/T1T2CMS/step2b_1_CMS_DIGI_RECO.py
cmsRun src/Configuration/TotemStandardSequences/test/T1T2CMS/step2b_2_CMS_DIGI_RECO.py 

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

cmsRun src/Configuration/TotemStandardSequences/test/T1T2CMS/step3a_TOTEM_NTUPLE.py

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

cmsRun src/Configuration/TotemStandardSequences/test/T1T2CMS/step3a_CMS_NTUPLE.py

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 MergedCMSTOTEM_NTuple.root

Documentation

STEP 0.

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 brakoczy@lxplus.cern.ch

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/cern.ch/cms/ CMS installation
Let us use default CMS installation, type in bash:
source /afs/cern.ch/cms/cmsset_default.sh

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://svn.cern.ch/reps/totem/branches/CMSSW_7_0_4/offline/cmssw/src/ 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.

cmsenv

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:

CMSSW_7_0_4/src/Configuration/TotemStandardSequences/test/RP/prodRPinelasticBeta90Energy6500GeV_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:prodRPelasticBeta90Energy6500GeV.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:

cmsRun src/Configuration/TotemStandardSequences/test/RP/prodRPinelasticBeta90Energy6500GeV_cfg.py

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 | Raw edit | More topic actions...
Topic revision: r17 - 2015-02-24 - 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-2021 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