#!/bin/bash # # Setup: # Ensure that your environment is correct CMSSW_VERSION=CMSSW_0_9_0 CMSSW_HOME=/afs/hep.wisc.edu/user/$USER/$CMSSW_VERSION # # Usage: # farmoutCmsRunJobs # Expects a cfi called IOMC/GeneratorInterface/test/PythiaSource.cfi to exist # in the CMSSW area that you are using. # # Job parameters # jobName=$1 declare -i nEvents=$2 declare -i nEventsPerJob=$3 # # Environment setup # originalDir=`pwd` cd $CMSSW_HOME eval `scramv1 runtime -sh` runDir=/afs/hep.wisc.edu/cms/$USER/CMS090TriggerSim-$jobName mkdir -p $runDir cd $runDir fs setacl -dir $runDir -acl condor-hosts rlidwk # # Job specification # Executable=`which cmsRun` # # Starting values for the job loop # declare -i nEventsSubmitted=0 declare -i job=0 # # Loop over jobs # while (( $nEvents > $nEventsSubmitted )); do # # Name the files # jobtag=`echo $jobName $job | awk '{printf("%s-%4.4d", $1, $2)}'` consub=`echo $jobName $job | awk '{printf("%s-%4.4d.sub", $1, $2)}'` conlog=`echo $jobName $job | awk '{printf("%s-%4.4d.log", $1, $2)}'` stdout=`echo $jobName $job | awk '{printf("%s-%4.4d.out", $1, $2)}'` stderr=`echo $jobName $job | awk '{printf("%s-%4.4d.err", $1, $2)}'` jobcfg=`echo $jobName $job | awk '{printf("%s-%4.4d.cfg", $1, $2)}'` jobout=`echo $jobName $job | awk '{printf("%s-%4.4d.root", $1, $2)}'` randomNumber=`date +%N%S | cut -c 1-6,10-` randomNumber2=`date +%N%S | cut -c 2-6,9-` # # Prepare job configuration file # cat < $jobcfg process PROD = { service = MessageLogger { untracked vstring destinations = {"cout"} untracked vstring categories = { "FwkJob" } untracked PSet cout = { #untracked PSet default = { untracked int32 limit = 0 } # kill all messages in the log untracked PSet default = { untracked int32 limit = -1 } # DON'T kill messages in the log! untracked PSet FwkJob = { untracked int32 limit = -1 } # except *all* of FwkJob's } #untracked vstring fwkJobReports = {"FrameworkJobReport.xml"} } service = Timing {} service = RandomNumberGeneratorService { untracked uint32 sourceSeed = $randomNumber PSet moduleSeeds = { untracked uint32 VtxSmeared = $randomNumber2 } } # NOTE : if one wants to run with the SiStripDigitizer, # then mag.field in the OscarProducer should be # turned ON; otherwise it gets (re)created by the # SiStripDigitizer, which seems to corrupt at all # the edm::Event record # Step 1 : Event Generation include "IOMC/GeneratorInterface/data/$jobName.cfi" replace PythiaSource.maxEvents = $nEventsPerJob # event vertex smearing - applies only once (internal check) # Note : all internal generatoes will always do (0,0,0) vertex # module VtxSmeared = VertexGenerator { string type = "IOMC/EventVertexGenerators/GaussianEventVertexGenerator" double MeanX = 0. double MeanY = 0. double MeanZ = 0. double SigmaX = 0.015 double SigmaY = 0.015 double SigmaZ = 53.0 // in mm (as in COBRA/OSCAR) } #Geometry # include "Geometry/CMSCommonData/data/cmsSimIdealGeometryXML.cfi" es_module = TrackerGeometricDetESModule {} #Magnetic Field # include "MagneticField/Engine/data/volumeBasedMagneticField.cfi" # Step 2 : CMS Detector Simulation # CMS Geant4-based Det.Simulation module (OscarProducer) # include "SimG4Core/Application/data/SimG4Object.cfi" # Step 3 : Digitization of the simulated hits # # Step 3a : Digitization of the Tracker # # required for Pixel and SiStrip Digitizers # es_module = TrackerDigiGeometryESModule {} # Pixel's digitization # include "SimTracker/SiPixelDigitizer/data/PixelDigi.cfi" # SiStrip's digitization # include "SimTracker/SiStripDigitizer/data/SiStripDigi.cfi" # Step 3b : Digitization of Ecal and Hcal include "Geometry/CaloEventSetup/data/CaloGeometrlse echo "$nEventsSubmitted >= $nEvents done!" fi # # Submit the job # condor_submit $consub done echo -n "Jobs for $jobName are created in " pwd cd $originalDir