Draft: Move class with utility functions to namespace
When compiling rich reconstruction classes afer changing the build system one gets the following error
reco/detectors/rich/CbmRichConverter.h:49:17: error: invalid use of member 'fRichHits' in static member function if (NULL == fRichHits) { Init(); }
The only way I found to fix the issue was to implement the utility functions in a namespace with the data member defined in an anonymous namespace.
Merge request reports
Activity
assigned to @f.uhlig
please check the changes. This is the code I told you about in the mail.
added 1 commit
- 66505cfb - Move class with utility functions to namespace
Can you try to add
TClonesArray* CbmRichConverter::fRichHits = NULL;
In the beginning of
reco/detectors/rich/CbmRichTrainAnnSelect.cxx
It should solve compilation problem. I mean the code before introducing namespaces.
thanks for the hint, I overlooked the source file. You are right with this change and a small adaption in the header the compilation works. Could you confirm that the change is okay.
diff --git a/reco/detectors/rich/CbmRichConverter.cxx b/reco/detectors/rich/CbmRichConverter.cxx index 2b6ed34b..f32d316b 100644 --- a/reco/detectors/rich/CbmRichConverter.cxx +++ b/reco/detectors/rich/CbmRichConverter.cxx @@ -4,4 +4,4 @@ #include "CbmRichConverter.h" -//TClonesArray* CbmRichConverter::fRichHits = NULL; +TClonesArray* CbmRichConverter::fRichHits = nullptr; diff --git a/reco/detectors/rich/CbmRichConverter.h b/reco/detectors/rich/CbmRichConverter.h index cb88ae03..2e65479c 100644 --- a/reco/detectors/rich/CbmRichConverter.h +++ b/reco/detectors/rich/CbmRichConverter.h @@ -89,7 +89,7 @@ public: ring2->SetPhi(ring1->GetPhi()); } - TClonesArray* fRichHits{nullptr}; + static TClonesArray* fRichHits; public: /**
Fine with me.
forget this MR: somehow I must have had a messed up local version. I checked now the version from the master branch and there the code is exactly as you proposed.
@f.uhlig But with your changes code should also work fine.
Dear @s.lebedev,
you have been identified as code owner of at least one file which was changed with this merge request.
Please check the changes and approve them or request changes.
added CodeOwners label