21 #include <Math/Vector3D.h> 22 #include <Math/Boost.h> 24 #include <momemta/Module.h> 25 #include <momemta/ParameterSet.h> 26 #include <momemta/Types.h> 74 if (parameters.get<
bool>(
"do_transverse_boost",
false)) {
75 do_compute_initials = compute_initials_boost;
77 do_compute_initials = compute_initials_trivial;
80 halved_sqrt_s = parameters.globalParameters().get<
double>(
"energy") / 2;
82 std::vector<InputTag> input_particles_tags = parameters.get<std::vector<InputTag>>(
"particles");
83 for (
auto& t: input_particles_tags)
84 input_particles.push_back(get<LorentzVector>(t));
87 virtual Status
work()
override {
91 LorentzVectorRefCollection particles;
92 for (
auto& p: input_particles) {
93 particles.push_back(std::ref(*p));
96 do_compute_initials(particles);
99 if ((*partons)[0].E() > halved_sqrt_s || (*partons)[1].E() > halved_sqrt_s )
106 using compute_initials_signature = std::function<void(const LorentzVectorRefCollection&)>;
108 compute_initials_signature do_compute_initials;
110 compute_initials_signature compute_initials_trivial =
111 [&](
const LorentzVectorRefCollection& particles) {
113 for (
const auto& p: particles)
116 double q1Pz = (tot.Pz() + tot.E()) / 2.;
117 double q2Pz = (tot.Pz() - tot.E()) / 2.;
119 partons->push_back(LorentzVector(0., 0., q1Pz, std::abs(q1Pz)));
120 partons->push_back(LorentzVector(0., 0., q2Pz, std::abs(q2Pz)));
123 compute_initials_signature compute_initials_boost =
124 [&](
const LorentzVectorRefCollection& particles) {
126 for (
const auto& p: particles)
130 LorentzVector transverse_tot = tot;
131 transverse_tot.SetPz(0);
132 ROOT::Math::XYZVector isr_deBoost_vector( transverse_tot.BoostToCM() );
135 const ROOT::Math::Boost isr_deBoost( isr_deBoost_vector );
136 const ROOT::Math::PxPyPzEVector new_tot( isr_deBoost * tot );
138 double q1Pz = (new_tot.Pz() + new_tot.E()) / 2.;
139 double q2Pz = (new_tot.Pz() - new_tot.E()) / 2.;
141 partons->push_back(LorentzVector(0., 0., q1Pz, std::abs(q1Pz)));
142 partons->push_back(LorentzVector(0., 0., q2Pz, std::abs(q2Pz)));
145 const ROOT::Math::Boost isr_boost( -isr_deBoost_vector );
146 (*partons)[0] = isr_boost * (*partons)[0];
147 (*partons)[1] = isr_boost * (*partons)[1];
150 double halved_sqrt_s;
152 std::vector<Value<LorentzVector>> input_particles;
154 std::shared_ptr<std::vector<LorentzVector>> partons = produce<std::vector<LorentzVector>>(
"partons");
160 .GlobalAttr(
"energy:double")
161 .Attr(
"do_transverse_boost:bool=false");
Build the initial partons given the whole final state.
Parent class for all the modules.
A class encapsulating a lua table.
virtual Status work() override
Main function.
Module(PoolPtr pool, const std::string &name)
Constructor.