ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/algomez/test/run_hadronizer_crab_job.sh
Revision: 1.3
Committed: Sat Jun 1 00:36:59 2013 UTC (11 years, 11 months ago) by algomez
Content type: application/x-sh
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +2 -2 lines
Error occurred while calculating annotation data.
Log Message:
*** empty log message ***

File Contents

# Content
1 #!/bin/tcsh -f
2 ####################################################
3 ###
4 ### Simple tcsh script to send many Hadronization
5 ### and FASTSim jobs to crab.
6 ###
7 ### Alejandro Gomez Espinosa
8 ### gomez@physics.rutgers.edu
9 ###
10 ### How to run:
11 ### source run_hadronizer_crab_job.sh 100 250
12 ### 100 is the mass of the daugher particle and 250 of the mother
13 ### (If it is an executable (chmod +x run_hadronizer_crab_job.sh):
14 ### ./run_hadronizer_crab_job.sh 100 250
15 ###
16 ####################################################
17
18
19 ######################################
20 ### PARAMETERS
21 #####################################
22
23 foreach Process ("bj" "jj") # Here I have two different final states
24 set stop1 = $1 # Mass of the stop1
25 set stop2 = $2 # Mass of the stop2
26
27 set Main_Dir = /uscms/home/algomez/work/CMSSW_5_2_6/src/ # Main Dir
28 set Name = st2_h_bb_st1_${Process}_${stop2}_${stop1} # Name of the process
29 set Sample_Dir = ${Main_Dir}/${Name}_AOD/ # Name of directory for each process
30 set LHE_Dir = /uscms_data/d3/algomez/files/stops/lhe/ # Name of lhe directory
31
32
33 #####################################################
34 #### Here is where the code starts.. Do NOT change
35 #####################################################
36
37 ######## Create Sample Dir
38 /bin/rm -rf $Sample_Dir
39 if ( -d $Sample_Dir ) then
40 else
41 mkdir $Sample_Dir
42 endif
43 cd $Sample_Dir
44
45 ########################################################
46 ######### Python script for Hadronization and FASTSim
47 ######### This part is generic for most of the analysis
48 ########################################################
49 /bin/rm -f Hadronizer_TuneZ2star_8TeV_generic_LHE_pythia_cff_py_GEN_FASTSIM_HLT_PU_${Name}_AOD.py
50 cat > Hadronizer_TuneZ2star_8TeV_generic_LHE_pythia_cff_py_GEN_FASTSIM_HLT_PU_${Name}_AOD.py << EOF
51 # Auto generated configuration file
52 # using:
53 # Revision: 1.372.2.14
54 # Source: /local/reps/CMSSW/CMSSW/Configuration/PyReleaseValidation/python/ConfigBuilder.py,v
55 # with command line options: Configuration/GenProduction/python/EightTeV/Hadronizer_TuneZ2star_8TeV_generic_LHE_pythia_cff.py -s GEN,FASTSIM,HLT:7E33v2 --beamspot Realistic8TeVCollision --pileup 2012_Startup_inTimeOnly --geometry DB --conditions START52_V10::All --eventcontent AODSIM --datatier AODSIM --filein file:/uscms_data/d3/algomez/files/stops/lhe/${Name}.lhe --fileout file:/uscms_data/d3/algomez/files/stops/AOD/${Name}_AOD.root --filetype LHE -n 10 --no_exec
56 import FWCore.ParameterSet.Config as cms
57
58 process = cms.Process('HLT')
59
60 # import of standard configurations
61 process.load('Configuration.StandardSequences.Services_cff')
62 process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi')
63 process.load('FWCore.MessageService.MessageLogger_cfi')
64 process.load('FastSimulation.Configuration.EventContent_cff')
65 process.load('FastSimulation.PileUpProducer.PileUpSimulator_2012_Startup_inTimeOnly_cff')
66 process.load('FastSimulation.Configuration.Geometries_START_cff')
67 process.load('Configuration.StandardSequences.MagneticField_38T_cff')
68 process.load('Configuration.StandardSequences.Generator_cff')
69 process.load('GeneratorInterface.Core.genFilterSummary_cff')
70 process.load('FastSimulation.Configuration.FamosSequences_cff')
71 process.load('IOMC.EventVertexGenerators.VtxSmearedParameters_cfi')
72 process.load('HLTrigger.Configuration.HLT_7E33v2_Famos_cff')
73 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
74
75 process.maxEvents = cms.untracked.PSet(
76 input = cms.untracked.int32(-1)
77 )
78
79 # Input source
80 process.source = cms.Source("LHESource",
81 fileNames = cms.untracked.vstring('file:${LHE_Dir}${Name}.lhe')
82 )
83
84 process.options = cms.untracked.PSet(
85
86 )
87
88 # Production Info
89 process.configurationMetadata = cms.untracked.PSet(
90 version = cms.untracked.string('\$Revision: 1.1 \$'),
91 annotation = cms.untracked.string('runs Z2* Pythia6'),
92 name = cms.untracked.string('\$Source: /local/reps/CMSSW/CMSSW/Configuration/GenProduction/python/EightTeV/Hadronizer_TuneZ2star_8TeV_generic_LHE_pythia_cff.py,v \$')
93 )
94
95 # Output definition
96
97 process.AODSIMoutput = cms.OutputModule("PoolOutputModule",
98 eventAutoFlushCompressedSize = cms.untracked.int32(15728640),
99 outputCommands = process.AODSIMEventContent.outputCommands,
100 fileName = cms.untracked.string('file:${Name}_AOD.root'),
101 dataset = cms.untracked.PSet(
102 filterName = cms.untracked.string(''),
103 dataTier = cms.untracked.string('AODSIM')
104 ),
105 SelectEvents = cms.untracked.PSet(
106 SelectEvents = cms.vstring('generation_step')
107 )
108 )
109
110 # Additional output definition
111
112 # Other statements
113 process.famosSimHits.SimulateCalorimetry = True
114 process.famosSimHits.SimulateTracking = True
115 process.simulation = cms.Sequence(process.simulationWithFamos)
116 process.HLTEndSequence = cms.Sequence(process.reconstructionWithFamos)
117 process.Realistic8TeVCollisionVtxSmearingParameters.type = cms.string("BetaFunc")
118 process.famosSimHits.VertexGenerator = process.Realistic8TeVCollisionVtxSmearingParameters
119 process.famosPileUp.VertexGenerator = process.Realistic8TeVCollisionVtxSmearingParameters
120 # customise the HLT menu for running on MC
121 from HLTrigger.Configuration.customizeHLTforMC import customizeHLTforMC
122 process = customizeHLTforMC(process)
123
124 process.GlobalTag.globaltag = 'START52_V10::All'
125
126 process.generator = cms.EDFilter("Pythia6HadronizerFilter",
127 pythiaHepMCVerbosity = cms.untracked.bool(True),
128 maxEventsToPrint = cms.untracked.int32(0),
129 pythiaPylistVerbosity = cms.untracked.int32(1),
130 comEnergy = cms.double(8000.0),
131 PythiaParameters = cms.PSet(
132 pythiaUESettings = cms.vstring('MSTU(21)=1 ! Check on possible errors during program execution',
133 'MSTJ(22)=2 ! Decay those unstable particles',
134 'PARJ(71)=10 . ! for which ctau 10 mm',
135 'MSTP(33)=0 ! no K factors in hard cross sections',
136 'MSTP(2)=1 ! which order running alphaS',
137 'MSTP(51)=10042 ! structure function chosen (external PDF CTEQ6L1)',
138 'MSTP(52)=2 ! work with LHAPDF',
139 'PARP(82)=1.921 ! pt cutoff for multiparton interactions',
140 'PARP(89)=1800. ! sqrts for which PARP82 is set',
141 'PARP(90)=0.227 ! Multiple interactions: rescaling power',
142 'MSTP(95)=6 ! CR (color reconnection parameters)',
143 'PARP(77)=1.016 ! CR',
144 'PARP(78)=0.538 ! CR',
145 'PARP(80)=0.1 ! Prob. colored parton from BBR',
146 'PARP(83)=0.356 ! Multiple interactions: matter distribution parameter',
147 'PARP(84)=0.651 ! Multiple interactions: matter distribution parameter',
148 'PARP(62)=1.025 ! ISR cutoff',
149 'MSTP(91)=1 ! Gaussian primordial kT',
150 'PARP(93)=10.0 ! primordial kT-max',
151 'MSTP(81)=21 ! multiple parton interactions 1 is Pythia default',
152 'MSTP(82)=4 ! Defines the multi-parton model'),
153 processParameters = cms.vstring('MSEL=0 ! User defined processes',
154 'PMAS(5,1)=4.4 ! b quark mass',
155 'PMAS(6,1)=172.4 ! t quark mass'),
156 parameterSets = cms.vstring('pythiaUESettings',
157 'processParameters')
158 )
159 )
160
161
162 # Path and EndPath definitions
163 process.generation_step = cms.Path(process.pgen_genonly)
164 process.reconstruction = cms.Path(process.reconstructionWithFamos)
165 process.genfiltersummary_step = cms.EndPath(process.genFilterSummary)
166 process.AODSIMoutput_step = cms.EndPath(process.AODSIMoutput)
167
168 # Schedule definition
169 process.schedule = cms.Schedule(process.generation_step,process.genfiltersummary_step)
170 process.schedule.extend(process.HLTSchedule)
171 process.schedule.extend([process.reconstruction,process.AODSIMoutput_step])
172 # filter all path with the production filter sequence
173 for path in process.paths:
174 getattr(process,path)._seq = process.generator * getattr(process,path)._seq
175
176 EOF
177
178 #########################################
179 ########## Crab file
180 #########################################
181 /bin/rm -f crab_${Name}_AOD.cfg
182 cat > crab_${Name}_AOD.cfg << EOF
183 [CRAB]
184 jobtype = cmssw
185 scheduler = condor
186
187 [CMSSW]
188 datasetpath = None
189 generator = lhe
190 pset = Hadronizer_TuneZ2star_8TeV_generic_LHE_pythia_cff_py_GEN_FASTSIM_HLT_PU_${Name}_AOD.py
191 output_file = ${Name}_AOD.root
192 total_number_of_events = 100000
193 events_per_job = 5000
194 get_edm_output = 1
195
196 [USER]
197 return_data = 0
198 copy_data = 1
199 storage_element = cmssrm.fnal.gov
200 storage_path = /srm/managerv2?SFN=11/store/user/algomez/
201 user_remote_dir = ${Name}_AOD
202 dbs_url_for_publication = http://cmsdbsprod.cern.ch:8643/cms_dbs_ph_analysis_02_writer/servlet/DBSServlet
203 ui_working_dir = ${Name}_AOD
204 check_user_remote_dir = 0
205 eMail = alejandro.gomez@cern.ch
206 EOF
207
208 #################################
209 ##### Make it run
210 #################################
211 crab -create -submit -cfg crab_${Name}_AOD.cfg
212
213 cd ${Main_Dir}
214
215 echo Done.
216 date
217 end
218