2 #----------------------------------------------------------------------
4 # Name: make_xml_mcc1.0.sh
6 # Purpose: Make xml files for mcc 1.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_mcc1.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 textfile; 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 = prodtextfile_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 = prodtextfile_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 "mcc1.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 textfile; then
274 echo " <inputmode>textfile</inputmode>" >> $newxml
275 echo " <inputlist>/lbne/app/users/tjyang/larsoft_dev/job/AntiMuonCutEvents.txt</inputlist>" >> $newxml
278 <outdir>/lbne/data2/${userdir}/&release;/gen/&name;</outdir>
279 <workdir>/lbne/app/users/${userbase}/&release;/gen/&name;</workdir>
280 <numjobs>$njob1</numjobs>
281 <datatier>generated</datatier>
282 <defname>&name;_&tag;_gen</defname>
287 <outdir>/lbne/data2/${userdir}/&release;/g4/&name;</outdir>
288 <workdir>/lbne/app/users/${userbase}/&release;/g4/&name;</workdir>
289 <numjobs>$njob1</numjobs>
290 <datatier>simulated</datatier>
291 <defname>&name;_&tag;_g4</defname>
295 if [ x$detsimfcl != x ]; then
297 <stage name="detsim">
298 <fcl>$detsimfcl</fcl>
299 <outdir>/lbne/data2/${userdir}/&release;/detsim/&name;</outdir>
300 <workdir>/lbne/app/users/${userbase}/&release;/detsim/&name;</workdir>
301 <numjobs>$njob2</numjobs>
302 <datatier>detector-simulated</datatier>
303 <defname>&name;_&tag;_detsim</defname>
308 if [ x$optsimfcl != x ]; then
310 <stage name="optsim">
311 <fcl>$optsimfcl</fcl>
312 <outdir>/lbne/data2/${userdir}/&release;/optsim/&name;</outdir>
313 <workdir>/lbne/app/users/${userbase}/&release;/optsim/&name;</workdir>
314 <numjobs>$njob2</numjobs>
315 <datatier>optical-simulated</datatier>
316 <defname>&name;_&tag;_optsim</defname>
321 if [ x$tpcsimfcl != x ]; then
323 <stage name="tpcsim">
324 <fcl>$tpcsimfcl</fcl>
325 <outdir>/lbne/data2/${userdir}/&release;/tpcsim/&name;</outdir>
326 <workdir>/lbne/app/users/${userbase}/&release;/tpcsim/&name;</workdir>
327 <numjobs>$njob2</numjobs>
328 <datatier>tpc-simulated</datatier>
329 <defname>&name;_&tag;_tpcsim</defname>
337 <outdir>/lbne/data2/${userdir}/&release;/reco/&name;</outdir>
338 <workdir>/lbne/app/users/${userbase}/&release;/reco/&name;</workdir>
339 <numjobs>$njob2</numjobs>
340 <datatier>full-reconstructed</datatier>
341 <defname>&name;_&tag;_reco</defname>
344 <stage name="mergeana">
346 <outdir>/lbne/data2/${userdir}/&release;/mergeana/&name;</outdir>
347 <workdir>/lbne/app/users/${userbase}/&release;/mergeana/&name;</workdir>
348 <numjobs>$njob2</numjobs>
349 <targetsize>8000000000</targetsize>
350 <datatier>full-reconstructed</datatier>
351 <defname>&name;_&tag;</defname>
355 <filetype>&file_type;</filetype>
358 <runtype>&run_type;</runtype>