BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
KinematicConstraints.cxx
Go to the documentation of this file.
1// #include <iostream>
2#include "VertexFit/KinematicConstraints.h"
3
4const int KinematicConstraints::Resonance = 1;
5const int KinematicConstraints::TotalEnergy = 2;
6const int KinematicConstraints::TotalMomentum = 4;
7const int KinematicConstraints::Position = 8;
8const int KinematicConstraints::ThreeMomentum = 16;
9const int KinematicConstraints::FourMomentum = 32;
10const int KinematicConstraints::EqualMass = 64;
11
13 m_Ec.clear();
14 m_Dc.clear();
15 m_dc.clear();
16 m_Vm.clear();
17 m_lambda.clear();
18 m_ltrk.clear();
19 m_nequal.clear();
20 m_nc = 0;
21 m_mres = -1;
22 m_etot = -1;
23 m_ptot = -1;
24 m_p3 = Hep3Vector( 0, 0, 0 );
25 m_p4 = HepLorentzVector( 0, 0, 0, 0 );
26 m_phipre = 0;
27 m_lambdapre = 0;
28 m_Vre = HepSymMatrix( 1, 0 );
29 m_Vme = HepSymMatrix( 4, 0 );
30 m_Vne = HepSymMatrix( 1, 0 );
31 m_Vpe = HepSymMatrix( 2, 0 );
32}
33
34void KinematicConstraints::ResonanceConstraints( const double mres, std::vector<int> tlis,
35 HepSymMatrix Vre ) {
36 m_ltrk = tlis;
37 m_nc = 1;
38 setType( typeRes() );
39 setMres( mres );
40 setVre( Vre );
42}
43
44void KinematicConstraints::TotalEnergyConstraints( const double etot, std::vector<int> tlis ) {
45 m_ltrk = tlis;
46 m_nc = 1;
47 setType( typeEtot() );
48 setEtot( etot );
49 HepSymMatrix tmp( 1, 0 );
50 setVmeasure( tmp );
51}
52
54 std::vector<int> tlis ) {
55 m_ltrk = tlis;
56 m_nc = 1;
57 setType( typePtot() );
58 setPtot( ptot );
59 HepSymMatrix tmp( 1, 0 );
60 setVmeasure( tmp );
61}
62
64 std::vector<int> tlis ) {
65 m_ltrk = tlis;
66 m_nc = 3;
67 setType( typeP3() );
68 setP3( p3 );
69 HepSymMatrix tmp( 3, 0 );
70 setVmeasure( tmp );
71}
72
74 std::vector<int> tlis, HepSymMatrix Vme ) {
75 m_ltrk = tlis;
76 m_nc = 4;
77 setType( typeP4() );
78 setP4( p4 );
79 setVme( Vme );
80 m_Vm.push_back( Vme );
82}
83
84void KinematicConstraints::EqualMassConstraints( std::vector<int> tlis1,
85 std::vector<int> tlis2, HepSymMatrix Vne ) {
86 m_ltrk.clear();
87 for ( unsigned int i = 0; i < tlis1.size(); i++ ) m_ltrk.push_back( tlis1[i] );
88 for ( unsigned int i = 0; i < tlis2.size(); i++ ) m_ltrk.push_back( tlis2[i] );
89 m_nc = 1;
91 setVne( Vne );
92 m_Vm.push_back( Vne );
93 m_nequal.clear();
94 m_nequal.push_back( tlis1.size() );
95 m_nequal.push_back( tlis2.size() );
97}
98/*
99void KinematicConstraints::PositionConstraints(const double phipre, const double lambdapre,
100std::vector<int> tlis_V, HepSymMatrix Vpe) { m_ltrk_V = tlis_V; m_nc = 2; setType(typePoint());
101 setPhipre(phipre);
102 setLambdapre(lambdapre);
103 setVpe(Vpe);
104 m_Vm.push_back(Vpe);
105 setVmeasure(Vpe);
106}
107*/
void FourMomentumConstraints(const HepLorentzVector p4, std::vector< int > tlis, HepSymMatrix Vme)
void ResonanceConstraints(const double mres, std::vector< int > tlis, HepSymMatrix Vre)
void ThreeMomentumConstraints(const Hep3Vector p3, std::vector< int > tlis)
void TotalEnergyConstraints(const double etot, std::vector< int > tlis)
void TotalMomentumConstraints(const double ptot, std::vector< int > tlis)
void EqualMassConstraints(std::vector< int > tlis1, std::vector< int > tlis2, HepSymMatrix Vne)