2 #----------------------------------------------------------------------
4 # Name: make_xml_mcc2.0.sh
6 # Purpose: Make xml files for mcc 2.0. This script loops over all
7 # generator-level fcl files in the source area of the currently
8 # setup version of lbnecode (that is, under
9 # $LBNECODE_DIR/source/fcl/lbne35t/gen), and makes a corresponding xml
10 # project file in the local directory.
14 # make_xml_mcc2.0.sh [-h|--help] [-r <release>] [-u|--user <user>] [--local <dir|tar>] [--nev <n>] [--nevjob <n>] [--nevgjob <n>]
18 # -h|--help - Print help.
19 # -r <release> - Use the specified larsoft/lbnecode release.
20 # -u|--user <user> - Use users/<user> as working and output directories
21 # (default is to use lbnepro).
22 # --local <dir|tar> - Specify larsoft local directory or tarball (xml
23 # tag <local>...</local>).
24 # --nev <n> - Specify number of events for all samples. Otherwise
25 # use hardwired defaults.
26 # --nevjob <n> - Specify the default number of events per job.
27 # --nevgjob <n> - Specify the maximum number of events per gen/g4 job.
29 #----------------------------------------------------------------------
41 while [ $# -gt 0 ]; do
47 echo "Usage: make_xml_mcc5.0.sh [-h|--help] [-r <release>] [-u|--user <user>] [--local <dir|tar>] [--nev <n>] [--nevjob <n>] [--nevgjob <n>]"
79 # Total number of events.
88 # Number of events per job.
97 # Number of events per gen/g4 job.
100 if [ $# -gt 1 ]; then
113 ver=`echo $rel | cut -c2-3`
114 if [ $ver -gt 2 ]; then
118 # Delete existing xml files.
122 find $LBNECODE_DIR/source/fcl/lbne35t/gen -name \*.fcl | while read fcl
124 if ! echo $fcl | grep -q common; then
125 newprj=`basename $fcl .fcl`
129 if echo $newprj | grep -q cosmics; then
132 if echo $newprj | grep -q AntiMuonCutEvents; then
133 generator=TextFileGen
138 echo "Making ${newprj}.xml"
142 genfcl=`basename $fcl`
146 g4fcl=standard_g4_lbne35t.fcl
148 # Detsim (optical + tpc).
150 detsimfcl=standard_detsim_lbne35t.fcl
151 if echo $newprj | grep -q milliblock; then
152 detsimfcl=standard_detsim_lbne35t_milliblock.fcl
156 # reco2dfcl=standard_reco_uboone_2D.fcl
160 # reco3dfcl=standard_reco_uboone_3D.fcl
163 recofcl=standard_reco_lbne35t.fcl
164 if echo $newprj | grep -q milliblock; then
165 recofcl=standard_reco_lbne35t_milliblock.fcl
170 mergefcl=standard_ana_lbne35t.fcl
172 # Set number of events per job.
173 if [ $nevjob -eq 0 ]; then
174 if [ $newprj = prodcosmics_lbne35t_milliblock ]; then
176 elif [ $newprj = prodcosmics_lbne35t_onewindow ]; then
178 elif [ $newprj = AntiMuonCutEvents_LSU_lbne35t ]; then
184 # Set number of gen/g4 events per job.
187 if [ $nevgjob -eq 0 ]; then
188 if echo $newprj | grep -q dirt; then
189 if echo $newprj | grep -q cosmic; then
199 # Set number of events.
202 if [ $nev -eq 0 ]; then
203 if [ $newprj = prodcosmics_lbne35t_milliblock ]; then
205 elif [ $newprj = prodcosmics_lbne35t_onewindow ]; then
207 elif [ $newprj = AntiMuonCutEvents_LSU_lbne35t ]; then
213 nev=$(( $nev * $filt ))
215 # Calculate the number of worker jobs.
217 njob1=$(( $nev / $nevgjob )) # Pre-filter (gen, g4)
218 njob2=$(( $nev / $nevjob / $filt )) # Post-filter (detsim and later)
219 if [ $njob1 -lt $njob2 ]; then
224 <?xml version="1.0"?>
226 <!-- Production Project -->
229 <!ENTITY release "$rel">
230 <!ENTITY file_type "mc">
231 <!ENTITY run_type "physics">
232 <!ENTITY name "$newprj">
233 <!ENTITY tag "mcc2.0">
236 <project name="&name;">
241 <!-- Project size -->
242 <numevents>$nev</numevents>
244 <!-- Operating System -->
247 <!-- Batch resources -->
248 <resource>DEDICATED,OPPORTUNISTIC</resource>
250 <!-- Larsoft information -->
253 <qual>${qual}:prof</qual>
256 if [ x$local != x ]; then
257 echo " <local>${local}</local>" >> $newxml
262 <!-- lbne35t metadata parameters -->
264 <parameter name ="MCName">${newprj}</parameter>
265 <parameter name ="MCDetectorType">35t</parameter>
266 <parameter name ="MCGenerators">${generator}</parameter>
268 <!-- Project stages -->
273 if echo $newprj | grep -q AntiMuonCutEvents_LSU_lbne35t; then
274 echo " <inputmode>textfile</inputmode>" >> $newxml
275 echo " <inputlist>/lbne/data2/users/jti3/txtfiles/AntiMuonCutEvents_LSU_100.txt</inputlist>" >> $newxml
278 <outdir>/pnfs/lbne/scratch/${userdir}/&release;/gen/&name;</outdir>
279 <workdir>/lbne/app/users/${userbase}/&release;/gen/&name;</workdir>
280 <logdir>/lbne/data/${userdir}/log/&release;/gen/&name;</logdir>
281 <output>${newprj}_\${PROCESS}_%tc_gen.root</output>
282 <numjobs>$njob1</numjobs>
283 <datatier>generated</datatier>
284 <defname>&name;_&tag;_gen</defname>
289 <outdir>/pnfs/lbne/scratch/${userdir}/&release;/g4/&name;</outdir>
290 <workdir>/lbne/app/users/${userbase}/&release;/g4/&name;</workdir>
291 <logdir>/lbne/data/${userdir}/log/&release;/g4/&name;</logdir>
292 <numjobs>$njob1</numjobs>
293 <datatier>simulated</datatier>
294 <defname>&name;_&tag;_g4</defname>
298 if [ x$detsimfcl != x ]; then
300 <stage name="detsim">
301 <fcl>$detsimfcl</fcl>
302 <outdir>/pnfs/lbne/scratch/${userdir}/&release;/detsim/&name;</outdir>
303 <workdir>/lbne/app/users/${userbase}/&release;/detsim/&name;</workdir>
304 <logdir>/lbne/data/${userdir}/log/&release;/detsim/&name;</logdir>
305 <numjobs>$njob2</numjobs>
306 <datatier>detector-simulated</datatier>
307 <defname>&name;_&tag;_detsim</defname>
312 if [ x$optsimfcl != x ]; then
314 <stage name="optsim">
315 <fcl>$optsimfcl</fcl>
316 <outdir>/pnfs/lbne/scratch/${userdir}/&release;/optsim/&name;</outdir>
317 <workdir>/lbne/app/users/${userbase}/&release;/optsim/&name;</workdir>
318 <numjobs>$njob2</numjobs>
319 <datatier>optical-simulated</datatier>
320 <defname>&name;_&tag;_optsim</defname>
325 if [ x$tpcsimfcl != x ]; then
327 <stage name="tpcsim">
328 <fcl>$tpcsimfcl</fcl>
329 <outdir>/pnfs/lbne/scratch/${userdir}/&release;/tpcsim/&name;</outdir>
330 <workdir>/lbne/app/users/${userbase}/&release;/tpcsim/&name;</workdir>
331 <numjobs>$njob2</numjobs>
332 <datatier>tpc-simulated</datatier>
333 <defname>&name;_&tag;_tpcsim</defname>
341 <outdir>/pnfs/lbne/scratch/${userdir}/&release;/reco/&name;</outdir>
342 <workdir>/lbne/app/users/${userbase}/&release;/reco/&name;</workdir>
343 <logdir>/lbne/data/${userdir}/log/&release;/reco/&name;</logdir>
344 <numjobs>$njob2</numjobs>
345 <datatier>full-reconstructed</datatier>
346 <defname>&name;_&tag;_reco</defname>
349 <stage name="mergeana">
351 <outdir>/pnfs/lbne/scratch/${userdir}/&release;/mergeana/&name;</outdir>
352 <workdir>/lbne/app/users/${userbase}/&release;/mergeana/&name;</workdir>
353 <logdir>/lbne/data/${userdir}/log/&release;/mergeana/&name;</logdir>
354 <numjobs>$njob2</numjobs>
355 <targetsize>8000000000</targetsize>
356 <datatier>full-reconstructed</datatier>
357 <defname>&name;_&tag;</defname>
361 <filetype>&file_type;</filetype>
364 <runtype>&run_type;</runtype>