Skip to content
Snippets Groups Projects
Commit d7240a6f authored by Markus Frank's avatar Markus Frank Committed by MarkusFrankATcernch
Browse files

Move DDG4 edm4hep writer to use ROOTFrameWriters

parent 048c378f
No related branches found
No related tags found
No related merge requests found
This diff is collapsed.
......@@ -46,8 +46,13 @@ class Setup:
def defineOutput(self, output):
# Configure I/O
evt_root = self.geant4.setupROOTOutput('RootOutput', output, mc_truth=True)
return evt_root
evt_write = self.geant4.setupROOTOutput('RootOutput', output, mc_truth=True)
return evt_write
def defineEdm4hepOutput(self, output):
# Configure I/O
evt_write = self.geant4.setupEDM4hepOutput('Edm4hepOutput', output)
return evt_write
def setupGun(self, name="Gun", particle='pi-', energy=100 * GeV, multiplicity=1):
# Setup particle gun
......
......@@ -38,8 +38,12 @@ def run():
cmds.append('/ddg4/UI/terminate')
m.ui.Commands = cmds
m.configure()
wr = m.defineOutput(output='MiniTel')
if args.output and str(args.output).lower().find('edm4hep') >= 0:
wr = m.defineEdm4hepOutput(args.output)
else:
wr = m.defineOutput(output='MiniTel')
wr.FilesByRun = True
gen = DDG4.GeneratorAction(kernel, "Geant4GeneratorActionInit/GenerationInit")
kernel.generatorAction().adopt(gen)
......
......@@ -41,3 +41,7 @@ class Setup(DDG4TestSetup.Setup):
def defineOutput(self, output='MiniTel_' + time.strftime('%Y-%m-%d_%H-%M')):
return DDG4TestSetup.Setup.defineOutput(self, output)
def defineEdm4hepOutput(self, output='MiniTel_' + time.strftime('%Y-%m-%d_%H-%M')):
return DDG4TestSetup.Setup.defineEdm4hepOutput(self, output)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment