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
139 if echo $newprj | grep -q dune10kt; then
142 if echo $newprj | grep -q protoDune; then
148 echo "Making ${newprj}.xml"
152 genfcl=`basename $fcl`
156 g4fcl=standard_g4_dune35t.fcl
158 # Detsim (optical + tpc).
160 detsimfcl=standard_detsim_dune35t.fcl
164 # reco2dfcl=standard_reco_uboone_2D.fcl
168 # reco3dfcl=standard_reco_uboone_3D.fcl
171 recofcl=standard_reco_dune35t.fcl
175 mergefcl=standard_ana_dune35t.fcl
177 if echo $newprj | grep -q protonpi0; then
178 g4fcl=standard_g4_dune35t_protonpi0.fcl
181 if echo $newprj | grep -q countermu; then
182 g4fcl=standard_g4_dune35t_countermu.fcl
185 # if echo $newprj | grep -q 'pi0\|gamma'; then
186 # recofcl=reco_dune35t_blur.fcl
187 # mergefcl=ana_energyCalib.fcl
190 # if echo $newprj | grep -q 'piminus'; then
192 # mergefcl=standard_merge_dune35t.fcl
195 if echo $newprj | grep -q milliblock; then
196 detsimfcl=standard_detsim_dune35t_milliblock.fcl
197 recofcl=standard_reco_dune35t_milliblock.fcl
198 mergefcl=standard_ana_dune35t_milliblock.fcl
201 if echo $newprj | grep -q dune10kt; then
202 g4fcl=standard_g4_dune10kt.fcl
203 detsimfcl=standard_detsim_dune10kt.fcl
204 recofcl=standard_reco_dune10kt.fcl
205 mergefcl=standard_ana_dune10kt.fcl
208 if echo $newprj | grep -q 'dune10kt_workspace\|dune10kt_r10deg_workspace'; then
209 g4fcl=standard_g4_dune10kt_workspace.fcl
210 detsimfcl=standard_detsim_dune10kt_workspace.fcl
211 recofcl=standard_reco_dune10kt_workspace.fcl
212 mergefcl=standard_ana_dune10kt_workspace.fcl
213 if echo $newprj | grep -q genie; then
214 recofcl=standard_reco_dune10kt_nu_workspace.fcl
218 if echo $newprj | grep -q dune10kt_3mmpitch_workspace; then
219 g4fcl=standard_g4_dune10kt_3mmpitch_workspace.fcl
220 detsimfcl=standard_detsim_dune10kt_3mmpitch_workspace.fcl
221 recofcl=standard_reco_dune10kt_3mmpitch_workspace.fcl
222 mergefcl=standard_ana_dune10kt_3mmpitch_workspace.fcl
223 if echo $newprj | grep -q genie; then
224 recofcl=standard_reco_dune10kt_3mmpitch_nu_workspace.fcl
228 if echo $newprj | grep -q dune10kt_45deg_workspace; then
229 g4fcl=standard_g4_dune10kt_45deg_workspace.fcl
230 detsimfcl=standard_detsim_dune10kt_45deg_workspace.fcl
231 recofcl=standard_reco_dune10kt_45deg_workspace.fcl
232 mergefcl=standard_ana_dune10kt_45deg_workspace.fcl
233 if echo $newprj | grep -q genie; then
234 recofcl=standard_reco_dune10kt_45deg_nu_workspace.fcl
238 if echo $newprj | grep -q 'dune10kt_1x2x6\|dune10kt_r90deg_1x2x6'; then
239 g4fcl=standard_g4_dune10kt_1x2x6.fcl
240 detsimfcl=standard_detsim_dune10kt_1x2x6.fcl
241 recofcl=standard_reco_dune10kt_1x2x6.fcl
242 mergefcl=standard_ana_dune10kt_1x2x6.fcl
243 if echo $newprj | grep -q genie; then
244 recofcl=standard_reco_dune10kt_nu_1x2x6.fcl
248 if echo $newprj | grep -q dune10kt_3mmpitch_1x2x6; then
249 g4fcl=standard_g4_dune10kt_3mmpitch_1x2x6.fcl
250 detsimfcl=standard_detsim_dune10kt_3mmpitch_1x2x6.fcl
251 recofcl=standard_reco_dune10kt_3mmpitch_1x2x6.fcl
252 mergefcl=standard_ana_dune10kt_3mmpitch_1x2x6.fcl
253 if echo $newprj | grep -q genie; then
254 recofcl=standard_reco_dune10kt_3mmpitch_nu_1x2x6.fcl
258 if echo $newprj | grep -q dune10kt_45deg_1x2x6; then
259 g4fcl=standard_g4_dune10kt_45deg_1x2x6.fcl
260 detsimfcl=standard_detsim_dune10kt_45deg_1x2x6.fcl
261 recofcl=standard_reco_dune10kt_45deg_1x2x6.fcl
262 mergefcl=standard_ana_dune10kt_45deg_1x2x6.fcl
263 if echo $newprj | grep -q genie; then
264 recofcl=standard_reco_dune10kt_45deg_nu_1x2x6.fcl
268 if echo $newprj | grep -q protoDune; then
269 g4fcl=protoDUNE_g4single.fcl
270 detsimfcl=protoDUNE_detsim_single.fcl
271 recofcl=protoDUNE_reco.fcl
272 mergefcl=protoDUNE_ana.fcl
276 # Set number of events per job.
278 if [ $nevjob -eq 0 ]; then
279 if [ $newprj = prodcosmics_dune35t_milliblock ]; then
281 elif [ $newprj = prodcosmics_dune35t_onewindow ]; then
283 elif [ $newprj = AntiMuonCutEvents_LSU_dune35t ]; then
285 elif [ $newprj = prodcosmics_dune35t_milliblock_countermu ]; then
287 elif [ $newprj = prodcosmics_dune35t_milliblock_protonpi0 ]; then
294 # Set number of events.
297 if [ $nev -eq 0 ]; then
298 if [ $newprj = prodcosmics_dune35t_milliblock ]; then
300 elif [ $newprj = prodcosmics_dune35t_onewindow ]; then
302 elif [ $newprj = AntiMuonCutEvents_LSU_dune35t ]; then
304 elif [ $newprj = prodcosmics_dune35t_milliblock_countermu ]; then
306 elif [ $newprj = prodcosmics_dune35t_milliblock_protonpi0 ]; then
308 elif echo $newprj | grep -q dune10kt; then
309 if echo $newprj | grep -q genie; then
314 elif echo $newprj | grep -q protoDune; then
321 # Calculate the number of worker jobs.
323 njob=$(( $nev / $nevjob ))
324 # echo $newprj, $nev, $nevjob, $njob
326 <?xml version="1.0"?>
328 <!-- Production Project -->
331 <!ENTITY release "$rel">
332 <!ENTITY file_type "mc">
333 <!ENTITY run_type "physics">
334 <!ENTITY name "$newprj">
335 <!ENTITY tag "mcc7.0">
338 <project name="&name;">
343 <!-- Project size -->
344 <numevents>$nev</numevents>
346 <!-- Operating System -->
349 <!-- Batch resources -->
350 <resource>DEDICATED,OPPORTUNISTIC</resource>
352 <!-- Larsoft information -->
355 <qual>${qual}:prof</qual>
358 if [ x$local != x ]; then
359 echo " <local>${local}</local>" >> $newxml
364 <!-- dune35t metadata parameters -->
366 <parameter name ="MCName">${newprj}</parameter>
367 <parameter name ="MCDetectorType">${detector}</parameter>
368 <parameter name ="MCGenerators">${generator}</parameter>
370 <!-- Project stages -->
375 if echo $newprj | grep -q AntiMuonCutEvents_LSU_dune35t; then
376 echo " <inputmode>textfile</inputmode>" >> $newxml
377 echo " <inputlist>/dune/data2/users/jti3/txtfiles/AntiMuonCutEvents_LSU_100.txt</inputlist>" >> $newxml
380 <outdir>/pnfs/dune/scratch/${userdir}/&release;/gen/&name;</outdir>
381 <workdir>/dune/app/users/${userbase}/work/&release;/gen/&name;</workdir>
382 <output>${newprj}_\${PROCESS}_%tc_gen.root</output>
383 <numjobs>$njob</numjobs>
384 <datatier>generated</datatier>
385 <defname>&name;_&tag;_gen</defname>
390 <outdir>/pnfs/dune/scratch/${userdir}/&release;/g4/&name;</outdir>
391 <workdir>/dune/app/users/${userbase}/work/&release;/g4/&name;</workdir>
392 <numjobs>$njob</numjobs>
393 <datatier>simulated</datatier>
394 <defname>&name;_&tag;_g4</defname>
398 if [ x$detsimfcl != x ]; then
400 <stage name="detsim">
401 <fcl>$detsimfcl</fcl>
402 <outdir>/pnfs/dune/scratch/${userdir}/&release;/detsim/&name;</outdir>
403 <workdir>/dune/app/users/${userbase}/work/&release;/detsim/&name;</workdir>
404 <numjobs>$njob</numjobs>
405 <datatier>detector-simulated</datatier>
406 <defname>&name;_&tag;_detsim</defname>
414 <outdir>/pnfs/dune/scratch/${userdir}/&release;/reco/&name;</outdir>
415 <workdir>/dune/app/users/${userbase}/work/&release;/reco/&name;</workdir>
416 <numjobs>$njob</numjobs>
417 <datatier>full-reconstructed</datatier>
418 <defname>&name;_&tag;_reco</defname>
421 <stage name="mergeana">
423 <outdir>/pnfs/dune/scratch/${userdir}/&release;/mergeana/&name;</outdir>
424 <output>&name;_\${PROCESS}_%tc_merged.root</output>
425 <workdir>/dune/app/users/${userbase}/work/&release;/mergeana/&name;</workdir>
426 <numjobs>$njob</numjobs>
427 <targetsize>8000000000</targetsize>
428 <datatier>full-reconstructed</datatier>
429 <defname>&name;_&tag;</defname>
433 <filetype>&file_type;</filetype>
436 <runtype>&run_type;</runtype>