26 #include "GaudiKernel/SystemOfUnits.h"
31 #include "TEfficiency.h"
42 m_histogramsCreated(false),
43 m_jetBtagKey(this,
"JetBtagKey", m_jetName.
key()+
".btaggingLink"),
106 if (!
sc.isSuccess())
139 if (!
sc.isSuccess()) {
170 return StatusCode::SUCCESS;
184 return StatusCode::SUCCESS;
197 ATH_MSG_INFO(
"Cosmic-ray data, not booking histograms");
198 return StatusCode::SUCCESS;
541 return StatusCode::SUCCESS;
553 return StatusCode::SUCCESS;
556 return StatusCode::SUCCESS;
561 if (!thisEventInfo.isValid()) {
563 return StatusCode::FAILURE;
589 return StatusCode::SUCCESS;
619 for (
auto & trig : chainGroup->getListOfTriggers()) {
662 unsigned int npv = 0, npv_trk = 0;
663 double xpv = 0., ypv = 0., zpv = 0.;
666 if (!vxContainer.isValid()) {
668 return StatusCode::SUCCESS;
673 npv = vxContainer->size();
676 if (vxContainer->size() < 2) {
678 return StatusCode::SUCCESS;
683 bool foundVxTypePriVtx =
false;
688 foundVxTypePriVtx =
true;
692 if ( ! foundVxTypePriVtx ) {
693 ATH_MSG_WARNING(
"xAOD::Vertex of type xAOD::VxType::PriVtx was not found in vertex container.");
694 return StatusCode::SUCCESS;
708 ATH_MSG_DEBUG(
"primary vertex: x = " << xpv <<
", y = " << ypv <<
", z = " << zpv);
710 if (xpv == 0 && ypv == 0 && zpv == 0)
720 return StatusCode::SUCCESS;
736 return StatusCode::SUCCESS;
742 return StatusCode::SUCCESS;
758 if (!trackParticles.isValid()) {
760 return StatusCode::SUCCESS;
776 for ( ; trackParticleItr != trackParticleEnd; ++trackParticleItr) {
793 return StatusCode::SUCCESS;
833 unsigned int nTrk = 0;
843 bool isSuspectJet =
false;
845 std::vector<const xAOD::IParticle*>::const_iterator trkItr;
847 for ( trkItr = trackVector.begin(); trkItr != trackVector.end() ; ++trkItr ) {
850 if ( ! trackPart )
continue;
852 double trk_eta = trackPart->
eta();
853 double trk_phi = trackPart->
phi();
858 std::bitset<17> failedCuts;
865 const std::bitset<17> passedCuts = ~failedCuts;
906 if (!muons.isValid()) {
918 int n_isoElectrons = 0;
919 for ( ; electronItr != electronEnd; ++electronItr) {
925 if (!inAcceptance)
continue;
927 bool lhmedium =
false;
928 (*electronItr)->passSelection(lhmedium,
"LHMedium");
929 if (!lhmedium)
continue;
931 float topoetcone20_value = -999.;
932 float ptvarcone20_value = -999.;
937 isoElectronItr = electronItr;
941 ATH_MSG_DEBUG(
"Number of isolated electrons is \"" << n_isoElectrons);
946 for ( ; muonItr != muonEnd; ++muonItr) {
950 if (!inAcceptance)
continue;
955 if ((*muonItr)->quality() > 1)
continue;
956 float topoetcone20_value = -999.;
957 float ptvarcone30_value = -999.;
965 if ((*muonItr)->quality() != 1)
continue;
966 float topoetcone20_value = -999.;
967 float ptvarcone20_value = -999.;
973 isoMuonItr = muonItr;
977 ATH_MSG_DEBUG(
"Number of isolated muons is \"" << n_isoMuons);
982 if (n_isoElectrons != 1)
return false;
983 if (n_isoMuons != 1)
return false;
984 if ((*isoElectronItr)->charge()*(*isoMuonItr)->charge() != -1.)
return false;
992 if ( TEfficiency::CheckConsistency(*h_passed, *h_all) ) {
994 TEfficiency *
eff =
new TEfficiency(*h_passed, *h_all);
995 eff->SetStatisticOption(TEfficiency::kBJeffrey);
997 for (
int i = 1;
i <= h_all->GetNbinsX(); ++
i) {
1076 return StatusCode::SUCCESS;
1089 if (!
jets.isValid()) {
1104 int n_jets_kinematic = 0;
1108 for ( ; jetItr != jetEnd; ++jetItr) {
1144 if (n_jets_kinematic == 0) firstKinematicjetItr = jetItr;
1152 if (is_top_event && n_jets_kinematic >= 2) {
1155 if (n_jets_kinematic == 2) {
1162 if (is_top_event && n_jets_kinematic >= 2) {
1164 if (n_jets_kinematic == 2) {
1182 if ( taggabilityLabel ==
goodJet ) {
1198 else if ( taggabilityLabel ==
badJet ) {
1217 std::vector<const xAOD::IParticle*>::const_iterator trkItr;
1219 nTrkInJet = trackVector.size();
1223 for ( trkItr = trackVector.begin(); trkItr != trackVector.end() ; ++trkItr ) {
1226 if ( ! trackPart )
continue;
1262 ATH_MSG_DEBUG(
"btagging weights: " <<
"SV1IP3D: " << sv1ip3d <<
", MV: " << mv);
1264 if (fill_top_histos) {
1298 ATH_MSG_WARNING(
"btag pointer is null in JetTagMonitoring::fillDetailedHistograms; filling these histograms will be skipped");
1302 unsigned int ntrk = 0;
1308 if ( taggabilityLabel ==
goodJet ) {
1324 <<
", Pu = " <<
pu<<
", Pc = " <<
pc <<
", llr = " << llr);
1332 if ( taggabilityLabel ==
goodJet ) {
1348 <<
", Pu = " <<
pu<<
", Pc = " <<
pc <<
", llr = " << llr);
1359 if ( taggabilityLabel ==
goodJet ) {
1372 ATH_MSG_VERBOSE(
"InfoBase for SV1: Pb = " <<
pb <<
", Pu = " <<
pu<<
", Pc = " <<
pc<<
", llr = " << llr);
1375 if ( taggabilityLabel ==
goodJet ) {
1385 if ( taggabilityLabel ==
goodJet ) {
1442 ATH_MSG_WARNING(
"btag pointer is null in JetTagMonitoring::fillGoodJetHistos; filling these histograms will be skipped");
1520 bool pass_cuts =
false;
1526 std::vector<float> SumPtTrkPt1000;
1528 float chf = SumPtTrkPt1000.size() > 0 ? SumPtTrkPt1000.at(0)/
jet->pt() : -1;
1537 (emf>0.95 && fabs(jetQuality)>0.8 && fabs(
jet->eta()) < 2.8) ||
1539 (fabs(jetTime)>25) ||
1540 (emf<0.05 && chf<0.05 && fabs(
jet->eta())<2) ||
1541 (emf<0.05 && fabs(
jet->eta())>= 2) ||
1542 (fracSamplingMax>0.99 && fabs(
jet->eta())<2)
1559 ATH_MSG_WARNING(
"btag pointer is null in JetTagMonitoring::fillSuspectJetHistos; filling these histograms will be skipped");
1629 double jvt = JVT(*
jet);
1631 if( !( ((
jet->pt()<60000)&&(abs(
jet->eta())<2.4)&&(jvt > 0.59))||((
jet->pt()<60000)&&(abs(
jet->eta())>2.4))||(
jet->pt()>60000) ) )
return false;