All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Attributes | List of all members
evgen::ldm::Kaon2HNLFlux Class Reference

Kaon2HNLFlux class definiton. More...

Inheritance diagram for evgen::ldm::Kaon2HNLFlux:
evgen::ldm::IMeVPrtlFlux evgen::ldm::IMeVPrtlStage

Public Member Functions

 Kaon2HNLFlux (fhicl::ParameterSet const &pset)
 Constructor. More...
 
 ~Kaon2HNLFlux ()
 Destructor. More...
 
bool MakeFlux (const simb::MCFlux &flux, MeVPrtlFlux &hnl, double &weight) override
 
void configure (const fhicl::ParameterSet &) override
 Interface for configuring the particular algorithm tool. More...
 
double MaxWeight () override
 
- Public Member Functions inherited from evgen::ldm::IMeVPrtlFlux
virtual ~IMeVPrtlFlux () noexcept=default
 Virtual Destructor. More...
 
 IMeVPrtlFlux (const fhicl::ParameterSet &pset)
 
- Public Member Functions inherited from evgen::ldm::IMeVPrtlStage
virtual ~IMeVPrtlStage () noexcept
 Virtual Destructor. More...
 
 IMeVPrtlStage (const char *name)
 
TVector3 RandomUnitVector ()
 
double GetRandom ()
 
const char * Name ()
 

Private Attributes

double fM
 Mass of HNL [GeV]. More...
 
double fMagUe4
 
double fMagUm4
 
bool fKDAROnly
 

Additional Inherited Members

- Protected Member Functions inherited from evgen::ldm::IMeVPrtlFlux
TLorentzVector BeamOrigin ()
 
double EnuLab (double enucm, TLorentzVector meson_mom, TLorentzVector meson_pos)
 
- Protected Attributes inherited from evgen::ldm::IMeVPrtlFlux
evgb::EvtTimeShiftI * fTimeShiftMethod
 
TRotation fBeam2Det
 
TVector3 fBeamOrigin
 
std::string fSpillTimeConfig
 
- Protected Attributes inherited from evgen::ldm::IMeVPrtlStage
CLHEP::HepRandomEngine * fEngine
 
const char * fName
 

Detailed Description

Kaon2HNLFlux class definiton.

Implementation of Kaon->HNL branching ratio taken from: arXiv:1912.07622

Definition at line 45 of file Kaon2HNLFlux_tool.cc.

Constructor & Destructor Documentation

evgen::ldm::Kaon2HNLFlux::Kaon2HNLFlux ( fhicl::ParameterSet const &  pset)

Constructor.

Definition at line 71 of file Kaon2HNLFlux_tool.cc.

71  :
72  IMeVPrtlStage("Kaon2HNLFlux"),
73  IMeVPrtlFlux(pset)
74 {
75  this->configure(pset);
76 
77 }
IMeVPrtlFlux(const fhicl::ParameterSet &pset)
Definition: IMeVPrtlFlux.h:49
void configure(const fhicl::ParameterSet &) override
Interface for configuring the particular algorithm tool.
IMeVPrtlStage(const char *name)
Definition: IMeVPrtlStage.h:46
evgen::ldm::Kaon2HNLFlux::~Kaon2HNLFlux ( )

Destructor.

Definition at line 81 of file Kaon2HNLFlux_tool.cc.

82 {
83 }

Member Function Documentation

void evgen::ldm::Kaon2HNLFlux::configure ( const fhicl::ParameterSet &  )
overridevirtual

Interface for configuring the particular algorithm tool.

Parameters
ParameterSetThe input set of parameters for configuration

Implements evgen::ldm::IMeVPrtlStage.

Definition at line 153 of file Kaon2HNLFlux_tool.cc.

154 {
155  fM = pset.get<double>("M");
156  fMagUm4 = pset.get<double>("MagUm4");
157  fMagUe4 = pset.get<double>("MagUe4");
158 
159  fKDAROnly = pset.get<bool>("KDAROnly", false);
160 
161  double max_mass = (fMagUe4 > 0.) ? (Constants::Instance().kplus_mass - Constants::Instance().elec_mass) :
163 
164  if (fM > max_mass) {
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) + ").");
167  }
168 
169 }
double fM
Mass of HNL [GeV].
static const Constants & Instance()
Definition: Constants.h:68
std::string to_string(WindowPattern const &pattern)
bool evgen::ldm::Kaon2HNLFlux::MakeFlux ( const simb::MCFlux &  flux,
MeVPrtlFlux hnl,
double &  weight 
)
overridevirtual

Implements evgen::ldm::IMeVPrtlFlux.

Definition at line 177 of file Kaon2HNLFlux_tool.cc.

177  {
178  // make the kaon parent
179  evgen::ldm::KaonParent kaon(flux);
180  if (abs(kaon.kaon_pdg) != 321) return false; // Only take charged kaons
181 
182  // select on the kaon
183  if (fKDAROnly && (kaon.mom.P() > 1e-3 || kaon.pos.Z() < 72000.)) return false;
184  if (fKDAROnly) std::cout << "FOUND KDAR\n";
185 
186  TLorentzVector Beam4 = BeamOrigin();
187 
188  // get position in detector frame
189  hnl.pos_beamcoord = kaon.pos;
190  hnl.pos = kaon.pos;
191  hnl.pos.Transform(fBeam2Det);
192  hnl.pos += Beam4;
193 
194  // Branch the parent Kaon Decay
195  double hnl_mass = fM;
196  std::pair<double, bool> decay = Branch(hnl_mass, fMagUe4, fMagUm4, GetRandom());
197  double br = decay.first;
198  bool is_muon = decay.second;
199  double lep_mass = is_muon ? Constants::Instance().muon_mass : Constants::Instance().elec_mass;
200 
201  std::cout << "BR: " << br << std::endl;
202 
203  // ignore if we can't make this hnl
204  // Ignore if branching ratio is exactly 0.
205  if (br == 0.) return false;
206 
207  // get the momentum direction in the kaon parent rest frame
208  double p = hnl_momentum(Constants::Instance().kplus_mass, lep_mass, hnl_mass);
209  double e = sqrt(p*p + hnl_mass * hnl_mass);
210  // Two-body decays are isotropic
211  hnl.mom = TLorentzVector(p*RandomUnitVector(), e);
212 
213  // boost to lab frame
214  TLorentzVector mom = hnl.mom;
215  mom.Boost(kaon.mom.BoostVector());
216 
217  hnl.mom_beamcoord = mom;
218  // rotate to detector frame
219  hnl.mom = mom;
220  hnl.mom.Transform(fBeam2Det);
221 
222  hnl.kmom_beamcoord = kaon.mom;
223  // also save the kaon momentum in the detector frame
224  hnl.kmom = kaon.mom;
225  hnl.kmom.Transform(fBeam2Det);
226 
227  // and save the secondary momentum
228  hnl.sec = hnl.kmom - hnl.mom;
229  hnl.sec_beamcoord = hnl.kmom_beamcoord - hnl.mom_beamcoord;
230 
231  // The weight is the importance weight times the branching-ratio weight
232  weight = kaon.weight * br / SMKaonBR(kaon.kaon_pdg);
233 
234  // set the mixing
235  hnl.C1 = fMagUe4;
236  hnl.C2 = fMagUm4;
237  hnl.mass = fM;
238 
239  hnl.kaon_pdg = kaon.kaon_pdg;
240  hnl.secondary_pdg = (is_muon ? 11 : 13) * (kaon.kaon_pdg > 0 ? 1 : -1);
241  hnl.generator = 1; // kHNL
242 
243  // equivalent neutrino energy
244  hnl.equiv_enu = EnuLab(flux.fnecm, hnl.kmom, hnl.pos);
245 
246  return true;
247 }
pdgs p
Definition: selectors.fcl:22
std::pair< double, bool > Branch(double hnl_mass, double ue4, double um4, double rand)
double fM
Mass of HNL [GeV].
T abs(T value)
static const Constants & Instance()
Definition: Constants.h:68
double SMKaonBR(int kaon_pdg)
double hnl_momentum(double kaon_mass, double lep_mass, double hnl_mass)
TLorentzVector BeamOrigin()
Definition: IMeVPrtlFlux.h:107
do i e
double EnuLab(double enucm, TLorentzVector meson_mom, TLorentzVector meson_pos)
Definition: IMeVPrtlFlux.h:119
BEGIN_PROLOG could also be cout
double evgen::ldm::Kaon2HNLFlux::MaxWeight ( )
overridevirtual

Implements evgen::ldm::IMeVPrtlStage.

Definition at line 171 of file Kaon2HNLFlux_tool.cc.

171  {
172  // Weight comes from the NuMi importance weight -- max is 100 (add in an epsilon)
173  // Scale by the branching ratios here
174  return 100.0001 * std::max(BranchingRatio(fM, fMagUe4, false) / SMKaonBR(321), BranchingRatio(fM, fMagUm4, true) / SMKaonBR(321));
175 }
double fM
Mass of HNL [GeV].
double BranchingRatio(double hnl_mass, double u4, bool is_muon)
double SMKaonBR(int kaon_pdg)

Member Data Documentation

bool evgen::ldm::Kaon2HNLFlux::fKDAROnly
private

Definition at line 68 of file Kaon2HNLFlux_tool.cc.

double evgen::ldm::Kaon2HNLFlux::fM
private

Mass of HNL [GeV].

Definition at line 65 of file Kaon2HNLFlux_tool.cc.

double evgen::ldm::Kaon2HNLFlux::fMagUe4
private

Definition at line 66 of file Kaon2HNLFlux_tool.cc.

double evgen::ldm::Kaon2HNLFlux::fMagUm4
private

Definition at line 67 of file Kaon2HNLFlux_tool.cc.


The documentation for this class was generated from the following file: