15 #include "GaudiKernel/IToolSvc.h"
46 constexpr
int comm_bit = (1<<xAOD::Muon::Commissioning);
59 return truthMatchProbabilityAcc.
withDefault (trackParticle,
60 std::numeric_limits<float>::quiet_NaN());
66 MuonPhysValMonitoringTool::MuonPhysValMonitoringTool(
const std::string&
type,
const std::string&
name,
const IInterface*
parent) :
100 return StatusCode::SUCCESS;
112 static const std::map<int,std::string> theMuonCategories = {
150 std::make_unique<MuonTrackValidationPlots>(
nullptr, categoryPath,
"MSOnlyMETrackParticles",
m_isData));
155 std::make_unique<MuonTrackValidationPlots>(
nullptr, categoryPath,
"IDSelectedTrackParticles",
m_isData));
159 std::make_unique<MuonTrackValidationPlots>(
nullptr, categoryPath,
"IDForwardTrackParticles",
m_isData));
162 if (
category != theMuonCategories.at(
ALL))
continue;
171 m_oUnmatchedRecoMuonPlots = std::make_unique<Muon::RecoMuonPlotOrganizer>(
nullptr, muonContainerName +
"/UnmatchedRecoMuons/");
172 m_oUnmatchedTruthMuonPlots = std::make_unique<Muon::TruthMuonPlotOrganizer>(
nullptr, muonContainerName +
"/UnmatchedTruthMuons/");
201 "Number of truth Muons per event", 20, -0.5, 19.5));
203 new TH1F(Form(
"%s_Overview_N_perevent_muons", muonContainerName.c_str()),
"Number of Muons per event", 20, -0.5, 19.5));
205 new TH1F(Form(
"%s_Overview_N_perevent_tracks", muonContainerName.c_str()),
"Number of Tracks per event", 50, -0.5, 49.5));
207 "Number of truth Segments per event", 200, -0.5, 199.5));
209 new TH1F(Form(
"%s_Overview_N_perevent_segments", muonContainerName.c_str()),
"Number of Segments per event", 200, -0.5, 199.5));
215 new TH1F(Form(
"%s_Overview_reco_category", muonContainerName.c_str()),
"", 4, 0, 4);
216 for (
int i = 1;
i < 4;
i++) {
223 for (
int i = 1;
i < 4;
i++) {
225 (muonContainerName +
"_" + theMuonCategories.at(
i) +
"_reco_authors").c_str(),
226 nAuth + 1, -0.5, nAuth + 0.5));
229 (muonContainerName +
"_Other_reco_authors").c_str(), nAuth + 1, -0.5, nAuth + 0.5));
235 return StatusCode::SUCCESS;
243 TString sHistName =
hist.first->GetName();
247 if (sHistName.Contains(
"momentumPulls")) {
249 if (!(sHistName.Contains(
"Prompt") && (sHistName.Contains(
"AllMuons") || sHistName.Contains(
"SiAssocForward"))))
252 if ((sHistName.Contains(
"resolution") || sHistName.Contains(
"pulls")) && !sHistName.Contains(
"Prompt"))
254 if (sHistName.Contains(
"trigger") && sHistName.Contains(
"wrt") && sHistName.Contains(
"Features"))
continue;
262 std::string sTreeName =
tree.first->GetName();
267 return StatusCode::SUCCESS;
292 if (!eventInfoHandle.
isValid()) {
294 return StatusCode::SUCCESS;
306 return StatusCode::FAILURE;
318 return StatusCode::SUCCESS;
324 if (!
Muons) {
return StatusCode::SUCCESS; }
332 if (
evtStore()->contains<xAOD::TrackParticleContainer>(
"MuonSpectrometerTrackParticles")) {
333 m_MSTracks = getContainer<xAOD::TrackParticleContainer>(
"MuonSpectrometerTrackParticles");
336 return StatusCode::SUCCESS;
345 std::vector<std::pair<const xAOD::Muon*, const xAOD::Muon*> >
pairs;
355 pairs.emplace_back(std::make_pair(mu1, mu2));
360 float dMmin {1e10}, mZ{0.};
361 for (std::pair<const xAOD::Muon*, const xAOD::Muon*>&
x :
pairs) {
363 const TLorentzVector mu1{
x.first->p4()}, mu2{
x.second->p4()};
364 const float M = (mu1 + mu2).M();
365 if (M < 66000. || M > 116000.)
continue;
368 float dM = std::abs(M - 91187.);
369 if (dM > dMmin)
continue;
383 if (metr1 && metr2) {
384 const TLorentzVector mu1ME{metr1->
p4()}, mu2ME{metr2->
p4()};
396 const TLorentzVector mu1ID{tr1->
p4()}, mu2ID{tr2->
p4()};
407 for (
const auto truthMu : *TruthMuons)
handleTruthMuon(truthMu, beamSpotWeight);
411 for (
const auto smu : *SlowMuons) {
413 const MuonLink link = smu->muonLink();
424 auto IDTracks = getContainer<xAOD::TrackParticleContainer>(
m_tracksName);
425 if (!IDTracks)
return StatusCode::FAILURE;
427 for (
const auto tp : *IDTracks)
handleMuonTrack(
tp, xAOD::Muon::InnerDetectorTrackParticle, beamSpotWeight);
430 auto FwdIDTracks = getContainer<xAOD::TrackParticleContainer>(
m_fwdtracksName);
431 if (!FwdIDTracks)
return StatusCode::FAILURE;
433 for (
const auto tp : *FwdIDTracks)
handleMuonTrack(
tp, xAOD::Muon::InnerDetectorTrackParticle, beamSpotWeight);
436 auto MuonTracks = getContainer<xAOD::TrackParticleContainer>(
m_muonTracksName);
437 if (!MuonTracks)
return StatusCode::FAILURE;
440 for (
const auto tp : *MuonTracks)
handleMuonTrack(
tp, xAOD::Muon::MuonSpectrometerTrackParticle, beamSpotWeight);
444 if (!MuonExtrapolatedTracks)
return StatusCode::FAILURE;
446 for (
const auto tp : *MuonExtrapolatedTracks)
447 handleMuonTrack(
tp, xAOD::Muon::ExtrapolatedMuonSpectrometerTrackParticle, beamSpotWeight);
453 if (!MSOnlyMuonExtrapolatedTracks)
return StatusCode::FAILURE;
455 for (
const auto tp : *MSOnlyMuonExtrapolatedTracks)
456 handleMuonTrack(
tp, xAOD::Muon::MSOnlyExtrapolatedMuonSpectrometerTrackParticle, beamSpotWeight);
463 if (!TruthMuonSegments) {
return StatusCode::SUCCESS; }
466 for (
const auto truthMuSeg : *TruthMuonSegments)
handleTruthMuonSegment(truthMuSeg, TruthMuons, beamSpotWeight);
470 if (!MuonSegments) {
return StatusCode::SUCCESS; }
478 auto chainGroups =
m_trigDec->getChainGroup(
"HLT_.*mu.*");
479 for (
auto& trig : chainGroups->getListOfTriggers()) {
480 if (
m_trigDec->isPassed(trig, TrigDefs::EF_passedRaw)) {
485 auto L1chainGroups =
m_trigDec->getChainGroup(
"L1_MU.*");
486 for (
auto& L1trig : L1chainGroups->getListOfTriggers()) {
487 if (
m_trigDec->isPassed(L1trig, TrigDefs::EF_passedRaw))
494 if (
mu->author() == 1) {
496 ATH_MSG_DEBUG(
"##### m_vRecoMuons_EffDen_CB pt:" <<
mu->pt() <<
" phi:" <<
mu->phi() <<
" eta:" <<
mu->eta());
497 }
else if (
mu->author() == 5) {
499 ATH_MSG_DEBUG(
"##### m_vRecoMuons_EffDen_MS pt:" <<
mu->pt() <<
" phi:" <<
mu->phi() <<
" eta:" <<
mu->eta());
507 if (!L1TrigMuons) {
return StatusCode::SUCCESS; }
516 if (!L2SAMuons) {
return StatusCode::SUCCESS; }
518 if (L2SAMuons->
size() != 0) {
519 for (
const auto L2SAmu : *L2SAMuons) {
520 ATH_MSG_DEBUG(
"Muon L2SA Trigger: pt " << L2SAmu->pt() <<
" phi " << L2SAmu->phi() <<
" eta " << L2SAmu->eta()
521 <<
" roiWord " << L2SAmu->roiWord() <<
" sAddress " << L2SAmu->sAddress());
525 if (
mu->pt() != 0.) {
531 unsigned int cont = 0;
545 std::vector<Trig::Feature<xAOD::L2StandAloneMuonContainer> > vec_muons;
546 TString muonItem_str = (TString)muonItem;
547 if (muonItem_str.Contains(
"_OR_")) {
548 muonItem_str.ReplaceAll(
"_OR_",
" ");
550 std::vector<TString> v_subchains;
552 for (
int i = 0;
i < (
int)v_subchains.size();
i++) {
554 std::vector<Trig::Feature<xAOD::L2StandAloneMuonContainer> > vec_muons_1 =
556 for (
const auto& mufeat : vec_muons_1) { vec_muons.emplace_back(mufeat); }
562 ATH_MSG_DEBUG(
"Size of vector Trig::Feature<xAOD::L2StandAloneMuonContainer> for chain " << muonItem <<
" = "
563 << vec_muons.size());
564 for (
const auto& mufeat : vec_muons) {
565 ATH_MSG_DEBUG(muonItem <<
" vec_muons.size() = " << vec_muons.size()
566 <<
" mufeat.cptr()->size() = " << mufeat.cptr()->size());
567 for (
unsigned int i = 0;
i < mufeat.cptr()->
size();
i++) {
568 ATH_MSG_DEBUG(
"#####" << muonItem <<
" L2SA feature pt: " << (*mufeat.cptr())[
i]->pt()
569 <<
" eta: " << (*mufeat.cptr())[
i]->eta() <<
" phi: " << (*mufeat.cptr())[
i]->phi());
576 if (!L2CBMuons) {
return StatusCode::SUCCESS; }
578 if (L2CBMuons->
size() != 0) {
579 for (
const auto L2CBmu : *L2CBMuons) {
580 ATH_MSG_DEBUG(
"Muon L2CB Trigger: pt " << L2CBmu->pt() <<
" phi " << L2CBmu->phi() <<
" eta " << L2CBmu->eta());
590 unsigned int cont = 0;
604 std::vector<Trig::Feature<xAOD::L2CombinedMuonContainer> > vec_muons;
605 TString muonItem_str = (TString)muonItem;
606 if (muonItem_str.Contains(
"_OR_")) {
607 muonItem_str.ReplaceAll(
"_OR_",
" ");
609 std::vector<TString> v_subchains;
611 for (
int i = 0;
i < (
int)v_subchains.size();
i++) {
613 std::vector<Trig::Feature<xAOD::L2CombinedMuonContainer> > vec_muons_1 =
615 for (
const auto& mufeat : vec_muons_1) { vec_muons.emplace_back(mufeat); }
621 ATH_MSG_DEBUG(
"Size of vector Trig::Feature<xAOD::L2CombinedMuonContainer> for chain " << muonItem <<
" = "
622 << vec_muons.size());
623 for (
const auto& mufeat : vec_muons) {
624 ATH_MSG_DEBUG(muonItem <<
" vec_muons.size() = " << vec_muons.size()
625 <<
" mufeat.cptr()->size() = " << mufeat.cptr()->size());
626 for (
unsigned int i = 0;
i < mufeat.cptr()->
size();
i++) {
627 ATH_MSG_DEBUG(
"#####" << muonItem <<
" L2CB feature pt: " << (*mufeat.cptr())[
i]->pt()
628 <<
" eta: " << (*mufeat.cptr())[
i]->eta() <<
" phi: " << (*mufeat.cptr())[
i]->phi());
638 if (!EFCombTrigMuons) {
return StatusCode::SUCCESS; }
640 if (EFCombTrigMuons->
size() != 0) {
641 for (
const auto Trigmu : *EFCombTrigMuons) {
642 ATH_MSG_DEBUG(
"Muon EF Trigger: pt " << Trigmu->pt() <<
" phi " << Trigmu->phi() <<
" eta " << Trigmu->eta()
643 <<
" author" << Trigmu->author());
648 unsigned int cont = 0;
663 for (
const auto truthMu : *TruthMuons) {
664 ATH_MSG_DEBUG(
"TRUTH:: pt=" << truthMu->pt() <<
" eta=" << truthMu->eta() <<
" phi=" << truthMu->phi());
672 if ((muonItem.find(
"msonly") != std::string::npos)) {
676 std::vector<Trig::Feature<xAOD::MuonContainer> > vec_muons;
677 TString muonItem_str = (TString)muonItem;
678 if (muonItem_str.Contains(
"_OR_")) {
679 muonItem_str.ReplaceAll(
"_OR_",
" ");
681 std::vector<TString> v_subchains;
683 for (
int i = 0;
i < (
int)v_subchains.size();
i++) {
686 for (
const auto& mufeat : vec_muons_1) { vec_muons.emplace_back(mufeat); }
692 ATH_MSG_DEBUG(
"Size of vector Trig::Feature<xAOD::MuonContainer> for chain " << muonItem <<
" = " << vec_muons.size());
693 for (
const auto& mufeat : vec_muons) {
694 ATH_MSG_DEBUG(muonItem <<
" vec_muons.size() = " << vec_muons.size()
695 <<
" mufeat.cptr()->size() = " << mufeat.cptr()->size());
696 for (
unsigned int i = 0;
i < mufeat.cptr()->
size();
i++) {
697 ATH_MSG_DEBUG(
"#####" << muonItem <<
" EF feature pt: " << (*mufeat.cptr())[
i]->pt()
698 <<
" eta: " << (*mufeat.cptr())[
i]->eta() <<
" phi: " << (*mufeat.cptr())[
i]->phi()
699 <<
" author: " << (*mufeat.cptr())[
i]->author());
709 bool break_flag =
false;
715 for (
const auto& mufeat : vec_muons) {
716 for (
unsigned int i = 0;
i < mufeat.cptr()->
size();
i++) {
725 << muonItem <<
" pt: " << (*mufeat.cptr())[
i]->pt()
726 <<
" eta: " << (*mufeat.cptr())[
i]->eta() <<
" phi: " << (*mufeat.cptr())[
i]->phi()
727 <<
" author: " << (*mufeat.cptr())[
i]->author() <<
" rel_p "
741 if (break_flag)
break;
750 if (L1MuonItem ==
"L1_MU4")
threshold = 4000;
751 else if (L1MuonItem ==
"L1_MU6")
threshold = 6000;
752 else if (L1MuonItem ==
"L1_MU10")
threshold = 10000;
753 else if (L1MuonItem ==
"L1_MU11")
threshold = 11000;
754 else if (L1MuonItem ==
"L1_MU15")
threshold = 15000;
755 else if (L1MuonItem ==
"L1_MU20")
threshold = 20000;
756 for (
const auto TrigL1mu : *L1TrigMuons) {
770 for (
const auto TrigL1mu : *L1TrigMuons) {
771 if (((TrigL1mu->thrValue()) >=
threshold) &&
778 ATH_MSG_DEBUG(
" $$$ L1 feature " << L1MuonItem <<
" pt: " << TrigL1mu->thrValue()
779 <<
" eta: " << TrigL1mu->eta() <<
" phi: " << TrigL1mu->phi());
792 std::vector<Trig::Feature<xAOD::MuonContainer> > vec_muons;
794 if (muonItem_str.Contains(
"_OR_")) {
795 muonItem_str.ReplaceAll(
"_OR_",
" ");
797 std::vector<TString> v_subchains;
799 for (
int i = 0;
i < (
int)v_subchains.size();
i++) {
802 for (
const auto& mufeat : vec_muons_1) { vec_muons.emplace_back(mufeat); }
822 bool break_flag =
false;
823 for (
const auto TrigL1mu : *L1TrigMuons) {
824 if (((TrigL1mu->thrValue()) >=
threshold) &&
832 for (
const auto& mufeat : vec_muons) {
833 for (
unsigned int i = 0;
i < mufeat.cptr()->size();
i++) {
846 if (break_flag)
break;
855 return StatusCode::SUCCESS;
863 unsigned int thisMuonCategory =
ALL;
897 std::unique_ptr<xAOD::Muon> mu_c;
909 thisMuonCategory =
REST;
929 if (my_quality <= xAOD::Muon::Medium && m_isoTool->
accept(*mu_c))
m_vRecoMuons.emplace_back(
mu);
978 std::unique_ptr<xAOD::Muon> mu_c;
1028 bool passesMuonTrackSel =
false;
1029 if (
type == xAOD::Muon::InnerDetectorTrackParticle) { passesMuonTrackSel =
m_trackSelector->decision(*
tp); }
1032 if (
type == xAOD::Muon::InnerDetectorTrackParticle) {
1036 thisTrkCategory =
REST;
1039 thisTrkCategory =
PROMPT;
1051 }
else if (
type == xAOD::Muon::MuonSpectrometerTrackParticle)
1053 else if (
type == xAOD::Muon::ExtrapolatedMuonSpectrometerTrackParticle)
1055 else if (
type == xAOD::Muon::MSOnlyExtrapolatedMuonSpectrometerTrackParticle)
1066 if (
type == xAOD::Muon::InnerDetectorTrackParticle)
return;
1076 if (
type == xAOD::Muon::MuonSpectrometerTrackParticle) {
1079 }
else if (
type == xAOD::Muon::ExtrapolatedMuonSpectrometerTrackParticle) {
1081 }
else if (
type == xAOD::Muon::MSOnlyExtrapolatedMuonSpectrometerTrackParticle) {
1091 xAOD::Muon::InnerDetectorTrackParticle) {
1092 if ((*truthLink)->absPdgId() != 13 || !
MC::isStable(*truthLink))
return;
1101 if (
type == xAOD::Muon::InnerDetectorTrackParticle) {
1108 }
else if (
type == xAOD::Muon::MuonSpectrometerTrackParticle) {
1110 }
else if (
type == xAOD::Muon::ExtrapolatedMuonSpectrometerTrackParticle) {
1112 }
else if (
type == xAOD::Muon::MSOnlyExtrapolatedMuonSpectrometerTrackParticle) {
1139 ATH_MSG_DEBUG(
" ==> Geometrical selection of Muon L2SA Trigger : pt " << L2SAMu->
pt() <<
" phi " << L2SAMu->
phi() <<
" eta "
1140 << L2SAMu->
eta() <<
" roiWord " << L2SAMu->
roiWord()
1141 <<
" sAddress " << L2SAMu->
sAddress());
1145 int k_L2SAMu_MinDeltaR = -1;
1146 float MinDeltaR = 0.;
1156 k_L2SAMu_MinDeltaR = -1;
1158 ATH_MSG_DEBUG(
"==============>>>> k_L2SAMu_MinDeltaR=" << k_L2SAMu_MinDeltaR <<
" MinDeltaR" << MinDeltaR);
1165 k_L2SAMu_MinDeltaR =
k;
1167 ATH_MSG_DEBUG(
"==============>>>> taken!!!! k_L2SAMu_MinDeltaR=" << k_L2SAMu_MinDeltaR <<
" MinDeltaR"
1171 if (k_L2SAMu_MinDeltaR == -1)
continue;
1187 ATH_MSG_DEBUG(
" ==> Geometrical selection of Muon L2CB Trigger : pt " << L2CBMu->
pt() <<
" phi " << L2CBMu->
phi() <<
" eta "
1192 int k_L2CBMu_MinDeltaR = -1;
1193 float MinDeltaR = 0.;
1203 k_L2CBMu_MinDeltaR = -1;
1205 ATH_MSG_DEBUG(
"==============>>>> k_L2CBMu_MinDeltaR=" << k_L2CBMu_MinDeltaR <<
" MinDeltaR" << MinDeltaR);
1212 k_L2CBMu_MinDeltaR =
k;
1214 ATH_MSG_DEBUG(
"==============>>>> taken!!!! k_L2CBMu_MinDeltaR=" << k_L2CBMu_MinDeltaR <<
" MinDeltaR"
1218 if (k_L2CBMu_MinDeltaR == -1)
continue;
1234 ATH_MSG_DEBUG(
"==> Geometrical selection of EF Trigger muons: pt " << EFMu->
pt() <<
" phi " << EFMu->
phi() <<
" eta " << EFMu->
eta()
1235 <<
" author " << EFMu->
author());
1239 int k_EFMu_MinDeltaR = -1;
1240 float MinDeltaR = 0.;
1241 std::vector<int> vAvailableAuthors;
1242 vAvailableAuthors.clear();
1244 unsigned int iter = 0;
1247 for (
unsigned int l = 0;
l < vAvailableAuthors.size();
l++) {
1250 if (iter == vAvailableAuthors.size()) vAvailableAuthors.emplace_back(
m_vEFMuons[
k]->
author());
1261 for (
unsigned int l = 0;
l < vAvailableAuthors.size();
l++) {
1262 k_EFMu_MinDeltaR = -1;
1269 if (
m_vEFMuons.at(
k)->author() == vAvailableAuthors.at(
l) &&
1272 k_EFMu_MinDeltaR =
k;
1276 if (k_EFMu_MinDeltaR == -1)
continue;
1298 if (!acc_muon.
isAvailable(*truthMu))
return nullptr;
1299 MuonLink link = acc_muon(*truthMu);
1300 if (!link.
isValid())
return nullptr;
1312 for (
const auto smu : *SlowMuons) {
1313 const MuonLink muLink = smu->muonLink();
1314 if (!muLink.
isValid())
continue;
1315 float DR =
deltaR(*muLink , truthMu);
1355 if (
plots->getMuonTree()) {
plots->getMuonTree()->getTree()->Write(); }
1359 return StatusCode::SUCCESS;
1364 if (!recoSegmentLinkAcc.
isAvailable(*truthMuSeg)) {
1368 MuonSegmentLink link = recoSegmentLinkAcc(*truthMuSeg);
1369 if (!link.isValid()) {
1378 const std::string& hdirTag,
const std::string& hNewName) {
1381 if (
hist.second.find(hdirTag) != std::string::npos || hdirTag.empty()) {
1383 if (
histname.find(hnameTag) != std::string::npos) {
1384 h = (
TH1F*)
hist.first->Clone(hNewName.c_str());
1396 if (truthParticleLinkAcc.
isAvailable(*truthMuSeg)) {
1397 truthLink = truthParticleLinkAcc(*truthMuSeg);
1400 if (std::abs((*truthLink)->pdgId()) != 13)
return REST;
1402 for (
const auto muTruthPart : *muonTruthContainer) {
1415 int truthType = truthTypeAcc(*
mu);
1418 else if (truthType == 8 && (truthOriginAcc(*
mu) == 34 || truthOriginAcc(*
mu) == 35))
1420 else if (truthType == 7)
1426 std::unique_ptr<xAOD::Muon> mu_c;
1427 if (
mu.m() <= 0)
return mu_c;
1428 mu_c = std::make_unique<xAOD::Muon>();
1434 if (idtrk && metrk) {
1437 InnerDetectorPtDec(*mu_c) = idtrk->pt();
1438 MuonSpectrometerPtDec(*mu_c) = metrk->pt();
1449 if (
histname.find(
"parameters_z0") != std::string::npos) {
1450 hist->GetXaxis()->Set(80, -200., 200.);
1452 if (
histname.find(
"parameters_d0") != std::string::npos &&
histname.find(
"parameters_d0_small") == std::string::npos) {
1453 hist->GetXaxis()->Set(80, -1., 1.);
1454 hist->GetYaxis()->SetTitle(
"Entries / 0.025 mm");
1459 if (
histname.find(
"parameters_d0") != std::string::npos &&
histname.find(
"parameters_d0_small") == std::string::npos) {
1461 hist->GetYaxis()->SetTitle(
"Entries / 2.5 mm");
1466 if (
histname.find(
"trigger_L1_pt") != std::string::npos) {
1467 hist->SetTitle(
"L1Trigger Muons pt threshold");
1468 hist->GetXaxis()->SetTitle(
"L1Trigger Muons pt threshold [GeV]");
1469 hist->GetXaxis()->Set(30, -0.5, 29.5);
1471 if (
histname.find(
"trigger_L1_eta_pt") != std::string::npos) {
1472 hist->SetTitle(
"L1Trigger Muons pt threshold vs eta");
1473 hist->GetYaxis()->Set(90, -0.5, 29.5);
1474 hist->GetYaxis()->SetTitle(
"L1Trigger Muons pt threshold [GeV]");
1477 if (
histname.find(
"trigger") != std::string::npos &&
1478 ((
histname.find(
"Denom_pt") != std::string::npos) || (
histname.find(
"Numer_pt") != std::string::npos) ||
1479 (
histname.find(
"Features_pt") != std::string::npos)))
1480 hist->GetXaxis()->Set(200, 0., 200.);
1482 if (
histname.find(
"hits") != std::string::npos) {
1483 if (
histname.find(
"etaLayer2") != std::string::npos)
1484 hist->GetXaxis()->Set(15, -0.5, 14.5);
1485 else if (
histname.find(
"etaLayer") != std::string::npos)
1486 hist->GetXaxis()->Set(11, -0.5, 10.5);
1490 bool is2D = !(
histname.find(
"_vs_") == std::string::npos);
1493 if (
histname.find(
"METrackParticles") != std::string::npos) {
1494 if (
histname.find(
"Res_eta") != std::string::npos) {
1496 hist->GetYaxis()->Set(50, -0.025, 0.025);
1498 hist->GetXaxis()->Set(50, -0.025, 0.025);
1499 }
else if (
histname.find(
"Res_phi") != std::string::npos) {
1501 hist->GetYaxis()->Set(50, -0.02, 0.02);
1503 hist->GetXaxis()->Set(50, -0.02, 0.02);
1505 }
else if (
histname.find(
"MSTrackParticles") != std::string::npos) {
1506 if (
histname.find(
"Res_eta") != std::string::npos) {
1508 hist->GetYaxis()->Set(50, -0.025, 0.025);
1510 hist->GetXaxis()->Set(50, -0.025, 0.025);
1511 }
else if (
histname.find(
"Res_phi") != std::string::npos) {
1513 hist->GetYaxis()->Set(50, -0.05, 0.05);
1515 hist->GetXaxis()->Set(50, -0.05, 0.05);
1518 if (
histname.find(
"Res_eta") != std::string::npos) {
1520 hist->GetYaxis()->Set(50, -0.005, 0.005);
1522 hist->GetXaxis()->Set(50, -0.005, 0.005);
1523 }
else if (
histname.find(
"Res_phi") != std::string::npos) {
1525 hist->GetYaxis()->Set(50, -0.002, 0.002);
1527 hist->GetXaxis()->Set(50, -0.002, 0.002);
1531 if (
histname.find(
"trigger") != std::string::npos) {
1534 (
histname.find(
"BARREL") != std::string::npos ||
histname.find(
"WHOLE_DETECT") != std::string::npos)) {
1535 if (
histname.find(
"Res_pT") != std::string::npos &&
histname.find(
"_vs_") == std::string::npos) {
1536 hist->GetXaxis()->Set(100, -0.04, 0.04);
1538 if (
histname.find(
"Res_pT_vs_") != std::string::npos) {
hist->GetYaxis()->Set(100, -0.04, 0.04); }
1539 if (
histname.find(
"Res_eta") != std::string::npos &&
histname.find(
"_vs_") == std::string::npos) {
1540 hist->GetXaxis()->Set(100, -0.0005, 0.0005);
1542 if (
histname.find(
"Res_eta_vs_") != std::string::npos) {
hist->GetYaxis()->Set(100, -0.0005, 0.0005); }
1544 if (
histname.find(
"Res_phi") != std::string::npos &&
histname.find(
"_vs_") == std::string::npos) {
1545 hist->GetXaxis()->Set(100, -0.0002, 0.0002);
1547 if (
histname.find(
"Res_phi_vs_") != std::string::npos) {
hist->GetYaxis()->Set(100, -0.0002, 0.0002); }
1549 if ((!
m_isData) &&
histname.find(
"MuidCo") != std::string::npos && (
histname.find(
"ENDCAPS") != std::string::npos)) {
1550 if (
histname.find(
"Res_pT") != std::string::npos &&
histname.find(
"_vs_") == std::string::npos) {
1551 hist->GetXaxis()->Set(100, -0.05, 0.05);
1553 if (
histname.find(
"Res_pT_vs_") != std::string::npos) {
hist->GetYaxis()->Set(100, -0.05, 0.05); }
1554 if (
histname.find(
"Res_eta") != std::string::npos &&
histname.find(
"_vs_") == std::string::npos) {
1555 hist->GetXaxis()->Set(100, -0.001, 0.001);
1557 if (
histname.find(
"Res_eta_vs_") != std::string::npos) {
hist->GetYaxis()->Set(100, -0.001, 0.001); }
1559 if (
histname.find(
"Res_phi") != std::string::npos &&
histname.find(
"_vs_") == std::string::npos) {
1560 hist->GetXaxis()->Set(100, -0.0003, 0.0003);
1562 if (
histname.find(
"Res_phi_vs_") != std::string::npos) {
hist->GetYaxis()->Set(100, -0.0003, 0.0003); }
1565 if (
histname.find(
"Res_eta") != std::string::npos &&
histname.find(
"_vs_") == std::string::npos) {
1566 hist->GetXaxis()->Set(100, -0.03, 0.03);
1568 if (
histname.find(
"Res_eta_vs_") != std::string::npos) {
hist->GetYaxis()->Set(100, -0.03, 0.03); }
1570 if (
histname.find(
"Res_phi") != std::string::npos &&
histname.find(
"_vs_") == std::string::npos) {
1571 hist->GetXaxis()->Set(100, -0.03, 0.03);
1573 if (
histname.find(
"Res_phi_vs_") != std::string::npos) {
hist->GetYaxis()->Set(100, -0.03, 0.03); }
1575 if ((!
m_isData) &&
histname.find(
"MuidSA") != std::string::npos && (
histname.find(
"BARREL") != std::string::npos)) {
1576 if (
histname.find(
"Res_pT") != std::string::npos &&
histname.find(
"_vs_") == std::string::npos) {
1577 hist->GetXaxis()->Set(100, -0.15, 0.15);
1579 if (
histname.find(
"Res_pT_vs_") != std::string::npos) {
hist->GetYaxis()->Set(100, -0.15, 0.15); }
1582 (
histname.find(
"ENDCAPS") != std::string::npos ||
histname.find(
"WHOLE_DETECT") != std::string::npos)) {
1583 if (
histname.find(
"Res_pT") != std::string::npos &&
histname.find(
"_vs_") == std::string::npos) {
1584 hist->GetXaxis()->Set(100, -0.2, 0.2);
1586 if (
histname.find(
"Res_pT_vs_") != std::string::npos) {
hist->GetYaxis()->Set(100, -0.2, 0.2); }
1591 (
histname.find(
"BARREL") != std::string::npos ||
histname.find(
"WHOLE_DETECT") != std::string::npos)) {
1592 if (
histname.find(
"Res_pT") != std::string::npos &&
histname.find(
"_vs_") == std::string::npos) {
1593 hist->GetXaxis()->Set(100, -0.06, 0.06);
1595 if (
histname.find(
"Res_pT_vs_") != std::string::npos) {
hist->GetYaxis()->Set(100, -0.06, 0.06); }
1596 if (
histname.find(
"Res_eta") != std::string::npos &&
histname.find(
"_vs_") == std::string::npos) {
1597 hist->GetXaxis()->Set(100, -0.001, 0.001);
1599 if (
histname.find(
"Res_eta_vs_") != std::string::npos) {
hist->GetYaxis()->Set(100, -0.001, 0.001); }
1601 if (
histname.find(
"Res_phi") != std::string::npos &&
histname.find(
"_vs_") == std::string::npos) {
1602 hist->GetXaxis()->Set(100, -0.0005, 0.0005);
1604 if (
histname.find(
"Res_phi_vs_") != std::string::npos) {
hist->GetYaxis()->Set(100, -0.0005, 0.0005); }
1606 if ((
m_isData) &&
histname.find(
"MuidCo") != std::string::npos && (
histname.find(
"ENDCAPS") != std::string::npos)) {
1607 if (
histname.find(
"Res_pT") != std::string::npos &&
histname.find(
"_vs_") == std::string::npos) {
1608 hist->GetXaxis()->Set(100, -0.1, 0.1);
1610 if (
histname.find(
"Res_pT_vs_") != std::string::npos) {
hist->GetYaxis()->Set(100, -0.1, 0.1); }
1611 if (
histname.find(
"Res_eta") != std::string::npos &&
histname.find(
"_vs_") == std::string::npos) {
1612 hist->GetXaxis()->Set(100, -0.0015, 0.0015);
1614 if (
histname.find(
"Res_eta_vs_") != std::string::npos) {
hist->GetYaxis()->Set(100, -0.0015, 0.0015); }
1616 if (
histname.find(
"Res_phi") != std::string::npos &&
histname.find(
"_vs_") == std::string::npos) {
1617 hist->GetXaxis()->Set(100, -0.0005, 0.0005);
1619 if (
histname.find(
"Res_phi_vs_") != std::string::npos) {
hist->GetYaxis()->Set(100, -0.0005, 0.0005); }
1622 if (
histname.find(
"Res_eta") != std::string::npos &&
histname.find(
"_vs_") == std::string::npos) {
1623 hist->GetXaxis()->Set(100, -0.03, 0.03);
1625 if (
histname.find(
"Res_eta_vs_") != std::string::npos) {
hist->GetYaxis()->Set(100, -0.03, 0.03); }
1627 if (
histname.find(
"Res_phi") != std::string::npos &&
histname.find(
"_vs_") == std::string::npos) {
1628 hist->GetXaxis()->Set(100, -0.03, 0.03);
1630 if (
histname.find(
"Res_phi_vs_") != std::string::npos) {
hist->GetYaxis()->Set(100, -0.03, 0.03); }
1632 if ((
m_isData) &&
histname.find(
"MuidSA") != std::string::npos && (
histname.find(
"BARREL") != std::string::npos)) {
1633 if (
histname.find(
"Res_pT") != std::string::npos &&
histname.find(
"_vs_") == std::string::npos) {
1634 hist->GetXaxis()->Set(100, -0.3, 0.3);
1636 if (
histname.find(
"Res_pT_vs_") != std::string::npos) {
hist->GetYaxis()->Set(100, -0.3, 0.3); }
1639 (
histname.find(
"ENDCAPS") != std::string::npos ||
histname.find(
"WHOLE_DETECT") != std::string::npos)) {
1640 if (
histname.find(
"Res_pT") != std::string::npos &&
histname.find(
"_vs_") == std::string::npos) {
1641 hist->GetXaxis()->Set(100, -0.5, 0.5);
1643 if (
histname.find(
"Res_pT_vs_") != std::string::npos) {
hist->GetYaxis()->Set(100, -0.5, 0.5); }
1647 if ((
histname.find(
"L2_StandAlone") != std::string::npos)) {
1648 if (
histname.find(
"Res_eta") != std::string::npos &&
histname.find(
"_vs_") == std::string::npos) {
1649 hist->GetXaxis()->Set(100, -0.03, 0.03);
1651 if (
histname.find(
"Res_eta_vs_") != std::string::npos) {
hist->GetYaxis()->Set(100, -0.03, 0.03); }
1653 if (
histname.find(
"Res_phi") != std::string::npos &&
histname.find(
"_vs_") == std::string::npos) {
1654 hist->GetXaxis()->Set(100, -0.03, 0.03);
1656 if (
histname.find(
"Res_phi_vs_") != std::string::npos) {
hist->GetYaxis()->Set(100, -0.03, 0.03); }
1658 if ((
histname.find(
"L2_StandAlone") != std::string::npos) && (
histname.find(
"BARREL") != std::string::npos)) {
1659 if (
histname.find(
"Res_pT") != std::string::npos &&
histname.find(
"_vs_") == std::string::npos) {
1660 hist->GetXaxis()->Set(100, -0.3, 0.3);
1662 if (
histname.find(
"Res_pT_vs_") != std::string::npos) {
hist->GetYaxis()->Set(100, -0.3, 0.3); }
1664 if ((
histname.find(
"L2_StandAlone") != std::string::npos) &&
1665 ((
histname.find(
"ENDCAPS") != std::string::npos) || (
histname.find(
"WHOLE_DETECT") != std::string::npos))) {
1666 if (
histname.find(
"Res_pT") != std::string::npos &&
histname.find(
"_vs_") == std::string::npos) {
1667 hist->GetXaxis()->Set(100, -0.5, 0.5);
1669 if (
histname.find(
"Res_pT_vs_") != std::string::npos) {
hist->GetYaxis()->Set(100, -0.5, 0.5); }
1672 if ((
histname.find(
"L2_Combined") != std::string::npos)) {
1673 if (
histname.find(
"Res_eta") != std::string::npos &&
histname.find(
"_vs_") == std::string::npos) {
1674 hist->GetXaxis()->Set(100, -0.002, 0.002);
1676 if (
histname.find(
"Res_eta_vs_") != std::string::npos) {
hist->GetYaxis()->Set(100, -0.002, 0.002); }
1678 if (
histname.find(
"Res_phi") != std::string::npos &&
histname.find(
"_vs_") == std::string::npos) {
1679 hist->GetXaxis()->Set(100, -0.001, 0.001);
1681 if (
histname.find(
"Res_phi_vs_") != std::string::npos) {
hist->GetYaxis()->Set(100, -0.001, 0.001); }
1682 if (
histname.find(
"Res_pT") != std::string::npos &&
histname.find(
"_vs_") == std::string::npos) {
1683 hist->GetXaxis()->Set(100, -0.2, 0.2);
1685 if (
histname.find(
"Res_pT_vs_") != std::string::npos) {
hist->GetYaxis()->Set(100, -0.2, 0.2); }
1691 if (prt->
pt() < 2000.)
return false;
1692 if (std::abs(prt->
eta()) > 2.7)
return false;
1698 int stringLength =
x.Length();
1699 int delimLength = delim.Length();
1702 TString
temp =
"---";
1703 while (
stop != -1) {
1704 stop =
x.First(delim);
1708 TSubString newString =
x(
stop + delimLength, stringLength);
1710 stringLength =
x.Length();
1712 stringLength =
x.Length();
1713 temp =
x(0, stringLength);
1716 v.emplace_back(
temp);