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 -name \*.fcl | while read fcl
115 if ! echo $fcl | grep -q common; 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
141 echo "Making ${newprj}.xml"
145 genfcl=`basename $fcl`
149 g4fcl=standard_g4_dune35t.fcl
151 # Detsim (optical + tpc).
153 detsimfcl=standard_detsim_dune35t.fcl
157 # reco2dfcl=standard_reco_uboone_2D.fcl
161 # reco3dfcl=standard_reco_uboone_3D.fcl
164 recofcl=standard_reco_dune35t.fcl
168 mergefcl=standard_ana_dune35t.fcl
170 if echo $newprj | grep -q protonpi0; then
171 g4fcl=standard_g4_dune35t_protonpi0.fcl
174 if echo $newprj | grep -q countermu; then
175 g4fcl=standard_g4_dune35t_countermu.fcl
178 # if echo $newprj | grep -q 'pi0\|gamma'; then
179 # recofcl=reco_dune35t_blur.fcl
180 # mergefcl=ana_energyCalib.fcl
183 # if echo $newprj | grep -q 'piminus'; then
185 # mergefcl=standard_merge_dune35t.fcl
188 if echo $newprj | grep -q milliblock; then
189 detsimfcl=standard_detsim_dune35t_milliblock.fcl
190 recofcl=standard_reco_dune35t_milliblock.fcl
191 mergefcl=standard_ana_dune35t_milliblock.fcl
194 if echo $newprj | grep -q dune10kt; then
195 g4fcl=standard_g4_dune10kt.fcl
196 detsimfcl=standard_detsim_dune10kt.fcl
197 recofcl=standard_reco_dune10kt.fcl
198 mergefcl=standard_ana_dune10kt.fcl
201 if echo $newprj | grep -q 'dune10kt_workspace\|dune10kt_r10deg_workspace'; then
202 g4fcl=standard_g4_dune10kt_workspace.fcl
203 detsimfcl=standard_detsim_dune10kt_workspace.fcl
204 recofcl=standard_reco_dune10kt_workspace.fcl
205 mergefcl=standard_ana_dune10kt_workspace.fcl
206 if echo $newprj | grep -q genie; then
207 recofcl=standard_reco_dune10kt_nu_workspace.fcl
211 if echo $newprj | grep -q dune10kt_3mmpitch_workspace; then
212 g4fcl=standard_g4_dune10kt_3mmpitch_workspace.fcl
213 detsimfcl=standard_detsim_dune10kt_3mmpitch_workspace.fcl
214 recofcl=standard_reco_dune10kt_3mmpitch_workspace.fcl
215 mergefcl=standard_ana_dune10kt_3mmpitch_workspace.fcl
216 if echo $newprj | grep -q genie; then
217 recofcl=standard_reco_dune10kt_3mmpitch_nu_workspace.fcl
221 if echo $newprj | grep -q dune10kt_45deg_workspace; then
222 g4fcl=standard_g4_dune10kt_45deg_workspace.fcl
223 detsimfcl=standard_detsim_dune10kt_45deg_workspace.fcl
224 recofcl=standard_reco_dune10kt_45deg_workspace.fcl
225 mergefcl=standard_ana_dune10kt_45deg_workspace.fcl
226 if echo $newprj | grep -q genie; then
227 recofcl=standard_reco_dune10kt_45deg_nu_workspace.fcl
232 # Set number of events per job.
234 if [ $nevjob -eq 0 ]; then
235 if [ $newprj = prodcosmics_dune35t_milliblock ]; then
237 elif [ $newprj = prodcosmics_dune35t_onewindow ]; then
239 elif [ $newprj = AntiMuonCutEvents_LSU_dune35t ]; then
241 elif [ $newprj = prodcosmics_dune35t_milliblock_countermu ]; then
243 elif [ $newprj = prodcosmics_dune35t_milliblock_protonpi0 ]; then
250 # Set number of events.
253 if [ $nev -eq 0 ]; then
254 if [ $newprj = prodcosmics_dune35t_milliblock ]; then
256 elif [ $newprj = prodcosmics_dune35t_onewindow ]; then
258 elif [ $newprj = AntiMuonCutEvents_LSU_dune35t ]; then
260 elif [ $newprj = prodcosmics_dune35t_milliblock_countermu ]; then
262 elif [ $newprj = prodcosmics_dune35t_milliblock_protonpi0 ]; then
264 elif echo $newprj | grep -q dune10kt; then
265 if echo $newprj | grep -q _nu_; then
275 # Calculate the number of worker jobs.
277 njob=$(( $nev / $nevjob ))
278 # echo $newprj, $nev, $nevjob, $njob
280 <?xml version="1.0"?>
282 <!-- Production Project -->
285 <!ENTITY release "$rel">
286 <!ENTITY file_type "mc">
287 <!ENTITY run_type "physics">
288 <!ENTITY name "$newprj">
289 <!ENTITY tag "mcc5.0">
292 <project name="&name;">
297 <!-- Project size -->
298 <numevents>$nev</numevents>
300 <!-- Operating System -->
303 <!-- Batch resources -->
304 <resource>DEDICATED,OPPORTUNISTIC</resource>
306 <!-- Larsoft information -->
309 <qual>${qual}:prof</qual>
312 if [ x$local != x ]; then
313 echo " <local>${local}</local>" >> $newxml
318 <!-- dune35t metadata parameters -->
320 <parameter name ="MCName">${newprj}</parameter>
321 <parameter name ="MCDetectorType">${detector}</parameter>
322 <parameter name ="MCGenerators">${generator}</parameter>
324 <!-- Project stages -->
329 if echo $newprj | grep -q AntiMuonCutEvents_LSU_dune35t; then
330 echo " <inputmode>textfile</inputmode>" >> $newxml
331 echo " <inputlist>/dune/data2/users/jti3/txtfiles/AntiMuonCutEvents_LSU_100.txt</inputlist>" >> $newxml
334 <outdir>/pnfs/lbne/persistent/${userdir}/&release;/gen/&name;</outdir>
335 <workdir>/lbne/app/users/${userbase}/work/&release;/gen/&name;</workdir>
336 <output>${newprj}_\${PROCESS}_%tc_gen.root</output>
337 <numjobs>$njob</numjobs>
338 <datatier>generated</datatier>
339 <defname>&name;_&tag;_gen</defname>
344 <outdir>/pnfs/lbne/persistent/${userdir}/&release;/g4/&name;</outdir>
345 <workdir>/lbne/app/users/${userbase}/work/&release;/g4/&name;</workdir>
346 <numjobs>$njob</numjobs>
347 <datatier>simulated</datatier>
348 <defname>&name;_&tag;_g4</defname>
352 if [ x$detsimfcl != x ]; then
354 <stage name="detsim">
355 <fcl>$detsimfcl</fcl>
356 <outdir>/pnfs/lbne/persistent/${userdir}/&release;/detsim/&name;</outdir>
357 <workdir>/lbne/app/users/${userbase}/work/&release;/detsim/&name;</workdir>
358 <numjobs>$njob</numjobs>
359 <datatier>detector-simulated</datatier>
360 <defname>&name;_&tag;_detsim</defname>
368 <outdir>/pnfs/lbne/persistent/${userdir}/&release;/reco/&name;</outdir>
369 <workdir>/lbne/app/users/${userbase}/work/&release;/reco/&name;</workdir>
370 <numjobs>$njob</numjobs>
371 <datatier>full-reconstructed</datatier>
372 <defname>&name;_&tag;_reco</defname>
375 <stage name="mergeana">
377 <outdir>/pnfs/lbne/persistent/${userdir}/&release;/mergeana/&name;</outdir>
378 <output>&name;_${PROCESS}_%tc_merged.root</output>
379 <workdir>/lbne/app/users/${userbase}/work/&release;/mergeana/&name;</workdir>
380 <numjobs>$njob</numjobs>
381 <targetsize>8000000000</targetsize>
382 <datatier>full-reconstructed</datatier>
383 <defname>&name;_&tag;</defname>
387 <filetype>&file_type;</filetype>
390 <runtype>&run_type;</runtype>