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

#include <KaonParent.h>

Public Member Functions

 KaonParent ()
 
 KaonParent (const simb::MCFlux &flux)
 

Public Attributes

TLorentzVector pos
 
TLorentzVector mom
 
int kaon_pdg
 
double weight
 
int mode
 

Detailed Description

Definition at line 10 of file KaonParent.h.

Constructor & Destructor Documentation

evgen::ldm::KaonParent::KaonParent ( )
inline

Definition at line 18 of file KaonParent.h.

18 {} // Default initialize
evgen::ldm::KaonParent::KaonParent ( const simb::MCFlux &  flux)

Definition at line 4 of file KaonParent.cxx.

4  {
5  // set the particle codes
6  switch (flux.fndecay) {
7  case 1 /*K0L -> nue pi- e+ */:
8  case 2 /*K0L -> nuebar pi+ e-*/:
9  case 3 /* K0L -> numu pi- mu+*/:
10  case 4 /*K0L -> numubar pi+ mu-*/:
11  kaon_pdg = 130;
12  break;
13  case 5 /*K+ -> numu mu+*/:
14  case 6 /*K+ -> nue pi0 e+*/:
15  case 7 /*K+ -> numu pi0 mu+*/:
16  kaon_pdg = 321;
17  break;
18  case 8 /*K- -> numubar mu-*/:
19  case 9 /*K- -> nuebar pi0 e-*/:
20  case 10 /*K- -> numubar pi0 mu-*/:
21  kaon_pdg = -321;
22  break;
23  default:
24  kaon_pdg = 0;
25  return; // not a kaon decay
26  }
27  mode = flux.fndecay;
28 
29  TVector3 pos3 = TVector3(flux.fvx, flux.fvy, flux.fvz);
30  double time = flux.fxpoint; /* README: the MCFlux for some reason does not have any time variable, so I have chosen to canibalize this one,
31  which according to documentation is just for debugging. (I am very sorry). */
32 
33  pos.SetVect(pos3);
34  pos.SetT(time);
35 
36 
37  // Get the mass from the available kinematics in the MCFlux
38 
39  // Get the magnitue of the beam slope drdz^2
40  double drdz2 = flux.fppdxdz*flux.fppdxdz + flux.fppdydz*flux.fppdydz;
41 
42  // the total momentum is p/cos(theta) = p * sqrt(1 + drdz2)
43  double production_momentum = flux.fpppz * sqrt(1 + drdz2);
44 
45  // And then we can use the total energy/momentum to get the mass
46  //
47  // This operation is dangerous numerically because for large energy we are relying
48  // on the cancellation of two large numbers to get a small number. I have tested that
49  // this gives precise results to 6 digits up to the energies relevant for numi (50GeV),
50  // provided one uses doubles.
51  double mass = sqrt(flux.fppenergy*flux.fppenergy - production_momentum*production_momentum);
52 
53  mom.SetVectM(TVector3(flux.fpdpx, flux.fpdpy, flux.fpdpz), mass);
54 
55  weight = flux.fnimpwt;
56 }
TLorentzVector pos
Definition: KaonParent.h:12
TLorentzVector mom
Definition: KaonParent.h:13
float mass
Definition: dedx.py:47

Member Data Documentation

int evgen::ldm::KaonParent::kaon_pdg

Definition at line 14 of file KaonParent.h.

int evgen::ldm::KaonParent::mode

Definition at line 16 of file KaonParent.h.

TLorentzVector evgen::ldm::KaonParent::mom

Definition at line 13 of file KaonParent.h.

TLorentzVector evgen::ldm::KaonParent::pos

Definition at line 12 of file KaonParent.h.

double evgen::ldm::KaonParent::weight

Definition at line 15 of file KaonParent.h.


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