本文整理汇总了C++中TLorentzVector::SetPtEtaPhiM方法的典型用法代码示例。如果您正苦于以下问题:C++ TLorentzVector::SetPtEtaPhiM方法的具体用法?C++ TLorentzVector::SetPtEtaPhiM怎么用?C++ TLorentzVector::SetPtEtaPhiM使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TLorentzVector
的用法示例。
在下文中一共展示了TLorentzVector::SetPtEtaPhiM方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: doJER
// https://twiki.cern.ch/twiki/bin/view/CMS/JetResolution
void doJER(EventTree* tree){
// correct MET when jets are smeared
TLorentzVector tMET;
tMET.SetPtEtaPhiM(tree->pfMET_,0.0,tree->pfMETPhi_,0.0);
//std::cout << "before correction MET " << tree->pfMET_ << " " << tree->pfMETPhi_ << " ";
// scale jets
for(int jetInd = 0; jetInd < tree->nJet_ ; ++jetInd){
if(tree->jetPt_->at(jetInd) < 20) continue;
if(tree->jetGenJetIndex_->at(jetInd)>0){
TLorentzVector tjet;
tjet.SetPtEtaPhiM(tree->jetPt_->at(jetInd), tree->jetEta_->at(jetInd), tree->jetPhi_->at(jetInd), 0.0);
tMET+=tjet;
double oldPt = tree->jetPt_->at(jetInd);
double genPt = tree->jetGenJetPt_->at(jetInd);
double eta = tree->jetEta_->at(jetInd);
tree->jetPt_->at(jetInd) = std::max(0.0, genPt + JERcorrection(eta)*(oldPt-genPt));
tjet.SetPtEtaPhiM(tree->jetPt_->at(jetInd), tree->jetEta_->at(jetInd), tree->jetPhi_->at(jetInd), 0.0);
tMET-=tjet;
//std::cout << "old " << oldPt << " new " << tree->jetPt_->at(jetInd) << std::endl;
}
}
// save updated MET values
tree->pfMET_ = tMET.Pt();
tree->pfMETPhi_ = tMET.Phi();
//std::cout << "after corrections " << tree->pfMET_ << " " << tree->pfMETPhi_ << std::endl;
}
示例2: tauGenMatchDeltaR
// // //
double analysisClass::tauGenMatchDeltaR(unsigned int iTauR){
TLorentzVector tauMgen;
TLorentzVector taureco;
if(HPSTauMatchedGenParticlePt->at(iTauR)<=0) return 9;
tauMgen.SetPtEtaPhiM( HPSTauMatchedGenParticlePt->at(iTauR), HPSTauMatchedGenParticleEta->at(iTauR), HPSTauMatchedGenParticlePhi->at(iTauR), 0 );
taureco.SetPtEtaPhiM( tauPtcorr(iTauR), HPSTauEta->at(iTauR), HPSTauPhi->at(iTauR), 0 );
return taureco.DeltaR(tauMgen);
}
示例3: muGenMatchDeltaR
// // //
double analysisClass::muGenMatchDeltaR(unsigned int iMuR){
TLorentzVector muMgen;
TLorentzVector mureco;
if(MuonMatchedGenParticlePt->at(iMuR)<=0) return 9;
muMgen.SetPtEtaPhiM( MuonMatchedGenParticlePt->at(iMuR), MuonMatchedGenParticleEta->at(iMuR), MuonMatchedGenParticlePhi->at(iMuR), 0 );
mureco.SetPtEtaPhiM( muPtcorr(iMuR), MuonEta->at(iMuR), MuonPhi->at(iMuR), 0 );
return mureco.DeltaR(muMgen);
}
示例4: DiscoverySelection
// // //
bool analysisClass::DiscoverySelection( TString SignalChannel ){
//
int TotalN=0;
int TotalTau=0;
int TotalMu=0;
int TotalEl=0;
int TotalJet=0;
int TotalBJet=0;
TotalTau = TauCounter();
TotalMu = MuCounter();
TotalEl = ElCounter();
TotalJet = JetCounter();
TotalBJet = BJetCounter();
TotalN = TotalTau + TotalMu + TotalEl + TotalJet;
//
double LeadMuTauDeltaR=0;
TLorentzVector Mu;
TLorentzVector Tau;
Mu.SetPtEtaPhiM(0,0,0,0);
Tau.SetPtEtaPhiM(0,0,0,0);
for(unsigned int iTauR=0; iTauR<HPSTauPt->size(); iTauR++){
if( !tauRisoCheck(iTauR) )continue;
if( tauPtcorr(iTauR)>Tau.Pt() ){
Tau.SetPtEtaPhiM(tauPtcorr(iTauR), HPSTauEta->at(iTauR), HPSTauPhi->at(iTauR), 0);
}
}
for(unsigned int iMuR=0; iMuR<MuonPt->size(); iMuR++){
if( !muRisoCheck(iMuR) )continue;
if( muPtcorr(iMuR)>Mu.Pt() ){
Mu.SetPtEtaPhiM(muPtcorr(iMuR), MuonEta->at(iMuR), MuonPhi->at(iMuR), 0);
}
}
if( TotalMu>0 && TotalTau>0 ) LeadMuTauDeltaR=Mu.DeltaR(Tau);
//
//
// ASSUME PRESELECTION IS ALREADY APPLIED
if( SignalChannel == "MuMu" ){
if( TotalBJet<1 ) return false;
if( TotalJet<2 ) return false;
if( ST()<400 ) return false;
if( LeadingMuPt()<20 ) return false;
if( RecoSignalType()!=2020 && TotalMu<3 ) return false;//mu-mu SS selection
if( isZToMuMu() ) return false;//required to exclude events in MuTrig Calculation
}
if( SignalChannel == "MuTau" ){
if( TotalBJet<1 ) return false;
if( TotalJet<2 ) return false;//SS selection
if( ST()<500 ) return false;
if( MaxMuTauInvMass()<100 ) return false;
if( LeadingTauPt()<50 ) return false;
if( RecoSignalType()<2000 ) return false;//mu-tau+X OS selection
if( isZToMuMu() ) return false;//required to exclude events in MuTrig Calculation
}
//
return true;
//
}
示例5: LeadingMuPt
// // //
double analysisClass::LeadingMuPt( ){
TLorentzVector LeadLep;
LeadLep.SetPtEtaPhiM( 0, 0, 0, 0 );
//
for(unsigned int iMuR=0; iMuR<MuonPt->size(); iMuR++){
if(!muRisoCheck(iMuR) ) continue;
if( LeadLep.Pt()<muPtcorr(iMuR) ) LeadLep.SetPtEtaPhiM( muPtcorr(iMuR), MuonEta->at(iMuR), MuonPhi->at(iMuR), 0 );
}
return LeadLep.Pt();
}
示例6: LeadingTauPt
// // //
double analysisClass::LeadingTauPt(){
TLorentzVector LeadLep;
LeadLep.SetPtEtaPhiM( 0, 0, 0, 0 );
//
for(unsigned int iTauR=0; iTauR<HPSTauPt->size(); iTauR++){
if(!tauRisoCheck(iTauR) ) continue;
if( LeadLep.Pt()<tauPtcorr(iTauR) ) LeadLep.SetPtEtaPhiM( tauPtcorr(iTauR), HPSTauEta->at(iTauR), HPSTauPhi->at(iTauR), 0 );
}
return LeadLep.Pt();
}
示例7: LeadingJetPt
// // //
double analysisClass::LeadingJetPt(){
TLorentzVector LeadJet;
LeadJet.SetPtEtaPhiM( 0, 0, 0, 0 );
//
for(unsigned int iJetR=0; iJetR<PFJetPt->size(); iJetR++){
if(!jetRisoCheck(iJetR) ) continue;
if( LeadJet.Pt()<jetPtcorr(iJetR) ) LeadJet.SetPtEtaPhiM( jetPtcorr(iJetR), PFJetEta->at(iJetR), PFJetPhi->at(iJetR), 0 );
}
return LeadJet.Pt();
}
示例8: isRecoTauMatchedTO
// // //
bool analysisClass::isRecoTauMatchedTO( double genPt , double genEta , double genPhi , double dRcut ){
double deltaR=999;
TLorentzVector RecoTau;
TLorentzVector GenTau;
GenTau.SetPtEtaPhiM( genPt, genEta, genPhi, 0 );
//
for(unsigned int iTauR=0; iTauR<HPSTauPt->size(); iTauR++){
if( !tauRCheck( iTauR ) ) continue;
RecoTau.SetPtEtaPhiM( tauPtcorr(iTauR) , HPSTauEta->at(iTauR) , HPSTauPhi->at(iTauR) , 0 );
if( fabs(RecoTau.DeltaR(GenTau))<deltaR ) deltaR=fabs(RecoTau.DeltaR(GenTau));
}
//
if( deltaR<dRcut ) return true;
return false;
}
示例9: isRecoMuMatchedTO
// // //
bool analysisClass::isRecoMuMatchedTO( double genPt , double genEta , double genPhi , double dRcut ){
double deltaR=999;
TLorentzVector RecoMu;
TLorentzVector GenMu;
GenMu.SetPtEtaPhiM( genPt, genEta, genPhi, 0 );
//
for(unsigned int iMuR=0; iMuR<MuonPt->size(); iMuR++){
if( !muRCheck( iMuR ) ) continue;
RecoMu.SetPtEtaPhiM( muPtcorr(iMuR) , MuonEta->at(iMuR) , MuonPhi->at(iMuR) , 0 );
if( RecoMu.DeltaR(GenMu)<deltaR ) deltaR=RecoMu.DeltaR(GenMu);
}
//
if( deltaR<dRcut ) return true;
return false;
}
示例10: GetAwayJets
//------------------------------------------------------------------------------
// GetAwayJets
//------------------------------------------------------------------------------
void AnalysisFR::GetAwayJets()
{
AnalysisJets.clear();
int jetsize = std_vector_jet_pt->size();
for (int j=0; j<jetsize; j++) {
Jet jet_;
jet_.index = j;
float pt = std_vector_jet_pt ->at(j);
float eta = std_vector_jet_eta->at(j);
float phi = std_vector_jet_phi->at(j);
if (pt < 10.) continue;
TLorentzVector tlv;
tlv.SetPtEtaPhiM(pt, eta, phi, 0);
jet_.v = tlv;
float dR = tlv.DeltaR(Lepton1.v);
if (dR > 1) AnalysisJets.push_back(jet_);
}
}
示例11: computeIso
//--------------------------------------------------------------------------------------------------
double computeIso(const Lepton &lep, const TPhoton *fsrCand, const double rho)
{
TLorentzVector fsrvec;
if(fsrCand) fsrvec.SetPtEtaPhiM(fsrCand->pfPt, fsrCand->pfEta, fsrCand->pfPhi, 0);
double fsrCorr = 0;
double dr = (fsrCand) ? lep.p4.DeltaR(fsrvec) : 0;
if(abs(lep.pdgId)==ELECTRON_PDGID) {
const TElectron *ele = (TElectron*)lep.baconObj;
const double extRadius = 0.4;
const double intRadius = 0.08;
bool matchEle = (fsrCand && (fsrCand->typeBits & kPFPhoton) && fsrCand->mvaNothingGamma>0.99 && ele->nMissingHits>0 &&
fsrCand->scID>-1 && ele->scID>-1 && fsrCand->scID == ele->scID);
if(ele->fiducialBits & kIsEB) {
if(fsrCand && dr<extRadius && !(matchEle)) fsrCorr = fsrCand->pfPt;
} else {
if(fsrCand && dr>=intRadius && dr<extRadius && !(matchEle)) fsrCorr = fsrCand->pfPt;
}
return ele->chHadIso04 + TMath::Max(ele->gammaIso04 - fsrCorr + ele->neuHadIso04 - rho*getEffArea(ele->scEta), 0.);
} else if(abs(lep.pdgId)==MUON_PDGID) {
const TMuon *mu = (TMuon*)lep.baconObj;
const double extRadius = 0.4;
const double intRadius = 0;//0.01;
if(fsrCand && dr>=intRadius && dr<extRadius) fsrCorr = fsrCand->pfPt;
return mu->chHadIso04 + TMath::Max(mu->gammaIso04 - fsrCorr + mu->neuHadIso04 - 0.5*(mu->puIso04), 0.);
} else {
return -1;
}
}
示例12: setLepton
void ZWW::setLepton(std::vector<float> pt,
std::vector<float> eta,
std::vector<float> phi,
std::vector<float> flavor,
std::vector<float> charge,
std::vector<float> id){
lepPt_ = pt;
lepEta_= eta;
lepPhi_= phi;
lepFl_ = flavor;
lepCh_ = charge;
lepId_ = id;
isLepOk();
if (isLepOk_){
TLorentzVector buffVec;
for(int iVec=0; iVec < 4; iVec++){
buffVec.SetPtEtaPhiM(lepPt_ [iVec],
lepEta_ [iVec],
lepPhi_ [iVec],
0);
lepVec_.push_back(buffVec);
}
setZ0LepIdx_();
setZ1LepIdx_();
setZaZbLepIdx_();
}
}
示例13: while
void ToyEvent7::GenerateSignalKinematics(TRandom *rnd,Bool_t isData) {
// fake decay of Z0 to two fermions
double M0=91.1876;
double Gamma=2.4952;
// generated mass
do {
fMGen[2]=rnd->BreitWigner(M0,Gamma);
} while(fMGen[2]<=0.0);
double N_ETA=3.0;
double MU_PT=5.;
double SIGMA_PT=2.0;
double DECAY_A=0.2;
if(isData) {
//N_ETA=2.5;
MU_PT=6.;
SIGMA_PT=1.8;
//DECAY_A=0.5;
}
fEtaGen[2]=TMath::Power(rnd->Uniform(0,1.5),N_ETA);
if(rnd->Uniform(-1.,1.)<0.) fEtaGen[2] *= -1.;
fPhiGen[2]=rnd->Uniform(-M_PI,M_PI);
do {
fPtGen[2]=rnd->Landau(MU_PT,SIGMA_PT);
} while((fPtGen[2]<=0.0)||(fPtGen[2]>500.));
//========================== decay
TLorentzVector sum;
sum.SetPtEtaPhiM(fPtGen[2],fEtaGen[2],fPhiGen[2],fMGen[2]);
// boost into lab-frame
TVector3 boost=sum.BoostVector();
// decay in rest-frame
TLorentzVector p[3];
double m=MASS1;
double costh;
do {
double r=rnd->Uniform(-1.,1.);
costh=r*(1.+DECAY_A*r*r);
} while(fabs(costh)>=1.0);
double phi=rnd->Uniform(-M_PI,M_PI);
double e=0.5*sum.M();
double ptot=TMath::Sqrt(e+m)*TMath::Sqrt(e-m);
double pz=ptot*costh;
double pt=TMath::Sqrt(ptot+pz)*TMath::Sqrt(ptot-pz);
double px=pt*cos(phi);
double py=pt*sin(phi);
p[0].SetXYZT(px,py,pz,e);
p[1].SetXYZT(-px,-py,-pz,e);
for(int i=0;i<2;i++) {
p[i].Boost(boost);
}
p[2]=p[0]+p[1];
for(int i=0;i<3;i++) {
fPtGen[i]=p[i].Pt();
fEtaGen[i]=p[i].Eta();
fPhiGen[i]=p[i].Phi();
fMGen[i]=p[i].M();
}
}
示例14: smearEmEnergy
void smearEmEnergy( const EnergyScaleCorrection_class& egcor, TLorentzVector& p, const ZGTree& myTree, float r9 ) {
float smearSigma = egcor.getSmearingSigma(myTree.run, fabs(p.Eta())<1.479, r9, p.Eta(), p.Pt(), 0., 0.);
float cor = myRandom_.Gaus( 1., smearSigma );
p.SetPtEtaPhiM( p.Pt()*cor, p.Eta(), p.Phi(), p.M() );
}
示例15: printEvent
void ZgSelectData::printEvent(int index_e1, int index_e2, int index_pho, vector<Float_t> elePt_){
cout << "PassedZeeGamma: run " << run << " event " << event << " rho " << rho << endl ;
cout << "electron :index,pt,eta,phi,En " << endl ;
cout << index_e1 << " , " << elePt_[index_e1] << " , " << eleEta[index_e1] ;
cout << " , " << elePhi[index_e1] << " , " << eleEn[index_e1] << endl ;
cout << index_e2 << " , " << elePt_[index_e2] << " , " << eleEta[index_e2] ;
cout << " , " << elePhi[index_e2] << " , " << eleEn[index_e2] << endl ;
cout << "Electron Pass " << endl ;
cout << "TrackIso " << eleIsoTrkDR03[index_e1] << " EcalIso " << eleIsoEcalDR03[index_e1] << " HcalSolidIso ";
cout << eleIsoHcalSolidDR03[index_e1] << " passID = " << elePassID(index_e1,3,elePt_) << endl ;
cout << "TrackIso " << eleIsoTrkDR03[index_e2] << " EcalIso " << eleIsoEcalDR03[index_e2] << " HcalSolidIso ";
cout << eleIsoHcalSolidDR03[index_e2] << " passID = " << elePassID(index_e2,3,elePt_) << endl ;
TLorentzVector ve1, ve2, vZ ;
ve1.SetPtEtaPhiE(elePt[index_e1],eleEta[index_e1],elePhi[index_e1],eleEn[index_e1]);
ve2.SetPtEtaPhiE(elePt[index_e2],eleEta[index_e2],elePhi[index_e2],eleEn[index_e2]);
vZ = ve1 + ve2 ;
cout << "ZMass = " << vZ.M() << endl ;
cout << "Photon : index, pt, eta, phi, dr1, dr2 " << endl ;
TLorentzVector vp ;
vp.SetPtEtaPhiM(phoEt[index_pho],phoEta[index_pho],phoPhi[index_pho],0);
cout << index_pho << " , " << vp.Pt() << " , " << vp.Eta() << " , " << vp.Phi() ;
cout << " , " << vp.DeltaR(ve1) << " , " << vp.DeltaR(ve2) << endl ;
cout << "=================================================================" << endl ;
}