25 const char* spectro,
const char*
vertex ) :
62 const RVarDef var2[] = {
63 {
"delta_p",
"Size of momentum correction",
"fDeltaP" },
64 {
"delta_dp",
"Size of delta correction (%)",
"fDeltaDp" },
65 {
"delta_xptar",
"Size of xptar correction (rad)",
"fDeltaTh" },
66 {
"xsieve",
"Golden track vertical position at sieve location (cm)",
"fxsieve" },
67 {
"ysieve",
"Golden track horizontal position at sieve location (cm) (cm)",
"fysieve" },
79 if( !
IsOK() )
return -1;
82 if( !trkifo->
IsOK() )
return 2;
84 if( !spectro )
return 3;
100 if( ntracks == 0 )
return -2;
118 for(
Int_t i = 0; i<ntracks; i++ ) {
121 delta_before_xtar_corr=theTrack->
GetDp();
122 p_before_xtar_corr=theTrack->
GetP();
123 xptar_before_xtar_corr=theTrack->
GetTTheta();
125 Double_t xptar_save=0.,xptar_diff=10000.;
130 while ( xptar_diff > 2 && niter < 5) {
134 xtar_new = x_tg - xptar*ztarg*
cos(theta);
136 xptar_diff =
abs(xptar-xptar_save)*1000;
140 theTrack->
SetTarget(xtar_new, ytar*100.0, xptar, yptar);
141 theTrack->
SetDp(delta*100.0);
146 if (strcmp(spectro->
GetName(),
"H")==0) {
150 if (strcmp(spectro->
GetName(),
"P")==0) {
153 fysieve=ytar*100+yptar*253.-(0.019+40.*.01*0.052)*delta_per+(0.00019+40*.01*.00052)*delta_per*delta_per;
163 trkifo->
Set( p_after_xtar_corr, delta*100, xtar_new,100*ytar, xptar, yptar, pvect_final );
164 fTrkIfo.
Set( p_after_xtar_corr, delta*100, xtar_new,100*ytar, xptar, yptar, pvect_final );
173 cout <<
"In THcExtTarCor::ReadDatabase()" << endl;
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char mode
ClassImp(VDC::AnalyticTTDConv) using namespace std
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="")
THaVertexModule * fVertexModule
THaTrackingModule * fTrackModule
virtual void Clear(Option_t *opt="")
Double_t GetPcentral() const
THaTrack * GetGoldenTrack() const
TClonesArray * GetTracks() const
const TVector3 & GetPointingOffset() const
virtual void TransportToLab(Double_t p, Double_t th, Double_t ph, TVector3 &pvect) const
Double_t GetThetaSph() const
void LabToTransport(const TVector3 &vertex, const TVector3 &pvect, Double_t *ray) const
THaSpectrometer * GetSpectrometer() const
const TVector3 & GetPvect() const
void Set(Double_t p, Double_t dp, Double_t x, Double_t y, Double_t th, Double_t ph, const TVector3 &pvect)
void SetPvect(const TVector3 &pvect)
void SetMomentum(Double_t p)
void SetTarget(Double_t x, Double_t y, Double_t theta, Double_t phi)
Double_t GetTTheta() const
static const RVarDef * GetRVarDef()
THaTrackInfo * GetTrackInfo()
virtual const TVector3 & GetVertex() const
Extended target corrections physics module.
virtual Int_t Process(const THaEvData &)
virtual Int_t DefineVariables(EMode mode=kDefine)
THcExtTarCor(const char *name, const char *description, const char *spectro="", const char *vertex="")
virtual Int_t ReadDatabase(const TDatime &date)
virtual void Clear(Option_t *opt="")
A standard Hall C spectrometer apparatus.
virtual void CalculateTargetQuantities(THaTrack *track, Double_t &gbeam_y, Double_t &xptar, Double_t &ytar, Double_t &yptar, Double_t &delta)
Transport focal plane track to target.
const char * GetName() const override
RVec< PromoteType< T > > abs(const RVec< T > &v)
RVec< PromoteType< T > > cos(const RVec< T > &v)