Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
KFParticlePVReconstructor.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file KFParticlePVReconstructor.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 
23 #ifndef KFParticlePVReconstructor_H
24 #define KFParticlePVReconstructor_H
25 
26 #include "KFVertex.h"
27 #include "assert.h"
28 
29 #include <vector>
30 
31 class KFParticle;
32 class KFPTrackVector;
33 
46  public:
49 
50  void Init(KFPTrackVector *tracks, int nParticles);
51 
52  void ReconstructPrimVertex();
53 
54  int NPrimaryVertices() const { return fPrimVertices.size(); }
55  KFParticle &GetPrimVertex(int iPV=0) { return fPrimVertices[iPV]; }
56  KFVertex &GetPrimKFVertex(int iPV=0) { return fPrimVertices[iPV]; }
57  std::vector<int>& GetPVTrackIndexArray(int iPV=0) { return fClusters[iPV].fTracks; }
58  KFParticle &GetParticle(int i){ assert( i < fNParticles ); return fParticles[i]; }
59 
61  bool IsBeamLine() const { return fIsBeamLine; }
62 
68  void AddPV(const KFVertex &pv, const std::vector<int> &tracks);
72  void AddPV(const KFVertex &pv);
73  void CleanPV() { fClusters.clear(); fPrimVertices.clear(); }
74 
77  void SetChi2PrimaryCut(float chi2) { fChi2Cut = chi2; fChi2CutPreparation = chi2*5; }
78 
79  private:
82 
83  void FindPrimaryClusters( int cutNDF = 1);
84 
85  std::vector<KFParticle> fParticles;
87 
88  std::vector<float> fWeight;
89 
91  bool fIsBeamLine;
92 
103  std::vector<int> fTracks;
104  float fP[3];
105  float fC[6];
106  };
107 
108  std::vector< KFParticleCluster > fClusters;
109  std::vector<KFVertex> fPrimVertices;
110 
112  float fChi2Cut;
113 }; // class KFParticlePVReconstructor
114 
115 
116 #endif // KFParticlePVReconstructor_H
117