Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
KFPartMatch.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file KFPartMatch.h
1 /*
2  * This file is part of KFParticle package
3  * Copyright (C) 2007-2019 FIAS Frankfurt Institute for Advanced Studies
4  * 2007-2019 Goethe University of Frankfurt
5  * 2007-2019 Ivan Kisel <I.Kisel@compeng.uni-frankfurt.de>
6  * 2007-2019 Maksym Zyzak
7  *
8  * KFParticle is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * KFParticle is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <https://www.gnu.org/licenses/>.
20  */
21 
22 #ifndef KFPartMatch_H
23 #define KFPartMatch_H
24 
25 #include <vector>
26 
27 
39 struct KFPartMatch // used for Reco to MC match as well as for MC to Reco
40 {
42 
43  bool IsMatched() const { return ids.size() != 0 || idsMI.size() != 0; }
44  bool IsMatchedWithPdg() const { return ids.size() != 0; }
45  int GetBestMatch() const {
46  if (ids.size() != 0) return ids[0];
47  else if (idsMI.size() != 0) return idsMI[0];
48  else return -1;
49  }
50  int GetBestMatchWithPdg() const {
51  if (ids.size() != 0) return ids[0];
52  else return -1;
53  }
54  std::vector<int> ids;
55  std::vector<int> idsMI;
56 };
57 
58 #endif