KFPartMatch.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. //----------------------------------------------------------------------------
  2. // Implementation of the KFParticle class
  3. // .
  4. // @author I.Kisel, I.Kulakov, M.Zyzak
  5. // @version 1.0
  6. // @since 20.08.13
  7. //
  8. //
  9. // -= Copyright &copy ALICE HLT and CBM L1 Groups =-
  10. //____________________________________________________________________________
  11. #ifndef KFPartMatch_H
  12. #define KFPartMatch_H
  13. #include <vector>
  14. /** @class KFPartMatch
  15. ** @brief A structure to store matching information between simulated Monte Carlo and reconstructed particles.
  16. ** @author M.Zyzak, I.Kisel
  17. ** @date 05.02.2019
  18. ** @version 1.0
  19. **
  20. ** The class is used in both directions: to store links from Monte Carlo to reconstructed particles and vise versa.
  21. ** It contains two kind of links: 1) PDG hypothesis of the reconstructed and Monte Carlo particles should be the same;
  22. ** 2) PDG code differs.
  23. **/
  24. struct KFPartMatch // used for Reco to MC match as well as for MC to Reco
  25. {
  26. KFPartMatch():ids(),idsMI() {}
  27. bool IsMatched() const { return ids.size() != 0 || idsMI.size() != 0; } ///< Returns true if at least one link exists independently of the PDG hypothesis.
  28. bool IsMatchedWithPdg() const { return ids.size() != 0; } ///< Returns true is at least one link with the correct PDG exists.
  29. int GetBestMatch() const {
  30. if (ids.size() != 0) return ids[0];
  31. else if (idsMI.size() != 0) return idsMI[0];
  32. else return -1;
  33. } ///< Returns first link with correct PDG if exists, otherwise first link with incorrect PDG. If no link exists returns "-1".
  34. int GetBestMatchWithPdg() const {
  35. if (ids.size() != 0) return ids[0];
  36. else return -1;
  37. } ///< Returns first link with correct PDG if exists, otherwise returns "-1".
  38. std::vector<int> ids; ///< Vector of links, PDG hypothesis of the reconstructed particle is required to be the same as the PDG code of the Monte Carlo particle.
  39. std::vector<int> idsMI; ///< Vector of links, PDG hypothesis of the reconstructed particle differs from the Monte Carlo particle.
  40. };
  41. #endif