37     constexpr 
int comm_bit = (1<<xAOD::Muon::Commissioning);
 
   46     template <
class ContType> 
StatusCode MuonPhysValMonitoringTool::retrieveContainer(
const EventContext& ctx,
 
   48                                                                                       const ContType* & container)
 const{
 
   52             return StatusCode::SUCCESS;
 
   55         if (!readHandle.isPresent()) {
 
   57             return StatusCode::FAILURE;
 
   59         container = readHandle.cptr();
 
   60         return StatusCode::SUCCESS;
 
   69         for (
unsigned int i = 0; 
i < m_selectHLTMuonItems.size(); 
i++) {
 
   70             if (m_selectHLTMuonItems[
i][0] == 
"" || m_selectHLTMuonItems[
i][1] == 
"") 
continue;
 
   71             m_muonItems.emplace_back(m_selectHLTMuonItems[
i][0]);
 
   72             m_L1Seed.emplace_back(m_selectHLTMuonItems[
i][1]);
 
   76         if (m_doTrigMuonValidation == 
false) {
 
   77             m_doTrigMuonL1Validation = 
false;
 
   78             m_doTrigMuonL2Validation = 
false;
 
   79             m_doTrigMuonEFValidation = 
false;
 
   81         ATH_CHECK(m_trigDec.retrieve(DisableTool{!m_doTrigMuonValidation}));
 
   84         ATH_CHECK(m_muonSelectionTool.retrieve());
 
   89         ATH_CHECK(m_fwdtracksName.initialize(!m_fwdtracksName.empty()));
 
   91         ATH_CHECK(m_slowMuonsName.initialize(!m_slowMuonsName.empty()));
 
   94         ATH_CHECK(m_muonExtrapolatedTracksName.initialize());
 
   95         ATH_CHECK(m_muonMSOnlyExtrapolatedTracksName.initialize());
 
   97         ATH_CHECK(m_muonSegmentsName.initialize());
 
   98         ATH_CHECK(m_muonsTruthName.initialize(!m_isData));
 
   99         ATH_CHECK(m_muonSegmentsTruthName.initialize(!m_isData));
 
  100         ATH_CHECK(m_muonL1TrigName.initialize(m_doTrigMuonL1Validation));
 
  101         ATH_CHECK(m_muonL2SAName.initialize(m_doTrigMuonL2Validation));
 
  102         ATH_CHECK(m_muonL2CBName.initialize(m_doTrigMuonL2Validation));
 
  103         ATH_CHECK(m_muonEFCombTrigName.initialize(m_doTrigMuonEFValidation));
 
  106             const std::vector<std::string> truthDecors{
"truthOrigin", 
"truthType", 
"truthParticleLink"};
 
  107             const std::vector<std::string> 
keys{m_tracksName.key(), m_fwdtracksName.key(), m_muonsName.key(), 
 
  108                                                 m_slowMuonsName.key(), m_muonTracksName.key(), m_muonExtrapolatedTracksName.key(),
 
  109                                                 m_muonMSOnlyExtrapolatedTracksName.key()};
 
  110             for (
const std::string& 
key : 
keys) {
 
  111                 if (
key.empty()) 
continue;
 
  112                 for (
const std::string& decor : truthDecors){
 
  116             const std::vector<std::string> truthPartDecors{
"MuonEntryLayer_px", 
"nprecLayers",
 
  117                                                             "truthOrigin", 
"truthType"};
 
  119             for (
const std::string& decor: truthPartDecors) {
 
  120                 m_decorDep.emplace_back(m_muonsTruthName, decor);
 
  128         return StatusCode::SUCCESS;
 
  136         if (m_selectMuonWPs.size() == 1 && m_selectMuonWPs[0] < 0) m_selectMuonWPs.clear();
 
  138         if (m_selectMuonAuthors.size() == 1 && m_selectMuonAuthors[0] == 0) m_selectMuonAuthors.clear();
 
  140         static const std::map<int,std::string> theMuonCategories = {
 
  143           {INFLIGHT, 
"InFlight"},
 
  144           {NONISO, 
"NonIsolated"},
 
  148         for (
const auto& 
category : m_selectMuonCategories) m_selectMuonCategoriesStr.emplace_back(theMuonCategories.at(
category));
 
  151         bool separateSAFMuons = m_slowMuonsName.empty();
 
  153         std::string muonContainerName = m_muonsName.key();
 
  154         for (
const auto& 
category : m_selectMuonCategoriesStr) {
 
  155             std::string categoryPath = muonContainerName + 
"/" + 
category + 
"/";
 
  157             m_muonValidationPlots.emplace_back(std::make_unique<MuonValidationPlots>(
 
  158                 nullptr, categoryPath, m_selectMuonWPs, m_selectMuonAuthors, m_isData,
 
  159                 (
category == theMuonCategories.at(ALL) ? 
false : m_doBinnedResolutionPlots.value()), separateSAFMuons, 
false));
 
  161             if (!m_slowMuonsName.empty()) m_slowMuonValidationPlots.emplace_back(std::make_unique<SlowMuonValidationPlots>(
nullptr, categoryPath, m_isData));
 
  162             if (m_doTrigMuonValidation) {
 
  164                     m_TriggerMuonValidationPlots.emplace_back(std::make_unique<TriggerMuonValidationPlots>(
 
  165                         nullptr, categoryPath, m_selectMuonAuthors, m_isData, m_doTrigMuonL1Validation, m_doTrigMuonL2Validation,
 
  166                         m_doTrigMuonEFValidation, m_selectHLTMuonItems, m_L1MuonItems));
 
  169             if (!m_muonTracksName.empty()) {
 
  170                 m_muonMSTrackValidationPlots.emplace_back(std::make_unique<MuonTrackValidationPlots>(
nullptr, categoryPath, 
"MSTrackParticles", m_isData));
 
  172                     m_oUnmatchedRecoMuonTrackPlots = std::make_unique<Muon::RecoMuonTrackPlotOrganizer>(
nullptr, muonContainerName + 
"/UnmatchedRecoMuonTracks/");
 
  174             if (!m_muonExtrapolatedTracksName.empty())
 
  175                 m_muonMETrackValidationPlots.emplace_back(std::make_unique<MuonTrackValidationPlots>(
nullptr, categoryPath, 
"METrackParticles", m_isData));
 
  176             if (!m_muonMSOnlyExtrapolatedTracksName.empty())
 
  177                 m_muonMSOnlyMETrackValidationPlots.emplace_back(
 
  178                     std::make_unique<MuonTrackValidationPlots>(
nullptr, categoryPath, 
"MSOnlyMETrackParticles", m_isData));
 
  180             if (!m_tracksName.empty()) {
 
  181                 m_muonIDTrackValidationPlots.emplace_back(std::make_unique<MuonTrackValidationPlots>(
nullptr, categoryPath, 
"IDTrackParticles", m_isData));
 
  182                 m_muonIDSelectedTrackValidationPlots.emplace_back(
 
  183                     std::make_unique<MuonTrackValidationPlots>(
nullptr, categoryPath, 
"IDSelectedTrackParticles", m_isData));
 
  185             if (!m_fwdtracksName.empty())
 
  186                 m_muonIDForwardTrackValidationPlots.emplace_back(
 
  187                     std::make_unique<MuonTrackValidationPlots>(
nullptr, categoryPath, 
"IDForwardTrackParticles", m_isData));
 
  189             if (!m_muonSegmentsName.empty()) {
 
  190                 if (
category != theMuonCategories.at(ALL)) 
continue;  
 
  191                 m_muonSegmentValidationPlots.emplace_back(std::make_unique<MuonSegmentValidationPlots>(
nullptr, categoryPath, m_isData));
 
  193                     m_oUnmatchedRecoMuonSegmentPlots.reset(
 
  199             m_oUnmatchedRecoMuonPlots = std::make_unique<Muon::RecoMuonPlotOrganizer>(
nullptr, muonContainerName +
"/UnmatchedRecoMuons/");
 
  200             m_oUnmatchedTruthMuonPlots = std::make_unique<Muon::TruthMuonPlotOrganizer>(
nullptr, muonContainerName +
"/UnmatchedTruthMuons/");
 
  203         for (
const auto& 
plots : m_muonValidationPlots) bookValidationPlots(*plots).ignore();
 
  204         for (
const auto& 
plots : m_slowMuonValidationPlots) bookValidationPlots(*plots).ignore();
 
  205         for (
const auto& 
plots : m_TriggerMuonValidationPlots) bookValidationPlots(*plots).ignore();
 
  206         for (
const auto& 
plots : m_muonIDTrackValidationPlots) bookValidationPlots(*plots).ignore();
 
  207         for (
const auto& 
plots : m_muonIDSelectedTrackValidationPlots) bookValidationPlots(*plots).ignore();
 
  208         for (
const auto& 
plots : m_muonIDForwardTrackValidationPlots) bookValidationPlots(*plots).ignore();
 
  209         for (
const auto& 
plots : m_muonMSTrackValidationPlots) bookValidationPlots(*plots).ignore();
 
  210         for (
const auto& 
plots : m_muonMETrackValidationPlots) bookValidationPlots(*plots).ignore();
 
  211         for (
const auto& 
plots : m_muonMSOnlyMETrackValidationPlots) bookValidationPlots(*plots).ignore();
 
  213             bookValidationPlots(*m_oUnmatchedRecoMuonPlots).ignore();
 
  214             bookValidationPlots(*m_oUnmatchedTruthMuonPlots).ignore();
 
  215             if (m_oUnmatchedRecoMuonTrackPlots) bookValidationPlots(*m_oUnmatchedRecoMuonTrackPlots).ignore();
 
  216             for (
const auto& 
plots : m_muonSegmentValidationPlots) bookValidationPlots(*plots).ignore();
 
  217             if (m_oUnmatchedRecoMuonSegmentPlots) bookValidationPlots(*m_oUnmatchedRecoMuonSegmentPlots).ignore();
 
  220         m_h_overview_Z_mass = 
new TH1F(Form(
"%s_Overview_Z_mass", muonContainerName.c_str()), 
"", 20, 76, 106);
 
  221         ATH_CHECK(regHist(m_h_overview_Z_mass, Form(
"%s/Overview", muonContainerName.c_str()), 
all));
 
  222         m_h_overview_Z_mass_ME = 
new TH1F(Form(
"%s_Overview_Z_mass_ME", muonContainerName.c_str()), 
"", 20, 76, 106);
 
  223         ATH_CHECK(regHist(m_h_overview_Z_mass_ME, Form(
"%s/Overview", muonContainerName.c_str()), 
all));
 
  224         m_h_overview_Z_mass_ID = 
new TH1F(Form(
"%s_Overview_Z_mass_ID", muonContainerName.c_str()), 
"", 20, 76, 106);
 
  225         ATH_CHECK(regHist(m_h_overview_Z_mass_ID, Form(
"%s/Overview", muonContainerName.c_str()), 
all));
 
  227         m_h_overview_nObjects.clear();
 
  228         m_h_overview_nObjects.emplace_back(
new TH1F(Form(
"%s_Overview_N_perevent_truth_muons", muonContainerName.c_str()),
 
  229                                                  "Number of truth Muons per event", 20, -0.5, 19.5));
 
  230         m_h_overview_nObjects.emplace_back(
 
  231             new TH1F(Form(
"%s_Overview_N_perevent_muons", muonContainerName.c_str()), 
"Number of Muons per event", 20, -0.5, 19.5));
 
  232         m_h_overview_nObjects.emplace_back(
 
  233             new TH1F(Form(
"%s_Overview_N_perevent_tracks", muonContainerName.c_str()), 
"Number of Tracks per event", 50, -0.5, 49.5));
 
  234         m_h_overview_nObjects.emplace_back(
new TH1F(Form(
"%s_Overview_N_perevent_truth_segments", muonContainerName.c_str()),
 
  235                                                  "Number of truth Segments per event", 200, -0.5, 199.5));
 
  236         m_h_overview_nObjects.emplace_back(
 
  237             new TH1F(Form(
"%s_Overview_N_perevent_segments", muonContainerName.c_str()), 
"Number of Segments per event", 200, -0.5, 199.5));
 
  238         for (
const auto& 
hist : m_h_overview_nObjects) {
 
  242         m_h_overview_reco_category =
 
  243             new TH1F(Form(
"%s_Overview_reco_category", muonContainerName.c_str()), 
"", 4, 0, 4);  
 
  244         for (
int i = 1; 
i < 4; 
i++) {                                                             
 
  245             m_h_overview_reco_category->GetXaxis()->SetBinLabel(
i, theMuonCategories.at(
i).c_str());
 
  247         m_h_overview_reco_category->GetXaxis()->SetBinLabel(4, 
"Other");  
 
  248         ATH_CHECK(regHist(m_h_overview_reco_category, Form(
"%s/Overview", muonContainerName.c_str()), 
all));
 
  251         for (
int i = 1; 
i < 4; 
i++) {
 
  252             m_h_overview_reco_authors.emplace_back(
new TH1F((muonContainerName + 
"_" + theMuonCategories.at(
i) + 
"_reco_authors").c_str(),
 
  253                                                          (muonContainerName + 
"_" + theMuonCategories.at(
i) + 
"_reco_authors").c_str(),
 
  254                                                          nAuth + 1, -0.5, nAuth + 0.5));
 
  256         m_h_overview_reco_authors.emplace_back(
new TH1F((muonContainerName + 
"_Overview_Other_reco_authors").c_str(),
 
  257                                                      (muonContainerName + 
"_Other_reco_authors").c_str(), nAuth + 1, -0.5, nAuth + 0.5));
 
  259         for (
const auto& 
hist : m_h_overview_reco_authors) {
 
  263         return StatusCode::SUCCESS;
 
  271             TString sHistName = 
hist.first->GetName();
 
  275             if (sHistName.Contains(
"momentumPulls")) {
 
  277                 if (!(sHistName.Contains(
"Prompt") && (sHistName.Contains(
"AllMuons") || sHistName.Contains(
"SiAssocForward"))))
 
  280             if ((sHistName.Contains(
"resolution") || sHistName.Contains(
"pulls")) && !sHistName.Contains(
"Prompt"))
 
  282             if (sHistName.Contains(
"trigger") && sHistName.Contains(
"wrt") && sHistName.Contains(
"Features")) 
continue;
 
  283             modifyHistogram(
hist.first);
 
  290             std::string sTreeName = 
tree.first->GetName();
 
  295         return StatusCode::SUCCESS;
 
  300         m_vMatchedTruthMuons.clear();
 
  301         m_vMatchedMuons.clear();
 
  302         m_vMatchedSlowMuons.clear();
 
  303         m_vMatchedMuonTracks.clear();
 
  304         m_vMatchedMuonSegments.clear();
 
  305         m_vZmumuIDTracks.clear();
 
  306         m_vZmumuMETracks.clear();
 
  307         m_vZmumuMuons.clear();
 
  309         m_vEFMuonsSelected.clear();
 
  310         m_vL2SAMuons.clear();
 
  311         m_vL2SAMuonsSelected.clear();
 
  312         m_vL2CBMuons.clear();
 
  313         m_vL2CBMuonsSelected.clear();
 
  314         m_vRecoMuons.clear();
 
  315         m_vRecoMuons_EffDen.clear();
 
  316         m_vRecoMuons_EffDen_CB.clear();
 
  317         m_vRecoMuons_EffDen_MS.clear();
 
  319         const EventContext& ctx{Gaudi::Hive::currentContext()};
 
  321         ATH_CHECK(retrieveContainer(ctx, m_eventInfo, eventInfo));
 
  323         float beamSpotWeight = eventInfo->beamSpotWeight();
 
  326         ATH_CHECK(retrieveContainer(ctx, m_muonsTruthName, TruthMuons));
 
  329             m_h_overview_nObjects[0]->Fill(TruthMuons->size(), beamSpotWeight);
 
  334         ATH_CHECK(retrieveContainer(ctx, m_slowMuonsName, SlowMuons));
 
  338             m_h_overview_nObjects[1]->Fill(SlowMuons->size(), beamSpotWeight);
 
  342             m_h_overview_nObjects[1]->Fill(
Muons->size(), beamSpotWeight);
 
  348         ATH_CHECK(retrieveContainer(ctx, m_muonTracksName, m_MSTracks));
 
  352         std::vector<std::pair<const xAOD::Muon*, const xAOD::Muon*> > 
pairs;
 
  357                 if (!m_selectComissioning && mu1->
allAuthors() & comm_bit) 
continue;
 
  360                     if (!m_selectComissioning && mu2->
allAuthors() & comm_bit) 
continue;                
 
  362                     pairs.emplace_back(std::make_pair(mu1, mu2));
 
  367         float dMmin {1e10}, mZ{0.};
 
  368         for (std::pair<const xAOD::Muon*, const xAOD::Muon*>& 
x : 
pairs) {
 
  370             const TLorentzVector mu1{
x.first->p4()}, mu2{
x.second->p4()};
 
  371             const float M = (mu1 + mu2).M();
 
  372             if (M < 66000. || M > 116000.) 
continue;
 
  375             float dM = std::abs(M - 91187.);
 
  376             if (dM > dMmin) 
continue;
 
  380             m_vZmumuMuons.clear();
 
  381             m_vZmumuMuons.emplace_back(
x.first);
 
  382             m_vZmumuMuons.emplace_back(
x.second);
 
  385         if (m_vZmumuMuons.size() == 2) {
 
  386             m_h_overview_Z_mass->Fill(mZ / 1000., beamSpotWeight);
 
  388             const xAOD::TrackParticle* metr1 = m_vZmumuMuons[0]->trackParticle(xAOD::Muon::ExtrapolatedMuonSpectrometerTrackParticle);
 
  389             const xAOD::TrackParticle* metr2 = m_vZmumuMuons[1]->trackParticle(xAOD::Muon::ExtrapolatedMuonSpectrometerTrackParticle);
 
  390             if (metr1 && metr2) {
 
  391                 const TLorentzVector mu1ME{metr1->
p4()}, mu2ME{metr2->
p4()};
 
  392                 m_h_overview_Z_mass_ME->Fill((mu1ME + mu2ME).M() / 1000., beamSpotWeight);
 
  394                     m_vZmumuMETracks.clear();
 
  395                     m_vZmumuMETracks.emplace_back(metr1);
 
  396                     m_vZmumuMETracks.emplace_back(metr2);
 
  400             const xAOD::TrackParticle* tr1 = m_vZmumuMuons[0]->trackParticle(xAOD::Muon::InnerDetectorTrackParticle);
 
  401             const xAOD::TrackParticle* tr2 = m_vZmumuMuons[1]->trackParticle(xAOD::Muon::InnerDetectorTrackParticle);
 
  403                 const TLorentzVector mu1ID{tr1->
p4()}, mu2ID{tr2->
p4()};
 
  404                 m_h_overview_Z_mass_ID->Fill((mu1ID + mu2ID).M() / 1000., beamSpotWeight);
 
  406                     m_vZmumuIDTracks.clear();
 
  407                     m_vZmumuIDTracks.emplace_back(tr1);
 
  408                     m_vZmumuIDTracks.emplace_back(tr2);
 
  414             for (
const auto truthMu : *TruthMuons) handleTruthMuon(truthMu, beamSpotWeight);
 
  418             for (
const auto smu : *SlowMuons) {
 
  420                 const MuonLink link = smu->muonLink();
 
  422                 handleMuon(*link, smu, beamSpotWeight);
 
  427                 handleMuon(
mu, 
nullptr, beamSpotWeight);
 
  432         ATH_CHECK(retrieveContainer(ctx, m_tracksName, IDTracks));
 
  434             ATH_MSG_DEBUG(
"handling " << IDTracks->size() << 
" " << m_tracksName);
 
  435             for (
const auto tp : *IDTracks) handleMuonTrack(
tp, xAOD::Muon::InnerDetectorTrackParticle, beamSpotWeight);
 
  438         ATH_CHECK(retrieveContainer(ctx, m_fwdtracksName, IDTracks));
 
  440             ATH_MSG_DEBUG(
"handling " << FwdIDTracks->size() << 
" " << m_fwdtracksName);
 
  441             for (
const auto tp : *FwdIDTracks) handleMuonTrack(
tp, xAOD::Muon::InnerDetectorTrackParticle, beamSpotWeight);
 
  444         ATH_CHECK(retrieveContainer(ctx, m_muonTracksName, MuonTracks));
 
  446             ATH_MSG_DEBUG(
"handling " << MuonTracks->size() << 
" " << m_muonTracksName);
 
  447             m_h_overview_nObjects[2]->Fill(MuonTracks->size(), beamSpotWeight);
 
  448             for (
const auto tp : *MuonTracks) handleMuonTrack(
tp, xAOD::Muon::MuonSpectrometerTrackParticle, beamSpotWeight);
 
  451         ATH_CHECK(retrieveContainer(ctx, m_muonExtrapolatedTracksName, MuonExtrapolatedTracks));
 
  452         if (MuonExtrapolatedTracks) {
 
  453             ATH_MSG_DEBUG(
"handling " << MuonExtrapolatedTracks->size() << 
" " << m_muonExtrapolatedTracksName);
 
  454             for (
const auto tp : *MuonExtrapolatedTracks)
 
  455                 handleMuonTrack(
tp, xAOD::Muon::ExtrapolatedMuonSpectrometerTrackParticle, beamSpotWeight);
 
  458         ATH_CHECK(retrieveContainer(ctx, m_muonMSOnlyExtrapolatedTracksName, MSOnlyMuonExtrapolatedTracks));
 
  460         if (MSOnlyMuonExtrapolatedTracks) {
 
  461             ATH_MSG_DEBUG(
"handling " << MSOnlyMuonExtrapolatedTracks->size() << 
" " << m_muonMSOnlyExtrapolatedTracksName);
 
  462             for (
const auto tp : *MSOnlyMuonExtrapolatedTracks)
 
  463                 handleMuonTrack(
tp, xAOD::Muon::MSOnlyExtrapolatedMuonSpectrometerTrackParticle, beamSpotWeight);
 
  467         ATH_CHECK(retrieveContainer(ctx, m_muonSegmentsTruthName, TruthMuonSegments));
 
  468         if (TruthMuonSegments) {
 
  469             m_h_overview_nObjects[3]->Fill(TruthMuonSegments->size(), beamSpotWeight);
 
  470             ATH_MSG_DEBUG(
"handling " << TruthMuonSegments->size() << 
" " << m_muonSegmentsTruthName);
 
  471             for (
const auto truthMuSeg : *TruthMuonSegments) handleTruthMuonSegment(truthMuSeg, TruthMuons, beamSpotWeight);
 
  475         ATH_CHECK(retrieveContainer(ctx, m_muonSegmentsName, MuonSegments));
 
  477             m_h_overview_nObjects[4]->Fill(MuonSegments->size(), beamSpotWeight);
 
  478             ATH_MSG_DEBUG(
"handling " << MuonSegments->size() << 
" " << m_muonSegmentsName);
 
  479             for (
const auto muSeg : *MuonSegments) handleMuonSegment(muSeg, beamSpotWeight);
 
  483         if (m_doTrigMuonValidation) {            
 
  484             auto chainGroups = m_trigDec->getChainGroup(
"HLT_.*mu.*");
 
  485             for (
auto& trig : chainGroups->getListOfTriggers()) {
 
  486                 if (m_trigDec->isPassed(trig, TrigDefs::EF_passedRaw)) {
 
  491             auto L1chainGroups = m_trigDec->getChainGroup(
"L1_MU.*");
 
  492             for (
auto& L1trig : L1chainGroups->getListOfTriggers()) {
 
  493                 if (m_trigDec->isPassed(L1trig, TrigDefs::EF_passedRaw))
 
  498             for (
auto mu : m_vRecoMuons) {
 
  499                 if (passesAcceptanceCuts(
mu) && std::abs(
mu->eta()) < 2.4) {
 
  500                     if (
mu->author() == 1) {
 
  501                         m_vRecoMuons_EffDen_CB.emplace_back(
mu);
 
  502                         ATH_MSG_DEBUG(
"##### m_vRecoMuons_EffDen_CB  pt:" << 
mu->pt() << 
"   phi:" << 
mu->phi() << 
"   eta:" << 
mu->eta());
 
  503                     } 
else if (
mu->author() == 5) {
 
  504                         m_vRecoMuons_EffDen_MS.emplace_back(
mu);
 
  505                         ATH_MSG_DEBUG(
"##### m_vRecoMuons_EffDen_MS  pt:" << 
mu->pt() << 
"   phi:" << 
mu->phi() << 
"   eta:" << 
mu->eta());
 
  511             if (m_doTrigMuonL1Validation) {
 
  513                 ATH_CHECK(retrieveContainer(ctx, m_muonL1TrigName, L1TrigMuons));
 
  514                 ATH_MSG_DEBUG(
"Retrieved L1 triggered muons " << L1TrigMuons->size());
 
  515                 for (
const auto TrigL1mu : *L1TrigMuons) handleMuonL1Trigger(TrigL1mu);
 
  519             if (m_doTrigMuonL2Validation) {
 
  522                 ATH_CHECK(retrieveContainer(ctx, m_muonL2SAName, L2SAMuons));
 
  523                 ATH_MSG_DEBUG(
"Retrieved L2 StandAlone triggered muons " << L2SAMuons->size());
 
  524                 if (L2SAMuons->size() != 0) {
 
  525                     for (
const auto L2SAmu : *L2SAMuons) {
 
  526                         ATH_MSG_DEBUG(
"Muon L2SA Trigger: pt " << L2SAmu->pt() << 
" phi " << L2SAmu->phi() << 
" eta " << L2SAmu->eta()
 
  527                                                                << 
" roiWord " << L2SAmu->roiWord() << 
" sAddress " << L2SAmu->sAddress());
 
  528                         m_vL2SAMuons.emplace_back(L2SAmu);
 
  530                     for (
const auto& 
mu : m_vL2SAMuons) {
 
  531                         if (
mu->pt() != 0.) {
 
  532                             m_vL2SAMuonsSelected.emplace_back(
mu);
 
  536                     for (
unsigned int i = 0; 
i < m_vL2SAMuons.size(); 
i++) {
 
  537                         unsigned int cont = 0;
 
  538                         for (
unsigned int j = 0; j < m_vL2SAMuonsSelected.size(); j++) {
 
  539                             if (((m_vL2SAMuons.at(
i)->pt()) != 0.) && ((
deltaR(m_vL2SAMuonsSelected.at(j), m_vL2SAMuons.at(
i))) > 0.1))
 
  541                             if (cont == m_vL2SAMuonsSelected.size()) {
 
  542                                 m_vL2SAMuonsSelected.emplace_back(m_vL2SAMuons.at(
i));
 
  547                     for (
unsigned int i = 0; 
i < m_vL2SAMuonsSelected.size(); 
i++) { handleMuonL2Trigger(m_vL2SAMuonsSelected.at(
i)); }
 
  548                     L2SATriggerResolution();
 
  550                 for (
const auto& muonItem : m_muonItems) {
 
  551                     std::vector<Trig::Feature<xAOD::L2StandAloneMuonContainer> > vec_muons;
 
  552                     TString muonItem_str = (TString)muonItem;
 
  553                     if (muonItem_str.Contains(
"_OR_")) {
 
  554                         muonItem_str.ReplaceAll(
"_OR_", 
" ");
 
  556                         std::vector<TString> v_subchains;
 
  558                         for (
int i = 0; 
i < (
int)v_subchains.size(); 
i++) {
 
  560                             std::vector<Trig::Feature<xAOD::L2StandAloneMuonContainer> > vec_muons_1 =
 
  562                             for (
const auto& mufeat : vec_muons_1) { vec_muons.emplace_back(mufeat); }
 
  568                     ATH_MSG_DEBUG(
"Size of vector Trig::Feature<xAOD::L2StandAloneMuonContainer> for chain " << muonItem << 
" = " 
  569                                                                                                              << vec_muons.size());
 
  570                     for (
const auto& mufeat : vec_muons) {
 
  571                         ATH_MSG_DEBUG(muonItem << 
"  vec_muons.size() = " << vec_muons.size()
 
  572                                                << 
"  mufeat.cptr()->size() = " << mufeat.cptr()->size());
 
  573                         for (
unsigned int i = 0; 
i < mufeat.cptr()->
size(); 
i++) {
 
  574                             ATH_MSG_DEBUG(
"#####" << muonItem << 
"  L2SA feature pt: " << (*mufeat.cptr())[
i]->pt()
 
  575                                                   << 
"   eta: " << (*mufeat.cptr())[
i]->eta() << 
"   phi: " << (*mufeat.cptr())[
i]->phi());
 
  583                 ATH_CHECK(retrieveContainer(ctx, m_muonL2CBName, L2CBMuons));
 
  584                 ATH_MSG_DEBUG(
"Retrieved L2 Combined triggered muons " << L2CBMuons->size());
 
  585                 if (L2CBMuons->size() != 0) {
 
  586                     for (
const auto L2CBmu : *L2CBMuons) {
 
  587                         ATH_MSG_DEBUG(
"Muon L2CB Trigger: pt " << L2CBmu->pt() << 
" phi " << L2CBmu->phi() << 
" eta " << L2CBmu->eta());
 
  588                         m_vL2CBMuons.emplace_back(L2CBmu);
 
  590                     for (
unsigned int i = 0; 
i < m_vL2CBMuons.size(); 
i++) {
 
  591                         if ((m_vL2CBMuons.at(
i)->pt()) != 0.) {
 
  592                             m_vL2CBMuonsSelected.emplace_back(m_vL2CBMuons.at(
i));
 
  596                     for (
unsigned int i = 0; 
i < m_vL2CBMuons.size(); 
i++) {
 
  597                         unsigned int cont = 0;
 
  598                         for (
unsigned int j = 0; j < m_vL2CBMuonsSelected.size(); j++) {
 
  599                             if (((m_vL2CBMuons.at(
i)->pt()) != 0.) && ((
deltaR(m_vL2CBMuonsSelected.at(j), m_vL2CBMuons.at(
i))) > 0.1))
 
  601                             if (cont == m_vL2CBMuonsSelected.size()) {
 
  602                                 m_vL2CBMuonsSelected.emplace_back(m_vL2CBMuons.at(
i));
 
  607                     for (
unsigned int i = 0; 
i < m_vL2CBMuonsSelected.size(); 
i++) { handleMuonL2Trigger(m_vL2CBMuonsSelected.at(
i)); }
 
  608                     L2CBTriggerResolution();
 
  610                 for (
const auto& muonItem : m_muonItems) {
 
  611                     std::vector<Trig::Feature<xAOD::L2CombinedMuonContainer> > vec_muons;
 
  612                     TString muonItem_str = (TString)muonItem;
 
  613                     if (muonItem_str.Contains(
"_OR_")) {
 
  614                         muonItem_str.ReplaceAll(
"_OR_", 
" ");
 
  616                         std::vector<TString> v_subchains;
 
  618                         for (
int i = 0; 
i < (
int)v_subchains.size(); 
i++) {
 
  620                             std::vector<Trig::Feature<xAOD::L2CombinedMuonContainer> > vec_muons_1 =
 
  622                             for (
const auto& mufeat : vec_muons_1) { vec_muons.emplace_back(mufeat); }
 
  628                     ATH_MSG_DEBUG(
"Size of vector Trig::Feature<xAOD::L2CombinedMuonContainer> for chain " << muonItem << 
" = " 
  629                                                                                                            << vec_muons.size());
 
  630                     for (
const auto& mufeat : vec_muons) {
 
  631                         ATH_MSG_DEBUG(muonItem << 
"  vec_muons.size() = " << vec_muons.size()
 
  632                                                << 
"  mufeat.cptr()->size() = " << mufeat.cptr()->size());
 
  633                         for (
unsigned int i = 0; 
i < mufeat.cptr()->
size(); 
i++) {
 
  634                             ATH_MSG_DEBUG(
"#####" << muonItem << 
"  L2CB feature pt: " << (*mufeat.cptr())[
i]->pt()
 
  635                                                   << 
"   eta: " << (*mufeat.cptr())[
i]->eta() << 
"   phi: " << (*mufeat.cptr())[
i]->phi());
 
  642             if (m_doTrigMuonEFValidation) {
 
  645                 ATH_CHECK(retrieveContainer(ctx, m_muonEFCombTrigName, EFCombTrigMuons));
 
  646                 ATH_CHECK(retrieveContainer(ctx, m_muonL1TrigName, L1TrigMuons));
 
  647                 ATH_MSG_DEBUG(
"Retrieved EF triggered muons " << EFCombTrigMuons->size());
 
  648                 if (EFCombTrigMuons->size() != 0) {
 
  649                     for (
const auto Trigmu : *EFCombTrigMuons) {
 
  650                         ATH_MSG_DEBUG(
"Muon EF Trigger: pt " << Trigmu->pt() << 
" phi " << Trigmu->phi() << 
" eta " << Trigmu->eta()
 
  651                                                              << 
"   author" << Trigmu->author());
 
  652                         m_vEFMuons.emplace_back(Trigmu);
 
  654                     m_vEFMuonsSelected.emplace_back(m_vEFMuons.at(0));
 
  655                     for (
unsigned int i = 0; 
i < m_vEFMuons.size(); 
i++) {
 
  656                         unsigned int cont = 0;
 
  657                         for (
unsigned int j = 0; j < m_vEFMuonsSelected.size(); j++) {
 
  658                             if (((
deltaR(m_vEFMuonsSelected.at(j), m_vEFMuons.at(
i))) > 0.1) ||
 
  659                                 ((m_vEFMuons.at(
i)->author() - m_vEFMuonsSelected.at(j)->author()) != 0))
 
  661                             if (cont == m_vEFMuonsSelected.size()) {
 
  662                                 m_vEFMuonsSelected.emplace_back(m_vEFMuons.at(
i));
 
  667                     for (
unsigned int i = 0; 
i < m_vEFMuonsSelected.size(); 
i++) { handleMuonTrigger(m_vEFMuonsSelected.at(
i)); }
 
  668                     EFTriggerResolution();
 
  671                     for (
const auto truthMu : *TruthMuons) {
 
  672                         ATH_MSG_DEBUG(
"TRUTH:: pt=" << truthMu->pt() << 
"  eta=" << truthMu->eta() << 
"  phi=" << truthMu->phi());
 
  677                 for (
const auto& muonItem : m_muonItems) {
 
  678                     m_vRecoMuons_EffDen = m_vRecoMuons_EffDen_CB;
 
  679                     m_SelectedAuthor = 1;
 
  680                     if ((muonItem.find(
"msonly") != std::string::npos)) {
 
  681                         m_vRecoMuons_EffDen = m_vRecoMuons_EffDen_MS;
 
  682                         m_SelectedAuthor = 5;
 
  684                     std::vector<Trig::Feature<xAOD::MuonContainer> > vec_muons;
 
  685                     TString muonItem_str = (TString)muonItem;
 
  686                     if (muonItem_str.Contains(
"_OR_")) {
 
  687                         muonItem_str.ReplaceAll(
"_OR_", 
" ");
 
  689                         std::vector<TString> v_subchains;
 
  691                         for (
int i = 0; 
i < (
int)v_subchains.size(); 
i++) {
 
  694                             for (
const auto& mufeat : vec_muons_1) { vec_muons.emplace_back(mufeat); }
 
  700                     ATH_MSG_DEBUG(
"Size of vector Trig::Feature<xAOD::MuonContainer> for chain " << muonItem << 
" = " << vec_muons.size());
 
  701                     for (
const auto& mufeat : vec_muons) {
 
  702                         ATH_MSG_DEBUG(muonItem << 
"  vec_muons.size() = " << vec_muons.size()
 
  703                                                << 
"  mufeat.cptr()->size() = " << mufeat.cptr()->size());
 
  704                         for (
unsigned int i = 0; 
i < mufeat.cptr()->
size(); 
i++) {
 
  705                             ATH_MSG_DEBUG(
"#####" << muonItem << 
"  EF feature pt: " << (*mufeat.cptr())[
i]->pt()
 
  706                                                   << 
"   eta: " << (*mufeat.cptr())[
i]->eta() << 
"   phi: " << (*mufeat.cptr())[
i]->phi()
 
  707                                                   << 
"   author: " << (*mufeat.cptr())[
i]->author());
 
  708                             for (
unsigned int j = 0; j < m_selectMuonCategories.size(); j++) {
 
  709                                 if (m_selectMuonCategories[j] == ALL) {
 
  710                                     if (((*mufeat.cptr())[
i]->author()) == m_SelectedAuthor)
 
  711                                         m_TriggerMuonValidationPlots[j]->fillFeatPlots(*(*mufeat.cptr())[
i], muonItem);
 
  716                     for (
unsigned int k = 0; 
k < m_vRecoMuons_EffDen.size(); 
k++) {
 
  717                         bool break_flag = 
false;
 
  718                         for (
unsigned int j = 0; j < m_selectMuonCategories.size(); j++) {
 
  719                             if (m_selectMuonCategories[j] == ALL) {
 
  720                                 m_TriggerMuonValidationPlots[j]->fillDenEff(*m_vRecoMuons_EffDen.at(
k), muonItem);
 
  723                         for (
const auto& mufeat : vec_muons) {
 
  724                             for (
unsigned int i = 0; 
i < mufeat.cptr()->
size(); 
i++) {
 
  725                                 if ((((*mufeat.cptr())[
i]->author()) == m_SelectedAuthor) &&
 
  726                                     (
deltaR((*mufeat.cptr())[
i], m_vRecoMuons_EffDen.at(
k)) < 0.1)) {
 
  729                                                   << muonItem << 
"         pt: " << m_vRecoMuons_EffDen.at(
k)->pt() << 
"   eta: " 
  730                                                   << m_vRecoMuons_EffDen.at(
k)->eta() << 
"   phi: " << m_vRecoMuons_EffDen.at(
k)->phi()
 
  731                                                   << 
"   author: " << m_vRecoMuons_EffDen.at(
k)->author());
 
  733                                                   << muonItem << 
"   pt: " << (*mufeat.cptr())[
i]->pt()
 
  734                                                   << 
"   eta: " << (*mufeat.cptr())[
i]->eta() << 
"   phi: " << (*mufeat.cptr())[
i]->phi()
 
  735                                                   << 
"   author: " << (*mufeat.cptr())[
i]->author() << 
"    rel_p " 
  736                                                   << (std::abs(((*mufeat.cptr())[
i]->pt() - m_vRecoMuons_EffDen.at(
k)->pt()) /
 
  737                                                                (m_vRecoMuons_EffDen.at(
k)->pt()))));
 
  738                                     for (
unsigned int j = 0; j < m_selectMuonCategories.size(); j++) {
 
  739                                         if (m_selectMuonCategories[j] == ALL) {
 
  740                                             m_TriggerMuonValidationPlots[j]->fillNumEff(*m_vRecoMuons_EffDen.at(
k), muonItem);
 
  749                             if (break_flag) 
break;
 
  754                 for (
const auto& L1MuonItem : m_L1MuonItems) {
 
  755                     m_vRecoMuons_EffDen = m_vRecoMuons_EffDen_CB;
 
  756                     m_SelectedAuthor = 1;
 
  758                     if (L1MuonItem == 
"L1_MU4") 
threshold = 4000;
 
  759                     else if (L1MuonItem == 
"L1_MU6") 
threshold = 6000;
 
  760                     else if (L1MuonItem == 
"L1_MU10") 
threshold = 10000;
 
  761                     else if (L1MuonItem == 
"L1_MU11") 
threshold = 11000;
 
  762                     else if (L1MuonItem == 
"L1_MU15") 
threshold = 15000;
 
  763                     else if (L1MuonItem == 
"L1_MU20") 
threshold = 20000;
 
  764                     for (
const auto TrigL1mu : *L1TrigMuons) {
 
  765                         for (
unsigned int j = 0; j < m_selectMuonCategories.size(); j++) {
 
  766                             if (m_selectMuonCategories[j] == ALL) {
 
  768                                     m_TriggerMuonValidationPlots[j]->fillFeatPlots(*TrigL1mu, L1MuonItem);
 
  772                     for (
unsigned int k = 0; 
k < m_vRecoMuons_EffDen.size(); 
k++) {
 
  773                         for (
unsigned int j = 0; j < m_selectMuonCategories.size(); j++) {
 
  774                             if (m_selectMuonCategories[j] == ALL) {
 
  775                                 m_TriggerMuonValidationPlots[j]->fillDenL1Eff(*m_vRecoMuons_EffDen.at(
k), L1MuonItem);
 
  778                         for (
const auto TrigL1mu : *L1TrigMuons) {
 
  779                             if (((TrigL1mu->thrValue()) >= 
threshold) &&
 
  780                                 (sqrt(
pow(m_vRecoMuons_EffDen.at(
k)->eta() - TrigL1mu->eta(), 2.) +
 
  781                                       pow(m_vRecoMuons_EffDen.at(
k)->phi() - TrigL1mu->phi(), 2.)) < 0.2)) {
 
  783                                               << L1MuonItem << 
"         pt: " << m_vRecoMuons_EffDen.at(
k)->pt() << 
"   eta: " 
  784                                               << m_vRecoMuons_EffDen.at(
k)->eta() << 
"   phi: " << m_vRecoMuons_EffDen.at(
k)->phi()
 
  785                                               << 
"   author: " << m_vRecoMuons_EffDen.at(
k)->author());
 
  786                                 ATH_MSG_DEBUG(
"   $$$ L1 feature " << L1MuonItem << 
"   pt: " << TrigL1mu->thrValue()
 
  787                                                                    << 
"   eta: " << TrigL1mu->eta() << 
"   phi: " << TrigL1mu->phi());
 
  788                                 for (
unsigned int j = 0; j < m_selectMuonCategories.size(); j++) {
 
  789                                     if (m_selectMuonCategories[j] == ALL) {
 
  790                                         m_TriggerMuonValidationPlots[j]->fillNumL1Eff(*m_vRecoMuons_EffDen.at(
k), L1MuonItem);
 
  799                 for (
unsigned int m = 0; 
m < m_muonItems.size(); 
m++) {
 
  800                     std::vector<Trig::Feature<xAOD::MuonContainer> > vec_muons;
 
  801                     TString muonItem_str = (TString)m_muonItems[
m];
 
  802                     if (muonItem_str.Contains(
"_OR_")) {
 
  803                         muonItem_str.ReplaceAll(
"_OR_", 
" ");
 
  805                         std::vector<TString> v_subchains;
 
  807                         for (
int i = 0; 
i < (
int)v_subchains.size(); 
i++) {
 
  810                             for (
const auto& mufeat : vec_muons_1) { vec_muons.emplace_back(mufeat); }
 
  816                     m_vRecoMuons_EffDen = m_vRecoMuons_EffDen_CB;
 
  817                     m_SelectedAuthor = 1;
 
  818                     if ((m_muonItems[
m].
find(
"msonly") != std::string::npos)) {
 
  819                         m_vRecoMuons_EffDen = m_vRecoMuons_EffDen_MS;
 
  820                         m_SelectedAuthor = 5;
 
  823                     if (m_L1Seed[
m] == 
"L1_MU4") 
threshold = 4000;
 
  824                     if (m_L1Seed[
m] == 
"L1_MU6") 
threshold = 6000;
 
  825                     if (m_L1Seed[
m] == 
"L1_MU10") 
threshold = 10000;
 
  826                     if (m_L1Seed[
m] == 
"L1_MU11") 
threshold = 11000;
 
  827                     if (m_L1Seed[
m] == 
"L1_MU15") 
threshold = 15000;
 
  828                     if (m_L1Seed[
m] == 
"L1_MU20") 
threshold = 20000;
 
  829                     for (
unsigned int k = 0; 
k < m_vRecoMuons_EffDen.size(); 
k++) {
 
  830                         bool break_flag = 
false;
 
  831                         for (
const auto TrigL1mu : *L1TrigMuons) {
 
  832                             if (((TrigL1mu->thrValue()) >= 
threshold) &&
 
  833                                 (sqrt(
pow(m_vRecoMuons_EffDen.at(
k)->eta() - TrigL1mu->eta(), 2.) +
 
  834                                       pow(m_vRecoMuons_EffDen.at(
k)->phi() - TrigL1mu->phi(), 2.)) < 0.2)) {
 
  835                                 for (
unsigned int j = 0; j < m_selectMuonCategories.size(); j++) {
 
  836                                     if (m_selectMuonCategories[j] == ALL) {
 
  837                                         m_TriggerMuonValidationPlots[j]->fillDenRELEff(*m_vRecoMuons_EffDen.at(
k), m_muonItems[
m]);
 
  840                                 for (
const auto& mufeat : vec_muons) {
 
  841                                     for (
unsigned int i = 0; 
i < mufeat.cptr()->size(); 
i++) {
 
  842                                         if ((((*mufeat.cptr())[
i]->author()) == m_SelectedAuthor) &&
 
  843                                             (
deltaR((*mufeat.cptr())[
i], m_vRecoMuons_EffDen.at(
k)) < 0.1)) {
 
  845                                             for (
unsigned int j = 0; j < m_selectMuonCategories.size(); j++) {
 
  846                                                 if (m_selectMuonCategories[j] == ALL) {
 
  847                                                     m_TriggerMuonValidationPlots[j]->fillNumRELEff(*m_vRecoMuons_EffDen.at(
k),
 
  854                                     if (break_flag) 
break;
 
  863         return StatusCode::SUCCESS;
 
  871         unsigned int thisMuonCategory = ALL;  
 
  873         for (
unsigned int i = 0; 
i < m_selectMuonCategories.size(); 
i++) {
 
  874             if (m_selectMuonCategories[
i] == ALL || m_selectMuonCategories[
i] == thisMuonCategory) {
 
  875                 m_muonSegmentValidationPlots[
i]->fill(truthMuSeg, muSeg,
 
  889         if (!m_isData) m_oUnmatchedRecoMuonSegmentPlots->fill(*muSeg, 
weight);
 
  890         for (
unsigned int i = 0; 
i < m_selectMuonCategories.size(); 
i++) {
 
  891             if (m_selectMuonCategories[
i] == ALL) {
 
  892                 m_muonSegmentValidationPlots[
i]->fill(muSeg, 
weight);
 
  900         if (!m_selectComissioning && 
mu->allAuthors() & comm_bit) 
return;
 
  905         std::unique_ptr<xAOD::Muon> mu_c;
 
  907             mu_c = getCorrectedMuon(*
mu);
 
  916             if (m_vZmumuMuons.size() > 0) {
 
  917                 thisMuonCategory = REST;
 
  918                 if (
std::find(m_vZmumuMuons.begin(), m_vZmumuMuons.end(), 
mu) != m_vZmumuMuons.end()) { thisMuonCategory = PROMPT; }
 
  921             for (
unsigned int i = 0; 
i < m_selectMuonCategories.size(); 
i++) {
 
  922                 if (m_selectMuonCategories[
i] == ALL or m_selectMuonCategories[
i] == thisMuonCategory) {
 
  925                     m_muonValidationPlots[
i]->fill(*mu_c, 
weight);
 
  926                     if (smu) m_slowMuonValidationPlots[
i]->fill(*smu, *mu_c, 
weight);
 
  928                     m_muonValidationPlots[
i]->fillTreeBranches(*mu_c);
 
  936         xAOD::Muon::Quality my_quality = m_muonSelectionTool->getQuality(*mu_c);
 
  937         if (my_quality <= xAOD::Muon::Medium && m_isoTool->
accept(*mu_c)) m_vRecoMuons.emplace_back(
mu);
 
  947         if (!m_isData) m_oUnmatchedRecoMuonPlots->fill(*mu_c, 
weight);
 
  949         m_h_overview_reco_category->Fill(
"Other", 
weight);
 
  950         m_h_overview_reco_authors[3]->Fill(
mu->author(), 
weight);
 
  952         for (
unsigned int i = 0; 
i < m_selectMuonCategories.size(); 
i++) {
 
  953             if (m_selectMuonCategories[
i] == ALL) {
 
  955                   m_muonValidationPlots[
i]->fill(*mu_c);
 
  956                   if (smu) m_slowMuonValidationPlots[
i]->fill(*smu, *mu_c, 
weight);
 
  958                   m_muonValidationPlots[
i]->fillTreeBranches(*mu_c);
 
  968         if (!m_slowMuonsName.empty()) {
 
  969             smu = findRecoSlowMuon(truthMu);
 
  980             mu = findRecoMuon(truthMu);
 
  983         if (msgLvl(
MSG::DEBUG)) printTruthMuonDebug(truthMu, 
mu);
 
  984         if (!passesAcceptanceCuts(truthMu)) 
return;
 
  986         std::unique_ptr<xAOD::Muon> mu_c;
 
  989                 mu_c = getCorrectedMuon(*
mu);
 
  996         unsigned int thisMuonCategory = getMuonTruthCategory(truthMu);
 
  997         for (
unsigned int i = 0; 
i < m_selectMuonCategories.size(); 
i++) {
 
  998             if (m_selectMuonCategories[
i] == ALL || m_selectMuonCategories[
i] == thisMuonCategory) {
 
 1000                 m_muonValidationPlots[
i]->fill(
 
 1001                     truthMu, mu_c.get(), m_MSTracks,
 
 1003                 if (!m_slowMuonsName.empty()) m_slowMuonValidationPlots[
i]->fill(truthMu, smu, mu_c.get(), 
weight);
 
 1005                 m_muonValidationPlots[
i]->fillTreeBranches(truthMu, mu_c.get(), m_MSTracks);
 
 1009             m_h_overview_reco_category->Fill(thisMuonCategory - 1, 
weight);
 
 1010             m_h_overview_reco_authors[thisMuonCategory - 1]->Fill(mu_c->
author(), 
weight);
 
 1011         } 
else if (!m_isData)
 
 1012             m_oUnmatchedTruthMuonPlots->fill(*truthMu, 
weight);
 
 1022         bool passesMuonTrackSel = 
false;
 
 1023         if (
type == xAOD::Muon::InnerDetectorTrackParticle) { passesMuonTrackSel = m_trackSelector->decision(*
tp); }
 
 1026             if (
type == xAOD::Muon::InnerDetectorTrackParticle) {
 
 1029                 if (m_vZmumuIDTracks.size() > 0) {
 
 1030                     thisTrkCategory = REST;
 
 1031                     for (
const auto& zmu : m_vZmumuIDTracks) {
 
 1033                             thisTrkCategory = PROMPT;
 
 1039                 for (
unsigned int i = 0; 
i < m_selectMuonCategories.size(); 
i++) {
 
 1040                     if (m_selectMuonCategories[
i] == ALL || m_selectMuonCategories[
i] == thisTrkCategory) {
 
 1041                         m_muonIDTrackValidationPlots[
i]->fill(*
tp, 
weight);
 
 1042                         if (passesMuonTrackSel) m_muonIDSelectedTrackValidationPlots[
i]->fill(*
tp, 
weight);
 
 1045             } 
else if (
type == xAOD::Muon::MuonSpectrometerTrackParticle)
 
 1046                 m_muonMSTrackValidationPlots[ALL]->fill(*
tp, 
weight);
 
 1047             else if (
type == xAOD::Muon::ExtrapolatedMuonSpectrometerTrackParticle)
 
 1048                 m_muonMETrackValidationPlots[ALL]->fill(*
tp, 
weight);
 
 1049             else if (
type == xAOD::Muon::MSOnlyExtrapolatedMuonSpectrometerTrackParticle)
 
 1050                 m_muonMSOnlyMETrackValidationPlots[ALL]->fill(*
tp, 
weight);
 
 1060             if (
type == xAOD::Muon::InnerDetectorTrackParticle) 
return;
 
 1061             if (!passesAcceptanceCuts(
tp)) 
return;
 
 1063             for (
unsigned int i = 0; 
i < m_selectMuonCategories.size(); 
i++) {
 
 1064                 if (m_selectMuonCategories[
i] == ALL) {
 
 1070                     if (
type == xAOD::Muon::MuonSpectrometerTrackParticle) {
 
 1071                         if (!m_isData) m_oUnmatchedRecoMuonTrackPlots->fill(*
tp, 
weight);
 
 1072                         m_muonMSTrackValidationPlots[
i]->fill(*
tp, 
weight);
 
 1073                     } 
else if (
type == xAOD::Muon::ExtrapolatedMuonSpectrometerTrackParticle) {
 
 1074                         m_muonMETrackValidationPlots[
i]->fill(*
tp, 
weight);
 
 1075                     } 
else if (
type == xAOD::Muon::MSOnlyExtrapolatedMuonSpectrometerTrackParticle) {
 
 1076                         m_muonMSOnlyMETrackValidationPlots[
i]->fill(*
tp, 
weight);
 
 1085                 xAOD::Muon::InnerDetectorTrackParticle) {  
 
 1086                 if ((*truthLink)->absPdgId() != 13 || !
MC::isStable(*truthLink)) 
return;     
 
 1090             if (!passesAcceptanceCuts(*truthLink)) 
return;
 
 1091             unsigned int thisMuonCategory = getMuonTruthCategory(
tp);
 
 1093             for (
unsigned int i = 0; 
i < m_selectMuonCategories.size(); 
i++) {
 
 1094                 if (m_selectMuonCategories[
i] == ALL || m_selectMuonCategories[
i] == thisMuonCategory) {
 
 1095                     if (
type == xAOD::Muon::InnerDetectorTrackParticle) {
 
 1096                         if (!m_fwdtracksName.empty() && std::abs((*truthLink)->eta()) > 2.5)
 
 1097                             m_muonIDForwardTrackValidationPlots[
i]->fill(*truthLink, 
tp, 
weight);
 
 1098                         else if (!m_tracksName.empty()) {
 
 1099                             m_muonIDTrackValidationPlots[
i]->fill(*truthLink, 
tp, 
weight);
 
 1100                             if (passesMuonTrackSel) m_muonIDSelectedTrackValidationPlots[
i]->fill(*truthLink, 
tp, 
weight);
 
 1102                     } 
else if (
type == xAOD::Muon::MuonSpectrometerTrackParticle) {
 
 1103                         m_muonMSTrackValidationPlots[
i]->fill(*truthLink, 
tp, 
weight);
 
 1104                     } 
else if (
type == xAOD::Muon::ExtrapolatedMuonSpectrometerTrackParticle) {
 
 1105                         m_muonMETrackValidationPlots[
i]->fill(*truthLink, 
tp, 
weight);
 
 1106                     } 
else if (
type == xAOD::Muon::MSOnlyExtrapolatedMuonSpectrometerTrackParticle) {
 
 1107                         m_muonMSOnlyMETrackValidationPlots[
i]->fill(*truthLink, 
tp, 
weight);
 
 1116     void MuonPhysValMonitoringTool::handleMuonL1Trigger(
const xAOD::MuonRoI* TrigL1mu) {
 
 1118         for (
unsigned int i = 0; 
i < m_selectMuonCategories.size(); 
i++) {
 
 1119             if (m_selectMuonCategories[
i] == ALL) {
 
 1120                 m_TriggerMuonValidationPlots[
i]->fill(*TrigL1mu);
 
 1127         for (
unsigned int i = 0; 
i < m_selectMuonCategories.size(); 
i++) {
 
 1128             if (m_selectMuonCategories[
i] == ALL) {
 
 1129                 m_TriggerMuonValidationPlots[
i]->fill(*L2SAMu);
 
 1133         ATH_MSG_DEBUG(
"   ==> Geometrical selection of Muon L2SA Trigger :  pt " << L2SAMu->
pt() << 
" phi " << L2SAMu->
phi() << 
" eta " 
 1134                                                                                  << L2SAMu->
eta() << 
" roiWord " << L2SAMu->
roiWord()
 
 1135                                                                                  << 
" sAddress " << L2SAMu->
sAddress());
 
 1138     void MuonPhysValMonitoringTool::L2SATriggerResolution() {
 
 1139         int k_L2SAMu_MinDeltaR = -1;
 
 1140         float MinDeltaR = 0.;
 
 1141         ATH_MSG_DEBUG(
" m_vL2SAMuons.size()" << m_vL2SAMuons.size());
 
 1142         for (
unsigned int i = 0; 
i < m_vRecoMuons.size(); 
i++) {
 
 1143             ATH_MSG_DEBUG(
":: TEST: listing all Recomu pt=" << m_vRecoMuons.at(
i)->pt() << 
"  eta=" << m_vRecoMuons.at(
i)->eta() << 
"  phi=" 
 1144                                                             << m_vRecoMuons.at(
i)->phi() << 
"    auth=" << m_vRecoMuons.at(
i)->author());
 
 1146         for (
unsigned int i = 0; 
i < m_vRecoMuons.size(); 
i++) {
 
 1147             if ((m_vRecoMuons.at(
i)->author() != 1) || (std::abs(m_vRecoMuons.at(
i)->eta()) > 2.4)) 
continue;
 
 1148             ATH_MSG_DEBUG(
":::: TEST: Recomu pt=" << m_vRecoMuons.at(
i)->pt() << 
"  eta=" << m_vRecoMuons.at(
i)->eta()
 
 1149                                                   << 
"  phi=" << m_vRecoMuons.at(
i)->phi() << 
"    auth=" << m_vRecoMuons.at(
i)->author());
 
 1150             k_L2SAMu_MinDeltaR = -1;
 
 1152             ATH_MSG_DEBUG(
"==============>>>>      k_L2SAMu_MinDeltaR=" << k_L2SAMu_MinDeltaR << 
"    MinDeltaR" << MinDeltaR);
 
 1153             for (
unsigned int k = 0; 
k < m_vL2SAMuons.size(); 
k++) {
 
 1154                 ATH_MSG_DEBUG(
"  :::::::: TEST: L2SA pt=" << m_vL2SAMuons.at(
k)->pt() << 
"  eta=" << m_vL2SAMuons.at(
k)->eta()
 
 1155                                                           << 
"  phi=" << m_vL2SAMuons.at(
k)->phi()
 
 1156                                                           << 
"  DeltaR=" << 
deltaR(m_vRecoMuons.at(
i), m_vL2SAMuons.at(
k)));
 
 1157                 if ((
deltaR(m_vRecoMuons.at(
i), m_vL2SAMuons.at(
k)) < 0.1 &&
 
 1158                      (
deltaR(m_vRecoMuons.at(
i), m_vL2SAMuons.at(
k)) < MinDeltaR))) {
 
 1159                     k_L2SAMu_MinDeltaR = 
k;
 
 1160                     MinDeltaR = 
deltaR(m_vRecoMuons.at(
i), m_vL2SAMuons.at(
k));
 
 1161                     ATH_MSG_DEBUG(
"==============>>>>   taken!!!!     k_L2SAMu_MinDeltaR=" << k_L2SAMu_MinDeltaR << 
"    MinDeltaR" 
 1165             if (k_L2SAMu_MinDeltaR == -1) 
continue;
 
 1166             for (
unsigned int c = 0; 
c < m_selectMuonCategories.size(); 
c++) {
 
 1167                 if (m_selectMuonCategories[
c] == ALL) {
 
 1168                     m_TriggerMuonValidationPlots[
c]->fill(*m_vL2SAMuons.at(k_L2SAMu_MinDeltaR), *m_vRecoMuons.at(
i));  
 
 1175         for (
unsigned int i = 0; 
i < m_selectMuonCategories.size(); 
i++) {
 
 1176             if (m_selectMuonCategories[
i] == ALL) {
 
 1177                 m_TriggerMuonValidationPlots[
i]->fill(*L2CBMu);
 
 1181         ATH_MSG_DEBUG(
"   ==> Geometrical selection of Muon L2CB Trigger :  pt " << L2CBMu->
pt() << 
" phi " << L2CBMu->
phi() << 
" eta " 
 1185     void MuonPhysValMonitoringTool::L2CBTriggerResolution() {
 
 1186         int k_L2CBMu_MinDeltaR = -1;
 
 1187         float MinDeltaR = 0.;
 
 1188         ATH_MSG_DEBUG(
" m_vL2CBMuons.size()" << m_vL2CBMuons.size());
 
 1189         for (
unsigned int i = 0; 
i < m_vRecoMuons.size(); 
i++) {
 
 1190             ATH_MSG_DEBUG(
":: TEST: listing all Recomu pt=" << m_vRecoMuons.at(
i)->pt() << 
"  eta=" << m_vRecoMuons.at(
i)->eta() << 
"  phi=" 
 1191                                                             << m_vRecoMuons.at(
i)->phi() << 
"    auth=" << m_vRecoMuons.at(
i)->author());
 
 1193         for (
unsigned int i = 0; 
i < m_vRecoMuons.size(); 
i++) {
 
 1194             if ((m_vRecoMuons.at(
i)->author() != 1) || (std::abs(m_vRecoMuons.at(
i)->eta()) > 2.4)) 
continue;
 
 1195             ATH_MSG_DEBUG(
":::: TEST: Recomu pt=" << m_vRecoMuons.at(
i)->pt() << 
"  eta=" << m_vRecoMuons.at(
i)->eta()
 
 1196                                                   << 
"  phi=" << m_vRecoMuons.at(
i)->phi() << 
"    auth=" << m_vRecoMuons.at(
i)->author());
 
 1197             k_L2CBMu_MinDeltaR = -1;
 
 1199             ATH_MSG_DEBUG(
"==============>>>>      k_L2CBMu_MinDeltaR=" << k_L2CBMu_MinDeltaR << 
"    MinDeltaR" << MinDeltaR);
 
 1200             for (
unsigned int k = 0; 
k < m_vL2CBMuons.size(); 
k++) {
 
 1201                 ATH_MSG_DEBUG(
"  :::::::: TEST: L2CB pt=" << m_vL2CBMuons.at(
k)->pt() << 
"  eta=" << m_vL2CBMuons.at(
k)->eta()
 
 1202                                                           << 
"  phi=" << m_vL2CBMuons.at(
k)->phi()
 
 1203                                                           << 
"  DeltaR=" << 
deltaR(m_vRecoMuons.at(
i), m_vL2CBMuons.at(
k)));
 
 1204                 if ((
deltaR(m_vRecoMuons.at(
i), m_vL2CBMuons.at(
k)) < 0.1 &&
 
 1205                      (
deltaR(m_vRecoMuons.at(
i), m_vL2CBMuons.at(
k)) < MinDeltaR))) {
 
 1206                     k_L2CBMu_MinDeltaR = 
k;
 
 1207                     MinDeltaR = 
deltaR(m_vRecoMuons.at(
i), m_vL2CBMuons.at(
k));
 
 1208                     ATH_MSG_DEBUG(
"==============>>>>   taken!!!!     k_L2CBMu_MinDeltaR=" << k_L2CBMu_MinDeltaR << 
"    MinDeltaR" 
 1212             if (k_L2CBMu_MinDeltaR == -1) 
continue;
 
 1213             for (
unsigned int c = 0; 
c < m_selectMuonCategories.size(); 
c++) {
 
 1214                 if (m_selectMuonCategories[
c] == ALL) {
 
 1215                     m_TriggerMuonValidationPlots[
c]->fill(*m_vL2CBMuons.at(k_L2CBMu_MinDeltaR), *m_vRecoMuons.at(
i));  
 
 1221     void MuonPhysValMonitoringTool::handleMuonTrigger(
const xAOD::Muon* EFMu) {
 
 1222         for (
unsigned int i = 0; 
i < m_selectMuonCategories.size(); 
i++) {
 
 1223             if (m_selectMuonCategories[
i] == ALL) {
 
 1224                 m_TriggerMuonValidationPlots[
i]->fill(*EFMu);
 
 1228         ATH_MSG_DEBUG(
"==> Geometrical selection of EF Trigger muons: pt " << EFMu->
pt() << 
" phi " << EFMu->
phi() << 
" eta " << EFMu->
eta()
 
 1229                                                                            << 
" author " << EFMu->
author());
 
 1232     void MuonPhysValMonitoringTool::EFTriggerResolution() {
 
 1233         int k_EFMu_MinDeltaR = -1;
 
 1234         float MinDeltaR = 0.;
 
 1235         std::vector<int> vAvailableAuthors;
 
 1236         vAvailableAuthors.clear();
 
 1237         vAvailableAuthors.emplace_back(m_vEFMuons[0]->
author());
 
 1238         unsigned int iter = 0;
 
 1239         for (
unsigned int k = 0; 
k < m_vEFMuons.size(); 
k++) {
 
 1241             for (
unsigned int l = 0; 
l < vAvailableAuthors.size(); 
l++) {
 
 1242                 if (m_vEFMuons[
k]->
author() != vAvailableAuthors[
l]) 
iter++;
 
 1244             if (
iter == vAvailableAuthors.size()) vAvailableAuthors.emplace_back(m_vEFMuons[
k]->
author());
 
 1247         for (
unsigned int i = 0; 
i < m_vRecoMuons.size(); 
i++) {
 
 1248             ATH_MSG_DEBUG(
":: TEST: listing all Recomu pt=" << m_vRecoMuons.at(
i)->pt() << 
"  eta=" << m_vRecoMuons.at(
i)->eta() << 
"  phi=" 
 1249                                                             << m_vRecoMuons.at(
i)->phi() << 
"    auth=" << m_vRecoMuons.at(
i)->author());
 
 1251         for (
unsigned int i = 0; 
i < m_vRecoMuons.size(); 
i++) {
 
 1252             if ((m_vRecoMuons.at(
i)->author() != 1) || (std::abs(m_vRecoMuons.at(
i)->eta()) > 2.4)) 
continue;
 
 1253             ATH_MSG_DEBUG(
":::: TEST: Recomu pt=" << m_vRecoMuons.at(
i)->pt() << 
"  eta=" << m_vRecoMuons.at(
i)->eta()
 
 1254                                                   << 
"  phi=" << m_vRecoMuons.at(
i)->phi() << 
"    auth=" << m_vRecoMuons.at(
i)->author());
 
 1255             for (
unsigned int l = 0; 
l < vAvailableAuthors.size(); 
l++) {
 
 1256                 k_EFMu_MinDeltaR = -1;
 
 1258                 for (
unsigned int k = 0; 
k < m_vEFMuons.size(); 
k++) {
 
 1259                     ATH_MSG_DEBUG(
"  :::::::: TEST: EF pt=" << m_vEFMuons.at(
k)->pt() << 
"  eta=" << m_vEFMuons.at(
k)->eta()
 
 1260                                                             << 
"  phi=" << m_vEFMuons.at(
k)->phi()
 
 1261                                                             << 
"  DeltaR=" << 
deltaR(m_vRecoMuons.at(
i), m_vEFMuons.at(
k))
 
 1262                                                             << 
"  author=" << m_vEFMuons.at(
k)->author());
 
 1263                     if (m_vEFMuons.at(
k)->author() == vAvailableAuthors.at(
l) &&
 
 1264                         (
deltaR(m_vRecoMuons.at(
i), m_vEFMuons.at(
k)) < 0.1 &&
 
 1265                          (
deltaR(m_vRecoMuons.at(
i), m_vEFMuons.at(
k)) < MinDeltaR))) {
 
 1266                         k_EFMu_MinDeltaR = 
k;
 
 1267                         MinDeltaR = 
deltaR(m_vRecoMuons.at(
i), m_vEFMuons.at(
k));
 
 1270                 if (k_EFMu_MinDeltaR == -1) 
continue;
 
 1271                 for (
unsigned int c = 0; 
c < m_selectMuonCategories.size(); 
c++) {
 
 1272                     if (m_selectMuonCategories[
c] == ALL) {
 
 1273                         m_TriggerMuonValidationPlots[
c]->fill(*m_vEFMuons.at(k_EFMu_MinDeltaR), *m_vRecoMuons.at(
i));
 
 1292         if (!acc_muon.
isAvailable(*truthMu)) 
return nullptr;
 
 1293         MuonLink link = acc_muon(*truthMu);
 
 1294         if (!link.
isValid()) 
return nullptr;
 
 1296         if (!m_selectComissioning && reco_mu->
allAuthors() & comm_bit) 
return nullptr;
 
 1297         m_vMatchedMuons.emplace_back(reco_mu);
 
 1303         retrieveContainer(Gaudi::Hive::currentContext() , m_slowMuonsName, SlowMuons).ignore();
 
 1304         if (!SlowMuons) 
return nullptr;
 
 1305         for (
const auto smu : *SlowMuons) {
 
 1306             const MuonLink muLink = smu->muonLink();
 
 1307             if (!muLink.
isValid()) 
continue;
 
 1308             float DR = 
deltaR(*muLink , truthMu);
 
 1310                 m_vMatchedSlowMuons.emplace_back(smu);
 
 1326         for (
const auto& 
plots : m_muonValidationPlots) 
plots->finalize();
 
 1327         for (
const auto& 
plots : m_TriggerMuonValidationPlots) 
plots->finalize();
 
 1329             m_oUnmatchedRecoMuonPlots->finalize();
 
 1330             m_oUnmatchedTruthMuonPlots->finalize();
 
 1333         for (
const auto& 
plots : m_muonMSTrackValidationPlots) 
plots->finalize();
 
 1334         for (
const auto& 
plots : m_muonMETrackValidationPlots) 
plots->finalize();
 
 1335         for (
const auto& 
plots : m_muonMSOnlyMETrackValidationPlots) 
plots->finalize();
 
 1336         for (
const auto& 
plots : m_muonIDTrackValidationPlots) 
plots->finalize();
 
 1337         for (
const auto& 
plots : m_muonIDSelectedTrackValidationPlots) 
plots->finalize();
 
 1338         for (
const auto& 
plots : m_muonIDForwardTrackValidationPlots) 
plots->finalize();
 
 1340             if (m_oUnmatchedRecoMuonTrackPlots) m_oUnmatchedRecoMuonTrackPlots->finalize();
 
 1342         for (
const auto& 
plots : m_muonSegmentValidationPlots) 
plots->finalize();
 
 1344             if (m_oUnmatchedRecoMuonSegmentPlots) m_oUnmatchedRecoMuonSegmentPlots->finalize();
 
 1346         return StatusCode::SUCCESS;
 
 1351         if (!recoSegmentLinkAcc.
isAvailable(*truthMuSeg)) {
 
 1355         MuonSegmentLink link = recoSegmentLinkAcc(*truthMuSeg);
 
 1356         if (!link.isValid()) {
 
 1360         m_vMatchedMuonSegments.emplace_back(*link);
 
 1364     TH1F* MuonPhysValMonitoringTool::findHistogram(
const std::vector<HistData>& 
hists, 
const std::string& hnameTag,
 
 1365                                                    const std::string& hdirTag, 
const std::string& hNewName) {
 
 1368             if (
hist.second.find(hdirTag) != std::string::npos || hdirTag.empty()) {
 
 1370                 if (
histname.find(hnameTag) != std::string::npos) {
 
 1371                     h = (
TH1F*)
hist.first->Clone(hNewName.c_str());
 
 1383         if (truthParticleLinkAcc.
isAvailable(*truthMuSeg)) {
 
 1384             truthLink = truthParticleLinkAcc(*truthMuSeg);
 
 1387               if (std::abs((*truthLink)->pdgId()) != 13) 
return REST;
 
 1389               for (
const auto muTruthPart : *muonTruthContainer) {
 
 1390                 if ( 
HepMC::uniqueID(muTruthPart) == theUniqueID ) { 
return getMuonTruthCategory(muTruthPart); }
 
 1405         else if (
truthType == 8 && (truthOriginAcc(*
mu) == 34 || truthOriginAcc(*
mu) == 35))
 
 1412     std::unique_ptr<xAOD::Muon> MuonPhysValMonitoringTool::getCorrectedMuon(
const xAOD::Muon& 
mu) {
 
 1413         std::unique_ptr<xAOD::Muon> mu_c;
 
 1414         if (
mu.m() <= 0) 
return mu_c;
 
 1415         mu_c = std::make_unique<xAOD::Muon>();
 
 1421         if (idtrk && metrk) {
 
 1424             InnerDetectorPtDec(*mu_c) = idtrk->pt();
 
 1425             MuonSpectrometerPtDec(*mu_c) = metrk->pt();
 
 1427         m_muonSelectionTool->setQuality(*mu_c);
 
 1428         m_muonSelectionTool->setPassesIDCuts(*mu_c);
 
 1432     void MuonPhysValMonitoringTool::modifyHistogram(TH1* 
hist) {
 
 1435         if(m_muonsName.key() == 
"Muons"){
 
 1436             if (
histname.find(
"parameters_z0") != std::string::npos) { 
 
 1437                 hist->GetXaxis()->Set(80, -200., 200.);
 
 1439             if (
histname.find(
"parameters_d0") != std::string::npos && 
histname.find(
"parameters_d0_small") == std::string::npos) {
 
 1440                 hist->GetXaxis()->Set(80, -1., 1.);
 
 1441                 hist->GetYaxis()->SetTitle(
"Entries / 0.025 mm");                
 
 1443        } 
else if(m_muonsName.key() == 
"MuonsLRT"){
 
 1444             if (
histname.find(
"parameters_d0") != std::string::npos && 
histname.find(
"parameters_d0_small") == std::string::npos) {
 
 1446                 hist->GetYaxis()->SetTitle(
"Entries / 2.5 mm");                
 
 1451         if (
histname.find(
"trigger_L1_pt") != std::string::npos) {  
 
 1452             hist->SetTitle(
"L1Trigger Muons pt threshold");
 
 1453             hist->GetXaxis()->SetTitle(
"L1Trigger Muons pt threshold [GeV]");
 
 1454             hist->GetXaxis()->Set(30, -0.5, 29.5);
 
 1456         if (
histname.find(
"trigger_L1_eta_pt") != std::string::npos) {  
 
 1457             hist->SetTitle(
"L1Trigger Muons pt threshold vs eta");
 
 1458             hist->GetYaxis()->Set(90, -0.5, 29.5);
 
 1459             hist->GetYaxis()->SetTitle(
"L1Trigger Muons pt threshold [GeV]");
 
 1462         if (
histname.find(
"trigger") != std::string::npos &&
 
 1463             ((
histname.find(
"Denom_pt") != std::string::npos) || (
histname.find(
"Numer_pt") != std::string::npos) ||
 
 1464              (
histname.find(
"Features_pt") != std::string::npos)))
 
 1465             hist->GetXaxis()->Set(200, 0., 200.);
 
 1467         if (
histname.find(
"hits") != std::string::npos) {
 
 1468             if (
histname.find(
"etaLayer2") != std::string::npos)
 
 1469                 hist->GetXaxis()->Set(15, -0.5, 14.5);
 
 1470             else if (
histname.find(
"etaLayer") != std::string::npos)
 
 1471                 hist->GetXaxis()->Set(11, -0.5, 10.5);
 
 1475         bool is2D = !(
histname.find(
"_vs_") == std::string::npos);
 
 1478         if (
histname.find(
"METrackParticles") != std::string::npos) {
 
 1479             if (
histname.find(
"Res_eta") != std::string::npos) {
 
 1481                     hist->GetYaxis()->Set(50, -0.025, 0.025);
 
 1483                     hist->GetXaxis()->Set(50, -0.025, 0.025);
 
 1484             } 
else if (
histname.find(
"Res_phi") != std::string::npos) {
 
 1486                     hist->GetYaxis()->Set(50, -0.02, 0.02);
 
 1488                     hist->GetXaxis()->Set(50, -0.02, 0.02);
 
 1490         } 
else if (
histname.find(
"MSTrackParticles") != std::string::npos) {
 
 1491             if (
histname.find(
"Res_eta") != std::string::npos) {
 
 1493                     hist->GetYaxis()->Set(50, -0.025, 0.025);
 
 1495                     hist->GetXaxis()->Set(50, -0.025, 0.025);
 
 1496             } 
else if (
histname.find(
"Res_phi") != std::string::npos) {
 
 1498                     hist->GetYaxis()->Set(50, -0.05, 0.05);
 
 1500                     hist->GetXaxis()->Set(50, -0.05, 0.05);
 
 1503             if (
histname.find(
"Res_eta") != std::string::npos) {
 
 1505                     hist->GetYaxis()->Set(50, -0.005, 0.005);
 
 1507                     hist->GetXaxis()->Set(50, -0.005, 0.005);
 
 1508             } 
else if (
histname.find(
"Res_phi") != std::string::npos) {
 
 1510                     hist->GetYaxis()->Set(50, -0.002, 0.002);
 
 1512                     hist->GetXaxis()->Set(50, -0.002, 0.002);
 
 1516         if (
histname.find(
"trigger") != std::string::npos) {
 
 1518             if ((!m_isData) && 
histname.find(
"MuidCo") != std::string::npos &&
 
 1519                 (
histname.find(
"BARREL") != std::string::npos || 
histname.find(
"WHOLE_DETECT") != std::string::npos)) {
 
 1520                 if (
histname.find(
"Res_pT") != std::string::npos && 
histname.find(
"_vs_") == std::string::npos) {
 
 1521                     hist->GetXaxis()->Set(100, -0.04, 0.04);
 
 1523                 if (
histname.find(
"Res_pT_vs_") != std::string::npos) { 
hist->GetYaxis()->Set(100, -0.04, 0.04); }
 
 1524                 if (
histname.find(
"Res_eta") != std::string::npos && 
histname.find(
"_vs_") == std::string::npos) {
 
 1525                     hist->GetXaxis()->Set(100, -0.0005, 0.0005);
 
 1527                 if (
histname.find(
"Res_eta_vs_") != std::string::npos) { 
hist->GetYaxis()->Set(100, -0.0005, 0.0005); }
 
 1529                 if (
histname.find(
"Res_phi") != std::string::npos && 
histname.find(
"_vs_") == std::string::npos) {
 
 1530                     hist->GetXaxis()->Set(100, -0.0002, 0.0002);
 
 1532                 if (
histname.find(
"Res_phi_vs_") != std::string::npos) { 
hist->GetYaxis()->Set(100, -0.0002, 0.0002); }
 
 1534             if ((!m_isData) && 
histname.find(
"MuidCo") != std::string::npos && (
histname.find(
"ENDCAPS") != std::string::npos)) {
 
 1535                 if (
histname.find(
"Res_pT") != std::string::npos && 
histname.find(
"_vs_") == std::string::npos) {
 
 1536                     hist->GetXaxis()->Set(100, -0.05, 0.05);
 
 1538                 if (
histname.find(
"Res_pT_vs_") != std::string::npos) { 
hist->GetYaxis()->Set(100, -0.05, 0.05); }
 
 1539                 if (
histname.find(
"Res_eta") != std::string::npos && 
histname.find(
"_vs_") == std::string::npos) {
 
 1540                     hist->GetXaxis()->Set(100, -0.001, 0.001);
 
 1542                 if (
histname.find(
"Res_eta_vs_") != std::string::npos) { 
hist->GetYaxis()->Set(100, -0.001, 0.001); }
 
 1544                 if (
histname.find(
"Res_phi") != std::string::npos && 
histname.find(
"_vs_") == std::string::npos) {
 
 1545                     hist->GetXaxis()->Set(100, -0.0003, 0.0003);
 
 1547                 if (
histname.find(
"Res_phi_vs_") != std::string::npos) { 
hist->GetYaxis()->Set(100, -0.0003, 0.0003); }
 
 1549             if ((!m_isData) && 
histname.find(
"MuidSA") != std::string::npos) {
 
 1550                 if (
histname.find(
"Res_eta") != std::string::npos && 
histname.find(
"_vs_") == std::string::npos) {
 
 1551                     hist->GetXaxis()->Set(100, -0.03, 0.03);
 
 1553                 if (
histname.find(
"Res_eta_vs_") != std::string::npos) { 
hist->GetYaxis()->Set(100, -0.03, 0.03); }
 
 1555                 if (
histname.find(
"Res_phi") != std::string::npos && 
histname.find(
"_vs_") == std::string::npos) {
 
 1556                     hist->GetXaxis()->Set(100, -0.03, 0.03);
 
 1558                 if (
histname.find(
"Res_phi_vs_") != std::string::npos) { 
hist->GetYaxis()->Set(100, -0.03, 0.03); }
 
 1560             if ((!m_isData) && 
histname.find(
"MuidSA") != std::string::npos && (
histname.find(
"BARREL") != std::string::npos)) {
 
 1561                 if (
histname.find(
"Res_pT") != std::string::npos && 
histname.find(
"_vs_") == std::string::npos) {
 
 1562                     hist->GetXaxis()->Set(100, -0.15, 0.15);
 
 1564                 if (
histname.find(
"Res_pT_vs_") != std::string::npos) { 
hist->GetYaxis()->Set(100, -0.15, 0.15); }
 
 1566             if ((!m_isData) && 
histname.find(
"MuidSA") != std::string::npos &&
 
 1567                 (
histname.find(
"ENDCAPS") != std::string::npos || 
histname.find(
"WHOLE_DETECT") != std::string::npos)) {
 
 1568                 if (
histname.find(
"Res_pT") != std::string::npos && 
histname.find(
"_vs_") == std::string::npos) {
 
 1569                     hist->GetXaxis()->Set(100, -0.2, 0.2);
 
 1571                 if (
histname.find(
"Res_pT_vs_") != std::string::npos) { 
hist->GetYaxis()->Set(100, -0.2, 0.2); }
 
 1575             if ((m_isData) && 
histname.find(
"MuidCo") != std::string::npos &&
 
 1576                 (
histname.find(
"BARREL") != std::string::npos || 
histname.find(
"WHOLE_DETECT") != std::string::npos)) {
 
 1577                 if (
histname.find(
"Res_pT") != std::string::npos && 
histname.find(
"_vs_") == std::string::npos) {
 
 1578                     hist->GetXaxis()->Set(100, -0.06, 0.06);
 
 1580                 if (
histname.find(
"Res_pT_vs_") != std::string::npos) { 
hist->GetYaxis()->Set(100, -0.06, 0.06); }
 
 1581                 if (
histname.find(
"Res_eta") != std::string::npos && 
histname.find(
"_vs_") == std::string::npos) {
 
 1582                     hist->GetXaxis()->Set(100, -0.001, 0.001);
 
 1584                 if (
histname.find(
"Res_eta_vs_") != std::string::npos) { 
hist->GetYaxis()->Set(100, -0.001, 0.001); }
 
 1586                 if (
histname.find(
"Res_phi") != std::string::npos && 
histname.find(
"_vs_") == std::string::npos) {
 
 1587                     hist->GetXaxis()->Set(100, -0.0005, 0.0005);
 
 1589                 if (
histname.find(
"Res_phi_vs_") != std::string::npos) { 
hist->GetYaxis()->Set(100, -0.0005, 0.0005); }
 
 1591             if ((m_isData) && 
histname.find(
"MuidCo") != std::string::npos && (
histname.find(
"ENDCAPS") != std::string::npos)) {
 
 1592                 if (
histname.find(
"Res_pT") != std::string::npos && 
histname.find(
"_vs_") == std::string::npos) {
 
 1593                     hist->GetXaxis()->Set(100, -0.1, 0.1);
 
 1595                 if (
histname.find(
"Res_pT_vs_") != std::string::npos) { 
hist->GetYaxis()->Set(100, -0.1, 0.1); }
 
 1596                 if (
histname.find(
"Res_eta") != std::string::npos && 
histname.find(
"_vs_") == std::string::npos) {
 
 1597                     hist->GetXaxis()->Set(100, -0.0015, 0.0015);
 
 1599                 if (
histname.find(
"Res_eta_vs_") != std::string::npos) { 
hist->GetYaxis()->Set(100, -0.0015, 0.0015); }
 
 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(
"MuidSA") != std::string::npos) {
 
 1607                 if (
histname.find(
"Res_eta") != std::string::npos && 
histname.find(
"_vs_") == std::string::npos) {
 
 1608                     hist->GetXaxis()->Set(100, -0.03, 0.03);
 
 1610                 if (
histname.find(
"Res_eta_vs_") != std::string::npos) { 
hist->GetYaxis()->Set(100, -0.03, 0.03); }
 
 1612                 if (
histname.find(
"Res_phi") != std::string::npos && 
histname.find(
"_vs_") == std::string::npos) {
 
 1613                     hist->GetXaxis()->Set(100, -0.03, 0.03);
 
 1615                 if (
histname.find(
"Res_phi_vs_") != std::string::npos) { 
hist->GetYaxis()->Set(100, -0.03, 0.03); }
 
 1617             if ((m_isData) && 
histname.find(
"MuidSA") != std::string::npos && (
histname.find(
"BARREL") != std::string::npos)) {
 
 1618                 if (
histname.find(
"Res_pT") != std::string::npos && 
histname.find(
"_vs_") == std::string::npos) {
 
 1619                     hist->GetXaxis()->Set(100, -0.3, 0.3);
 
 1621                 if (
histname.find(
"Res_pT_vs_") != std::string::npos) { 
hist->GetYaxis()->Set(100, -0.3, 0.3); }
 
 1623             if ((m_isData) && 
histname.find(
"MuidSA") != std::string::npos &&
 
 1624                 (
histname.find(
"ENDCAPS") != std::string::npos || 
histname.find(
"WHOLE_DETECT") != std::string::npos)) {
 
 1625                 if (
histname.find(
"Res_pT") != std::string::npos && 
histname.find(
"_vs_") == std::string::npos) {
 
 1626                     hist->GetXaxis()->Set(100, -0.5, 0.5);
 
 1628                 if (
histname.find(
"Res_pT_vs_") != std::string::npos) { 
hist->GetYaxis()->Set(100, -0.5, 0.5); }
 
 1632             if ((
histname.find(
"L2_StandAlone") != std::string::npos)) {
 
 1633                 if (
histname.find(
"Res_eta") != std::string::npos && 
histname.find(
"_vs_") == std::string::npos) {
 
 1634                     hist->GetXaxis()->Set(100, -0.03, 0.03);
 
 1636                 if (
histname.find(
"Res_eta_vs_") != std::string::npos) { 
hist->GetYaxis()->Set(100, -0.03, 0.03); }
 
 1638                 if (
histname.find(
"Res_phi") != std::string::npos && 
histname.find(
"_vs_") == std::string::npos) {
 
 1639                     hist->GetXaxis()->Set(100, -0.03, 0.03);
 
 1641                 if (
histname.find(
"Res_phi_vs_") != std::string::npos) { 
hist->GetYaxis()->Set(100, -0.03, 0.03); }
 
 1643             if ((
histname.find(
"L2_StandAlone") != std::string::npos) && (
histname.find(
"BARREL") != std::string::npos)) {
 
 1644                 if (
histname.find(
"Res_pT") != std::string::npos && 
histname.find(
"_vs_") == std::string::npos) {
 
 1645                     hist->GetXaxis()->Set(100, -0.3, 0.3);
 
 1647                 if (
histname.find(
"Res_pT_vs_") != std::string::npos) { 
hist->GetYaxis()->Set(100, -0.3, 0.3); }
 
 1649             if ((
histname.find(
"L2_StandAlone") != std::string::npos) &&
 
 1650                 ((
histname.find(
"ENDCAPS") != std::string::npos) || (
histname.find(
"WHOLE_DETECT") != std::string::npos))) {
 
 1651                 if (
histname.find(
"Res_pT") != std::string::npos && 
histname.find(
"_vs_") == std::string::npos) {
 
 1652                     hist->GetXaxis()->Set(100, -0.5, 0.5);
 
 1654                 if (
histname.find(
"Res_pT_vs_") != std::string::npos) { 
hist->GetYaxis()->Set(100, -0.5, 0.5); }
 
 1657             if ((
histname.find(
"L2_Combined") != std::string::npos)) {
 
 1658                 if (
histname.find(
"Res_eta") != std::string::npos && 
histname.find(
"_vs_") == std::string::npos) {
 
 1659                     hist->GetXaxis()->Set(100, -0.002, 0.002);
 
 1661                 if (
histname.find(
"Res_eta_vs_") != std::string::npos) { 
hist->GetYaxis()->Set(100, -0.002, 0.002); }
 
 1663                 if (
histname.find(
"Res_phi") != std::string::npos && 
histname.find(
"_vs_") == std::string::npos) {
 
 1664                     hist->GetXaxis()->Set(100, -0.001, 0.001);
 
 1666                 if (
histname.find(
"Res_phi_vs_") != std::string::npos) { 
hist->GetYaxis()->Set(100, -0.001, 0.001); }
 
 1667                 if (
histname.find(
"Res_pT") != std::string::npos && 
histname.find(
"_vs_") == std::string::npos) {
 
 1668                     hist->GetXaxis()->Set(100, -0.2, 0.2);
 
 1670                 if (
histname.find(
"Res_pT_vs_") != std::string::npos) { 
hist->GetYaxis()->Set(100, -0.2, 0.2); }
 
 1676         if (prt->
pt() < 2000.) 
return false;
 
 1677         if (std::abs(prt->
eta()) > 2.7) 
return false;
 
 1683         int stringLength = 
x.Length();
 
 1684         int delimLength = delim.Length();
 
 1687         TString 
temp = 
"---";
 
 1688         while (
stop != -1) {
 
 1689             stop = 
x.First(delim);
 
 1693                 TSubString newString = 
x(
stop + delimLength, stringLength);
 
 1695                 stringLength = 
x.Length();
 
 1697                 stringLength = 
x.Length();
 
 1698                 temp = 
x(0, stringLength);
 
 1701             v.emplace_back(
temp);