-
Notifications
You must be signed in to change notification settings - Fork 1
/
AliRPCValueDCS.cpp
128 lines (106 loc) · 3.29 KB
/
AliRPCValueDCS.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
//
// AliRPCValueDCS.C
// Aliroot project
//
// Created by Gabriele Gaetano Fronzé on 20/11/15.
// Copyright © 2015 Gabriele Gaetano Fronzé. All rights reserved.
//
#include "AliRPCValueDCS.h"
#include "TClass.h"
AliRPCValueDCS::AliRPCValueDCS() : TObject(){
fRunNumber=0;
fRunYear=0;
fTimeStamp=0;
fIsCalib=kFALSE;
fIsAMANDA=kFALSE;
fBeamEnergy=0.f;
fBeamType=knone;
fLHCStatus=kNONE;
};
AliRPCValueDCS::AliRPCValueDCS(UInt_t runNumber, ULong64_t timeStamp, UInt_t runYear, Bool_t isCalib, TString beamType,
Float_t beamEnergy, TString LHCStatus, Bool_t isAMANDA) : TObject(){
fRunNumber=runNumber;
fRunYear=runYear;
fTimeStamp=timeStamp;
fIsCalib=isCalib;
fIsAMANDA=isAMANDA;
fBeamType = knone;
if(LHCStatus.Contains("BEAM")){
if(LHCStatus.Contains("NO")){
fLHCStatus = kNOBEAM;
} else if(LHCStatus.Contains("DUMP")){
fLHCStatus = kDUMP;
} else {
fLHCStatus = kBEAM;
}
} else if(LHCStatus.Contains("RAMP")){
fLHCStatus = kRAMP;
} else {
fLHCStatus = kNONE;
}
if(fLHCStatus == 0) {
if (beamType.Contains("p")) {
if (beamType.Contains("A")) {
fBeamType = kpA;
} else {
fBeamType = kpp;
}
} else if (beamType.Contains("A")) {
fBeamType = kAA;
}
fBeamEnergy=beamEnergy;
} else {
fBeamType = knone;
fBeamEnergy=0.f;
}
};
Bool_t AliRPCValueDCS::IsEqual (const TObject *obj) const {
return fTimeStamp == ((AliRPCValueDCS*)obj)->GetTimeStamp();
};
Int_t AliRPCValueDCS::Compare(const TObject *obj) const {
if ( fTimeStamp < ((AliRPCValueDCS*)obj)->GetTimeStamp() ) return -1;
if ( fTimeStamp == ((AliRPCValueDCS*)obj)->GetTimeStamp() ) return 0;
else return 1;
};
TString* AliRPCValueDCS::WhatIsThis() const {
TString *className =new TString(((TClass*)this->IsA())->GetName());
if (className->Contains("AliRPCValueCurrent")) {
delete className;
return new TString("current");
} else if (className->Contains("AliRPCValueVoltage")) {
delete className;
return new TString("voltage");
} else if (className->Contains("AliRPCValueScaler")) {
delete className;
return new TString("scaler");
} else if (className->Contains("AliRPCOverflowStatistics")) {
delete className;
return new TString("overflow");
} else {
delete className;
return new TString("unknown");
}
};
void AliRPCValueDCS::SetRunNumber(UInt_t RunNumber){
//AMANDA needs to be set, OCDB run Rumber are set when created
if(this->IsAMANDA()) fRunNumber=RunNumber;
}
TString AliRPCValueDCS::fHumanBeamType() const {
switch (fBeamType){
case kpp: return "p-p";
case kpA: return "p-A";
case kAA: return "A-A";
case knone: return "None";
default: return "Unknown";
}
};
TString AliRPCValueDCS::fHumanLHCStatusType() const {
switch (fLHCStatus){
case kBEAM: return "STABLE BEAMS";
case kNONE: return "UNKNOWN";
case kNOBEAM: return "NO BEAM";
case kDUMP: return "BEAM DUMP";
case kRAMP: return "RAMP DOWN";
default: return "UNKNOWN";
}
}