GENIEGenerator
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
HNLFluxContainer.cxx
Go to the documentation of this file.
1 //____________________________________________________________________________
2 /*
3  Copyright (c) 2003-2024, The GENIE Collaboration
4  For the full text of the license visit http://copyright.genie-mc.org
5 
6  John Plows <komninos-john.plows@physics.ox.ac.yk>
7  University of Oxford
8 
9  Robert Hatcher <rhatcher@fnal.gov>
10  Fermi National Accelerator Laboratory
11 
12  Costas Andreopoulos <c.andreopoulos \at cern.ch>
13  University of Liverpool
14 */
15 //____________________________________________________________________________
16 
17 #include <cstdlib>
18 #include <fstream>
19 #include <vector>
20 #include <sstream>
21 #include <cassert>
22 #include <climits>
23 
24 #include "libxml/xmlmemory.h"
25 #include "libxml/parser.h"
26 
29 
30 #include <TFile.h>
31 #include <TChain.h>
32 #include <TChainElement.h>
33 #include <TSystem.h>
34 #include <TStopwatch.h>
35 
37 #include "Framework/Conventions/GBuild.h"
38 
46 
47 using std::endl;
48 
49 #include <vector>
50 #include <algorithm>
51 #include <iomanip>
52 #include "TRegexp.h"
53 #include "TString.h"
54 
56 
57 using namespace genie;
58 using namespace genie::hnl;
59 
60 //___________________________________________________________________________
61 FluxContainer::FluxContainer()
62  : TObject()
63 {
64  this->ResetCopy();
65 }
66 
67 //___________________________________________________________________________
69 {
70  evtno = 0;
71 
72  pdg = 0;
73  parPdg = 0;
74  lepPdg = 0;
75  nuPdg = 0;
76 
77  prodChan = 0;
78  nuProdChan = 0;
79 
80  startPoint.SetXYZ(0.0, 0.0, 0.0);
81  targetPoint.SetXYZ(0.0, 0.0, 0.0);
82  startPointUser.SetXYZ(0.0, 0.0, 0.0);
83  targetPointUser.SetXYZ(0.0, 0.0, 0.0);
84  delay = 0.0;
85 
86  polz.SetXYZ(0.0, 0.0, 0.0);
87 
88  p4.SetPxPyPzE(0.0, 0.0, 0.0, 0.0);
89  parp4.SetPxPyPzE(0.0, 0.0, 0.0, 0.0);
90  p4User.SetPxPyPzE(0.0, 0.0, 0.0, 0.0);
91  parp4User.SetPxPyPzE(0.0, 0.0, 0.0, 0.0);
92 
93  Ecm = 0.0;
94  nuEcm = 0.0;
95 
96  XYWgt = 0.0;
97  boostCorr = 0.0;
98  accCorr = 0.0;
99  zetaMinus = 0.0;
100  zetaPlus = 0.0;
101  acceptance = 0.0;
102 
103  nimpwt = 0.0;
104 }
105 
106 //___________________________________________________________________________
107 void FluxContainer::Print(const Option_t* /* opt */ ) const
108 {
109  std::cout << *this << std::endl;
110 }
111 //___________________________________________________________________________
112 
113 namespace genie {
114 namespace hnl {
115  ostream & operator << (
116  ostream & stream, const FluxContainer & info)
117  {
118  // convert some stuff to string
119  HNLProd_t hProdChan = static_cast<HNLProd_t>(info.prodChan);
120 
121  std::string sNuProdChan;
122  int typeMod = (info.pdg > 0) ? 1 : -1;
123  int switchChan = typeMod * info.nuProdChan;
124  switch(switchChan){
125  case 1: sNuProdChan = std::string("K0L -> nue + pi- + e+"); break;
126  case -1: sNuProdChan = std::string("K0L -> nuebar + pi+ + e-"); break;
127  case 2: sNuProdChan = std::string("K0L -> numu + pi- + mu"); break;
128  case -2: sNuProdChan = std::string("K0L -> numubar + pi+ + mu-"); break;
129  case 3: sNuProdChan = std::string("K+ -> numu + mu+"); break;
130  case -3: sNuProdChan = std::string("K- -> numubar + mu-"); break;
131  case 4: sNuProdChan = std::string("K+ -> nue + e+"); break;
132  case -4: sNuProdChan = std::string("K- -> nuebar + e-"); break;
133  case 5: sNuProdChan = std::string("K+ -> numu + pi0 + mu+"); break;
134  case -5: sNuProdChan = std::string("K- -> numubar + pi0 + mu-"); break;
135  case 6: sNuProdChan = std::string("K+ -> nue + pi0 + e+"); break;
136  case -6: sNuProdChan = std::string("K- -> nuebar + pi0 + e-"); break;
137  case 7: sNuProdChan = std::string("pi+ -> numu + mu+"); break;
138  case -7: sNuProdChan = std::string("pi- -> numubar + mu-"); break;
139  case 8: sNuProdChan = std::string("pi+ -> nue + e+"); break;
140  case -8: sNuProdChan = std::string("pi- -> nuebar + e-"); break;
141  case 9: sNuProdChan = std::string("mu- -> numu + nuebar + e-"); break;
142  case -9: sNuProdChan = std::string("mu+ -> numubar + nue + e+"); break;
143  default: sNuProdChan = std::string("Unknown!"); break;
144  }
145 
146  stream << "\nEvent number: " << info.evtno
147  << "\nHNL PDG code: " << info.pdg
148  << "\nParent PDG code: " << info.parPdg
149  << "\nCo-produced lepton PDG code: " << info.lepPdg
150  << "\nParent weight: " << info.nimpwt
151  << "\nHNL polarisation vector [HNL rest frame, NEAR coords]: " << utils::print::Vec3AsString(&info.polz)
152  << "\nPDG code of equivalent SM neutrino: " << info.nuPdg
153  << "\nProduction channel: " << utils::hnl::ProdAsString(hProdChan)
154  << " ; code " << info.prodChan
155  << "\nEquivalent neutrino production channel: " << sNuProdChan
156  << " ; code " << info.nuProdChan
157  << "\nHNL parent rest-frame energy [GeV]: " << info.Ecm
158  << "\nEquivalent neutrino parent rest-frame energy [GeV]: " << info.nuEcm
159  << "\nStart point [NEAR, m]: " << utils::print::Vec3AsString(&info.startPoint)
160  << "\nStart point [USER, m]: " << utils::print::Vec3AsString(&info.startPointUser)
161  << "\nFlux passes through point [NEAR, m]: " << utils::print::Vec3AsString(&info.targetPoint)
162  << "\nFlux passes through point [USER, m]: " << utils::print::Vec3AsString(&info.targetPointUser)
163  << "\nHNL momentum [NEAR, GeV]: " << utils::print::P4AsString(&info.p4)
164  << "\nHNL momentum [USER, GeV]: " << utils::print::P4AsString(&info.p4User)
165  << "\nHNL delay wrt SM neutrino [ns]: " << info.delay
166  << "\nParent momentum [NEAR, GeV]: " << utils::print::P4AsString(&info.parp4)
167  << "\nParent momentum [USER, GeV]: " << utils::print::P4AsString(&info.parp4User)
168  << "\nDeviation angles zeta- = " << info.zetaMinus << ", zeta+ = " << info.zetaPlus
169  << "\nGeometric acceptance: " << info.XYWgt
170  << "\nBoost correction: " << info.boostCorr
171  << "\nAcceptance correction: " << info.accCorr
172  << "\nFull acceptance: " << info.acceptance;
173 
174  return stream;
175  }
176 }//hnl
177 }//genie
178 
179 //___________________________________________________________________________
enum genie::hnl::t_HNLProd HNLProd_t
TLorentzVector parp4
parent momentum at HNL production in NEAR coords [GeV/c]
double Ecm
Parent rest-frame energy of HNL [GeV].
double zetaMinus
minimum angular deviation from parent momentum to reach detector [deg]
double nuEcm
Parent rest-frame energy of equivalent SM neutrino [GeV].
double delay
delay HNL would have wrt SMv [ns]
TVector3 startPoint
parent decay vertex in NEAR coords [m]
int lepPdg
PDG code of lepton produced with HNL on parent decay.
TVector3 polz
HNL polarisation vector, in HNL rest frame, in NEAR coords.
int parPdg
parent PDG code
A GENIE flux container specific for HNL containers. Based on the dk2nu flux paradigm and genie::flux:...
string P4AsString(const TLorentzVector *p)
Definition: PrintUtils.cxx:27
double zetaPlus
maximum angular deviation from parent momentum to reach detector [deg]
ostream & operator<<(ostream &stream, const FluxContainer &info)
TVector3 startPointUser
parent decay vertex in USER coords [m]
TLorentzVector parp4User
parent momentum at HNL production in USER coords [GeV/c]
void Print(const Option_t *) const
TLorentzVector p4
HNL momentum in NEAR coords [GeV/c].
TLorentzVector p4User
HNL momentum in USER coords [GeV/c].
int prodChan
Decay mode that produced HNL.
string ProdAsString(genie::hnl::HNLProd_t hnlprod)
double acceptance
full acceptance == XYWgt * boostCorr^2 * accCorr
TVector3 targetPointUser
point in detector HNL is forced towards in USER coords [m]
TVector3 targetPoint
point in detector HNL is forced towards in NEAR coords [m]
double nimpwt
Weight of parent.
double accCorr
acceptance correction (collimation effect. SM v == 1)
int nuPdg
PDG code of SM neutrino that would have been produced.
double XYWgt
geometric acceptance (angular size of detector in parent rest frame)
int nuProdChan
Decay mode that would have produced SM neutrino.
double boostCorr
boost correction wrt parent rest-frame (ELAB = ECM * boostCorr)
Most commonly used PDG codes. A set of utility functions to handle PDG codes is provided in PDGUtils...
string Vec3AsString(const TVector3 *vec)
Definition: PrintUtils.cxx:80