• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ TLorentzVector类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: Tran_to_cm

void Tran_to_cm(TLorentzVector e_vec, TLorentzVector d_vec, 
                TLorentzVector &e_cm, TLorentzVector &d_cm){
     //input: 
     //   e_vec - electron 4 vector in some frame
     //   d_vec - ion 4 vector in some frame
     //output:
     //   e_ft - electron 4 vector in center of mass frame
     //   d_ft - ion 4 vector in center of mass frame
     e_cm = e_vec;
     d_cm = d_vec;

     TLorentzVector cm_vec = e_vec + d_vec;

     e_cm.Boost(-cm_vec.BoostVector());
     d_cm.Boost(-cm_vec.BoostVector());
     return;

}
开发者ID:JeffersonLab,项目名称:LightIonEIC,代码行数:18,代码来源:lorentz_transform.cpp


示例2: CalcDeltaPhiNEW

// This is the pt corrected delta phi between the 2 mega-jets
// P and Q are the 4-vectors for the 2 hemispheres 
// M is the MET 3 vector (don't forget to set the z-component of
// MET to 0)
// This function will do the correct Lorentz transformations of the 
// leptons for you
double HWWKinematics::CalcDeltaPhiNEW(TLorentzVector P, TLorentzVector Q, TVector3 M){
    // first calculate pt-corrected MR
 float mymrnew = CalcMRNEW(L1,L2,MET);

    //Next, calculate the transverse Lorentz transformation
 TVector3 B = P.Vect()+Q.Vect()+MET;
 B.SetZ(0.0);
 B = (-1./(sqrt(4.*mymrnew*mymrnew+B.Dot(B))))*B;

 P.Boost(B);
 Q.Boost(B);

    //Now, re-calculate the delta phi
    // in the new reference frame:

 return P.DeltaPhi(Q);

}
开发者ID:alessandrothea,项目名称:gardener,代码行数:24,代码来源:unBoostedVar.C


示例3: momcor_mc

void rochcor::momcor_mc( TLorentzVector& mu, float charge, float sysdev, int runopt){
  
  //sysdev == num : deviation = num

  float ptmu = mu.Pt();
  float muphi = mu.Phi();
  float mueta = mu.Eta(); // same with mu.Eta() in Root

  float px = mu.Px();
  float py = mu.Py();
  float pz = mu.Pz();
  float e = mu.E();

  int mu_phibin = phibin(muphi);
  int mu_etabin = etabin(mueta);

  //float mptsys = sran.Gaus(0.0,sysdev);
  
  float dm = (mcor_bf[mu_phibin][mu_etabin] + mptsys_mc_dm[mu_phibin][mu_etabin]*mcor_bfer[mu_phibin][mu_etabin])/mmavg[mu_phibin][mu_etabin];
  float da = mcor_ma[mu_phibin][mu_etabin] + mptsys_mc_da[mu_phibin][mu_etabin]*mcor_maer[mu_phibin][mu_etabin];
  
  float cor = 1.0/(1.0 + dm + charge*da*ptmu);

  //for the momentum tuning - eta,phi,Q correction
  px *= cor;
  py *= cor;
  pz *= cor;
  e  *= cor;
  
  float gscler = 0.0;
  float deltaer = 0.0;
  float sfer = 0.0;
  
  gscler = TMath::Sqrt( TMath::Power(mgscl_stat,2) + TMath::Power(mgscl_syst,2) );
  deltaer = TMath::Sqrt( TMath::Power(delta_stat,2) + TMath::Power(delta_syst,2) );
  sfer = TMath::Sqrt( TMath::Power(sf_stat,2) + TMath::Power(sf_syst,2) );
  
  float tune = 1.0/(1.0 + (delta + sysdev*deltaer)*sqrt(px*px + py*py)*eran.Gaus(1.0,(sf + sysdev*sfer)));
  
  px *= (tune); 
  py *= (tune);  
  pz *= (tune);  
  e  *= (tune);   
  
  float gscl = (genm_smr/mrecm);
  
  px *= (gscl + gscler_mc_dev*gscler);
  py *= (gscl + gscler_mc_dev*gscler);
  pz *= (gscl + gscler_mc_dev*gscler);
  e  *= (gscl + gscler_mc_dev*gscler);

  mu.SetPxPyPzE(px,py,pz,e);
  
}
开发者ID:KyeongPil-Lee,项目名称:DYAnalysis,代码行数:54,代码来源:rochcor.C


示例4: phibin

void rochcor2012::momcor_mc( TLorentzVector& mu, float charge, float sysdev, int runopt, float& qter){
  
  //sysdev == num : deviation = num

  float ptmu = mu.Pt();
  float muphi = mu.Phi();
  float mueta = mu.Eta(); // same with mu.Eta() in Root

  float px = mu.Px();
  float py = mu.Py();
  float pz = mu.Pz();
  float e = mu.E();

  int mu_phibin = phibin(muphi);
  int mu_etabin = etabin(mueta);

  //float mptsys = sran.Gaus(0.0,sysdev);
  
  float Mf = (mcor_bf[mu_phibin][mu_etabin] + mptsys_mc_dm[mu_phibin][mu_etabin]*mcor_bfer[mu_phibin][mu_etabin])/(mpavg[mu_phibin][mu_etabin]+mmavg[mu_phibin][mu_etabin]);
  float Af = ((mcor_ma[mu_phibin][mu_etabin]+mptsys_mc_da[mu_phibin][mu_etabin]*mcor_maer[mu_phibin][mu_etabin]) - Mf*(mpavg[mu_phibin][mu_etabin]-mmavg[mu_phibin][mu_etabin]));     
  
  float cor = 1.0/(1.0 + 2.0*Mf + charge*Af*ptmu);
  
  //for the momentum tuning - eta,phi,Q correction
  px *= cor;
  py *= cor;
  pz *= cor;
  e  *= cor;
  
  float gscler = mgscl_stat;
  float deltaer = delta_stat;
  float sfer = sf_stat;
    
  float gscl = (genm_smr/mrecm);
  
  px *= (gscl + gscler_mc_dev*gscler);
  py *= (gscl + gscler_mc_dev*gscler);
  pz *= (gscl + gscler_mc_dev*gscler);
  e  *= (gscl + gscler_mc_dev*gscler);
  
  float momscl = sqrt(px*px + py*py)/ptmu;
  
  float tune = 1.0/(1.0 + (delta + sysdev*deltaer)*sqrt(px*px + py*py)*eran.Gaus(1.0,(sf + sysdev*sfer)));
  
  px *= (tune); 
  py *= (tune);  
  pz *= (tune);  
  e  *= (tune);   
  
  qter *= (momscl*momscl + (1.0-tune)*(1.0-tune));
  
  mu.SetPxPyPzE(px,py,pz,e);
  
}
开发者ID:digiovan,项目名称:hmumuAnalysis,代码行数:54,代码来源:rochcor2012.C


示例5: CalcUnboostedMTR

double HWWKinematics::CalcUnboostedMTR(TLorentzVector P, TLorentzVector Q, TVector3 M){
    // first calculate pt-corrected MR
 float mymrnew = CalcMRNEW(L1,L2,MET);

    //Next, calculate the transverse Lorentz transformation
 TVector3 B = P.Vect()+Q.Vect()+MET;
 B.SetZ(0.0);
 B = (-1./(sqrt(4.*mymrnew*mymrnew+B.Dot(B))))*B;

 P.Boost(B);
 Q.Boost(B);

    //Now, re-calculate MTR in the new reference frame:
 float mymtrnew = CalcMTRNEW(P, Q);

    //R is now just the ratio of mymrnew and mymtrnew;

 return mymtrnew;
}
开发者ID:alessandrothea,项目名称:gardener,代码行数:19,代码来源:unBoostedVar.C


示例6: smearMom

TLorentzVector smearMom(TLorentzVector const& b,TF1 const * const fMomResolution)
{
  float const pt = b.Perp();
  float const sPt = gRandom->Gaus(pt,pt*fMomResolution->Eval(pt));

  TLorentzVector sMom;
  sMom.SetXYZM(sPt*cos(b.Phi()),sPt*sin(b.Phi()),sPt*sinh(b.PseudoRapidity()),b.M());
  return sMom;
}
开发者ID:GuannanXie,项目名称:auau200GeVRun14,代码行数:9,代码来源:pythia_decay.C


示例7: Delta

double Delta(double pt1, double eta1, double phi1,double pt2, double eta2, double phi2,double t1pfmetPhi){
  TLorentzVector fLorentzVec1; 
  TLorentzVector fLorentzVec2; 
  TLorentzVector fLorentzVecgg;
  
  // Fill TLorentzVector
  fLorentzVec1.SetPtEtaPhiM(pt1,eta1,phi1,0.);
  fLorentzVec2.SetPtEtaPhiM(pt2,eta2,phi2,0.);
  fLorentzVecgg = fLorentzVec1 + fLorentzVec2;
  double phigg= fLorentzVecgg.Phi();
  double delta = phigg-t1pfmetPhi;
  if(delta>3.14){
    delta-=6.28;
  }
  if(delta<-3.14){
    delta+=6.28;
  }
  delta =fabs(delta);
  return delta;
}
开发者ID:camendola,项目名称:macro,代码行数:20,代码来源:t1pfmetPhiwithCorr.C


示例8: smearEmEnergy

void smearEmEnergy( TLorentzVector& p ) {

    float smearEBlowEta     = 0.013898;
    float smearEBhighEta    = 0.0189895;
    float smearEElowEta     = 0.027686;
    float smearEEhighEta    = 0.031312;
    float theGaussMean      = 1.;
    float pt = p.Pt();
    float eta = p.Eta();
    float phi = p.Phi();
    float mass = p.M();
    float theSmear = 0.;
    if      (fabs(eta)<1.                   )  theSmear = smearEBlowEta;
    else if (fabs(eta)>=1.  && fabs(eta)<1.5)  theSmear = smearEBhighEta;
    else if (fabs(eta)>=1.5 && fabs(eta)<2. )  theSmear = smearEElowEta;
    else if (fabs(eta)>=2.  && fabs(eta)<2.5)  theSmear = smearEEhighEta;
    float fromGauss = myRandom_.Gaus(theGaussMean,theSmear);
    p.SetPtEtaPhiM( fromGauss*pt, eta, phi, mass ); // keep mass and direction same

}
开发者ID:pandolf,项目名称:ZGAnalysis,代码行数:20,代码来源:computeGenEfficiency.cpp


示例9: minDrPhoB

double Histogrammer::minDrPhoB(int PhoInd, EventTree* tree){
	// find the closest b-jet
	TLorentzVector b;
	TLorentzVector bBar;
	int phoGen=-1;
	double mindr = 999.0;
	for( int mcI = 0; mcI < tree->nMC_; ++mcI){
		if( tree->mcIndex->at(mcI) == tree->phoGenIndex_->at(PhoInd) ) 
			phoGen=mcI;
		if( tree->mcPID->at(mcI) == 5) 
			b.SetPtEtaPhiM(tree->mcPt->at(mcI), tree->mcEta->at(mcI), tree->mcPhi->at(mcI), tree->mcMass->at(mcI));
		if( tree->mcPID->at(mcI) == -5) 
			bBar.SetPtEtaPhiM(tree->mcPt->at(mcI), tree->mcEta->at(mcI), tree->mcPhi->at(mcI), tree->mcMass->at(mcI));
	}
	if( phoGen > 0 && b.Pt() > 0.0001 && bBar.Pt() > 0.0001 ) {
		mindr = std::min(dR(tree->mcEta->at(phoGen), tree->mcPhi->at(phoGen), b.Eta(), b.Phi()),
						 dR(tree->mcEta->at(phoGen), tree->mcPhi->at(phoGen), bBar.Eta(), bBar.Phi()));
	}
	return mindr;
}
开发者ID:titasroy89,项目名称:Muons,代码行数:20,代码来源:Histogrammer.cpp


示例10: AnalyseParticles

void Output_Delphes::AnalyseParticles(ExRootTreeBranch *branch, const HepMC::GenEvent& evt)
{
  TRootC::GenParticle *element;
  TLorentzVector momentum;
  Double_t signPz;
  ReadStats();
  for(int n=1; n<=evt.particles_size(); n++) {
    int mo1, mo2, da1, da2, status, pid;
    getStatsFromTuple(mo1,mo2,da1,da2,status,pid,n);
    element = static_cast<TRootC::GenParticle*>(branch->NewEntry());
    element->PID = pid;
    element->Status = status;
    element->M1 = mo1 - 1; // added -1 as the numbering in the tree starts from 0
    element->M2 = mo2 - 1;
    element->D1 = da1 - 1;
    element->D2 = da2 - 1;
    element->E = index_to_particle[n]->momentum().e();
    element->Px = index_to_particle[n]->momentum().px();
    element->Py = index_to_particle[n]->momentum().py();
    element->Pz = index_to_particle[n]->momentum().pz();
    element->PT = sqrt(pow(element->Px,2)+pow(element->Py,2));
    momentum.SetPxPyPzE(element->Px, element->Py, element->Pz, element->E);
    signPz = (element->Pz >= 0.0) ? 1.0 : -1.0;
    element->Eta = element->PT < 1e-6 ? signPz*999.9 : momentum.Eta();
    element->Phi = index_to_particle[n]->momentum().phi();
    HepMC::GenVertex* vrtI = (index_to_particle[n])->production_vertex();
    HepMC::GenVertex::particles_in_const_iterator partI;
    if(vrtI) {
      element->T = vrtI->position().t();
      element->X = vrtI->position().x();
      element->Y = vrtI->position().y();
      element->Z = vrtI->position().z();
    }
    else {
      element->T = 0.;
      element->X = 0.;
      element->Y = 0.;
      element->Z = 0.;
    }  
  }
}
开发者ID:alisw,项目名称:SHERPA,代码行数:41,代码来源:Output_Delphes.C


示例11: sqrt

//This is the function to determine the interaction point in case of a cylinder (case1), for BDXmini.
//The cylinder is with the axis along y(vertical), center at x=0,y=0,z=ldet, radius is R,height is h
double KinUtils::findInteractionPointCylinder1(const TLorentzVector &chi,double ldet,double h,double R,TVector3 &vin,TVector3 &vout,TVector3 &vhit){

	double tIN,tOUT,t2,t3,t,L;

	double px=chi.Px();
	double py=chi.Py();
	double pz=chi.Pz();

	double delta=pz*pz*ldet*ldet-(pz*pz+px*px)*(ldet*ldet-R*R);
	if (delta<0){
		cout<<"KinUtils::findInteractionPointCylinder1 error, the delta is: "<<delta<<endl;
		return 0;
	}

	//entry point
	tIN = (pz*ldet - sqrt(delta))/(px*px+pz*pz);
	t2 = (pz*ldet + sqrt(delta))/(px*px+pz*pz);

	t3 = (h/2)/py;


	if ((t3>0)&&(t3<t2)&&(t3>tIN)){
		tOUT=t3;
	}else{
		tOUT=t2;
	}

	t=Rand.Uniform(tIN,tOUT);

	vin.SetXYZ(tIN*px,tIN*py,tIN*pz);
	vout.SetXYZ(tOUT*px,tOUT*py,tOUT*pz);

	vhit.SetXYZ(t*px,t*py,t*pz);


	L = (vout - vin).Mag();



	return L;
}
开发者ID:JeffersonLab,项目名称:BDXEventGenerator,代码行数:43,代码来源:KinUtils.cpp


示例12: CalculateDeltaEtaAndPhi

std::vector<double> CalculateDeltaEtaAndPhi(bool possibleMultW, bool possibleMultAntiW, int w1, TLorentzVector TL_munu){

  //Don't take into account the events with multiple W's. Think of something

  double deltaphi, deltaeta;
  if(possibleMultW == false && possibleMultAntiW == false){
    deltaphi = TMath::Abs(TVector2::Phi_mpi_pi(TL_munu.Phi() - genPhi[w1]) );
     deltaeta = TMath::Abs(TL_munu.Eta() - genEta[w1] );
  } else {
    deltaphi = 99.;
    deltaeta = 99.;
  }

  std::vector<double> EtaAndPhi;

  EtaAndPhi.push_back(deltaeta);
  EtaAndPhi.push_back(deltaphi);

  return EtaAndPhi;

}
开发者ID:LuukVermunt,项目名称:PbPbTopAnalysis,代码行数:21,代码来源:checkOriginSelectedMuon.C


示例13: getKinematics

void getKinematics(TLorentzVector& b, double const mass)
{
   float const pt = gRandom->Uniform(momentumRange.first, momentumRange.second);
   float const y = gRandom->Uniform(-acceptanceRapidity, acceptanceRapidity);
   float const phi = TMath::TwoPi() * gRandom->Rndm();

   float const mT = sqrt(mass * mass + pt * pt);
   float const pz = mT * sinh(y);
   float const E = mT * cosh(y);

   b.SetPxPyPzE(pt * cos(phi), pt * sin(phi) , pz, E);
}
开发者ID:amcw7777,项目名称:auau200GeVRun14Ana,代码行数:12,代码来源:toyMcEffKS.C


示例14: muPtcorr

// // //
double analysisClass::RecoHLTdeltaRmin_SingleMu24Trigger( unsigned int iReco ){
  TLorentzVector HLTLep;
  TLorentzVector RecoLep;
  double deltaRmin=999999.9;
  RecoLep.SetPtEtaPhiM( muPtcorr(iReco),   MuonEta->at(iReco),   MuonPhi->at(iReco),   0);
  //
  for(unsigned int ifilter=0; ifilter<HLTFilterName->size(); ifilter++){  
    //
    // HLT_Mu24_eta2p1_v*
    if( HLTFilterName->at(ifilter) == "hltL3fL1sMu16Eta2p1L1f0L2f16QL3Filtered24Q" //V3,V4,V5
	){
      //
      // -----  extract TrigObject 4-vector  -----
      std::vector<std::vector<float> > * TrigObjectPt_TrigArray;  vector<float> trigObjPtArray;  float trigObjPt_;
      std::vector<std::vector<float> > * TrigObjectEta_TrigArray; vector<float> trigObjEtaArray; float trigObjEta_;
      std::vector<std::vector<float> > * TrigObjectPhi_TrigArray; vector<float> trigObjPhiArray; float trigObjPhi_;
      TrigObjectPt_TrigArray  = HLTFilterObjPt;    trigObjPtArray  = (*TrigObjectPt_TrigArray)[ifilter];
      TrigObjectEta_TrigArray = HLTFilterObjEta;   trigObjEtaArray = (*TrigObjectEta_TrigArray)[ifilter];
      TrigObjectPhi_TrigArray = HLTFilterObjPhi;   trigObjPhiArray = (*TrigObjectPhi_TrigArray)[ifilter];
      // ----- ----- ----- ----- ----- ----- -----
      for(unsigned int iobj=0; iobj<trigObjPtArray.size(); iobj++){//loop over all trigObjects of selected Filter
	trigObjPt_ = (trigObjPtArray)[iobj];  trigObjEta_= (trigObjEtaArray)[iobj];  trigObjPhi_= (trigObjPhiArray)[iobj];
	HLTLep.SetPtEtaPhiM( trigObjPt_, trigObjEta_, trigObjPhi_, 0 );
	if(RecoLep.DeltaR(HLTLep)<deltaRmin) deltaRmin = RecoLep.DeltaR(HLTLep);
      }
    }
  }
  //
  return deltaRmin;
}
开发者ID:dertexaner,项目名称:LQ3,代码行数:31,代码来源:ADDON2_LAC.C


示例15: HistResp

double PTCut::HistResp(TLorentzVector tmpP, double respHCAL, double respECAL,
                         double respEHHCAL, double respEHECAL)
{
    double respSum = 0;
    // In case of inconsistensies in binning, the bins are checked explicitely
    int binHadrf = 0;
    int binEcalf = 0;
    double trueFracECAL = 0;
    double fE = 0;
    // H: all energy in HCAL; this is multiplied with HCAL response
    binHadrf = pfh->FindBin(tmpP.Perp());
    respSum += (pfh->GetBinContent(binHadrf))*respHCAL; 
    
    // E: energy only in ECAL, fraction multiplied with ECAL response
    binHadrf = pfe->FindBin(tmpP.Perp());
    respSum += (pfe->GetBinContent(binHadrf))*respECAL; 
    
    // pf0: nothing is added for the lost hadrons, effectively:
    // respSum += (pf0->GetBinContent(binHadrf))*0;
    
    // eH: energy in both ECAL and HCAL, mostly HCAL. Does not work
    // intuitively (compared to EH). First, approximate H by HCAL
    // resp. times tot energy - 0.3 GeV. Move 0.3 GeV to ECAL and
    // use response for this.
    binHadrf = pfe0h->FindBin(tmpP.Perp());
    respSum += (pfe0h->GetBinContent(binHadrf))*( 0.3*(respECAL-1)
        + respHCAL );

    // EH: energy in both ECAL and HCAL
    binHadrf = pfe1h->FindBin(tmpP.Perp());
    binEcalf = pef1->FindBin(tmpP.Perp());

    fE = pef1->GetBinContent(binEcalf); 
    trueFracECAL = fE/((1-fE)*respEHECAL/respEHHCAL+1); 
    respSum += (pfe1h->GetBinContent(binHadrf))*(trueFracECAL*respEHECAL
        +(1-trueFracECAL)*respEHHCAL);

    return respSum;
}
开发者ID:errai-,项目名称:jetscripts,代码行数:39,代码来源:PTCut.cpp


示例16: HHLorentzVector

HHKinFit2::HHKinFitMasterSingleHiggs::HHKinFitMasterSingleHiggs(TLorentzVector const& tauvis1,
                                                                TLorentzVector const& tauvis2,
                                                                TVector2 const& met, 
                                                                TMatrixD const& met_cov, 
                                                                bool istruth,
                                                                TLorentzVector const& higgsgen)
:m_MET_COV(TMatrixD(4,4))
{
  
  m_tauvis1 = HHLorentzVector(tauvis1.Px(), tauvis1.Py(), tauvis1.Pz(), tauvis1.E());  
  m_tauvis2 = HHLorentzVector(tauvis2.Px(), tauvis2.Py(), tauvis2.Pz(), tauvis2.E());
 
  m_tauvis1.SetMkeepE(1.77682);
  m_tauvis2.SetMkeepE(1.77682);
   
  m_MET = met;
  m_MET_COV = met_cov;

  m_chi2_best = pow(10,10);
  m_bestHypo = 0;

  //  if (istruth){
  //    TRandom3 r(0);
  //
  //    HHLorentzVector recoil;
  //    if(heavyhiggsgen != NULL){
  //       Double_t pxRecoil = r.Gaus(-(heavyhiggsgen->Px() ), 10.0);
  //       Double_t pyRecoil = r.Gaus(-(heavyhiggsgen->Py() ), 10.0);
  //
  //       recoil = HHLorentzVector(pxRecoil, pyRecoil, 0,
  //				sqrt(pxRecoil*pxRecoil+pyRecoil*pyRecoil));
  //    }
  //    else{
  //      recoil = HHLorentzVector(0,0,0,0);
  //      std::cout << "WARNING! Truthinput mode active but no Heavy Higgs gen-information given! Setting Recoil to Zero!" << std::endl;
  //    }
  //
  //    TMatrixD recoilCov(2,2);
  //    recoilCov(0,0)=100;  recoilCov(0,1)=0;
  //    recoilCov(1,0)=0;    recoilCov(1,1)=100;
  //
  //    HHLorentzVector recoHH = m_bjet1 + m_bjet2 + m_tauvis1 + m_tauvis2 + recoil;
  //    m_MET = TVector2(-recoHH.Px(), -recoHH.Py() );
  //
  //    m_MET_COV = TMatrixD(2,2);
  //    m_MET_COV = recoilCov + bjet1Cov + bjet2Cov;
  //
  //  }
}
开发者ID:MonikaVen,项目名称:HHKinFit2,代码行数:49,代码来源:HHKinFitMasterSingleHiggs.cpp


示例17:

void DalitzChiSq2::setap3(TLorentzVector vec){
	ap3.v.SetXYZM(vec.Px(),vec.Py(),vec.Pz(),vec.M());
	//em & ep
    	    double cos12 = (ap1.v.Px()*ap2.v.Px() + ap1.v.Py()*ap2.v.Py() + ap1.v.Pz()*ap2.v.Pz())/(ap1.v.P()*ap2.v.P());
    	   //em & gm
   	    double cos23 = (ap2.v.Px()*ap3.v.Px() + ap2.v.Py()*ap3.v.Py() + ap2.v.Pz()*ap3.v.Pz())/(ap3.v.P()*ap2.v.P());
            //ep & gm
            double cos13 = (ap1.v.Px()*ap3.v.Px() + ap1.v.Py()*ap3.v.Py() + ap1.v.Pz()*ap3.v.Pz())/(ap1.v.P()*ap3.v.P());
		
		double beta1 = ap1.v.P()/ap1.v.E();
		double beta2 = ap2.v.P()/ap2.v.E();
	    

	    double z12 = 2*((1/(beta1*beta2)) -cos12);
	    double z23 = 2*((1/beta2)-cos23);
	    double z13 = 2*((1/beta1)-cos13);
	double topterm =   M*M - 2*m_e*m_e - ( z12/(TMath::Sin(ap1.theta) * TMath::Sin(ap2.theta) *ap1.x_m*ap2.x_m));
	double bottomterm = ( (z13/(TMath::Sin(ap1.theta) * ap1.x_m)) + (z23/(TMath::Sin(ap2.theta) * ap2.x_m)) );

	ap3.x_m=topterm/bottomterm;
	
}
开发者ID:Jphsx,项目名称:Dalitz-Decay,代码行数:22,代码来源:DalitzChiSq2.cpp


示例18: doLoop

void ptLooper::doLoop() {

  for (int i = ievent_; i < max_entry; i++) {
    if (i % 100000 == 0) cout << i << " / " << max_entry << endl;
    tree->GetEntry(i);

    TLorentzVector muPN;
    muPN = *muonP_p4 + *muonN_p4;
    muPN_mass_h.Fill(muPN.M());

    mass_h.Fill(dimuon_p4->M());

    dimuonPt_h.Fill(dimuon_p4->Pt());
    dimuonEta_h.Fill(dimuon_p4->Eta());

    dimuonpteta_h.Fill(dimuon_p4->Eta(), dimuon_p4->Pt());

    muonpteta_h.Fill(muonP_p4->Eta(), muonP_p4->Pt());
    muonpteta_h.Fill(muonN_p4->Eta(), muonN_p4->Pt());

    if (muonP_p4->Pt() > 4. && muonN_p4->Pt()>4.) {
      dimuonPt4_h.Fill(dimuon_p4->Pt());
      dimuonEta4_h.Fill(dimuon_p4->Eta());
    }

    if (simul_Jpsi_trigger(muonP_p4, muonN_p4, dimuon_p4)) {
      dimuonPtTriggered_h.Fill(dimuon_p4->Pt());
    }
  }

  histos1D.push_back(dimuonPt_h);
  histos1D.push_back(dimuonPt4_h);
  histos1D.push_back(dimuonEta_h);
  histos1D.push_back(dimuonEta4_h);
  histos1D.push_back(muPN_mass_h);
  histos1D.push_back(mass_h);
  histos1D.push_back(dimuonPtTriggered_h);

}
开发者ID:lucamartini,项目名称:quarkonia,代码行数:39,代码来源:ptLooper.cpp


示例19: phibin

void rochcor2012::momcor_data( TLorentzVector& mu, float charge, int runopt, float& qter){
  
  float ptmu = mu.Pt();

  float muphi = mu.Phi();
  float mueta = mu.Eta(); // same with mu.Eta() in Root

  float px = mu.Px();
  float py = mu.Py();
  float pz = mu.Pz();
  float e = mu.E();
  
  int mu_phibin = phibin(muphi);
  int mu_etabin = etabin(mueta);

  float Mf = 0.0;
  float Af = 0.0;

  if(runopt==0){
    Mf = (dcor_bf[mu_phibin][mu_etabin]+mptsys_da_dm[mu_phibin][mu_etabin]*dcor_bfer[mu_phibin][mu_etabin])/(dpavg[mu_phibin][mu_etabin]+dmavg[mu_phibin][mu_etabin]);
    Af = ((dcor_ma[mu_phibin][mu_etabin]+mptsys_da_da[mu_phibin][mu_etabin]*dcor_maer[mu_phibin][mu_etabin]) - Mf*(dpavg[mu_phibin][mu_etabin]-dmavg[mu_phibin][mu_etabin]));     
  }else if(runopt==1){
    Mf = (dcor_bfD[mu_phibin][mu_etabin]+mptsys_da_dm[mu_phibin][mu_etabin]*dcor_bfDer[mu_phibin][mu_etabin])/(dpavgD[mu_phibin][mu_etabin]+dmavgD[mu_phibin][mu_etabin]);
    Af = ((dcor_maD[mu_phibin][mu_etabin]+mptsys_da_da[mu_phibin][mu_etabin]*dcor_maDer[mu_phibin][mu_etabin]) - Mf*(dpavgD[mu_phibin][mu_etabin]-dmavgD[mu_phibin][mu_etabin]));     
  }
  
  float cor = 1.0/(1.0 + 2.0*Mf + charge*Af*ptmu);
  
  px *= cor;
  py *= cor;
  pz *= cor;
  e  *= cor;
  
  //after Z pt correction
  float gscler = dgscl_stat;
  float gscl = (genm_smr/drecm);
  
  px *= (gscl + gscler_da_dev*gscler);
  py *= (gscl + gscler_da_dev*gscler);
  pz *= (gscl + gscler_da_dev*gscler);
  e  *= (gscl + gscler_da_dev*gscler);
  
  float momscl = sqrt(px*px + py*py)/ptmu;
  qter *= momscl;
  
  mu.SetPxPyPzE(px,py,pz,e);
  
}
开发者ID:brovercleveland,项目名称:HZG_Analyzer,代码行数:48,代码来源:rochcor2012v2.C


示例20: if

TLorentzVector muon_pog::Plotter::muonTk(const muon_pog::Muon & muon)
{
  std::string & trackType = m_config.muon_trackType;

  TLorentzVector result; 
  if (trackType == "PF")
    result.SetPtEtaPhiM(muon.pt,muon.eta,muon.phi,.10565);
  else if (trackType == "TUNEP")
    result.SetPtEtaPhiM(muon.pt_tuneP,muon.eta_tuneP,muon.phi_tuneP,.10565);
  else if (trackType == "GLB")
    result.SetPtEtaPhiM(muon.pt_global,muon.eta_global,muon.phi_global,.10565);
  else if (trackType == "INNER")
    result.SetPtEtaPhiM(muon.pt_tracker,muon.eta_tracker,muon.phi_tracker,.10565);
  else
    {
      std::cout << "[Plotter::muonTk]: Invalid track type: "
		<< trackType << std::endl;
      exit(900);
    }

  return result;
  
}
开发者ID:HuguesBrun,项目名称:MuonPOG,代码行数:23,代码来源:invariantMassPlots.C



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ TMMFMessage类代码示例发布时间:2022-05-31
下一篇:
C++ TLocale类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap