Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
KFMCVertex.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file KFMCVertex.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 KFMCVERTEX_H
23 #define KFMCVERTEX_H
24 
25 #include <iostream>
26 #include <vector>
27 
39 {
40  public:
41  KFMCVertex();
42 
43  float Par( int i ) const { return fPar[i]; }
44 
45  float X() const { return fPar[0]; }
46  float Y() const { return fPar[1]; }
47  float Z() const { return fPar[2]; }
48 
49  const float* GetPar() const { return fPar; }
50 
51  void SetPar( int i, float v ) { fPar[i] = v; }
52 
53  void SetX( float v ) { fPar[0] = v; }
54  void SetY( float v ) { fPar[1] = v; }
55  void SetZ( float v ) { fPar[2] = v; }
56 
57  int NDaughterTracks() const { return fDaughterTracks.size(); }
59  void AddDaughterTrack( int iTr ) { fDaughterTracks.push_back(iTr); }
60  int DaughterTrack( int iTr ) const
61  {
65  if(iTr >= NDaughterTracks())
66  {
67  std::cout << "ERROR!!!! MC PV contains only " << NDaughterTracks() << " tracks" << std::endl;
68  return -1;
69  }
70  return fDaughterTracks[iTr];
71  }
72 
73  bool IsMCReconstructable() const { return fIsMCReconstructable; }
74  bool IsReconstructable() const { return fIsReconstructable; }
75  bool IsReconstructed() const { return fIsReconstructed; }
76 
79 
82 
85 
87 
88  bool IsTriggerPV() const { return fIsTriggerPV; }
89  void SetTriggerPV() { fIsTriggerPV = 1; }
90 
91  friend std::ostream& operator<<(std::ostream& out, const KFMCVertex &a);
92  friend std::istream& operator>>(std::istream& in, KFMCVertex &a);
93 
94  protected:
95 
96  float fPar[3];
97  std::vector<int> fDaughterTracks;
103 };
104 
105 #endif