Skip to content

Commit 2d02d96

Browse files
authored
Merge pull request AliceO2Group#1 from ktf/remote-gui
Remote gui
2 parents 42dce0e + 024940e commit 2d02d96

File tree

127 files changed

+2877
-1359
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+2877
-1359
lines changed

CCDB/src/BasicCCDBManager.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ void CCDBManagerInstance::reportFatal(std::string_view err)
3434

3535
std::pair<uint64_t, uint64_t> CCDBManagerInstance::getRunDuration(int runnumber) const
3636
{
37-
auto response = mCCDBAccessor.retrieveHeaders("RCT/RunInformation", std::map<std::string, std::string>(), runnumber);
37+
auto response = mCCDBAccessor.retrieveHeaders("RCT/Info/RunInformation", std::map<std::string, std::string>(), runnumber);
3838
if (response.size() == 0 || response.find("SOR") == response.end() || response.find("EOR") == response.end()) {
39-
LOG(fatal) << "Empty or missing response from query to RCT/RunInformation for run " << runnumber;
39+
LOG(fatal) << "Empty or missing response from query to RCT/Info/RunInformation for run " << runnumber;
4040
}
4141
auto sor = boost::lexical_cast<uint64_t>(response["SOR"]);
4242
auto eor = boost::lexical_cast<uint64_t>(response["EOR"]);

DataFormats/Detectors/CTP/include/DataFormatsCTP/Configuration.h

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ namespace ctp
2929
{
3030
/// Database constants
3131
const std::string CCDBPathCTPConfig = "CTP/Config/Config";
32-
const std::string CCDBPathCTPScalers = "CTP/Scalers";
3332
///
3433
/// CTP Config items
3534
struct BCMask {
@@ -69,6 +68,7 @@ struct CTPDescriptor {
6968
struct CTPDetector {
7069
CTPDetector() = default;
7170
o2::detectors::DetID::ID detID;
71+
o2::detectors::DetID::mask_t getMask() const { return o2::detectors::DetID(detID).getMask(); }
7272
const char* getName() const { return o2::detectors::DetID::getName(detID); }
7373
uint32_t HBaccepted; /// Number of HB frames in TF to be accepted
7474
std::string mode = "";
@@ -92,13 +92,14 @@ struct CTPClass {
9292
CTPDescriptor const* descriptor = nullptr;
9393
CTPCluster const* cluster = nullptr;
9494
int clusterIndex = 0;
95-
;
95+
int descriptorIndex = 0;
9696
void printStream(std::ostream& strem) const;
97-
ClassDefNV(CTPClass, 2);
97+
ClassDefNV(CTPClass, 3);
9898
};
9999
class CTPConfiguration
100100
{
101101
public:
102+
const static std::map<std::string, std::string> detName2LTG;
102103
CTPConfiguration() = default;
103104
bool isDetector(const o2::detectors::DetID& det);
104105
void capitaliseString(std::string& str);
@@ -112,13 +113,6 @@ class CTPConfiguration
112113
CLASS,
113114
UNKNOWN };
114115
int loadConfigurationRun3(const std::string& ctpconfiguartion);
115-
int loadConfiguration(const std::string& ctpconfiguartion);
116-
void addBCMask(const BCMask& bcmask);
117-
void addCTPInput(const CTPInput& input);
118-
void addCTPDescriptor(const CTPDescriptor& descriptor);
119-
void addCTPDetector(const CTPDetector& detector);
120-
void addCTPCluster(const CTPCluster& cluster);
121-
void addCTPClass(const CTPClass& ctpclass);
122116
void printStream(std::ostream& stream) const;
123117
std::vector<CTPInput>& getCTPInputs() { return mInputs; }
124118
std::vector<CTPClass>& getCTPClasses() { return mCTPClasses; }
@@ -131,6 +125,8 @@ class CTPConfiguration
131125
uint64_t getTriggerClassMask() const;
132126
std::vector<int> getTriggerClassList() const;
133127
uint32_t getRunNumber() { return mRunNumber; };
128+
std::vector<std::string> getDetectorList() const;
129+
o2::detectors::DetID::mask_t getDetectorMask() const;
134130

135131
private:
136132
std::string mConfigString = "";
@@ -145,8 +141,7 @@ class CTPConfiguration
145141
std::vector<CTPCluster> mClusters;
146142
std::vector<CTPClass> mCTPClasses;
147143
int processConfigurationLineRun3(std::string& line, int& level);
148-
int processConfigurationLine(std::string& line, int& level);
149-
ClassDefNV(CTPConfiguration, 4);
144+
ClassDefNV(CTPConfiguration, 5);
150145
};
151146
// Run Manager
152147
struct CTPActiveRun {
@@ -168,21 +163,29 @@ class CTPRunManager
168163
void printActiveRuns() const;
169164
int saveRunScalersToCCDB(int i);
170165
int saveRunConfigToCCDB(CTPConfiguration* cfg, long timeStart);
171-
int getConfigFromCCDB();
172-
int getScalersFromCCDB();
166+
CTPConfiguration getConfigFromCCDB(long timestamp, std::string run);
167+
CTPRunScalers getScalersFromCCDB(long timestamp, std::string);
173168
int loadScalerNames();
174-
void setCcdbHost(std::string host) { mCcdbHost = host; };
169+
// void setCCDBPathConfig(std::string path) { mCCDBPathCTPConfig = path;};
170+
void setCCDBPathScalers(std::string path) { mCCDBPathCTPScalers = path; };
171+
void setCCDBHost(std::string host) { mCCDBHost = host; };
172+
void setCTPQC(int qc) { mQC = qc; };
173+
void printCounters();
175174

176175
private:
177-
std::string mCcdbHost = "http://ccdb-test.cern.ch:8080";
176+
/// Database constants
177+
// std::string mCCDBHost = "http://ccdb-test.cern.ch:8080";
178+
std::string mCCDBHost = "http://o2-ccdb.internal:8080";
179+
std::string mCCDBPathCTPScalers = "CTP/Calib/Scalers";
178180
std::array<CTPActiveRun*, NRUNS> mActiveRuns;
179181
std::array<std::uint32_t, NRUNS> mActiveRunNumbers;
180182
std::array<uint32_t, CTPRunScalers::NCOUNTERS> mCounters;
181183
std::map<std::string, uint32_t> mScalerName2Position;
182184
CTPActiveRun* mRunInStart = nullptr;
183185
int mEOX = 0; // redundancy check
184186
int mCtpcfg = 0;
185-
ClassDefNV(CTPRunManager, 2);
187+
int mQC = 0; // 1 - no CCDB: used for QC
188+
ClassDefNV(CTPRunManager, 4);
186189
};
187190
} // namespace ctp
188191
} // namespace o2

DataFormats/Detectors/CTP/include/DataFormatsCTP/Scalers.h

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,18 +57,20 @@ struct CTPScalerO2 {
5757
struct CTPScalerRecordRaw {
5858
CTPScalerRecordRaw() = default;
5959
o2::InteractionRecord intRecord;
60-
uint64_t epochTime;
60+
double_t epochTime;
6161
std::vector<CTPScalerRaw> scalers;
62+
std::vector<uint32_t> scalersDets;
6263
void printStream(std::ostream& stream) const;
63-
ClassDefNV(CTPScalerRecordRaw, 1);
64+
ClassDefNV(CTPScalerRecordRaw, 3);
6465
};
6566
struct CTPScalerRecordO2 {
6667
CTPScalerRecordO2() = default;
6768
o2::InteractionRecord intRecord;
68-
uint64_t epochTime;
69+
double_t epochTime;
6970
std::vector<CTPScalerO2> scalers;
71+
std::vector<uint64_t> scalersDets;
7072
void printStream(std::ostream& stream) const;
71-
ClassDefNV(CTPScalerRecordO2, 1);
73+
ClassDefNV(CTPScalerRecordO2, 3);
7274
};
7375
class CTPRunScalers
7476
{
@@ -82,27 +84,32 @@ class CTPRunScalers
8284
int checkConsistency(const CTPScalerO2& scal0, const CTPScalerO2& scal1) const;
8385
int checkConsistency(const CTPScalerRecordO2& rec0, const CTPScalerRecordO2& rec1) const;
8486
void setClassMask(std::bitset<CTP_NCLASSES> classMask) { mClassMask = classMask; };
87+
void setDetectorMask(o2::detectors::DetID::mask_t mask) { mDetectorMask = mask; };
8588
void setRunNumber(uint32_t rnumber) { mRunNumber = rnumber; };
89+
void addScalerRacordRaw(CTPScalerRecordRaw& scalerrecordraw) { mScalerRecordRaw.push_back(scalerrecordraw); };
90+
int printRates();
91+
int printIntegrals();
8692
//
87-
int parseZMQScalers(std::string zmqscalers);
88-
static constexpr uint32_t NCOUNTERS = 1052;
93+
// static constexpr uint32_t NCOUNTERS = 1052;
94+
static constexpr uint32_t NCOUNTERS = 1070;
8995
static std::vector<std::string> scalerNames;
9096

9197
private:
9298
// map from class index to overflow
9399
// overflow counts how many time class scalerers overflowed
94100
typedef std::map<uint32_t, std::array<uint32_t, 6>> overflows_t;
95-
int mVersion;
96-
uint32_t mRunNumber;
101+
int mVersion = 0;
102+
uint32_t mRunNumber = 0;
97103
// using class mask for all class index related stuff
98104
std::bitset<CTP_NCLASSES> mClassMask;
105+
o2::detectors::DetID::mask_t mDetectorMask;
99106
std::vector<CTPScalerRecordRaw> mScalerRecordRaw;
100107
std::vector<CTPScalerRecordO2> mScalerRecordO2;
101108
int processScalerLine(const std::string& line, int& level, int& nclasses);
102109
int copyRawToO2ScalerRecord(const CTPScalerRecordRaw& rawrec, CTPScalerRecordO2& o2rec, overflows_t& classesoverflows);
103110
int updateOverflows(const CTPScalerRecordRaw& rec0, const CTPScalerRecordRaw& rec1, overflows_t& classesoverflows) const;
104111
int updateOverflows(const CTPScalerRaw& scal0, const CTPScalerRaw& scal1, std::array<uint32_t, 6>& overflow) const;
105-
ClassDefNV(CTPRunScalers, 1);
112+
ClassDefNV(CTPRunScalers, 2);
106113
};
107114
} // namespace ctp
108115
} // namespace o2

0 commit comments

Comments
 (0)