Skip to content

Commit

Permalink
Event Display: added run type to screenshot filename
Browse files Browse the repository at this point in the history
  • Loading branch information
mchwes authored and davidrohr committed Jul 29, 2022
1 parent c0615ec commit 18e8cd0
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 10 deletions.
14 changes: 9 additions & 5 deletions EventVisualisation/Scripts/.o2eve_config
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ background.color: 1
screenshot.path: /home/ed/Screenshot
screenshot.logo.o2: /home/ed/alice/O2/EventVisualisation/Scripts/o2.png
screenshot.logo.alice: /home/ed/alice/O2/EventVisualisation/Scripts/alice-white.png
#screenshot.logo.alice: /home/ed/alice/O2/EventVisualisation/Scripts/alice-black.png
#screenshot.logo.alice: /home/ed/alice/O2/EventVisualisation/Scripts/alice-black.png
screenshot.width: 1000
screenshot.height: 500
#screenshot.message.line.0: Run number: 520144 <- change/comment it in .o2eve_config
Expand All @@ -30,13 +30,17 @@ emcal.tower.noise 0
emcal.tower.scale: 1
emcal.tower.size.eta: 0.0143
emcal.tower.size.phi: 0.0143
emcal.tower.max.height: 80
emcal.tower.max.val.abs: 50

phos.barrel.radius: 550
phos.tower.color: 65
phos.tower.noise 1
phos.tower.scale: 1
phos.tower.size.eta: 0.0143
phos.tower.size.phi: 0.0143
phos.tower.max.height: 80
phos.tower.max.val.abs: 50

#camera
camera.3D.rotation.horizontal: -0.4
Expand All @@ -48,10 +52,10 @@ camera.Z-Y.zoom: 1.0
simple.geom.default: R3
simple.geom.R3.path: /home/jmy/CERN/alice/dev/o2-dev/O2/EventVisualisation/Geometry

data.synthetic.run.dir /home/ed/jsons/synthetic
data.cosmics.run.dir /home/ed/jsons/cosmics
data.physics.run.dir /home/ed/jsons/physics
data.default SYNTHETIC
data.synthetic.run.dir: /home/ed/jsons/synthetic
data.cosmics.run.dir: /home/ed/jsons/cosmics
data.physics.run.dir: /home/ed/jsons/physics
data.default: SYNTHETIC

tracks.width: 2

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ class EventManagerFrame : public TGMainFrame
bool inTick = false;
TString mDefaultDataDirectory;
long memoryUsedInfo = 0L; // used to track memory leaks
bool setInTick(); // try set inTick, return true if set, false if already set
void clearInTick(); // safely clears inTick
void checkMemory(); // check memory used end exit(-1) if it is too much
void updateGUI(); // updates
bool setInTick(); // try set inTick, return true if set, false if already set
void clearInTick(); // safely clears inTick
void checkMemory(); // check memory used end exit(-1) if it is too much
void updateGUI(); // updates
static TGTextButton* makeButton(TGCompositeFrame* p, const char* txt, Int_t width = 0, const char* txttooltip = nullptr,
Int_t lo = 8, Int_t ro = 8, Int_t to = 4, Int_t bo = 4);
static TGRadioButton* makeRadioButton(TGButtonGroup* g, const char* txt, Int_t width = 0, const char* txttooltip = nullptr, bool checked = false,
Expand Down Expand Up @@ -123,6 +123,7 @@ class EventManagerFrame : public TGMainFrame
public: // static functions
static TString getSourceDirectory(EventManagerFrame::RunMode runMode);
static RunMode decipherRunMode(TString name, RunMode defaultRun = SyntheticRun);
static TString getRunTypeString(EventManagerFrame::RunMode runMode);
};

} // namespace event_visualisation
Expand Down
16 changes: 15 additions & 1 deletion EventVisualisation/View/src/EventManagerFrame.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ void EventManagerFrame::DoScreenshot()
ConfigurationManager::getInstance().getConfig(settings);
std::string outDirectory = settings.GetValue("screenshot.path", "Screenshots");
std::ostringstream filepath;
filepath << outDirectory << "/Screenshot_" << time_str << ".png";
filepath << outDirectory << "/Screenshot_" << time_str << "_" << getRunTypeString(mRunMode) << ".png";
if (!std::filesystem::is_directory(outDirectory)) {
std::filesystem::create_directory(outDirectory);
}
Expand Down Expand Up @@ -611,5 +611,19 @@ EventManagerFrame::RunMode EventManagerFrame::decipherRunMode(TString name, RunM
}
}

TString EventManagerFrame::getRunTypeString(EventManagerFrame::RunMode runMode)
{
switch (runMode) {
case EventManagerFrame::SyntheticRun:
return "synthetic";
case EventManagerFrame::CosmicsRun:
return "cosmics";
case EventManagerFrame::PhysicsRun:
return "physics";
default:
return "";
}
}

} // namespace event_visualisation
} // namespace o2

0 comments on commit 18e8cd0

Please sign in to comment.