17 #include <RtypesCore.h>
19 #include <TEveManager.h>
22 #include <TGComboBox.h>
25 #include <TGNumberEntry.h>
26 #include <TGenericClassInfo.h>
27 #include <TGeoManager.h>
45 FairEventManagerEditor::FairEventManagerEditor(
const TGWindow* p,
50 : TGedFrame(p, width, height, options | kVerticalFrame, back)
54 , fGlobalTransparency(nullptr)
56 , fScreenshotOpt(nullptr)
67 Int_t Entries = chain->GetEntriesFast();
69 MakeTitle(
"FairEventManager Editor");
70 TGVerticalFrame* fInfoFrame = CreateEditorTabSubFrame(
"Info");
71 TGCompositeFrame* title1 =
72 new TGCompositeFrame(fInfoFrame, 250, 10, kVerticalFrame | kLHintsExpandX | kFixedWidth | kOwnBackground);
74 TString Infile =
"Input file : ";
77 Infile += file->GetName();
78 TGLabel* TFName =
new TGLabel(title1, Infile.Data());
79 title1->AddFrame(TFName);
82 TString run =
"Run Id : ";
84 TGLabel* TRunId =
new TGLabel(title1, run.Data());
85 title1->AddFrame(TRunId);
87 TString nevent =
"No of events : ";
89 TGLabel* TEvent =
new TGLabel(title1, nevent.Data());
90 title1->AddFrame(TEvent);
92 Int_t nodes = gGeoManager->GetNNodes();
93 TString NNodes =
"No. of Nodes : ";
95 TGLabel* NoNode =
new TGLabel(title1, NNodes.Data());
96 title1->AddFrame(NoNode);
98 TGHorizontalFrame* f =
new TGHorizontalFrame(title1);
99 TGLabel* l =
new TGLabel(f,
"Current Event:");
100 f->AddFrame(l,
new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 1, 2, 1, 1));
105 TGNumberFormat::kNESInteger,
106 TGNumberFormat::kNEANonNegative,
107 TGNumberFormat::kNELLimitMinMax,
110 f->AddFrame(
fCurrentEvent,
new TGLayoutHints(kLHintsLeft, 1, 1, 1, 1));
111 fCurrentEvent->Connect(
"ValueSet(Long_t)",
"FairEventManagerEditor",
this,
"SelectSingleEvent()");
114 TGHorizontalFrame* f2 =
new TGHorizontalFrame(title1);
115 TGLabel* EventTimeLabel =
new TGLabel(f2,
"Event Time: ");
117 f2->AddFrame(EventTimeLabel);
119 title1->AddFrame(f2);
121 TGTextButton* fUpdate =
new TGTextButton(title1,
"Update");
122 title1->AddFrame(fUpdate,
new TGLayoutHints(kLHintsRight | kLHintsExpandX, 5, 5, 1, 1));
123 fUpdate->Connect(
"Clicked()",
"FairEventManagerEditor",
this,
"SelectSingleEvent()");
125 fInfoFrame->AddFrame(title1,
new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
130 TGVerticalFrame* scene_conf = CreateEditorTabSubFrame(
"Graphics");
131 TGHorizontalFrame* transparency_frame =
new TGHorizontalFrame(scene_conf);
133 std::unique_ptr<FairEveTransparencyControl> transparency(
135 scene_conf->AddFrame(transparency.release(),
new TGLayoutHints(kLHintsNormal, 5, 5, 1, 1));
137 TGCheckButton* backgroundButton =
new TGCheckButton(scene_conf,
"Light background");
138 scene_conf->AddFrame(backgroundButton,
new TGLayoutHints(kLHintsRight | kLHintsExpandX, 5, 5, 1, 1));
139 backgroundButton->Connect(
"Toggled(Bool_t)", this->ClassName(),
this,
"SwitchBackground(Bool_t)");
141 TGGroupFrame* frame_screenshot =
new TGGroupFrame(scene_conf,
"Screenshot");
142 frame_screenshot->SetTitlePos(TGGroupFrame::kCenter);
144 frame_screenshot->SetLayoutManager(
new TGHorizontalLayout(frame_screenshot));
146 TGTextButton* Screen =
new TGTextButton(frame_screenshot,
"Make");
147 frame_screenshot->AddFrame(Screen,
new TGLayoutHints(kLHintsLeft | kLHintsExpandX, 20, 2, 2, 2));
148 Screen->Connect(
"Clicked()", this->ClassName(),
this,
"MakeScreenshot()");
157 frame_screenshot->AddFrame(
fScreenshotOpt,
new TGLayoutHints(kLHintsRight | kLHintsExpandX));
158 scene_conf->AddFrame(frame_screenshot,
new TGLayoutHints(kLHintsTop | kLHintsExpandX, 1, 1, 2, 1));
186 stime.Form(
"%.2f", time);
197 case FairEveAnimationControl::eAnimationType::kEventByEvent: {
200 gSystem->mkdir(
"event_animations");
205 gSystem->mkdir(
"event_animations");
206 for (
int i = start; i < end; i++) {
209 gEve->FullRedraw3D();
213 case FairEveAnimationControl::eAnimationType::kTimeSlice: {
214 gSystem->mkdir(
"timeslice_animations");
230 TList* taskList = pMainTask->GetListOfTasks();
233 Bool_t runOnce =
true;
234 for (Double_t i = start; i < end; i += step) {
235 if (runOnce ==
true) {
246 Double_t lowerLimit = 0;
250 lowerLimit = i - tail;
258 TObjLink* lnk = taskList->FirstLink();
264 gEve->FullRedraw3D();
TGNumberEntry * fCurrentEvent
virtual void StartAnimation()
void SetUseTimeOfEvent(Bool_t val)
virtual void ExecuteTask(Option_t *option="0")
virtual void SetEvtTime(Float_t time)
virtual void SetEvtTimeText(Double_t time)
void MakeScreenshot(FairEveAnimationControl::eScreenshotType screen, TString def_path="")
static FairRootManager * Instance()
ClassImp(FairEventBuilder)
virtual void SetMaxEnergy(Float_t max)
void SetMinMax(Double_t min, Double_t max)
virtual void SelectSingleEvent()
eScreenshotType GetScreenshotType()
static FairRunAna * Instance()
TGComboBox * fScreenshotOpt
void SetModel(TObject *obj)
void SetClearHandler(Bool_t val)
void SetTimeLimits(Double_t min, Double_t max)
FairEveAnimationControl * fAnimation
virtual void SwitchBackground(Bool_t light)
static FairEventManager * Instance()
virtual void GotoEvent(Int_t event)
void SetFunctionName(TString name)
eAnimationType GetAnimationType()
void SetAnimatedTracks(Bool_t val)
void SetEventTimeLabel(Double_t time)
virtual void SetEvtNumberText(Int_t evtNumber)
Bool_t GetRunContinuous()
void SwitchBackground(Bool_t light_background)
FairEventManager * fManager
virtual void SelectEvent()