Open smgilligan opened 3 years ago
As of writing, lines 29-31 of MAT-MINERvA/calculators/LowRecoilFunctions.h read as:
MAT-MINERvA/calculators/LowRecoilFunctions.h
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:
MAT-MINERvA/calculators/MuonFunctions.h
GetPmu_nominal()
GetPmuMinos_nominal()
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; }
Looks good to me. Will make it work for other packages
As of writing, lines 29-31 of
MAT-MINERvA/calculators/LowRecoilFunctions.h
read as:Suggested rewrite, something like:
This is similar to the format as implemented in lines 57-74 of
MAT-MINERvA/calculators/MuonFunctions.h
for functionsGetPmu_nominal()
andGetPmuMinos_nominal()
, but without creating new variables. Those lines at the time of writing are: