BOSS 6.6.4.p03
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 ()
 
- 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 29 of file EvtmH2.hh.

Constructor & Destructor Documentation

◆ EvtmH2()

EvtmH2::EvtmH2 ( )
inline

Definition at line 33 of file EvtmH2.hh.

33{}

Referenced by clone().

◆ ~EvtmH2()

EvtmH2::~EvtmH2 ( )
virtual

Definition at line 57 of file EvtmH2.cc.

57{}

Member Function Documentation

◆ clone()

EvtDecayBase * EvtmH2::clone ( )
virtual

Implements EvtDecayBase.

Definition at line 65 of file EvtmH2.cc.

65 {
66
67 return new EvtmH2;
68
69}
EvtmH2()
Definition: EvtmH2.hh:33

◆ decay()

void EvtmH2::decay ( EvtParticle p)
virtual

Implements EvtDecayBase.

Definition at line 86 of file 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}
const double xmass[5]
Definition: Gam4pikp.cxx:50
EvtId * getDaugs()
Definition: EvtDecayBase.hh:65
EvtVector4R getP4Lab()
Definition: EvtParticle.cc:683
int getNDaug() const
Definition: EvtParticle.cc:125
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
double mass() const
Definition: EvtVector4R.cc:39
const char * setFileName()
Definition: UsermH2.cc:10
const char * setHpoint()
Definition: UsermH2.cc:16

◆ getName()

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

Implements EvtDecayBase.

Definition at line 59 of file EvtmH2.cc.

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

◆ init()

void EvtmH2::init ( )
virtual

Reimplemented from EvtDecayBase.

Definition at line 72 of file 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}
double getArg(int j)
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 EvtmH2::initProbMax ( )
virtual

Reimplemented from EvtDecayBase.

Definition at line 80 of file EvtmH2.cc.

80 {
81
82 noProbMax();
83
84}
void noProbMax()

◆ setFileName()

const char * EvtmH2::setFileName ( )

Definition at line 10 of file UsermH2.cc.

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

Referenced by decay().

◆ setHpoint()

const char * EvtmH2::setHpoint ( )

Definition at line 16 of file UsermH2.cc.

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

Referenced by decay().


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