ROOT logo
Podd » SRC » THaSpectrometer

class THaSpectrometer: public THaApparatus, public THaTrackingModule, public THaVertexModule


 THaSpectrometer

 Abstract base class for a spectrometer.

 It implements a generic Reconstruct() method that should be
 useful for most situations. See specific description below.

 It also provides support for lists of different detector types
 (e.g. tracking/non-tracking/PID) for efficient processing.


Function Members (Methods)

 
    This is an abstract class, constructors will not be documented.
    Look at the header to check for available constructors.

public:
virtual~THaSpectrometer()
voidTObject::AbstractMethod(const char* method) const
virtual Int_tAddDetector(THaDetector* det)
virtual Int_tAddPidParticle(const char* shortname, const char* name, Double_t mass, Int_t charge = 0)
virtual voidTObject::AppendPad(Option_t* option = "")
virtual Int_tTHaApparatus::Begin(THaRunBase* r = 0)
virtual voidTObject::Browse(TBrowser* b)
virtual Int_tCalcPID()
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidClear(Option_t* opt = "")
virtual TObject*TNamed::Clone(const char* newname = "") const
virtual Int_tCoarseReconstruct()
virtual Int_tCoarseTrack()
virtual Int_tTNamed::Compare(const TObject* obj) const
virtual voidTNamed::Copy(TObject& named) const
virtual Int_tTHaApparatus::Decode(const THaEvData&)
virtual voidDefinePidParticles()
virtual Int_tDefineVariables(THaAnalysisObject::EMode mode = kDefine)
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 = "")MENU
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() constMENU
virtual TObject*TObject::DrawClone(Option_t* option = "") constMENU
virtual voidTObject::Dump() constMENU
virtual Int_tTHaApparatus::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
virtual Int_tFindVertices(TClonesArray& tracks)
static voidTHaAnalysisObject::GeoToSph(Double_t th_geo, Double_t ph_geo, Double_t& th_sph, Double_t& ph_sph)
const char*THaAnalysisObject::GetClassName() const
Double_tGetCollDist() const
const char*THaAnalysisObject::GetConfig() const
virtual const char*THaAnalysisObject::GetDBFileName() const
Int_tTHaAnalysisObject::GetDebug() const
virtual THaDetector*THaApparatus::GetDetector(const char* name)
const TList*THaApparatus::GetDetectors()
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
THaTrack*GetGoldenTrack() const
virtual const char*TObject::GetIconName() const
TDatimeTHaAnalysisObject::GetInitDate() const
virtual const char*TNamed::GetName() const
Int_tGetNpidDetectors() const
Int_tGetNpidParticles() const
Int_tGetNTracks() const
Int_tTHaApparatus::GetNumDets() const
static TString&THaAnalysisObject::GetObjArrayString(const TObjArray* params, Int_t pos)
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
Double_tGetPcentral() const
Double_tGetPhiGeo() const
Double_tGetPhiSph() const
const THaPidDetector*GetPidDetector(Int_t i) const
const THaParticleInfo*GetPidParticleInfo(Int_t i) const
const TVector3&GetPointingOffset() const
const char*THaAnalysisObject::GetPrefix() const
static const RVarDef*THaTrackingModule::GetRVarDef()
Double_tGetThetaGeo() const
Double_tGetThetaSph() const
virtual const char*TNamed::GetTitle() const
const TRotation&GetToLabRot() const
const TRotation&GetToTraRot() const
THaTrack*THaTrackingModule::GetTrack()
THaTrackInfo*THaTrackingModule::GetTrackInfo()
TClonesArray*GetTrackPID() const
TClonesArray*GetTracks() const
virtual UInt_tTObject::GetUniqueID() const
virtual const TVector3&GetVertex() const
virtual const TVector3&THaVertexModule::GetVertexError() const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTNamed::Hash() const
virtual Bool_tHasVertex() 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
virtual THaAnalysisObject::EStatusTHaApparatus::Init(const TDatime& run_time)
virtual Int_tTHaAnalysisObject::InitOutput(THaOutput*)
virtual voidTObject::Inspect() constMENU
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
Bool_tIsDone(UInt_t stage) 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
Bool_tIsPID() const
virtual Bool_tTNamed::IsSortable() const
static boolTHaAnalysisObject::IsTag(const char* buf)
Bool_tTObject::IsZombie() const
voidLabToTransport(const TVector3& vertex, const TVector3& pvect, Double_t* ray) const
virtual voidLabToTransport(const TVector3& vertex, const TVector3& pvect, TVector3& tvertex, Double_t* ray) const
static Int_tTHaAnalysisObject::LoadDB(FILE* file, const TDatime& date, const DBRequest* request, const char* prefix, Int_t search = 0, const char* here = "THaAnalysisObject::LoadDB")
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()
voidTObject::Obsolete(const char* method, const char* asOfVers, const char* removedFromVers) const
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()
virtual voidTHaApparatus::Print(Option_t* opt = "") const
static voidTHaAnalysisObject::PrintObjects(Option_t* opt = "")
virtual Int_tTObject::Read(const char* name)
static Int_tTHaAnalysisObject::ReadDBline(FILE* fp, char* buf, size_t bufsiz, string& line)
virtual Int_tReconstruct()
virtual voidTObject::RecursiveRemove(TObject* obj)
voidTObject::ResetBit(UInt_t f)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidTObject::SavePrimitive(ostream& 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)
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
voidSetCentralAngles(Double_t th, Double_t ph, Bool_t bend_down)
voidTHaAnalysisObject::SetConfig(const char* label)
virtual voidTHaAnalysisObject::SetDebug(Int_t level)
virtual voidTHaApparatus::SetDebugAll(Int_t level)
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
voidSetGoldenTrack(THaTrack* t)
virtual voidTHaAnalysisObject::SetName(const char* name)
virtual voidTHaAnalysisObject::SetNameTitle(const char* name, const char* title)
static voidTObject::SetObjectStat(Bool_t stat)
voidSetPID(Bool_t b = kTRUE)
virtual voidTNamed::SetTitle(const char* title = "")MENU
virtual voidTObject::SetUniqueID(UInt_t uid)
virtual voidShowMembers(TMemberInspector&)
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&)
voidStreamerNVirtual(TBuffer& ClassDef_StreamerNVirtual_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 Int_tTrack()
virtual Int_tTrackCalc()
virtual voidTrackToLab(THaTrack& track, TVector3& pvect) const
virtual voidTransportToLab(Double_t p, Double_t th, Double_t ph, TVector3& pvect) const
voidTHaTrackingModule::TrkIfoClear()
virtual voidTObject::UseCurrentStyle()
virtual voidTHaVertexModule::VertexClear()
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
protected:
virtual const char*THaAnalysisObject::ClassNameHere(const char*) const
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 voidTHaAnalysisObject::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)
static vector<std::string>THaAnalysisObject::GetDBFileList(const char* name, const TDatime& date, const char* here = "GetDBFileList()")
virtual const char*THaAnalysisObject::Here(const char*) const
Int_tTHaAnalysisObject::LoadDB(FILE* f, const TDatime& date, const DBRequest* req, Int_t search = 0)
virtual voidTHaAnalysisObject::MakePrefix()
voidTHaAnalysisObject::MakePrefix(const char* basename)
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_tTHaAnalysisObject::ReadDatabase(const TDatime& date)
virtual Int_tReadRunDatabase(const TDatime& date)
virtual Int_tTHaAnalysisObject::RemoveVariables()
private:
voidListInit()

Data Members

public:
enum EStagesDone { kCoarseTrack
kCoarseRecon
kTracking
kReconstruct
};
enum THaAnalysisObject::EStatus { kOK
kNotinit
kInitError
kFileError
};
enum THaAnalysisObject::EType { kVarDef
kRVarDef
};
enum THaAnalysisObject::EMode { kDefine
kDelete
};
enum THaAnalysisObject::EProperties { kNeedsRunDB
kConfigOverride
};
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:
Double_tfCollDistDistance from collimator to target center (m)
TStringTHaAnalysisObject::fConfigConfiguration to use from database
Double_tfCosPhGeoin geographical coordinates
Double_tfCosPhSphspherical coordinates
Double_tfCosThGeoSine and cosine of central angles
Double_tfCosThSphSine and cosine of central angles in
Int_tTHaAnalysisObject::fDebugDebug level
TList*THaApparatus::fDetectorsList of all detectors for this apparatus
THaTrack*fGoldenTrackGolden track within fTracks
TDatimeTHaAnalysisObject::fInitDateDate passed to Init
Bool_tTHaAnalysisObject::fIsInitFlag indicating that ReadDatabase done
Bool_tTHaAnalysisObject::fIsSetupFlag indicating that DefineVariables done.
TStringTNamed::fNameobject identifier
TList*fNonTrackingDetectorsNon-tracking detectors
Bool_tTHaAnalysisObject::fOKOutFlag indicating object-output prepared
Bool_tfPIDPID enabled
Double_tfPcentralCentral momentum (GeV)
Double_tfPhiGeoOut-of-plane geographic central angle (rad)
Double_tfPhiSphCentral angles in spherical coords. (rad)
TObjArray*fPidDetectorsPID detectors
TObjArray*fPidParticlesParticles for which we want PID
TVector3fPointingOffsetOptical point in lab coordinate system
char*THaAnalysisObject::fPrefixName prefix for global variables
UInt_tTHaAnalysisObject::fPropertiesProperties of this object (see EProperties)
Double_tfSinPhGeo
Double_tfSinPhSph
Double_tfSinThGeo
Double_tfSinThSph
UInt_tfStagesDoneBitfield of completed analysis stages
THaAnalysisObject::EStatusTHaAnalysisObject::fStatusInitialization status flag
Double_tfThetaGeoIn-plane geographic central angle (rad)
Double_tfThetaSph
TStringTNamed::fTitleobject title
TRotationfToLabRotRotation matrix from TRANSPORT to lab
TRotationfToTraRotRotation matrix from lab to TRANSPORT
TClonesArray*fTrackPIDPID info for the tracks
TList*fTrackingDetectorsTracking detectors
TClonesArray*fTracksTracks
THaTrack*THaTrackingModule::fTrk! Pointer to associated track
THaTrackInfoTHaTrackingModule::fTrkIfoTrack information
TVector3THaVertexModule::fVertexVertex position (m)
TVector3THaVertexModule::fVertexErrorUncertainties in fVertex coordinates
Bool_tTHaVertexModule::fVertexOK
static const Int_tkInitTrackMultiplicity
private:
Bool_tfListInitDetector lists initialized

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

~THaSpectrometer()
 Destructor. Delete the lists of specialized detectors.
 FIXME: delete tracks, pid, vertices too?
Int_t AddDetector(THaDetector* det)
 Add a detector to the internal lists of spectrometer detectors.
 This method is useful for quick testing of a new detector class that
 one doesn't want to include permanently in an Apparatus yet.
 Duplicate detector names are not allowed.

 NOTE: The detector object must be allocated by the caller, but will be
 deleted by the spectrometer. Do not delete detectors you've added
 to an apparatus/spectrometer. Recommended: AddDetector( new MyDetector )
Int_t AddPidParticle(const char* shortname, const char* name, Double_t mass, Int_t charge = 0)
 Add a particle type to the list of particles for which we want PID.
 The "charge" argument is optional.
Int_t CalcPID()
 Combine the PID information from all detectors into an overall PID
 for each track.  The actual work is done in the THaPIDinfo class.
 This is just a loop over all tracks.
 Called by Reconstruct().
void Clear(Option_t* opt = "")
 Clear the spectrometer data for next event.
void DefinePidParticles()
 Define the default set of PID particles:
  pion, kaon, proton
Int_t DefineVariables(THaAnalysisObject::EMode mode = kDefine)
 Define/delete standard variables for a spectrometer (tracks etc.)
 Can be overridden or extended by derived (actual) apparatuses
const TVector3& GetVertex() const
 Return vertex vector of the Golden Track.
 Overrides standard method of THaVertexModule.
Bool_t HasVertex() const
void ListInit()
 Initialize lists of specialized detectors.
 Private function called by Reconstruct().
Int_t CoarseTrack()
 Coarse Tracking: First step of spectrometer analysis
Int_t CoarseReconstruct()
 2nd step: Coarse processing.  Pass the coarse tracks to the remaining
 detectors for any processing that can be done at this stage.
 This may include clustering and preliminary PID.
 PID information is tacked onto the tracks as a THaPIDinfo object.
Int_t Track()
 Fine tracking.  Compute the tracks with high precision.
 If coarse tracking was done, this step should simply "refine" the
 tracks found earlier, not add new tracks to fTrack.
Int_t Reconstruct()
 This method implements a fairly generic algorithm for spectrometer
 reconstruction which should be useful for most situations.
 Additional, equipment-specific processing can be done in
 a derived class that calls this method first.

 The algorithm is as follows:

 For all tracking detectors:
   CoarseTrack()
 For all non-tracking detectors:
   CoarseProcess()
 For all tracking detectors:
   FineTrack()
 Reconstruct tracks to target
 For all non-tracking detectors:
   FineProcess()
 Compute additional attributes of tracks (e.g. momentum, beta)
 Find "Golden Track"
 Combine all PID detectors to get overall PID for each track

void TrackToLab(THaTrack& track, TVector3& pvect) const
 Convert TRANSPORT coordinates of 'track' to momentum vector 'pvect'
 in the lab coordinate system (z = beam, y = up).
 Uses the spectrometer angles from the database (loaded during Init())
 for the transformation.

 The track origin (vertex) is not calculated here because
 doing so requires knowledge of beam positions and and angles.
 Vertex calculations are done in a separate physics module.
void TransportToLab(Double_t p, Double_t th, Double_t ph, TVector3& pvect) const
 Convert TRANSPORT vector to lab vector.
 Inputs:
  p:  TRANSPORT momentum (absolute)
  th: Tangent of TRANSPORT theta
  ph: Tangent of TRANSPORT phi
 Output:
  pvect: Vector in lab frame (z = beam, y = up) in same units as p.

 Note: Simple vector transformation can be done trivially by multiplying
 with the appropriate rotation matrix, e.g.:
  TVector3 lab_vector = spect->GetToLabRot() * transport_vector;
void LabToTransport(const TVector3& vertex, const TVector3& pvect, TVector3& tvertex, Double_t* ray) const
 Convert lab coordinates to TRANSPORT coordinates in the spectrometer
 coordinate system.
 Inputs:
  vertex:  Reaction point in lab system
  pvect:   Momentum vector in lab
 Outputs:
  tvertex: The vertex point in the TRANSPORT system, without any
           coordinate projections applied
  ray:     The TRANSPORT ray according to TRANSPORT conventions.
           This is an array of size 6 with elements x, tan(theta),
           y, tan(y), z, and delta.
           z is set to 0, and accordingly x and y are the TRANSPORT
           coordinates in the z=0 plane. delta is computed with respect
           to the present spectrometer's central momentum.
           Units are the same as of the input vectors.
void SetCentralAngles(Double_t th, Double_t ph, Bool_t bend_down)
 Given geographical angles theta and phi (in degrees), compute the
 spectrometer's central angles in spherical coordinates and save trig.
 values of angles for later use.
 Note: negative theta corresponds to beam RIGHT.
 phi should be close to zero unless this is a true out-of-plane spectrometer.
 If 'bend_down' is true, the spectrometer bends downwards.
Int_t ReadRunDatabase(const TDatime& date)
 Query the run database for parameters specific to this spectrometer
 (central angles, momentum, offsets, drift, etc.)
Int_t GetNpidParticles() const
inlines
Int_t GetNpidDetectors() const
const THaParticleInfo* GetPidParticleInfo( Int_t i )
const THaPidDetector* GetPidDetector(Int_t i) const
Bool_t IsDone(UInt_t stage) const
void LabToTransport(const TVector3& vertex, const TVector3& pvect, Double_t* ray) const
Int_t FindVertices(TClonesArray& tracks)
Int_t TrackCalc()
THaTrack* GetGoldenTrack() const
{ return fGoldenTrack; }
Int_t GetNTracks() const
{ return fTracks->GetLast()+1; }
TClonesArray* GetTracks() const
{ return fTracks; }
TClonesArray* GetTrackPID() const
{ return fTrackPID; }
Bool_t IsPID() const
{ return fPID; }
void SetGoldenTrack(THaTrack* t)
{ fGoldenTrack = t; }
void SetPID(Bool_t b = kTRUE)
{ fPID = b; }
const TRotation& GetToLabRot() const
 The following is specific to small-acceptance pointing spectrometers
 using spectrometer-specific coordinates such as TRANSPORT
{ return fToLabRot; }
const TRotation& GetToTraRot() const
{ return fToTraRot; }
const TVector3& GetPointingOffset() const
{ return fPointingOffset; }
Double_t GetThetaGeo() const
{ return fThetaGeo; }
Double_t GetPhiGeo() const
{ return fPhiGeo; }
Double_t GetThetaSph() const
{ return fThetaSph; }
Double_t GetPhiSph() const
{ return fPhiSph; }
Double_t GetPcentral() const
{ return fPcentral; }
Double_t GetCollDist() const
{ return fCollDist; }