Skip to content

Commit 847793b

Browse files
authored
Merge branch 'AliceO2Group:dev' into new-detector4
2 parents 27410da + 7fccf1d commit 847793b

File tree

127 files changed

+2288
-1327
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

+2288
-1327
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ bazel-*
8282
# direnv
8383
.envrc
8484

85+
# git wrappers
86+
.sl
87+
8588
# LSP support on macOS with vim
8689
.clangd
8790
DataFormats/Detectors/CTP/include/DataFormatsCTP/Scalers.h

CCDB/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ If you access the CCDB with a web browser, add `/browse` at the end of the URL t
3131
```c++
3232
// init
3333
CcdbApi api;
34-
map<string, string> metadata; // can be empty
34+
std::map<std::string, std::string> metadata; // can be empty
3535
api.init("http://ccdb-test.cern.ch:8080"); // or http://localhost:8080 for a local installation
3636
// store abitrary user object in strongly typed manner
3737
auto deadpixels = new o2::FOO::DeadPixelMap();
3838
api.storeAsTFileAny(deadpixels, "FOO/DeadPixels", metadata);
3939
// read like this (you have to specify the type)
4040
auto deadpixelsback = api.retrieveFromTFileAny<o2::FOO::DeadPixelMap>("FOO/DeadPixels", metadata);
4141
// read like this to get the headers as well, and thus the metadata attached to the object
42-
map<string, string> headers;
42+
std::map<std::string, std::string> headers;
4343
auto deadpixelsback = api.retrieveFromTFileAny<o2::FOO::DeadPixelMap>("FOO/DeadPixels", metadata /* constraint the objects retrieved to those matching the metadata */, -1 /* timestamp */, &headers /* the headers attached to the returned object */);
4444
// finally, use this method to retrieve only the headers (and thus the metadata)
4545
std::map<std::string, std::string> headers = f.api.retrieveHeaders("FOO/DeadPixels", f.metadata);
@@ -50,7 +50,7 @@ std::map<std::string, std::string> headers = f.api.retrieveHeaders("FOO/DeadPixe
5050
```c++
5151
// init
5252
CcdbApi api;
53-
map<string, string> metadata; // can be empty
53+
std::map<std::string, std::string> metadata; // can be empty
5454
api.init("http://ccdb-test.cern.ch:8080"); // or http://localhost:8080 for a local installation
5555
// create a local snapshot of everthing in or below the FOO folder valid for timestamp 12345
5656
api.snapshot("FOO", "/tmp/CCDBSnapshot/", 12345);

CCDB/include/CCDB/CCDBDownloader.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ namespace o2::ccdb
4141
#if !defined(__CINT__) && !defined(__MAKECINT__) && !defined(__ROOTCLING__) && !defined(__CLING__)
4242
struct HeaderObjectPair_t {
4343
std::multimap<std::string, std::string> header;
44-
std::pmr::vector<char>* object = nullptr;
44+
o2::pmr::vector<char>* object = nullptr;
4545
int counter = 0;
4646
};
4747

CCDB/include/CCDB/CcdbApi.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ class CcdbApi //: public DatabaseInterface
355355

356356
#if !defined(__CINT__) && !defined(__MAKECINT__) && !defined(__ROOTCLING__) && !defined(__CLING__)
357357
typedef struct RequestContext {
358-
std::pmr::vector<char>& dest;
358+
o2::pmr::vector<char>& dest;
359359
std::string path;
360360
std::map<std::string, std::string> const& metadata;
361361
long timestamp;
@@ -365,7 +365,7 @@ class CcdbApi //: public DatabaseInterface
365365
std::string createdNotBefore;
366366
bool considerSnapshot;
367367

368-
RequestContext(std::pmr::vector<char>& d,
368+
RequestContext(o2::pmr::vector<char>& d,
369369
std::map<std::string, std::string> const& m,
370370
std::map<std::string, std::string>& h)
371371
: dest(d), metadata(m), headers(h) {}
@@ -379,7 +379,7 @@ class CcdbApi //: public DatabaseInterface
379379

380380
void getFromSnapshot(bool createSnapshot, std::string const& path,
381381
long timestamp, std::map<std::string, std::string>& headers,
382-
std::string& snapshotpath, std::pmr::vector<char>& dest, int& fromSnapshot, std::string const& etag) const;
382+
std::string& snapshotpath, o2::pmr::vector<char>& dest, int& fromSnapshot, std::string const& etag) const;
383383
void releaseNamedSemaphore(boost::interprocess::named_semaphore* sem, std::string const& path) const;
384384
boost::interprocess::named_semaphore* createNamedSemaphore(std::string const& path) const;
385385
static std::string determineSemaphoreName(std::string const& basedir, std::string const& objectpath);
@@ -388,22 +388,22 @@ class CcdbApi //: public DatabaseInterface
388388
static bool removeSemaphore(std::string const& name, bool remove = false);
389389
static void removeLeakingSemaphores(std::string const& basedir, bool remove = false);
390390

391-
void loadFileToMemory(std::pmr::vector<char>& dest, const std::string& path, std::map<std::string, std::string>* localHeaders = nullptr, bool fetchLocalMetaData = true) const;
392-
void loadFileToMemory(std::pmr::vector<char>& dest, std::string const& path,
391+
void loadFileToMemory(o2::pmr::vector<char>& dest, const std::string& path, std::map<std::string, std::string>* localHeaders = nullptr, bool fetchLocalMetaData = true) const;
392+
void loadFileToMemory(o2::pmr::vector<char>& dest, std::string const& path,
393393
std::map<std::string, std::string> const& metadata, long timestamp,
394394
std::map<std::string, std::string>* headers, std::string const& etag,
395395
const std::string& createdNotAfter, const std::string& createdNotBefore, bool considerSnapshot = true) const;
396396

397397
// Loads files from alien and cvmfs into given destination.
398-
bool loadLocalContentToMemory(std::pmr::vector<char>& dest, std::string& url) const;
398+
bool loadLocalContentToMemory(o2::pmr::vector<char>& dest, std::string& url) const;
399399

400400
// add annotated flattened headers in the end of the blob
401-
static void appendFlatHeader(std::pmr::vector<char>& dest, const std::map<std::string, std::string>& headers);
401+
static void appendFlatHeader(o2::pmr::vector<char>& dest, const std::map<std::string, std::string>& headers);
402402

403403
// the failure to load the file to memory is signaled by 0 size and non-0 capacity
404-
static bool isMemoryFileInvalid(const std::pmr::vector<char>& v) { return v.size() == 0 && v.capacity() > 0; }
404+
static bool isMemoryFileInvalid(const o2::pmr::vector<char>& v) { return v.size() == 0 && v.capacity() > 0; }
405405
template <typename T>
406-
static T* extractFromMemoryBlob(std::pmr::vector<char>& blob)
406+
static T* extractFromMemoryBlob(o2::pmr::vector<char>& blob)
407407
{
408408
auto obj = static_cast<T*>(interpretAsTMemFileAndExtract(blob.data(), blob.size(), typeid(T)));
409409
if constexpr (std::is_base_of<o2::conf::ConfigurableParam, T>::value) {

CCDB/src/CcdbApi.cxx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -844,7 +844,7 @@ bool CcdbApi::retrieveBlob(std::string const& path, std::string const& targetdir
844844
return false;
845845
}
846846

847-
std::pmr::vector<char> buff;
847+
o2::pmr::vector<char> buff;
848848
std::map<std::string, std::string> headers;
849849
// avoid creating snapshot via loadFileToMemory itself
850850
loadFileToMemory(buff, path, metadata, timestamp, &headers, "", createdNotAfter, createdNotBefore, false);
@@ -1830,7 +1830,7 @@ void CcdbApi::removeLeakingSemaphores(std::string const& snapshotdir, bool remov
18301830

18311831
void CcdbApi::getFromSnapshot(bool createSnapshot, std::string const& path,
18321832
long timestamp, std::map<std::string, std::string>& headers,
1833-
std::string& snapshotpath, std::pmr::vector<char>& dest, int& fromSnapshot, std::string const& etag) const
1833+
std::string& snapshotpath, o2::pmr::vector<char>& dest, int& fromSnapshot, std::string const& etag) const
18341834
{
18351835
if (createSnapshot) { // create named semaphore
18361836
std::string logfile = mSnapshotCachePath + "/log";
@@ -1884,7 +1884,7 @@ void CcdbApi::loadFileToMemory(std::vector<char>& dest, std::string const& path,
18841884
std::map<std::string, std::string>* headers, std::string const& etag,
18851885
const std::string& createdNotAfter, const std::string& createdNotBefore, bool considerSnapshot) const
18861886
{
1887-
std::pmr::vector<char> destP;
1887+
o2::pmr::vector<char> destP;
18881888
destP.reserve(dest.size());
18891889
loadFileToMemory(destP, path, metadata, timestamp, headers, etag, createdNotAfter, createdNotBefore, considerSnapshot);
18901890
dest.clear();
@@ -1894,7 +1894,7 @@ void CcdbApi::loadFileToMemory(std::vector<char>& dest, std::string const& path,
18941894
}
18951895
}
18961896

1897-
void CcdbApi::loadFileToMemory(std::pmr::vector<char>& dest, std::string const& path,
1897+
void CcdbApi::loadFileToMemory(o2::pmr::vector<char>& dest, std::string const& path,
18981898
std::map<std::string, std::string> const& metadata, long timestamp,
18991899
std::map<std::string, std::string>* headers, std::string const& etag,
19001900
const std::string& createdNotAfter, const std::string& createdNotBefore, bool considerSnapshot) const
@@ -1912,7 +1912,7 @@ void CcdbApi::loadFileToMemory(std::pmr::vector<char>& dest, std::string const&
19121912
vectoredLoadFileToMemory(contexts);
19131913
}
19141914

1915-
void CcdbApi::appendFlatHeader(std::pmr::vector<char>& dest, const std::map<std::string, std::string>& headers)
1915+
void CcdbApi::appendFlatHeader(o2::pmr::vector<char>& dest, const std::map<std::string, std::string>& headers)
19161916
{
19171917
size_t hsize = getFlatHeaderSize(headers), cnt = dest.size();
19181918
dest.resize(cnt + hsize);
@@ -1977,7 +1977,7 @@ void CcdbApi::vectoredLoadFileToMemory(std::vector<RequestContext>& requestConte
19771977
}
19781978
}
19791979

1980-
bool CcdbApi::loadLocalContentToMemory(std::pmr::vector<char>& dest, std::string& url) const
1980+
bool CcdbApi::loadLocalContentToMemory(o2::pmr::vector<char>& dest, std::string& url) const
19811981
{
19821982
if (url.find("alien:/", 0) != std::string::npos) {
19831983
std::map<std::string, std::string> localHeaders;
@@ -2005,7 +2005,7 @@ bool CcdbApi::loadLocalContentToMemory(std::pmr::vector<char>& dest, std::string
20052005
return false;
20062006
}
20072007

2008-
void CcdbApi::loadFileToMemory(std::pmr::vector<char>& dest, const std::string& path, std::map<std::string, std::string>* localHeaders, bool fetchLocalMetaData) const
2008+
void CcdbApi::loadFileToMemory(o2::pmr::vector<char>& dest, const std::string& path, std::map<std::string, std::string>* localHeaders, bool fetchLocalMetaData) const
20092009
{
20102010
// Read file to memory as vector. For special case of the locally cached file retriev metadata stored directly in the file
20112011
constexpr size_t MaxCopySize = 0x1L << 25;

CCDB/test/testCcdbApi.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ BOOST_AUTO_TEST_CASE(multi_host_test)
560560
api.init("http://bogus-host.cern.ch,http://ccdb-test.cern.ch:8080");
561561
std::map<std::string, std::string> metadata;
562562
std::map<std::string, std::string> headers;
563-
std::pmr::vector<char> dst;
563+
o2::pmr::vector<char> dst;
564564
std::string url = "Analysis/ALICE3/Centrality";
565565
api.loadFileToMemory(dst, url, metadata, 1645780010602, &headers, "", "", "", true);
566566
BOOST_CHECK(dst.size() != 0);
@@ -572,7 +572,7 @@ BOOST_AUTO_TEST_CASE(vectored)
572572
api.init("http://ccdb-test.cern.ch:8080");
573573

574574
int TEST_SAMPLE_SIZE = 5;
575-
std::vector<std::pmr::vector<char>> dests(TEST_SAMPLE_SIZE);
575+
std::vector<o2::pmr::vector<char>> dests(TEST_SAMPLE_SIZE);
576576
std::vector<std::map<std::string, std::string>> metadatas(TEST_SAMPLE_SIZE);
577577
std::vector<std::map<std::string, std::string>> headers(TEST_SAMPLE_SIZE);
578578

CCDB/test/testCcdbApiDownloader.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,12 @@ size_t writeCallbackNoLambda(void* contents, size_t size, size_t nmemb, void* ch
116116
return realsize;
117117
}
118118

119-
std::vector<CURL*> prepareAsyncHandles(size_t num, std::vector<std::pmr::vector<char>*>& dests)
119+
std::vector<CURL*> prepareAsyncHandles(size_t num, std::vector<o2::pmr::vector<char>*>& dests)
120120
{
121121
std::vector<CURL*> handles;
122122

123123
for (int i = 0; i < num; i++) {
124-
auto dest = new std::pmr::vector<char>();
124+
auto dest = new o2::pmr::vector<char>();
125125
dests.push_back(dest);
126126
CURL* curl_handle = curl_easy_init();
127127
handles.push_back(curl_handle);
@@ -154,7 +154,7 @@ BOOST_AUTO_TEST_CASE(asynch_schedule_test)
154154
}
155155

156156
CCDBDownloader downloader;
157-
std::vector<std::pmr::vector<char>*> dests;
157+
std::vector<o2::pmr::vector<char>*> dests;
158158
auto handles = prepareAsyncHandles(TRANSFERS, dests);
159159
size_t transfersLeft = 0;
160160

DataFormats/Detectors/Common/include/DetectorsCommonDataFormats/AlignParam.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class AlignParam
5555
double getZ() const { return mZ; }
5656

5757
/// apply object to geoemetry
58-
bool applyToGeometry() const;
58+
bool applyToGeometry(int printLevel = -1) const;
5959

6060
/// extract global delta matrix
6161
TGeoHMatrix createMatrix() const;

DataFormats/Detectors/Common/src/AlignParam.cxx

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
/// \file AlignParam.cxx
1313
/// \brief Implementation of the base alignment parameters class
1414

15-
#include <fairlogger/Logger.h>
1615
#include <TGeoManager.h>
1716
#include <TGeoMatrix.h>
1817
#include <TGeoOverlap.h>
1918
#include <TGeoPhysicalNode.h>
2019

20+
#include "Framework/Logger.h"
2121
#include "DetectorsCommonDataFormats/AlignParam.h"
2222

2323
using namespace o2::detectors;
@@ -261,7 +261,7 @@ bool AlignParam::createLocalMatrix(TGeoHMatrix& m) const
261261
}
262262

263263
//_____________________________________________________________________________
264-
bool AlignParam::applyToGeometry() const
264+
bool AlignParam::applyToGeometry(int printLevel) const
265265
{
266266
/// Apply the current alignment object to the TGeo geometry
267267
/// This method returns FALSE if the symname of the object was not
@@ -308,13 +308,24 @@ bool AlignParam::applyToGeometry() const
308308
TGeoHMatrix* align = new TGeoHMatrix(createMatrix());
309309
if (mIsGlobal) {
310310
align->Multiply(node->GetMatrix());
311-
TGeoHMatrix* g = node->GetMatrix(node->GetLevel() - 1);
312311
align->MultiplyLeft(node->GetMatrix(node->GetLevel() - 1)->Inverse());
312+
} else {
313+
align->MultiplyLeft(node->GetOriginalMatrix());
313314
}
314-
LOG(debug) << "Aligning volume " << symname;
315315

316316
node->Align(align);
317317

318+
if (getLevel() <= printLevel) {
319+
LOGP(info, "{:*^100}", symname);
320+
LOGP(info, " - Alignment parameter:");
321+
print();
322+
LOGP(info, " - Alignment matrix:");
323+
align->Print();
324+
LOGP(info, " - Node:");
325+
node->Print();
326+
LOGP(info, "{:~^100}", symname);
327+
}
328+
318329
return true;
319330
}
320331

@@ -347,8 +358,8 @@ int AlignParam::getLevel() const
347358
void AlignParam::print() const
348359
{
349360
// print parameters
350-
printf("%s : %6d | X: %+e Y: %+e Z: %+e | pitch: %+e roll: %+e yaw: %e\n", getSymName().c_str(), getAlignableID(), getX(),
351-
getY(), getZ(), getPsi(), getTheta(), getPhi());
361+
printf("%s (Lvl:%2d): %6d | %s | tra: X: %+e Y: %+e Z: %+e | pitch: %+e roll: %+e yaw: %e\n", getSymName().c_str(), getLevel(), getAlignableID(), (mIsGlobal) ? "G" : "L",
362+
getX(), getY(), getZ(), getPsi(), getTheta(), getPhi());
352363
}
353364

354365
//_____________________________________________________________________________

DataFormats/Detectors/TPC/include/DataFormatsTPC/LtrCalibData.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ struct LtrCalibData {
4242
std::vector<uint16_t> matchedLtrIDs; ///< matched laser track IDs
4343
std::vector<uint16_t> nTrackTF; ///< number of laser tracks per TF
4444
std::vector<float> dEdx; ///< dE/dx of each track
45+
float tp{0.f}; ///< temperature over pressure ratio
4546

4647
bool isValid() const
4748
{
@@ -138,7 +139,7 @@ struct LtrCalibData {
138139
dEdx.clear();
139140
}
140141

141-
ClassDefNV(LtrCalibData, 4);
142+
ClassDefNV(LtrCalibData, 5);
142143
};
143144

144145
} // namespace o2::tpc

0 commit comments

Comments
 (0)