Skip to content

Commit

Permalink
Merge pull request AliceO2Group#8993 from jmyrcha/dev3
Browse files Browse the repository at this point in the history
o2-eve: version number in o2-eve window title
  • Loading branch information
jmyrcha authored May 29, 2022
1 parent 91a6931 commit bd38b24
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ namespace o2
{
namespace event_visualisation
{
/// Version of the software
const static std::string o2_eve_version = "1.20";

/// Configuration Manager allows an easy access to the config file.
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ class VisualisationEvent

const VisualisationCluster& getCluster(int i) const { return mClusters[i]; };
size_t getClusterCount() const { return mClusters.size(); } // Returns number of clusters
void setWorkflowVersion(float workflowVersion) { this->mWorkflowVersion = workflowVersion; }
void setWorkflowVersion(const std::string& workflowVersion) { this->mWorkflowVersion = workflowVersion; }
void setWorkflowParameters(const std::string& workflowParameters) { this->mWorkflowParameters = workflowParameters; }

std::string getCollisionTime() const { return this->mCollisionTime; }
Expand Down Expand Up @@ -185,7 +185,7 @@ class VisualisationEvent

float mMinTimeOfTracks; /// minimum time of tracks in the event
float mMaxTimeOfTracks; /// maximum time of tracks in the event
float mWorkflowVersion; /// workflow version used to generate this Event
std::string mWorkflowVersion; /// workflow version used to generate this Event
std::string mWorkflowParameters; /// workflow parameters used to generate this Event
int mEventNumber; /// event number in file
double mEnergy; /// energy of the collision
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ std::string VisualisationEventJSONSerializer::toJson(const VisualisationEvent& e
tree.AddMember("firstTForbit", rapidjson::Value().SetInt(event.mFirstTForbit), allocator);

tree.AddMember("collisionTime", rapidjson::Value().SetString(event.mCollisionTime.c_str(), event.mCollisionTime.size()), allocator);
tree.AddMember("workflowVersion", rapidjson::Value().SetFloat(event.mWorkflowVersion), allocator);
tree.AddMember("workflowVersion", rapidjson::Value().SetString(event.mWorkflowVersion.c_str(), event.mWorkflowVersion.size()), allocator);
tree.AddMember("workflowParameters", rapidjson::Value().SetString(event.mWorkflowParameters.c_str(), event.mWorkflowParameters.size()), allocator);
// Tracks
tree.AddMember("trackCount", rapidjson::Value().SetInt(event.getTrackCount()), allocator);
Expand Down
Binary file modified EventVisualisation/Geometry/simple_geom_MCH.root
Binary file not shown.
4 changes: 2 additions & 2 deletions EventVisualisation/View/src/Initializer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include "EventVisualisationView/Initializer.h"

#include "EventVisualisationBase/ConfigurationManager.h"
#include "EventVisualisationBase/GeometryManager.h"
#include "EventVisualisationView/EventManager.h"
#include "EventVisualisationView/MultiView.h"
#include "EventVisualisationDataConverter/VisualisationConstants.h"
Expand Down Expand Up @@ -75,6 +74,8 @@ void Initializer::setup()

// Setup windows size, fullscreen and focus
TEveBrowser* browser = gEve->GetBrowser();
std::string title = std::string("o2-eve v:") + o2_eve_version;
browser->SetWindowName(title.c_str());
browser->GetTabRight()->SetTab(1);
browser->MoveResize(0, 0, gClient->GetDisplayWidth(), gClient->GetDisplayHeight() - 32);

Expand All @@ -94,7 +95,6 @@ void Initializer::setup()
// Temporary:
// Later this will be triggered by button, and finally moved to configuration.
gEve->AddEvent(&EventManager::getInstance());
// eventManager.getDataSource()->refresh();

if (Options::Instance()->online()) {
frame->StartTimer();
Expand Down
2 changes: 1 addition & 1 deletion EventVisualisation/View/src/main.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ using namespace o2::event_visualisation;

int main(int argc, char** argv)
{
LOG(info) << "Welcome in O2 event visualisation tool (v1.02)";
LOG(info) << "Welcome in O2 event visualisation tool (" << o2_eve_version << ")";

if (!Options::Instance()->processCommandLine(argc, argv)) {
exit(-1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ class EveWorkflowHelper
int numberOfFiles,
o2::dataformats::GlobalTrackID::mask_t trkMask,
o2::dataformats::GlobalTrackID::mask_t clMask,
float workflowVersion,
o2::header::DataHeader::RunNumberType runNumber,
o2::framework::DataProcessingHeader::CreationTime creationTime);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ class TPCFastTransform;
class O2DPLDisplaySpec : public o2::framework::Task
{
public:
static constexpr float mWorkflowVersion = 1.02; // helps recognizing version of workflow which produce data
O2DPLDisplaySpec(bool useMC, o2::dataformats::GlobalTrackID::mask_t trkMask,
o2::dataformats::GlobalTrackID::mask_t clMask,
std::shared_ptr<o2::globaltracking::DataRequest> dataRequest, const std::string& jsonPath,
Expand Down
2 changes: 1 addition & 1 deletion EventVisualisation/Workflow/src/AO2DConverter.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ void AO2DConverter::process(o2::aod::Collisions const& collisions, EveWorkflowHe
mHelper->drawAODMFT(track, c.collisionTime());
}

mHelper->save(jsonPath, collisions.size(), GlobalTrackID::MASK_ALL, GlobalTrackID::MASK_NONE, mWorkflowVersion, mRunNumber, mCreationTime);
mHelper->save(jsonPath, collisions.size(), GlobalTrackID::MASK_ALL, GlobalTrackID::MASK_NONE, mRunNumber, mCreationTime);
mHelper->clear();
}
}
Expand Down
5 changes: 3 additions & 2 deletions EventVisualisation/Workflow/src/EveWorkflowHelper.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
/// \author [email protected]

#include <EveWorkflow/EveWorkflowHelper.h>
#include "EventVisualisationBase/ConfigurationManager.h"
#include "EventVisualisationDataConverter/VisualisationEventSerializer.h"
#include "ReconstructionDataFormats/GlobalTrackID.h"
#include "EveWorkflow/FileProducer.h"
Expand Down Expand Up @@ -199,9 +200,9 @@ void EveWorkflowHelper::draw()

void EveWorkflowHelper::save(const std::string& jsonPath, int numberOfFiles,
o2::dataformats::GlobalTrackID::mask_t trkMask, o2::dataformats::GlobalTrackID::mask_t clMask,
float workflowVersion, o2::header::DataHeader::RunNumberType runNumber, o2::framework::DataProcessingHeader::CreationTime creation)
o2::header::DataHeader::RunNumberType runNumber, o2::framework::DataProcessingHeader::CreationTime creation)
{
mEvent.setWorkflowVersion(workflowVersion);
mEvent.setWorkflowVersion(o2_eve_version);
mEvent.setRunNumber(runNumber);
std::time_t timeStamp = std::time(nullptr);
std::string asciiTimeStamp = std::asctime(std::localtime(&timeStamp));
Expand Down
9 changes: 5 additions & 4 deletions EventVisualisation/Workflow/src/O2DPLDisplay.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

#include "EveWorkflow/O2DPLDisplay.h"
#include "EveWorkflow/EveWorkflowHelper.h"
#include "EventVisualisationBase/ConfigurationManager.h"
#include "DetectorsBase/Propagator.h"
#include "DataFormatsGlobalTracking/RecoContainer.h"
#include "DataFormatsTPC/WorkflowHelper.h"
Expand Down Expand Up @@ -67,7 +68,7 @@ void customize(std::vector<ConfigParamSpec>& workflowOptions)
#include "Framework/runDataProcessing.h" // main method must be included here (otherwise customize not used)
void O2DPLDisplaySpec::init(InitContext& ic)
{
LOG(info) << "------------------------ O2DPLDisplay::init version " << this->mWorkflowVersion << " ------------------------------------";
LOG(info) << "------------------------ O2DPLDisplay::init version " << o2_eve_version << " ------------------------------------";
mData.init();

mData.mConfig->configProcessing.runMC = mUseMC;
Expand All @@ -78,7 +79,7 @@ void O2DPLDisplaySpec::run(ProcessingContext& pc)
if (!this->mEveHostNameMatch) {
return;
}
LOG(info) << "------------------------ O2DPLDisplay::run version " << this->mWorkflowVersion << " ------------------------------------";
LOG(info) << "------------------------ O2DPLDisplay::run version " << o2_eve_version << " ------------------------------------";
// filtering out any run which occur before reaching next time interval
auto currentTime = std::chrono::high_resolution_clock::now();
std::chrono::duration<double> elapsed = currentTime - this->mTimeStamp;
Expand Down Expand Up @@ -125,7 +126,7 @@ void O2DPLDisplaySpec::run(ProcessingContext& pc)
helper.mEvent.setRunNumber(dh->runNumber);
helper.mEvent.setTfCounter(dh->tfCounter);
helper.mEvent.setFirstTForbit(dh->firstTForbit);
helper.save(this->mJsonPath, this->mNumberOfFiles, this->mTrkMask, this->mClMask, this->mWorkflowVersion, dh->runNumber, dph->creation);
helper.save(this->mJsonPath, this->mNumberOfFiles, this->mTrkMask, this->mClMask, dh->runNumber, dph->creation);
}

auto endTime = std::chrono::high_resolution_clock::now();
Expand Down Expand Up @@ -156,7 +157,7 @@ void O2DPLDisplaySpec::finaliseCCDB(ConcreteDataMatcher& matcher, void* obj)

WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
{
LOG(info) << "------------------------ defineDataProcessing " << O2DPLDisplaySpec::mWorkflowVersion << " ------------------------------------";
LOG(info) << "------------------------ defineDataProcessing " << o2_eve_version << " ------------------------------------";

WorkflowSpec specs;

Expand Down

0 comments on commit bd38b24

Please sign in to comment.