6 #include "art/Framework/Core/EDProducer.h"
7 #include "art/Framework/Principal/Event.h"
8 #include "art/Framework/Principal/Handle.h"
9 #include "art/Framework/Services/Registry/ServiceHandle.h"
10 #include "art/Persistency/Common/PtrMaker.h"
11 #include "art/Utilities/ToolMacros.h"
12 #include "cetlib/cpu_timer.h"
13 #include "fhiclcpp/ParameterSet.h"
14 #include "messagefacility/MessageLogger/MessageLogger.h"
15 #include "CLHEP/Random/RandFlat.h"
32 #include "TDatabasePDG.h"
59 void configure(
const fhicl::ParameterSet&)
override;
88 double hnl_momentum(
double kaon_mass,
double lep_mass,
double hnl_mass) {
89 if (kaon_mass - lep_mass < hnl_mass)
return -1.;
91 return sqrt(kaon_mass * kaon_mass * kaon_mass * kaon_mass
92 -2 * kaon_mass * kaon_mass * lep_mass * lep_mass
93 -2 * kaon_mass * kaon_mass * hnl_mass * hnl_mass
94 + lep_mass * lep_mass * lep_mass * lep_mass
95 + hnl_mass * hnl_mass * hnl_mass * hnl_mass
96 -2 * lep_mass * lep_mass * hnl_mass * hnl_mass) / ( 2 * kaon_mass );
110 return 0.6339 + 0.0559 + 0.0330 ;
112 return 0.6339 + 0.0559 + 0.0330 ;
114 return 0.2020 + 0.2020 + 0.1348 + 0.1348 ;
124 if (hnl_mass > kplus_mass - lep_mass)
return 0.;
127 double lep_ratio = (lep_mass * lep_mass) / (kplus_mass * kplus_mass);
128 double hnl_ratio = (hnl_mass * hnl_mass) / (kplus_mass * kplus_mass);
129 double kinematic_factor = (lep_ratio + hnl_ratio - (lep_ratio - hnl_ratio) * (lep_ratio - hnl_ratio)) \
130 * sqrt(1 + hnl_ratio * hnl_ratio + lep_ratio * lep_ratio - 2*(hnl_ratio + lep_ratio + hnl_ratio*lep_ratio)) \
131 / (lep_ratio * (1. - lep_ratio) * (1. - lep_ratio));
134 return smbr * (u4 / (1. - u4)) * kinematic_factor;
137 std::pair<double, bool>
Branch(
double hnl_mass,
double ue4,
double um4,
double rand) {
142 if (br_muon == 0. && br_elec == 0.)
return {0.,
false};
144 double br_weight = br_muon + br_elec;
146 bool is_muon = rand < (br_muon / br_weight);
148 return {br_weight, is_muon};
155 fM = pset.get<
double>(
"M");
156 fMagUm4 = pset.get<
double>(
"MagUm4");
157 fMagUe4 = pset.get<
double>(
"MagUe4");
159 fKDAROnly = pset.get<
bool>(
"KDAROnly",
false);
165 throw cet::exception(
"Kaon2HNLFlux Tool: BAD MASS. Configured mass (" +
std::to_string(
fM) +
166 ") is larger than maximum allowed by enabled couplings (" +
std::to_string(max_mass) +
").");
183 if (
fKDAROnly && (kaon.
mom.P() > 1
e-3 || kaon.
pos.Z() < 72000.))
return false;
195 double hnl_mass =
fM;
197 double br = decay.first;
198 bool is_muon = decay.second;
205 if (br == 0.)
return false;
209 double e = sqrt(p*p + hnl_mass * hnl_mass);
214 TLorentzVector mom = hnl.
mom;
215 mom.Boost(kaon.
mom.BoostVector());
TLorentzVector pos_beamcoord
TLorentzVector sec_beamcoord
~Kaon2HNLFlux()
Destructor.
TLorentzVector mom_beamcoord
std::pair< double, bool > Branch(double hnl_mass, double ue4, double um4, double rand)
double fM
Mass of HNL [GeV].
Kaon2HNLFlux class definiton.
Kaon2HNLFlux(fhicl::ParameterSet const &pset)
Constructor.
double BranchingRatio(double hnl_mass, double u4, bool is_muon)
IMeVPrtlStage interface class definiton. General interface behind each stage. Provides random number ...
static const Constants & Instance()
bool MakeFlux(const simb::MCFlux &flux, MeVPrtlFlux &hnl, double &weight) override
double SMKaonBR(int kaon_pdg)
double hnl_momentum(double kaon_mass, double lep_mass, double hnl_mass)
void configure(const fhicl::ParameterSet &) override
Interface for configuring the particular algorithm tool.
TLorentzVector BeamOrigin()
std::string to_string(WindowPattern const &pattern)
This is an interface for an art Tool which turns MCFlux objects (which is a meson decay to neutrinos)...
double MaxWeight() override
TVector3 RandomUnitVector()
double EnuLab(double enucm, TLorentzVector meson_mom, TLorentzVector meson_pos)
IMeVPrtlFlux interface class definiton.
TLorentzVector kmom_beamcoord
BEGIN_PROLOG could also be cout