本文整理汇总了C++中TVector2::Unit方法的典型用法代码示例。如果您正苦于以下问题:C++ TVector2::Unit方法的具体用法?C++ TVector2::Unit怎么用?C++ TVector2::Unit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TVector2
的用法示例。
在下文中一共展示了TVector2::Unit方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getD0RedMet
// D0 RedMET with CMG trees
double getD0RedMet(double lpx1, double lpy1, double lpterr1,
double lpx2, double lpy2, double lpterr2,
double sumjpx, double sumjpy,
double pfmet, double pfmetphi,
int flav, int pickAFlav = 1) {
if( flav==3 ) {
if( pickAFlav!=1 && pickAFlav!=2 ) {
cout << " *** ERROR *** " << endl;
cout << " You need to pick a flavor in getD0RedMet(...)! " << endl;
throw std::exception();
return -1.;
}
else {
flav = pickAFlav;
}
}
// double wPerpMu = 1.0;
// double wRecMu = 2.0;
// double wUncMu = 2.5;
double wPerpMu = 1.0;
double wRecMu = 1.5;
double wUncMu = 2.75;
// double wPerpEl = 1.5;
// double wRecEl = 2.25;
// double wUncEl = 0.0;
double wPerpEl = 0.75;
double wRecEl = 1.0;
double wUncEl = 0.25;
int seplep = 1;
if (seplep == 0){
wPerpMu = 1.0;
wRecMu = 1.25;
wUncMu = 0.0;
wPerpEl = wPerpMu;
wRecEl = wRecMu;
wUncEl = wUncMu;
}
double kPerp = 1.;
double kRecoil_l = 1.;
double kRecoil_t = 1.;
double kSigmaPt_l = 1.;
double kSigmaPt_t = 1.;
if( flav==1 ) { // mm
kPerp = wPerpMu;
kRecoil_l = kRecoil_t = wRecMu;
kSigmaPt_l = kSigmaPt_t = wUncMu;
}
else if( flav==2 ) { // ee
kPerp = wPerpEl;
kRecoil_l = kRecoil_t = wRecEl;
kSigmaPt_l = kSigmaPt_t = wUncEl;
}
else {}
double pt1 = sqrt(lpx1*lpx1 + lpy1*lpy1);
double pt2 = sqrt(lpx2*lpx2 + lpy2*lpy2);
TVector2 lead, subl;
double leadpt, sublpt, leadpterr, sublpterr;
if(pt1>pt2) {
lead = TVector2(lpx1, lpy1);
subl = TVector2(lpx2, lpy2);
leadpt = pt1;
leadpterr = lpterr1;
sublpt = pt2;
sublpterr = lpterr2;
}
else {
lead = TVector2(lpx2, lpy2);
subl = TVector2(lpx1, lpy1);
leadpt = pt2;
leadpterr = lpterr2;
sublpt = pt1;
sublpterr = lpterr1;
}
// Define the thrust and dilepton
TVector2 dil = lead+subl;
TVector2 thr = lead-subl;
TVector2 longi;
TVector2 perpe;
double deltaPhi = fabs(lead.DeltaPhi(subl));
if( deltaPhi>(3.141592654/2.) ) {
longi = thr.Unit();
perpe = longi.Rotate(3.141592654/2.);
if(perpe*lead<0) perpe *= -1;
}
else {
perpe = dil.Unit();
//.........这里部分代码省略.........