2 #----------------------------------------------------------------------
4 # Name: make_xml_mcc.sh
6 # Purpose: Make xml files for mcc. This script loops over all
7 # generator-level fcl files in the source area of the currently
8 # setup version of dunetpc (that is, under
9 # $DUNETPC_DIR/source/fcl/dune35t/gen), and makes a corresponding xml
10 # project file in the local directory.
14 # make_xml_mcc4.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/dunetpc 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_mcc.sh [-h|--help] [-r <release>] [-u|--user <user>] [--local <dir|tar>] [--nev <n>] [--nevjob <n>]"
79 # Total number of events.
88 # Number of events per job.
104 ver=`echo $rel | cut -c2-3`
105 if [ $ver -gt 2 ]; then
109 # Delete existing xml files.
113 find $DUNETPC_DIR/source/fcl/dune35t/gen $DUNETPC_DIR/source/fcl/dunefd/gen $DUNETPC_DIR/source/fcl/protodune/gen -name \*.fcl | while read fcl
115 if ! echo $fcl | grep -q 'common\|protoDUNE_gensingle'; then
116 newprj=`basename $fcl .fcl`
119 if echo $newprj | grep -q cosmics; then
122 if echo $newprj | grep -q AntiMuonCutEvents; then
123 generator=TextFileGen
125 if echo $newprj | grep -q genie; then
128 if echo $newprj | grep -q MUSUN; then
131 if echo $newprj | grep -q supernova; then
132 generator=SNNueAr40CCGen
134 if echo $newprj | grep -q prodndk; then
137 if echo $newprj | grep -q prodmarley; then
140 if echo $newprj | grep -q prodbackground_ar39; then
145 if echo $newprj | grep -q dune10kt; then
148 if echo $newprj | grep -q protoDune; then
154 echo "Making ${newprj}.xml"
158 genfcl=`basename $fcl`
162 g4fcl=standard_g4_dune35t.fcl
164 # Detsim (optical + tpc).
166 detsimfcl=standard_detsim_dune35t.fcl
170 # reco2dfcl=standard_reco_uboone_2D.fcl
174 # reco3dfcl=standard_reco_uboone_3D.fcl
177 recofcl=standard_reco_dune35t.fcl
181 mergefcl=standard_ana_dune35t.fcl
183 if echo $newprj | grep -q protonpi0; then
184 g4fcl=standard_g4_dune35t_protonpi0.fcl
187 if echo $newprj | grep -q countermu; then
188 g4fcl=standard_g4_dune35t_countermu.fcl
191 # if echo $newprj | grep -q 'pi0\|gamma'; then
192 # recofcl=reco_dune35t_blur.fcl
193 # mergefcl=ana_energyCalib.fcl
196 # if echo $newprj | grep -q 'piminus'; then
198 # mergefcl=standard_merge_dune35t.fcl
201 if echo $newprj | grep -q milliblock; then
202 detsimfcl=standard_detsim_dune35t_milliblock.fcl
203 recofcl=standard_reco_dune35t_milliblock.fcl
204 mergefcl=standard_ana_dune35t_milliblock.fcl
207 if echo $newprj | grep -q dune10kt; then
208 g4fcl=standard_g4_dune10kt.fcl
209 detsimfcl=standard_detsim_dune10kt.fcl
210 recofcl=standard_reco_dune10kt.fcl
211 mergefcl=standard_ana_dune10kt.fcl
214 if echo $newprj | grep -q 'dune10kt_workspace\|dune10kt_r10deg_workspace'; then
215 g4fcl=standard_g4_dune10kt_workspace.fcl
216 detsimfcl=standard_detsim_dune10kt_workspace.fcl
217 recofcl=standard_reco_dune10kt_workspace.fcl
218 mergefcl=standard_ana_dune10kt_workspace.fcl
219 if echo $newprj | grep -q genie; then
220 recofcl=standard_reco_dune10kt_nu_workspace.fcl
224 if echo $newprj | grep -q dune10kt_3mmpitch_workspace; then
225 g4fcl=standard_g4_dune10kt_3mmpitch_workspace.fcl
226 detsimfcl=standard_detsim_dune10kt_3mmpitch_workspace.fcl
227 recofcl=standard_reco_dune10kt_3mmpitch_workspace.fcl
228 mergefcl=standard_ana_dune10kt_3mmpitch_workspace.fcl
229 if echo $newprj | grep -q genie; then
230 recofcl=standard_reco_dune10kt_3mmpitch_nu_workspace.fcl
234 if echo $newprj | grep -q dune10kt_45deg_workspace; then
235 g4fcl=standard_g4_dune10kt_45deg_workspace.fcl
236 detsimfcl=standard_detsim_dune10kt_45deg_workspace.fcl
237 recofcl=standard_reco_dune10kt_45deg_workspace.fcl
238 mergefcl=standard_ana_dune10kt_45deg_workspace.fcl
239 if echo $newprj | grep -q genie; then
240 recofcl=standard_reco_dune10kt_45deg_nu_workspace.fcl
244 if echo $newprj | grep -q 'dune10kt_1x2x6\|dune10kt_r90deg_1x2x6'; then
245 g4fcl=standard_g4_dune10kt_1x2x6.fcl
246 detsimfcl=standard_detsim_dune10kt_1x2x6.fcl
247 recofcl=standard_reco_dune10kt_1x2x6.fcl
248 mergefcl=standard_ana_dune10kt_1x2x6.fcl
249 if echo $newprj | grep -q genie; then
250 recofcl=standard_reco_dune10kt_nu_1x2x6.fcl
252 if echo $newprj | grep -q 'supernova\|marley'; then
253 g4fcl=supernova_g4_dune10kt_1x2x6.fcl
257 if echo $newprj | grep -q dune10kt_3mmpitch_1x2x6; then
258 g4fcl=standard_g4_dune10kt_3mmpitch_1x2x6.fcl
259 detsimfcl=standard_detsim_dune10kt_3mmpitch_1x2x6.fcl
260 recofcl=standard_reco_dune10kt_3mmpitch_1x2x6.fcl
261 mergefcl=standard_ana_dune10kt_3mmpitch_1x2x6.fcl
262 if echo $newprj | grep -q genie; then
263 recofcl=standard_reco_dune10kt_3mmpitch_nu_1x2x6.fcl
265 if echo $newprj | grep -q 'supernova\|marley'; then
266 g4fcl=supernova_g4_dune10kt_3mmpitch_1x2x6.fcl
270 if echo $newprj | grep -q dune10kt_45deg_1x2x6; then
271 g4fcl=standard_g4_dune10kt_45deg_1x2x6.fcl
272 detsimfcl=standard_detsim_dune10kt_45deg_1x2x6.fcl
273 recofcl=standard_reco_dune10kt_45deg_1x2x6.fcl
274 mergefcl=standard_ana_dune10kt_45deg_1x2x6.fcl
275 if echo $newprj | grep -q genie; then
276 recofcl=standard_reco_dune10kt_45deg_nu_1x2x6.fcl
278 if echo $newprj | grep -q 'supernova\|marley'; then
279 g4fcl=supernova_g4_dune10kt_45deg_1x2x6.fcl
283 if echo $newprj | grep -q protoDune; then
284 g4fcl=protoDUNE_g4single.fcl
285 detsimfcl=protoDUNE_detsim_single.fcl
286 recofcl=protoDUNE_reco.fcl
287 mergefcl=protoDUNE_ana.fcl
290 if echo $newprj | grep -q dphase; then
291 g4fcl=standard_g4_dune10kt_dp.fcl
292 detsimfcl=standard_detsim_dune10kt_dp.fcl
293 recofcl=standard_reco_dune10ktdphase.fcl
294 mergefcl=standard_ana_dune10kt_dp.fcl
299 # Set number of events per job.
301 if [ $nevjob -eq 0 ]; then
302 if [ $newprj = prodcosmics_dune35t_milliblock ]; then
304 elif [ $newprj = prodcosmics_dune35t_onewindow ]; then
306 elif [ $newprj = AntiMuonCutEvents_LSU_dune35t ]; then
308 elif [ $newprj = prodcosmics_dune35t_milliblock_countermu ]; then
310 elif [ $newprj = prodcosmics_dune35t_milliblock_protonpi0 ]; then
317 # Set number of events.
320 if [ $nev -eq 0 ]; then
321 if [ $newprj = prodcosmics_dune35t_milliblock ]; then
323 elif [ $newprj = prodcosmics_dune35t_onewindow ]; then
325 elif [ $newprj = AntiMuonCutEvents_LSU_dune35t ]; then
327 elif [ $newprj = prodcosmics_dune35t_milliblock_countermu ]; then
329 elif [ $newprj = prodcosmics_dune35t_milliblock_protonpi0 ]; then
331 elif echo $newprj | grep -q dune10kt; then
332 if echo $newprj | grep -q genie; then
334 if echo $newprj | grep -q dphase; then
340 elif echo $newprj | grep -q protoDune; then
347 # Calculate the number of worker jobs.
349 njob=$(( $nev / $nevjob ))
350 # echo $newprj, $nev, $nevjob, $njob
352 <?xml version="1.0"?>
354 <!-- Production Project -->
357 <!ENTITY release "$rel">
358 <!ENTITY file_type "mc">
359 <!ENTITY run_type "physics">
360 <!ENTITY name "$newprj">
361 <!ENTITY tag "mcc7.2">
364 <project name="&name;">
369 <!-- Project size -->
370 <numevents>$nev</numevents>
372 <!-- Operating System -->
375 <!-- Batch resources -->
376 <resource>DEDICATED,OPPORTUNISTIC</resource>
378 <!-- Larsoft information -->
381 <qual>${qual}:prof</qual>
384 if [ x$local != x ]; then
385 echo " <local>${local}</local>" >> $newxml
390 <!-- dune35t metadata parameters -->
392 <parameter name ="MCName">${newprj}</parameter>
393 <parameter name ="MCDetectorType">${detector}</parameter>
394 <parameter name ="MCGenerators">${generator}</parameter>
396 <!-- Project stages -->
401 if echo $newprj | grep -q AntiMuonCutEvents_LSU_dune35t; then
402 echo " <inputmode>textfile</inputmode>" >> $newxml
403 echo " <inputlist>/dune/data2/users/jti3/txtfiles/AntiMuonCutEvents_LSU_100.txt</inputlist>" >> $newxml
406 <outdir>/pnfs/dune/scratch/${userdir}/&release;/gen/&name;</outdir>
407 <workdir>/pnfs/dune/scratch/${userdir}/work/&release;/gen/&name;</workdir>
408 <output>${newprj}_\${PROCESS}_%tc_gen.root</output>
409 <numjobs>$njob</numjobs>
410 <datatier>generated</datatier>
411 <defname>&name;_&tag;_gen</defname>
416 <outdir>/pnfs/dune/scratch/${userdir}/&release;/g4/&name;</outdir>
417 <workdir>/pnfs/dune/scratch/${userdir}/work/&release;/g4/&name;</workdir>
418 <numjobs>$njob</numjobs>
419 <datatier>simulated</datatier>
420 <defname>&name;_&tag;_g4</defname>
424 if [ x$detsimfcl != x ]; then
426 <stage name="detsim">
427 <fcl>$detsimfcl</fcl>
428 <outdir>/pnfs/dune/scratch/${userdir}/&release;/detsim/&name;</outdir>
429 <workdir>/pnfs/dune/scratch/${userdir}/work/&release;/detsim/&name;</workdir>
430 <numjobs>$njob</numjobs>
431 <datatier>detector-simulated</datatier>
432 <defname>&name;_&tag;_detsim</defname>
440 <outdir>/pnfs/dune/scratch/${userdir}/&release;/reco/&name;</outdir>
441 <workdir>/pnfs/dune/scratch/${userdir}/work/&release;/reco/&name;</workdir>
442 <numjobs>$njob</numjobs>
443 <datatier>full-reconstructed</datatier>
444 <defname>&name;_&tag;_reco</defname>
447 <stage name="mergeana">
449 <outdir>/pnfs/dune/scratch/${userdir}/&release;/mergeana/&name;</outdir>
450 <output>&name;_\${PROCESS}_%tc_merged.root</output>
451 <workdir>/pnfs/dune/scratch/${userdir}/work/&release;/mergeana/&name;</workdir>
452 <numjobs>$njob</numjobs>
453 <targetsize>8000000000</targetsize>
454 <datatier>full-reconstructed</datatier>
455 <defname>&name;_&tag;</defname>
459 <filetype>&file_type;</filetype>
462 <runtype>&run_type;</runtype>