7#include "FairRootManager.h"
66 FairRootManager* fRootManager = FairRootManager::Instance();
67 TChain* chain = fRootManager->GetInChain();
78 if (pChainFile == NULL) {
79 InSource =
"Data Stream";
82 InSource += pChainFile->
GetName();
89 UInt_t RunId = FairRunAna::Instance()->getRunId();
117 fCurrentEvent->Connect(
"ValueSet(Long_t)",
"MpdEventManagerEditor",
this,
"SelectEvent()");
125 fSave->Connect(
"Clicked()",
"MpdEventManagerEditor",
this,
"SaveImage()");
131 fVizPri->Connect(
"Toggled(Bool_t)",
"MpdEventManagerEditor",
this,
"DoVizPri()");
140 fCurrentPDGTextEntry->Connect(
"TextChanged(char*)",
"MpdEventManagerEditor",
this,
"SelectPDG()");
152 sliderMinEnergy->Connect(
"ValueSet(Double_t)",
"MpdEventManagerEditor",
this,
"SetMinEnergyCut()");
164 sliderMaxEnergy->Connect(
"ValueSet(Double_t)",
"MpdEventManagerEditor",
this,
"SetMaxEnergyCut()");
171 fGeometry->Connect(
"Toggled(Bool_t)",
"MpdEventManagerEditor",
this,
"ShowGeometry(Bool_t)");
179 ShowMagnetButton->Connect(
"Toggled(Bool_t)",
"MpdEventManagerEditor",
this,
"ShowMagnet(Bool_t)");
187 fTransparency->
Connect(
"Toggled(Bool_t)",
"MpdEventManagerEditor",
this,
"SwitchTransparency(Bool_t)");
192 backgroundButton->
Connect(
"Toggled(Bool_t)",
"MpdEventManagerEditor",
this,
"SwitchBackground(Bool_t)");
194 backgroundButton->
SetOn();
195 gEve->GetViewers()->SwitchColorSet();
206 fShowMCPoints->Connect(
"Toggled(Bool_t)",
"MpdEventManagerEditor",
this,
"ShowMCPoints(Bool_t)");
212 fShowRecoPoints->Connect(
"Toggled(Bool_t)",
"MpdEventManagerEditor",
this,
"ShowRecoPoints(Bool_t)");
220 fShowMCTracks->Connect(
"Toggled(Bool_t)",
"MpdEventManagerEditor",
this,
"ShowMCTracks(Bool_t)");
226 fShowRecoTracks->Connect(
"Toggled(Bool_t)",
"MpdEventManagerEditor",
this,
"ShowRecoTracks(Bool_t)");
238 fUpdate->Connect(
"Clicked()",
"MpdEventManagerEditor",
this,
"UpdateEvent()");
291 gEve->GetGlobalScene()->SetRnrState(is_show);
319 cout <<
"ERROR: There is no magnet with given name: Magnet" << endl;
323 magnet->SetVisibility(is_show);
324 magnet->VisibleDaughters(is_show);
326 if (
gEve->GetGlobalScene()->GetRnrState()) {
328 gEve->GetGlobalScene()->SetRnrState(
kTRUE);
336 gEve->GetViewers()->SwitchColorSet();
344 if (
gEve->GetGlobalScene()->GetRnrState()) {
346 gEve->GetGlobalScene()->SetRnrState(
kTRUE);
366 if (points == NULL) {
367 cout <<
"There is no information about MC points" << endl;
394 cout <<
"ERROR: There is no volume with given name: VETO" << endl;
398 for (;
i < 68;
i++) {
415 for (;
i < 104;
i++) {
432 if ((isFull || isRedraw) && (
gEve->GetGlobalScene()->GetRnrState())) {
434 gEve->GetGlobalScene()->SetRnrState(
kTRUE);
456 if (tracks == NULL) {
457 cout <<
"There is no information about MC tracks" << endl;
470 if (points == NULL) {
471 cout <<
"There is no information about reconstructed points" << endl;
489 if (tracks == NULL) {
490 cout <<
"There is no information about reconstructed tracks" << endl;
506 const char* filetypes[] = {
"PNG",
"*.png",
"JPG",
"*.jpg", 0, 0};
530 if (iOldEvent != iNewEvent) {
564 regex rgx(
"[\\s,]+");
566 sregex_token_iterator end;
567 for (; iter != end; ++iter) {
568 string s = (*iter).str();
570 auto pdg = atoi(s.c_str());
574 auto particle = databasePDG->GetParticle(s.c_str());
590 if (iOldEvent != iNewEvent) {
613 par_online_display->
fRootManager = FairRootManager::Instance();
622 thread_run_online->
Run();
632 fUpdate->SetText(
"Stop online display");
640 fUpdate->SetText(
"Start online display");
650 FairRootManager* fRootManager = thread_par->
fRootManager;
656 FairRunAna* pRun = fEventManager->
fRunAna;
657 FairTask* pMainTask = pRun->GetMainTask();
658 TList* taskList = pMainTask->GetListOfTasks();
660 for (
int i = current_event + 1; ((stream_source) || (
i < fEditor->
iEventCount));
i++) {
665 }
while ((
gEve->GetGlobalScene()->GetGLScene()->IsLocked())
666 || (
gEve->GetEventScene()->GetGLScene()->IsLocked()));
668 fRootManager->ReadEvent(
i);
675 pCurTask->ExecuteTask(
"");
686 cout <<
"Redrawing event #" <<
i <<
"..." << endl << endl;
void * RunOnlineDisplay(void *ptr)
R__EXTERN TEveManager * gEve
R__EXTERN TGeoManager * gGeoManager
char * Form(const char *fmt,...)
char * StrDup(const char *str)
R__EXTERN TSystem * gSystem
MpdEventManager * fEventManager
TGCheckButton * fShowMCTracks
virtual void ShowMCTracks(Bool_t is_show)
void UpdateEnergySlider()
TGCheckButton * fShowMCPoints
TGCheckButton * fShowRecoPoints
TGCheckButton * fShowRecoTracks
virtual void SetMaxEnergyCut()
virtual void ShowRecoTracks(Bool_t is_show)
virtual void ShowMagnet(Bool_t is_show)
virtual void SwitchTransparency(Bool_t is_on)
TGCheckButton * fGeometry
virtual void ShowGeometry(Bool_t is_show)
virtual void SelectEvent()
virtual void SwitchBackground(Bool_t is_on)
TEveGValuator * sliderMaxEnergy
TGNumberEntry * fCurrentEvent
virtual void UpdateEvent()
bool RedrawZDC(bool isFull=false, bool isRedraw=true)
MpdEventManagerEditor(const TGWindow *p=0, Int_t width=170, Int_t height=30, UInt_t options=kChildFrame, Pixel_t back=GetDefaultFrameBackground())
virtual void ShowRecoPoints(Bool_t is_show)
virtual void SetMinEnergyCut()
virtual void ShowMCPoints(Bool_t is_show)
TGHorizontalFrame * fGeometryFrame
TGTextEntry * fCurrentPDGTextEntry
TGCheckButton * ShowMagnetButton
TEveGValuator * sliderMinEnergy
virtual void SetCurrentEvent(Int_t event_number)
static TDatabasePDG * Instance()
virtual Bool_t SetRnrState(Bool_t rnr)
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
TGCompositeFrame(const TGWindow *p=nullptr, UInt_t w=1, UInt_t h=1, UInt_t options=0, Pixel_t back=GetDefaultFrameBackground())
virtual void SetTitlePos(ETitlePos pos=kLeft)
virtual TGVerticalFrame * CreateEditorTabSubFrame(const char *name)
virtual void MakeTitle(const char *title)
TGedFrame(const TGWindow *p=nullptr, Int_t width=140, Int_t height=30, UInt_t options=kChildFrame, Pixel_t back=GetDefaultFrameBackground())
void SetVisibility(Bool_t vis=kTRUE) override
void VisibleDaughters(Bool_t vis=kTRUE)
TGeoNode * FindNode(const char *name) const
virtual TObjLink * FirstLink() const
const char * GetName() const override
TObject * GetObject() const
Bool_t Connect(const char *signal, const char *receiver_class, void *receiver, const char *slot)
const char * Data() const
static TString Format(const char *fmt,...)
static Int_t Sleep(ULong_t secs, ULong_t nanos=0)
Int_t Run(void *arg=nullptr, const int affinity=-1)
virtual Long64_t GetEntriesFast() const
void * RunOnlineDisplay(void *ptr)
FairRootManager * fRootManager
MpdEventManagerEditor * fManagerEditor
MpdEventManager * fEventManager