File tree Expand file tree Collapse file tree
fairroot/eventdisplay/xml Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11/* *******************************************************************************
2- * Copyright (C) 2020-2023 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
2+ * Copyright (C) 2020-2024 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
33 * *
44 * This software is distributed under the terms of the *
55 * GNU Lesser General Public Licence (LGPL) version 3, *
2020
2121#include < TString.h>
2222
23- FairXMLPdgColor::FairXMLPdgColor (FairXMLNode* node)
23+ FairXMLPdgColor::FairXMLPdgColor (const FairXMLNode* node)
2424{
2525 if (!node) {
2626 SetDefColor ();
@@ -32,8 +32,13 @@ FairXMLPdgColor::FairXMLPdgColor(FairXMLNode* node)
3232 return ;
3333 }
3434
35- for (int i = 0 ; i < node->GetNChildren (); i++) {
36- FairXMLNode* colors = node->GetChild (i);
35+ SetColorsFromXML (*node);
36+ }
37+
38+ void FairXMLPdgColor::SetColorsFromXML (const FairXMLNode& node)
39+ {
40+ for (int i = 0 ; i < node.GetNChildren (); i++) {
41+ const FairXMLNode* colors = node.GetChild (i);
3742 TString pgd_code = colors->GetAttrib (" pdg" )->GetValue ();
3843 TString color_code = colors->GetAttrib (" color" )->GetValue ();
3944 fPDGToColor [pgd_code.Atoi ()] = StringToColor (color_code);
Original file line number Diff line number Diff line change 11/* *******************************************************************************
2- * Copyright (C) 2020-2023 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
2+ * Copyright (C) 2020-2024 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
33 * *
44 * This software is distributed under the terms of the *
55 * GNU Lesser General Public Licence (LGPL) version 3, *
@@ -28,8 +28,9 @@ class FairXMLPdgColor : public FairXMLEveConf
2828 void SetDefColor ();
2929
3030 public:
31- explicit FairXMLPdgColor (FairXMLNode* node = nullptr );
31+ explicit FairXMLPdgColor (const FairXMLNode* node = nullptr );
3232 ~FairXMLPdgColor () override = default ;
33+ void SetColorsFromXML (const FairXMLNode& node);
3334 void SetColor (Int_t pdg, Int_t color) { fPDGToColor [pdg] = color; }
3435 Int_t GetColor (Int_t pdg) const ;
3536};
You can’t perform that action at this time.
0 commit comments