Skip to content

Commit

Permalink
Examples and documentation of FCCDIRAC application workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Lorenzo Valentini authored and Lorenzov1999 committed Jun 14, 2023
1 parent 0995f11 commit d854a07
Show file tree
Hide file tree
Showing 24 changed files with 2,371 additions and 3 deletions.
49 changes: 46 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,15 @@ Contents:
* [6 - Get Back Results](#6---get-back-results)
* [a - Command Line Interface](#a---command-line-interface)
* [b - Web Portal](#b---web-portal)



* [7 - Workflow examples](#7---workflow-examples)
* [Workflow 1 - KKMC and k4SimDelphes in Delphes standalone](#Workflow-1---KKMC-and-k4SimDelphes-in-Delphes-standalone)
* [Workflow 2 - KKMC and k4SimDelphes in Gaudi](#Workflow-2---KKMC-and-k4SimDelphes-in-Gaudi)
* [Workflow 3 - Pythia8 and k4SimDelphes in Delphes standalone](#Workflow-3---Pythia8-and-k4SimDelphes-in-Delphes-standalone)
* [Workflow 4 - Pythia8 and k4SimDelphes in Gaudi](#Workflow-4---Pythia8-and-k4SimDelphes-in-Gaudi)
* [Workflow 5 - Particle Gun, k4SimGeant4 and k4RecCalorimeter in Gaudi](#Workflow-5---Particle-Gun-k4SimGeant4-and-k4RecCalorimeter-in-Gaudi)
* [Workflow 6 - Bhlumi and k4SimDelphes in Delphes standalone](#Workflow-6---Bhlumi-and-k4SimDelphes-in-Delphes-standalone)
* [Workflow 7 - Babayaga and k4SimDelphes in Delphes standalone](#Workflow-7---Babayaga-and-k4SimDelphes-in-Delphes-standalone)
* [fccconfig](#fccconfig)


## Overview
Expand Down Expand Up @@ -434,3 +440,40 @@ Congratulations !!!
You ran FCC softwares on the GRID.

For any questions or any further informations, please contact us at : fcc-experiments-sw-devATSPAMNOTcern.ch


## [7 - Workflow Examples](https://github.com/HEP-FCC/FCCDIRAC/tree/master/workflows)

### Workflow 1 - KKMC and k4SimDelphes in Delphes standalone

work in progress

### Workflow 2 - KKMC and k4SimDelphes in Gaudi

work in progress

### [Workflow 3 - Pythia8 and k4SimDelphes in Delphes standalone](https://github.com/HEP-FCC/FCCDIRAC/tree/master/workflows/3)

Generate events with Pythia and process through k4SimDelphes, all using a Delphes standalone executable. The model of detector used is IDEA.

### [Workflow 4 - Pythia8 and k4SimDelphes in Gaudi](https://github.com/HEP-FCC/FCCDIRAC/tree/master/workflows/4)

Generate events with Pythia and process through k4SimDelphes, all inside a Gaudi algorithm. The model of detector used is IDEA.

### [Workflow 5 - Particle Gun, k4SimGeant4 and k4RecCalorimeter in Gaudi](https://github.com/HEP-FCC/FCCDIRAC/tree/master/workflows/5)

Generate events with Particle Gun, run a simuation with Geant4, do a reconstruction, all in a Gaudi algorithm. The model of detector used is IDEA, with liquid Argon.

### [Workflow 6 - Bhlumi and k4SimDelphes in Delphes standalone](https://github.com/HEP-FCC/FCCDIRAC/tree/master/workflows/6)

Generate events with Bhlumi. Process through k4SimDelphes, using a Delphes standalone executable with a Pythia LHE reader.

### [Workflow 7 - Babayaga and k4SimDelphes in Delphes standalone](https://github.com/HEP-FCC/FCCDIRAC/tree/master/workflows/7)

(Not yet inplemented)

Generate events with Babayaga. Process through k4SimDelphes, using a Delphes standalone executable with a Pythia LHE reader.

### [fccconfig](https://github.com/HEP-FCC/FCCDIRAC/tree/master/workflows/fccconfig)

Steering files, cards, etc.
33 changes: 33 additions & 0 deletions workflows/3/WF3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/env python
"""script to do X"""
from DIRAC.Core.Base.Script import parseCommandLine
parseCommandLine()

from ILCDIRAC.Interfaces.API.NewInterface.Applications import DelphesApp
from ILCDIRAC.Interfaces.API.NewInterface.UserJob import UserJob
from ILCDIRAC.Interfaces.API.DiracILC import DiracILC


def run():
"""Run The Job."""
job = UserJob()
job.setConfigPackage("fccConfig", 'key4hep-devel-2')

delphes = DelphesApp()
delphes.setVersion('key4hep-latest')
delphes.setExecutableName("DelphesPythia8_EDM4HEP")
delphes.setDetectorCard('card_IDEA.tcl')
delphes.setOutputCard('edm4hep_IDEA.tcl')
delphes.setPythia8Card('p8_ee_ggqq_ecm91.cmd')
delphes.setRandomSeed(12340)
delphes.setEnergy(91.19)
delphes.setNumberOfEvents(100)
delphes.setOutputFile('output.root')

job.append(delphes)
job.submit(DiracILC(), mode='local')



if __name__ =="__main__":
run()
27 changes: 27 additions & 0 deletions workflows/3/p8_ee_ggqq_ecm91.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Random:setSeed = on
Main:numberOfEvents = 3000 ! number of events to generate
Main:timesAllowErrors = 5 ! how many aborts before run stops


! 2) Settings related to output in init(), next() and stat().
Init:showChangedSettings = on ! list changed settings
Init:showChangedParticleData = off ! list changed particle data
Next:numberCount = 100 ! print message every n events
Next:numberShowInfo = 1 ! print event information n times
Next:numberShowProcess = 1 ! print process record n times
Next:numberShowEvent = 0 ! print event record n times
Stat:showPartonLevel = off

! 3) Beam parameter settings. Values below agree with default ones.
Beams:idA = 11 ! first beam, e- = 11
Beams:idB = -11 ! second beam, e+ = -11

! 4) Hard process : photon collisions at 91.188 GeV
Beams:eCM = 91.188 ! CM energy of collision
PhotonCollision:gmgm2qqbar = on
PhotonCollision:gmgm2ccbar = on
PhotonCollision:gmgm2bbbar = on

PartonLevel:ISR = on ! initial-state radiation
PartonLevel:FSR = on ! final-state radiation

38 changes: 38 additions & 0 deletions workflows/3/test_fccprod_wf3.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[delphesapp]
ExecutableName = DelphesPythia8_EDM4HEP
DetectorCard = card_IDEA.tcl
OutputCard = edm4hep_IDEA.tcl
Version = key4hep-latest

[Production Parameters]
machine = ee
prodGroup = several

softwareVersion = key4hep-latest
generatorApplication = delphesapp
generatorSteeringFile = p8_ee_ggqq_ecm91.cmd, p8_ee_WW_ecm240.cmd, p8_ee_ZH_ecm240.cmd, p8_ee_ZZ_ecm240.cmd

configVersion = key4hep-devel-2
configPackage = fccConfig
eventsPerJobs = 1000, 2000, 3000, 1500

numberOfTasks = 1, 1, 1, 1

campaign = winter2023
energies = 91.188, 240, 240, 240
processes = qqbar, WW_incl, ZZ_incl, ZH_incl
detectorModel = idea
datatype = delphes

productionLogLevel = VERBOSE
outputSE = CERN-DST-EOS

finalOutputSE = CERN-SRM
MoveStatus = Stopped
MoveGroupSize = 10

ProdTypes = Gen
move = False



30 changes: 30 additions & 0 deletions workflows/4/WF4.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/env python
"""script to do X"""
from DIRAC.Core.Base.Script import parseCommandLine
parseCommandLine()

from ILCDIRAC.Interfaces.API.NewInterface.Applications import GaudiApp, DelphesApp
from ILCDIRAC.Interfaces.API.NewInterface.UserJob import UserJob
from ILCDIRAC.Interfaces.API.DiracILC import DiracILC

def run():
"""Run The Job."""
job = UserJob()
job.setConfigPackage("fccConfig", 'key4hep-devel-2')

ga = GaudiApp()
ga.setVersion('key4hep-latest')
ga.setExecutableName("k4run")
ga.setSteeringFile('k4simdelphesalg_pythia.py')
ga.setPythia8Card('p8_ee_ggqq_ecm91.cmd') #p8_ee_ZH_ecm240.cmd p8_ee_WW_ecm240 p8_ee_ZZ_ecm240.cmd
ga.setExtraCLIArguments("--Pythia8.PythiaInterface.pythiacard pythia8card.cmd --k4SimDelphesAlg.DelphesCard card_IDEA.tcl --k4SimDelphesAlg.DelphesOutputSettings edm4hep_IDEA.tcl")
ga.setEnergy(91.19)
ga.setNumberOfEvents(50)
ga.setOutputFile('output.root')

job.append(ga)
job.submit(DiracILC(), mode='local')


if __name__ =="__main__":
run()
54 changes: 54 additions & 0 deletions workflows/4/k4simdelphesalg_pythia.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
from Gaudi.Configuration import *
from GaudiKernel import SystemOfUnits as units

from Configurables import ApplicationMgr
app = ApplicationMgr()
app.EvtMax = 100
app.EvtSel = "NONE"

from Configurables import k4DataSvc
podioevent = k4DataSvc("EventDataSvc")
app.ExtSvc += [podioevent]


from Configurables import PythiaInterface
pythia8gentool = PythiaInterface()
### Example of pythia configuration file to generate events
# take from $K4GEN if defined, locally if not
path_to_pythiafile = os.environ.get("K4GEN", "")
pythiafilename = "Pythia_standard.cmd"
pythiafile = os.path.join(path_to_pythiafile, pythiafilename)
# Example of pythia configuration file to read LH event file
#pythiafile="options/Pythia_LHEinput.cmd"
pythia8gentool.pythiacard = pythiafile
pythia8gentool.doEvtGenDecays = False
pythia8gentool.printPythiaStatistics = True

from Configurables import GenAlg
gun = GenAlg()
gun.SignalProvider = pythia8gentool
gun.hepmc.Path = "hepmc"
ApplicationMgr().TopAlg += [gun]


from Configurables import HepMCToEDMConverter
hepmc_converter = HepMCToEDMConverter()
hepmc_converter.hepmc.Path="hepmc"
hepmc_converter.GenParticles.Path = "GenParticles"
ApplicationMgr().TopAlg += [hepmc_converter]

from Configurables import k4SimDelphesAlg
delphesalg = k4SimDelphesAlg()
delphesalg.DelphesCard = "delphes_card_IDEA.tcl"
delphesalg.DelphesOutputSettings = "edm4hep_output_config.tcl"
delphesalg.GenParticles.Path = "GenParticles"
delphesalg.OutputLevel = VERBOSE
ApplicationMgr().TopAlg += [delphesalg]


from Configurables import PodioOutput
out = PodioOutput("out", filename = "output_k4SimDelphes_pythia.root")
out.outputCommands = ["keep *"]
ApplicationMgr().TopAlg += [out]


22 changes: 22 additions & 0 deletions workflows/4/p8_ee_WW_ecm240.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Random:setSeed = on
Main:numberOfEvents = 1000 ! number of events to generate
Main:timesAllowErrors = 5 ! how many aborts before run stops

! 2) Settings related to output in init(), next() and stat().
Init:showChangedSettings = on ! list changed settings
Init:showChangedParticleData = off ! list changed particle data
Next:numberCount = 100 ! print message every n events
Next:numberShowInfo = 1 ! print event information n times
Next:numberShowProcess = 1 ! print process record n times
Next:numberShowEvent = 0 ! print event record n times

Beams:idA = 11 ! first beam, e+ = 11
Beams:idB = -11 ! second beam, e- = -11

! 3) Hard process : WW at 240 GeV
Beams:eCM = 240 ! CM energy of collision
WeakDoubleBoson:ffbar2WW = on

! 4) Settings for the event generation process in the Pythia8 library.
PartonLevel:ISR = on ! no initial-state radiation
PartonLevel:FSR = on ! no final-state radiation
25 changes: 25 additions & 0 deletions workflows/4/p8_ee_ZH_ecm240.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Random:setSeed = on
Main:numberOfEvents = 1000 ! number of events to generate
Main:timesAllowErrors = 5 ! how many aborts before run stops

! 2) Settings related to output in init(), next() and stat().
Init:showChangedSettings = on ! list changed settings
Init:showChangedParticleData = off ! list changed particle data
Next:numberCount = 100 ! print message every n events
Next:numberShowInfo = 1 ! print event information n times
Next:numberShowProcess = 1 ! print process record n times
Next:numberShowEvent = 0 ! print event record n times

Beams:idA = 11 ! first beam, e+ = 11
Beams:idB = -11 ! second beam, e- = -11

! 3) Hard process : ZH at 240 GeV
Beams:eCM = 240. ! CM energy of collision
HiggsSM:ffbar2HZ = on

! 4) Settings for the event generation process in the Pythia8 library.
PartonLevel:ISR = on ! initial-state radiation
PartonLevel:FSR = on ! final-state radiation

! 5) Non-standard settings; exemplifies tuning possibilities.
25:m0 = 125.0 ! Higgs mass
23 changes: 23 additions & 0 deletions workflows/4/p8_ee_ZZ_ecm240.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Random:setSeed = on
Main:numberOfEvents = 1000 ! number of events to generate
Main:timesAllowErrors = 5 ! how many aborts before run stops

! 2) Settings related to output in init(), next() and stat().
Init:showChangedSettings = on ! list changed settings
Init:showChangedParticleData = off ! list changed particle data
Next:numberCount = 100 ! print message every n events
Next:numberShowInfo = 1 ! print event information n times
Next:numberShowProcess = 1 ! print process record n times
Next:numberShowEvent = 0 ! print event record n times

Beams:idA = 11 ! first beam, e+ = 11
Beams:idB = -11 ! second beam, e- = -11

! 3) Hard process : ZZ at 240 GeV
Beams:eCM = 240 ! CM energy of collision
WeakDoubleBoson:ffbar2gmZgmZ = on

! 4) Settings for the event generation process in the Pythia8 library.
PartonLevel:ISR = on ! no initial-state radiation
PartonLevel:FSR = on ! no final-state radiation

27 changes: 27 additions & 0 deletions workflows/4/p8_ee_ggqq_ecm91.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Random:setSeed = on
Main:numberOfEvents = 3000 ! number of events to generate
Main:timesAllowErrors = 5 ! how many aborts before run stops


! 2) Settings related to output in init(), next() and stat().
Init:showChangedSettings = on ! list changed settings
Init:showChangedParticleData = off ! list changed particle data
Next:numberCount = 100 ! print message every n events
Next:numberShowInfo = 1 ! print event information n times
Next:numberShowProcess = 1 ! print process record n times
Next:numberShowEvent = 0 ! print event record n times
Stat:showPartonLevel = off

! 3) Beam parameter settings. Values below agree with default ones.
Beams:idA = 11 ! first beam, e- = 11
Beams:idB = -11 ! second beam, e+ = -11

! 4) Hard process : photon collisions at 91.188 GeV
Beams:eCM = 91.188 ! CM energy of collision
PhotonCollision:gmgm2qqbar = on
PhotonCollision:gmgm2ccbar = on
PhotonCollision:gmgm2bbbar = on

PartonLevel:ISR = on ! initial-state radiation
PartonLevel:FSR = on ! final-state radiation

34 changes: 34 additions & 0 deletions workflows/4/test_fccprod_wf4.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[gaudiapp]
ExecutableName = k4run
SteeringFile = k4simdelphesalg_pythia.py
Arguments = --Pythia8.PythiaInterface.pythiacard pythia8card.cmd --k4SimDelphesAlg.DelphesCard card_IDEA.tcl --k4SimDelphesAlg.DelphesOutputSettings edm4hep_IDEA.tcl
Version = key4hep-latest

[Production Parameters]
machine = ee
prodGroup = several
softwareVersion = key4hep-latest

generatorApplication = gaudiapp
generatorSteeringFile = p8_ee_ggqq_ecm91.cmd, p8_ee_WW_ecm240.cmd, p8_ee_ZH_ecm240.cmd, p8_ee_ZZ_ecm240.cmd

configVersion = key4hep-devel-2
configPackage = fccConfig
eventsPerJobs = 1000, 2000, 3000, 1500

numberOfTasks = 1, 1, 1, 1

campaign = winter2023
energies = 91.19, 240, 240, 240
processes = qqbar, WW_incl, ZZ_incl, ZH_incl
detectorModel = idea
datatype = delphes

productionLogLevel = VERBOSE
outputSE = CERN-DST-EOS

finalOutputSE = CERN-SRM
MoveStatus = Stopped
MoveGroupSize = 10

ProdTypes = Gen
Loading

0 comments on commit d854a07

Please sign in to comment.