-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
88 changed files
with
1,842 additions
and
989 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/** | ||
* @license | ||
* Copyright CERN and copyright holders of ALICE O2. This software is | ||
* distributed under the terms of the GNU General Public License v3 (GPL | ||
* Version 3), copied verbatim in the file "COPYING". | ||
* | ||
* See http://alice-o2.web.cern.ch/license for full licensing information. | ||
* | ||
* In applying this license CERN does not waive the privileges and immunities | ||
* granted to it by virtue of its status as an Intergovernmental Organization | ||
* or submit itself to any jurisdiction. | ||
*/ | ||
|
||
const { AdapterError } = require('../../server/errors/AdapterError.js'); | ||
|
||
/** | ||
* Adapter for data pass QC flag | ||
*/ | ||
class DataPassQcFlagAdapter { | ||
/** | ||
* Constructor | ||
*/ | ||
constructor() { | ||
this.toEntity = this.toEntity.bind(this); | ||
|
||
this.dataPassAdapter = null; | ||
this.qcFlagTypeAdapter = null; | ||
this.qcFlagVerificationAdapter = null; | ||
this.userAdapter = null; | ||
} | ||
|
||
/** | ||
* Converts the given database object to an entity object. | ||
* | ||
* @param {SequelizeDataPassQcFlag} databaseObject Object to convert. | ||
* @returns {DataPassQcFlag} Converted entity object. | ||
*/ | ||
toEntity(databaseObject) { | ||
const { | ||
dataPassId, | ||
qualityControlFlagId, | ||
qcFlag, | ||
createdAt, | ||
updatedAt, | ||
dataPass, | ||
} = databaseObject; | ||
|
||
if (qcFlag === null) { | ||
throw new AdapterError('Related QC flag missing in DataPassQcFlag.'); | ||
} | ||
|
||
return { | ||
dataPassId, | ||
qcFlagId: qualityControlFlagId, | ||
from: qcFlag.from, | ||
to: qcFlag.to, | ||
comment: qcFlag.comment, | ||
createdById: qcFlag.createdById, | ||
flagTypeId: qcFlag.flagTypeId, | ||
runNumber: qcFlag.runNumber, | ||
dplDetectorId: qcFlag.dplDetectorId, | ||
createdAt, | ||
updatedAt, | ||
dataPass: dataPass ? this.dataPassAdapter.toEntity(dataPass) : null, | ||
createdBy: qcFlag.createdBy ? this.userAdapter.toEntity(qcFlag.createdBy) : null, | ||
flagType: qcFlag.flagType ? this.qcFlagTypeAdapter.toEntity(qcFlag.flagType) : null, | ||
verifications: qcFlag.verifications ? this.qcFlagVerificationAdapter.toEntity(qcFlag.verifications) : null, | ||
}; | ||
} | ||
} | ||
|
||
exports.DataPassQcFlagAdapter = DataPassQcFlagAdapter; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/** | ||
* @license | ||
* Copyright CERN and copyright holders of ALICE O2. This software is | ||
* distributed under the terms of the GNU General Public License v3 (GPL | ||
* Version 3), copied verbatim in the file "COPYING". | ||
* | ||
* See http://alice-o2.web.cern.ch/license for full licensing information. | ||
* | ||
* In applying this license CERN does not waive the privileges and immunities | ||
* granted to it by virtue of its status as an Intergovernmental Organization | ||
* or submit itself to any jurisdiction. | ||
*/ | ||
|
||
const { AdapterError } = require('../../server/errors/AdapterError.js'); | ||
|
||
/** | ||
* Adapter for simulation pass QC flag | ||
*/ | ||
class SimulationPassQcFlagAdapter { | ||
/** | ||
* Constructor | ||
*/ | ||
constructor() { | ||
this.toEntity = this.toEntity.bind(this); | ||
|
||
this.simulationPassAdapter = null; | ||
this.qcFlagTypeAdapter = null; | ||
this.qcFlagVerificationAdapter = null; | ||
this.userAdapter = null; | ||
} | ||
|
||
/** | ||
* Converts the given database object to an entity object. | ||
* | ||
* @param {SequelizeSimulationPassQcFlag} databaseObject Object to convert. | ||
* @returns {SimulationPassQcFlag} Converted entity object. | ||
*/ | ||
toEntity(databaseObject) { | ||
const { | ||
simulationPassId, | ||
qualityControlFlagId, | ||
qcFlag, | ||
createdAt, | ||
updatedAt, | ||
simulationPass, | ||
} = databaseObject; | ||
|
||
if (qcFlag === null) { | ||
throw new AdapterError('Related QC flag missing in SimulationPassQcFlag.'); | ||
} | ||
|
||
return { | ||
simulationPassId, | ||
qcFlagId: qualityControlFlagId, | ||
from: qcFlag.from, | ||
to: qcFlag.to, | ||
comment: qcFlag.comment, | ||
createdById: qcFlag.createdById, | ||
flagTypeId: qcFlag.flagTypeId, | ||
runNumber: qcFlag.runNumber, | ||
dplDetectorId: qcFlag.dplDetectorId, | ||
createdAt, | ||
updatedAt, | ||
simulationPass: simulationPass ? this.simulationPassAdapter.toEntity(simulationPass) : null, | ||
createdBy: qcFlag.createdBy ? this.userAdapter.toEntity(qcFlag.createdBy) : null, | ||
flagType: qcFlag.flagType ? this.qcFlagTypeAdapter.toEntity(qcFlag.flagType) : null, | ||
verifications: qcFlag.verifications ? this.qcFlagVerificationAdapter.toEntity(qcFlag.verifications) : null, | ||
}; | ||
} | ||
} | ||
|
||
exports.SimulationPassQcFlagAdapter = SimulationPassQcFlagAdapter; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
lib/database/migrations/20230901090207-include-fill-without-runs-in-statistics.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
lib/database/migrations/20240417163030-add-Mu-and-Inel-columns-to-runs.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/** | ||
* @license | ||
* Copyright CERN and copyright holders of ALICE O2. This software is | ||
* distributed under the terms of the GNU General Public License v3 (GPL | ||
* Version 3), copied verbatim in the file "COPYING". | ||
* | ||
* See http://alice-o2.web.cern.ch/license for full licensing information. | ||
* | ||
* In applying this license CERN does not waive the privileges and immunities | ||
* granted to it by virtue of its status as an Intergovernmental Organization | ||
* or submit itself to any jurisdiction. | ||
*/ | ||
|
||
/** @type {import('sequelize-cli').Migration} */ | ||
module.exports = { | ||
up: async (queryInterface, Sequelize) => queryInterface.sequelize.transaction(async (transaction) => { | ||
await queryInterface.addColumn('runs', 'inelastic_interaction_rate_avg', { | ||
type: Sequelize.FLOAT, | ||
allowNull: true, | ||
}, { transaction }); | ||
|
||
await queryInterface.addColumn('runs', 'inelastic_interaction_rate_at_start', { | ||
type: Sequelize.FLOAT, | ||
allowNull: true, | ||
}, { transaction }); | ||
|
||
await queryInterface.addColumn('runs', 'inelastic_interaction_rate_at_mid', { | ||
type: Sequelize.FLOAT, | ||
allowNull: true, | ||
}, { transaction }); | ||
|
||
await queryInterface.addColumn('runs', 'inelastic_interaction_rate_at_end', { | ||
type: Sequelize.FLOAT, | ||
allowNull: true, | ||
}, { transaction }); | ||
}), | ||
|
||
down: async (queryInterface) => queryInterface.sequelize.transaction(async (transaction) => { | ||
await queryInterface.removeColumn('runs', 'inelastic_interaction_rate_avg', { transaction }); | ||
await queryInterface.removeColumn('runs', 'inelastic_interaction_rate_at_start', { transaction }); | ||
await queryInterface.removeColumn('runs', 'inelastic_interaction_rate_at_mid', { transaction }); | ||
await queryInterface.removeColumn('runs', 'inelastic_interaction_rate_at_end', { transaction }); | ||
}), | ||
}; |
Oops, something went wrong.