-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minor updates for TRestGDMLParser #202
Changes from all commits
9f295b4
f0ebe59
1c6fce3
d23d41f
2bc7e4e
bc07e79
90eaa64
d58379b
1ffc4f5
3fa0573
226b8e6
0d73a2b
172ba77
887ef17
c497cb5
26647a2
ffb4790
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,49 +7,51 @@ | |
|
||
#include "TRestMetadata.h" | ||
|
||
/////////////////////////////////////////// | ||
// we must preprocess gdml file because of a bug in TGDMLParse::Value() in ROOT6 | ||
// | ||
|
||
class TRestGDMLParser : public TRestMetadata { | ||
private: | ||
TGeoManager* fGeo; | ||
TGeoManager* fGeoManager{}; | ||
|
||
public: | ||
TRestGDMLParser() {} | ||
~TRestGDMLParser() {} | ||
std::string filestr = ""; | ||
std::string path = ""; | ||
std::string outPath = REST_USER_PATH + "/gdml/"; | ||
std::string outfilename = ""; | ||
std::string gdmlVersion = "0.0"; | ||
std::map<std::string, std::string> entityVersion; | ||
TRestGDMLParser() = default; | ||
~TRestGDMLParser() = default; | ||
|
||
std::string GetEntityVersion(std::string name); | ||
std::string fFileString = ""; | ||
std::string fPath = ""; | ||
std::string fOutputGdmlDirectory = REST_USER_PATH.empty() ? "/tmp/gdml/" : REST_USER_PATH + "/gdml/"; | ||
std::string fOutputGdmlFilename = ""; | ||
std::string fGdmlVersion = "0.0"; | ||
std::map<std::string, std::string> fEntityVersionMap{}; | ||
|
||
std::string GetGDMLVersion(); | ||
std::string GetEntityVersion(const std::string& name) const; | ||
|
||
std::string GetOutputGDMLFile(); | ||
inline std::string GetGDMLVersion() const { return fGdmlVersion; } | ||
|
||
void Load(std::string file); | ||
inline std::string GetOutputGDMLFile() const { return fOutputGdmlFilename; } | ||
|
||
TGeoManager* GetGeoManager(std::string gdmlFile) { | ||
Load(gdmlFile); | ||
fGeo = TGeoManager::Import(GetOutputGDMLFile().c_str()); | ||
return fGeo; | ||
void Load(const std::string& filename); | ||
|
||
inline TGeoManager* GetGeoManager(const std::string& gdmlFilename) { | ||
Load(gdmlFilename); | ||
fGeoManager = TGeoManager::Import(GetOutputGDMLFile().c_str()); | ||
return fGeoManager; | ||
} | ||
|
||
TGeoManager* CreateGeoM(); | ||
TGeoManager* CreateGeoManager(); | ||
[[deprecated("Use CreateGeoManager() instead.")]] inline TGeoManager* CreateGeoM() { | ||
return CreateGeoManager(); | ||
} | ||
|
||
void InitFromConfigFile() {} | ||
void InitFromConfigFile() override {} | ||
|
||
void PrintContent(); | ||
|
||
void ReplaceEntity(); | ||
|
||
void ReplaceAttributeWithKeyWord(std::string keyword); | ||
void ReplaceAttributeWithKeyWord(const std::string& keyword); | ||
|
||
ClassDef(TRestGDMLParser, 1); | ||
ClassDefOverride(TRestGDMLParser, 2); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For curiosity, when should we use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should use
In general is a good practise to mark inherited virtual functions with I think we should update the template macros to generate different processes or metadata accordingly. |
||
}; | ||
|
||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this a bug fix?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really sure, it was introduced by @juanangp
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is a bug fix, it was giving an error after performing
cmake