class THaOpticsAnalytical: public THaOptics


    THaOpticsAnalytical



 Author: Jin Huang <mailto:jinhuang@jlab.org>    Feb 2008
    Modify History:



What's this?

THaOpticsAnalytical is a derived class of THaOptics, which uses a analytical approach calculating track back to target for BigBite spectrometer. One can mount it to a THaOptics-supporting spectrometer by following line and fill up database according to last section.

Bool_t mr=MountOptics(new THaOpticsAnalytical("opticstest","BigBite Optics",this));
assert(mr);

Feature of the model

Since the solid angle of bigbite is relatively large, it will not be possible to use a single matrix to describe backward optics calculation for this spectrometer. This is because for backward matrix, it will be deeply involved with parameters such as distance between magnetic and target. This dependancy is not simple and a matrix for one experiment will not be able to be used on the other. Besides, the angle of spectrometer will also affect the matrix element. The overall error of matrix methord is equivalent to the spacial resolusion of detector is worth by the following amount :

$$\Delta x_{error}=\tan( \theta_{Target} )(\Delta L+\cos(\Theta_0)z_{react})$$

To solve these problem, a general, fitting free model is developped.

Assumption

This class use a analytical model calculating the whole track back to target given infomation of the track on the detector side. It based on the following assumption:

  • The edge of magnetic field is sharp
  • In the magnetic region, field is homogeneous and along y axis
  • the front end of the magnetic field is along a surface perpendicular to central optics line
  • The back end of magnetic field is along a surface, which could be described by a rotation of the front surface for a certain angle (described by fMagTheta) along y axis. The hight of the rotating axis is described by fMagS

Advantages over Matrix expansion

  • No fitting needed. All input parameter is directly related to experiment setup.
  • do not require condition, such as the particle is close to central optical axis.

thus, this optics class will be suitable for online replay, in which case, usually optics data is not available.

Beyond this model

accuracy of this model will not meet the requirement of further offline analysis. Therefore, the following steps is suggested for improvement of precision:

  • Use otptical run data to build a correctiong table. And make an additional corrections base one this table in data analysis.
  • Use otptical run data to fit a series of matrix element, and use THaOpticsHRS reading in the matrix and performing the optics calculation.

Algorithm Description

calculate bending radius

Base on the assumptions, a particle going through the whole system could be devided into 3 stages: drift in the target region, helix movement in magnetic feild and free drift in detector region. Following is a figure of a typical track, projected to midplane:

typical track

This also shows the temporary coordinate system used in internal function THaOpticsAnalytical::CalxA and THaOpticsAnalytical::CalR. These two fucntion use infomation of track parameter on the detector side and aprox. beam position to calculate position of point A(enter point), B(exit point) and bending radius R. For the y position, which is perpendicular to midplane, this model first assume a simple reflectiong model (get FirstVertex) and then correct it with calculated particle path (and get SecendVertex). Aproximate beam position is also corrected according to y position.

scaling bending radius to momentum

P=q*B*R=K*I*R, in which,

  •  P is calculated momentum
  •  q is charge of the incoming particle
  •  B is the magnetic field
  •  R is bending radius
  •  K is an constant related to the magnetic
  •  I is the current in coil

 there are two method of scaling bending radius to momentum:

  1.  given current I and constant K
  2.  given radius of central momentum

 this class will try both of above method.  Priority of method 1 is higher.

 a K<=0 will a push this class to use method 2

Database

This class will acquire following information from database (in additional to general THaOptics). All length units are meter and angle are degrees.

From db_run.dat

  • <Spectrometer Name>.theta:Angle of Spectrometer.
  • <Spectrometer Name>.pcentral:Central momentum. The final momentum will be scaled respect to this value
  • <Spectrometer Name>.colldist:distance of sieve plane away from target center. As expressed as "L" in last section.

From db_<Spectrometer Name>.<Optics Module Name>.dat

  • MagneticFieldFrontShift: distance between sieve plane and front boundary of magnetic field. Called "fMagDL" in code and picture above.
  • MagneticFieldTopCrossing:Called "fMagS" in code and picture above.
  • MagneticFieldRearSlopeAngle:Called "fMagTheta" in code and picture above.
  • CurveRadiusOfCentralMomentum:For the central momentum, it will curve this given radius in the magnetic field. If it's an negative value, the code will automatically generate one according to definition.
  • K:onstant K here, as discussed above. units: GeV/A/m/c

Function Members (Methods)

public:
THaOpticsAnalytical(const char* name, const char* desc, THaSpectrometer* pspec, TString strBeamDetectorName = "")
virtual~THaOpticsAnalytical()
voidTObject::AbstractMethod(const char* method) const
virtual voidTObject::AppendPad(Option_t* option = "")
virtual Int_tTHaOptics::ApplyCorrection(Double_t& Th, Double_t& Ph, Double_t& P, Double_t& PathLen)
virtual Int_tApplyOptics(Double_t trackX, Double_t trackY, Double_t trackTheta, Double_t trackPhi, TVector3 beamPos, TVector3 beamDir, TVector3& P, TVector3& Vertex, Double_t& TargetX, Double_t& TargetY, Double_t& TargetTheta, Double_t& TargetPhi, Double_t& PathLen)
virtual Int_tTHaAnalysisObject::Begin(THaRunBase* r = 0)
virtual voidTObject::Browse(TBrowser* b)
Double_tCalR(Double_t xA, Double_t xB, Double_t zB, Double_t TanF, Double_t xx, Double_t zz)
Double_tCalxA(Double_t xB, Double_t zB, Double_t TanF, Double_t xx, Double_t zz)
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidTHaOptics::Clear(Option_t* opt = "")
virtual TObject*TNamed::Clone(const char* newname = "") const
virtual Int_tTNamed::Compare(const TObject* obj) const
static TComplexComplex(Double_t re, Double_t im)
virtual voidTNamed::Copy(TObject& named) const
TVector2THaOptics::CrossingLineLine2D(TVector2 o1, TVector2 d1, TVector2 o2, TVector2 d2)
TVector3THaOptics::CrossingSurfLine3D(TVector3 OSurf, TVector3 NSurf, TVector3 OLine, TVector3 DLine)
static TComplexCSqrt(Double_t x)
static TComplexCSqrt(TComplex x)
static Int_tTHaAnalysisObject::DefineVarsFromList(const void* list, THaAnalysisObject::EType type, THaAnalysisObject::EMode mode, const char* var_prefix, const TObject* obj, const char* prefix, const char* here)
virtual voidTObject::Delete(Option_t* option = "")
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() const
virtual TObject*TObject::DrawClone(Option_t* option = "") const
virtual voidTObject::Dump() const
virtual Int_tTHaAnalysisObject::End(THaRunBase* r = 0)
virtual voidTObject::Error(const char* method, const char* msgfmt) const
virtual voidTObject::Execute(const char* method, const char* params, Int_t* error = 0)
virtual voidTObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0)
virtual voidTObject::ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
virtual voidTNamed::FillBuffer(char*& buffer)
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
voidFitter(TString sInputFileName)
static voidTHaAnalysisObject::GeoToSph(Double_t th_geo, Double_t ph_geo, Double_t& th_sph, Double_t& ph_sph)
Double_tTHaOptics::GetCollDist() const
const char*THaAnalysisObject::GetConfig() const
Double_tTHaOptics::GetCurrent() const
Double_tGetCurveRadiusOfCentralMomentum()
virtual const char*THaAnalysisObject::GetDBFileName() const
Int_tTHaAnalysisObject::GetDebug() const
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
virtual const char*TObject::GetIconName() const
TDatimeTHaAnalysisObject::GetInitDate() const
Double_tGetMagneticFieldFrontShift()
Double_tGetMagneticFieldRearSlopeAngle()
Double_tGetMagneticFieldTopCrossing()
virtual const char*TNamed::GetName() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
Double_tTHaOptics::GetPcentral() const
const char*THaAnalysisObject::GetPrefix() const
virtual const char*TNamed::GetTitle() const
virtual UInt_tTObject::GetUniqueID() const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTNamed::Hash() const
virtual voidTObject::Info(const char* method, const char* msgfmt) const
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
THaAnalysisObject::EStatusTHaAnalysisObject::Init()
virtual THaAnalysisObject::EStatusTHaAnalysisObject::Init(const TDatime& run_time)
virtual Int_tTHaAnalysisObject::InitOutput(THaOutput*)
virtual voidTObject::Inspect() const
static Bool_tTHaAnalysisObject::IntersectPlaneWithRay(const TVector3& xax, const TVector3& yax, const TVector3& org, const TVector3& ray_start, const TVector3& ray_vect, Double_t& length, TVector3& intersect)
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
Bool_tTHaAnalysisObject::IsInit() const
Bool_tTHaAnalysisObject::IsOK() const
Bool_tTHaAnalysisObject::IsOKOut()
Bool_tTObject::IsOnHeap() const
virtual Bool_tTNamed::IsSortable() const
Bool_tTObject::IsZombie() const
static Int_tTHaAnalysisObject::LoadDB(FILE* file, const TDatime& date, const DBRequest* request, const char* prefix = "", Int_t search = 0)
static Int_tTHaAnalysisObject::LoadDB(FILE* file, const TDatime& date, const TagDef* tags, const char* prefix = "", Int_t search = 0)
static Int_tTHaAnalysisObject::LoadDBvalue(FILE* file, const TDatime& date, const char* tag, Double_t& value)
static Int_tTHaAnalysisObject::LoadDBvalue(FILE* file, const TDatime& date, const char* tag, Int_t& value)
static Int_tTHaAnalysisObject::LoadDBvalue(FILE* file, const TDatime& date, const char* tag, string& text)
static Int_tTHaAnalysisObject::LoadDBvalue(FILE* file, const TDatime& date, const char* tag, TString& text)
virtual voidTNamed::ls(Option_t* option = "") const
voidTObject::MayNotUse(const char* method) const
virtual Bool_tTObject::Notify()
static FILE*THaAnalysisObject::OpenFile(const char* name, const TDatime& date, const char* here = "OpenFile()", const char* filemode = "r", const int debug_flag = 1)
static voidTObject::operator delete(void* ptr)
static voidTObject::operator delete(void* ptr, void* vp)
static voidTObject::operator delete[](void* ptr)
static voidTObject::operator delete[](void* ptr, void* vp)
void*TObject::operator new(size_t sz)
void*TObject::operator new(size_t sz, void* vp)
void*TObject::operator new[](size_t sz)
void*TObject::operator new[](size_t sz, void* vp)
TNamed&TNamed::operator=(const TNamed& rhs)
virtual voidTObject::Paint(Option_t* option = "")
virtual voidTObject::Pop()
static Double_tPower(Double_t x, Double_t y)
static TComplexPower(TComplex x, Double_t y)
virtual voidTNamed::Print(Option_t* option = "") const
virtual Int_tTObject::Read(const char* name)
virtual voidTObject::RecursiveRemove(TObject* obj)
voidTObject::ResetBit(UInt_t f)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") const
virtual voidTObject::SavePrimitive(basic_ostream<char,char_traits<char> >& out, Option_t* option = "")
static Int_tTHaAnalysisObject::SeekDBconfig(FILE* file, const char* tag, const char* label = "config", Bool_t end_on_tag = false)
static Int_tTHaAnalysisObject::SeekDBdate(FILE* file, const TDatime& date, Bool_t end_on_tag = false)
Bool_tTHaOptics::SetBeamName(const char*)
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
voidTHaAnalysisObject::SetConfig(const char* label)
Double_tSetCurveRadiusOfCentralMomentum(Double_t v)
virtual voidTHaAnalysisObject::SetDebug(Int_t level)
virtual voidTObject::SetDrawOption(Option_t* option = "")
static voidTObject::SetDtorOnly(void* obj)
Double_tSetMagneticFieldFrontShift(Double_t v)
Double_tSetMagneticFieldRearSlopeAngle(Double_t v)
Double_tSetMagneticFieldTopCrossing(Double_t v)
virtual voidTHaAnalysisObject::SetName(const char* name)
virtual voidTHaAnalysisObject::SetNameTitle(const char* name, const char* title)
static voidTObject::SetObjectStat(Bool_t stat)
Double_tSetRCentral()
virtual voidTNamed::SetTitle(const char* title = "")
virtual voidTObject::SetUniqueID(UInt_t uid)
virtual voidShowMembers(TMemberInspector& insp, char* parent)
virtual Int_tTNamed::Sizeof() const
static voidTHaAnalysisObject::SphToGeo(Double_t th_sph, Double_t ph_sph, Double_t& th_geo, Double_t& ph_geo)
THaAnalysisObject::EStatusTHaAnalysisObject::Status() const
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
virtual voidTObject::UseCurrentStyle()
static vector<std::string>THaAnalysisObject::vsplit(const string& s)
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0)
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const
virtual Int_tTHaOptics::ZeroOrderCorrection(Double_t& Th, Double_t& Ph, Double_t& P, Double_t& PathLen)
protected:
virtual Int_tTHaAnalysisObject::DefineVariables(THaAnalysisObject::EMode mode = kDefine)
Int_tTHaAnalysisObject::DefineVarsFromList(const VarDef* list, THaAnalysisObject::EMode mode = kDefine, const char* var_prefix = "") const
Int_tTHaAnalysisObject::DefineVarsFromList(const RVarDef* list, THaAnalysisObject::EMode mode = kDefine, const char* var_prefix = "") const
Int_tTHaAnalysisObject::DefineVarsFromList(const void* list, THaAnalysisObject::EType type, THaAnalysisObject::EMode mode, const char* var_prefix = "") const
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
THaAnalysisObject*THaAnalysisObject::FindModule(const char* name, const char* classname, bool do_error = true)
virtual THaAnalysisObject*THaOptics::FindModuleNoCheck(const char* name, const char* classname)
static vector<std::string>THaAnalysisObject::GetDBFileList(const char* name, const TDatime& date, const char* here = "GetDBFileList()")
virtual const char*THaAnalysisObject::Here(const char*) const
virtual voidTHaOptics::MakePrefix()
voidTObject::MakeZombie()
virtual FILE*THaAnalysisObject::OpenFile(const TDatime& date)
virtual FILE*THaAnalysisObject::OpenRunDBFile(const TDatime& date)
static char*THaAnalysisObject::ReadComment(FILE* fp, char* buf, const int len)
virtual Int_tReadDatabase(const TDatime& date)
virtual Int_tTHaOptics::ReadRunDatabase(const TDatime& date)
virtual Int_tTHaAnalysisObject::RemoveVariables()

Data Members

public:
enum THaAnalysisObject::EStatus { kOK
kNotinit
kInitError
kFileError
};
enum THaAnalysisObject::EType { kVarDef
kRVarDef
};
enum THaAnalysisObject::EMode { kDefine
kDelete
};
enum THaAnalysisObject::EProperties { kNeedsRunDB
};
enum TObject::EStatusBits { kCanDelete
kMustCleanup
kObjInCanvas
kIsReferenced
kHasUUID
kCannotPick
kNoContextMenu
kInvalidObject
};
enum TObject::[unnamed] { kIsOnHeap
kNotDeleted
kZombie
kBitMask
kSingleKey
kOverwrite
kWriteDelete
};
public:
static const Double_tTHaAnalysisObject::kBig= 1.e38; // default junk value
protected:
TRefTHaOptics::fBeam
TStringTHaAnalysisObject::fConfigConfiguration to use from database
Double_tTHaOptics::fCurrentCentral momentum (GeV)
Int_tTHaAnalysisObject::fDebugDebug level
TStringTHaOptics::fDefBeamName
TRotationTHaOptics::fHCS2TCS
TDatimeTHaAnalysisObject::fInitDateDate passed to Init
Bool_tTHaAnalysisObject::fIsInitFlag indicating that ReadDatabase done
Bool_tTHaAnalysisObject::fIsSetupFlag indicating that DefineVariables done.
Double_tfMagDLshift of front surface of magnetic field from sieve
Double_tfMagSthe distance between crossing line of two surfaces of magnetic field and central point of front surface
Double_tfMagThetain rad, the angle between two surfaces of magnetic field
TStringTNamed::fNameobject identifier
Bool_tTHaAnalysisObject::fOKOutFlag indicating object-output prepared
Double_tTHaOptics::fPShift
Double_tTHaOptics::fPathLenShift
Double_tTHaOptics::fPhShift
char*THaAnalysisObject::fPrefixName prefix for global variables
UInt_tTHaAnalysisObject::fPropertiesProperties of this object (see EProperties)
Double_tfRCentralthe curve radius in magnetic field for a particle with central momentum
Double_tfRadius2Momentumconversion constant of bending radius to momentum, units: GeV/m/c
TRefTHaOptics::fSpecpointer to BigBite
THaAnalysisObject::EStatusTHaAnalysisObject::fStatusInitialization status flag
TRotationTHaOptics::fTCS2HCS
TRotationTHaOptics::fTCS2TRCS
TVector3THaOptics::fTCSOffSetInHCS
TRotationTHaOptics::fTRCS2TCS
TVector3THaOptics::fTRCSOffSetInTCS
Double_tTHaOptics::fThShift
TStringTNamed::fTitleobject title

Class Charts

Inheritance Chart:
TObject
TNamed
THaAnalysisObject
THaOptics
THaOpticsAnalytical

Function documentation

THaOpticsAnalytical(const char* name, const char* desc, THaSpectrometer* pspec, TString strBeamDetectorName = "")
 constructor function of THaOpticsAnalytical
~THaOpticsAnalytical()
{}
Int_t ReadDatabase(const TDatime& date)
Double_t SetRCentral()
calcuate the radius of curve of a central ray
 central ray is the ray go through z axis of TRCS and target coord. sys. origin point
How it works. Set a dummy run of ApplyOptics for central ray at an
arbitary R_Central. Then real R_Central will be proportional to the
reconstructed p magnitude

if fRCentral is read in from database and valid
then no need for calculation again. It will keep unchanged.
void Fitter(TString sInputFileName)
fit the for the parameters in the model
Int_t ApplyOptics(Double_t trackX, Double_t trackY, Double_t trackTheta, Double_t trackPhi, TVector3 beamPos, TVector3 beamDir, TVector3& P, TVector3& Vertex, Double_t& TargetX, Double_t& TargetY, Double_t& TargetTheta, Double_t& TargetPhi, Double_t& PathLen)
apply optics : do the job
Double_t CalR(Double_t xA, Double_t xB, Double_t zB, Double_t TanF, Double_t xx, Double_t zz)
TComplex CSqrt(Double_t x)
{return TComplex::Sqrt(TComplex(x,0));}
TComplex CSqrt(TComplex x)
{ return TComplex::Sqrt(x); }
Double_t Power(Double_t x, Double_t y)
{ return TMath::Power(x, y); }
TComplex Power(TComplex x, Double_t y)
{ return TComplex::Power(x, y); }
Double_t GetMagneticFieldFrontShift()
{return fMagDL;}
Double_t GetMagneticFieldRearSlopeAngle()
{return fMagTheta;}
Double_t GetMagneticFieldTopCrossing()
{return fMagS;}
Double_t GetCurveRadiusOfCentralMomentum()
{return fRCentral;}
Double_t SetMagneticFieldFrontShift(Double_t v)
{return fMagDL=v;}
Double_t SetMagneticFieldRearSlopeAngle(Double_t v)
{return fMagTheta=v;}
Double_t SetMagneticFieldTopCrossing(Double_t v)
{return fMagS=v;}
Double_t SetCurveRadiusOfCentralMomentum(Double_t v)
{return fRCentral=v;}

Author: Jin Huang Feb 2008
Last update: Tue Jul 7 19:26:17 2009

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.