本文整理汇总了C++中EventPtr::getSignalLepton方法的典型用法代码示例。如果您正苦于以下问题:C++ EventPtr::getSignalLepton方法的具体用法?C++ EventPtr::getSignalLepton怎么用?C++ EventPtr::getSignalLepton使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EventPtr
的用法示例。
在下文中一共展示了EventPtr::getSignalLepton方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fillCommonTreesNoBSelection
void TTbar_plus_X_analyser::fillCommonTreesNoBSelection(const EventPtr event, const unsigned int selectionCriteria, std::string folder ) {
SelectionCriteria::selection selection = SelectionCriteria::selection(selectionCriteria);
// Jets
const JetCollection jets(event->CleanedJets());
// B Jets
const JetCollection bJets(event->CleanedBJets());
// Lepton
const LeptonPointer signalLepton = event->getSignalLepton( selection );
treeMan_->setCurrentFolder(folder);
treeMan_->Fill("EventWeight", event->weight());
treeMan_->Fill("PUWeight", event->PileUpWeight());
treeMan_->Fill("PUWeight_up", event->PileUpWeight(1));
treeMan_->Fill("PUWeight_down", event->PileUpWeight(-1));
treeMan_->Fill("NJets",Event::NJets(jets));
treeMan_->Fill("NBJets",Event::NJets(bJets));
treeMan_->Fill("NVertices", event->Vertices().size());
treeMan_->Fill("BJetWeight",event->BJetWeight());
treeMan_->Fill("BJetUpWeight",event->BJetUpWeight());
treeMan_->Fill("BJetDownWeight",event->BJetDownWeight());
treeMan_->Fill("LightJetUpWeight",event->LightJetUpWeight());
treeMan_->Fill("LightJetDownWeight",event->LightJetDownWeight());
if (selection == SelectionCriteria::selection(SelectionCriteria::ElectronPlusJetsReference)){
treeMan_->Fill("lepton_isolation", signalLepton->PFRelIso03DeltaBeta());
}
else if (selection == SelectionCriteria::selection(SelectionCriteria::MuonPlusJetsReference)){
treeMan_->Fill("lepton_isolation", signalLepton->PFRelIso04DeltaBeta());
}
fillLeptonEfficiencyCorrectionBranches( event, selectionCriteria, signalLepton );
}
示例2: fillCommonTreesNoBSelection
void TTbar_plus_X_analyser::fillCommonTreesNoBSelection(const EventPtr event, const unsigned int selectionCriteria, std::string folder ) {
SelectionCriteria::selection selection = SelectionCriteria::selection(selectionCriteria);
// Jets
const JetCollection jets(event->CleanedJets());
// B Jets
const JetCollection bJets(event->CleanedBJets());
// Lepton
const LeptonPointer signalLepton = event->getSignalLepton( selection );
// MET
const METPointer MET_original(event->MET((METAlgorithm::value) 0));
treeMan_->setCurrentFolder(folder);
treeMan_->Fill("EventWeight", event->weight());
treeMan_->Fill("PUWeight", event->PileUpWeight());
treeMan_->Fill("PUWeight_up", event->PileUpWeight(1));
treeMan_->Fill("PUWeight_down", event->PileUpWeight(-1));
treeMan_->Fill("M3",Event::M3(jets));
if ( Event::NJets(bJets) > 0 ) {
treeMan_->Fill("M_bl",Event::M_bl(bJets, signalLepton));
treeMan_->Fill("angle_bl",Event::angle_bl(bJets, signalLepton));
}
treeMan_->Fill("HT",Event::HT(jets));
treeMan_->Fill("MET",MET_original->et());
treeMan_->Fill("MET_phi",MET_original->phi());
treeMan_->Fill("ST",Event::ST(jets, signalLepton, MET_original));
treeMan_->Fill("WPT",Event::WPT(signalLepton, MET_original));
treeMan_->Fill("MT",Event::MT(signalLepton, MET_original));
treeMan_->Fill("NJets",Event::NJets(jets));
treeMan_->Fill("NBJets",Event::NJets(bJets));
treeMan_->Fill("NVertices", event->Vertices().size());
treeMan_->Fill("BJetWeight",event->BJetWeight());
treeMan_->Fill("BJetEfficiencyCorrectionWeight",event->BJetEfficiencyCorrectionWeight());
treeMan_->Fill("BJetAlternativeWeight",event->BJetAlternativeWeight());
treeMan_->Fill("BJetUpWeight",event->BJetUpWeight());
treeMan_->Fill("BJetDownWeight",event->BJetDownWeight());
treeMan_->Fill("LightJetUpWeight",event->LightJetUpWeight());
treeMan_->Fill("LightJetDownWeight",event->LightJetDownWeight());
if (selection == SelectionCriteria::selection(SelectionCriteria::ElectronPlusJetsReference)){
treeMan_->Fill("lepton_isolation", signalLepton->PFRelIso03DeltaBeta());
}
else if (selection == SelectionCriteria::selection(SelectionCriteria::MuonPlusJetsReference)){
treeMan_->Fill("lepton_isolation", signalLepton->PFRelIso04DeltaBeta());
}
for (unsigned int index = 0; index < jets.size(); ++index) {
treeMan_->Fill("jet_csv", jets.at(index)->getBTagDiscriminator(BtagAlgorithm::CombinedSecondaryVertexV2) );
}
fillLeptonEfficiencyCorrectionBranches( event, selectionCriteria, signalLepton );
}
示例3: fillCommonTrees
void TTbar_plus_X_analyser::fillCommonTrees(const EventPtr event, const unsigned int selectionCriteria, std::string folder ) {
SelectionCriteria::selection selection = SelectionCriteria::selection(selectionCriteria);
// Jets
const JetCollection jets(event->CleanedJets());
// B Jets
unsigned int numberOfBjets = event->getNBJets( selection );
const JetCollection bJets(event->CleanedBJets());
// Lepton
const LeptonPointer signalLepton = event->getSignalLepton( selection );
// MET
const METPointer MET_original(event->MET((METAlgorithm::value) 0));
treeMan_->setCurrentFolder(folder);
treeMan_->Fill("EventWeight", event->weight());
treeMan_->Fill("PUWeight", event->PileUpWeight());
treeMan_->Fill("PUWeight_up", event->PileUpWeight(1));
treeMan_->Fill("PUWeight_down", event->PileUpWeight(-1));
treeMan_->Fill("lepton_eta",signalLepton->eta());
treeMan_->Fill("lepton_pt",signalLepton->pt());
treeMan_->Fill("lepton_charge",signalLepton->charge());
if (selection == SelectionCriteria::selection(SelectionCriteria::ElectronPlusJetsReference) ||
selection == SelectionCriteria::selection(SelectionCriteria::ElectronPlusJetsQCDNonIsolated) ||
selection == SelectionCriteria::selection(SelectionCriteria::ElectronPlusJetsQCDConversion)){
treeMan_->Fill("lepton_isolation", signalLepton->PFRelIsoWithEA());
treeMan_->Fill("lepton_hltECALisolation", signalLepton->hltECALIso());
treeMan_->Fill("lepton_hltHCALisolation", signalLepton->hltHCALIso());
treeMan_->Fill("lepton_hltTrackerisolation", signalLepton->hltTrackerIso());
if ( signalLepton->pt() > 0 ) {
treeMan_->Fill("lepton_hltTrackerisolation_overPt", signalLepton->hltTrackerIso() / signalLepton->pt() );
}
}
else if (selection == SelectionCriteria::selection(SelectionCriteria::MuonPlusJetsReference) ||
selection == SelectionCriteria::selection(SelectionCriteria::MuonPlusJetsQCDNonIsolated1p5to3) ||
selection == SelectionCriteria::selection(SelectionCriteria::MuonPlusJetsQCDNonIsolated3toInf)){
treeMan_->Fill("lepton_isolation", signalLepton->PFRelIso04DeltaBeta());
}
treeMan_->Fill("M3",Event::M3(jets));
if ( numberOfBjets > 0 ) {
treeMan_->Fill("M_bl",Event::M_bl(bJets, signalLepton));
treeMan_->Fill("angle_bl",Event::angle_bl(bJets, signalLepton));
// if ( numberOfBjets >= 2 ) {
// unsigned int highestCSVJetIndex = 0;
// unsigned int secondHighestCSVJetIndex = 0;
// Event::getTopTwoCSVJets( bJets, highestCSVJetIndex, secondHighestCSVJetIndex );
// JetPointer highestCSVJet(bJets.at(highestCSVJetIndex));
// JetPointer secondHighestCSVJet(bJets.at(secondHighestCSVJetIndex));
// treeMan_->Fill("deltaPhi_bb", fabs( Event::deltaPhi_bb(highestCSVJet, secondHighestCSVJet) ) ) ;
// treeMan_->Fill("deltaEta_bb", fabs( Event::deltaEta_bb(highestCSVJet, secondHighestCSVJet) ) ) ;
// treeMan_->Fill("angle_bb", Event::angle_bb(highestCSVJet, secondHighestCSVJet));
// }
}
for (unsigned int index = 0; index < jets.size(); ++index) {
treeMan_->Fill("jet_pt", jets.at(index)->pt() );
treeMan_->Fill("jet_eta", jets.at(index)->eta() );
treeMan_->Fill("jet_csv", jets.at(index)->getBTagDiscriminator(BtagAlgorithm::CombinedSecondaryVertexV2) );
}
treeMan_->Fill("HT",Event::HT(jets));
treeMan_->Fill("MET",MET_original->et());
treeMan_->Fill("MET_phi",MET_original->phi());
treeMan_->Fill("ST",Event::ST(jets, signalLepton, MET_original));
treeMan_->Fill("WPT",Event::WPT(signalLepton, MET_original));
treeMan_->Fill("MT",Event::MT(signalLepton, MET_original));
treeMan_->Fill("NJets",Event::NJets(jets));
treeMan_->Fill("NBJets",Event::NJets(bJets));
treeMan_->Fill("NVertices", event->Vertices().size());
treeMan_->Fill("BJetWeight",event->BJetWeight());
treeMan_->Fill("BJetEfficiencyCorrectionWeight",event->BJetEfficiencyCorrectionWeight());
treeMan_->Fill("BJetAlternativeWeight",event->BJetAlternativeWeight());
treeMan_->Fill("BJetUpWeight",event->BJetUpWeight());
treeMan_->Fill("BJetDownWeight",event->BJetDownWeight());
treeMan_->Fill("LightJetUpWeight",event->LightJetUpWeight());
treeMan_->Fill("LightJetDownWeight",event->LightJetDownWeight());
treeMan_->Fill("tau1", event->getTau1());
treeMan_->Fill("tau2", event->getTau2());
treeMan_->Fill("tau3", event->getTau3());
treeMan_->Fill("tau4", event->getTau4());
treeMan_->Fill("tau5", event->getTau5());
treeMan_->Fill("tau6", event->getTau6());
// MET Uncertainties
for ( unsigned int unc_i = 0; unc_i < MET_original->getAllMETUncertainties().size(); ++unc_i ) {
METPointer METForUnc_i = MET_original->getMETForUncertainty( unc_i );
treeMan_->Fill("MET_METUncertainties",METForUnc_i->et());
treeMan_->Fill("ST_METUncertainties",Event::ST(jets, signalLepton, METForUnc_i));
treeMan_->Fill("WPT_METUncertainties",Event::WPT(signalLepton, METForUnc_i));
}
double topPtWeight = 1.;
if ( ( event->isSemiLeptonicElectron() || event->isSemiLeptonicMuon() ) ) {
//.........这里部分代码省略.........
示例4: analyse
void BTagEff::analyse(const EventPtr event) {
treeMan_->setCurrentFolder(histogramFolder_);
int NJets = 0;
int NBJets = 0; // How many medium b jets
const JetCollection cleanedJets = event->CleanedJets();
int selectionCriteria = -1;
if ( event->PassesElectronTriggerAndSelectionNoB() ) selectionCriteria = SelectionCriteria::ElectronPlusJetsReference;
else if ( event->PassesMuonTriggerAndSelectionNoB() ) selectionCriteria = SelectionCriteria::MuonPlusJetsReference;
const LeptonPointer signalLepton = event->getSignalLepton( selectionCriteria );
// unsigned int nParton = 0;
for (unsigned int jetIndex = 0; jetIndex < cleanedJets.size(); ++jetIndex) {
const JetPointer jet(cleanedJets.at(jetIndex));
bool isLoose = false;
bool isMedium = false;
bool isTight = false;
double jetPt = jet->pt();
double jetEta = jet->eta();
if (jetPt < 25 || fabs(jetEta) > 2.4) continue;
double jetCSV = jet->getBTagDiscriminator(BAT::BtagAlgorithm::value::CombinedSecondaryVertexV2);
// https://twiki.cern.ch/twiki/bin/viewauth/CMS/BtagRecommendation76X
if (jetCSV > 0.460) {
isLoose = true;
}
if (jetCSV > 0.800) {
isMedium = true;
++NBJets;
}
if (jetCSV > 0.935) {
isTight = true;
}
unsigned int partonFlavour = abs(jet->partonFlavour());
unsigned int hadronFlavour = abs(jet->hadronFlavour());
treeMan_->Fill("pt", jetPt);
treeMan_->Fill("eta", jetEta);
treeMan_->Fill("CSV", jetCSV);
treeMan_->Fill("partonFlavour", partonFlavour);
treeMan_->Fill("hadronFlavour", hadronFlavour);
treeMan_->Fill("isLoose", isLoose);
treeMan_->Fill("isMedium", isMedium);
treeMan_->Fill("isTight", isTight);
++NJets;
}
treeMan_->Fill("NJets", NJets);
treeMan_->Fill("NBJets", NBJets);
treeMan_->Fill("EventWeight", event->weight());
treeMan_->Fill("PUWeight", event->PileUpWeight());
if ( selectionCriteria == SelectionCriteria::ElectronPlusJetsReference ) {
double electronEfficiencyCorrection = 1;
if ( !event->isRealData() ) {
const ElectronPointer signalElectron(boost::static_pointer_cast<Electron>(signalLepton));
electronEfficiencyCorrection = signalElectron->getEfficiencyCorrection( 0 );
}
treeMan_->Fill("ElectronEfficiencyCorrection",electronEfficiencyCorrection);
}
else if ( selectionCriteria == SelectionCriteria::MuonPlusJetsReference ) {
double muonEfficiencyCorrection = 1;
if ( !event->isRealData() ) {
const MuonPointer signalMuon(boost::static_pointer_cast<Muon>(signalLepton));
muonEfficiencyCorrection = signalMuon->getEfficiencyCorrection( 0 );
}
treeMan_->Fill("MuonEfficiencyCorrection",muonEfficiencyCorrection);
}
}
示例5: fillCommonTrees
void TTbar_plus_X_analyser::fillCommonTrees(const EventPtr event, const unsigned int selectionCriteria, std::string folder ) {
SelectionCriteria::selection selection = SelectionCriteria::selection(selectionCriteria);
// Jets
const JetCollection jets(event->CleanedJets());
// B Jets
unsigned int numberOfBjets = event->getNBJets( selection );
const JetCollection bJets(event->CleanedBJets());
// Lepton
const LeptonPointer signalLepton = event->getSignalLepton( selection );
// MET
const METPointer MET_original(event->MET((METAlgorithm::value) 0));
treeMan_->setCurrentFolder(folder);
treeMan_->Fill("EventWeight", event->weight());
treeMan_->Fill("PUWeight", event->PileUpWeight());
treeMan_->Fill("PUWeight_up", event->PileUpWeight(1));
treeMan_->Fill("PUWeight_down", event->PileUpWeight(-1));
treeMan_->Fill("lepton_eta",signalLepton->eta());
treeMan_->Fill("lepton_pt",signalLepton->pt());
treeMan_->Fill("lepton_charge",signalLepton->charge());
if (selection == SelectionCriteria::selection(SelectionCriteria::ElectronPlusJetsReference) ||
selection == SelectionCriteria::selection(SelectionCriteria::ElectronPlusJetsQCDNonIsolated) ||
selection == SelectionCriteria::selection(SelectionCriteria::ElectronPlusJetsQCDConversion)){
treeMan_->Fill("lepton_isolation", signalLepton->PFRelIsoWithEA());
}
else if (selection == SelectionCriteria::selection(SelectionCriteria::MuonPlusJetsReference) ||
selection == SelectionCriteria::selection(SelectionCriteria::MuonPlusJetsQCDNonIsolated1p5to3) ||
selection == SelectionCriteria::selection(SelectionCriteria::MuonPlusJetsQCDNonIsolated3toInf)){
treeMan_->Fill("lepton_isolation", signalLepton->PFRelIso04DeltaBeta());
}
treeMan_->Fill("M3",Event::M3(jets));
if ( numberOfBjets > 0 ) {
treeMan_->Fill("M_bl",Event::M_bl(bJets, signalLepton));
treeMan_->Fill("angle_bl",Event::angle_bl(bJets, signalLepton));
}
for (unsigned int index = 0; index < jets.size(); ++index) {
treeMan_->Fill("jet_pt", jets.at(index)->pt() );
treeMan_->Fill("jet_eta", jets.at(index)->eta() );
}
treeMan_->Fill("HT",Event::HT(jets));
treeMan_->Fill("MET",MET_original->et());
treeMan_->Fill("ST",Event::ST(jets, signalLepton, MET_original));
treeMan_->Fill("WPT",Event::WPT(signalLepton, MET_original));
treeMan_->Fill("MT",Event::MT(signalLepton, MET_original));
treeMan_->Fill("NJets",Event::NJets(jets));
treeMan_->Fill("NBJets",Event::NJets(bJets));
treeMan_->Fill("NVertices", event->Vertices().size());
treeMan_->Fill("BJetWeight",event->BJetWeight());
treeMan_->Fill("BJetUpWeight",event->BJetUpWeight());
treeMan_->Fill("BJetDownWeight",event->BJetDownWeight());
treeMan_->Fill("LightJetUpWeight",event->LightJetUpWeight());
treeMan_->Fill("LightJetDownWeight",event->LightJetDownWeight());
// MET Uncertainties
for ( unsigned int unc_i = 0; unc_i < MET_original->getAllMETUncertainties().size(); ++unc_i ) {
METPointer METForUnc_i = MET_original->getMETForUncertainty( unc_i );
treeMan_->Fill("MET_METUncertainties",METForUnc_i->et());
treeMan_->Fill("ST_METUncertainties",Event::ST(jets, signalLepton, METForUnc_i));
treeMan_->Fill("WPT_METUncertainties",Event::WPT(signalLepton, METForUnc_i));
}
fillLeptonEfficiencyCorrectionBranches( event, selectionCriteria, signalLepton );
}
示例6: analyse
void JetAnalyser::analyse(const EventPtr event) {
histMan_->setCurrentHistogramFolder(histogramFolder_);
treeMan_->setCurrentFolder(histogramFolder_);
weight_ = event->weight() * prescale_ * scale_;
// const JetCollection jets = event->Jets();
const JetCollection jets(event->CleanedJets());
const JetCollection bjets(event->CleanedBJets());
unsigned int numberOfBJets = event->NJets(bjets);
unsigned int numberOfJets = event->NJets(jets);
treeMan_->Fill("NJets", numberOfJets);
treeMan_->Fill("NBJets", numberOfBJets);
for (unsigned int index = 0; index < jets.size(); ++index) {
const JetPointer jet(jets.at(index));
if (jet->pt() < 25 ) continue;
if (index < 5) {
stringstream temp;
temp << "jet" << (index + 1);
string nthJet = temp.str();
treeMan_->Fill( nthJet + "_pt", jet->pt());
treeMan_->Fill( nthJet + "_eta", jet->eta());
treeMan_->Fill( nthJet + "_phi", jet->phi());
}
treeMan_->Fill("pt", jet->pt());
treeMan_->Fill("eta", jet->eta());
treeMan_->Fill("phi", jet->phi());
}
for (unsigned int index = 0; index < bjets.size(); ++index) {
const JetPointer bJet(bjets.at(index));
if ( bJet->pt() < 25 ) continue;
treeMan_->Fill("bjet_pt", bJet->pt());
treeMan_->Fill("bjet_eta", bJet->eta());
treeMan_->Fill("bjet_phi", bJet->phi());
}
// if ( numberOfJets < 4 ) {
// cout << "Fewer than 4 good cleaned jets with pt > 25 GeV : " << numberOfJets << endl;
// cout << numberOfJets << " " << numberOfBJets << endl;
// }
treeMan_->Fill("EventWeight", weight_ );
if ( event->PassesMuonTriggerAndSelection() ) {
const LeptonPointer signalLepton = event->getSignalLepton( SelectionCriteria::MuonPlusJetsReference );
const MuonPointer signalMuon(boost::static_pointer_cast<Muon>(signalLepton));
double efficiencyCorrection = event->isRealData() ? 1. : signalMuon->getEfficiencyCorrection( 0 );
treeMan_->Fill("MuonEfficiencyCorrection", efficiencyCorrection);
}
else if ( event->PassesElectronTriggerAndSelection() ) {
const LeptonPointer signalLepton = event->getSignalLepton( SelectionCriteria::ElectronPlusJetsReference );
const ElectronPointer signalElectron(boost::static_pointer_cast<Electron>(signalLepton));
double efficiencyCorrection = event->isRealData() ? 1. : signalElectron->getEfficiencyCorrection( 0 );
treeMan_->Fill("ElectronEfficiencyCorrection", efficiencyCorrection);
}
}