Skip to content

Added warning when actual mu reweighting is not used for mc16d/e samples

Tomas Dado requested to merge tdado/athena:21.2-AT-actualMuWarning into 21.2

Adding warning to AnalysisTop when actual mu reweighting is not used for mc16d/e.

One interesting observation: we wanted to check the campaign type by retrieving RunNumber from Metadata:

if (m_aodMetaData->valid()) {
      const std::string runNumberString = m_aodMetaData->get("/Simulation/Parameters","RunNumber");
      try {
        const int runNumber = std::stoi(runNumberString);
        if (runNumber >= 300000) {
          if ((!m_isAFII && m_pileup_reweighting.actual_mu_FS.size() == 0) ||
            (m_isAFII && m_pileup_reweighting.actual_mu_AF.size() == 0)) {
            std::cout << "WARNING: You are running over mc16d or mc16e samples but you are not using actual mu reweighting!\n";
            std::cout << "You are strongly advised to use the actual mu reweighting\n";
            std::cout << "Check: https://twiki.cern.ch/twiki/bin/view/AtlasProtected/TopxAODStartGuideR21#PRW_and_Lumicalc_files\n";
          }
        }
      } catch(std::invalid_argument& e) {
        std::cout << e.what() << "\n";
        std::cout << "WARNING: Cannot properly convert RunNumber from metadata to integer.\n";
        std::cout << "Skipping check for actual mu reweighting\n";
      }
    }

But we found out that the runNumber is the same for all campaigns, is this expected?

Due to this issue we have to retrieve the runNumber during the event loop from eventInto

Edited by Tomas Dado

Merge request reports