1
1
2
2
# Details here: https://twiki.cern.ch/twiki/bin/view/Sandbox/PpsCepStudies#FPMC
3
+
4
+ # variable JOBNAME is been used for IO filenames from simulation and event sample used as input:
5
+ #
6
+ # $JOBNAME.hepmc: input event sample from FPMC
7
+ # $JOBNAME.py: config file for cmsRun
8
+ # $JOBNAME.root: output file from simulation
9
+
3
10
CMSSW=CMSSW_8_0_1
4
11
AREA=$PWD /$CMSSW /src/
5
- OUTPUTFILE=dataWW.py
6
- INPUTFILE=dataWW.hepmc
12
+ JOBNAME=data_dijets
13
+ NEVENTS=100
7
14
8
- cp fpmc/$INPUTFILE $AREA
15
+ echo " Copying event sample"
16
+ cp fpmc/$JOBNAME .hepmc $AREA
9
17
10
18
cd $AREA
19
+ echo " Setting up CMSSW environment"
11
20
eval ` scramv1 runtime -sh`
12
21
22
+ echo " Creating configuration file from cmsDriver"
13
23
cmsDriver.py \
14
24
readHepMC_cff.py \
15
- -n 10 \
25
+ -n $(( NEVENTS )) \
16
26
--fast \
17
27
--conditions auto:run2_mc \
18
28
--eventcontent AODSIM \
@@ -23,29 +33,34 @@ cmsDriver.py \
23
33
--era Run2_25ns \
24
34
--customise FastSimulation/PPSFastSim/customise_FastSimCTPPS_cff.customise \
25
35
--no_exec \
26
- --fileout=dataWW .root \
27
- --python_filename=$OUTPUTFILE
36
+ --fileout=" $JOBNAME " .root \
37
+ --python_filename=" $JOBNAME " .py
28
38
29
39
# Replace input file:
30
40
31
- sed -i -e ' s/FPMC_WW_Inclusive_13TeV/dataWW/g' Configuration/Generator/python/readHepMC_cff.py
41
+ echo " Replacing input filename for hepMC format"
42
+ sed -i ' s/file:.*.hepmc/file:' " $JOBNAME " ' .hepmc/g' Configuration/Generator/python/readHepMC_cff.py
32
43
33
44
# modify the resulting driver (in this examples, 'readHepMC_cff_py_GEN_SIM_RECOBEFMIX_DIGI_RECO.py')
34
45
# by adding the following line, with 'source' as the input HepMC sample:
35
46
# process.VtxSmeared.src = 'source'
36
47
37
- sed ' 94iprocess.VtxSmeared.src = "' $INPUTFILE ' "' $OUTPUTFILE > test.py
38
- mv test.py $OUTPUTFILE
48
+ echo " Adding hepMC event sample for simulation"
49
+ sed ' 94iprocess.VtxSmeared.src = ' " \" $JOBNAME " ' .hepmc\"' " $JOBNAME " .py > test.py
50
+ mv test.py $JOBNAME .py
39
51
40
52
# filter has to be modified to include specific channels; for WW see:
41
53
# https://raw.githubusercontent.com/uerj-cms-cep-studies/tmp/master/inputHepMC.cc
54
+ echo " Fetching ED filter"
42
55
mkdir inputHepMC
43
56
cd inputHepMC
44
57
mkedfltr inputHepMC
45
58
cd ..
46
59
47
60
# when ready, run:
61
+ echo " Compiling CMSSW area"
48
62
scram b -j 8
49
63
# and:
50
- cmsRun dataWW.py
64
+ echo " Running job"
65
+ cmsRun $JOBNAME .py
51
66
# or equivalent driver.
0 commit comments