Skip to content

Commit

Permalink
Rename to CTP trigger configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
martinboulais committed Feb 11, 2025
1 parent 0bda0a5 commit 1ceab23
Show file tree
Hide file tree
Showing 18 changed files with 28 additions and 28 deletions.
4 changes: 2 additions & 2 deletions cxx-client/example/exampleSpecificServices.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ int main(int argc, char** argv)
std::cout << "Successfully updated trigger counters" << std::endl;

// Test run update
client->run()->setRawTriggerConfiguration(1, "A\nnew raw\nconfiguration");
std::cout << "Successfully updated run raw configuration" << std::endl;
client->run()->setRawCtpTriggerConfiguration(1, "A\nnew raw\nCTP trigger configuration");
std::cout << "Successfully updated run raw CTP trigger configuration" << std::endl;
} catch (std::runtime_error& error) {
std::cerr << "An error occurred: " << error.what() << std::endl;
exit(2);
Expand Down
2 changes: 1 addition & 1 deletion cxx-client/include/BookkeepingApi/RunServiceClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class RunServiceClient
public:
virtual ~RunServiceClient() = default;

virtual void setRawTriggerConfiguration(int runNumber, std::string rawTriggerConfiguration) = 0;
virtual void setRawCtpTriggerConfiguration(int runNumber, std::string rawCtpTriggerConfiguration) = 0;
};
} // namespace o2::bkp::api

Expand Down
4 changes: 2 additions & 2 deletions cxx-client/src/grpc/services/GrpcRunServiceClient.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ GrpcRunServiceClient::GrpcRunServiceClient(const std::shared_ptr<::grpc::Channel
{
mStub = o2::bookkeeping::RunService::NewStub(channel);
}
void GrpcRunServiceClient::setRawTriggerConfiguration(int runNumber, std::string rawTriggerConfiguration) {
void GrpcRunServiceClient::setRawCtpTriggerConfiguration(int runNumber, std::string rawCtpTriggerConfiguration) {
ClientContext context{};
RunUpdateRequest updateRequest{};
Run updatedRun;

updateRequest.set_runnumber(runNumber);
updateRequest.set_triggerrawconfiguration(rawTriggerConfiguration);
updateRequest.set_rawctptriggerconfiguration(rawCtpTriggerConfiguration);

auto status = mStub->Update(&context, updateRequest, &updatedRun);
if (!status.ok()) {
Expand Down
2 changes: 1 addition & 1 deletion cxx-client/src/grpc/services/GrpcRunServiceClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class GrpcRunServiceClient : public RunServiceClient
explicit GrpcRunServiceClient(const std::shared_ptr<::grpc::ChannelInterface>& channel);
~GrpcRunServiceClient() override = default;

void setRawTriggerConfiguration(int runNumber, std::string rawTriggerConfiguration) override;
void setRawCtpTriggerConfiguration(int runNumber, std::string rawCtpTriggerConfiguration) override;

private:
std::unique_ptr<o2::bookkeeping::RunService::Stub> mStub;
Expand Down
6 changes: 3 additions & 3 deletions lib/database/adapters/RunAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ class RunAdapter {
crossSection,
triggerEfficiency,
triggerAcceptance,
triggerRawConfiguration,
rawCtpTriggerConfiguration,
phaseShiftAtStartBeam1,
phaseShiftAtStartBeam2,
phaseShiftAtEndBeam1,
Expand Down Expand Up @@ -231,7 +231,7 @@ class RunAdapter {
crossSection,
triggerEfficiency,
triggerAcceptance,
triggerRawConfiguration,
rawCtpTriggerConfiguration,
phaseShiftAtStartBeam1,
phaseShiftAtStartBeam2,
phaseShiftAtEndBeam1,
Expand Down Expand Up @@ -349,7 +349,7 @@ class RunAdapter {
crossSection: entityObject.crossSection,
triggerEfficiency: entityObject.triggerEfficiency,
triggerAcceptance: entityObject.triggerAcceptance,
triggerRawConfiguration: entityObject.triggerRawConfiguration,
rawCtpTriggerConfiguration: entityObject.rawCtpTriggerConfiguration,
phaseShiftAtStartBeam1: entityObject.phaseShiftAtStartBeam1,
phaseShiftAtStartBeam2: entityObject.phaseShiftAtStartBeam2,
phaseShiftAtEndBeam1: entityObject.phaseShiftAtEndBeam1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
module.exports = {
up: async (queryInterface, Sequelize) => await queryInterface.addColumn(
'runs',
'trigger_raw_configuration',
'raw_ctp_trigger_configuration',
{
type: Sequelize.DataTypes.TEXT,
allowNull: true,
Expand All @@ -13,5 +13,5 @@ module.exports = {
},
),

down: async (queryInterface) => await queryInterface.removeColumn('runs', 'trigger_raw_configuration'),
down: async (queryInterface) => await queryInterface.removeColumn('runs', 'raw_ctp_trigger_configuration'),
};
2 changes: 1 addition & 1 deletion lib/database/models/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ module.exports = (sequelize) => {
allowNull: true,
default: null,
},
triggerRawConfiguration: {
rawCtpTriggerConfiguration: {
type: Sequelize.TEXT,
allowNull: true,
default: null,
Expand Down
2 changes: 1 addition & 1 deletion lib/database/models/typedefs/SequelizeRun.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
* @property {number|null} crossSection
* @property {number|null} triggerEfficiency
* @property {number|null} triggerAcceptance
* @property {string|null} triggerRawConfiguration
* @property {string|null} rawCtpTriggerConfiguration
* @property {number|null} phaseShiftAtEndBeam1
* @property {number|null} phaseShiftAtEndBeam2
* @property {number|null} phaseShiftAtStartBeam1
Expand Down
2 changes: 1 addition & 1 deletion lib/database/seeders/20200713103855-runs.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ module.exports = {
cross_section: 1.23,
trigger_efficiency: 2.34,
trigger_acceptance: 3.45,
trigger_raw_configuration: 'Raw\nTrigger\nConfiguration',
raw_ctp_trigger_configuration: 'Raw\nTrigger\nConfiguration',
phase_shift_at_start_beam1: 4.56,
phase_shift_at_start_beam2: -1.23,
phase_shift_at_end_beam1: 5.67,
Expand Down
2 changes: 1 addition & 1 deletion lib/domain/dtos/UpdateRunByRunNumberDto.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const BodyDto = Joi.object({
crossSection: Joi.number().optional(),
triggerEfficiency: Joi.number().optional(),
triggerAcceptance: Joi.number().optional(),
triggerRawConfiguration: Joi.string().optional(),
rawCtpTriggerConfiguration: Joi.string().optional(),
phaseShiftAtStart: PhaseShiftDto,
phaseShiftAtEnd: PhaseShiftDto,
});
Expand Down
2 changes: 1 addition & 1 deletion lib/domain/entities/Run.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
* @property {number|null} crossSection
* @property {number|null} triggerEfficiency
* @property {number|null} triggerAcceptance
* @property {string|null} triggerRawConfiguration
* @property {string|null} rawCtpTriggerConfiguration
* @property {number|null} phaseShiftAtStartBeam1
* @property {number|null} phaseShiftAtStartBeam2
* @property {number|null} phaseShiftAtEndBeam1
Expand Down
2 changes: 1 addition & 1 deletion lib/public/views/Runs/Details/RunDetailsModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const RUN_DETAILS_PANELS_KEYS = {
FLPS: 'flps',
DPL_PROCESSES: 'dpl-processes',
TRIGGER_COUNTERS: 'trigger-counters',
TRIGGER_CONFIGURATION: 'trigger-configuration',
CTP_TRIGGER_CONFIGURATION: 'trigger-configuration',
};

/**
Expand Down
6 changes: 3 additions & 3 deletions lib/public/views/Runs/Details/runDetailsComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ export const runDetailsComponent = (runDetailsModel, router) => runDetailsModel.
[RUN_DETAILS_PANELS_KEYS.FLPS]: 'FLP statistics',
[RUN_DETAILS_PANELS_KEYS.DPL_PROCESSES]: 'QC/PDP tasks',
[RUN_DETAILS_PANELS_KEYS.TRIGGER_COUNTERS]: 'Trigger counters',
[RUN_DETAILS_PANELS_KEYS.TRIGGER_CONFIGURATION]: 'Trigger Config',
[RUN_DETAILS_PANELS_KEYS.CTP_TRIGGER_CONFIGURATION]: 'CTP Trigger Config',
},
{
[RUN_DETAILS_PANELS_KEYS.LOGS]: (dataLogs) => table(dataLogs, logsActiveColumns, null, { profile: 'embeded' }),
Expand Down Expand Up @@ -600,11 +600,11 @@ export const runDetailsComponent = (runDetailsModel, router) => runDetailsModel.
},
{ classes: 'table-sm' },
),
[RUN_DETAILS_PANELS_KEYS.TRIGGER_CONFIGURATION]: () => h(
[RUN_DETAILS_PANELS_KEYS.CTP_TRIGGER_CONFIGURATION]: () => h(

Check warning on line 603 in lib/public/views/Runs/Details/runDetailsComponent.js

View check run for this annotation

Codecov / codecov/patch

lib/public/views/Runs/Details/runDetailsComponent.js#L603

Added line #L603 was not covered by tests
PanelComponent,
h(
'.p2',
run.triggerRawConfiguration
run.rawCtpTriggerConfiguration
.split('\n')
.map((row) => h('', row)),

Check warning on line 609 in lib/public/views/Runs/Details/runDetailsComponent.js

View check run for this annotation

Codecov / codecov/patch

lib/public/views/Runs/Details/runDetailsComponent.js#L609

Added line #L609 was not covered by tests
),
Expand Down
2 changes: 1 addition & 1 deletion proto/common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ message Run {
optional int64 timeTrgStart = 21;
// Trigger value
optional string triggerValue = 22;
optional string triggerRawConfiguration = 32;
optional string rawCtpTriggerConfiguration = 32;
// The full name or file location of the odcTopology
optional string odcTopologyFullName = 23;
optional bool ddFlp = 24;
Expand Down
2 changes: 1 addition & 1 deletion proto/run.proto
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ message RunUpdateRequest {
optional int64 timeTrgStart = 5;
optional int64 timeTrgEnd = 6;
optional string triggerValue = 7;
optional string triggerRawConfiguration = 19;
optional string rawCtpTriggerConfiguration = 19;
optional string pdpConfigOption = 8;
optional string pdpTopologyDescriptionLibraryFile = 9;
optional string tfbDdMode = 10;
Expand Down
4 changes: 2 additions & 2 deletions test/api/runs.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1226,7 +1226,7 @@ module.exports = () => {
crossSection: 0.1,
triggerEfficiency: 0.2,
triggerAcceptance: 0.3,
triggerRawConfiguration: 'Trigger\nRaw\nConfiguration',
rawCtpTriggerConfiguration: 'Trigger\nRaw\nConfiguration',
phaseShiftAtStart: {
beam1: 0.4,
beam2: -0.2,
Expand Down Expand Up @@ -1259,7 +1259,7 @@ module.exports = () => {
expect(data.nTfOrbits).to.equal(BIG_INT_NUMBER);
expect(data.triggerEfficiency).to.equal(0.2);
expect(data.triggerAcceptance).to.equal(0.3);
expect(data.triggerRawConfiguration).to.equal('Trigger\nRaw\nConfiguration');
expect(data.rawCtpTriggerConfiguration).to.equal('Trigger\nRaw\nConfiguration');
expect(data.phaseShiftAtStartBeam1).to.equal(0.4);
expect(data.phaseShiftAtStartBeam2).to.equal(-0.2);
expect(data.phaseShiftAtEndBeam1).to.equal(0.5);
Expand Down
4 changes: 2 additions & 2 deletions test/lib/server/services/run/RunService.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -685,11 +685,11 @@ module.exports = () => {
{ runNumber },
{
runPatch: {
triggerRawConfiguration: 'Raw\nTrigger\nConfiguration',
rawCtpTriggerConfiguration: 'Raw\nTrigger\nConfiguration',
},
},
);
expect(run.triggerRawConfiguration).to.equal('Raw\nTrigger\nConfiguration');
expect(run.rawCtpTriggerConfiguration).to.equal('Raw\nTrigger\nConfiguration');
});

it('should fetch distinct aliceCurrent levels', async () => {
Expand Down
4 changes: 2 additions & 2 deletions test/lib/usecases/run/UpdateRunUseCase.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ module.exports = () => {
crossSection: 0.1,
triggerEfficiency: 0.2,
triggerAcceptance: 0.3,
triggerRawConfiguration: 'Raw\nTrigger\nConfiguration',
rawCtpTriggerConfiguration: 'Raw\nTrigger\nConfiguration',
phaseShiftAtStart: {
beam1: 0.4,
beam2: -0.1,
Expand Down Expand Up @@ -330,7 +330,7 @@ module.exports = () => {
expect(result.crossSection).to.equal(0.1);
expect(result.triggerEfficiency).to.equal(0.2);
expect(result.triggerAcceptance).to.equal(0.3);
expect(result.triggerRawConfiguration).to.equal('Raw\nTrigger\nConfiguration');
expect(result.rawCtpTriggerConfiguration).to.equal('Raw\nTrigger\nConfiguration');
expect(result.phaseShiftAtStartBeam1).to.equal(0.4);
expect(result.phaseShiftAtStartBeam2).to.equal(-0.1);
expect(result.phaseShiftAtEndBeam1).to.equal(0.5);
Expand Down

0 comments on commit 1ceab23

Please sign in to comment.