Skip to content
Snippets Groups Projects
Commit f34d57d9 authored by hallc-online's avatar hallc-online Committed by Mark K Jones
Browse files

Update THcHallCSpectrometer and THcExtTarCor

THcHallCSpectrometer
  1) Add variables fMispointing_x and fMispointing_y
    which are filled by parameters hmispointing_x, hmispointing_y
      in PARAM/HMS/GEN/hmsflags.param and pmispointing_x, pmispointing_y
      in PARAM/SHMS/GEN/shmsflags.param .
   The offsets are used in THcExtTarCor and THaReactionPoint
  2) Modify argument to method CalculateTargetQuantities to be xtar
     instead of gbeam_y .

THcExtTarCor
   1) add call to get spectrometer pointing offsets
   2) The mispointing_x is added to xtar
   3) Set xtar to start as -beam_y = - vertex(1)+mispointing_x for first call to CalculateTargetQuantities
      After first call the xtar is recalculated using the returned xptar
      and a second call is done to get the target xptar,ytar,yptar and delta.
    4) Fill golden track with final xtar
parent 425470d0
No related branches found
No related tags found
No related merge requests found
......@@ -128,7 +128,8 @@ Int_t THcExtTarCor::Process( const THaEvData& )
Double_t delta;
Double_t p=0;
TVector3 pvect;
Double_t xtar_new=vertex[1];
TVector3 pointing_off=spectro->GetPointingOffset();
Double_t xtar_new=-vertex[1];
TClonesArray* tracks = spectro->GetTracks();
if( !tracks ){
return -2;
......@@ -137,19 +138,18 @@ Int_t THcExtTarCor::Process( const THaEvData& )
THaTrack* theTrack = static_cast<THaTrack*>( tracks->At(i) );
if( theTrack == spectro->GetGoldenTrack() ) {
// Calculate corrections & recalculate ,,,track parameters
//cout << " orig" << spectro->GetName() << " " <<theTrack->GetTTheta()<< " " << theTrack->GetDp() << endl;
Double_t x_tg = vertex[1];
Double_t x_tg = -vertex[1]+pointing_off[0]; // units of cm, beam position in spectrometer coordinate system
spectro->CalculateTargetQuantities(theTrack,x_tg,xptar,ytar,yptar,delta);
p = spectro->GetPcentral() * ( 1.0+delta );
spectro->TransportToLab( p, xptar, yptar, pvect );
Double_t theta=spectro->GetThetaSph();
xtar_new = x_tg - xptar*ztarg*cos(theta);
xtar_new = x_tg - xptar*ztarg*cos(theta); //units of cm
// Get a second-iteration value for x_tg based on the
spectro->CalculateTargetQuantities(theTrack,xtar_new,xptar,ytar,yptar,delta);
fDeltaDp = delta*100 -theTrack->GetDp();
fDeltaP = p - theTrack->GetP();
fDeltaTh = xptar - theTrack->GetTTheta();
theTrack->SetTarget(0.0, ytar*100.0, xptar, yptar);
theTrack->SetTarget(xtar_new, ytar*100.0, xptar, yptar);
theTrack->SetDp(delta*100.0); // Percent.
Double_t ptemp =spectro->GetPcentral()*(1+theTrack->GetDp()/100.0);
theTrack->SetMomentum(ptemp);
......
......@@ -207,6 +207,8 @@ Int_t THcHallCSpectrometer::ReadDatabase( const TDatime& date )
{"theta_lab", &fTheta_lab, kDouble },
{"partmass", &fPartMass, kDouble },
{"phi_lab", &fPhi_lab, kDouble, 0, 1},
{"mispointing_x", &fMispointing_x, kDouble, 0, 1},
{"mispointing_y", &fMispointing_y, kDouble, 0, 1},
{"sel_using_scin", &fSelUsingScin, kInt, 0, 1},
{"sel_using_prune", &fSelUsingPrune, kInt, 0, 1},
{"sel_ndegreesmin", &fSelNDegreesMin, kDouble, 0, 1},
......@@ -238,6 +240,8 @@ Int_t THcHallCSpectrometer::ReadDatabase( const TDatime& date )
fSelUsingPrune = 0;
fPhi_lab = 0.;
fSatCorr=0.;
fMispointing_x=0.;
fMispointing_y=0.;
gHcParms->LoadParmValues((DBRequest*)&list,prefix);
EnforcePruneLimits();
......@@ -270,9 +274,8 @@ Int_t THcHallCSpectrometer::ReadDatabase( const TDatime& date )
// Computes TRotation fToLabRot and fToTraRot
Bool_t bend_down = kFALSE;
SetCentralAngles(fTheta_lab, ph, bend_down);
Double_t off_x = 0.0, off_y = 0.0, off_z = 0.0;
fPointingOffset.SetXYZ( off_x, off_y, off_z );
Double_t off_z = 0.0;
fPointingOffset.SetXYZ( fMispointing_x, fMispointing_y, off_z );
//
ifstream ifile;
ifile.open(reconCoeffFilename.c_str());
......@@ -388,7 +391,7 @@ Int_t THcHallCSpectrometer::FindVertices( TClonesArray& tracks )
return 0;
}
//
void THcHallCSpectrometer::CalculateTargetQuantities(THaTrack* track,Double_t& gbeam_y,Double_t& xptar,Double_t& ytar,Double_t& yptar,Double_t& delta)
void THcHallCSpectrometer::CalculateTargetQuantities(THaTrack* track,Double_t& xtar,Double_t& xptar,Double_t& ytar,Double_t& yptar,Double_t& delta)
{
Double_t hut[5];
Double_t hut_rot[5];
......@@ -398,7 +401,7 @@ void THcHallCSpectrometer::CalculateTargetQuantities(THaTrack* track,Double_t& g
hut[2] = track->GetY()/100.0 + fZTrueFocus*track->GetPhi() + fDetOffset_y;//m
hut[3] = track->GetPhi() + fAngOffset_y;//radians
hut[4] = -gbeam_y/100.0;
hut[4] = xtar/100.0;
// Retrieve the focal plane coordnates
// Do the transpormation
......
......@@ -144,6 +144,8 @@ protected:
Double_t fPCentralOffset; // Offset Central spectrometer momentum (%)
Double_t fTheta_lab; // Central spectrometer angle (deg)
Double_t fPhi_lab; // Central spectrometer angle (deg)
Double_t fMispointing_x; // Spectrometer Verticcal Mispointing
Double_t fMispointing_y; // Spectrometer Horizontal Mispointing
// For spectrometer central momentum use fPcentral in THaSpectrometer.h
// THaScintillator *sc_ref; // calculate time track hits this plane
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment