DpeMC Interface

Athena interface for DpeMC. All command bellow are for bash (resp. zsh).
Used release is 12.0.2

How to run DpeMC under Athena

Preparing environment

CMT setup

First you need to create your cmthome directory and in this direstory requirement file (in fact the requirement file could be anywhere, but it's better to keep it in separate directory).
mkdir cmthome12 
cd cmthome12 
emacs requirement 
Requirement file could looks like this one
set SITEROOT /afs/cern.ch
macro ATLAS_DIST_AREA /afs/cern.ch/atlas/software/dist
macro ATLAS_TEST_AREA ${HOME}/testarea12
apply_tag setup
apply_tag simpleTest
use AtlasLogin AtlasLogin-* $(ATLAS_DIST_AREA)
Then you have to source cmt setup file:
source /afs/cern.ch/sw/contrib/CMT/v1r18p20061003/mgr/setup.sh
and configure:
cmt config
and run setup script with appropriate tag (number of used release):
source setup.sh -tag=12.0.2

Working directory

Line macro ATLAS_TEST_AREA ${HOME}/testarea12 in requirement file defines working directory. We will use for our test ${HOME}/testarea12 so we have to created it and go there:
mkdir ~/testarea12
cd ../testarea12
Now you check out UserAnalysis package:
cmt co PhysicsAnalysis/AnalysisCommon/UserAnalysis 
go to the run directory:
cd PhysicsAnalysis/AnalysisCommon/UserAnalysis/run
and get dpemc script by
get_files jobOptions.dpemc.py 
Now you can run by
athena jobOptions.dpemc.py 
to test that everything woks well.
All this need to be done only once ever.

Running DpeMC

All above steps should be done only once ever. Every time you start new session you have to do only this:
cd cmthome12
source setup.sh -tag=12.0.2
cd ../testarea12/PhysicsAnalysis/AnalysisCommon/UserAnalysis/run
now you can modify job option script and run in as usual by
athena  my_script.py
The most important line is
Dpemc.DpemcCommand = ["typepr EXC","typint QCD","iproc 9999","gapspr 0.03","prospr 0.9","cdffac 3.8","nstru 11"]
Here you can change dpemc settings. Number of generated events is set up by theApp.EvtMax = 10.

Running DpeMC with Altfast

For running DpeMC with Altfast you only add a few lines into the script where you call Atlfast and save the histograms/ntuples. Simple script, which run AtlFast and creates Athena Aware file could look like this one:
# Job options file
# General Application Configuration options
theApp.setup( MONTECARLO )
include( "PartPropSvc/PartPropSvc.py" )
# Private Application Configuration options
theApp.ExtSvc += ["AtRndmGenSvc"]
# Set output level threshold (2=DEBUG, 3=INFO, 4=WARNING, 5=ERROR, 6=FATAL )
MessageSvc = Service( "MessageSvc" )
MessageSvc.OutputLevel               = 3
# Event related parameters
theApp.EvtMax = 10
# Generator fragment
theApp.Dlls  += [ "Dpemc_i","TruthExamples"]
theApp.TopAlg = ["Dpemc","DumpMC"]
AtRndmGenSvc = Service( "AtRndmGenSvc" )
AtRndmGenSvc.Seeds = ["DPEMC 390020611 821000366", "DPEMC_INIT 820021 2347532"]
Dpemc = Algorithm( "Dpemc" )
Dpemc.DpemcCommand = ["typepr EXC","typint QCD","iproc 9999","gapspr 0.03","prospr 0.9","cdffac 3.8","nstru 11"]
# AtlFast simulation and reconstruction
include( "DC3_joboptions/GentoAtlfasttoCBNT_for12.0.0.py" )
# Athena Aware Output
include( "CBNT_Athena/CBNT_AthenaAware_jobOptions.py" )
include( "CBNT_Athena/CBNT_EventInfo_jobOptions.py" )

CBNT_AthenaAware = Algorithm( "CBNT_AthenaAware" )
CBNT_AthenaAware.Members += [ "Atlfast::AAN_Atlfast/AAN_Atlfast" ]
AAN_Atlfast = Algorithm( "AAN_Atlfast" )

#switch on/off ntuple blocks
AAN_Atlfast.FillIsolatedElectrons = TRUE
AAN_Atlfast.FillIsolatedPhotons   = TRUE
AAN_Atlfast.FillIsolatedMuons     = TRUE
AAN_Atlfast.FillNonIsolatedMuons  = TRUE
AAN_Atlfast.FillJets              = TRUE
AAN_Atlfast.FillEventData         = TRUE

THistSvc = Service ( "THistSvc" )
THistSvc.Output = ["AANT DATAFILE='atlfast.aan.root' OPT='RECREATE'"]
theApp.Dlls   += [ "AnalysisTools" ]
theApp.TopAlg += [ "AANTupleStream" ]
AANTupleStream = Algorithm( "AANTupleStream" )
AANTupleStream.ExistDataHeader = False
AANTupleStream.OutputName = 'atlfast.aan.root'
AANTupleStream.WriteInputDataHeader = True
theApp.Dlls += [ "RootHistCnv" ]
theApp.HistogramPersistency = "ROOT"

How to modify Dpemc

  • Go to ~/testarea12
  • Check out Dpemc by
    cmt co Generators/Herwig_i
    (or copy cmt, Herwig_i and src folder from /afs/cern.ch/atlas/software/builds/AtlasSimulation/2.0.2/Generators to ~/testarea/Generators/Herwig_i)
  • Change what you want
  • Compile the Herwig_i package

Structure of the package

As the DpeMC is modification of Herwig, it the interface (together with Jimmy interface) belongs to the Herwig_i package, i.e. the package contains Herwig, Jimmy and DpeMC interface.


This folder contains header files.


Folder for cmt management, run gmake here.


Contain source files.
  • In root of this folder is interface for Herwin, Jimmy and Dpemc
  • DpeMC folder contains dpemc source files
  • Herwig_modified folder contains Heriwg files with are modified for DpeMC


This is the main part of the interface.

How to change PDF

The interface as it is in release 12.0.2 unfortunately doesn't alltow changing PDF through python script. You have to check out the Herwig_i package, change it by hand in Dpemc.cxx and compile the package. PDF are set by ifit parameter (on line 434 in Dpemc.cxx). So if you want to you e.g. zeus PDF, you have to change ifit = 20, compile the package and copy PDF table (table_zeus.txt) into the run directory. Then if when you run DpeMC, it will use zeus PDF.


  • Go to cmt
  • If there is no makefile, run
    cmt config
  • Run
    This should compile all changes in whole Hewrig_i package.

Known bugs

Fixed bugs

Fixed bugs (not yet in release - should be in 12.0.4)

  • Don't call subrutine hwigin_() in Dpemc.cxx - overwrites parametres set int python script
  • Add ifit to parametres which can be chaneged in python scripts

Unsolved bugs


Nightlies (NICOS): http://atlas-computing.web.cern.ch/atlas-computing/links/distDirectory/nightlies/projects/nicos_web_areaSimDbg/NICOS_Log_rel_3/Generators_Herwig_i.loglog

Usefull links

-- VojtechJuranek - 06 Nov 2006
Edit | Attach | Watch | Print version | History: r8 < r7 < r6 < r5 < r4 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r8 - 2007-07-07 - VojtechJuranek
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Main 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