Hall A ROOT/C++ Analyzer (podd)
Loading...
Searching...
No Matches
THaSAProtonEP.cxx
Go to the documentation of this file.
1//*-- Author: LEDEX collaboration June 2006
2
3// THaSAProtonEP
4//
5// This module is calculates the kinematics for elastic X(e,X)e'
6// (and only that reaction!!!) when only the outbound X is detected.
7//
8// By default X = proton. For heavier targets, use SetMass() or
9// giv ethe target mass explicitly in the constructor.
10
11#include "THaSAProtonEP.h"
12#include "THaRunBase.h"
13#include "THaTrackingModule.h"
14#include "THaBeam.h"
15#include "TMath.h"
16
17using namespace std;
18
19// Assume ep by default
20static const Double_t electron_mass = 0.511e-3;
21static const Double_t Mp = 0.938272;
22
23//_____________________________________________________________________________
24THaSAProtonEP::THaSAProtonEP( const char* name, const char* description,
25 const char* spectro,
27 : THaPrimaryKine(name,description,spectro,electron_mass,
28 (target_mass > 0.0) ? target_mass : Mp )
29{
30 // Standard constructor. Assumes ideal beam along z_lab.
31}
32
33
34//_____________________________________________________________________________
35THaSAProtonEP::THaSAProtonEP( const char* name, const char* description,
36 const char* spectro, const char* beam,
38 : THaPrimaryKine(name,description,spectro,beam,
39 (target_mass > 0.0) ? target_mass : Mp )
40{
41 // Constructor with specification of optional beam module.
42
44}
45
46//_____________________________________________________________________________
48{
49 // Calculate the electron kinematics for elastic eX -> eX using the
50 // 4-vector from the outgoing X.
51
52 if( !IsOK() || !gHaRun ) return -1;
53
55 if( !trkifo || !trkifo->IsOK() ) return 1;
56
57 // 4-momentum of incident particle. If a beam module given
58 // then use it, otherwise assume beam along z_lab
59 if( fBeam ) {
61 } else {
63 fP0.SetXYZM( 0.0, 0.0, p_in, fM );
64 }
65
66 // Assume target at rest
67 fA.SetXYZM( 0.0, 0.0, 0.0, fMA );
68
69 //Only for elastic ep
70 fA1.SetVectM( trkifo->GetPvect(), fMA );
71 fQ = fA1 - fA;
72 fP1 = fP0 - fQ;
73
74 // Reconstructed electron kinematics
75 fQ2 = -fQ.M2();
76 fQ3mag = fQ.P();
77 fOmega = fQ.E();
78 fW2 = fA1.M2(); // = fMA
80 fEpsilon = 1.0 / ( 1.0 + 2.0*fQ3mag*fQ3mag/fQ2*
81 pow( tan(fScatAngle/2.0), 2.0 ));
82 fThetaQ = fQ.Theta();
83 fPhiQ = fQ.Phi();
84 fXbj = fQ2/(2.0*Mp*fOmega);
85
86 fDataValid = true;
87 return 0;
88}
89
90
92
int Int_t
double Double_t
char name[80]
R__EXTERN class THaRunBase * gHaRun
Definition THaGlobals.h:16
static const Double_t target_mass
static const Double_t Mp
static const Double_t electron_mass
Bool_t IsOK() const
const TVector3 & GetPvect() const
Definition THaBeamInfo.h:56
THaBeamInfo * GetBeamInfo()
Double_t fScatAngle
THaTrackingModule * fSpectro
void SetMass(Double_t m)
THaBeamModule * fBeam
THaRunParameters * GetParameters() const
Definition THaRunBase.h:61
Double_t GetBeamP() const
virtual Int_t Process(const THaEvData &)
THaSAProtonEP(const char *name, const char *description, const char *spectro="", Double_t target_mass=-1.0)
const TVector3 & GetPvect() const
Bool_t IsOK() const
THaTrackInfo * GetTrackInfo()
Double_t Angle(const TVector3 &v) const
TVector3 Vect() const
Double_t M2() const
Double_t P() const
Double_t Theta() const
Double_t Phi() const
Double_t E() const
void SetVectM(const TVector3 &spatial, Double_t mass)
void SetXYZM(Double_t x, Double_t y, Double_t z, Double_t m)
RVec< PromoteType< T > > tan(const RVec< T > &v)
RVec< PromoteTypes< T0, T1 > > pow(const RVec< T0 > &v, const T1 &y)
STL namespace.
ClassImp(TPyArg)