Skip to content
Snippets Groups Projects
Commit cb2c25ec authored by Ziyue Zhang's avatar Ziyue Zhang
Browse files

WIP: Test on PID instead of pmass

parent 9aee331c
No related branches found
No related tags found
1 merge request!39Replacing nu with y
......@@ -40,7 +40,7 @@ namespace util {
}
//========================================import Geant4 and set the wanted particles in the intended order========================
//0:e0 1:p0 2:e1 3:p1 4:recoil system (without p1) 5:l1 from 4 6:l2 from 4
inline auto momenta_ordered_sim(const std::vector<dd4pod::Geant4ParticleData>& parts, std::string_view mother, std::string_view daughter){//mother and daughter are not used yet; will be useful when generater is different and/or when the mcparticles doesn't follow the same order in all events
/*inline auto momenta_ordered_sim(const std::vector<dd4pod::Geant4ParticleData>& parts, std::string_view mother, std::string_view daughter){//mother and daughter are not used yet; will be useful when generater is different and/or when the mcparticles doesn't follow the same order in all events
std::vector<ROOT::Math::PxPyPzMVector> momenta{7};
int order_map[7] = {0, 3, 2, 6, 5, 7, 8};
for(int i = 0 ; i < 7 ; i++){
......@@ -52,10 +52,10 @@ namespace util {
momenta[i].SetPxPyPzE(px, py, pz, e);
}
return momenta;
}
}*/
//import Reconstructed particles and set the wanted particles in the intended order========================
inline auto momenta_ordered_rec(const std::vector<eic::ReconstructedParticleData>& parts, std::string_view mother, std::string_view daughter){//mother and daughter are not used yet; will be useful when generater is different and/or when the mcparticles doesn't follow the same order in all events
/*inline auto momenta_ordered_rec(const std::vector<eic::ReconstructedParticleData>& parts, std::string_view mother, std::string_view daughter){//mother and daughter are not used yet; will be useful when generater is different and/or when the mcparticles doesn't follow the same order in all events
std::vector<ROOT::Math::PxPyPzMVector> momenta{7};
//0:e0 1:p0 2:e1 3:p1 4:recoil system (without p1) 5:l1 from recoil decay 6:l2 from recoil decay
for(int i = 0 ; i < 7 ; i++) momenta[i].SetPxPyPzE(0., 0., 0., 0.); //initialize as all 0
......@@ -118,7 +118,7 @@ namespace util {
//}
}
return momenta;
}
}*/
//for Dummy rc
inline inv_quant calc_inv_quant_rec(const std::vector<ROOT::Math::PxPyPzMVector>& parts, const double pdg_mass, const double daughter_mass){
......@@ -186,7 +186,7 @@ namespace util {
return quantities;
}
inline inv_quant calc_inv_quant_both(const std::vector<ROOT::Math::PxPyPzMVector>& parts)
/*inline inv_quant calc_inv_quant_both(const std::vector<ROOT::Math::PxPyPzMVector>& parts)
{
//0:e0 1:p0 2:e1 3:p1 4:recoil system (without p1) 5:l1 from 4 6:l2 from 4
ROOT::Math::PxPyPzMVector q(parts[0] - parts[2]);
......@@ -199,7 +199,7 @@ namespace util {
double t = Delta.Dot(Delta);
inv_quant quantities = {nu, Q2, Q2/2./P.mass()/nu, t};
return quantities;
}
}*/
inline double get_nu(inv_quant quantities) { return quantities.nu / 1000.; }
......
......@@ -74,18 +74,18 @@ int vm_invar(const std::string& config_name)
auto calc_inv_quant_rec = [vm_mass, decay_mass](const std::vector<ROOT::Math::PxPyPzMVector>& parts) {
return util::calc_inv_quant_rec(parts, vm_mass, decay_mass);
};
auto momenta_ordered_sim = [vm_name, decay_name](const std::vector<dd4pod::Geant4ParticleData>& parts){
return util::momenta_ordered_sim(parts, vm_name, decay_name);
};
auto momenta_ordered_rec = [vm_name, decay_name](const std::vector<eic::ReconstructedParticleData>& parts){
return util::momenta_ordered_rec(parts, vm_name, decay_name);
};
//auto momenta_ordered_sim = [vm_name, decay_name](const std::vector<dd4pod::Geant4ParticleData>& parts){
// return util::momenta_ordered_sim(parts, vm_name, decay_name);
//};
//auto momenta_ordered_rec = [vm_name, decay_name](const std::vector<eic::ReconstructedParticleData>& parts){
// return util::momenta_ordered_rec(parts, vm_name, decay_name);
//};
//====================================================================
// Define analysis flow
auto d_im = d.Define("p_rec", util::momenta_RC, {"DummyReconstructedParticles"})
.Define("p_sim_ordered", momenta_ordered_sim, {"mcparticles2"})
.Define("p_rec_ordered", momenta_ordered_rec, {"DummyReconstructedParticles"})
//.Define("p_sim_ordered", momenta_ordered_sim, {"mcparticles2"})
//.Define("p_rec_ordered", momenta_ordered_rec, {"DummyReconstructedParticles"})
.Define("N", "p_rec.size()")
.Define("p_sim", util::momenta_from_simulation, {"mcparticles2"})
//================================================================
......@@ -98,9 +98,9 @@ int vm_invar(const std::string& config_name)
.Define("nu_sim", util::get_nu, {"invariant_quantities_sim"})
.Define("Q2_sim", util::get_Q2, {"invariant_quantities_sim"})
.Define("x_sim", util::get_x, {"invariant_quantities_sim"})
.Define("t_sim", util::get_t, {"invariant_quantities_sim"})
.Define("invariant_quantities_rec", util::calc_inv_quant_both, {"p_rec_ordered"})
.Define("invariant_quantities_sim", util::calc_inv_quant_both, {"p_sim_ordered"});
.Define("t_sim", util::get_t, {"invariant_quantities_sim"});
//.Define("invariant_quantities_rec", util::calc_inv_quant_bot*h, {"p_rec_ordered"})
//.Define("invariant_quantities_sim", util::calc_inv_quant_both, {"p_sim_ordered"});
//================================================================
// Define output histograms
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment