Skip to content
Snippets Groups Projects
Commit 9f076db7 authored by Mark Jones's avatar Mark Jones
Browse files

Add getting beam energy from gpbeam parameter

Read gpbeam in THcRaster::ReadDatabase
Add jan05.kinematics
Modified DBASE/raster_test.database to fill g_ctp_kinematics_filename
with DBASE/jan05.kinematics
Modified raster_test.C to load g_ctp_kinematics_filename
parent 47ef7bca
No related branches found
No related tags found
No related merge requests found
This diff is collapsed.
This diff is collapsed.
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
// Open and load parameter files // Open and load parameter files
// //
gHcParms->Load(gHcParms->GetString("g_ctp_kinematics_filename"), RunNumber);
gHcParms->Load(gHcParms->GetString("g_ctp_parm_filename")); gHcParms->Load(gHcParms->GetString("g_ctp_parm_filename"));
// parameters not found in usual engine parameter files // parameters not found in usual engine parameter files
gHcParms->Load("PARAM/hcana.param"); gHcParms->Load("PARAM/hcana.param");
......
...@@ -96,6 +96,7 @@ Int_t THcRaster::ReadDatabase( const TDatime& date ) ...@@ -96,6 +96,7 @@ Int_t THcRaster::ReadDatabase( const TDatime& date )
{"fr_cal_mom",&fFrCalMom, kDouble}, {"fr_cal_mom",&fFrCalMom, kDouble},
{"frx_adcpercm",&fFrXADCperCM, kDouble}, {"frx_adcpercm",&fFrXADCperCM, kDouble},
{"fry_adcpercm",&fFrYADCperCM, kDouble}, {"fry_adcpercm",&fFrYADCperCM, kDouble},
{"pbeam",&fgpbeam, kDouble},
{0} {0}
}; };
...@@ -301,12 +302,13 @@ Int_t THcRaster::Process( ){ ...@@ -301,12 +302,13 @@ Int_t THcRaster::Process( ){
gfry = (gfry_adc/gfry_adcpercm)*(gfr_cal_mom/ebeam) gfry = (gfry_adc/gfry_adcpercm)*(gfr_cal_mom/ebeam)
*/ */
// bpw- Iam not sure how to access the global variables. the below code doesnt work. so for now, hard code the beam energy. // bpw- Iam not sure how to access the global variables. the below code doesnt work. so for now, hard code the beam energy.
if(gHcParms->Find("ebeam")){ eBeam=0.0001;
tmp=*(Double_t *)gHcParms->Find("ebeam")->GetValuePointer(); if(gHcParms->Find("gpbeam")){
cout <<"e Beam = "<< tmp << endl; eBeam=*(Double_t *)gHcParms->Find("gpbeam")->GetValuePointer();
} }
// cout <<"e Beam = "<< eBeam << " " << fgpbeam << endl;
eBeam = 4.02187; // eBeam = 4.02187;
fXpos = (fXADC/fFrXADCperCM)*(fFrCalMom/eBeam); fXpos = (fXADC/fFrXADCperCM)*(fFrCalMom/eBeam);
fYpos = (fYADC/fFrYADCperCM)*(fFrCalMom/eBeam); fYpos = (fYADC/fFrYADCperCM)*(fFrCalMom/eBeam);
......
...@@ -40,6 +40,8 @@ class THcRaster : public THaBeamDet, public THcHitList { ...@@ -40,6 +40,8 @@ class THcRaster : public THaBeamDet, public THcHitList {
Int_t ReadDatabase( const TDatime& date ); Int_t ReadDatabase( const TDatime& date );
Int_t DefineVariables( EMode mode ); Int_t DefineVariables( EMode mode );
Double_t fgpbeam; //
Double_t fXADC; // X current Double_t fXADC; // X current
Double_t fYADC; // Y current Double_t fYADC; // Y current
Double_t fXpos; // X position Double_t fXpos; // X position
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment