BOSS 7.0.3
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtAngH2 Class Reference

#include <EvtAngH2.hh>

+ Inheritance diagram for EvtAngH2:

Public Member Functions

 EvtAngH2 ()
 
virtual ~EvtAngH2 ()
 
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 30 of file EvtAngH2.hh.

Constructor & Destructor Documentation

◆ EvtAngH2()

EvtAngH2::EvtAngH2 ( )
inline

Definition at line 34 of file EvtAngH2.hh.

34{}

Referenced by clone().

◆ ~EvtAngH2()

EvtAngH2::~EvtAngH2 ( )
virtual

Definition at line 59 of file EvtAngH2.cc.

59{}

Member Function Documentation

◆ clone()

EvtDecayBase * EvtAngH2::clone ( )
virtual

Implements EvtDecayBase.

Definition at line 67 of file EvtAngH2.cc.

67 {
68
69 return new EvtAngH2;
70
71}
EvtAngH2()
Definition: EvtAngH2.hh:34

◆ decay()

void EvtAngH2::decay ( EvtParticle p)
virtual

Implements EvtDecayBase.

Definition at line 86 of file EvtAngH2.cc.

86 {
87
88 const char* fl=setFileName();
89 const char* hp=setHpoint();
90 int* dp;
91
92 TFile f(fl);
93 TH2F *hid = (TH2F*)f.Get(hp);
94 TAxis* xaxis = hid->GetXaxis();
95 TAxis* yaxis = hid->GetYaxis();
96
97 int BINSx =xaxis->GetLast();
98 int BINSy =yaxis->GetLast();
99 int BINS =BINSx*BINSy;
100 double yvalue,ymax=0.0;
101 int i,j,binxy;
102
103 for(i=1;i<BINSx+1;i++){
104 for(j=1;j<BINSy+1;j++){
105 binxy=hid->GetBin(i,j);
106 yvalue=hid->GetBinContent(binxy);
107// cout<<"binxy,yvalue = "<<binxy<<"; "<<yvalue<<endl;
108 if(yvalue>ymax) ymax=yvalue;
109 }
110 }
111
112loop:
114
115 EvtParticle *id1,*id2,*id3,*id4,*s1;
116 EvtVector4R pd1,pd2,pd3,pd4,ps;
117 double xcostheta,ycostheta;
118
119 id1 =p->getDaug(0);
120 id2 =p->getDaug(1);
121 id3 =p->getDaug(2);
122
123
124 pd1 =id1->getP4Lab();
125 pd2 =id2->getP4Lab();
126 pd3 =id3->getP4Lab();
127
128 xcostheta=pd1.get(3)/pd1.d3mag();
129 ycostheta=pd2.get(3)/pd2.d3mag();
130 if( EvtPDL::name(p->getDaug(0)->getId()) == EvtPDL::name(p->getDaug(1)->getId()) ){
131 if(pd1.get(0)>pd2.get(0)){
132 xcostheta=pd2.get(3)/pd2.d3mag();
133 ycostheta=pd1.get(3)/pd1.d3mag();
134 }
135 }
136 int xbin = hid->GetXaxis()->FindBin(xcostheta);
137 int ybin = hid->GetYaxis()->FindBin(ycostheta);
138 int xybin= hid->GetBin(xbin,ybin);
139 double zvalue=hid->GetBinContent(xybin);
140 double xratio=zvalue/ymax;
141// cout<<"***************zvalue,ymax,xratio= "<<zvalue<<"; "<<ymax<<"; "<<xratio<<endl;
142 double rd1=EvtRandom::Flat(0.0, 1.0);
143 if(rd1>xratio) goto loop;
144 return ;
145}
const char * setHpoint()
Definition: UserAngH2.cc:16
const char * setFileName()
Definition: UserAngH2.cc:10
EvtId * getDaugs()
Definition: EvtDecayBase.hh:65
static std::string name(EvtId i)
Definition: EvtPDL.hh:64
EvtVector4R getP4Lab()
Definition: EvtParticle.cc:685
EvtId getId() const
Definition: EvtParticle.cc:113
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 get(int i) const
Definition: EvtVector4R.hh:179
double d3mag() const
Definition: EvtVector4R.cc:186

◆ getName()

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

Implements EvtDecayBase.

Definition at line 61 of file EvtAngH2.cc.

61 {
62
63 model_name="AngH2";
64
65}

◆ init()

void EvtAngH2::init ( )
virtual

Reimplemented from EvtDecayBase.

Definition at line 74 of file EvtAngH2.cc.

74 {
75
76 // check that there are 4 arguments: Invariant mass part. Index: i,j, histor. file name, Hid
77 checkNArg(0);
79}
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 EvtAngH2::initProbMax ( )
virtual

Reimplemented from EvtDecayBase.

Definition at line 80 of file EvtAngH2.cc.

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

◆ setFileName()

const char * EvtAngH2::setFileName ( )

Definition at line 10 of file UserAngH2.cc.

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

Referenced by decay().

◆ setHpoint()

const char * EvtAngH2::setHpoint ( )

Definition at line 16 of file UserAngH2.cc.

16 {
17 const char* hpoint;
18//specify scatter plot id, x-axis is the angular distribution(in Lab system) for daugher(0)
19//, y-axix is the the angular distribution(in Lab system) for daugher(1). They are corrected by detection efficiency
20 hpoint="AngScatter";
21 return hpoint;
22}

Referenced by decay().


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