42 stream << hex << hex_string;
162 cout << color <<
" - RGB triple isn't correct. Color set to default blue" << endl;
169 int red_rgb = -1, green_rgb = -1, blue_rgb = -1;
170 if (triple[0] ==
'#') {
171 if (triple.
Length() < 7) {
173 <<
" - hex triple size after '#' isn't correct (should have 6 symbols). Color set to default blue"
178 TString str_red = triple(1, 2);
179 TString str_green = triple(3, 2);
180 TString str_blue = triple(5, 2);
181 if ((!str_red.
IsHex()) || (!str_green.
IsHex()) || (!str_blue.
IsHex())) {
182 cout << triple <<
" - hex triple after '#' has not hex format. Color set to default blue" << endl;
192 cout << triple <<
" - RGB string doesn't include color triple. Color set to default blue" << endl;
195 red_rgb = ((
TObjString*)pRGB->
At(0))->GetString().Atoi();
196 green_rgb = ((
TObjString*)pRGB->
At(1))->GetString().Atoi();
197 blue_rgb = ((
TObjString*)pRGB->
At(2))->GetString().Atoi();
202 new TColor(ci, red_rgb / 255.0F, green_rgb / 255.0F, blue_rgb / 255.0F);
208 if (sign_index ==
kNPOS)
209 sign_index = color.
First(
'-');
212 if (sign_index ==
kNPOS)
215 color_name = color(0, sign_index);
218 if (color_name.
EqualTo(
"kwhite"))
220 else if (color_name.
EqualTo(
"kblack"))
222 else if (color_name.
EqualTo(
"kgray"))
224 else if (color_name.
EqualTo(
"kred"))
226 else if (color_name.
EqualTo(
"kgreen"))
228 else if (color_name.
EqualTo(
"kblue"))
230 else if (color_name.
EqualTo(
"kyellow"))
232 else if (color_name.
EqualTo(
"kmagenta"))
234 else if (color_name.
EqualTo(
"kcyan"))
236 else if (color_name.
EqualTo(
"korange"))
238 else if (color_name.
EqualTo(
"kspring"))
240 else if (color_name.
EqualTo(
"kteal"))
242 else if (color_name.
EqualTo(
"kazure"))
244 else if (color_name.
EqualTo(
"kviolet"))
246 else if (color_name.
EqualTo(
"kpink"))
248 else if (color_name.
EqualTo(
"kkhaki"))
251 cout << color_name <<
" not found. Color set to default blue" << endl;
255 if ((sign_index !=
kNPOS) && (color.
Length() > sign_index + 2)) {
256 TString strNumber = color(sign_index + 1, color.
Length() - sign_index - 1);
258 if (color(sign_index) ==
'+')
259 color_value += strNumber.
Atoi();
261 color_value -= strNumber.
Atoi();
272 auto file_path =
gSystem->ExpandPathName(
"$VMCWORKDIR/config/eventdisplay.json");
273 ifstream file(file_path);
274 if (file.is_open()) {
279 for (
auto& particle : data[
"coloring"][
"particles"])
281 }
catch (
const json::type_error& e) {
282 cout <<
"MpdEventManager::InitColorStructure() Using default coloring for particles!" << endl;
289 string type = data[
"coloring"][
"type"];
291 if (type ==
"detectors") {
294 string scheme = data[
"coloring"][type][
"scheme"];
296 for (
auto&
detector : data[
"coloring"][type][scheme]) {
305 for (
auto& level : data[
"coloring"][type]) {
308 level.value(
"visibility",
kFALSE), level.value(
"transparency", 0));
312 }
catch (
const json::type_error& e) {
313 cout <<
"MpdEventManager::InitColorStructure() Using default ROOT coloring for detectors!" << endl;
317 cout <<
"MpdEventManager::InitColorStructure() File " << file_path <<
"not found! Using default coloring!"
347 gEve->AddGlobalElement(TNod);
364 gEve->GetDefaultViewer()->SetElementName(
"3D View");
371 gEve->GetDefaultViewer()->GetGLViewer()->UseLightColorSet();
494 cout <<
"There is no volume with given name: " << selected_coloring->
detector_name << endl;
550 cout <<
"There is no volume with given name: " << selected_coloring->
detector_name << endl;
557 Int_t curTransparency = 80;
680 const Double_t kAu2Gev = 0.9314943228;
681 const Double_t khSlash = 1.0545726663e-27;
682 const Double_t kErg2Gev = 1 / 1.6021773349e-3;
683 const Double_t khShGev = khSlash * kErg2Gev;
684 const Double_t kYear2Sec = 3600 * 24 * 365.25;
688 pdgDB->
AddParticle(
"Deuteron",
"Deuteron", 2 * kAu2Gev + 8.071e-3,
kTRUE, 0, 3,
"Ion", 1000010020);
691 pdgDB->
AddParticle(
"Triton",
"Triton", 3 * kAu2Gev + 14.931e-3,
kFALSE, khShGev / (12.33 * kYear2Sec), 3,
"Ion",
695 pdgDB->
AddParticle(
"Alpha",
"Alpha", 4 * kAu2Gev + 2.424e-3,
kTRUE, khShGev / (12.33 * kYear2Sec), 6,
"Ion",
699 pdgDB->
AddParticle(
"HE3",
"HE3", 3 * kAu2Gev + 14.931e-3,
kFALSE, 0, 6,
"Ion", 1000020030);
703 pdgDB->
AddParticle(
"Cherenkov",
"Cherenkov", 0,
kFALSE, 0, 0,
"Special", 50000050);
706 pdgDB->
AddParticle(
"FeedbackPhoton",
"FeedbackPhoton", 0,
kFALSE, 0, 0,
"Special", 50000051);
711 switch (element_list) {
770 if (nodename.
EqualTo(
"Detectors")) {
773 if (top_xml !=
nullptr)
775 }
else if (nodename.
EqualTo(
"MCTracksColors")) {
793 if (recursive && depth == 0)
810 xml_depth = depth - 1;
824 if (subnode_name == subdetector_name)
837 bool isIncreaseCut =
false;
839 isIncreaseCut =
true;
int hex_string_to_int(string hex_string)
R__EXTERN TEveManager * gEve
R__EXTERN TGeoManager * gGeoManager
R__EXTERN TSystem * gSystem
TGCheckButton * fShowMCTracks
TGCheckButton * fShowMCPoints
TGCheckButton * fShowRecoPoints
TGCheckButton * fShowRecoTracks
bool fgShowShowRecoTracks
TEveElementList * EveRecoPoints
virtual void Init(Int_t visopt=1, Int_t vislvl=3, Int_t maxvisnds=10000)
static MpdEventManager * fgRinstance
vector< structLevelColoring * > vecLevelColoring
TEveViewer * fMultiRPhiView
void SelectedGeometryColoring()
bool fgRedrawRecoPointsReqired
TEveProjectionManager * fRhoZMng
void LevelChangeNodeProperty(TGeoNode *node, size_t level)
VisualizationColoring gVisualizationColoring
virtual void ExpandEnergyLimits(Float_t check_energy, float add_multiplier=1)
vector< structSelectedColoring * > vecSelectedColoring
static MpdEventManager * Instance()
MpdEventManagerEditor * GetEventEditor()
virtual ~MpdEventManager()
TEveScene * fRPhiGeomScene
TEveProjectionAxes * fAxesPhi
TEveElementList * EveRecoTracks
virtual void GotoEvent(Int_t event)
virtual Int_t Color(Int_t pdg)
TEveViewer * fMulti3DView
void SetViewers(TEveViewer *RPhi, TEveViewer *RhoZ)
void InitColorStructure()
MpdEventManagerEditor * fEventEditor
TEveProjectionAxes * fAxesRho
TEveElementList * EveMCTracks
TEveScene * fRhoZGeomScene
void RecursiveChangeNodeTransparent(TGeoNode *parentNode, int transparency)
map< int, int > fPDGToColor
TEveViewer * fMultiRhoZView
bool fgShowShowRecoPoints
Int_t StringToColor(TString color)
void SetTransparentGeometry(bool is_on)
void LoadXMLDetector(TGeoNode *node, MpdXMLNode *xml, Int_t depth=0)
unordered_set< Int_t > fCurrentPDG
virtual void AddParticlesToPdgDataBase()
void AddEventElement(TEveElement *element, ElementList element_list)
TEveProjectionManager * fRPhiMng
void RecursiveChangeNodeProperty(TGeoNode *parentNode, Int_t color, int transparency)
virtual void LoadXMLSettings()
TEveElementList * EveMCPoints
virtual void DisplaySettings()
class for opening XML files
MpdXMLNode * GetRootNode() const
class for representing XML node
MpdXMLNode * GetChild(TString name, Int_t count=0) const
search for node with given name
MpdXMLAttrib * GetAttrib(TString name) const
Int_t GetNChildren() const
virtual void SetFillColor(Color_t fcolor)
Int_t ParseFile(const char *filename) override
static TDatabasePDG * Instance()
TParticlePDG * GetParticle(const char *name) const
virtual TParticlePDG * AddParticle(const char *Name, const char *Title, Double_t Mass, Bool_t Stable, Double_t DecayWidth, Double_t Charge, const char *ParticleClass, Int_t PdgCode, Int_t Anti=-1, Int_t TrackingCode=0)
TEveElementList(const char *n="TEveElementList", const char *t="", Bool_t doColor=kFALSE, Bool_t doTransparency=kFALSE)
void SetElementName(const char *name) override
TEveEventManager(const char *n="TEveEventManager", const char *t="")
static TEveManager * Create(Bool_t map_window=kTRUE, Option_t *opt="FIV")
TGLViewer * GetGLViewer() const
virtual void AddScene(TEveScene *scene)
TEveWindowSlot * NewSlot() override
TEveWindowPack * MakePack()
static TEveWindowSlot * CreateWindowInTab(TGTab *tab, TEveWindow *eve_parent=nullptr)
void SetShowTitleBar(Bool_t x)
void SetShowOrthographic(Bool_t x)
void SetOrthographicMode(EMode m)
void SetClipState(TGLClip::EType type, const Double_t data[6])
void SetClipType(TGLClip::EType type)
void SetLight(ELight light, Bool_t on)
TGLCameraOverlay * GetCameraOverlay() const
TGLLightSet * GetLightSet() const
void SetCurrentCamera(ECameraType camera)
TGLClipSet * GetClipSet() const
void SetClearColor(Color_t col)
TGeoVolume * GetVolume() const
Int_t GetNdaughters() const
TGeoNode * GetDaughter(Int_t ind) const
void SetVisibility(Bool_t vis=kTRUE) override
Int_t GetNdaughters() const
void SetTransparency(Char_t transparency=0)
TGeoNode * GetNode(const char *name) const
void SetLineColor(Color_t lcolor) override
const char * GetName() const override
Int_t GetEntriesFast() const
TObject * At(Int_t idx) const override
Ssiz_t First(char c) const
const char * Data() const
Bool_t EqualTo(const char *cs, ECaseCompare cmp=kExact) const
TObjArray * Tokenize(const TString &delim) const
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
TString & Remove(EStripType s, char c)
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
TString & ReplaceAll(const char *s1, const char *s2)
void SetValidate(Bool_t val=kTRUE)
RVec< PromoteType< T > > ceil(const RVec< T > &v)
basic_json<> json
default specialization
int detector_transparency