BOSS 7.1.2
BESIII Offline Software System
Loading...
Searching...
No Matches
PionZeroList Class Reference

#include <PionZeroList.h>

Classes

class  f_less
 

Public Member Functions

 PionZeroList (Vp4 &input_vp)
 
void set_cut (int index, double cut)
 
void sort ()
 
void reduce ()
 
void print ()
 
void refresh ()
 
int get_num_pi0 ()
 
Vp4 get_pi0_list ()
 

Detailed Description

Definition at line 32 of file PionZeroList.h.

Constructor & Destructor Documentation

◆ PionZeroList()

PionZeroList::PionZeroList ( Vp4 & input_vp)

Definition at line 46 of file PionZeroList.cxx.

46 :
47 m_gam_vp(input_vp),
48 m_pi0_vp(0),
49 Vpi0_list(0),
50 m_low_cut(0.11),
51 m_high_cut(0.15){
52 int m_Ngam(input_vp.size());
53 if(m_Ngam<2) cout << "number of photons less than 2" << endl;
54 for(int i=0; i<m_Ngam-1; i++){
55 for(int j=i+1; j<m_Ngam; j++){
56 double m_temp_mass((m_gam_vp[i]+m_gam_vp[j]).m());
57 if(m_temp_mass<m_low_cut || m_temp_mass>m_high_cut) continue;
58 PionZero m_temp_pi0(m_gam_vp[i], i, m_gam_vp[j], j);
59 Vpi0_list.push_back(m_temp_pi0);
60 }
61 }
62 m_num_pi0 = Vpi0_list.size();
63}

Member Function Documentation

◆ get_num_pi0()

int PionZeroList::get_num_pi0 ( )
inline

Definition at line 40 of file PionZeroList.h.

40{ return m_num_pi0; }

◆ get_pi0_list()

Vp4 PionZeroList::get_pi0_list ( )
inline

Definition at line 41 of file PionZeroList.h.

41{ return m_pi0_vp; }

◆ print()

void PionZeroList::print ( )

Definition at line 108 of file PionZeroList.cxx.

108 {
109 std::cout << "number of pion0 in the list " << m_num_pi0 << std::endl;
110 for(int i=0; i<Vpi0_list.size(); i++){
111 std::cout << "i= " << i << endl;
112 std::cout << "pi0 mass " << Vpi0_list[i].get_mass() << endl;
113 std::cout << "pi0 goodness " << Vpi0_list[i].get_goodness() << endl;
114 std::cout << "pi0 four momentum " << Vpi0_list[i].get_pi0_vp() << endl;
115 std::cout << "fir gam index " << Vpi0_list[i].get_index(0) << endl;
116 std::cout << "sec gam index " << Vpi0_list[i].get_index(1) << endl;
117 std::cout << "fir gam mom " << Vpi0_list[i].get_gam_vp(0) << endl;
118 std::cout << "sec gam mom " << Vpi0_list[i].get_gam_vp(1) << endl;
119 }
120}

◆ reduce()

void PionZeroList::reduce ( )

Definition at line 84 of file PionZeroList.cxx.

84 {
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 int temp_one(Vpi0_list[i].get_index(0));
89 int temp_two(Vpi0_list[i].get_index(1));
90 if(find(gam_index_v.begin(), gam_index_v.end(), temp_one) != gam_index_v.end() ) continue;
91 if(find(gam_index_v.begin(), gam_index_v.end(), temp_two) != gam_index_v.end() ) continue;
92 gam_index_v.push_back(temp_one);
93 gam_index_v.push_back(temp_two);
94 temp_pi0_list.push_back(Vpi0_list[i]);
95 }
96 Vpi0_list = temp_pi0_list;
97 refresh();
98}

◆ refresh()

void PionZeroList::refresh ( )

Definition at line 101 of file PionZeroList.cxx.

101 {
102 m_num_pi0 = Vpi0_list.size();
103 m_pi0_vp.clear();
104 for(int i=0; i<m_num_pi0; i++) m_pi0_vp.push_back(Vpi0_list[i].get_pi0_vp());
105}

Referenced by reduce(), set_cut(), and sort().

◆ set_cut()

void PionZeroList::set_cut ( int index,
double cut )

Definition at line 66 of file PionZeroList.cxx.

66 {
67 if(index < 1) m_low_cut = cut;
68 else m_high_cut = cut;
69 std::vector<PionZero>::iterator m_ind;
70 for(m_ind=Vpi0_list.begin(); m_ind!=Vpi0_list.end(); m_ind++){
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}

◆ sort()

void PionZeroList::sort ( )

Definition at line 78 of file PionZeroList.cxx.

78 { // sort the pion0 list respect to goodness
79 std::sort(Vpi0_list.begin(), Vpi0_list.end(), f_less());
80 refresh();
81}

The documentation for this class was generated from the following files: