2 #----------------------------------------------------------------------
4 # Name: make_xml_mcc4.0.sh
6 # Purpose: Make xml files for mcc 4.0. 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_mcc4.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.
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
129 if echo $newprj | grep -q dune10kt; then
134 echo "Making ${newprj}.xml"
138 genfcl=`basename $fcl`
142 g4fcl=standard_g4_dune35t.fcl
144 # Detsim (optical + tpc).
146 detsimfcl=standard_detsim_dune35t.fcl
150 # reco2dfcl=standard_reco_uboone_2D.fcl
154 # reco3dfcl=standard_reco_uboone_3D.fcl
157 recofcl=standard_reco_dune35t.fcl
161 mergefcl=standard_ana_dune35t.fcl
163 if echo $newprj | grep -q protonpi0; then
164 g4fcl=standard_g4_dune35t_protonpi0.fcl
167 if echo $newprj | grep -q countermu; then
168 g4fcl=standard_g4_dune35t_countermu.fcl
171 if echo $newprj | grep -q 'pi0\|gamma'; then
172 recofcl=reco_dune35t_blur.fcl
173 mergefcl=ana_energyCalib.fcl
176 if echo $newprj | grep -q 'piminus'; then
178 mergefcl=standard_merge_dune35t.fcl
181 if echo $newprj | grep -q milliblock; then
182 detsimfcl=standard_detsim_dune35t_milliblock.fcl
183 recofcl=standard_reco_dune35t_milliblock.fcl
184 mergefcl=standard_ana_dune35t_milliblock.fcl
187 if echo $newprj | grep -q dune10kt; then
188 g4fcl=standard_g4_dune10kt.fcl
189 detsimfcl=standard_detsim_dune10kt.fcl
190 recofcl=standard_reco_dune10kt.fcl
191 mergefcl=standard_ana_dune10kt.fcl
194 if echo $newprj | grep -q dune10kt_workspace; then
195 g4fcl=standard_g4_dune10kt_workspace.fcl
196 detsimfcl=standard_detsim_dune10kt_workspace.fcl
197 recofcl=standard_reco_dune10kt_workspace.fcl
198 mergefcl=standard_ana_dune10kt_workspace.fcl
201 # Set number of events per job.
203 if [ $nevjob -eq 0 ]; then
204 if [ $newprj = prodcosmics_dune35t_milliblock ]; then
206 elif [ $newprj = prodcosmics_dune35t_onewindow ]; then
208 elif [ $newprj = AntiMuonCutEvents_LSU_dune35t ]; then
210 elif [ $newprj = prodcosmics_dune35t_milliblock_countermu ]; then
212 elif [ $newprj = prodcosmics_dune35t_milliblock_protonpi0 ]; then
219 # Set number of events.
222 if [ $nev -eq 0 ]; then
223 if [ $newprj = prodcosmics_dune35t_milliblock ]; then
225 elif [ $newprj = prodcosmics_dune35t_onewindow ]; then
227 elif [ $newprj = AntiMuonCutEvents_LSU_dune35t ]; then
229 elif [ $newprj = prodcosmics_dune35t_milliblock_countermu ]; then
231 elif [ $newprj = prodcosmics_dune35t_milliblock_protonpi0 ]; then
233 elif echo $newprj | grep -q dune10kt; then
240 # Calculate the number of worker jobs.
242 njob=$(( $nev / $nevjob ))
243 # echo $newprj, $nev, $nevjob, $njob
245 <?xml version="1.0"?>
247 <!-- Production Project -->
250 <!ENTITY release "$rel">
251 <!ENTITY file_type "mc">
252 <!ENTITY run_type "physics">
253 <!ENTITY name "$newprj">
254 <!ENTITY tag "mcc4.0">
257 <project name="&name;">
262 <!-- Project size -->
263 <numevents>$nev</numevents>
265 <!-- Operating System -->
268 <!-- Batch resources -->
269 <resource>DEDICATED,OPPORTUNISTIC</resource>
271 <!-- Larsoft information -->
274 <qual>${qual}:prof</qual>
277 if [ x$local != x ]; then
278 echo " <local>${local}</local>" >> $newxml
283 <!-- dune35t metadata parameters -->
285 <parameter name ="MCName">${newprj}</parameter>
286 <parameter name ="MCDetectorType">${detector}</parameter>
287 <parameter name ="MCGenerators">${generator}</parameter>
289 <!-- Project stages -->
294 if echo $newprj | grep -q AntiMuonCutEvents_LSU_dune35t; then
295 echo " <inputmode>textfile</inputmode>" >> $newxml
296 echo " <inputlist>/lbne/data2/users/jti3/txtfiles/AntiMuonCutEvents_LSU_100.txt</inputlist>" >> $newxml
299 <outdir>/pnfs/lbne/persistent/${userdir}/&release;/gen/&name;</outdir>
300 <workdir>/lbne/app/users/${userbase}/&release;/gen/&name;</workdir>
301 <logdir>/lbne/data/users/${userbase}/log/&release;/gen/&name;</logdir>
302 <output>${newprj}_\${PROCESS}_%tc_gen.root</output>
303 <numjobs>$njob</numjobs>
304 <datatier>generated</datatier>
305 <defname>&name;_&tag;_gen</defname>
310 <outdir>/pnfs/lbne/persistent/${userdir}/&release;/g4/&name;</outdir>
311 <workdir>/lbne/app/users/${userbase}/&release;/g4/&name;</workdir>
312 <logdir>/lbne/data/users/${userbase}/log/&release;/g4/&name;</logdir>
313 <numjobs>$njob</numjobs>
314 <datatier>simulated</datatier>
315 <defname>&name;_&tag;_g4</defname>
319 if [ x$detsimfcl != x ]; then
321 <stage name="detsim">
322 <fcl>$detsimfcl</fcl>
323 <outdir>/pnfs/lbne/persistent/${userdir}/&release;/detsim/&name;</outdir>
324 <workdir>/lbne/app/users/${userbase}/&release;/detsim/&name;</workdir>
325 <logdir>/lbne/data/users/${userbase}/log/&release;/detsim/&name;</logdir>
326 <numjobs>$njob</numjobs>
327 <datatier>detector-simulated</datatier>
328 <defname>&name;_&tag;_detsim</defname>
336 <outdir>/pnfs/lbne/persistent/${userdir}/&release;/reco/&name;</outdir>
337 <workdir>/lbne/app/users/${userbase}/&release;/reco/&name;</workdir>
338 <logdir>/lbne/data/users/${userbase}/log/&release;/reco/&name;</logdir>
339 <numjobs>$njob</numjobs>
340 <datatier>full-reconstructed</datatier>
341 <defname>&name;_&tag;_reco</defname>
344 <stage name="mergeana">
346 <outdir>/pnfs/lbne/persistent/${userdir}/&release;/mergeana/&name;</outdir>
347 <workdir>/lbne/app/users/${userbase}/&release;/mergeana/&name;</workdir>
348 <logdir>/lbne/data/users/${userbase}/log/&release;/mergeana/&name;</logdir>
349 <numjobs>$njob</numjobs>
350 <targetsize>8000000000</targetsize>
351 <datatier>full-reconstructed</datatier>
352 <defname>&name;_&tag;</defname>
356 <filetype>&file_type;</filetype>
359 <runtype>&run_type;</runtype>