Reintegrated irt-2.1d changes into a master branch#2515
Reintegrated irt-2.1d changes into a master branch#2515alexander-kiselev wants to merge 125 commits into
Conversation
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
```
/home/runner/work/EICrecon/EICrecon/src/algorithms/pid/G4DataInterpolation.cc: In member function 'double G4DataInterpolation::GetInterpolatedValue(double, order) const':
/home/runner/work/EICrecon/EICrecon/src/algorithms/pid/G4DataInterpolation.cc:85:14: error: comparison of integer expressions of different signedness: 'int' and 'unsigned int' [-Werror=sign-compare]
85 | if (ibin == tdim - 1)
| ~~~~~^~~~~~~~~~~
cc1plus: all warnings being treated as errors
```
/home/runner/work/EICrecon/EICrecon/src/algorithms/pid/IrtInterfaceJsonParser.cc: In member function 'void eicrecon::IrtInterface::JsonParser()':
/home/runner/work/EICrecon/EICrecon/src/algorithms/pid/IrtInterfaceJsonParser.cc:104:26: error: comparison of integer expressions of different signedness: 'int' and 'std::map<TString, IRT2::CherenkovRadiator*>::size_type' {aka 'long unsigned int'} [-Werror=sign-compare]
104 | if (rnum == reco->GetMyRICH()->Radiators().size()) {
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/runner/work/EICrecon/EICrecon/src/algorithms/pid/IrtInterfaceJsonParser.cc:110:44: error: comparison of integer expressions of different signedness: 'unsigned int' and 'int' [-Werror=sign-compare]
110 | for (unsigned ir = 0; ir < rnum; ir++)
| ~~~^~~~~~
This resolves conflict and brings this algorithm in compliance with the
interface.
In file included from /home/runner/work/EICrecon/EICrecon/src/algorithms/pid/IrtInterfaceJsonParser.cc:7:
/home/runner/work/EICrecon/EICrecon/src/algorithms/pid/IrtInterface.h:77:8: error: 'eicrecon::IrtInterface::init' hides overloaded virtual function [-Werror,-Woverloaded-virtual]
77 | void init(DD4hep_service& service, IrtConfig& config, std::shared_ptr<spdlog::logger>& logger);
| ^
/opt/local/include/algorithms/algorithm.h:87:16: note: hidden overloaded virtual function 'algorithms::Algorithm<algorithms::Input<edm4hep::MCParticleCollection, edm4eic::TrackCollection, edm4eic::MCRecoTrackParticleAssociationCollection, edm4eic::TrackSegmentCollection, edm4hep::SimTrackerHitCollection>, algorithms::Output<edm4eic::IrtRadiatorInfoCollection, edm4eic::IrtParticleCollection>>::init' declared here: different number of parameters (0 vs 3)
87 | virtual void init() {}
| ^
1 error generated.
for more information, see https://pre-commit.ci
In file included from /home/runner/work/EICrecon/EICrecon/src/detectors/RICH-IRT/RICH-IRT.cc:19:
/home/runner/work/EICrecon/EICrecon/src/extensions/jana/JOmniFactory.h:540:8: error: 'void JOmniFactory<AlgoT, ConfigT>::Process(const std::shared_ptr<const JEvent>&) [with AlgoT = eicrecon::IrtInterface_factory; ConfigT = eicrecon::IrtConfig]' was hidden [-Werror=overloaded-virtual=]
540 | void Process(const std::shared_ptr<const JEvent>& event) override {
| ^~~~~~~
In file included from /home/runner/work/EICrecon/EICrecon/src/detectors/RICH-IRT/RICH-IRT.cc:23:
/home/runner/work/EICrecon/EICrecon/src/global/pid/IrtInterface_factory.h:52:8: note: by 'void eicrecon::IrtInterface_factory::Process(int64_t, uint64_t)'
52 | void Process(int64_t run_number, uint64_t event_number) {
| ^~~~~~~
/home/runner/work/EICrecon/EICrecon/src/extensions/jana/JOmniFactory.h:538:16: error: 'void JOmniFactory<AlgoT, ConfigT>::Process(int32_t, uint64_t) [with AlgoT = eicrecon::IrtInterface_factory; ConfigT = eicrecon::IrtConfig; int32_t = int; uint64_t = long unsigned int]' was hidden [-Werror=overloaded-virtual=]
538 | virtual void Process(int32_t /* run_number */, uint64_t /* event_number */) {};
| ^~~~~~~
/home/runner/work/EICrecon/EICrecon/src/global/pid/IrtInterface_factory.h:52:8: note: by 'void eicrecon::IrtInterface_factory::Process(int64_t, uint64_t)'
52 | void Process(int64_t run_number, uint64_t event_number) {
| ^~~~~~~
/home/runner/work/EICrecon/EICrecon/src/extensions/jana/JOmniFactory.h:536:16: error: 'void JOmniFactory<AlgoT, ConfigT>::ChangeRun(int32_t) [with AlgoT = eicrecon::IrtInterface_factory; ConfigT = eicrecon::IrtConfig; int32_t = int]' was hidden [-Werror=overloaded-virtual=]
536 | virtual void ChangeRun(int32_t /* run_number */) override {};
| ^~~~~~~~~
/home/runner/work/EICrecon/EICrecon/src/global/pid/IrtInterface_factory.h:50:8: note: by 'void eicrecon::IrtInterface_factory::ChangeRun(int64_t)'
50 | void ChangeRun(int64_t run_number) {}
| ^~~~~~~~~
/home/runner/work/EICrecon/EICrecon/src/global/pid/IrtInterface_factory.h: In member function 'void eicrecon::IrtInterface_factory::ChangeRun(int64_t)':
/home/runner/work/EICrecon/EICrecon/src/global/pid/IrtInterface_factory.h:50:26: error: unused parameter 'run_number' [-Werror=unused-parameter]
50 | void ChangeRun(int64_t run_number) {}
| ~~~~~~~~^~~~~~~~~~
/home/runner/work/EICrecon/EICrecon/src/global/pid/IrtInterface_factory.h: In member function 'void eicrecon::IrtInterface_factory::Process(int64_t, uint64_t)':
/home/runner/work/EICrecon/EICrecon/src/global/pid/IrtInterface_factory.h:52:24: error: unused parameter 'run_number' [-Werror=unused-parameter]
52 | void Process(int64_t run_number, uint64_t event_number) {
| ~~~~~~~~^~~~~~~~~~
/home/runner/work/EICrecon/EICrecon/src/global/pid/IrtInterface_factory.h:52:45: error: unused parameter 'event_number' [-Werror=unused-parameter]
52 | void Process(int64_t run_number, uint64_t event_number) {
| ~~~~~~~~~^~~~~~~~~~~~
/home/runner/work/EICrecon/EICrecon/src/detectors/RICH-IRT/RICH-IRT.cc: In function 'void InitPlugin(JApplication*)':
/home/runner/work/EICrecon/EICrecon/src/detectors/RICH-IRT/RICH-IRT.cc:171:20: error: unused variable 'bf' [-Werror=unused-variable]
171 | bool bf = sf->GetCrossing(x0, n0, &from, false);
| ^~
/home/runner/work/EICrecon/EICrecon/src/detectors/RICH-IRT/RICH-IRT.cc:172:20: error: unused variable 'br' [-Werror=unused-variable]
172 | bool br = sr->GetCrossing(x0, n0, &to, false);
| ^~
/home/runner/work/EICrecon/EICrecon/src/detectors/RICH-IRT/RICH-IRT.cc:186:31: error: comparison of integer expressions of different signedness: 'int' and 'unsigned int' [-Werror=sign-compare]
186 | for (int i = 0; i < numPlanes; i++) {
| ~~^~~~~~~~~~~
/home/runner/work/EICrecon/EICrecon/src/detectors/RICH-IRT/RICH-IRT.cc: In lambda function:
/home/runner/work/EICrecon/EICrecon/src/detectors/RICH-IRT/RICH-IRT.cc:213:79: error: unused parameter 'p' [-Werror=unused-parameter]
213 | std::function<bool(edm4eic::TrackPoint)>([](edm4eic::TrackPoint p) { return true; });
| ~~~~~~~~~~~~~~~~~~~~^
/home/runner/work/EICrecon/EICrecon/src/detectors/RICH-IRT/RICH-IRT.cc: In function 'void InitPlugin(JApplication*)':
/home/runner/work/EICrecon/EICrecon/src/detectors/RICH-IRT/RICH-IRT.cc:338:22: error: unused variable 'bf' [-Werror=unused-variable]
338 | bool bf = sf->GetCrossing(x0, n0, &from, false);
| ^~
/home/runner/work/EICrecon/EICrecon/src/detectors/RICH-IRT/RICH-IRT.cc:339:22: error: unused variable 'br' [-Werror=unused-variable]
339 | bool br = sr->GetCrossing(x0, n0, &to, false);
| ^~
/home/runner/work/EICrecon/EICrecon/src/detectors/RICH-IRT/RICH-IRT.cc:353:33: error: comparison of integer expressions of different signedness: 'int' and 'unsigned int' [-Werror=sign-compare]
353 | for (int i = 0; i < numPlanes; i++) {
| ~~^~~~~~~~~~~
/home/runner/work/EICrecon/EICrecon/src/detectors/RICH-IRT/RICH-IRT.cc: In lambda function:
/home/runner/work/EICrecon/EICrecon/src/detectors/RICH-IRT/RICH-IRT.cc:380:40: error: unused parameter 'p' [-Werror=unused-parameter]
380 | [](edm4eic::TrackPoint p) { return true; });
| ~~~~~~~~~~~~~~~~~~~~^
cc1plus: all warnings being treated as errors
for more information, see https://pre-commit.ci
This reverts commit 8484aa0.
for more information, see https://pre-commit.ci
| if (m_ReconstructionFactory) { | ||
| delete m_ReconstructionFactory; | ||
| m_ReconstructionFactory = nullptr; | ||
| } //if | ||
|
|
||
| if (m_Event) { | ||
| delete m_Event; | ||
| m_Event = nullptr; | ||
| } //if | ||
|
|
||
| if (m_irt_detector) { | ||
| for (auto [name, rad] : m_irt_detector->Radiators()) { | ||
| if (rad && rad->m_RefractiveIndex) { | ||
| delete rad->m_RefractiveIndex; | ||
| rad->m_RefractiveIndex = nullptr; | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
Can we use smart pointers here and rely on RAII for deletion? Likely makes destructor sufficient as default.
There was a problem hiding this comment.
My thought too. I suspect IRT2 won't use smart pointers inside due to ROOT streamer issues. I will treat m_Event/m_ReconstructionFactory that we have full control over.
| auto dd4hep_service = app->GetService<DD4hep_service>(); | ||
| auto det = dd4hep_service->detector(); |
There was a problem hiding this comment.
Anti-pattern to parse geometry in plugin. In this case we don't use the geometry beyond checking that the specific RICH is there, so we can skip this here and rely on the algorithm not doing anything if the RICH is not in the geometry.
There was a problem hiding this comment.
I'm not sure. I think this is a valid question and the FIXME states as much. I suspect, there might be a crash whenever IRT2 tries to access a detector that is not in the configuration, and this is a guard against that. I don't think it's in scope to fix that now - we'll need to revisit this.
Co-authored-by: Wouter Deconinck <wdconinc@gmail.com>
Co-authored-by: Wouter Deconinck <wdconinc@gmail.com>
for more information, see https://pre-commit.ci
Conflicts: src/detectors/PFRICH/PFRICH.cc
for more information, see https://pre-commit.ci
Makes IRT2 codes consistent with irt-2.1e branches in EDM4eic/irt/epic repositories and 26.02.0-stable image
TODO:
EICrecon/src/algorithms/calorimetry/CalorimeterHitDigi.h
Line 81 in af0e8fb
EICrecon/src/algorithms/calorimetry/CalorimeterHitDigi.cc
Lines 147 to 150 in af0e8fb