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 sbndcode (that is, under
9 # $SBNDCODE_DIR/source/fcl/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/sbndcode release.
20 # -u|--user <user> - Use users/<user> as working and output directories
21 # (default is to use sbndpro).
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 #----------------------------------------------------------------------
33 echo
"Making ${newxml}"
38 <!-- Production Project -->
41 <!ENTITY release
"$rel">
42 <!ENTITY file_type
"mc">
43 <!ENTITY run_type
"physics">
44 <!ENTITY
name "$newprj">
45 <!ENTITY tag
"mcc1.0">
48 <project
name=
"&name;">
51 <numevents>$nev</numevents>
53 <!-- Operating System -->
56 <!-- Batch resources -->
64 if [
x$local !=
x ]; then
66 echo
" <local>${local}</local>" >> $newxml
71 <!-- Project stages -->
77 <numjobs>$njob1</numjobs>
78 <datatier>generated</datatier>
79 <defname>&
name;_&tag;_gen</defname>
86 <numjobs>$njob1</numjobs>
87 <datatier>simulated</datatier>
88 <defname>&
name;_&tag;_g4</defname>
95 <numjobs>$njob2</numjobs>
96 <datatier>
detector-simulated</datatier>
97 <defname>&
name;_&tag;_detsim</defname>
104 <numjobs>$njob2</numjobs>
105 <datatier>reconstructed</datatier>
106 <defname>&
name;_&tag;_reco</defname>
109 <
stage name=
"anatree">
113 <numjobs>$njob2</numjobs>
114 <targetsize>8000000000</targetsize>
115 <datatier>reconstructed</datatier>
116 <defname>&
name;_&tag;</defname>
120 <filetype>&file_type;</filetype>
123 <runtype>&run_type;</runtype>
129 function set_default_fcl {
131 g4fcl=standard_g4_sbnd.fcl
133 # Detsim (optical + tpc).
137 recofcl=standard_reco_sbnd_basic.fcl
140 anatreefcl=standard_anatree_sbnd.fcl
155 while [ $# -gt 0 ];
do
161 echo
"Usage: make_xml_mcc1.0.sh [-h|--help] [-r <release>] [-q <qual>] [-u|--user <user>] [--local <dir|tar>] [--nev <n>] [--nevjob <n>] [--nevgjob <n>]"
168 if [ $# -gt 1 ]; then
177 if [ $# -gt 1 ]; then
187 if [ $# -gt 1 ]; then
197 if [ $# -gt 1 ]; then
203 # Total number of events.
206 if [ $# -gt 1 ]; then
212 # Number of events per job.
215 if [ $# -gt 1 ]; then
221 # Number of events per gen/g4 job.
224 if [ $# -gt 1 ]; then
238 # Delete existing xml files.
242 # Loop over existing generator fcl files.
246 if ! echo $fcl | grep -
q common; then
247 newprj=`basename $fcl .fcl`
255 # Set number of gen/g4 events per job.
258 if [ $nevgjob -eq 0 ]; then
259 if echo $newprj | grep -
q dirt; then
260 if echo $newprj | grep -
q cosmic; then
270 # Set number of events.
273 if [ $nev -eq 0 ]; then
274 if [ $newprj = prodgenie_bnb_nu_cosmic_sbnd ]; then
276 elif [ $newprj = prodgenie_bnb_nu_sbnd ]; then
278 elif [ $newprj = prodgenie_bnb_nue_cosmic_sbnd ]; then
280 elif [ $newprj = prodgenie_bnb_nue_sbnd ]; then
282 elif [ $newprj = prodcosmics_sbnd ]; then
288 nev=$(( $nev * $filt ))
290 # Calculate the number of worker jobs.
292 njob1=$(( $nev / $nevgjob )) # Pre-
filter (gen, g4)
293 njob2=$(( $nev / $nevjob / $filt ))
# Post-filter (detsim and later)
294 if [ $njob1 -lt $njob2 ]; then
300 # Define the generator-level fcl
301 genfcl=`basename $fcl`
302 #Assume that we are going to produce this sample with the default fcls
303 makedefaultsample=
true
304 #Loop over the MCCSTATEMENTs in this fcl file to figure out what alternative samples need making
305 grep
"MCCSTATEMENT" $fcl |
306 { #being
the moron
I am,
I forgot that
a while loop uses
a subshell.
I want to maybe
307 #change the value of makedefaultsample and check it outside of the loop. So
308 #complete hack; wrap from here to the final makedefaultsample check in braces
309 #so it is all in the same subshell. Basically not having the braces means that
310 #makedefaultsample will evaluate to true outside of this while loop
311 while read mccstatement
313 #At time of writing, the MCCSTATEMENT should define an altnerative set of fcl files to
314 #process this particular sample through. Technically each MCCSTATEMENT line is a
315 #comma separated list of fcl files and a name for the alternative project. The first element in the
316 #comma separated list is a pair of statements separated by white space, the second of the pair is the
317 #name of the project. All subsequent elements in the list are also pairs separated by white space.
318 #The first element defines which stage to change the fcl file and can have the following names: G4:
319 #DETSIM: RECO: and ANATREE:.
321 #It is also possible that one of the statement lines asks us not to make the default sample path
322 #Check for this and set the flag to false if necessary
323 if echo $mccstatement | grep -
q SKIPDEFAULT; then
324 makedefaultsample=
false
325 #There shouldn't be anything else useful on this line so continue to the next statement
329 #For each new MCCSTATEMENT line we should initially reset the fcl files
331 #Also reset the project name to that of the default sample as otherwise the new project names keep
332 #getting appended to the previous new project name
333 newprj=`basename $fcl .fcl`
336 #Delimit the MCCSTATEMENT line on the commas
338 statementarray=($mccstatement)
340 for statementelement
in "${statementarray[@]}"
342 #The statementelement should be
a string pair basically with
a key
and a value. This time
343 #separated by whitespace
344 pair=($statementelement)
347 if echo $key | grep -
q MCCSTATEMENT; then
348 newprj=
"${newprj}_${value}"
350 elif echo $key | grep -
q G4; then
352 elif echo $key | grep -
q DETSIM; then
354 elif echo $key | grep -
q RECO; then
356 elif echo $key | grep -
q ANATREE; then
358 else echo
"ISSUE WITH MCCSTATEMENT IN $newprj. CAN NOT FIND THE SET STATEMENTS (MCCSTATEMENT G4 DETSIM RECO OR ANATREE)"
361 #make an XML file for each MCCSTATEMENT line
365 #if we still want to make the default file then make the XML
366 if [
"$makedefaultsample"=
true ] ; then
368 newprj=`basename $fcl .fcl` #reset
the newprj back to
the default project
373 } #
while loop subshell
process_name standard_reco_uboone fcl
see a below echo or echo I(indirect symbol).'echo" If the symbol is local (non-external)
opportunistic OPPORTUNISTIC
process_name opflash particleana ie x
process_name can override from command line with o or output proton mvapid_weights muon_all_BDT weights xml
then source cvmfs dune opensciencegrid org products dune setup_dune sh exit elif[-f/grid/fermiapp/products/dune/setup_dune_fermiapp.sh]
std::size_t size(FixedBins< T, C > const &) noexcept
function print_xml_to_file
process_name standard_reco_uboone reco
then if echo $newprj grep q dirt
return match has_match and(match.match_pdg==11 or match.match_pdg==-11)
then echo echo For and will not be changed by echo further linking echo echo B echo The symbol is in the uninitialized data multiple common symbols may appear with the echo same name If the symbol is defined the common echo symbols are treated as undefined references For more echo details on common see the discussion of warn common echo in *Note Linker see the discussion of warn common echo in *Note Linker such as a global int variable echo as opposed to a large global array echo echo I echo The symbol is an indirect reference to another symbol This echo is a GNU extension to the a out object file format which is echo rarely used echo echo N echo The symbol is a debugging symbol echo echo R echo The symbol is in a read only data section echo echo S echo The symbol is in an uninitialized data section for small echo objects echo echo T echo The symbol is in the the normal defined echo symbol is used with no error When a weak undefined symbol echo is linked and the symbol is not the value of the echo weak symbol becomes zero with no error echo echo W echo The symbol is a weak symbol that has not been specifically echo tagged as a weak object symbol When a weak defined symbol echo is linked with a normal defined the normal defined echo symbol is used with no error When a weak undefined symbol echo is linked and the symbol is not the value of the echo weak symbol becomes zero with no error echo echo echo The symbol is a stabs symbol in an a out object file In echo this the next values printed are the stabs other echo the stabs desc and the stab type Stabs symbols are echo used to hold debugging information For more information
esac shift done rm f *xml find $SBNDCODE_DIR source fcl gen name *fcl while read fcl do if!echo $fcl grep q common
if &&[-z"$BASH_VERSION"] then echo Attempting to switch to bash bash shellSwitch exit fi &&["$1"= 'shellSwitch'] shift declare a IncludeDirectives for Dir in
stream1 can override from command line with o or output services user sbnd
BEGIN_PROLOG don t mess with this pandoraTrackGausCryoW true