BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
PionZeroList.cxx
Go to the documentation of this file.
1#include "PionZeroList.h"
2const double m_true_pi0 = 0.135;
3using namespace std;
4
5//====================
6//********************
7//====================
8PionZero::PionZero( HepLorentzVector& vp_gam_1, int& index_gam_1, HepLorentzVector& vp_gam_2,
9 int& index_gam_2 )
10 : m_vp_1( vp_gam_1 )
11 , m_index_1( index_gam_1 )
12 , m_vp_2( vp_gam_2 )
13 , m_index_2( index_gam_2 ) {
14 m_vp_total = m_vp_1 + m_vp_2;
15 m_inv_mass = m_vp_total.m();
16 cal_goodness( 0 );
17}
18
19////********************
20// PionZero::PionZero():
21// m_vp_1(0),
22// m_index_1(x_gam_1),
23// m_vp_2(vp_gam_2),
24// m_index_2(index_gam_2){
25// m_vp_total = m_vp_1 + m_vp_2;
26// m_inv_mass = m_vp_total.m();
27// cal_goodness(0);
28// }
29
30//********************
31void PionZero::cal_goodness( int good_method ) {
32 switch ( good_method )
33 {
34 case 0: m_goodness = fabs( m_inv_mass - m_true_pi0 ); break;
35 case 1: cout << "not complete yet, sorry" << endl; break;
36 default: cout << "this default do nothing" << endl;
37 }
38}
39
40//====================
41//********************
42//====================
44 : m_gam_vp( input_vp )
45 , m_pi0_vp( 0 )
46 , Vpi0_list( 0 )
47 , m_low_cut( 0.11 )
48 , m_high_cut( 0.15 ) {
49 int m_Ngam( input_vp.size() );
50 if ( m_Ngam < 2 ) cout << "number of photons less than 2" << endl;
51 for ( int i = 0; i < m_Ngam - 1; i++ )
52 {
53 for ( int j = i + 1; j < m_Ngam; j++ )
54 {
55 double m_temp_mass( ( m_gam_vp[i] + m_gam_vp[j] ).m() );
56 if ( m_temp_mass < m_low_cut || m_temp_mass > m_high_cut ) continue;
57 PionZero m_temp_pi0( m_gam_vp[i], i, m_gam_vp[j], j );
58 Vpi0_list.push_back( m_temp_pi0 );
59 }
60 }
61 m_num_pi0 = Vpi0_list.size();
62}
63
64//*******************
65void PionZeroList::set_cut( int index, double cut ) {
66 if ( index < 1 ) m_low_cut = cut;
67 else m_high_cut = cut;
68 std::vector<PionZero>::iterator m_ind;
69 for ( m_ind = Vpi0_list.begin(); m_ind != Vpi0_list.end(); m_ind++ )
70 {
71 double m_temp_mass( ( *m_ind ).get_mass() );
72 if ( m_temp_mass < m_low_cut || m_temp_mass > m_high_cut ) Vpi0_list.erase( m_ind );
73 }
74 refresh();
75}
76
77//********************
78void PionZeroList::sort() { // sort the pion0 list respect to goodness
79 std::sort( Vpi0_list.begin(), Vpi0_list.end(), f_less() );
80 refresh();
81}
82
83//********************
85 std::vector<int> gam_index_v( 0 );
86 std::vector<PionZero> temp_pi0_list( 0 );
87 for ( int i = 0; i < Vpi0_list.size(); i++ )
88 {
89 int temp_one( Vpi0_list[i].get_index( 0 ) );
90 int temp_two( Vpi0_list[i].get_index( 1 ) );
91 if ( find( gam_index_v.begin(), gam_index_v.end(), temp_one ) != gam_index_v.end() )
92 continue;
93 if ( find( gam_index_v.begin(), gam_index_v.end(), temp_two ) != gam_index_v.end() )
94 continue;
95 gam_index_v.push_back( temp_one );
96 gam_index_v.push_back( temp_two );
97 temp_pi0_list.push_back( Vpi0_list[i] );
98 }
99 Vpi0_list = temp_pi0_list;
100 refresh();
101}
102
103//********************
105 m_num_pi0 = Vpi0_list.size();
106 m_pi0_vp.clear();
107 for ( int i = 0; i < m_num_pi0; i++ ) m_pi0_vp.push_back( Vpi0_list[i].get_pi0_vp() );
108}
109
110//********************
112 std::cout << "number of pion0 in the list " << m_num_pi0 << std::endl;
113 for ( int i = 0; i < Vpi0_list.size(); i++ )
114 {
115 std::cout << "i= " << i << endl;
116 std::cout << "pi0 mass " << Vpi0_list[i].get_mass() << endl;
117 std::cout << "pi0 goodness " << Vpi0_list[i].get_goodness() << endl;
118 std::cout << "pi0 four momentum " << Vpi0_list[i].get_pi0_vp() << endl;
119 std::cout << "fir gam index " << Vpi0_list[i].get_index( 0 ) << endl;
120 std::cout << "sec gam index " << Vpi0_list[i].get_index( 1 ) << endl;
121 std::cout << "fir gam mom " << Vpi0_list[i].get_gam_vp( 0 ) << endl;
122 std::cout << "sec gam mom " << Vpi0_list[i].get_gam_vp( 1 ) << endl;
123 }
124}
*********Class see also m_nmax DOUBLE PRECISION m_MasPhot DOUBLE PRECISION m_phsu DOUBLE PRECISION m_Xenph DOUBLE PRECISION m_r2 DOUBLE PRECISION m_WtMass INTEGER m_nmax INTEGER m_Nevgen INTEGER m_IsFSR INTEGER m_MarTot *COMMON c_KarFin $ !Output file $ !Event serial number $ !alpha QED at Thomson limit $ !minimum energy at CMS for remooval $ !infrared cut
Definition KarFin.h:27
const double m_true_pi0
std::vector< HepLorentzVector > Vp4
void set_cut(int index, double cut)
PionZeroList(Vp4 &input_vp)
void cal_goodness(int good_method)