TargetData.cpp
Go to the documentation of this file.
1 
2 #include "TargetData.h"
3 #include <iomanip>
4 
5 namespace NeutrinoFluxReweight{
6 
8 
9  Tar_pdg = 0;
10 
11  Px = -1000.;
12  Py = -1000.;
13  Pz = -1000.;
14  Pt = -1000.;
15  Theta = -1000.;
16 
17  Vx = -1000.;
18  Vy = -1000.;
19  Vz = -1000.;
20 
21  Idx_ancestry = -1;
22 
23  }
24 
25  TargetData::TargetData(double tarMom[],int tarPdg, double position[],int anc_idx){
26 
27  TargetData::Tar_pdg = tarPdg;
28 
29  TargetData::Px = tarMom[0];
30  TargetData::Py = tarMom[1];
31  TargetData::Pz = tarMom[2];
32  TargetData::Pt = std::sqrt(tarMom[0]*tarMom[0] + tarMom[1]*tarMom[1]);
34 
35  TargetData::Vx = position[0];
36  TargetData::Vy = position[1];
37  TargetData::Vz = position[2];
38 
39  Idx_ancestry = anc_idx;
40  }
41 
42  //----------------------------------------------------------------------
44 
45  }
46  std::ostream& TargetData::print(std::ostream& os) const {
47 
48  using namespace std;
49 
50  os<<"pid:"<<setw(5)<<Tar_pdg
51  <<"|p3:"<<setiosflags(ios::fixed) << setprecision(2);
52  os<<Px<<","<<Py<<","<<Pz;
53  os <<"|v3:";
54  os<<Vx<<","<<Vy<<","<<Vz;
55  // os<<endl;
56  return os;
57  }
58 
59 }
int Idx_ancestry
The index of the hadron leaving the target in the ancestry chain.
Definition: TargetData.h:51
double Vz
The z position of the hadron leaving the target.
Definition: TargetData.h:48
double Theta
Angle (rad) of the particle.
Definition: TargetData.h:36
STL namespace.
TargetData()
Default Constructor.
Definition: TargetData.cpp:7
int Tar_pdg
pdg code of the particle
Definition: TargetData.h:24
std::ostream & print(std::ostream &os) const
Definition: TargetData.cpp:46
Q_EXPORT QTSManip setprecision(int p)
Definition: qtextstream.h:343
double Px
P_{x} (GeV/c) of the particle.
Definition: TargetData.h:30
Q_EXPORT QTSManip setw(int w)
Definition: qtextstream.h:331
double Vx
The x position of the hadron leaving the target.
Definition: TargetData.h:42
double Pt
Transversal momentum (GeV/c) of the particle.
Definition: TargetData.h:39
double Pz
Longitudinal momentum (GeV/c) of the particle.
Definition: TargetData.h:27
double Py
P_{y} (GeV/c) of the particle.
Definition: TargetData.h:33
double Vy
The y position of the hadron leaving the target.
Definition: TargetData.h:45