BOSS 7.0.9
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtmH2 Class Reference

#include <EvtmH2.hh>

+ Inheritance diagram for EvtmH2:

Public Member Functions

 EvtmH2 ()
 
virtual ~EvtmH2 ()
 
void getName (std::string &name)
 
EvtDecayBaseclone ()
 
void initProbMax ()
 
void init ()
 
void decay (EvtParticle *p)
 
const char * setFileName ()
 
const char * setHpoint ()
 
 EvtmH2 ()
 
virtual ~EvtmH2 ()
 
void getName (std::string &name)
 
EvtDecayBaseclone ()
 
void initProbMax ()
 
void init ()
 
void decay (EvtParticle *p)
 
const char * setFileName ()
 
const char * setHpoint ()
 
- Public Member Functions inherited from EvtDecayIncoherent
void makeDecay (EvtParticle *p)
 
virtual ~EvtDecayIncoherent ()
 
void setDaughterSpinDensity (int daughter)
 
int isDaughterSpinDensitySet (int daughter)
 
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 ()
 
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)
 
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 ()
 
bool daugsDecayedByParentModel ()
 
- Protected Attributes inherited from EvtDecayBase
bool _daugsDecayedByParentModel
 

Detailed Description

Constructor & Destructor Documentation

◆ EvtmH2() [1/2]

EvtmH2::EvtmH2 ( )
inline

Definition at line 33 of file bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtmH2.hh.

33{}

Referenced by clone().

◆ ~EvtmH2() [1/2]

EvtmH2::~EvtmH2 ( )
virtual

◆ EvtmH2() [2/2]

EvtmH2::EvtmH2 ( )
inline

Definition at line 33 of file BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtmH2.hh.

33{}

◆ ~EvtmH2() [2/2]

virtual EvtmH2::~EvtmH2 ( )
virtual

Member Function Documentation

◆ clone() [1/2]

EvtDecayBase * EvtmH2::clone ( )
virtual

◆ clone() [2/2]

EvtDecayBase * EvtmH2::clone ( )
virtual

Implements EvtDecayBase.

◆ decay() [1/2]

void EvtmH2::decay ( EvtParticle p)
virtual

Implements EvtDecayBase.

Definition at line 86 of file bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtmH2.cc.

86 {
87
88 const char* fl=setFileName();
89 const char* hp=setHpoint();
90
91 TFile f(fl);
92 TH2F *hid = (TH2F*)f.Get("mH2");
93 TAxis* xaxis = hid->GetXaxis();
94 TAxis* yaxis = hid->GetYaxis();
95
96 int BINSx =xaxis->GetLast();
97 int BINSy =yaxis->GetLast();
98 int BINS =BINSx*BINSy;
99 double yvalue,ymax=0.0;
100 int i,j,binxy;
101
102 for(i=1;i<BINSx+1;i++){
103 for(j=1;j<BINSy+1;j++){
104 binxy=hid->GetBin(i,j);
105 yvalue=hid->GetBinContent(binxy);
106// cout<<"binxy,yvalue = "<<binxy<<"; "<<yvalue<<endl;
107 if(yvalue>ymax) ymax=yvalue;
108 }
109 }
110
111loop:
113
114 if(p->getNDaug()!= nbx+nby) {std::cout<<"The number of specified particles is not equal the number of decay daughters "<<endl;::abort();}
115
116 EvtVector4R pt,pt2;
117 double xmass,ymass;
118
119 pt=p->getDaug(0)->getP4Lab();
120 for (int ii=1;ii<nbx;ii++){
121 pt=pt+p->getDaug(ii)->getP4Lab();
122 }
123 xmass=pt.mass();
124
125 pt2=p->getDaug(nbx)->getP4Lab();
126 for(int jj=nbx+1;jj<nbx+nby;jj++) pt2=pt2+p->getDaug(jj)->getP4Lab();
127 ymass=pt2.mass();
128
129
130 int xbin = hid->GetXaxis()->FindBin(xmass);
131 int ybin = hid->GetYaxis()->FindBin(ymass);
132 int xybin= hid->GetBin(xbin,ybin);
133 double zvalue=hid->GetBinContent(xybin);
134 double xratio=zvalue/ymax;
135// cout<<"***************zvalue,ymax,xratio= "<<zvalue<<"; "<<ymax<<"; "<<xratio<<endl;
136 double rd1=EvtRandom::Flat(0.0, 1.0);
137 if(rd1>xratio) goto loop;
138 return ;
139}
TFile f("ana_bhabha660a_dqa_mcPat_zy_old.root")
const double xmass[5]
Definition: Gam4pikp.cxx:50
double initializePhaseSpace(int numdaughter, EvtId *daughters, double poleSize=-1., int whichTwo1=0, int whichTwo2=1)

◆ decay() [2/2]

void EvtmH2::decay ( EvtParticle p)
virtual

Implements EvtDecayBase.

◆ getName() [1/2]

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

Implements EvtDecayBase.

Definition at line 59 of file bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtmH2.cc.

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

◆ getName() [2/2]

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

Implements EvtDecayBase.

◆ init() [1/2]

void EvtmH2::init ( )
virtual

Reimplemented from EvtDecayBase.

Definition at line 72 of file bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtmH2.cc.

72 {
73
74 // check that there are 4 arguments: Invariant mass part. Index: i,j, histor. file name, Hid
75 checkNArg(2);
77 nbx = getArg(0);
78 nby = getArg(1);
79}
void checkNArg(int a1, int a2=-1, int a3=-1, int a4=-1)
static EvtSpinType::spintype getSpinType(EvtId i)

◆ init() [2/2]

void EvtmH2::init ( )
virtual

Reimplemented from EvtDecayBase.

◆ initProbMax() [1/2]

void EvtmH2::initProbMax ( )
virtual

◆ initProbMax() [2/2]

void EvtmH2::initProbMax ( )
virtual

Reimplemented from EvtDecayBase.

◆ setFileName() [1/2]

const char * EvtmH2::setFileName ( )

Definition at line 10 of file bak-BesEvtGen-00-04-08/user/UsermH2.cc.

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

Referenced by decay().

◆ setFileName() [2/2]

const char * EvtmH2::setFileName ( )

◆ setHpoint() [1/2]

const char * EvtmH2::setHpoint ( )

Definition at line 16 of file bak-BesEvtGen-00-04-08/user/UsermH2.cc.

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

Referenced by decay().

◆ setHpoint() [2/2]

const char * EvtmH2::setHpoint ( )

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