Hall A ROOT/C++ Analyzer (podd)
Loading...
Searching...
No Matches
THaElossCorrection.h
Go to the documentation of this file.
1#ifndef Podd_THaElossCorrection_h_
2#define Podd_THaElossCorrection_h_
3
5//
6// THaElossCorrection
7//
9
10#include "THaPhysicsModule.h"
11#include "TString.h"
12
13class THaVertexModule;
14
16
17public:
18 virtual ~THaElossCorrection();
19
20 virtual void Clear( Option_t* opt="" );
21 virtual EStatus Init( const TDatime& run_time );
22
23 Double_t GetMass() const { return fM; }
24 Double_t GetEloss() const { return fEloss; }
25
26 void SetInputModule( const char* name );
27 void SetMass( Double_t m /* GeV/c^2 */ );
28 void SetTestMode( Bool_t enable=true,
29 Double_t eloss_value=0.0 /* GeV */ );
30 void SetMedium( Double_t Z, Double_t A,
31 Double_t density /* g/cm^3 */ );
32 void SetPathlength( Double_t pathlength /* m */ );
33 void SetPathlength( const char* vertex_module,
34 Double_t z_ref /* m */, Double_t scale = 1.0 );
35
36 static Double_t ElossElectron( Double_t beta, Double_t z_med,
37 Double_t a_med,
38 Double_t d_med /* g/cm^3 */,
39 Double_t pathlength /* m */ );
40 static Double_t ElossHadron( Int_t Z_hadron, Double_t beta,
41 Double_t z_med, Double_t a_med,
42 Double_t d_med /* g/cm^3 */,
43 Double_t pathlength /* m */ );
44
45protected:
46
47 // Event-by-event data
48 Double_t fEloss; // Energy loss correction (GeV)
49
50 // Parameters
51 Double_t fM; // Mass of particle (GeV/c^2)
52 Int_t fZ; // Charge (Z) of particle (only used for hadrons)
53
54 Double_t fZmed; // Effective Z of medium
55 Double_t fAmed; // Effective A of medium
56 Double_t fDensity; // Density of medium (g/cm^3)
57 Double_t fPathlength; // Pathlength through medium (m)
58 Double_t fZref; // Reference z-pos for variable pathlength calc (m)
59 Double_t fScale; // Scale factor for variable pathlength calc
60
61 Bool_t fTestMode; // If true, use fixed value for fEloss
62 Bool_t fElectronMode;// Particle is electron or positron
63 Bool_t fExtPathMode; // If true, obtain pathlength from vertex module
64 TString fInputName; // Name of input module
65 TString fVertexName; // Name of vertex module for var pathlength, if any
66 THaVertexModule* fVertexModule;// Pointer to vertex module
67
68 // Setup functions
69 virtual Int_t DefineVariables( EMode mode = kDefine );
70 virtual Int_t ReadRunDatabase( const TDatime& date );
71
72 THaElossCorrection( const char* name, const char* description,
73 const char* input = "",
74 Double_t particle_mass = 0.511e-3 /* GeV/c^2 */,
75 Int_t hadron_charge = 1 );
76
77private:
78 // Energy loss library functions
79 static Double_t ExEnerg( Double_t z_med, Double_t d_med );
80 static void HaDensi( Double_t z_med, Double_t d_med,
81 Double_t& X0, Double_t& X1, Double_t& M );
82
83 ClassDef(THaElossCorrection,0) //Track energy loss correction module
84};
85
86#endif
int Int_t
bool Bool_t
double Double_t
const char Option_t
#define ClassDef(name, id)
virtual Int_t DefineVariables(EMode mode=kDefine)
Double_t GetMass() const
void SetPathlength(Double_t pathlength)
static void HaDensi(Double_t z_med, Double_t d_med, Double_t &X0, Double_t &X1, Double_t &M)
virtual void Clear(Option_t *opt="")
void SetMedium(Double_t Z, Double_t A, Double_t density)
virtual Int_t ReadRunDatabase(const TDatime &date)
static Double_t ElossHadron(Int_t Z_hadron, Double_t beta, Double_t z_med, Double_t a_med, Double_t d_med, Double_t pathlength)
static Double_t ElossElectron(Double_t beta, Double_t z_med, Double_t a_med, Double_t d_med, Double_t pathlength)
static Double_t ExEnerg(Double_t z_med, Double_t d_med)
void SetInputModule(const char *name)
THaVertexModule * fVertexModule
void SetTestMode(Bool_t enable=true, Double_t eloss_value=0.0)
Double_t GetEloss() const