24 const char* description,
25 const char* input_tracks,
27 Int_t hadron_charge ) :
29 fZ(hadron_charge), fZmed(0.0), fAmed(0.0), fDensity(0.0), fPathlength(0.0),
30 fZref(0.0), fScale(0.0),
31 fTestMode(false), fElectronMode(false), fExtPathMode(false),
32 fInputName(input_tracks), fVertexModule(nullptr)
82 const RVarDef var[] = {
83 {
"eloss",
"Calculated energy loss correction (GeV)",
"fEloss" },
84 {
"pathl",
"Pathlength thru medium for this event",
"fPathlength" },
102 {
"M", &
fM,
kDouble, 0,
false, 0,
"M (particle mass [GeV/c^2])" },
103 {
"Z", &
fZ,
kInt, 0,
true, 0,
"Z (particle Z)" },
104 {
"Z_med", &
fZmed,
kDouble, 0,
false, 0,
"Z_med (Z of medium)" },
105 {
"A_med", &
fAmed,
kDouble, 0,
false, 0,
"A_med (A of medium)" },
106 {
"density", &
fDensity,
kDouble, 0,
false, 0,
"density of medium [g/cm^3]" },
107 {
"pathlength", &
fPathlength,
kDouble, 0,
false, 0,
"pathlength through medium [m]" },
113 while( req[i].
name ) {
115 req[i].optional =
true;
123 DBRequest* item = req;
124 while( item->name ) {
125 if( *((
double*)item->var) != 0.0 )
285 static const Double_t COEF = 0.1535374581;
289 static const Double_t EMAS = 0.5109989020;
297 if( beta <= 0.0 || beta >= 1.0 || z_med == 0.0 ||
298 a_med == 0.0 || pathlength == 0.0 )
313 Double_t EKIN = EMAS * ( GAMMA - 1.0 );
323 if(DENS < 0.0) DENS = 0.0;
327 Double_t ESTP = COEF * z_med * ( BETH - DENS ) / a_med / BETA2;
331 Double_t eloss = ESTP * d_med * pathlength * 1
e-3;
375 static const Double_t COEF = 0.3070749162;
379 static const Double_t EMAS = 0.5109989020;
387 if( Z_hadron == 0 || beta <= 0.0 || beta >= 1.0 || z_med == 0.0 ||
388 a_med == 0.0 || pathlength == 0.0 )
394 Double_t GAMA2 = 1.0 / (1.0 - BETA2);
433 Double_t SHE0 = 4.2237e-1*ETA2 + 3.040e-2*ETA4 - 3.80e-4*ETA6;
434 Double_t SHE1 = 3.8580e0 *ETA2 - 1.668e-1*ETA4 + 1.58e-3*ETA6;
435 Double_t SHEL = 1
e-6 * EXEN * EXEN * (SHE0 + 1
e-3*SHE1*EXEN) / z_med;
440 HSTP = HSTP * ( BETH - DENS - SHEL ) / BETA2;
444 Double_t eloss = HSTP * d_med * pathlength * 1
e-3;
520 cout <<
"Warning... Unknown selected material !!" << endl;
521 cout <<
"z_med = " << z_med <<
" d_med = " << d_med << endl;
522 cout <<
"Implement THaElossCorrection::ExEnerg routine for proper use."
599 else if( d_med < 2.050) {
605 else if( d_med < 2.270) {
642 cout <<
"Warning... Inconsistent material density... " << endl;
643 cout <<
"z_med = " << z_med <<
" d_med = " << d_med << endl;
644 cout <<
"Implement THaElossCorrection::HaDensi routine for proper use."
Option_t Option_t TPoint TPoint const char mode
static const Double_t eps
virtual Int_t ReadRunDatabase(const TDatime &date)
static Int_t LoadDB(FILE *file, const TDatime &date, const DBRequest *request, const char *prefix, Int_t search=0, const char *here="THaAnalysisObject::LoadDB")
static Int_t DefineVarsFromList(const void *list, EType type, EMode mode, const char *def_prefix, const TObject *obj, const char *prefix, const char *here, const char *comment_subst="")
THaAnalysisObject * FindModule(const char *name, const char *classname, bool do_error=true)
virtual FILE * OpenRunDBFile(const TDatime &date)
virtual Int_t DefineVariables(EMode mode=kDefine)
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="")
THaElossCorrection(const char *name, const char *description, const char *input="", Double_t particle_mass=0.511e-3, Int_t hadron_charge=1)
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)
virtual ~THaElossCorrection()
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)
void PrintInitError(const char *here)
virtual void Clear(Option_t *opt="")
const char * Data() const
double beta(double x, double y)
RVec< PromoteType< T > > log2(const RVec< T > &v)
Double_t Power(Double_t x, Double_t y)
Double_t Sqrt(Double_t x)
Double_t Max(Double_t a, Double_t b)
Double_t Log10(Double_t x)