Draft: Changes needed for making generator transforms CA compatible
Main changes
-
Gen_tf.py
: changed initialisation ofathenaExecutor
inGen_tf.py
to useskeletonCA
. Old executors are still kept - New
EvgenConfig
class from which the jO will inherit- add
genCA
as a class attribute - move helper function definitions to
EvgenConfigHelpers.py
- add
- added
python/GENtoEVGEN_Skeleton.py
as a replacement ofshare/skel.GENtoEVGEN.py
- Added
flags.Generator
configuration flags inGeneratorConfig
-
evgenTrfArgs.py
- removed 13.0 TeV as default energy. Made the transform crash if
ecmEnergy
not provided. This was also the intended behaviour in the old skeleton but probably it was overseen thatecmEnergy
had a default value - removed
inputGenConfFile
as a possible argument. This makes the code crash automatically when this argument is provided
- removed 13.0 TeV as default energy. Made the transform crash if
To do
-
MetaData and other containers (e.g. JetContainer) not saved -
Need to discuss relation between main sequence and sequences created in GENtoEVGEN.py_Skeleton
-
Discuss whether EvgenConfig.setupProcess
should return aComponentAccumulator
-
Need to decide how we are going to support CA and legacy configuration running together. We would need two EvgenConfig
classes
How to run
- Check out my
sargyrop/athena:spyrosCA
asetup main,latest,AthGeneration
Gen_tf.py --jobConfig=./100000 --ecmEnergy=13600. --maxEvents=10 --outputEVNTFile=minbias.root --CA
In the run
directory make a DSID with a jO file 100000/mc.PG_test.py
with the following content
# Translation of 950555/mc.PG_single_nu_valid.py into CA mode
from EvgenJobTransforms.EvgenConfig import EvgenConfig
from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
class Sample(EvgenConfig):
def __init__(self, runArgs, flags):
super().__init__(runArgs, flags)
def setupFlags(self, runArgs, flags):
self.description = ["Single neutrinos with fixed eta and E: purely for pile-up/lumi testing"]
self.keywords = ["singleParticle", "neutrino"]
self.contact = ["dhirsch@mail.cern.ch"]
self.nEventsPerJob = 100
self.generators += ["ParticleGun"]
super().setupFlags(runArgs, flags)
def setupProcess(self, flags):
sampleConfig = ComponentAccumulator()
import ParticleGun as PG
pg = PG.ParticleGun(randomStream = "SINGLE", randomSeed = flags.Random.SeedOffset)
pg.sampler.pid = 12
pg.sampler.mom = PG.EEtaMPhiSampler(energy=50000, eta=0)
sampleConfig.addEventAlgo(pg)
return sampleConfig
How to run
Gen_tf.py --jobConfig=./100000 --outputEVNTFile=minbias.root --CA --maxEvents=10
Merge request reports
Activity
added Generators label
- Resolved by Spyros Argyropoulos
- Resolved by Spyros Argyropoulos
- Resolved by Spyros Argyropoulos
181 184 exeSet = set() 182 185 msg.info("Transform arguments %s" % sys.argv[1:]) 183 186 if "--outputEVNTFile" in str(sys.argv[1:]): 187 # Spyros add the CA part 188 if "--CA" in str(sys.argv[1:]): The reason I did it like this (only temporary) is to see whether we would allow to run non-CA
23.6
configurations. But perhaps if someone would need to run such configurations they would just use an older23.6.x
release.We should also discuss today whether (and how) we should for some time support running both with CA (for development) and without (for production)
Edited by Spyros Argyropoulos
- Resolved by Spyros Argyropoulos
- Resolved by Spyros Argyropoulos
Hi @sargyrop, thanks for working on this. Note that you still use legacy configuration in the new skeleton. You have to move to
ComponentFactory
with the new configurables andComponentAccumulator
for all pieces of the configuration.
Hi @sargyrop, before undrafting please add the ATLAS bot as Developer to your fork
https://atlassoftwaredocs.web.cern.ch/gittutorial/gitlab-fork/#add-your-friendly-build-bot
Best, Thomas - L2
104 evgenLog.error("You must supply one and only one jobConfig file argument") 105 sys.exit(1) 106 107 evgenLog.info("Using JOBOPTSEARCHPATH (as seen in skeleton) = '%s'" % os.environ["JOBOPTSEARCHPATH"]) 108 109 FIRST_DIR = (os.environ['JOBOPTSEARCHPATH']).split(":")[0] 110 111 # Find jO file and make perform consistency checks 112 jofiles = [f for f in os.listdir(FIRST_DIR) if (f.startswith('mc') and f.endswith('.py'))] 113 if len(jofiles) !=1: 114 evgenLog.error("You must supply one and only one jobOption file in DSID directory") 115 sys.exit(1) 116 jofile = jofiles[0] 117 checkJOConsistency(jofile) 118 119 exec(open(os.path.join(FIRST_DIR,jofile)).read()) changed this line in version 4 of the diff