#!/usr/bin/env bash export GENVERSION=p10.15.01 export RECOVERSION=p10.15.01 export D0GSTARVERSION=p10.15.01 export D0SIMVERSION=p10.15.01 export RECOVERSION=p10.15.01 export RECOAVERSION=p10.15.01 export CARDSVERSION=v00-03-23 export PARENT=qcd export DECAY=incl export PTMIN=5.0 export PTMAX=999999. export NBGND=0.5 export NEVT=50000 export GROUP=np export PART=xxx export ENERGY=1960. export REQUEST=147 export ONETOP=off export MAXOPT=1 export GEOMETRY=plain # Give a short, human readable description of the process. # No spaces are allowed between "" signs, enviroment variables can be used # example: # export PROCESS=a+b-->C;Pt>$PTMIN" export PROCESS="a+b-->C;Pt>$PTMIN" ####################################################################### export LOGFILE=$PARENT-$DECAY-$NBGND-PtGt$PTMIN-$NEVT-$PART.log export TEMPORARYFILE=$LOGFILE.temporaryfile cat <$LOGFILE ******************************************************** PROCESS $PROCESS PART $PART NEVT $NEVT NBGND $NBGND PTMIN $PTMIN ENCM $ENERGY REQUEST $REQUEST ONETOP $ONETOP GENVERSION $GENVERSION RECOVERSION $RECOVERSION D0GSTARVERSION $D0GSTARVERSION D0SIMVERSION $D0SIMVERSION RECOVERSION $RECOVERSION RECOAVERSION $RECOAVERSION CARDSVERSION $CARDSVERSION ---------------------------------------------------------------------------- Log file started at EOF #cat $LOGFILE date >> $LOGFILE #################### define generator mc_runjob cards ######################## export SCRIPT=$PARENT-$DECAY.script cat < $SCRIPT # Script for starting a pythia-only job # # (Job name will be filled in by reg_job, # included here for manual use of fmcreate) cfg samglobal define string JobName UTA-P- # pythia is a configurator for the MCpythia_x program attach pythia cfg pythia define string D0Release $GENVERSION cfg pythia define string RunNumberFile ~/run.number cfg pythia make seeds cfg samglobal define int RequestID $REQUEST cfg pythia define string CardfileVersion $CARDSVERSION cfg pythia define string CardfileDir $GROUP cfg pythia define float CollisionEnergy $ENERGY cfg pythia define string Production $PARENT cfg pythia define string Decay $DECAY cfg pythia define int NumRecords 0 cfg pythia define int UseMaxopt $MAXOPT cfg pythia define string UseOnetop $ONETOP cfg pythia define float PtGt $PTMIN cfg pythia define float PtLt $PTMAX cfg pythia define float EtaGt 0.0 cfg pythia define float EtaLt 0.0 reset chain make job return EOF ############### define the d0gstar+d0sim+reco+recoA cards ################## export RUNSCRIPT=$LOGFILE.script cat < $RUNSCRIPT # Script for starting a d0gstar/d0sim/d0reco/recoanalyze job # # (Job name will be filled in by reg_job, # included here for manual use of fmcreate) cfg samglobal define string JobName UTA-DSRA- # # Attach a list of files in place of a gen phase # attach filestream cfg filestream setinfo generator None filestream cfg filestream define string FilesToProcess fileproc.list cfg filestream define int MergeFiles 0 # d0gstar is a configurator for the d0gstar2.x program attach d0gstar cfg d0gstar define int NumRecords 0 cfg d0gstar define int SkipRecords 0 cfg d0gstar define string D0Release $D0GSTARVERSION cfg d0gstar make seeds cfg d0gstar define int UseMaxopt $MAXOPT cfg d0gstar define string Geometry $GEOMETRY # d0sim is a configurator for the d0sim.x program attach d0sim cfg d0sim define int NumRecords 0 cfg d0sim define int SkipRecords 0 cfg d0sim define string D0Release $D0SIMVERSION cfg d0sim define string MinBiOpt Poisson cfg d0sim define float NumMinBi $NBGND cfg d0sim define string MinBiFileName dummy cfg d0sim define int UseMaxopt $MAXOPT cfg d0sim define string LinkToRundata on # d0reco is a configurator for the d0reco.x program attach d0reco cfg d0reco define int NumRecords 0 cfg d0reco define int SkipRecords 0 cfg d0reco define string D0Release $RECOVERSION cfg d0reco define int UseMaxopt $MAXOPT cfg d0reco define string LinkToRundata on # recoanalyze is a configurator for the RecoAnalyze_x program attach recoanalyze cfg recoanalyze define int NumRecords 0 cfg recoanalyze define int SkipRecords 0 cfg recoanalyze define string D0Release $RECOAVERSION cfg recoanalyze define int UseROOT 1 cfg recoanalyze define int UseMaxopt $MAXOPT cfg recoanalyze define int AddRootSuffix 1 # # Read in list of filenames # cfg filestream make filelist repeat reset chain make job end return EOF ###### prepare the script which will extract jobname and generator ######### ##### file name from reg_job output ######### export PYTHONSCRIPT=temporary_python_script cat < $PYTHONSCRIPT #!/usr/bin/env python import sys import os import commands import string import time #This file takes lines containing # Output # and job name from input file # and writes them to standard output # used to create log file for InputFileName in sys.argv[1:]: InputFile=open(InputFileName,"r") for line in InputFile.readlines(): if string.find(line,"Output")!=-1 and string.find(line,":")!=-1: print line if string.find(line,"Registered")!=-1 and string.find(line,":")!=-1: JobName=string.strip(string.split(line,":")[1]) print "Generator job:" print JobName+" submitted" print "# Generator job submited at "+time.ctime(time.time()) InputFile.close() EOF # register the job. First copy the configuration script to conf_files dir cp $SCRIPT ~/conf_files/ reg_job $SCRIPT --final_disposition=cache --num_events=$NEVT>$TEMPORARYFILE # append generator file and generator job name to logfile python $PYTHONSCRIPT $TEMPORARYFILE >>$LOGFILE # clean temporary files #rm -rf $TEMPORARYFILE $PYTHONSCRIPT cat $TEMPORARYFILE