Skip to content

Commit 1674604

Browse files
jmyrchaJulian Myrcha
andauthored
o2-eve: HMPID display, fix in display configuration file read (#11997)
* o2-eve: HMPID display, fix in display configuration file read o2-eve-workflow: storing HMPID in *.root/*.json file * clang * LOG->LOGF * clang * geometry for HMP --------- Co-authored-by: Julian Myrcha <jmyrcha@cern.ch>
1 parent 230c821 commit 1674604

29 files changed

+147
-92
lines changed

EventVisualisation/Base/include/EventVisualisationBase/ConfigurationManager.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ namespace o2
2525
namespace event_visualisation
2626
{
2727
/// Version of the software
28-
const static std::string o2_eve_version = "1.60";
28+
const static std::string o2_eve_version = "1.70";
2929

3030
/// Configuration Manager allows an easy access to the config file.
3131
///

EventVisualisation/Base/src/ConfigurationManager.cxx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,21 @@ void ConfigurationManager::getConfig(TEnv& settings) const
3838
return; // precise located options file name read succesfully
3939
}
4040
if (settings.ReadFile(fileName = ".o2eve_config", kEnvUser) < 0) {
41-
LOG(warn) << "could not find .o2eve_config in working directory! Trying .o2eve_config in home directory";
41+
LOGF(warn, "could not find .o2eve_config in working directory! Trying .o2eve_config in home directory");
4242
if (settings.ReadFile(fileName = Form("%s/.o2eve_config", gSystem->Getenv("HOME")), kEnvUser) < 0) {
43-
LOG(warn) << "could not find .o2eve_config in home directory! Trying o2eve_config in home directory";
43+
LOGF(warn, "could not find .o2eve_config in home directory! Trying o2eve_config in home directory");
4444
if (settings.ReadFile(fileName = Form("%s/o2eve_config", gSystem->Getenv("HOME")), kEnvUser) < 0) {
45-
LOG(warn) << "could not find o2eve_config in home directory! Trying o2eve_config in O2/EventVisualisation";
45+
LOGF(warn, "could not find o2eve_config in home directory! Trying o2eve_config in O2/EventVisualisation");
4646
if (settings.ReadFile(fileName = Form("%s/EventVisualisation/o2eve_config",
4747
gSystem->Getenv("ALICEO2_INSTALL_PATH")),
4848
kEnvUser) < 0) {
49-
LOG(fatal) << "could not find .o2eve_config or o2eve_config file!.";
49+
LOGF(fatal, "could not find .o2eve_config or o2eve_config file!.");
5050
exit(0);
5151
}
5252
}
5353
}
5454
}
55-
LOG(info) << Form("using %s config settings", fileName.Data());
55+
LOGF(info, Form("using %s config settings", fileName.Data()));
5656
}
5757

5858
const ConfigurationManager* ConfigurationManager::loadSettings()

EventVisualisation/Base/src/DataSourceOnline.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ std::vector<std::pair<VisualisationEvent, EVisualisationGroup>>
8383
}
8484
auto stop = std::chrono::high_resolution_clock::now();
8585
auto duration = std::chrono::duration_cast<std::chrono::microseconds>(stop - start);
86-
LOG(info) << "getVisualisationList: " << duration.count();
86+
LOGF(info, "getVisualisationList: ", duration.count());
8787
return res;
8888
}
8989

EventVisualisation/Base/src/DirectoryLoader.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,10 @@ std::string DirectoryLoader::getLatestFile(std::string& path, std::vector<std::s
104104
return oldest_file_name;
105105
}
106106

107-
void DirectoryLoader::removeOldestFiles(std::string& path, std::vector<std::string>& ext, int remaining)
107+
void DirectoryLoader::removeOldestFiles(std::string& path, std::vector<std::string>& ext, const int remaining)
108108
{
109109
while (getNumberOfFiles(path, ext) > remaining) {
110-
LOG(info) << "removing oldest file in folder: " << path << " : " << getLatestFile(path, ext);
110+
LOGF(info, "removing oldest file in folder: ", path, " : ", getLatestFile(path, ext));
111111
filesystem::remove(path + "/" + getLatestFile(path, ext));
112112
}
113113
}

EventVisualisation/Base/src/FileWatcher.cxx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ int FileWatcher::getPos() const
143143
bool FileWatcher::refresh()
144144
{
145145
string previous = this->currentItem();
146-
LOG(info) << "previous:" << previous;
147-
LOG(info) << "currentFile:" << this->mCurrentFile;
146+
LOGF(info, "previous:", previous);
147+
LOGF(info, "currentFile:", this->mCurrentFile);
148148

149149
this->mFiles = DirectoryLoader::load(this->mDataFolders, "_", this->mExt); // already sorted according part staring with marker
150150
if (this->mCurrentFile != mEndGuard) {
@@ -165,17 +165,17 @@ bool FileWatcher::refresh()
165165
this->mFiles.push_front(mLowGuard);
166166
this->mFiles.push_back(mEndGuard);
167167

168-
LOG(info) << "this->mFiles.size() = " << this->mFiles.size();
169-
LOG(info) << "this->mCurrentFile = " << this->mCurrentFile;
170-
LOG(info) << "current:" << this->currentItem();
168+
LOGF(info, "this->mFiles.size() = ", this->mFiles.size());
169+
LOGF(info, "this->mCurrentFile = ", this->mCurrentFile);
170+
LOGF(info, "current:", this->currentItem());
171171
return previous != this->currentItem();
172172
}
173173

174174
void FileWatcher::setCurrentItem(int no)
175175
{
176176
this->mCurrentFile = this->mFiles[no];
177-
LOG(info) << "this->setCurrentItem(" << no << ")";
178-
LOG(info) << "this->mCurrentFile = " << this->mCurrentFile;
177+
LOGF(info, "this->setCurrentItem(", no, ")");
178+
LOGF(info, "this->mCurrentFile = ", this->mCurrentFile);
179179
}
180180

181181
std::string FileWatcher::currentFilePath() const

EventVisualisation/Base/src/GeometryManager.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,13 @@ TEveGeoShape* GeometryManager::getGeometryForDetector(string detectorName)
4747
// load ROOT file with geometry
4848
TFile* f = TFile::Open(Form("%s/simple_geom_%s.root", geomPath.c_str(), detectorName.c_str()));
4949
if (!f) {
50-
LOG(error) << "GeometryManager::GetSimpleGeom -- no file with geometry found for: " << detectorName << "!";
50+
LOGF(error, "GeometryManager::GetSimpleGeom -- no file with geometry found for: ", detectorName, "!");
5151
return nullptr;
5252
}
53-
LOG(info) << "GeometryManager::GetSimpleGeom for: " << detectorName << " from "
54-
<< Form("%s/simple_geom_%s.root", geomPath.c_str(), detectorName.c_str());
53+
LOGF(info, "GeometryManager::GetSimpleGeom for: ", detectorName, " from ",
54+
Form("%s/simple_geom_%s.root", geomPath.c_str(), detectorName.c_str()));
5555

56-
TEveGeoShapeExtract* geomShapreExtract = static_cast<TEveGeoShapeExtract*>(f->Get(detectorName.c_str()));
56+
auto geomShapreExtract = dynamic_cast<TEveGeoShapeExtract*>(f->Get(detectorName.c_str()));
5757
TEveGeoShape* geomShape = TEveGeoShape::ImportShapeExtract(geomShapreExtract);
5858
f->Close();
5959

EventVisualisation/DataConverter/include/EventVisualisationDataConverter/VisualisationCalo.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,9 @@ class VisualisationCalo
4646
std::string gid = "";
4747
o2::dataformats::GlobalTrackID::Source source;
4848
};
49+
4950
// Constructor with properties initialisation
50-
VisualisationCalo(const VisualisationCaloVO& vo);
51+
explicit VisualisationCalo(const VisualisationCaloVO& vo);
5152

5253
VisualisationCalo(const VisualisationCalo& src);
5354

@@ -103,8 +104,6 @@ class VisualisationCalo
103104
int mPID; /// PDG code of the particle
104105
std::string mGID; /// String representation of gid
105106

106-
float mStartCoordinates[3]; /// Vector of track's start coordinates
107-
108107
float mEta; /// An angle from Z-axis to the radius vector pointing to the particle
109108
float mPhi; /// An angle from X-axis to the radius vector pointing to the particle
110109

EventVisualisation/DataConverter/include/EventVisualisationDataConverter/VisualisationCluster.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
#include "ReconstructionDataFormats/GlobalTrackID.h"
2121
#include "rapidjson/document.h"
22+
#include <TVector3.h>
2223

2324
#include <vector>
2425
#include <ctime>
@@ -42,6 +43,14 @@ class VisualisationCluster
4243
public:
4344
// Default constructor
4445
VisualisationCluster(float XYZ[], float time);
46+
VisualisationCluster(TVector3 xyz)
47+
{
48+
mTime = 0;
49+
mCoordinates[0] = xyz[0];
50+
mCoordinates[1] = xyz[1];
51+
mCoordinates[2] = xyz[2];
52+
mSource = o2::dataformats::GlobalTrackID::HMP;
53+
}
4554

4655
float X() const { return mCoordinates[0]; }
4756
float Y() const { return mCoordinates[1]; }
@@ -59,4 +68,4 @@ class VisualisationCluster
5968
};
6069
} // namespace event_visualisation
6170
} // namespace o2
62-
#endif // ALICE_O2_DATACONVERTER_VISUALISATIONCLUSTER_H
71+
#endif // ALICE_O2_DATACONVERTER_VISUALISATIONCLUSTER_H

EventVisualisation/DataConverter/include/EventVisualisationDataConverter/VisualisationConstants.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ enum EVisualisationGroup {
3636
EMC,
3737
PHS,
3838
CPV,
39+
HMP,
3940
NvisualisationGroups
4041
};
4142

@@ -49,7 +50,8 @@ const std::string gVisualisationGroupName[NvisualisationGroups] = {
4950
"MID",
5051
"EMC",
5152
"PHS",
52-
"CPV"};
53+
"CPV",
54+
"HMP"};
5355

5456
const bool R3Visualisation[NvisualisationGroups] = {
5557
true, //"ITS",
@@ -61,7 +63,8 @@ const bool R3Visualisation[NvisualisationGroups] = {
6163
true, //"MID",
6264
true, //"EMC",
6365
true, //"PHS",
64-
true, // "CPV"
66+
true, //"CPV"
67+
true, //"HMP"
6568
};
6669

6770
enum EVisualisationDataType {

EventVisualisation/DataConverter/include/EventVisualisationDataConverter/VisualisationEvent.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@ class VisualisationEvent
8989
return mTracks.back().addCluster(pos);
9090
}
9191

92+
VisualisationCluster& addGlobalCluster(const TVector3& xyz)
93+
{
94+
return mClusters.emplace_back(xyz);
95+
}
96+
9297
VisualisationCalo* addCalo(VisualisationCalo::VisualisationCaloVO vo)
9398
{
9499
mCalo.emplace_back(vo);

0 commit comments

Comments
 (0)