Skip to content

Should fix hard-coded MasterAnaDev tuple variable call #3

@smgilligan

Description

@smgilligan

As of writing, lines 29-31 of MAT-MINERvA/calculators/LowRecoilFunctions.h read as:

double GetCalorimetryQ0() const {
  return GetDouble("MasterAnaDev_recoil_E");
}

Suggested rewrite, something like:

double GetCalorimetryQ0() const {
  return GetDouble(std::string(GetAnaToolName()+"_recoil_E").c_str());
}

This is similar to the format as implemented in lines 57-74 of MAT-MINERvA/calculators/MuonFunctions.h for functions GetPmu_nominal() and GetPmuMinos_nominal(), but without creating new variables. Those lines at the time of writing are:

virtual double GetPmu_nominal() const {                       /* MeV */
  std::string lepton_branch = GetAnaToolName() + "_leptonE";  // AnaTool
  // std::string lepton_branch = "Muon_leptonE";
  double px = GetVecElem(lepton_branch.c_str(), 0);
  double py = GetVecElem(lepton_branch.c_str(), 1);
  double pz = GetVecElem(lepton_branch.c_str(), 2);
  double total_p_nominal = sqrt(px * px + py * py + pz * pz);

  return total_p_nominal;
}

virtual double GetPmuMinos_nominal() const { /* MeV */
  // std::string minos_momentum_branch = "Muon_minos_trk_p";
  std::string minos_momentum_branch = GetAnaToolName() + "_minos_trk_p";
  double minos_p_nominal = GetDouble(minos_momentum_branch.c_str());

  return minos_p_nominal;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions