BOSS 8.0.0
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 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 EvtAngH2.hh.

Constructor & Destructor Documentation

◆ EvtAngH2()

EvtAngH2::EvtAngH2 ( )
inline

Definition at line 32 of file EvtAngH2.hh.

32{}

Referenced by clone().

◆ ~EvtAngH2()

EvtAngH2::~EvtAngH2 ( )
virtual

Definition at line 61 of file EvtAngH2.cc.

61{}

Member Function Documentation

◆ clone()

EvtDecayBase * EvtAngH2::clone ( )
virtual

Implements EvtDecayBase.

Definition at line 65 of file EvtAngH2.cc.

65{ return new EvtAngH2; }

◆ decay()

void EvtAngH2::decay ( EvtParticle * p)
virtual

Implements EvtDecayBase.

Definition at line 75 of file EvtAngH2.cc.

75 {
76
77 const char* fl = setFileName();
78 const char* hp = setHpoint();
79 int* dp;
80
81 TFile f( fl );
82 TH2F* hid = (TH2F*)f.Get( hp );
83 TAxis* xaxis = hid->GetXaxis();
84 TAxis* yaxis = hid->GetYaxis();
85
86 int BINSx = xaxis->GetLast();
87 int BINSy = yaxis->GetLast();
88 int BINS = BINSx * BINSy;
89 double yvalue, ymax = 0.0;
90 int i, j, binxy;
91
92 for ( i = 1; i < BINSx + 1; i++ )
93 {
94 for ( j = 1; j < BINSy + 1; j++ )
95 {
96 binxy = hid->GetBin( i, j );
97 yvalue = hid->GetBinContent( binxy );
98 // cout<<"binxy,yvalue = "<<binxy<<"; "<<yvalue<<endl;
99 if ( yvalue > ymax ) ymax = yvalue;
100 }
101 }
102
103loop:
105
106 EvtParticle *id1, *id2, *id3, *id4, *s1;
107 EvtVector4R pd1, pd2, pd3, pd4, ps;
108 double xcostheta, ycostheta;
109
110 id1 = p->getDaug( 0 );
111 id2 = p->getDaug( 1 );
112 id3 = p->getDaug( 2 );
113
114 pd1 = id1->getP4Lab();
115 pd2 = id2->getP4Lab();
116 pd3 = id3->getP4Lab();
117
118 xcostheta = pd1.get( 3 ) / pd1.d3mag();
119 ycostheta = pd2.get( 3 ) / pd2.d3mag();
120 if ( EvtPDL::name( p->getDaug( 0 )->getId() ) == EvtPDL::name( p->getDaug( 1 )->getId() ) )
121 {
122 if ( pd1.get( 0 ) > pd2.get( 0 ) )
123 {
124 xcostheta = pd2.get( 3 ) / pd2.d3mag();
125 ycostheta = pd1.get( 3 ) / pd1.d3mag();
126 }
127 }
128 int xbin = hid->GetXaxis()->FindBin( xcostheta );
129 int ybin = hid->GetYaxis()->FindBin( ycostheta );
130 int xybin = hid->GetBin( xbin, ybin );
131 double zvalue = hid->GetBinContent( xybin );
132 double xratio = zvalue / ymax;
133 // cout<<"***************zvalue,ymax,xratio= "<<zvalue<<"; "<<ymax<<"; "<<xratio<<endl;
134 double rd1 = EvtRandom::Flat( 0.0, 1.0 );
135 if ( rd1 > xratio ) goto loop;
136 return;
137}
TFile f("ana_bhabha660a_dqa_mcPat_zy_old.root")
const char * setHpoint()
Definition UserAngH2.cc:16
const char * setFileName()
Definition UserAngH2.cc:10
EvtId * getDaugs()
static std::string name(EvtId i)
Definition EvtPDL.hh:70
EvtVector4R getP4Lab()
EvtId getId() const
EvtParticle * getDaug(int i)
double initializePhaseSpace(int numdaughter, EvtId *daughters, double poleSize=-1., int whichTwo1=0, int whichTwo2=1)
static double Flat()
Definition EvtRandom.cc:69
double get(int i) const
double d3mag() const

◆ getName()

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

Implements EvtDecayBase.

Definition at line 63 of file EvtAngH2.cc.

63{ model_name = "AngH2"; }

◆ init()

void EvtAngH2::init ( )
virtual

Reimplemented from EvtDecayBase.

Definition at line 67 of file EvtAngH2.cc.

67 {
68
69 // check that there are 4 arguments: Invariant mass part. Index: i,j, histor. file name, Hid
70 checkNArg( 0 );
72}
EvtId getParentId()
void checkNArg(int a1, int a2=-1, int a3=-1, int a4=-1)
static EvtSpinType::spintype getSpinType(EvtId i)
Definition EvtPDL.hh:66

◆ initProbMax()

void EvtAngH2::initProbMax ( )
virtual

Reimplemented from EvtDecayBase.

Definition at line 73 of file EvtAngH2.cc.

73{ 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
20 // by detection efficiency
21 hpoint = "AngScatter";
22 return hpoint;
23}

Referenced by decay().


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