Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
KFVertex.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file KFVertex.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 KFVERTEX_H
24 #define KFVERTEX_H
25 
26 #include "KFParticle.h"
27 #include "KFPVertex.h"
28 
39 class KFVertex : public KFParticle
40 {
41  public:
42 
44  KFVertex( const KFParticle &particle ): KFParticle(particle), fIsConstrained(0) {}
45  KFVertex( const KFPVertex &vertex );
47 
48  Int_t GetNContributors() const { return fIsConstrained ?fNDF/2:(fNDF+3)/2; }
49 
50 
51  void operator +=( const KFParticle &Daughter );
52  KFVertex operator -( const KFParticle &Daughter ) const;
53  void operator -=( const KFParticle &Daughter );
54 
55  void SetBeamConstraint( float X, float Y, float Z,
56  float ErrX, float ErrY, float ErrZ );
57  void SetBeamConstraintOff();
58 
59  void ConstructPrimaryVertex( const KFParticle *vDaughters[], int nDaughters,
60  Bool_t vtxFlag[], float ChiCut=3.5 );
61 
62  protected:
63 
64  Bool_t fIsConstrained;
65 
66 #ifndef KFParticleStandalone
67  ClassDef( KFVertex, 2 )
68 #endif
69 };
70 
71 
72 //---------------------------------------------------------------------
73 //
74 // Inline implementation of the KFVertex methods
75 //
76 //---------------------------------------------------------------------
77 
78 
79 inline void KFVertex::operator+=( const KFParticle &Daughter )
80 {
81  KFParticle::operator+=( Daughter );
82 }
83 
84 
85 inline void KFVertex::operator-=( const KFParticle &Daughter )
86 {
87  Daughter.SubtractFromVertex( *this );
88 }
89 
90 inline KFVertex KFVertex::operator-( const KFParticle &Daughter ) const
91 {
92  KFVertex tmp = *this;
93  Daughter.SubtractFromVertex( tmp );
94  return tmp;
95 }
96 
97 
98 #endif