本文整理汇总了C++中JetPointer::hadronFlavour方法的典型用法代码示例。如果您正苦于以下问题:C++ JetPointer::hadronFlavour方法的具体用法?C++ JetPointer::hadronFlavour怎么用?C++ JetPointer::hadronFlavour使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JetPointer
的用法示例。
在下文中一共展示了JetPointer::hadronFlavour方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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);
}
}