本文整理汇总了C++中TVector2::Px方法的典型用法代码示例。如果您正苦于以下问题:C++ TVector2::Px方法的具体用法?C++ TVector2::Px怎么用?C++ TVector2::Px使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TVector2
的用法示例。
在下文中一共展示了TVector2::Px方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: selectWe
//.........这里部分代码省略.........
for(UInt_t ieta=0; ieta<escaleNbins; ieta++) {
if(fabs(goodEle->scEta)<escaleEta[ieta]) {
escale = escaleCorr[ieta];
break;
}
}
}
LorentzVector vLep(escale*(goodEle->pt), goodEle->eta, goodEle->phi, ELE_MASS);
LorentzVector vSC(escale*(goodEle->scEt), goodEle->scEta, goodEle->scPhi, ELE_MASS);
//
// Fill tree
//
runNum = info->runNum;
lumiSec = info->lumiSec;
evtNum = info->evtNum;
npv = pvArr->GetEntriesFast();
npu = info->nPU;
genVPt = 0;
genVPhi = 0;
genVy = 0;
genVMass = 0;
genLepPt = 0;
genLepPhi= 0;
u1 = 0;
u2 = 0;
if(hasGen) {
genVPt = gen->vpt;
genVPhi = gen->vphi;
genVy = gen->vy;
genVMass = gen->vmass;
TVector2 vWPt((gen->vpt)*cos(gen->vphi),(gen->vpt)*sin(gen->vphi));
TVector2 vLepPt(vLep.Px(),vLep.Py());
TVector2 vMet((info->pfMET)*cos(info->pfMETphi), (info->pfMET)*sin(info->pfMETphi));
TVector2 vU = -1.0*(vMet+vLepPt);
u1 = ((vWPt.Px())*(vU.Px()) + (vWPt.Py())*(vU.Py()))/(gen->vpt); // u1 = (pT . u)/|pT|
u2 = ((vWPt.Px())*(vU.Py()) - (vWPt.Py())*(vU.Px()))/(gen->vpt); // u2 = (pT x u)/|pT|
if(abs(gen->id_1)==EGenType::kElectron) { genLepPt = gen->vpt_1; genLepPhi = gen->vphi_1; }
if(abs(gen->id_2)==EGenType::kElectron) { genLepPt = gen->vpt_2; genLepPhi = gen->vphi_2; }
}
scale1fb = weight;
met = info->pfMET;
metPhi = info->pfMETphi;
sumEt = info->pfSumET;
mt = sqrt( 2.0 * (vLep.Pt()) * (info->pfMET) * (1.0-cos(toolbox::deltaPhi(vLep.Phi(),info->pfMETphi))) );
q = goodEle->q;
lep = &vLep;
///// electron specific /////
sc = &vSC;
trkIso = goodEle->trkIso03;
emIso = goodEle->emIso03;
hadIso = goodEle->hadIso03;
pfChIso = goodEle->pfChIso03;
pfGamIso = goodEle->pfGamIso03;
pfNeuIso = goodEle->pfNeuIso03;
pfCombIso = goodEle->pfChIso03 + TMath::Max(goodEle->pfNeuIso03 + goodEle->pfGamIso03 - (info->rhoLowEta)*getEffArea(goodEle->scEta), 0.);
sigieie = goodEle->sigiEtaiEta;
hovere = goodEle->HoverE;
eoverp = goodEle->EoverP;
fbrem = goodEle->fBrem;
dphi = goodEle->deltaPhiIn;
deta = goodEle->deltaEtaIn;
d0 = goodEle->d0;
示例2: selectWe
//.........这里部分代码省略.........
tkU2 = -999;
mvaU1 = -999;
mvaU2 = -999;
puppiU1 = -999;
puppiU2 = -999;
id_1 = -999;
id_2 = -999;
x_1 = -999;
x_2 = -999;
xPDF_1 = -999;
xPDF_2 = -999;
scalePDF = -999;
weightPDF = -999;
if(isSignal && hasGen) {
TLorentzVector *gvec=new TLorentzVector(0,0,0,0);
TLorentzVector *glep1=new TLorentzVector(0,0,0,0);
TLorentzVector *glep2=new TLorentzVector(0,0,0,0);
toolbox::fillGen(genPartArr, BOSON_ID, gvec, glep1, glep2,1);
if (gvec && glep1) {
genV = new TLorentzVector(0,0,0,0);
genV->SetPtEtaPhiM(gvec->Pt(),gvec->Eta(),gvec->Phi(),gvec->M());
genLep = new TLorentzVector(0,0,0,0);
genLep->SetPtEtaPhiM(glep1->Pt(),glep1->Eta(),glep1->Phi(),glep1->M());
genVPt = gvec->Pt();
genVPhi = gvec->Phi();
genVy = gvec->Rapidity();
genVMass = gvec->M();
genLepPt = glep1->Pt();
genLepPhi = glep1->Phi();
TVector2 vWPt((genVPt)*cos(genVPhi),(genVPt)*sin(genVPhi));
TVector2 vLepPt(vLep.Px(),vLep.Py());
TVector2 vMet((info->pfMETC)*cos(info->pfMETCphi), (info->pfMETC)*sin(info->pfMETCphi));
TVector2 vU = -1.0*(vMet+vLepPt);
u1 = ((vWPt.Px())*(vU.Px()) + (vWPt.Py())*(vU.Py()))/(genVPt); // u1 = (pT . u)/|pT|
u2 = ((vWPt.Px())*(vU.Py()) - (vWPt.Py())*(vU.Px()))/(genVPt); // u2 = (pT x u)/|pT|
TVector2 vTkMet((info->trkMET)*cos(info->trkMETphi), (info->trkMET)*sin(info->trkMETphi));
TVector2 vTkU = -1.0*(vTkMet+vLepPt);
tkU1 = ((vWPt.Px())*(vTkU.Px()) + (vWPt.Py())*(vTkU.Py()))/(genVPt); // u1 = (pT . u)/|pT|
tkU2 = ((vWPt.Px())*(vTkU.Py()) - (vWPt.Py())*(vTkU.Px()))/(genVPt); // u2 = (pT x u)/|pT|
TVector2 vMvaMet((info->mvaMET)*cos(info->mvaMETphi), (info->mvaMET)*sin(info->mvaMETphi));
TVector2 vMvaU = -1.0*(vMvaMet+vLepPt);
mvaU1 = ((vWPt.Px())*(vMvaU.Px()) + (vWPt.Py())*(vMvaU.Py()))/(genVPt); // u1 = (pT . u)/|pT|
mvaU2 = ((vWPt.Px())*(vMvaU.Py()) - (vWPt.Py())*(vMvaU.Px()))/(genVPt); // u2 = (pT x u)/|pT|
TVector2 vPuppiMet((info->puppET)*cos(info->puppETphi), (info->puppET)*sin(info->puppETphi));
TVector2 vPuppiU = -1.0*(vPuppiMet+vLepPt);
puppiU1 = ((vWPt.Px())*(vPuppiU.Px()) + (vWPt.Py())*(vPuppiU.Py()))/(genVPt); // u1 = (pT . u)/|pT|
puppiU2 = ((vWPt.Px())*(vPuppiU.Py()) - (vWPt.Py())*(vPuppiU.Px()))/(genVPt); // u2 = (pT x u)/|pT|
}
id_1 = gen->id_1;
id_2 = gen->id_2;
x_1 = gen->x_1;
x_2 = gen->x_2;
xPDF_1 = gen->xPDF_1;
xPDF_2 = gen->xPDF_2;
scalePDF = gen->scalePDF;
weightPDF = gen->weight;
delete gvec;
示例3: selectAntiWm
//.........这里部分代码省略.........
u2 = -999;
tkU1 = -999;
tkU2 = -999;
mvaU1 = -999;
mvaU2 = -999;
id_1 = -999;
id_2 = -999;
x_1 = -999;
x_2 = -999;
xPDF_1 = -999;
xPDF_2 = -999;
scalePDF = -999;
weightPDF = -999;
if(isSignal && hasGen) {
TLorentzVector *gvec=new TLorentzVector(0,0,0,0);
TLorentzVector *glep1=new TLorentzVector(0,0,0,0);
TLorentzVector *glep2=new TLorentzVector(0,0,0,0);
toolbox::fillGen(genPartArr, BOSON_ID, gvec, glep1, glep2,1);
if (gvec && glep1) {
genV = new TLorentzVector(0,0,0,0);
genV->SetPtEtaPhiM(gvec->Pt(),gvec->Eta(),gvec->Phi(),gvec->M());
genLep = new TLorentzVector(0,0,0,0);
genLep->SetPtEtaPhiM(glep1->Pt(),glep1->Eta(),glep1->Phi(),glep1->M());
genVPt = gvec->Pt();
genVPhi = gvec->Phi();
genVy = gvec->Rapidity();
genVMass = gvec->M();
genLepPt = glep1->Pt();
genLepPhi = glep1->Phi();
TVector2 vWPt((genVPt)*cos(genVPhi),(genVPt)*sin(genVPhi));
TVector2 vLepPt(vLep.Px(),vLep.Py());
TVector2 vMet((info->pfMETC)*cos(info->pfMETCphi), (info->pfMETC)*sin(info->pfMETCphi));
TVector2 vU = -1.0*(vMet+vLepPt);
u1 = ((vWPt.Px())*(vU.Px()) + (vWPt.Py())*(vU.Py()))/(genVPt); // u1 = (pT . u)/|pT|
u2 = ((vWPt.Px())*(vU.Py()) - (vWPt.Py())*(vU.Px()))/(genVPt); // u2 = (pT x u)/|pT|
TVector2 vTkMet((info->trkMET)*cos(info->trkMETphi), (info->trkMET)*sin(info->trkMETphi));
TVector2 vTkU = -1.0*(vTkMet+vLepPt);
tkU1 = ((vWPt.Px())*(vTkU.Px()) + (vWPt.Py())*(vTkU.Py()))/(genVPt); // u1 = (pT . u)/|pT|
tkU2 = ((vWPt.Px())*(vTkU.Py()) - (vWPt.Py())*(vTkU.Px()))/(genVPt); // u2 = (pT x u)/|pT|
TVector2 vMvaMet((info->mvaMET)*cos(info->mvaMETphi), (info->mvaMET)*sin(info->mvaMETphi));
TVector2 vMvaU = -1.0*(vMvaMet+vLepPt);
mvaU1 = ((vWPt.Px())*(vMvaU.Px()) + (vWPt.Py())*(vMvaU.Py()))/(genVPt); // u1 = (pT . u)/|pT|
mvaU2 = ((vWPt.Px())*(vMvaU.Py()) - (vWPt.Py())*(vMvaU.Px()))/(genVPt); // u2 = (pT x u)/|pT|
}
id_1 = gen->id_1;
id_2 = gen->id_2;
x_1 = gen->x_1;
x_2 = gen->x_2;
xPDF_1 = gen->xPDF_1;
xPDF_2 = gen->xPDF_2;
scalePDF = gen->scalePDF;
weightPDF = gen->weight;
delete gvec;
delete glep1;
delete glep2;
gvec=0; glep1=0; glep2=0;
}
scale1fb = weight;
示例4: selectZee
//.........这里部分代码省略.........
scalePDF = -999;
weightPDF = -999;
}
//
// Fill tree
//
runNum = info->runNum;
lumiSec = info->lumiSec;
evtNum = info->evtNum;
if (hasGenMatch) matchGen=1;
else matchGen=0;
category = icat;
npv = hasVer ? pvArr->GetEntriesFast() : 0;
npu = info->nPU;
scale1fb = weight;
met = info->pfMET;
metPhi = info->pfMETphi;
sumEt = 0;
tkMet = info->trkMET;
tkMetPhi = info->trkMETphi;
tkSumEt = 0;
lep1 = &vTag;
lep2 = &vProbe;
dilep = &vDilep;
q1 = tag->q;
q2 = (eleProbe) ? eleProbe->q : -(tag->q);
TVector2 vZPt((vDilep.Pt())*cos(vDilep.Phi()),(vDilep.Pt())*sin(vDilep.Phi()));
TVector2 vMet((info->pfMET)*cos(info->pfMETphi), (info->pfMET)*sin(info->pfMETphi));
TVector2 vU = -1.0*(vMet+vZPt);
u1 = ((vDilep.Px())*(vU.Px()) + (vDilep.Py())*(vU.Py()))/(vDilep.Pt()); // u1 = (pT . u)/|pT|
u2 = ((vDilep.Px())*(vU.Py()) - (vDilep.Py())*(vU.Px()))/(vDilep.Pt()); // u2 = (pT x u)/|pT|
TVector2 vTkMet((info->trkMET)*cos(info->trkMETphi), (info->trkMET)*sin(info->trkMETphi));
TVector2 vTkU = -1.0*(vTkMet+vZPt);
tkU1 = ((vDilep.Px())*(vTkU.Px()) + (vDilep.Py())*(vTkU.Py()))/(vDilep.Pt()); // u1 = (pT . u)/|pT|
tkU2 = ((vDilep.Px())*(vTkU.Py()) - (vDilep.Py())*(vTkU.Px()))/(vDilep.Pt()); // u2 = (pT x u)/|pT|
///// electron specific /////
sc1 = &vTagSC;
trkIso1 = tag->trkIso;
emIso1 = tag->ecalIso;
hadIso1 = tag->hcalIso;
pfChIso1 = tag->chHadIso;
pfGamIso1 = tag->gammaIso;
pfNeuIso1 = tag->neuHadIso;
pfCombIso1 = tag->chHadIso + TMath::Max(tag->neuHadIso + tag->gammaIso -
(info->rhoIso)*getEffArea(tag->scEta), 0.);
sigieie1 = tag->sieie;
hovere1 = tag->hovere;
eoverp1 = tag->eoverp;
fbrem1 = tag->fbrem;
dphi1 = tag->dPhiIn;
deta1 = tag->dEtaIn;
ecalE1 = tag->ecalEnergy;
d01 = tag->d0;
dz1 = tag->dz;
isConv1 = tag->isConv;
nexphits1 = tag->nMissingHits;
typeBits1 = tag->typeBits;
sc2 = &vProbeSC;
trkIso2 = (eleProbe) ? eleProbe->trkIso : -1;
示例5: selectZmm
//.........这里部分代码省略.........
evtNum = info->evtNum;
if (hasGenMatch) matchGen=1;
else matchGen=0;
category = icat;
vertexArr->Clear();
vertexBr->GetEntry(ientry);
npv = vertexArr->GetEntries();
npu = info->nPUmean;
genWeight= hasGen ? gen->weight: 1.;
PUWeight = puWeight;
scale1fb = weight;
scale1fbUp = weightUp;
scale1fbDown = weightDown;
met = info->pfMETC;
metPhi = info->pfMETCphi;
sumEt = 0;
tkMet = info->trkMET;
tkMetPhi = info->trkMETphi;
tkSumEt = 0;
mvaMet = info->mvaMET;
mvaMetPhi = info->mvaMETphi;
mvaSumEt = 0;
TVector2 vZPt((vDilep.Pt())*cos(vDilep.Phi()),(vDilep.Pt())*sin(vDilep.Phi()));
puppiMet = info->puppET;
puppiMetPhi = info->puppETphi;
puppiSumEt = 0;
lep1 = &vTag;
lep2 = &vProbe;
dilep = &vDilep;
sta1 = &vTagSta;
sta2 = &vProbeSta;
TVector2 vMet((info->pfMETC)*cos(info->pfMETCphi), (info->pfMETC)*sin(info->pfMETCphi));
TVector2 vU = -1.0*(vMet+vZPt);
u1 = ((vDilep.Px())*(vU.Px()) + (vDilep.Py())*(vU.Py()))/(vDilep.Pt()); // u1 = (pT . u)/|pT|
u2 = ((vDilep.Px())*(vU.Py()) - (vDilep.Py())*(vU.Px()))/(vDilep.Pt()); // u2 = (pT x u)/|pT|
TVector2 vTkMet((info->trkMET)*cos(info->trkMETphi), (info->trkMET)*sin(info->trkMETphi));
TVector2 vTkU = -1.0*(vTkMet+vZPt);
tkU1 = ((vDilep.Px())*(vTkU.Px()) + (vDilep.Py())*(vTkU.Py()))/(vDilep.Pt()); // u1 = (pT . u)/|pT|
tkU2 = ((vDilep.Px())*(vTkU.Py()) - (vDilep.Py())*(vTkU.Px()))/(vDilep.Pt()); // u2 = (pT x u)/|pT|
TVector2 vMvaMet((info->mvaMET)*cos(info->mvaMETphi), (info->mvaMET)*sin(info->mvaMETphi));
TVector2 vMvaU = -1.0*(vMvaMet+vZPt);
mvaU1 = ((vDilep.Px())*(vMvaU.Px()) + (vDilep.Py())*(vMvaU.Py()))/(vDilep.Pt()); // u1 = (pT . u)/|pT|
mvaU2 = ((vDilep.Px())*(vMvaU.Py()) - (vDilep.Py())*(vMvaU.Px()))/(vDilep.Pt()); // u2 = (pT x u)/|pT|
TVector2 vPuppiMet((info->puppET)*cos(info->puppETphi), (info->puppET)*sin(info->puppETphi));
TVector2 vPuppiU = -1.0*(vPuppiMet+vZPt);
puppiU1 = ((vDilep.Px())*(vPuppiU.Px()) + (vDilep.Py())*(vPuppiU.Py()))/(vDilep.Pt()); // u1 = (pT . u)/|pT|
puppiU2 = ((vDilep.Px())*(vPuppiU.Py()) - (vDilep.Py())*(vPuppiU.Px()))/(vDilep.Pt()); // u2 = (pT x u)/|pT|
outTree->Fill();
delete genV;
genV=0, dilep=0, lep1=0, lep2=0, sta1=0, sta2=0;
}
delete infile;
infile=0, eventTree=0;
cout << nsel << " +/- " << sqrt(nselvar);
if(!isData) cout << " per 1/fb";
cout << endl;
}
outFile->Write();
outFile->Close();
}
delete h_rw;
delete h_rw_up;
delete h_rw_down;
delete f_rw;
delete info;
delete gen;
delete genPartArr;
delete muonArr;
delete vertexArr;
//--------------------------------------------------------------------------------------------------------------
// Output
//==============================================================================================================
cout << "*" << endl;
cout << "* SUMMARY" << endl;
cout << "*--------------------------------------------------" << endl;
cout << " Z -> mu mu" << endl;
cout << " Mass window: [" << MASS_LOW << ", " << MASS_HIGH << "]" << endl;
cout << " pT > " << PT_CUT << endl;
cout << " |eta| < " << ETA_CUT << endl;
cout << endl;
cout << endl;
cout << " <> Output saved in " << outputDir << "/" << endl;
cout << endl;
gBenchmark->Show("selectZmm");
}
示例6: selectZee
//.........这里部分代码省略.........
lumiSec = info->lumiSec;
evtNum = info->evtNum;
if (hasGenMatch) matchGen=1;
else matchGen=0;
category = icat;
vertexArr->Clear();
vertexBr->GetEntry(ientry);
npv = vertexArr->GetEntries();
npu = info->nPUmean;
genWeight= hasGen ? gen->weight: 1.;
PUWeight = puWeight;
scale1fb = weight;
scale1fbUp = weightUp;
scale1fbDown = weightDown;
met = info->pfMETC;
metPhi = info->pfMETCphi;
sumEt = 0;
tkMet = info->trkMET;
tkMetPhi = info->trkMETphi;
tkSumEt = 0;
mvaMet = info->mvaMET;
mvaMetPhi = info->mvaMETphi;
mvaSumEt = 0;
TVector2 vZPt((vDilep.Pt())*cos(vDilep.Phi()),(vDilep.Pt())*sin(vDilep.Phi()));
puppiMet = info->puppET;
puppiMetPhi = info->puppETphi;
puppiSumEt = 0;
lep1 = &vTag;
lep2 = &vProbe;
dilep = &vDilep;
sc1 = &vTagSC;
sc2 = &vProbeSC;
TVector2 vMet((info->pfMETC)*cos(info->pfMETCphi), (info->pfMETC)*sin(info->pfMETCphi));
TVector2 vU = -1.0*(vMet+vZPt);
u1 = ((vDilep.Px())*(vU.Px()) + (vDilep.Py())*(vU.Py()))/(vDilep.Pt()); // u1 = (pT . u)/|pT|
u2 = ((vDilep.Px())*(vU.Py()) - (vDilep.Py())*(vU.Px()))/(vDilep.Pt()); // u2 = (pT x u)/|pT|
TVector2 vTkMet((info->trkMET)*cos(info->trkMETphi), (info->trkMET)*sin(info->trkMETphi));
TVector2 vTkU = -1.0*(vTkMet+vZPt);
tkU1 = ((vDilep.Px())*(vTkU.Px()) + (vDilep.Py())*(vTkU.Py()))/(vDilep.Pt()); // u1 = (pT . u)/|pT|
tkU2 = ((vDilep.Px())*(vTkU.Py()) - (vDilep.Py())*(vTkU.Px()))/(vDilep.Pt()); // u2 = (pT x u)/|pT|
TVector2 vMvaMet((info->mvaMET)*cos(info->mvaMETphi), (info->mvaMET)*sin(info->mvaMETphi));
TVector2 vMvaU = -1.0*(vMvaMet+vZPt);
mvaU1 = ((vDilep.Px())*(vMvaU.Px()) + (vDilep.Py())*(vMvaU.Py()))/(vDilep.Pt()); // u1 = (pT . u)/|pT|
mvaU2 = ((vDilep.Px())*(vMvaU.Py()) - (vDilep.Py())*(vMvaU.Px()))/(vDilep.Pt()); // u2 = (pT x u)/|pT|
TVector2 vPuppiMet((info->puppET)*cos(info->puppETphi), (info->puppET)*sin(info->puppETphi));
TVector2 vPuppiU = -1.0*(vPuppiMet+vZPt);
puppiU1 = ((vDilep.Px())*(vPuppiU.Px()) + (vDilep.Py())*(vPuppiU.Py()))/(vDilep.Pt()); // u1 = (pT . u)/|pT|
puppiU2 = ((vDilep.Px())*(vPuppiU.Py()) - (vDilep.Py())*(vPuppiU.Px()))/(vDilep.Pt()); // u2 = (pT x u)/|pT|
outTree->Fill();
delete genV;
genV=0, dilep=0, lep1=0, lep2=0, sc1=0, sc2=0;
}
delete infile;
infile=0, eventTree=0;
cout << nsel << " +/- " << sqrt(nselvar);
if(!isData) cout << " per 1/fb";
cout << endl;
}
outFile->Write();
outFile->Close();
}
delete h_rw;
delete f_rw;
delete info;
delete gen;
delete genPartArr;
delete electronArr;
delete scArr;
delete vertexArr;
//--------------------------------------------------------------------------------------------------------------
// Output
//==============================================================================================================
cout << "*" << endl;
cout << "* SUMMARY" << endl;
cout << "*--------------------------------------------------" << endl;
cout << " Z -> e e" << endl;
cout << " Mass window: [" << MASS_LOW << ", " << MASS_HIGH << "]" << endl;
cout << " pT > " << PT_CUT << endl;
cout << " |eta| < " << ETA_CUT << endl;
cout << endl;
cout << endl;
cout << " <> Output saved in " << outputDir << "/" << endl;
cout << endl;
gBenchmark->Show("selectZee");
}
示例7: smear_JetMET
void smear_JetMET(vector <TLorentzVector> & orig_jets, const TVector2 & orig_met, vector <TLorentzVector> & smear_jets, TVector2 & smear_met, TRandom3* rand3, vector <TF1*> vPtRes, vector <TF1*> vEtaRes, vector <TF1*> vPhiRes, TLorentzVector lep_sum){
smear_jets.clear();
double sum_jpx = 0;
double sum_jpy = 0;
double sum_jpx_sm = 0;
double sum_jpy_sm = 0;
double Pt_sm, Eta_sm, Phi_sm;
TLorentzVector v_temp;
// double a, b, c;
// double Et;
for (unsigned int sui = 0; sui < orig_jets.size(); sui++){
// a = 1.84; b = 1.14; c = 0.027;
// if (orig_jets.at(sui).Eta() < 1.4){
// a = 1.78; b = 1.3; c = 0.053;
// }
// Et = orig_jets.at(sui).Pt();
// Pt_sm = Et + sqrt(a*a + b*b*Et + c*c*Et*Et) * rand3->Gaus();
// Eta_sm = orig_jets.at(sui).Eta();
// Phi_sm = orig_jets.at(sui).Phi();
Long64_t iseed = (Long64_t) 10E10;
gRandom->SetSeed(rand3->Integer(iseed));
// Pt_sm = orig_jets.at(sui).Pt() * (1 + (vPtRes.at(sui)->GetRandom() - 1) * 1.1);
Pt_sm = orig_jets.at(sui).Pt() * vPtRes.at(sui)->GetRandom();
gRandom->SetSeed(rand3->Integer(iseed));
Eta_sm = orig_jets.at(sui).Eta() + vEtaRes.at(sui)->GetRandom();
gRandom->SetSeed(rand3->Integer(iseed));
Phi_sm = orig_jets.at(sui).Phi() + vPhiRes.at(sui)->GetRandom();
v_temp.SetPtEtaPhiM(Pt_sm, Eta_sm, Phi_sm, orig_jets.at(sui).M());
sum_jpx += orig_jets.at(sui).Px();
sum_jpy += orig_jets.at(sui).Py();
sum_jpx_sm += v_temp.Px();
sum_jpy_sm += v_temp.Py();
smear_jets.push_back(v_temp);
}
double unclust_metx = orig_met.Px() + sum_jpx + lep_sum.Px();
double unclust_mety = orig_met.Py() + sum_jpy + lep_sum.Py();
//10% resolution
double unclust_metx_sm = unclust_metx * (1 + 0.1*rand3->Gaus());
double unclust_mety_sm = unclust_mety * (1 + 0.1*rand3->Gaus());
smear_met.Set(orig_met.Px() + sum_jpx - unclust_metx - sum_jpx_sm + unclust_metx_sm, orig_met.Py() + sum_jpy - unclust_mety - sum_jpy_sm + unclust_mety_sm);
}
示例8: selectZee
//.........这里部分代码省略.........
if(match1 && match2) hasGenMatch = kTRUE;
};
//
// Fill tree
//
runNum = info->runNum;
lumiSec = info->lumiSec;
evtNum = info->evtNum;
matchGen = hasGenMatch ? 1 : 0;
category = icat;
npv = pvArr->GetEntriesFast();
npu = info->nPU;
genVPt = (hasGen) ? gen->vpt : 0;
genVPhi = (hasGen) ? gen->vphi : 0;
genVy = (hasGen) ? gen->vy : 0;
genVMass = (hasGen) ? gen->vmass : 0;
scale1fb = weight;
met = info->pfMET;
metPhi = info->pfMETphi;
sumEt = info->pfSumET;
lep1 = &vTag;
q1 = tag->q;
lep2 = &vProbe;
q2 = (eleProbe) ? eleProbe->q : -(tag->q);
dilep = &vDilep;
TVector2 vZPt((vDilep.Pt())*cos(vDilep.Phi()),(vDilep.Pt())*sin(vDilep.Phi()));
TVector2 vMet((info->pfMET)*cos(info->pfMETphi), (info->pfMET)*sin(info->pfMETphi));
TVector2 vU = -1.0*(vMet+vZPt);
u1 = ((vDilep.Px())*(vU.Px()) + (vDilep.Py())*(vU.Py()))/(vDilep.Pt()); // u1 = (pT . u)/|pT|
u2 = ((vDilep.Px())*(vU.Py()) - (vDilep.Py())*(vU.Px()))/(vDilep.Pt()); // u2 = (pT x u)/|pT|
///// electron specific /////
sc1 = &vTagSC;
trkIso1 = tag->trkIso03;
emIso1 = tag->emIso03;
hadIso1 = tag->hadIso03;
pfChIso1 = tag->pfChIso03;
pfGamIso1 = tag->pfGamIso03;
pfNeuIso1 = tag->pfNeuIso03;
pfCombIso1 = tag->pfChIso03 + TMath::Max(tag->pfNeuIso03 + tag->pfGamIso03 - (info->rhoLowEta)*getEffArea(tag->scEta), 0.);
sigieie1 = tag->sigiEtaiEta;
hovere1 = tag->HoverE;
eoverp1 = tag->EoverP;
fbrem1 = tag->fBrem;
dphi1 = tag->deltaPhiIn;
deta1 = tag->deltaEtaIn;
ecalE1 = tag->ecalE;
d01 = tag->d0;
dz1 = tag->dz;
isConv1 = tag->isConv;
nexphits1 = tag->nExpHitsInner;
typeBits1 = tag->typeBits;
sc2 = &vProbeSC;
trkIso2 = (eleProbe) ? eleProbe->trkIso03 : -1;
emIso2 = (eleProbe) ? eleProbe->emIso03 : -1;
hadIso2 = (eleProbe) ? eleProbe->hadIso03 : -1;
pfChIso2 = (eleProbe) ? eleProbe->pfChIso03 : -1;
pfGamIso2 = (eleProbe) ? eleProbe->pfGamIso03 : -1;
pfNeuIso2 = (eleProbe) ? eleProbe->pfNeuIso03 : -1;