本文整理汇总了C++中TVector3::SetTheta方法的典型用法代码示例。如果您正苦于以下问题:C++ TVector3::SetTheta方法的具体用法?C++ TVector3::SetTheta怎么用?C++ TVector3::SetTheta使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TVector3
的用法示例。
在下文中一共展示了TVector3::SetTheta方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main()
{
// -- Declaring Cuba variables -- //
int comp, nregions, neval, fail;
cubareal integral[NCOMP], error[NCOMP], prob[NCOMP];
// -- ThreeBodyDecay initialization-- //
muon.SetMotherMPThetaPhi(M,muon_p,muon_theta,muon_phi);
muon.SetBitBoostBack(BitBoostBack);
// -- Set up pointers to the momenta
P = muon.P;
p1 = muon.p[0];
p2 = muon.p[1];
p3 = muon.p[2];
// -- Get muon kinematics
double P_gamma = P->Gamma();
double P_beta = P->Beta();
double P_M = P->M();
double P_MomMag = P->P();
// -- Polarization vector -- //
// -- Custom vector construction
k0_custom = TLorentzVector(1.0, 0.0, 0.0, 1.0);
// k0_custom = TLorentzVector(3, 2, 0.0, 1.0);
// k0_custom = TLorentzVector(1.0, 0.0, 0.0, 1.0);
double alpha = 1;
// -- Phyicsal vector construction
k0_physical[3] = 1;
for (int i = 0; i<3; i++)
{ k0_physical[i] = (*P)[i]/P_MomMag; }
for (int nu = 0; nu<4; nu++)
{ k0_physical[nu] = alpha*k0_physical[nu]/(P_M*P_gamma*(1+P_beta)); }
// -- Choosing k0 auxiliary vector
if ( k0_flag == 1)
{ k0 = k0_custom; }
if ( k0_flag == 2)
{ k0 = k0_physical; }
// Get pk0 scalar product
double Pk0 = P->Dot(k0);
// Custom spin polarization vector with p and k0
if (polvec_flag == 1)
{
for(int nu = 0; nu<4; nu++)
{ polvec[nu] = ( (*P)[nu]/M) - (M/Pk0)*k0[nu]; }
}
// Helicity spin ampltiude vector
// Note:
// This should be equivalent to the custom pol. vector
// when choosing physical k0
// Default:
if (polvec_flag == 2)
{
TVector3 phat(1.0,0.0,0.0);
phat.SetPhi(phat_phi);
phat.SetTheta(phat_theta);
polvec = TLorentzVector(phat,P->Beta());
for(int nu = 0; nu<4; nu++)
{ polvec[nu] = polvec[nu]*P_gamma; }
}
phat34 = TVector3(1.0,0.0,0.0);
phat34.SetPhi(phat34_phi);
phat34.SetTheta(phat34_theta);
polvec34 = TLorentzVector(phat34,0);
/////////////////////////////////////////////////////////////////////////
#if 1
printf("-------------------- Vegas test --------------------\n");
Vegas(NDIM, NCOMP, Integrand, USERDATA, NVEC,
EPSREL, EPSABS, VERBOSE, SEED,
MINEVAL, MAXEVAL, NSTART, NINCREASE, NBATCH,
GRIDNO, STATEFILE, SPIN,
&neval, &fail, integral, error, prob);
printf("VEGAS RESULT:\tneval %d\tfail %d\n",
neval, fail);
comp = 0;
printf("VEGAS RESULT:\t%.8f +- %.8f\tp = %.3f\n",
(double)integral[comp], (double)error[comp], (double)prob[comp]);
#endif
#if 0
//.........这里部分代码省略.........