REST-for-Physics  v2.3
Rare Event Searches ToolKit for Physics
TRestRealTimeDrawingProcess.h
1 /*************************************************************************
2  * This file is part of the REST software framework. *
3  * *
4  * Copyright (C) 2016 GIFNA/TREX (University of Zaragoza) *
5  * For more information see http://gifna.unizar.es/trex *
6  * *
7  * REST is free software: you can redistribute it and/or modify *
8  * it under the terms of the GNU General Public License as published by *
9  * the Free Software Foundation, either version 3 of the License, or *
10  * (at your option) any later version. *
11  * *
12  * REST is distributed in the hope that it will be useful, *
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15  * GNU General Public License for more details. *
16  * *
17  * You should have a copy of the GNU General Public License along with *
18  * REST in $REST_PATH/LICENSE. *
19  * If not, see http://www.gnu.org/licenses/. *
20  * For the list of contributors see $REST_PATH/CREDITS. *
21  *************************************************************************/
22 
23 #ifndef RestCore_TRestRealTimeDrawingProcess
24 #define RestCore_TRestRealTimeDrawingProcess
25 
26 #include "TRestAnalysisPlot.h"
27 #include "TRestEventProcess.h"
28 #include "TVector2.h"
29 
33  private:
38 
40  static std::vector<std::string> fProcessesToDraw;
42  static std::vector<TRestAnalysisPlot*> fPlots;
44  static Long64_t fLastDrawnEntry;
46  static bool fPauseInvoke;
48  static std::map<TRestRealTimeDrawingProcess*, bool> fPauseResponse;
50  TRestEvent* fEvent = nullptr;
51 
52  void InitProcess() override;
53  void EndProcess() override;
54 
55  void Initialize() override;
56 
57  protected:
58  public:
59  RESTValue GetInputEvent() const override { return fEvent; }
60  RESTValue GetOutputEvent() const override { return fEvent; }
61 
62  TRestEvent* ProcessEvent(TRestEvent* inputEvent) override;
63 
64  void PrintMetadata() override;
65 
67  void DrawWithNotification();
68 
69  void DrawOnce();
70 
72  const char* GetProcessName() const override { return "realtimedraw"; }
73 
75 
77 
78  // If new members are added, removed or modified in this class version number must be increased!
79  ClassDefOverride(TRestRealTimeDrawingProcess, 3);
80 };
81 #endif
A base class for any REST event process.
A base class for any REST event.
Definition: TRestEvent.h:38
static Long64_t fLastDrawnEntry
Last drawn entry of analysis tree.
static std::vector< TRestAnalysisPlot * > fPlots
TRestAnalysisPlot object called for drawing.
static std::map< TRestRealTimeDrawingProcess *, bool > fPauseResponse
Pause response flag from other threads when recieving pause signal.
RESTValue GetOutputEvent() const override
Get pointer to output event. Must be implemented in the derived class.
TRestEvent * fEvent
The event pointer is not used in this process.
static std::vector< std::string > fProcessesToDraw
TRestAnalysisPlot object called for drawing.
void EndProcess() override
Function to use when all events have been processed.
void DrawWithNotification()
Returns a new instance of this class.
Int_t fThreadWaitTimeoutMs
How many events passed when it starts next drawing.
void PrintMetadata() override
It prints out the process parameters stored in the metadata structure.
void InitProcess() override
Function to use in initialization of process members before starting to process the event.
TRestRealTimeDrawingProcess()
Default constructor.
void Initialize() override
Function to initialize input/output event members and define the section name and library version.
const char * GetProcessName() const override
Returns the name of this process.
int fDrawInterval
How many events passed when it starts next drawing.
TRestEvent * ProcessEvent(TRestEvent *inputEvent) override
The main processing event function.
static bool fPauseInvoke
Pause signal send for other threads when start drawing.
RESTValue GetInputEvent() const override
Get pointer to input event. Must be implemented in the derived class.