当前位置: 首页>>代码示例>>C++>>正文


C++ TLorentzVector::Dot方法代码示例

本文整理汇总了C++中TLorentzVector::Dot方法的典型用法代码示例。如果您正苦于以下问题:C++ TLorentzVector::Dot方法的具体用法?C++ TLorentzVector::Dot怎么用?C++ TLorentzVector::Dot使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TLorentzVector的用法示例。


在下文中一共展示了TLorentzVector::Dot方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Integrand

static int Integrand(const int *ndim, const cubareal xx[],
  const int *ncomp, cubareal ff[], void *userdata)
{

//	TVector3 Boostvec = P->BoostVector();
//	p3->Boost(-Boostvec);
   
//	p1->Boost(-Boostvec);
//	p2->Boost(-Boostvec);
	
	double amp;
	double weight = muon.GetPhaseSpaceWeight(x1,x2,x3,x4,x5);
	
	// -- Default case -- //
	double amp_unpolarized = 128*P->Dot( (*p3) )  * p1->Dot( (*p2) );
	double amp_polarized1  =  64*P->Dot( (*p3) )  * p1->Dot( (*p2) ) - 64*M*(polvec*(*p3)) * ( (*p1) * (*p2) );
	double amp_polarized2  =  64*P->Dot( (*p3) )  * p1->Dot( (*p2) ) + 64*M*(polvec*(*p3)) * ( (*p1) * (*p2) );
	
	// -- Custom case -- //
	double lambda3 =  1.0;
	double amp_polarized3 =         64*P->Gamma()*(1-lambda3*P->Beta()) * M * p3->E()             * p1->Dot((*p2))-
			  						lambda3*64*P->Gamma()*(1-lambda3*P->Beta()) * M * polvec34.Dot((*p3)) * p1->Dot((*p2));
	
	double lambda4 = -1.0;
	double amp_polarized4 =         64*P->Gamma()*(1-lambda4*P->Beta()) * M * p3->E()             * p1->Dot((*p2))-
			  						lambda4*64*P->Gamma()*(1-lambda4*P->Beta()) * M * polvec34.Dot((*p3)) * p1->Dot((*p2));
	
	double amp_unpolarized34 = amp_polarized3 + amp_polarized4;
	
	// -- Choosing amplitude -- //
	switch(ampltiude)
	{ 
		// Default
		case  0: amp = amp_unpolarized; break;
		case  1: amp = amp_polarized1;  break;
		case -1: amp = amp_polarized2;  break;
	
		// Custom
		case   3: amp = amp_polarized3;     break;
		case   4: amp = amp_polarized4;     break;
		case  34: amp = amp_unpolarized34;  break;
	}

	//amp =  64*M*(polvec*(*p3)) * ( (*p1) * (*p2) );
	//amp =  64*M * ( (*p1) * (*p2) );
	//amp =  64*M*(polvec*(*p3));
	f = amp*weight;
	//f = weight;
	
  	return 0;
};
开发者ID:denglert,项目名称:HelicityCalcFW,代码行数:51,代码来源:Decay-1-2-6.cpp

示例2: main


//.........这里部分代码省略.........

	p2.SetPxPyPzE(p2mag*sintheta23*cos(phi23),p2mag*sintheta23*sin(phi23),p2mag*costheta23,E2);
	p3.SetPxPyPzE(-p2mag*sintheta23*cos(phi23),-p2mag*sintheta23*sin(phi23),-p2mag*costheta23,E3);

	std::cout << "p1:" << std::endl;
	displayTLorentzVector(&p1);

	std::cout << "p2 and p3 in the 23 rest frame:" << std::endl;

	std::cout << "p2:" << std::endl;
	displayTLorentzVector(&p2);

	std::cout << "p3:" << std::endl;
	displayTLorentzVector(&p3);

	p2.Boost(v);
	p3.Boost(v);


	std::cout << "All in the lab frame:" << std::endl;

	std::cout << "p1:" << std::endl;
	displayTLorentzVector(&p1);

	std::cout << "p2:" << std::endl;
	displayTLorentzVector(&p2);

	std::cout << "p3:" << std::endl;
	displayTLorentzVector(&p3);

	TLorentzVector sum;
	sum = p1 + p2 + p3;

	std::cout << "sum in the lab frame:" << std::endl;
	displayTLorentzVector(&sum);

	}

	{

	printf("######################################\n");
	printf("### --- TwoBudyFunc utils TEST --- ###\n");
	printf("######################################\n");

	double M_test      = 5.0;
	double m1_sqr_test = 3.0;
	double m2_sqr_test = 1.0;

	double E = TwoBodyFunc::E (M_test, m1_sqr_test, m2_sqr_test);

	printf("M_test: %.2f\n", M_test);
	printf("m1_sqr_test: %.2f\n", m1_sqr_test);
	printf("m2_sqr_test: %.2f\n", m2_sqr_test);
	printf("TwoBodyFunc::E (M_test, m1_sqr_test, m2_sqr_test): %.2f\n", E);

	}

	{

	printf("\n");
	printf("########################################\n");
	printf("### --- ThreeBodyDecayClass TEST --- ###\n");
	printf("########################################\n");
	printf("\n");
	// ThreeBodyDecay class
   ThreeBodyDecay tau(M, m1, m2, m3);
	tau.SetMotherMPThetaPhi(M,momentum,theta,phi);
	tau.SetBitBoostBack(true);


	tau.SetPhaseSpace(x1, x2, x3, x4, x5);
	TLorentzVector *P = tau.P;
	TLorentzVector *p1 = tau.p[0];
	TLorentzVector *p2 = tau.p[1];
	TLorentzVector *p3 = tau.p[2];
  	double amp = P->Dot( (*p3) ) * p1->Dot( (*p2) );
	tau.DisplayAll();

//	printf("\ns23_min: %.2f", );

	double weight = tau.GetPhaseSpaceWeight(x1, x2, x3, x4, x5);
	std::cout << "PSWeight: " << weight << std::endl;
	std::cout << "amp: " << amp << std::endl;

	std::cout << "P:" << std::endl;
	displayTLorentzVector(P);

	std::cout << "p1:" << std::endl;
	displayTLorentzVector(p1);
	std::cout << "p2:" << std::endl;
	displayTLorentzVector(p2);
	std::cout << "p3:" << std::endl;
	displayTLorentzVector(p3);

	TLorentzVector sum = (*p1) + (*p2) + (*p3);
	std::cout << "p1+p2+p3:" << std::endl;
	displayTLorentzVector(&sum);
	}

}
开发者ID:denglert,项目名称:HelicityCalcFW,代码行数:101,代码来源:test_PhaseSpaceTools.cpp


注:本文中的TLorentzVector::Dot方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。