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>] [--nevgjob <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
136 if echo $newprj | grep -q dune10kt; then
139 if echo $newprj | grep -q protoDune; then
145 echo "Making ${newprj}.xml"
149 genfcl=`basename $fcl`
153 g4fcl=standard_g4_dune35t.fcl
155 # Detsim (optical + tpc).
157 detsimfcl=standard_detsim_dune35t.fcl
161 # reco2dfcl=standard_reco_uboone_2D.fcl
165 # reco3dfcl=standard_reco_uboone_3D.fcl
168 recofcl=standard_reco_dune35t.fcl
172 mergefcl=standard_ana_dune35t.fcl
174 if echo $newprj | grep -q protonpi0; then
175 g4fcl=standard_g4_dune35t_protonpi0.fcl
178 if echo $newprj | grep -q countermu; then
179 g4fcl=standard_g4_dune35t_countermu.fcl
182 # if echo $newprj | grep -q 'pi0\|gamma'; then
183 # recofcl=reco_dune35t_blur.fcl
184 # mergefcl=ana_energyCalib.fcl
187 # if echo $newprj | grep -q 'piminus'; then
189 # mergefcl=standard_merge_dune35t.fcl
192 if echo $newprj | grep -q milliblock; then
193 detsimfcl=standard_detsim_dune35t_milliblock.fcl
194 recofcl=standard_reco_dune35t_milliblock.fcl
195 mergefcl=standard_ana_dune35t_milliblock.fcl
198 if echo $newprj | grep -q dune10kt; then
199 g4fcl=standard_g4_dune10kt.fcl
200 detsimfcl=standard_detsim_dune10kt.fcl
201 recofcl=standard_reco_dune10kt.fcl
202 mergefcl=standard_ana_dune10kt.fcl
205 if echo $newprj | grep -q 'dune10kt_workspace\|dune10kt_r10deg_workspace'; then
206 g4fcl=standard_g4_dune10kt_workspace.fcl
207 detsimfcl=standard_detsim_dune10kt_workspace.fcl
208 recofcl=standard_reco_dune10kt_workspace.fcl
209 mergefcl=standard_ana_dune10kt_workspace.fcl
210 if echo $newprj | grep -q genie; then
211 recofcl=standard_reco_dune10kt_nu_workspace.fcl
215 if echo $newprj | grep -q dune10kt_3mmpitch_workspace; then
216 g4fcl=standard_g4_dune10kt_3mmpitch_workspace.fcl
217 detsimfcl=standard_detsim_dune10kt_3mmpitch_workspace.fcl
218 recofcl=standard_reco_dune10kt_3mmpitch_workspace.fcl
219 mergefcl=standard_ana_dune10kt_3mmpitch_workspace.fcl
220 if echo $newprj | grep -q genie; then
221 recofcl=standard_reco_dune10kt_3mmpitch_nu_workspace.fcl
225 if echo $newprj | grep -q dune10kt_45deg_workspace; then
226 g4fcl=standard_g4_dune10kt_45deg_workspace.fcl
227 detsimfcl=standard_detsim_dune10kt_45deg_workspace.fcl
228 recofcl=standard_reco_dune10kt_45deg_workspace.fcl
229 mergefcl=standard_ana_dune10kt_45deg_workspace.fcl
230 if echo $newprj | grep -q genie; then
231 recofcl=standard_reco_dune10kt_45deg_nu_workspace.fcl
235 if echo $newprj | grep -q 'dune10kt_1x2x6\|dune10kt_r90deg_1x2x6'; then
236 g4fcl=standard_g4_dune10kt_1x2x6.fcl
237 detsimfcl=standard_detsim_dune10kt_1x2x6.fcl
238 recofcl=standard_reco_dune10kt_1x2x6.fcl
239 mergefcl=standard_ana_dune10kt_1x2x6.fcl
240 if echo $newprj | grep -q genie; then
241 recofcl=standard_reco_dune10kt_nu_1x2x6.fcl
245 if echo $newprj | grep -q dune10kt_3mmpitch_1x2x6; then
246 g4fcl=standard_g4_dune10kt_3mmpitch_1x2x6.fcl
247 detsimfcl=standard_detsim_dune10kt_3mmpitch_1x2x6.fcl
248 recofcl=standard_reco_dune10kt_3mmpitch_1x2x6.fcl
249 mergefcl=standard_ana_dune10kt_3mmpitch_1x2x6.fcl
250 if echo $newprj | grep -q genie; then
251 recofcl=standard_reco_dune10kt_3mmpitch_nu_1x2x6.fcl
255 if echo $newprj | grep -q dune10kt_45deg_1x2x6; then
256 g4fcl=standard_g4_dune10kt_45deg_1x2x6.fcl
257 detsimfcl=standard_detsim_dune10kt_45deg_1x2x6.fcl
258 recofcl=standard_reco_dune10kt_45deg_1x2x6.fcl
259 mergefcl=standard_ana_dune10kt_45deg_1x2x6.fcl
260 if echo $newprj | grep -q genie; then
261 recofcl=standard_reco_dune10kt_45deg_nu_1x2x6.fcl
265 if echo $newprj | grep -q protoDune; then
266 g4fcl=protoDUNE_g4single.fcl
267 detsimfcl=protoDUNE_detsim_single.fcl
268 recofcl=protoDUNE_reco.fcl
269 mergefcl=protoDUNE_ana.fcl
273 # Set number of events per job.
275 if [ $nevjob -eq 0 ]; then
276 if [ $newprj = prodcosmics_dune35t_milliblock ]; then
278 elif [ $newprj = prodcosmics_dune35t_onewindow ]; then
280 elif [ $newprj = AntiMuonCutEvents_LSU_dune35t ]; then
282 elif [ $newprj = prodcosmics_dune35t_milliblock_countermu ]; then
284 elif [ $newprj = prodcosmics_dune35t_milliblock_protonpi0 ]; then
291 # Set number of events.
294 if [ $nev -eq 0 ]; then
295 if [ $newprj = prodcosmics_dune35t_milliblock ]; then
297 elif [ $newprj = prodcosmics_dune35t_onewindow ]; then
299 elif [ $newprj = AntiMuonCutEvents_LSU_dune35t ]; then
301 elif [ $newprj = prodcosmics_dune35t_milliblock_countermu ]; then
303 elif [ $newprj = prodcosmics_dune35t_milliblock_protonpi0 ]; then
305 elif echo $newprj | grep -q dune10kt; then
306 if echo $newprj | grep -q genie; then
311 elif echo $newprj | grep -q protoDune; then
318 # Calculate the number of worker jobs.
320 njob=$(( $nev / $nevjob ))
321 # echo $newprj, $nev, $nevjob, $njob
323 <?xml version="1.0"?>
325 <!-- Production Project -->
328 <!ENTITY release "$rel">
329 <!ENTITY file_type "mc">
330 <!ENTITY run_type "physics">
331 <!ENTITY name "$newprj">
332 <!ENTITY tag "mcc6.0">
335 <project name="&name;">
340 <!-- Project size -->
341 <numevents>$nev</numevents>
343 <!-- Operating System -->
346 <!-- Batch resources -->
347 <resource>DEDICATED,OPPORTUNISTIC</resource>
349 <!-- Larsoft information -->
352 <qual>${qual}:prof</qual>
355 if [ x$local != x ]; then
356 echo " <local>${local}</local>" >> $newxml
361 <!-- dune35t metadata parameters -->
363 <parameter name ="MCName">${newprj}</parameter>
364 <parameter name ="MCDetectorType">${detector}</parameter>
365 <parameter name ="MCGenerators">${generator}</parameter>
367 <!-- Project stages -->
372 if echo $newprj | grep -q AntiMuonCutEvents_LSU_dune35t; then
373 echo " <inputmode>textfile</inputmode>" >> $newxml
374 echo " <inputlist>/dune/data2/users/jti3/txtfiles/AntiMuonCutEvents_LSU_100.txt</inputlist>" >> $newxml
377 <outdir>/pnfs/dune/persistent/${userdir}/&release;/gen/&name;</outdir>
378 <workdir>/dune/app/users/${userbase}/work/&release;/gen/&name;</workdir>
379 <output>${newprj}_\${PROCESS}_%tc_gen.root</output>
380 <numjobs>$njob</numjobs>
381 <datatier>generated</datatier>
382 <defname>&name;_&tag;_gen</defname>
387 <outdir>/pnfs/dune/persistent/${userdir}/&release;/g4/&name;</outdir>
388 <workdir>/dune/app/users/${userbase}/work/&release;/g4/&name;</workdir>
389 <numjobs>$njob</numjobs>
390 <datatier>simulated</datatier>
391 <defname>&name;_&tag;_g4</defname>
395 if [ x$detsimfcl != x ]; then
397 <stage name="detsim">
398 <fcl>$detsimfcl</fcl>
399 <outdir>/pnfs/dune/persistent/${userdir}/&release;/detsim/&name;</outdir>
400 <workdir>/dune/app/users/${userbase}/work/&release;/detsim/&name;</workdir>
401 <numjobs>$njob</numjobs>
402 <datatier>detector-simulated</datatier>
403 <defname>&name;_&tag;_detsim</defname>
411 <outdir>/pnfs/dune/persistent/${userdir}/&release;/reco/&name;</outdir>
412 <workdir>/dune/app/users/${userbase}/work/&release;/reco/&name;</workdir>
413 <numjobs>$njob</numjobs>
414 <datatier>full-reconstructed</datatier>
415 <defname>&name;_&tag;_reco</defname>
418 <stage name="mergeana">
420 <outdir>/pnfs/dune/persistent/${userdir}/&release;/mergeana/&name;</outdir>
421 <output>&name;_\${PROCESS}_%tc_merged.root</output>
422 <workdir>/dune/app/users/${userbase}/work/&release;/mergeana/&name;</workdir>
423 <numjobs>$njob</numjobs>
424 <targetsize>8000000000</targetsize>
425 <datatier>full-reconstructed</datatier>
426 <defname>&name;_&tag;</defname>
430 <filetype>&file_type;</filetype>
433 <runtype>&run_type;</runtype>