Skip to content
Merged
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
27 changes: 16 additions & 11 deletions src/main/java/alice/dip/DipMessagesProcessor.java
Original file line number Diff line number Diff line change
Expand Up @@ -236,24 +236,24 @@ public void processNextInQueue(MessageItem messageItem) {
case "dip/acc/LHC/RunControl/SafeBeam":
handleSafeBeamMessage(messageItem.data);
break;
case "dip/acc/LHC/Beam/Energy":
handleEnergyMessage(messageItem.data);
break;
case "dip/acc/LHC/RunControl/BeamMode":
handleBeamModeMessage(messageItem.data);
break;
case "dip/acc/LHC/Beam/Energy":
handleEnergyMessage(messageItem.data);
break;
case "dip/acc/LHC/Beam/BetaStar/Bstar2":
handleBetaStarMessage(messageItem.data);
break;
case "dip/ALICE/MCS/Solenoid/Current":
handleL3CurrentMessage(messageItem.data);
break;
case "dip/ALICE/MCS/Dipole/Current":
handleDipoleCurrentMessage(messageItem.data);
break;
case "dip/ALICE/MCS/Solenoid/Polarity":
handleL3PolarityMessage(messageItem.data);
break;
case "dip/ALICE/MCS/Dipole/Current":
handleDipoleCurrentMessage(messageItem.data);
break;
case "dip/ALICE/MCS/Dipole/Polarity":
handleDipolePolarityMessage(messageItem.data);
break;
Expand Down Expand Up @@ -308,7 +308,7 @@ private void handleRunConfigurationMessage(DipData dipData) throws BadParameter,
}

private void handleSafeBeamMessage(DipData dipData) throws BadParameter, TypeMismatch {
var safeBeamPayload = dipData.extractInt("payload");
var safeBeamPayload = dipData.extractInt("PAYLOAD");

var time = dipData.extractDipTime().getAsMillis();

Expand Down Expand Up @@ -342,11 +342,11 @@ private void handleSafeBeamMessage(DipData dipData) throws BadParameter, TypeMis
}

private void handleEnergyMessage(DipData dipData) throws BadParameter, TypeMismatch {
var energyPayload = dipData.extractInt("payload");
var energyPayload = dipData.extractInt("PAYLOAD");
// Per documentation, value has to be multiplied by 120 go get MeV
// https://confluence.cern.ch/display/expcomm/Energy
var energy = 0.12f * energyPayload;

AliDip2BK.log(1, "ProcData.dispach", " New Energy = " + energy + " TeV");
var time = dipData.extractDipTime().getAsMillis();

if (currentFill != null) {
Expand All @@ -371,13 +371,18 @@ private void handleBeamModeMessage(DipData dipData) throws BadParameter, TypeMis
newBeamMode(time, beamMode);
}

/**
* Handles the Beta Star message, extracts the value, converts it to meters and updates the current fill information accordingly.
* Source: https://confluence.cern.ch/pages/viewpage.action?spaceKey=expcomm&title=BetaStar
* @param dipData - the DipData object containing the Beta Star information
*/
private void handleBetaStarMessage(DipData dipData) throws BadParameter, TypeMismatch {
var betaStarPayload = dipData.extractInt("payload");
var betaStarPayload = dipData.extractInt("PAYLOAD");
// Per documentation, value is in cm, we convert it to m
var betaStar = betaStarPayload / 100.f; // in m

var time = dipData.extractDipTime().getAsMillis();

AliDip2BK.log(1, "ProcData.dispach", " New Beta Star = " + betaStar);
if (currentFill != null) {
currentFill.setLHCBetaStar(time, betaStar);
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/proto/events.proto
Original file line number Diff line number Diff line change
Expand Up @@ -160,4 +160,4 @@ message Event {
// Events produced by other systems, but natively supported and defined by AliECS
Ev_BeamModeEvent beamModeEvent = 200;
}
}
}
15 changes: 11 additions & 4 deletions src/main/proto/protos/common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@ message User {
string name = 3;
}

// Production and staging BKP recognizes these special user IDs.
// They are used to associate certain actions (e.g. EOR) with certain subsystem
// or AliECS component rather than a human user.
enum SpecialUserId {
INVALID = 0;
LHC = 60;
TIMER = 65;
}

message WorkflowTemplateInfo {
string name = 1;
string description = 2;
Expand All @@ -55,10 +64,8 @@ message BeamInfo {
int64 stableBeamsEnd = 2; // milliseconds since epoch when stable beams ended
int32 fillNumber = 3; // LHC fill number
string fillingSchemeName = 4; // LHC filling scheme name e.g. 25ns_2460b_2448_2089_2227_144bpi_20inj
float beam1Energy = 5; // in GeV
float beam2Energy = 6; // in GeV
string beamType = 7; // e.g. PROTON-PROTON, O8-O8, Pb-Pb, p-Pb, Pb-p
BeamMode beamMode = 8;
string beamType = 5; // e.g. PROTON-PROTON, O8-O8, Pb-Pb, p-Pb, Pb-p
BeamMode beamMode = 6;
}

/**
Expand Down
Loading