Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:11:17

0001 #!/bin/sh
0002 
0003 castorhome="/castor/cern.ch/user/p/pjanot/CMSSW330pre2/"
0004 cmsswDir=/afs/cern.ch/user/p/pjanot/scratch0/CMSSW_3_3_0_pre2/src
0005 
0006 # 150000 evenements en 8h
0007 # for energy in 1 2 3 4 5 7 9
0008 # 100000 evenements en 8h
0009 # for energy in 12 15 20
0010 # 50000 evenements en 8h
0011 #for energy in 30 50 100 200
0012 # 30000 evenements en 8h
0013 #for energy in 300 500 700 1000
0014 #for energy in 15
0015 # Some electrons with pt = 35 GeV/c
0016 for pt in 35
0017  do
0018 #echo "Energy "$energy
0019   echo "pT = "$pt
0020 
0021 #    for pid in 211 -211 130 321 -321 2112 -2112 2212 -2212
0022 #    for pid in -2212
0023     for pid in 11 -11
0024     do
0025         echo "PID "$pid
0026 
0027 #       DIRNAME=$castorhome"SingleParticlePID"$pid"-E"$energy
0028         DIRNAME=$castorhome"SingleParticlePID"$pid"-pT"$pt
0029         echo "Creating directory "$DIRNAME
0030         rfmkdir $DIRNAME
0031         for ((job=0;job<=9;job++));
0032             do
0033             
0034             echo "JOB "$job
0035 #           NAME="SingleParticlePID"$pid"-E"$energy"_"$job
0036             NAME="SingleParticlePID"$pid"-pT"$pt"_"$job
0037 
0038             echo "Name "$NAME
0039             outputfilename=$NAME".root"
0040             echo $outputfilename
0041             seed1=$(( ($job+1)*143123 ))
0042             
0043 
0044             sed -e "s/==OUTPUT==/$outputfilename/" -e "s/==SEED==/$seed1/" -e "s/==PID==/$pid/" -e "s/==PT==/$pt/" template_cfg.py > tmp_cfgfile
0045             #sed -e "s/==OUTPUT==/$outputfilename/" -e "s/==SEED==/$seed1/" -e "s/==PID==/$pid/" -e "s/==ENERGY==/$energy/" template.cfg > tmp_cfgfile
0046 
0047         #Start to write the script
0048         cat > job_${NAME}.sh << EOF
0049 #!/bin/sh
0050 cd $cmsswDir
0051 eval \`scramv1 runtime -sh\`
0052 cd -
0053 
0054 #commande pour decoder le .cfg
0055 cat > TEST_cfg.py << "EOF"
0056 EOF
0057 
0058 #Ajoute le .cfg au script
0059 cat tmp_cfgfile >> job_${NAME}.sh
0060 
0061 # On poursuit le script
0062 echo "EOF" >> job_${NAME}.sh
0063 cat >> job_${NAME}.sh << EOF
0064 cmsRun TEST_cfg.py >& log
0065 
0066 rfcp $outputfilename $DIRNAME/$outputfilename
0067 
0068 EOF
0069 chmod 755 job_${NAME}.sh
0070 bsub -q cmst3 -J $NAME -R "mem>2000" $PWD/job_${NAME}.sh
0071 
0072             done
0073         done
0074 done