Skip to content

Commit ee59676

Browse files
author
Christian Holm Christensen
authored
Merge branch 'AliceO2Group:dev' into cholmcc_generatos
2 parents d65a0c9 + fa81df3 commit ee59676

File tree

251 files changed

+11561
-5328
lines changed

Some content is hidden

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

251 files changed

+11561
-5328
lines changed

CCDB/include/CCDB/CCDBDownloader.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ typedef struct uv_signal_s uv_signal_t;
2929
typedef struct uv_async_s uv_async_t;
3030
typedef struct uv_handle_s uv_handle_t;
3131

32-
using namespace std;
33-
3432
namespace o2::ccdb
3533
{
3634

Common/SimConfig/src/SimConfig.cxx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,12 @@ void SimConfig::determineActiveModules(std::vector<std::string> const& inputargs
9393
#ifdef ENABLE_UPGRADES
9494
if (mIsRun5) {
9595
for (int d = DetID::First; d <= DetID::Last; ++d) {
96-
if (d == DetID::IT3 || d == DetID::TRK || d == DetID::FT3 || d == DetID::FCT) {
96+
if (d == DetID::TRK || d == DetID::FT3 || d == DetID::FCT) {
9797
activeModules.emplace_back(DetID::getName(d));
9898
}
9999
}
100100
activeModules.emplace_back("A3IP");
101+
activeModules.emplace_back("A3ABSO");
101102
} else {
102103
#endif
103104
// add passive components manually (make a PassiveDetID for them!)

Common/Utils/include/CommonUtils/ConfigurableParam.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#define COMMON_SIMCONFIG_INCLUDE_SIMCONFIG_CONFIGURABLEPARAM_H_
1616

1717
#include <vector>
18+
#include <cassert>
1819
#include <map>
1920
#include <unordered_map>
2021
#include <boost/property_tree/ptree.hpp>

Common/Utils/include/CommonUtils/ShmManager.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,12 @@
2323
#include <cstddef>
2424
#include <atomic>
2525

26+
#if !defined(__CINT__) && !defined(__MAKECINT__) && !defined(__ROOTCLING__) && !defined(__CLING__)
2627
#include <boost/interprocess/managed_external_buffer.hpp>
2728
#include <boost/interprocess/allocators/allocator.hpp>
29+
#endif
2830

29-
#if !defined(__CINT__) && !defined(__MAKECINT__) && !defined(__ROOTCLING__) && !defined(__CLING__)
31+
#if !defined(__CINT__) && !defined(__MAKECINT__) && !defined(__ROOTCLING__) && !defined(__CLING__) && !defined(__APPLE__)
3032
// this shared mem mode is meant for compiled stuff in o2-sim; not for ROOT sessions
3133
#define USESHM 1
3234
#endif
@@ -116,8 +118,10 @@ class ShmManager
116118
void* tryAttach(bool& success);
117119
size_t getPointerOffset(void* ptr) const { return (size_t)((char*)ptr - (char*)mBufferPtr); }
118120

121+
#if !defined(__CINT__) && !defined(__MAKECINT__) && !defined(__ROOTCLING__) && !defined(__CLING__)
119122
boost::interprocess::wmanaged_external_buffer* boostmanagedbuffer;
120123
boost::interprocess::allocator<char, boost::interprocess::wmanaged_external_buffer::segment_manager>* boostallocator;
124+
#endif
121125
};
122126

123127
} // namespace utils

Common/Utils/src/ShmManager.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ bool ShmManager::createGlobalSegment(int nsegments)
119119
return false;
120120
}
121121

122-
LOG(info) << "CREATING SIM SHARED MEM SEGMENT FOR " << nsegments << " WORKERS";
123122
#ifdef USESHM
123+
LOG(info) << "CREATING SIM SHARED MEM SEGMENT FOR " << nsegments << " WORKERS";
124124
// LOG(info) << "SIZEOF ShmMetaInfo " << sizeof(ShmMetaInfo);
125125
const auto totalsize = sizeof(ShmMetaInfo) + SHMPOOLSIZE * nsegments;
126126
if ((mShmID = shmget(IPC_PRIVATE, totalsize, IPC_CREAT | 0666)) == -1) {

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

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,16 @@ namespace ctp
2929
struct CTFHeader : public o2::ctf::CTFDictHeader {
3030
uint64_t lumiCounts = 0; /// FT0 Luminosity counts moving average over lumiNHBFs orbits
3131
uint64_t lumiCountsFV0 = 0; /// FV0 Luminosity counts moving average over lumiNHBFs orbits
32-
uint32_t lumiNHBFs = 0; /// Number of HBFs over which lumi is integrated
33-
uint32_t lumiOrbit = 0; /// 1st orbit of TF where lumi was updated, can be compared with firstOrbit
34-
uint32_t nTriggers = 0; /// number of triggers
35-
uint32_t firstOrbit = 0; /// orbit of 1st trigger
36-
uint16_t firstBC = 0; /// bc of 1st trigger
37-
38-
ClassDefNV(CTFHeader, 3);
32+
uint32_t lumiNHBFs = 0; /// Number of HBFs over which lumi is integrated
33+
uint32_t lumiNHBFsFV0 = 0; /// Number of FV0 HBFs over which lumi is integrated
34+
uint32_t lumiOrbit = 0; /// 1st orbit of TF where lumi was updated, can be compared with firstOrbit
35+
uint32_t nTriggers = 0; /// number of triggers
36+
uint32_t firstOrbit = 0; /// orbit of 1st trigger
37+
uint16_t firstBC = 0; /// bc of 1st trigger
38+
uint16_t inp1 = 0; /// lumiCounts input ID
39+
uint16_t inp2 = 0; /// lumiCountsFV0 input ID
40+
41+
ClassDefNV(CTFHeader, 5);
3942
};
4043

4144
/// wrapper for the Entropy-encoded trigger inputs and classes of the TF

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,10 @@ struct LumiInfo {
3232
int inp2 = 6; // VBA
3333
float getLumi() const { return nHBFCounted > 0 ? float(counts / (nHBFCounted * o2::constants::lhc::LHCOrbitMUS * 1e-6)) : 0.f; }
3434
float getLumiFV0() const { return nHBFCountedFV0 > 0 ? float(countsFV0 / (nHBFCountedFV0 * o2::constants::lhc::LHCOrbitMUS * 1e-6)) : 0.f; }
35+
float getLumiAlt() const { return getLumiFV0(); }
3536
float getLumiError() const { return nHBFCounted > 0 ? float(std::sqrt(counts) / (nHBFCounted * o2::constants::lhc::LHCOrbitMUS * 1e-6)) : 0.f; }
3637
float getLumiFV0Error() const { return nHBFCountedFV0 > 0 ? float(std::sqrt(countsFV0) / (nHBFCountedFV0 * o2::constants::lhc::LHCOrbitMUS * 1e-6)) : 0.f; }
38+
float getLumiAltError() const { return getLumiFV0Error(); }
3739
void printInputs() const;
3840
ClassDefNV(LumiInfo, 3);
3941
};

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

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,19 +67,21 @@ struct CTPScalerRecordRaw {
6767
o2::InteractionRecord intRecord;
6868
double_t epochTime;
6969
std::vector<CTPScalerRaw> scalers;
70-
std::vector<uint32_t> scalersDets;
70+
// std::vector<uint32_t> scalersDets;
71+
std::vector<uint32_t> scalersInps;
7172
void printStream(std::ostream& stream) const;
72-
ClassDefNV(CTPScalerRecordRaw, 3);
73+
ClassDefNV(CTPScalerRecordRaw, 4);
7374
};
7475
struct CTPScalerRecordO2 {
7576
CTPScalerRecordO2() = default;
7677
o2::InteractionRecord intRecord;
7778
double_t epochTime;
7879
std::vector<CTPScalerO2> scalers;
79-
std::vector<uint64_t> scalersDets;
80+
// std::vector<uint64_t> scalersDets;
81+
std::vector<uint64_t> scalersInps;
8082
void printStream(std::ostream& stream) const;
8183
void printFromZero(std::ostream& stream, CTPScalerRecordO2& record0) const;
82-
ClassDefNV(CTPScalerRecordO2, 3);
84+
ClassDefNV(CTPScalerRecordO2, 4);
8385
};
8486
class CTPRunScalers
8587
{
@@ -103,6 +105,8 @@ class CTPRunScalers
103105
uint32_t getRunNUmber() { return mRunNumber; };
104106
int printRates();
105107
int printIntegrals();
108+
int printInputRateAndIntegral(int inp);
109+
int printClassBRateAndIntegral(int icls);
106110
//
107111
// static constexpr uint32_t NCOUNTERS = 1052;
108112
// v1
@@ -144,10 +148,10 @@ class CTPRunScalers
144148
std::vector<CTPScalerRecordRaw> mScalerRecordRaw;
145149
std::vector<CTPScalerRecordO2> mScalerRecordO2;
146150
int processScalerLine(const std::string& line, int& level, int& nclasses);
147-
int copyRawToO2ScalerRecord(const CTPScalerRecordRaw& rawrec, CTPScalerRecordO2& o2rec, overflows_t& classesoverflows);
151+
int copyRawToO2ScalerRecord(const CTPScalerRecordRaw& rawrec, CTPScalerRecordO2& o2rec, overflows_t& classesoverflows, std::array<uint32_t, 48>& overflows);
148152
int updateOverflows(const CTPScalerRecordRaw& rec0, const CTPScalerRecordRaw& rec1, overflows_t& classesoverflows) const;
149153
int updateOverflows(const CTPScalerRaw& scal0, const CTPScalerRaw& scal1, std::array<uint32_t, 6>& overflow) const;
150-
154+
int updateOverflowsInps(const CTPScalerRecordRaw& rec0, const CTPScalerRecordRaw& rec1, std::array<uint32_t, 48>& overflow) const;
151155
ClassDefNV(CTPRunScalers, 2);
152156
};
153157
} // namespace ctp

DataFormats/Detectors/CTP/src/RunManager.cxx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ int CTPRunManager::addScalers(uint32_t irun, std::time_t time)
122122
}
123123
// detectors
124124
// std::vector<std::string> detlist = mActiveRuns[irun]->cfg.getDetectorList();
125+
/*
125126
o2::detectors::DetID::mask_t detmask = mActiveRuns[irun]->cfg.getDetectorMask();
126127
for (uint32_t i = 0; i < 32; i++) {
127128
o2::detectors::DetID::mask_t deti = 1ul << i;
@@ -134,6 +135,14 @@ int CTPRunManager::addScalers(uint32_t irun, std::time_t time)
134135
// LOG(info) << "Scaler for detector:" << countername << ":" << detcount;
135136
}
136137
}
138+
*/
139+
int NINPS = 48;
140+
int offset = 599;
141+
for (uint32_t i = 0; i < NINPS; i++) {
142+
uint32_t inpcount = mCounters[offset + i];
143+
scalrec.scalersInps.push_back(inpcount);
144+
// LOG(info) << "Scaler for input:" << CTPRunScalers::scalerNames[offset+i] << ":" << inpcount;
145+
}
137146
//
138147
if (mNew == 0) {
139148
scalrec.intRecord.orbit = mCounters[mScalerName2Position[orb]];

DataFormats/Detectors/CTP/src/Scalers.cxx

Lines changed: 70 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ void CTPScalerRecordRaw::printStream(std::ostream& stream) const
6565
for (auto const& cnts : scalers) {
6666
cnts.printStream(stream);
6767
}
68-
for (auto const& dets : scalersDets) {
68+
std::cout << "Inputs:" << scalersInps.size() << std::endl;
69+
for (auto const& dets : scalersInps) {
6970
stream << dets << " ";
7071
}
7172
stream << std::endl;
@@ -77,7 +78,8 @@ void CTPScalerRecordO2::printStream(std::ostream& stream) const
7778
for (auto const& cnts : scalers) {
7879
cnts.printStream(stream);
7980
}
80-
for (auto const& dets : scalersDets) {
81+
std::cout << "Inputs:" << scalersInps.size() << std::endl;
82+
for (auto const& dets : scalersInps) {
8183
stream << dets << " ";
8284
}
8385
stream << std::endl;
@@ -273,10 +275,12 @@ int CTPRunScalers::convertRawToO2()
273275
overflows[i] = {0, 0, 0, 0, 0, 0};
274276
}
275277
}
278+
// Input overflows
279+
std::array<uint32_t, 48> overflowsInputs = {48 * 0};
276280
errorCounters eCnts;
277281
// 1st o2 rec is just copy
278282
CTPScalerRecordO2 o2rec;
279-
copyRawToO2ScalerRecord(mScalerRecordRaw[0], o2rec, overflows);
283+
copyRawToO2ScalerRecord(mScalerRecordRaw[0], o2rec, overflows, overflowsInputs);
280284
mScalerRecordO2.push_back(o2rec);
281285
int j = 1;
282286
for (uint32_t i = 1; i < mScalerRecordRaw.size(); i++) {
@@ -285,7 +289,8 @@ int CTPRunScalers::convertRawToO2()
285289
//
286290
if (ret == 0) {
287291
CTPScalerRecordO2 o2rec;
288-
copyRawToO2ScalerRecord(mScalerRecordRaw[i], o2rec, overflows);
292+
ret = updateOverflowsInps(mScalerRecordRaw[i - 1], mScalerRecordRaw[i], overflowsInputs);
293+
copyRawToO2ScalerRecord(mScalerRecordRaw[i], o2rec, overflows, overflowsInputs);
289294
mScalerRecordO2.push_back(o2rec);
290295
// Check consistency
291296
checkConsistency(mScalerRecordO2[j - 1], mScalerRecordO2[j], eCnts);
@@ -295,7 +300,7 @@ int CTPRunScalers::convertRawToO2()
295300
eCnts.printStream(std::cout);
296301
return 0;
297302
}
298-
int CTPRunScalers::copyRawToO2ScalerRecord(const CTPScalerRecordRaw& rawrec, CTPScalerRecordO2& o2rec, overflows_t& classesoverflows)
303+
int CTPRunScalers::copyRawToO2ScalerRecord(const CTPScalerRecordRaw& rawrec, CTPScalerRecordO2& o2rec, overflows_t& classesoverflows, std::array<uint32_t, 48>& overflows)
299304
{
300305
if (rawrec.scalers.size() != (mClassMask.count())) {
301306
LOG(error) << "Inconsistent scaler record size:" << rawrec.scalers.size() << " Expected:" << mClassMask.count();
@@ -313,6 +318,10 @@ int CTPRunScalers::copyRawToO2ScalerRecord(const CTPScalerRecordRaw& rawrec, CTP
313318
o2scal.createCTPScalerO2FromRaw(rawscal, classesoverflows[k]);
314319
o2rec.scalers.push_back(o2scal);
315320
}
321+
for (int i = 0; i < rawrec.scalersInps.size(); i++) {
322+
uint64_t inpo2 = (uint64_t)(rawrec.scalersInps[i]) + 0xffffffffull * (uint64_t)(overflows[i]);
323+
o2rec.scalersInps.push_back(inpo2);
324+
}
316325
return 0;
317326
}
318327
int CTPRunScalers::checkConsistency(const CTPScalerO2& scal0, const CTPScalerO2& scal1, errorCounters& eCnts) const
@@ -452,6 +461,26 @@ int CTPRunScalers::updateOverflows(const CTPScalerRaw& scal0, const CTPScalerRaw
452461
//std::cout << std::endl;
453462
return 0;
454463
}
464+
//
465+
int CTPRunScalers::updateOverflowsInps(const CTPScalerRecordRaw& rec0, const CTPScalerRecordRaw& rec1, std::array<uint32_t, 48>& overflow) const
466+
{
467+
int NINPS = 48;
468+
if (rec0.scalersInps.size() < NINPS) {
469+
LOG(error) << "updateOverflowsInps.size < 48:" << rec0.scalersInps.size();
470+
return 1;
471+
}
472+
if (rec1.scalersInps.size() < NINPS) {
473+
LOG(error) << "updateOverflowsInps.size < 48:" << rec1.scalersInps.size();
474+
return 2;
475+
}
476+
for (int i = 0; i < NINPS; i++) {
477+
if (rec0.scalersInps[i] > rec1.scalersInps[i]) {
478+
overflow[i] += 1;
479+
}
480+
}
481+
return 0;
482+
}
483+
//
455484
int CTPRunScalers::printRates()
456485
{
457486
if (mScalerRecordO2.size() == 0) {
@@ -507,7 +536,42 @@ int CTPRunScalers::printIntegrals()
507536
}
508537
return 0;
509538
}
510-
539+
//
540+
// Input counting 1..48
541+
int CTPRunScalers::printInputRateAndIntegral(int inp)
542+
{
543+
if (mScalerRecordO2.size() == 0) {
544+
LOG(info) << "ScalerRecord is empty, doing nothing";
545+
return 1;
546+
}
547+
double_t time0 = mScalerRecordO2[0].epochTime;
548+
double_t timeL = mScalerRecordO2[mScalerRecordO2.size() - 1].epochTime;
549+
int integral = mScalerRecordO2[mScalerRecordO2.size() - 1].scalersInps[inp - 1] - mScalerRecordO2[0].scalersInps[inp - 1];
550+
std::cout << "Scaler Integrals for run:" << mRunNumber << " duration:" << timeL - time0;
551+
std::cout << " Input " << inp << " integral:" << integral << " rate:" << integral / (timeL - time0) << std::endl;
552+
return 0;
553+
}
554+
// Prints class before counters for lumi
555+
// Class counting 1..64
556+
int CTPRunScalers::printClassBRateAndIntegral(int icls)
557+
{
558+
if (mScalerRecordO2.size() == 0) {
559+
LOG(info) << "ScalerRecord is empty, doing nothing";
560+
return 1;
561+
}
562+
double_t time0 = mScalerRecordO2[0].epochTime;
563+
double_t timeL = mScalerRecordO2[mScalerRecordO2.size() - 1].epochTime;
564+
if (mScalerRecordO2[0].scalers.size() < icls) {
565+
LOG(error) << "class number bigger than expected for this run:" << icls << "expexted smaller than:" << mScalerRecordO2[0].scalers.size();
566+
return 1;
567+
} else {
568+
int integral = mScalerRecordO2[mScalerRecordO2.size() - 1].scalers[icls - 1].lmBefore - mScalerRecordO2[0].scalers[icls - 1].lmBefore;
569+
std::cout << "Scaler Integrals for run:" << mRunNumber << " duration:" << timeL - time0;
570+
std::cout << " Class " << icls << " integral:" << integral << " rate:" << integral / (timeL - time0) << std::endl;
571+
}
572+
return 0;
573+
}
574+
//
511575
void CTPRunScalers::printLMBRateVsT() const
512576
{
513577
for (int i = 1; i < mScalerRecordO2.size(); i++) { // loop over time

0 commit comments

Comments
 (0)