BOSS 7.0.2
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtMassH2 Class Reference

#include <EvtMassH2.hh>

+ Inheritance diagram for EvtMassH2:

Public Member Functions

 EvtMassH2 ()
 
virtual ~EvtMassH2 ()
 
void getName (std::string &name)
 
EvtDecayBaseclone ()
 
void initProbMax ()
 
void init ()
 
void decay (EvtParticle *p)
 
const char * setFileName ()
 
const char * setHpoint ()
 
int * setDaugPair ()
 
- Public Member Functions inherited from EvtDecayIncoherent
void makeDecay (EvtParticle *p)
 
virtual ~EvtDecayIncoherent ()
 
void setDaughterSpinDensity (int daughter)
 
int isDaughterSpinDensitySet (int daughter)
 
- Public Member Functions inherited from EvtDecayBase
virtual void getName (std::string &name)=0
 
virtual void decay (EvtParticle *p)=0
 
virtual void makeDecay (EvtParticle *p)=0
 
virtual EvtDecayBaseclone ()=0
 
virtual void init ()
 
virtual void initProbMax ()
 
virtual std::string commandName ()
 
virtual void command (std::string cmd)
 
double getProbMax (double prob)
 
double resetProbMax (double prob)
 
 EvtDecayBase ()
 
virtual ~EvtDecayBase ()
 
virtual bool matchingDecay (const EvtDecayBase &other) const
 
EvtId getParentId ()
 
double getBranchingFraction ()
 
void disableCheckQ ()
 
void checkQ ()
 
int getNDaug ()
 
EvtIdgetDaugs ()
 
EvtId getDaug (int i)
 
int getNArg ()
 
int getPHOTOS ()
 
void setPHOTOS ()
 
void setVerbose ()
 
void setSummary ()
 
double * getArgs ()
 
std::string * getArgsStr ()
 
double getArg (int j)
 
std::string getArgStr (int j)
 
std::string getModelName ()
 
int getDSum ()
 
int summary ()
 
int verbose ()
 
void saveDecayInfo (EvtId ipar, int ndaug, EvtId *daug, int narg, std::vector< std::string > &args, std::string name, double brfr)
 
void printSummary ()
 
void setProbMax (double prbmx)
 
void noProbMax ()
 
void checkNArg (int a1, int a2=-1, int a3=-1, int a4=-1)
 
void checkNDaug (int d1, int d2=-1)
 
void checkSpinParent (EvtSpinType::spintype sp)
 
void checkSpinDaughter (int d1, EvtSpinType::spintype sp)
 
virtual int nRealDaughters ()
 

Additional Inherited Members

- Static Public Member Functions inherited from EvtDecayBase
static void findMasses (EvtParticle *p, int ndaugs, EvtId daugs[10], double masses[10])
 
static void findMass (EvtParticle *p)
 
static double findMaxMass (EvtParticle *p)
 
- Protected Member Functions inherited from EvtDecayBase
bool daugsDecayedByParentModel ()
 
- Protected Attributes inherited from EvtDecayBase
bool _daugsDecayedByParentModel
 

Detailed Description

Definition at line 30 of file EvtMassH2.hh.

Constructor & Destructor Documentation

◆ EvtMassH2()

EvtMassH2::EvtMassH2 ( )
inline

Definition at line 34 of file EvtMassH2.hh.

34{}

Referenced by clone().

◆ ~EvtMassH2()

EvtMassH2::~EvtMassH2 ( )
virtual

Definition at line 57 of file EvtMassH2.cc.

57{}

Member Function Documentation

◆ clone()

EvtDecayBase * EvtMassH2::clone ( )
virtual

Implements EvtDecayBase.

Definition at line 65 of file EvtMassH2.cc.

65 {
66
67 return new EvtMassH2;
68
69}

◆ decay()

void EvtMassH2::decay ( EvtParticle p)
virtual

Implements EvtDecayBase.

Definition at line 84 of file EvtMassH2.cc.

84 {
85
86 const char* fl=setFileName();
87 const char* hp=setHpoint();
88 int* dp;
89 dp=setDaugPair();
90 int d1=dp[0]; //m(d1,d2) pair at X axis
91 int d2=dp[1];
92 int d3=dp[2]; //m(d3,d4) pair at Y axis
93 int d4=dp[3];
94
95 TFile f(fl);
96 TH2F *hid = (TH2F*)f.Get(hp);
97 TAxis* xaxis = hid->GetXaxis();
98 TAxis* yaxis = hid->GetYaxis();
99
100 int BINSx =xaxis->GetLast();
101 int BINSy =yaxis->GetLast();
102 int BINS =BINSx*BINSy;
103 double yvalue,ymax=0.0;
104 int i,j,binxy;
105
106 for(i=1;i<BINSx+1;i++){
107 for(j=1;j<BINSy+1;j++){
108 binxy=hid->GetBin(i,j);
109 yvalue=hid->GetBinContent(binxy);
110// cout<<"binxy,yvalue = "<<binxy<<"; "<<yvalue<<endl;
111 if(yvalue>ymax) ymax=yvalue;
112 }
113 }
114
115loop:
117
118 EvtParticle *id1,*id2,*id3,*id4,*s1;
119 EvtVector4R pd1,pd2,pd3,pd4,ps;
120 double xmass2,ymass2;
121
122 id1 =p->getDaug(d1);
123 id2 =p->getDaug(d2);
124 id3 =p->getDaug(d3);
125 id4 =p->getDaug(d4);
126
127 pd1 =id1->getP4Lab();
128 pd2 =id2->getP4Lab();
129 pd3 =id3->getP4Lab();
130 pd4 =id4->getP4Lab();
131
132 xmass2=(pd1+pd2).mass2();
133 ymass2=(pd3+pd4).mass2();
134
135 int xbin = hid->GetXaxis()->FindBin(xmass2);
136 int ybin = hid->GetYaxis()->FindBin(ymass2);
137 int xybin= hid->GetBin(xbin,ybin);
138 double zvalue=hid->GetBinContent(xybin);
139 double xratio=zvalue/ymax;
140// cout<<"***************zvalue,ymax,xratio= "<<zvalue<<"; "<<ymax<<"; "<<xratio<<endl;
141 double rd1=EvtRandom::Flat(0.0, 1.0);
142 if(rd1>xratio) goto loop;
143 return ;
144}
EvtId * getDaugs()
Definition: EvtDecayBase.hh:65
const char * setHpoint()
Definition: UserMassH2.cc:16
int * setDaugPair()
Definition: UserMassH2.cc:22
const char * setFileName()
Definition: UserMassH2.cc:10
EvtVector4R getP4Lab()
Definition: EvtParticle.cc:685
EvtParticle * getDaug(int i)
Definition: EvtParticle.cc:85
double initializePhaseSpace(int numdaughter, EvtId *daughters, double poleSize=-1., int whichTwo1=0, int whichTwo2=1)
static double Flat()
Definition: EvtRandom.cc:73

◆ getName()

void EvtMassH2::getName ( std::string &  name)
virtual

Implements EvtDecayBase.

Definition at line 59 of file EvtMassH2.cc.

59 {
60
61 model_name="MassH2";
62
63}

◆ init()

void EvtMassH2::init ( )
virtual

Reimplemented from EvtDecayBase.

Definition at line 72 of file EvtMassH2.cc.

72 {
73
74 // check that there are 4 arguments: Invariant mass part. Index: i,j, histor. file name, Hid
75 checkNArg(0);
77}
EvtId getParentId()
Definition: EvtDecayBase.hh:60
void checkNArg(int a1, int a2=-1, int a3=-1, int a4=-1)
static EvtSpinType::spintype getSpinType(EvtId i)
Definition: EvtPDL.hh:61

◆ initProbMax()

void EvtMassH2::initProbMax ( )
virtual

Reimplemented from EvtDecayBase.

Definition at line 78 of file EvtMassH2.cc.

78 {
79
80 noProbMax();
81
82}
void noProbMax()

◆ setDaugPair()

int * EvtMassH2::setDaugPair ( )

Definition at line 22 of file UserMassH2.cc.

22 {
23 static int DP[4];
24 DP[0]=0; // 0,1,2,... indexes for daughter particles
25 DP[1]=1;
26 DP[2]=0;
27 DP[3]=2;
28 return DP;
29}

Referenced by decay().

◆ setFileName()

const char * EvtMassH2::setFileName ( )

Definition at line 10 of file UserMassH2.cc.

10 {
11 const char* filename;
12 filename="diy.root"; //specify the root histor. name
13 return filename;
14}

Referenced by decay().

◆ setHpoint()

const char * EvtMassH2::setHpoint ( )

Definition at line 16 of file UserMassH2.cc.

16 {
17 const char* hpoint;
18 hpoint="hdalitz"; //specify the histor. id
19 return hpoint;
20}

Referenced by decay().


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