Search/Navigation:
Related:
SLAC/EPP/HPS Public
Jefferson Lab/Hall B/HPS Run Wiki
S30XL-LESA/LDMX
Table of Contents |
---|
The tool conditions CommandLineTool can be run using the java command after Installing HPS Java.
Code Block | ||||
---|---|---|---|---|
| ||||
java -cp ./distribution/target/hps-distribution-3.7-SNAPSHOT-bin.jar org.hps.conditions.cli.CommandLineTool |
The This automatically generated run script can also may be used equivalently.
Code Block | ||||
---|---|---|---|---|
| ||||
./distribution/target/appassembler/bin/conditions-cli.sh |
Without any arguments these the commands will print the command basic usage information and then exit.
No Format |
---|
usage: CommandLineTool Commands: tag run-summary load add print -d,--detector <arg> detector name -h,--help print help -p,--connection <arg> database connection properties file -r,--run <arg> run number -t,--tag <arg> conditions tag to use for filtering records -x,--xml <arg> conditions XML configuration file |
...
These options should be provided before the sub-command, as in this example.
Code Block | ||
---|---|---|
| ||
./distribution/target/appassembler/bin/conditions-cli.sh tag -p myconnection.prop -d HPS-dummy-detector -r 1234 [subcommand] |
Options after the sub-command are will be passed to that sub-commands command's parser and not processed as general options (similar to how the svn command works).
The tag command is used to make a conditions tag that can be used to filter records.
...
Short Option | Long Option | Description |
---|---|---|
-d D | --dont-prompt | don't prompt before making tag (be careful!) |
-t | --tag | name of tag |
-s | --run-start | start run number |
-e | --run-end | end run number |
-m | --multiple | action for disambiguation of multiple valid records of the same type in the run |
-h | --help | print help and exit |
Here is a dummy example of using the tag command.
Code Block | ||
---|---|---|
| ||
./distribution/target/appassembler/bin/conditions-cli.sh tag -s 42 -e 1001 -m LAST_CREATED -t test-tag-1 |
...
The run-summary command can print out conditions collections that will be used for a given run.
Short Option | Long Option | Description |
---|---|---|
-a | --all | print out collection records and not just summary information |
-h | --help | print help and exit |
To use this, command the -d and -r base options should be used to initialize the conditions system.
Code Block | ||
---|---|---|
| ||
./distribution/target/appassembler/bin/conditions-cli.sh tag -p myconnection.prop -d HPS-dummy-detector -r 1234 run-summary |
If this information is not provided then the conditions system cannot be initialized and an error will occur.
The load command is used to insert new conditions collections into the database.
Short Option | Long Option | Description |
---|---|---|
-a | --all | print out collection records and not just summary information |
-h | --help | print help and exit |
Here is an example of using the load command.
Code Block |
---|
conditions-cli.sh load -d "adding new ECal calibrations" -f ecal_calibrations.txt -t ecal_calibrations |
The data for formatting should be in CSV format similar to the following.
No Format |
---|
ecal_channel_id,pedestal,noise
1,123.40,3.45
[...] |
The first row should contain column headers but the id and collection_id fields should always be omitted.
This command requires write access to the database so a connection properties file must be provided.
The add command is used to associate an existing conditions collection with a range of run numbers.
Short Option | Long Option | Description |
---|---|---|
-c | --collection | collection ID of the data |
-r | --run-start | starting run number |
-e | --run-end | ending run number defaults to run start if not provided |
-m | --notes | provide notes about this conditions set |
-t | --table | name of conditions table in database |
-u | --user | your user name (computer account name is fine) |
-h | --help | print help and exit |
Here is an example of using the add command.
Code Block | ||
---|---|---|
| ||
conditions-cli.sh add -c 1234 -s 5000 -e 5001 -m "ECal calibrations for 5000 and 5001" -t ecal_calibrations -u jeremym |
This command requires write access to the database so a connection properties file must be provided.
The collection ID can be found by looking at the collection_id column in the individual data tables. It is also printed out when using the load command to add new data.
The print command is used to print out detailed collection information for a given run number.
Short Option | Long Option | Description |
---|---|---|
-h | --help | print help and exit |
-t | --table | data table name if not provided all collections for the run will be printed |
-i | --print-id | include the row ID in print outs |
-f | --file | instead of printing to screen write output to a CSV file the -t option must also be provided or an error will occur |
-H | --no-header | do not print collection header information |
-h | --help | print help and exit |
Here is an example of using print to show all collections from a run.
Code Block | ||
---|---|---|
| ||
conditions-cli.sh -r 5000 -d HPS-EngRun2015-Nominal-v3 print |
This command will save the given table data for the run to an output CSV file.
Code Block |
---|
conditions-cli.sh -r 5000 -d HPS-EngRun2015-Nominal-v3 print -t ecal_calibrations -f ecal_calibrations_saved.txt |
The print command requires that the base -r and -d options are provided to initialize the conditions system or an error will occur.