BmnRoot 26.10.0-19-g6979a6c6
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
MpdEventManager.h
Go to the documentation of this file.
1// MpdEventManager: class for event management and navigation
2
3#ifndef MPDEVENTMANAGER_H
4#define MPDEVENTMANAGER_H
5
6#include "FairRunAna.h"
7#include "FairTask.h"
8#include "MpdXMLNode.h"
9#include "TEveEventManager.h"
10#include "TGListTree.h"
11
12#include <TEveProjectionAxes.h>
14#include <TEveScene.h>
15#include <TEveViewer.h>
16#include <TGeoNode.h>
17#include <unordered_set>
18#include <vector>
19
20using namespace std;
21
23{
28}; // enum for Event Element lists
29
32{
33 public:
35 {
40
42
43 structSelectedColoring(TString det_name, TString det_color, int det_transparency, bool isRecursive)
44 {
45 detector_name = det_name;
46 detector_color = det_color;
47 detector_transparency = det_transparency;
48 isRecursiveColoring = isRecursive;
49 }
50 };
51
53 {
58
60
61 structLevelColoring(TString fill, bool isLine, bool vis, int transp)
62 {
63 fill_color = fill;
64 isFillLine = isLine;
65 visibility = vis;
66 transparency = transp;
67 }
68 };
69
70 static MpdEventManager* Instance();
72 virtual ~MpdEventManager();
73
74 virtual void Open();
75 virtual void GotoEvent(Int_t event); // *MENU*
76 virtual void NextEvent(); // *MENU*
77 virtual void PrevEvent(); // *MENU*
78 virtual void DisplaySettings(); // *Menu*
79 virtual void Close();
80 void UpdateEditor();
81
82 virtual void Init(Int_t visopt = 1, Int_t vislvl = 3, Int_t maxvisnds = 10000);
83 void SetEventEditor(MpdEventManagerEditor* event_editor) { fEventEditor = event_editor; }
85
86 // FairRunAna to init and to execute visualization tasks
87 FairRunAna* fRunAna; //!
88 void AddTask(FairTask* t) { fRunAna->AddTask(t); }
89
90 // assign different colors for differrent particles
91 // return integer value of color for track by particle pdg (default, white)
92 virtual Int_t Color(Int_t pdg);
93 virtual void AddParticlesToPdgDataBase();
94
95 virtual void SetCurrentEvent(Int_t event_number) { iCurrentEvent = event_number; }
96 virtual Int_t GetCurrentEvent() { return iCurrentEvent; }
97
98 virtual void SetPriOnly(Bool_t Pri) { fPriOnly = Pri; }
99 virtual Bool_t IsPriOnly() { return fPriOnly; }
100
109 // extend energy limits and modify sliders for energy cut if 'check_energy' is out of the limits
110 virtual void ExpandEnergyLimits(Float_t check_energy, float add_multiplier = 1);
111
115 {
116 fRPhiPlane[0] = a;
117 fRPhiPlane[1] = b;
118 fRPhiPlane[2] = c;
119 fRPhiPlane[3] = d;
120 }
122 {
123 fRhoZPlane[0] = a;
124 fRhoZPlane[1] = b;
125 fRhoZPlane[2] = c;
126 fRhoZPlane[3] = d;
127 }
128
129 // Event Elements of Event Scene
131 void AddEventElement(TEveElement* element, ElementList element_list);
132
133 // coloring method
141 // set high transparency for detector geometry
142 void SetTransparentGeometry(bool is_on);
143 virtual void SetXMLConfig(TString xml_config) { fXMLConfig = xml_config; }
144
145 // background color of EVE Viewers
147 // whether background color is dark
149 // whether Online of Offline mode
151 // data source: 0 - simulation data; 1 - raw detector data
153
154 // ZDC module visibility flags. NULL if there are no ZDC modules to show
155 bool* isZDCModule; //!
156 // current value of "mc points", "reco points", "reco tracks" checkbox - FOR CALORIMETER TOWERS
160 // require event redraw after "mc points", "reco points", "reco tracks" checkbox value is changed - FOR CALORIMETER
161 // TOWERS
163
164 unordered_set<Int_t> fCurrentPDG;
165
166 protected:
167 TEveViewer* GetRPhiView() const { return fRPhiView; }
168 TEveViewer* GetRhoZView() const { return fRhoZView; }
176
177 virtual void LoadXMLSettings();
178 void LoadXMLDetector(TGeoNode* node, MpdXMLNode* xml, Int_t depth = 0);
179
180 private:
182 // skeleton Singleton Instance
184
187
188 // VIEWERS for RPhi and RPhoZ projections, 3D view in multi-viewer, RPhi and RPhoZ projections in multi-viewer
190 // projection managers for RPhi and Rho views
192 // scenes for geometry presentation in RPhi plane and RPhoZ plane
197
199 // current event number
202 // the most minimum particle energy for selected event
204 // the most maximum particle energy for selected event
206 // minimum energy to cut particles by energy in selected event
208 // maximum energy to cut particles by energy in selected event
210
211 // the last color indice of Color Creating from rgb triple
213
215 map<int, int> fPDGToColor;
216
217 // arrays with color sturctures for detector and hierarchical coloring
218 vector<structSelectedColoring*> vecSelectedColoring; //!
219 vector<structLevelColoring*> vecLevelColoring; //!
220
221 void SetViewers(TEveViewer* RPhi, TEveViewer* RhoZ);
222
223 // changing color and visibility of geometry nodes
224 void InitColorStructure();
225 // get color id by color name or RGB triple
227 // returns loaded xml if successful of NULL if validation failed
228 bool ValidateXml(const char* XMLFileName, const char* XSDFileName);
229 void LevelChangeNodeProperty(TGeoNode* node, size_t level);
231 void RecursiveChangeNodeProperty(TGeoNode* parentNode, Int_t color, int transparency);
232 void RecursiveChangeNodeTransparent(TGeoNode* parentNode, int transparency);
233
235};
236
237#endif
ElementList
@ RecoPointList
@ MCPointList
@ MCTrackList
@ RecoTrackList
friend F32vec4 min(const F32vec4 &a, const F32vec4 &b)
Definition P4_F32vec4.h:30
friend F32vec4 max(const F32vec4 &a, const F32vec4 &b)
Definition P4_F32vec4.h:31
bool Bool_t
int Int_t
float Float_t
double Double_t
#define ClassDef(name, id)
Double_t fRhoZPlane[4]
map< int, int > fPDGToColor
TEveProjectionManager * GetRPhiProjManager() const
virtual void SetMinEnergyLimit(Float_t min)
virtual void SetCurrentEvent(Int_t event_number)
TEveViewer * fRPhiView
virtual void SetXMLConfig(TString xml_config)
TEveElementList * EveRecoPoints
virtual void Init(Int_t visopt=1, Int_t vislvl=3, Int_t maxvisnds=10000)
MpdEventManager(const MpdEventManager &)=delete
TEveViewer * fMultiRPhiView
unordered_set< Int_t > fCurrentPDG
static MpdEventManager * fgRinstance
TEveProjectionManager * fRhoZMng
void LevelChangeNodeProperty(TGeoNode *node, size_t level)
TEveProjectionManager * GetRhoZProjManager() const
virtual void SetMaxEnergyCut(Float_t max)
TEveViewer * GetMultiView() const
virtual void NextEvent()
VisualizationColoring gVisualizationColoring
MpdEventManagerEditor * fEventEditor
virtual void ExpandEnergyLimits(Float_t check_energy, float add_multiplier=1)
virtual void SetMinEnergyCut(Float_t min)
bool ValidateXml(const char *XMLFileName, const char *XSDFileName)
TEveProjectionAxes * GetRPhiAxes() const
virtual Bool_t IsPriOnly()
virtual void SetPriOnly(Bool_t Pri)
static MpdEventManager * Instance()
vector< structSelectedColoring * > vecSelectedColoring
MpdEventManagerEditor * GetEventEditor()
TEveProjectionAxes * GetRhoZAxes() const
TEveElementList * EveRecoTracks
virtual void GotoEvent(Int_t event)
virtual Int_t Color(Int_t pdg)
TGListTreeItem * fEvent
virtual void Open()
TEveViewer * fMulti3DView
virtual void SetRhoZPlane(Double_t a, Double_t b, Double_t c, Double_t d)
void SetViewers(TEveViewer *RPhi, TEveViewer *RhoZ)
TEveViewer * GetRhoZView() const
TEveProjectionAxes * fAxesRho
vector< structLevelColoring * > vecLevelColoring
TEveElementList * EveMCTracks
TEveScene * fRhoZGeomScene
TEveViewer * GetMultiRhoZView() const
void RecursiveChangeNodeTransparent(TGeoNode *parentNode, int transparency)
TEveViewer * GetRPhiView() const
virtual void SetRPhiPlane(Double_t a, Double_t b, Double_t c, Double_t d)
virtual void Close()
TEveViewer * fMultiRhoZView
void SetEventEditor(MpdEventManagerEditor *event_editor)
Int_t StringToColor(TString color)
Double_t fRPhiPlane[4]
TEveScene * GetRPhiScene()
void SetTransparentGeometry(bool is_on)
TEveViewer * GetMultiRPhiView() const
virtual Int_t GetCurrentEvent()
virtual Float_t GetMinEnergyLimit()
FairRunAna * fRunAna
TEveViewer * fRhoZView
void LoadXMLDetector(TGeoNode *node, MpdXMLNode *xml, Int_t depth=0)
MpdEventManager & operator=(const MpdEventManager &)=delete
virtual void PrevEvent()
virtual void AddParticlesToPdgDataBase()
void AddEventElement(TEveElement *element, ElementList element_list)
TEveScene * fRPhiGeomScene
void AddTask(FairTask *t)
TEveProjectionAxes * fAxesPhi
void RecursiveChangeNodeProperty(TGeoNode *parentNode, Int_t color, int transparency)
TEveProjectionManager * fRPhiMng
TEveElementList * EveMCPoints
virtual void LoadXMLSettings()
virtual Float_t GetMinEnergyCut()
TEveScene * GetRhoZScene()
virtual Float_t GetMaxEnergyCut()
virtual void DisplaySettings()
virtual void SetMaxEnergyLimit(Float_t max)
virtual Float_t GetMaxEnergyLimit()
class for representing XML node
Definition MpdXMLNode.h:56
TEveElementList(const char *n="TEveElementList", const char *t="", Bool_t doColor=kFALSE, Bool_t doTransparency=kFALSE)
TEveEventManager(const char *n="TEveEventManager", const char *t="")
structLevelColoring(TString fill, bool isLine, bool vis, int transp)
structSelectedColoring(TString det_name, TString det_color, int det_transparency, bool isRecursive)