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 #----------------------------------------------------------------------
34 userdir=scratch/dunepro
43 while [ $# -gt 0 ]; do
49 echo "Usage: make_xml_mcc5.0.sh [-h|--help] [-r <release>] [-u|--user <user>] [--local <dir|tar>] [--nev <n>] [--nevjob <n>] [--sys <sys>]"
66 userdir=scratch/users/$2
81 # Total number of events.
90 # Number of events per job.
99 # Name of systematic effect
102 if [ $# -gt 1 ]; then
116 if [[ $rel < 'v06_32_00' ]]; then
122 # Delete existing xml files.
126 find $DUNETPC_DIR/source/fcl/dune35t/gen $DUNETPC_DIR/source/fcl/dunefd/gen $DUNETPC_DIR/source/fcl/protodune/gen -name \*.fcl | while read fcl
128 if echo $fcl | grep -q 'prodgenie_nu_dune10kt_1x2x6\|prodgenie_nue_dune10kt_1x2x6\|prodgenie_nutau_dune10kt_1x2x6\|prodgenie_anu_dune10kt_1x2x6\|prodgenie_anue_dune10kt_1x2x6\|prodgenie_anutau_dune10kt_1x2x6'; then
129 newprj=`basename $fcl .fcl`_${tag}_${sys}
132 if [ $userbase != dunepro ]; then
133 samprj=${userbase}_$newprj
140 echo "Making ${newxml}"
144 recofcl=/dune/app/users/tjyang/larsoft_mydev/srcs/dunetpc/fcl/dunefd/reco/syst/standard_reco_dune10kt_nu_1x2x6_${sys}.fcl
145 if [ "$sys" == "def" ]; then
146 recofcl=standard_reco_dune10kt_nu_1x2x6.fcl
152 if echo $newprj | grep -q '_nu_'; then
153 recoinputdef=prodgenie_nu_dune10kt_1x2x6_mcc10.0_detsim
155 if echo $newprj | grep -q '_nue_'; then
156 recoinputdef=prodgenie_nue_dune10kt_1x2x6_mcc10.0_detsim
158 if echo $newprj | grep -q '_nutau_'; then
159 recoinputdef=prodgenie_nutau_dune10kt_1x2x6_mcc10.0_detsim
161 if echo $newprj | grep -q '_anu_'; then
162 recoinputdef=prodgenie_anu_dune10kt_1x2x6_mcc10.0_detsim
164 if echo $newprj | grep -q '_anue_'; then
165 recoinputdef=prodgenie_anue_dune10kt_1x2x6_mcc10.0_detsim
167 if echo $newprj | grep -q '_anutau_'; then
168 recoinputdef=prodgenie_anutau_dune10kt_1x2x6_mcc10.0_detsim
170 if echo $newprj | grep -q '_nu'; then
171 caffcl=select_ana_dune10kt_nu.fcl
173 if echo $newprj | grep -q '_anu'; then
174 caffcl=select_ana_dune10kt_anu.fcl
178 njob=$(( $nev / $nevjob ))
179 # echo $newprj, $nev, $nevjob, $njob
181 <?xml version="1.0"?>
183 <!-- Production Project -->
187 <!ENTITY file_type "mc">
188 <!ENTITY run_type "physics">
189 <!ENTITY name "$samprj">
190 <!ENTITY tag "${tag}_${sys}">
195 <project name="&name;">
197 <!-- Project size -->
198 <numevents>$nev</numevents>
200 <!-- Operating System -->
203 <!-- Batch resources -->
204 <resource>DEDICATED,OPPORTUNISTIC</resource>
206 <!-- metadata parameters -->
208 <parameter name ="MCName">${samprj}</parameter>
209 <parameter name ="MCDetectorType">${detector}</parameter>
210 <parameter name ="MCGenerators">${generator}</parameter>
212 <!-- Larsoft information -->
215 <qual>${quals}:prof</qual>
217 if [ x$local != x ]; then
219 echo " <local>${local}</local>" >> $newxml
226 <!-- Project stages -->
228 <jobsub>--expected-lifetime=24h --subgroup=prod</jobsub>
229 <maxfilesperjob>1</maxfilesperjob>
230 <inputdef>${recoinputdef}</inputdef>
232 <outdir>/pnfs/dune/${userdir}/&rel;/reco/&name;</outdir>
233 <workdir>/pnfs/dune/${userdir}/work/&rel;/reco/&name;</workdir>
234 <numjobs>$njob</numjobs>
235 <datatier>full-reconstructed</datatier>
236 <defname>&name;_reco</defname>
239 <stage name="mergeana">
240 <jobsub>--memory=4000 --expected-lifetime=24h --subgroup=prod</jobsub>
242 <outdir>/pnfs/dune/${userdir}/&rel;/mergeana/&name;</outdir>
243 <output>&name;_\${PROCESS}_%tc_merged.root</output>
244 <workdir>/pnfs/dune/${userdir}/work/&rel;/mergeana/&name;</workdir>
245 <numjobs>$njob</numjobs>
246 <targetsize>8000000000</targetsize>
247 <datatier>full-reconstructed</datatier>
248 <defname>&name;</defname>
252 <filetype>&file_type;</filetype>
255 <runtype>&run_type;</runtype>