4 #Subrun follows $PROCESS+1
5 #After every 100 subruns, a new run is started
7 export
WORKDIR=
"/sbnd/app/users/dbrailsf/generated_fcls"
13 show_help # Display
a usage synopsis.
21 echo
"$0 ERROR: fcl requires a non-empty option argument."
30 echo
"$0 ERROR: outdir requires a non-empty option argument."
42 echo
"$0 ERROR: nfiles requires a non-empty option argument."
51 echo
"$0 ERROR: workdir requires a non-empty option argument."
60 echo
"$0 ERROR: mdprojver requires a non-empty option argument."
69 echo
"$0 ERROR: mdprodname requires a non-empty option argument."
78 echo
"$0 ERROR: mdprodtype requires a non-empty option argument."
82 --mdstagename) # Takes an
option argument; ensure it has been
specified.
87 echo
"$0 ERROR: mdstagename requires a non-empty option argument."
100 printf
"$0 WARN: Unknown option (ignored): %s\n" "$1" >&2
108 if [ -
z "$FCL" ]; then
109 echo
"$0 ERROR: fcl is mandatory"
112 if [ -
z "$OUTDIR" ]; then
113 echo
"$0 ERROR: outdir is mandatory"
116 if [ -
z "$NFILES" ]; then
117 echo
"$0 ERROR: nfiles is mandatory"
120 if [ -
z "$MDSBNDPROJECTVERSION" ]; then
121 echo
"$0 ERROR: mdprojver is mandatory"
124 if [ -
z "$MDPRODUCTIONNAME" ]; then
125 echo
"$0 ERROR: mdprodname is mandatory"
128 if [ -
z "$MDPRODUCTIONTYPE" ]; then
129 echo
"$0 ERROR: mdprodtype is mandatory"
132 if [ -
z "$MDSTAGENAME" ]; then
133 echo
"$0 ERROR: mdstagename is mandatory"
138 echo
"Running with the following settings:"
139 echo
" fcl name: $FCL"
140 echo
" outdir: $OUTDIR (note this will be appended with additional directory names!)"
141 echo
" workdir: $WORKDIR"
142 echo
" nfiles: $NFILES"
143 echo
" sbnd project version: $MDSBNDPROJECTVERSION"
144 echo
" production name: $MDPRODUCTIONNAME"
145 echo
" production type: $MDPRODUCTIONTYPE"
146 echo
" stage name: $MDSTAGENAME"
147 echo
" Declare to SAM: $SAMDECLARE"
149 OUTDIR=$OUTDIR/$MDPRODUCTIONTYPE/$MDPRODUCTIONNAME/$MDSBNDPROJECTVERSION/${
FCL%.*}
150 echo
"The full output path is: $OUTDIR"
151 #make the directories
155 #We need to extract what the default run number is. Let's get this from running lar and dumping the config
156 lar --
debug-config lar_config_dump.txt -c $FCL
157 DEFAULTRUN=`grep -
r "firstRun" lar_config_dump.txt`
158 #THis line is of the form firstRun: RUN
159 #We need to extract RUN
160 #Delimit on the colon
161 IFS=\: read -
a DEFAULTRUNARRAY <<<
"$DEFAULTRUN"
162 #Extract the run number
163 DEFAULTRUN=${DEFAULTRUNARRAY[1]}
165 #starting making the files
167 #Needed to make subruns always start at 1
168 let
"SUBRUNCANDIDATE= 0"
169 while [[ $NPROCESSEDFILES -lt $NFILES ]]
171 #Do arithmetic to modulo-ise the run number and subrun number whilst making sure subrun always starts at 1
172 let
"SUBRUNCANDIDATE++"
174 let
"RUNNUMBER= $DEFAULTRUN + $RUNINCREMENT"
176 #Never let subrun be 0
181 #We now have run and subrun number
183 OUTFCL=
"${FCL%.*}_run${RUNNUMBER}_subrun${SUBRUNNUMBER}.fcl"
184 if [ -
e $WORKDIR/$OUTFCL ]
188 echo
"Producing $WORKDIR/$OUTFCL"
189 echo -
e "#include \"$FCL\"\n" \
190 "source.firstRun: $RUNNUMBER\n" \
191 "source.firstSubRun: $SUBRUNNUMBER" >> $WORKDIR/$OUTFCL
192 #Append all of the other metadata needed for the job
196 #make the fcl have a unique name (needed for SAM)
197 ifdh addOutputFile $WORKDIR/$OUTFCL
198 ifdh renameOutput unique
199 #Bit annoying but we now need to find the fcl file again as ifdh doesn't tell us what the unique name is
200 if [[ `find $WORKDIR -
name ${OUTFCL%.*}*.fcl | wc -l` -ne 1 ]]
202 echo
"Found incorrect number of matching fcl files for pattern: $OUTFCL"
203 find $WORKDIR -
name ${OUTFCL%.*}*.fcl
207 # OK so it looks like there it exactly one pattern match, so assume that is the correct one
208 UNIQUEOUTFCL=`find $WORKDIR -
name ${OUTFCL%.*}*.fcl`
209 UNIQUEOUTFCL=`basename $UNIQUEOUTFCL`
210 #Copy the fcl to the output directory (most likely dcache)
211 ifdh copyBackOutput $OUTDIR
220 \"file_type\": \"mc\",
222 \"fcl.name\": \"$UNIQUEOUTFCL\",
223 \"sbnd_project.name\": \"${FCL%.*}\",
224 \"sbnd_project.stage\": \"fcl\",
225 \"sbnd_project.version\": \"$MDSBNDPROJECTVERSION\",
226 \"sbnd_project.software\": \"sbndcode\",
227 \"production.name\": \"$MDPRODUCTIONNAME\",
228 \"production.type\": \"$MDPRODUCTIONTYPE\",
229 \"data_tier\": \"initial-fcl\",
230 \"file_format\": \"fcl\",
231 \"start_time\": \"`date +"%FT%T
"`\",
232 \"end_time\": \"`date +"%FT%T
"`\",
233 \"runs\": [ [ $RUNNUMBER, $SUBRUNNUMBER, \"physics\" ] ],
235 \"first_event\": -9999 ,
236 \"last_event\": -9999 ,
238 \"file_name\": \"$UNIQUEOUTFCL\",
239 \"file_size\": \"`wc -c < $WORKDIR/$UNIQUEOUTFCL`\",
241 `ifdh checksum $WORKDIR/$UNIQUEOUTFCL`
244 " >> $WORKDIR/${UNIQUEOUTFCL}.json
245 if [
"$SAMDECLARE" =
true ];
247 echo
"Declaring ${UNIQUEOUTFCL} to SAM"
251 let
"NPROCESSEDFILES++"
255 if [
"$SAMDECLARE" =
true ];
257 echo
"Making SAM dataset"
258 #Need to store the chopped up FCL name in a var as samweb has trouble parsing the %
260 samweb -
e sbnd create-definition ${
MDPRODUCTIONTYPE}_${
MDPRODUCTIONNAME}_${
FCL%.*}_initialfcl_sbnd
"file_name like ${TRUNCFCL}%.fcl and sbnd_project.version $MDSBNDPROJECTVERSION and production.type $MDPRODUCTIONTYPE and production.name $MDPRODUCTIONNAME"
262 samweb -
e sbnd create-definition ${
MDPRODUCTIONTYPE}_${
MDPRODUCTIONNAME}_${
FCL%.*}_initialfcl_sbnd
"file_name like ${TRUNCFCL}%.fcl and sbnd_project.version $MDSBNDPROJECTVERSION and production.type $MDPRODUCTIONTYPE and production.name $MDPRODUCTIONNAME"
265 ##Calculate how much to increment the run by
266 #RUNINCREMENT=`python -c "print $SUBRUNCANDIDATE//$NSUBRUNSPERRUN"`
267 ##Calculate the run number
268 #let "RUNNUMBER= $DEFAULTRUN + $RUNINCREMENT"
270 #SUBRUNNUMBER=`python -c "print $SUBRUNCANDIDATE % $NSUBRUNSPERRUN"`
271 #echo "#Metadata injection by $0" >> $FCL
272 #echo "source.firstRun: $RUNNUMBER" >> $FCL
273 #echo "source.firstSubRun: $SUBRUNNUMBER" >> $FCL
process_name standard_reco_uboone fcl
process_name opflash particleana ie ie ie z
process_name drop raw::OpDetWaveforms_DataApr2016RecoStage1_saturation_ * physics
then MDSBNDPROJECTVERSION
then echo Sam station was not specified(use option--sam_station)." exit 1 fi if [ x$SAM_GROUP
BEGIN_PROLOG triggeremu_data_config_icarus settings PMTADCthresholds sequence::icarus_stage0_multiTPC_TPC physics sequence::icarus_stage0_EastHits_TPC physics sequence::icarus_stage0_WestHits_TPC physics producers purityana0 caloskimCalorimetryCryoE physics caloskimCalorimetryCryoW physics path
then echo fcl sbnd_project sbnd_project sbnd_project sbnd_project production production $SUBRUNNUMBER
if &&[-z"$BASH_VERSION"] then echo Attempting to switch to bash bash shellSwitch exit fi &&["$1"= 'shellSwitch'] shift declare a IncludeDirectives for Dir in
BEGIN_PROLOG sequence::SlidingWindowTriggerPatternsOppositeWindows END_PROLOG simSlidingORM6O6 effSlidingORW output
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 options
stream1 can override from command line with o or output services user sbnd
then echo find_global_symbol finds mangled or demangled symbols in libraries echo within LD_LIBRARY_PATH match any symbol that echo contains name echo Default
BEGIN_PROLOG don t mess with this pandoraTrackGausCryoW true
bool Update(detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, const TCSlice &slc, PFPStruct &pfp, bool prt)