JeffersonLab / JANA2

Multi-threaded HENP Event Reconstruction
https://jeffersonlab.github.io/JANA2/
Other
6 stars 9 forks source link

Use OmniFactories without explicit wiring #384

Open DraTeots opened 2 weeks ago

DraTeots commented 2 weeks ago

Trying to use JANA2 JOmniFactory. Unfortunately using i

    struct ReconstructedHitFactory : public JOmniFactory<ReconstructedHitFactory> {
        PodioInput<tdis::DigitizedMtpcMcHit> m_mc_hits_in {this, {"DigitizedMtpcMcHit"}};
        PodioOutput<edm4eic::TrackerHit> m_tracker_hits_out {this, "TrackerHit"};
//...

    auto reco_hit_generator = new JOmniFactoryGeneratorT<tdis::tracking::ReconstructedHitFactory>();
    app.Add(reco_hit_generator);

This will not work until explicit wiring is added

    reco_hit_generator->AddWiring("TrackerHitGenerator", {"DigitizedMtpcMcHit"}, {"TrackerHit"});

This line basically rewrites the above values. I understand that this is supported to nourish some expectations of some EICRecon developers. But in smaller application I don't see any value in this. On opposite, it makes people to write these string names in another part of codebase and makes code more difficult to grasp for those not familiar with JANA2. JANA2 wiring is still automatic and not explicit in general.

I have a couple of JANA2 applications for different experiments and projects. For all of them it is a problem.