本文整理汇总了C++中Jet::ShiftPtWithJESCorr方法的典型用法代码示例。如果您正苦于以下问题:C++ Jet::ShiftPtWithJESCorr方法的具体用法?C++ Jet::ShiftPtWithJESCorr怎么用?C++ Jet::ShiftPtWithJESCorr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Jet
的用法示例。
在下文中一共展示了Jet::ShiftPtWithJESCorr方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FillBranches
void JESBDTVars::FillBranches(EventContainer * evtObj){
//Evaluate each distribution once per JES shift
for (int i = 0; i < evtObj->jets[0].GetNumberOfJESCorrections(); i++){
//First let's clear the things we already have
selectedJet.clear();
Jet2040.clear();
BJet.clear();
UntaggedJet.clear();
//And make a dummy variable here
Jet tempJet;
TLorentzVector tempjet(0,0,0,0);
//Number of loose jets
for (auto jet : evtObj->alljets){
tempJet = jet;
TLorentzVector tempmet(0,0,0,0);
tempJet.ShiftPtWithJESCorr(i,&tempmet);
if (tempJet.Pt() > 20 && tempJet.Pt() < 40) Jet2040.push_back(tempJet);
}
for (auto jet : evtObj->jesShiftedJets[i]){
selectedJet.push_back(jet);
if (jet.IsTagged()) BJet.push_back(jet);
else UntaggedJet.push_back(jet);
}
//Now set up the lepton and met variables
TLorentzVector Lepton(00,0,0,0);
TLorentzVector Miss(00,0,0,0);
TLorentzVector Wlv(0,0,0,0);
Miss = evtObj->metVecsJESShifted[i];
if (evtObj->electronsToUsePtr->size() > 0){ // if this number is >0 we're in the electron channel. Otherwise use muons
Lepton.SetPtEtaPhiE(evtObj->electronsToUsePtr->at(0).Pt(),evtObj->electronsToUsePtr->at(0).Eta(),evtObj->electronsToUsePtr->at(0).Phi(),evtObj->electronsToUsePtr->at(0).E());
}
else{
Lepton.SetPtEtaPhiE(evtObj->muonsToUsePtr->at(0).Pt(),evtObj->muonsToUsePtr->at(0).Eta(),evtObj->muonsToUsePtr->at(0).Phi(),evtObj->muonsToUsePtr->at(0).E());
}
Wlv = Lepton+Miss;
TLorentzVector W(0,0,0,0), Top(0,0,0,0);
for (auto jet : UntaggedJet){
W = W + jet;
}
TLorentzVector totalJets(0,0,0,0);
for (auto jet : selectedJet){
totalJets += jet;
}
//That should be all of the things we need to make the BDT variables, so let's make the variables now.
_floatVecVars["M_DeltaRBJetLepton_JESShifts"][i] = fabs(BJet[0].DeltaR(Lepton));
if (UntaggedJet.size() > 1) _floatVecVars["M_DeltaRlightjets_JESShifts"][i] = UntaggedJet.at(0).DeltaR(UntaggedJet.at(1));
if (BJet[0].DeltaR(Lepton) > BJet[0].DeltaR(W)){
_floatVecVars["M_topMass2_lep_JESShifts"][i] = -1;
}
else{
Top = W + BJet[0];
_floatVecVars["M_topMass2_lep_JESShifts"][i] = Top.M();
}
_floatVecVars["M_Pt_Lepton_JESShifts"][i] = Lepton.Pt();
_floatVecVars["M_Pt_AllJetsLeptonMET_JESShifts"][i] = (Lepton + Miss + totalJets).Pt();
_floatVecVars["M_DeltaRLeptonJet1_JESShifts"][i] = fabs(selectedJet.at(0).DeltaR(Lepton));
if (selectedJet.size() > 2) _floatVecVars["M_Mass_Jet1Jet2Jet3LeptonMET_JESShifts"][i] = (selectedJet[0] + selectedJet[1] + selectedJet[2]).M();
_floatVecVars["M_hadronicWmass_JESShifts"][i] = W.M();
_floatVecVars["lightJet1CSV_JESShifts"][i] = UntaggedJet[0].GetbDiscriminator();
}
}