Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-22 09:55:37

0001 // SPDX-License-Identifier: LGPL-3.0-or-later
0002 // Copyright (C) 2022 Sylvester Joosten, Wouter Deconinck
0003 
0004 #include <algorithms/algorithm.h>
0005 
0006 // Event Model related classes
0007 #include <edm4eic/MCRecoParticleAssociationCollection.h>
0008 #include <edm4eic/ReconstructedParticleCollection.h>
0009 #include <edm4eic/TrackParametersCollection.h>
0010 #include <edm4hep/MCParticleCollection.h>
0011 
0012 namespace algorithms::truth {
0013 
0014 using ParticlesWithTruthPIDAlgorithm = Algorithm<
0015     Input<edm4hep::MCParticleCollection, edm4eic::TrackParametersCollection>,
0016     Output<edm4eic::ReconstructedParticleCollection, edm4eic::MCRecoParticleAssociationCollection>>;
0017 
0018 class ParticlesWithTruthPID : public ParticlesWithTruthPIDAlgorithm {
0019 public:
0020   ParticlesWithTruthPID(std::string_view name)
0021       : ParticlesWithTruthPIDAlgorithm{name,
0022                                        {"inputMCParticles", "inputTrackParameters"},
0023                                        {"outputParticles", "outputAssociations"},
0024                                        "Create mock reconstructed particles by associating truth "
0025                                        "PID with reconstructed tracks. Matching happens by "
0026                                        "comparing generated with reconstructed P, phi, and eta."} {}
0027 
0028   void init() final;
0029   void process(const Input&, const Output&) const final;
0030 
0031 private:
0032   // Matching momentum tolerance requires 10% by default;
0033   Property<double> m_pRelativeTolerance{this, "pRelativeTolerance", 0.1,
0034                                         "Relative momentum tolarance factor"};
0035   // Matching phi tolerance of 30 mrad
0036   Property<double> m_phiTolerance{this, "phiTolerance", 0.030, "Azimuthal angle tolerance in rad"};
0037   // Matching eta tolerance of 0.2
0038   Property<double> m_etaTolerance{this, "etaTolerance", 0.2, "Eta tolerance"};
0039 };
0040 
0041 } // namespace algorithms::truth
0042