Skip to content
Snippets Groups Projects
Commit c8dc9e87 authored by Mark Jones's avatar Mark Jones Committed by Mark K Jones
Browse files

Modify THcRaster to add variable of EPICS beam energy

Add the variable ebeam_epics to the tree. This is the EPICS
value of HALLC:p  . For now this is good for monitoring changes in the
beam energy but needs to be check how it compares to the Hall C
beam energy measurement.
parent b9e95a69
Branches
Tags
No related merge requests found
...@@ -82,7 +82,9 @@ THcRaster::THcRaster( const char* name, const char* description, ...@@ -82,7 +82,9 @@ THcRaster::THcRaster( const char* name, const char* description,
fFrYB_ADC_zero_offset =0; fFrYB_ADC_zero_offset =0;
frPosAdcPulseIntRaw = NULL; frPosAdcPulseIntRaw = NULL;
fEbeamEpics_read=0.;
fEbeamEpics_prev=0.;
fEbeamEpics=0.;
for(Int_t i=0;i<4;i++){ for(Int_t i=0;i<4;i++){
fPedADC[i] = 0; fPedADC[i] = 0;
...@@ -269,6 +271,7 @@ Int_t THcRaster::DefineVariables( EMode mode ) ...@@ -269,6 +271,7 @@ Int_t THcRaster::DefineVariables( EMode mode )
{"fr_ybpmB", "Y BPM at BPMB (+Y is up)", "fYbpm_B"}, {"fr_ybpmB", "Y BPM at BPMB (+Y is up)", "fYbpm_B"},
{"fr_xbpmC", "X BPM at BPMC (+X is beam right)", "fXbpm_C"}, {"fr_xbpmC", "X BPM at BPMC (+X is beam right)", "fXbpm_C"},
{"fr_ybpmC", "Y BPM at BPMC (+Y is up)", "fYbpm_C"}, {"fr_ybpmC", "Y BPM at BPMC (+Y is up)", "fYbpm_C"},
{"ebeam_epics", "Beam energy of epics variable HALLC:p", "fEbeamEpics"},
{ 0 } { 0 }
}; };
...@@ -441,6 +444,9 @@ Int_t THcRaster::Decode( const THaEvData& evdata ) ...@@ -441,6 +444,9 @@ Int_t THcRaster::Decode( const THaEvData& evdata )
if (fEpicsHandler->IsLoaded("IPM3H07C.YRAW")){ if (fEpicsHandler->IsLoaded("IPM3H07C.YRAW")){
BPMYC_raw = atof(fEpicsHandler->GetString("IPM3H07C.YRAW")); BPMYC_raw = atof(fEpicsHandler->GetString("IPM3H07C.YRAW"));
} }
if (fEpicsHandler->IsLoaded("HALLC:p")){
fEbeamEpics_read = atof(fEpicsHandler->GetString("HALLC:p"));
}
} }
return 0; return 0;
...@@ -525,6 +531,8 @@ Int_t THcRaster::Process(){ ...@@ -525,6 +531,8 @@ Int_t THcRaster::Process(){
fYbeam_prev[2]=BPMYB_pos; fYbeam_prev[2]=BPMYB_pos;
fXbeam_prev[3]=BPMXC_pos; fXbeam_prev[3]=BPMXC_pos;
fYbeam_prev[3]=BPMYC_pos; fYbeam_prev[3]=BPMYC_pos;
fEbeamEpics = fEbeamEpics_read;
fEbeamEpics_prev=fEbeamEpics_read;
}else{ }else{
fgbeam_xoff = fXbeam_prev[0]; fgbeam_xoff = fXbeam_prev[0];
fgbeam_yoff = fYbeam_prev[0]; fgbeam_yoff = fYbeam_prev[0];
...@@ -536,7 +544,8 @@ Int_t THcRaster::Process(){ ...@@ -536,7 +544,8 @@ Int_t THcRaster::Process(){
BPMYC_pos=fYbeam_prev[3]; BPMYC_pos=fYbeam_prev[3];
fgbeam_xpoff = 0; fgbeam_xpoff = 0;
fgbeam_ypoff = 0; fgbeam_ypoff = 0;
} fEbeamEpics = fEbeamEpics_prev;
}
fXbpm_tar= -fgbeam_xoff; fXbpm_tar= -fgbeam_xoff;
fYbpm_tar= fgbeam_yoff; fYbpm_tar= fgbeam_yoff;
......
...@@ -117,6 +117,11 @@ class THcRaster : public THaBeamDet, public THcHitList { ...@@ -117,6 +117,11 @@ class THcRaster : public THaBeamDet, public THcHitList {
Double_t fYbpm_C; // Y BPM at BPMC (+Y is up) Double_t fYbpm_C; // Y BPM at BPMC (+Y is up)
Double_t fXbeam_prev[4]; // Double_t fXbeam_prev[4]; //
Double_t fYbeam_prev[4]; // Double_t fYbeam_prev[4]; //
//
Double_t fEbeamEpics;
Double_t fEbeamEpics_read;
Double_t fEbeamEpics_prev;
//
Double_t fFrXA_ADC_zero_offset; Double_t fFrXA_ADC_zero_offset;
Double_t fFrYA_ADC_zero_offset; Double_t fFrYA_ADC_zero_offset;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment