Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions JobConfig/common/database_empty.fcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
services.DbService.purpose: EMPTY
services.DbService.version: ""
2 changes: 1 addition & 1 deletion JobConfig/digitize/Digitize.fcl
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ physics.end_paths : [ EndPath ]
#include "Production/JobConfig/digitize/epilog.fcl"
#include "mu2e-trig-config/core/trigDigiInputsEpilog.fcl"
# the following is a default placeholder
#include "Production/Validation/database.fcl"
#include "Production/JobConfig/common/database_empty.fcl"
2 changes: 1 addition & 1 deletion JobConfig/reco/Reco.fcl
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ physics : {
analyzers: @local::Reconstruction.analyzers
}
# the following is a placeholder
#include "Production/Validation/database.fcl"
#include "Production/JobConfig/common/database_empty.fcl"
2 changes: 1 addition & 1 deletion JobConfig/reco/RecoTrig.fcl
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ physics : {
trigger_paths : [ @sequence::Trig_physMenu.trigger_paths ]
}
# the following is a placeholder
#include "Production/Validation/database.fcl"
#include "Production/JobConfig/common/database_empty.fcl"
2 changes: 1 addition & 1 deletion JobConfig/recoMC/Reco.fcl
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ physics :
analyzers: @local::Reconstruction.analyzers
}
# the following is a placeholder
#include "Production/Validation/database.fcl"
#include "Production/JobConfig/common/database_empty.fcl"
10 changes: 10 additions & 0 deletions Scripts/LatestDbVersion.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
# Gets the latest database version for the given purpose

purpose="${1:-Sim_best}"

last_line=$(dbTool print-version --purpose "$purpose" | tail -1)

vmaj=$(echo "$last_line" | awk '{print $5}')
vmin=$(echo "$last_line" | awk '{print $6}')
echo "v${vmaj}_${vmin}"
26 changes: 26 additions & 0 deletions Scripts/addDatabase.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash
# creates fcl appending DbService database configuration
# Usage: ./Production/Scripts/addDatabase.sh <input fcl path> <output fcl path> [db purpose] [db version]

input_path=${1}
output_path=${2}

if [ -z "$3" ]; then
purpose="Sim_best"
echo "No purpose provided, using default: $purpose"
else
purpose="$3"
fi
if [ -z "$4" ]; then
dbversion=$(Production/Scripts/LatestDbVersion.sh "$purpose")
echo "No version provided, using latest: $dbversion"
else
dbversion="$4"
fi

cat "$input_path" > "$output_path"
cat >> "$output_path" <<EOF
services.DbService.purpose: $purpose
services.DbService.version: $dbversion
services.DbService.verbose: 2
EOF