ROOT logo
AliRoot » TRD » AliTRDtrackerV1

class AliTRDtrackerV1: public AliTracker


Track finder

Authors:
Alex Bercuci <A.Bercuci@gsi.de>
Markus Fasel <M.Fasel@gsi.de>


Function Members (Methods)

public:
AliTRDtrackerV1(const AliTRDReconstructor* rec = NULL)
virtual~AliTRDtrackerV1()
voidTObject::AbstractMethod(const char* method) const
virtual voidTObject::AppendPad(Option_t* option = "")
virtual voidTObject::Browse(TBrowser* b)
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidTObject::Clear(Option_t* = "")
virtual TObject*TObject::Clone(const char* newname = "") const
virtual Int_tClusters2Tracks(AliESDEvent* esd)
virtual Int_tAliTracker::Clusters2TracksHLT(AliESDEvent* event, const AliESDEvent*)
virtual Int_tTObject::Compare(const TObject* obj) const
virtual voidAliTracker::CookLabel(AliKalmanTrack* t, Float_t wrong) const
virtual voidTObject::Copy(TObject& object) const
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 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 voidAliTracker::FillClusterArray(TObjArray* array) const
static voidAliTracker::FillResiduals(const AliExternalTrackParam* t, const AliCluster* c, Bool_t updated = kTRUE)
static voidAliTracker::FillResiduals(const AliExternalTrackParam* t, Double_t* p, Double_t* cov, UShort_t id, Bool_t updated = kTRUE)
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
static Double_tFitKalman(AliTRDtrackV1* trk, AliTRDseedV1 *const tracklets = NULL, Bool_t up = 0, Int_t np = 0, AliTrackPoint* points = NULL)
static Double_tFitLine(const AliTRDtrackV1* trk, AliTRDseedV1* tracklets = NULL, Bool_t err = 0, Int_t np = 0, AliTrackPoint* points = NULL)
static voidFitRieman(AliTRDcluster** clusters, Double_t* chi2)
static Float_tFitRieman(AliTRDseedV1* tracklets, Double_t* chi2, Int_t *const planes = NULL)
static Double_tFitRiemanTilt(const AliTRDtrackV1* trk, AliTRDseedV1* tracklets = NULL, Bool_t err = 0, Int_t np = 0, AliTrackPoint* points = NULL)
static Float_tFitTiltedRieman(AliTRDseedV1* tracklets, Bool_t sigError)
static Float_tFitTiltedRiemanConstraint(AliTRDseedV1* tracklets, Double_t zVertex)
static Double_tFitTiltedRiemanV1(AliTRDseedV1* tracklets)
static Double_tAliTrackerBase::FitTrack(AliExternalTrackParam* trackParam, AliTrackPointArray* pointArray, Double_t mass, Double_t maxStep)
Int_tFollowBackProlongation(AliTRDtrackV1& t)
Int_tFollowProlongation(AliTRDtrackV1& t)
static AliTRDtrackerV1::ETRDtrackerV1BetheBlochGetBetheBloch()
static voidAliTrackerBase::GetBxByBz(const Double_t* r, Double_t* b)
static Double_tAliTrackerBase::GetBz()
static Double_tAliTrackerBase::GetBz(const Double_t* r)
virtual AliCluster*GetCluster(Int_t index) const
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
const AliEventInfo*AliTracker::GetEventInfo() const
static voidGetExtrapolationConfig(Int_t iconfig, Int_t* planes)
virtual const char*TObject::GetIconName() const
TClonesArray*GetListOfClusters() const
TClonesArray*GetListOfTracklets() const
TClonesArray*GetListOfTracks() const
virtual const char*TObject::GetName() const
static Int_tGetNTimeBins()
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
virtual AliPlaneEff*AliTracker::GetPlaneEff()
static TObjArray**AliTracker::GetResidualsArray()
static AliRieman*GetRiemanFitter()
static voidGetSeedingConfig(Int_t iconfig, Int_t* planes)
Double_tAliTrackerBase::GetSigmaX() const
Double_tAliTrackerBase::GetSigmaY() const
Double_tAliTrackerBase::GetSigmaZ() const
static TLinearFitter*GetTiltedRiemanFitter()
static TLinearFitter*GetTiltedRiemanFitterConstraint()
virtual const char*TObject::GetTitle() const
AliKalmanTrack*GetTrack(Int_t index) const
AliTRDtrackingSector*GetTrackingSector(Int_t sec)
AliTRDseedV1*GetTracklet(Int_t index) const
virtual Bool_tAliTracker::GetTrackPointTrackingError(Int_t, AliTrackPoint&, const AliESDtrack*)
static Double_tAliTrackerBase::GetTrackPredictedChi2(AliExternalTrackParam* track, Double_t mass, Double_t step, const AliExternalTrackParam* backup)
virtual UInt_tTObject::GetUniqueID() const
Double_tAliTrackerBase::GetX() const
Double_tAliTrackerBase::GetY() const
Double_tAliTrackerBase::GetZ() const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTObject::Hash() const
Bool_tHasRemoveContainers() 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 voidTObject::Inspect() constMENU
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
Bool_tIsClustersOwner() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
Bool_tTObject::IsOnHeap() const
virtual Bool_tTObject::IsSortable() const
Bool_tTObject::IsZombie() const
virtual Int_tLoadClusters(TTree* cTree)
Int_tLoadClusters(TClonesArray *const clusters)
virtual voidTObject::ls(Option_t* option = "") const
static Double_tAliTrackerBase::MakeC(Double_t x1, Double_t y1, Double_t x2, Double_t y2, Double_t x3, Double_t y3)
static AliExternalTrackParam*AliTrackerBase::MakeSeed(AliTrackPoint& point0, AliTrackPoint& point1, AliTrackPoint& point2)
static Double_tAliTrackerBase::MakeSnp(Double_t x1, Double_t y1, Double_t x2, Double_t y2, Double_t x3, Double_t y3)
static Double_tAliTrackerBase::MakeTgl(Double_t x1, Double_t y1, Double_t x2, Double_t y2, Double_t z1, Double_t z2)
static Double_tAliTrackerBase::MakeTgl(Double_t x1, Double_t y1, Double_t x2, Double_t y2, Double_t z1, Double_t z2, Double_t c)
voidTObject::MayNotUse(const char* method) const
static Double_tAliTrackerBase::MeanMaterialBudget(const Double_t* start, const Double_t* end, Double_t* mparam)
virtual Bool_tTObject::Notify()
voidTObject::Obsolete(const char* method, const char* asOfVers, const char* removedFromVers) const
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)
virtual voidTObject::Paint(Option_t* option = "")
virtual voidTObject::Pop()
virtual Int_tAliTracker::PostProcess(AliESDEvent*)
virtual voidTObject::Print(Option_t* option = "") const
virtual Int_tPropagateBack(AliESDEvent* event)
static Int_tPropagateToX(AliTRDtrackV1& t, Double_t xToGo, Double_t maxStep)
static Bool_tAliTrackerBase::PropagateTrackTo(AliExternalTrackParam* track, Double_t x, Double_t m, Double_t maxStep, Bool_t rotateTo = kTRUE, Double_t maxSnp = 0.8, Int_t sign = 0, Bool_t addTimeStep = kFALSE, Bool_t correctMaterialBudget = kTRUE)
static Int_tAliTrackerBase::PropagateTrackTo2(AliExternalTrackParam* track, Double_t x, Double_t m, Double_t maxStep, Bool_t rotateTo = kTRUE, Double_t maxSnp = 0.8, Int_t sign = 0, Bool_t addTimeStep = kFALSE, Bool_t correctMaterialBudget = kTRUE)
static Bool_tAliTrackerBase::PropagateTrackToBxByBz(AliExternalTrackParam* track, Double_t x, Double_t m, Double_t maxStep, Bool_t rotateTo = kTRUE, Double_t maxSnp = 0.8, Int_t sign = 0, Bool_t addTimeStep = kFALSE)
virtual Int_tTObject::Read(const char* name)
Bool_tReadClusters(TTree* in)
virtual voidTObject::RecursiveRemove(TObject* obj)
virtual Int_tRefitInward(AliESDEvent* event)
voidTObject::ResetBit(UInt_t f)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidTObject::SavePrimitive(basic_ostream<char,char_traits<char> >& out, Option_t* option = "")
static voidSetBetheBloch(AliTRDtrackerV1::ETRDtrackerV1BetheBloch bb)
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
voidSetClustersOwner(Bool_t own = kTRUE)
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
voidAliTracker::SetEventInfo(AliEventInfo* evInfo)
static voidAliTracker::SetFillResiduals(AliRecoParam::EventSpecie_t es, Bool_t flag = kTRUE)
static voidSetNTimeBins(Int_t nTimeBins)
static voidTObject::SetObjectStat(Bool_t stat)
voidSetReconstructor(const AliTRDReconstructor* rec)
voidSetRemoveContainers(Bool_t rm = kTRUE)
static voidAliTracker::SetResidualsArray(TObjArray** arr)
virtual voidTObject::SetUniqueID(UInt_t uid)
voidAliTrackerBase::SetVertex(const Double_t* xyz, const Double_t* ers = 0)
virtual voidShowMembers(TMemberInspector&)
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
static Bool_tAliTrackerBase::UniformField()
virtual voidUnloadClusters()
static voidAliTrackerBase::UpdateTrack(AliExternalTrackParam&, const AliExternalTrackParam&)
virtual voidAliTracker::UseClusters(const AliKalmanTrack* t, Int_t from = 0) const
virtual voidTObject::UseCurrentStyle()
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:
static Bool_tAdjustSector(AliTRDtrackV1 *const track)
Double_tBuildSeedingConfigs(AliTRDtrackingChamber** stack, Int_t* configs)
Int_tBuildTrackingContainers()
static Float_tCalculateChi2Z(const AliTRDseedV1* tracklets, Double_t offset, Double_t slope, Double_t xref)
Int_tClusters2TracksSM(Int_t sector, AliESDEvent* esd)
Int_tClusters2TracksStack(AliTRDtrackingChamber** stack, TClonesArray *const esdTrackList)
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
Float_tGetR4Layer(Int_t ly) const
AliTRDseedV1*GetTracklet(const AliTRDtrackV1 *const trk, Int_t plane, Int_t& idx)
virtual Bool_tGetTrackPoint(Int_t index, AliTrackPoint& p) const
Int_tMakeSeeds(AliTRDtrackingChamber** stack, AliTRDseedV1 *const sseed, const Int_t *const ipar)
AliTRDtrackV1*MakeTrack(AliTRDseedV1 *const tracklet)
voidTObject::MakeZombie()
AliTRDtrackV1*SetTrack(const AliTRDtrackV1 *const track)
AliTRDseedV1*SetTracklet(const AliTRDseedV1 *const tracklet)
voidUnsetTrackletsTrack(const AliTRDtrackV1 *const track)
private:
AliTRDtrackerV1(const AliTRDtrackerV1& tracker)
static Float_tCalculateReferenceX(const AliTRDseedV1 *const tracklets)
Double_tCalculateTrackLikelihood(Double_t* chi2)
Double_tCookLikelihood(AliTRDseedV1* cseed, Int_t* planes)
Float_tGetChi2Phi(const AliTRDseedV1 *const tracklets) const
Float_tGetChi2Y(const AliTRDseedV1 *const tracklets) const
Float_tGetChi2Z(const AliTRDseedV1 *const tracklets) const
Bool_tImproveSeedQuality(AliTRDtrackingChamber** stack, AliTRDseedV1* tracklet, Double_t& chi2)
AliTRDtrackerV1&operator=(const AliTRDtrackerV1& tracker)
voidResetSeedTB()

Data Members

public:
enum { kOwner
kRemoveContainers
};
enum ETRDtrackerV1const { kMaxLayersPerSector
kMaxTimeBinIndex
kTrackingSectors
kNTimeBins
kNPlanes
kNSeedPlanes
kMaxTracksStack
kNConfigs
};
enum ETRDtrackerV1BetheBloch { kGeant
kSolid
kGas
};
enum TObject::EStatusBits { kCanDelete
kMustCleanup
kObjInCanvas
kIsReferenced
kHasUUID
kCannotPick
kNoContextMenu
kInvalidObject
};
enum TObject::[unnamed] { kIsOnHeap
kNotDeleted
kZombie
kBitMask
kSingleKey
kOverwrite
kWriteDelete
};
private:
TClonesArray*fClustersList of clusters
Int_tfEventInFile! event in file being tracked (debug purposes)
AliTRDgeometry*fGeomPointer to TRD geometry
Float_tfR[6]! rough radial position of each TRD layer
Int_tfSeedLayer[100]Seed layer
AliTRDchamberTimeBin*fSeedTB[4]seeding time bin planes
Int_tfSieveSeeding! Seeding iterator
AliTRDtrackingSectorfTrSec[18]Array of tracking sectors;
Double_tfTrackQuality[100]Track quality
TClonesArray*fTrackletsList of tracklets
TClonesArray*fTracksList of tracks
TClonesArray*fTracksESDList of ESD tracks in current SM
static AliTRDtrackerV1::ETRDtrackerV1BetheBlochfgBBBethe Bloch method
static Int_tfgNTimeBinsTimebins per plane in track prolongation
static AliRieman*fgRiemanFitter for the untilted Rieman fit
static TLinearFitter*fgTiltedRiemanFitter for the tilted Rieman fit without vertex constriant
static TLinearFitter*fgTiltedRiemanConstrainedFitter for the tilted Rieman fit with vertex constraint
static Double_tfgTopologicQA[15]Topologic quality
static const Double_tfgkX0[6]default values for the position of anode wire
const AliTRDrecoParam*fkRecoParamreco param for the current event
const AliTRDReconstructor*fkReconstructorreconstructor manager

Class Charts

Inheritance Chart:
TObject
AliTrackerBase
AliTracker
AliTRDtrackerV1
AliTRDtrackerDebug

Function documentation

AliTRDtrackerV1(const AliTRDReconstructor* rec = NULL)
 Default constructor.

~AliTRDtrackerV1()
 Destructor

Int_t Clusters2Tracks(AliESDEvent* esd)
 Steering stand alone tracking for full TRD detector

 Parameters :
   esd     : The ESD event. On output it contains
             the ESD tracks found in TRD.

 Output :
   Number of tracks found in the TRD detector.

 Detailed description
 1. Launch individual SM trackers.
    See AliTRDtrackerV1::Clusters2TracksSM() for details.

Bool_t GetTrackPoint(Int_t index, AliTrackPoint& p) const
AliInfo(Form("Asking for tracklet %d", index));
TLinearFitter* GetTiltedRiemanFitter()
TLinearFitter* GetTiltedRiemanFitterConstraint()
AliRieman* GetRiemanFitter()
Int_t PropagateBack(AliESDEvent* event)
 Propagation of ESD tracks from TPC to TOF detectors and building of the TRD track. For building
 a TRD track an ESD track is used as seed. The informations obtained on the TRD track (measured points,
 covariance, PID, etc.) are than used to update the corresponding ESD track.
 Each track seed is first propagated to the geometrical limit of the TRD detector.
 Its prolongation is searched in the TRD and if corresponding clusters are found tracklets are
 constructed out of them (see AliTRDseedV1::AttachClusters()) and the track is updated.
 Otherwise the ESD track is left unchanged.

 The following steps are performed:
 1. Selection of tracks based on the variance in the y-z plane.
 2. Propagation to the geometrical limit of the TRD volume. If track propagation fails the AliESDtrack::kTRDStop is set.
 3. Prolongation inside the fiducial volume (see AliTRDtrackerV1::FollowBackProlongation()) and marking
 the following status bits:
   - AliESDtrack::kTRDin - if the tracks enters the TRD fiducial volume
   - AliESDtrack::kTRDStop - if the tracks fails propagation
   - AliESDtrack::kTRDbackup - if the tracks fulfills chi2 conditions and qualify for refitting
 4. Writting to friends, PID, MC label, quality etc. Setting status bit AliESDtrack::kTRDout.
 5. Propagation to TOF. If track propagation fails the AliESDtrack::kTRDStop is set.

Int_t RefitInward(AliESDEvent* event)
 Refits tracks within the TRD. The ESD event is expected to contain seeds
 at the outer part of the TRD.
 The tracks are propagated to the innermost time bin
 of the TRD and the ESD event is updated
 Origin: Thomas KUHR (Thomas.Kuhr@cern.ch)

Int_t FollowProlongation(AliTRDtrackV1& t)
 Extrapolates the TRD track in the TPC direction.

 Parameters
   t : the TRD track which has to be extrapolated

 Output
   number of clusters attached to the track

 Detailed description

 Starting from current radial position of track <t> this function
 extrapolates the track through the 6 TRD layers. The following steps
 are being performed for each plane:
 1. prepare track:
   a. get plane limits in the local x direction
   b. check crossing sectors
   c. check track inclination
 2. search tracklet in the tracker list (see GetTracklet() for details)
 3. evaluate material budget using the geo manager
 4. propagate and update track using the tracklet information.

 Debug level 2

Int_t FollowBackProlongation(AliTRDtrackV1& t)
 Extrapolates/Build the TRD track in the TOF direction.

 Parameters
   t : the TRD track which has to be extrapolated

 Output
   number of clusters attached to the track

 Starting from current radial position of track <t> this function
 extrapolates the track through the 6 TRD layers. The following steps
 are being performed for each plane:
 1. Propagate track to the entrance of the next chamber:
   - get chamber limits in the radial direction
   - check crossing sectors
   - check track inclination
   - check track prolongation against boundary conditions (see exclusion boundaries on AliTRDgeometry::IsOnBoundary())
 2. Build tracklet (see AliTRDseed::AttachClusters() for details) for this layer if needed. If only
    Kalman filter is needed and tracklets are already linked to the track this step is skipped.
 3. Fit tracklet using the information from the Kalman filter.
 4. Propagate and update track at reference radial position of the tracklet.
 5. Register tracklet with the tracker and track; update pulls monitoring.

 Observation
   1. During the propagation a bit map is filled detailing the status of the track in each TRD chamber. The following errors are being registered for each tracklet:
 - AliTRDtrackV1::kProlongation : track prolongation failed
 - AliTRDtrackV1::kPropagation : track prolongation failed
 - AliTRDtrackV1::kAdjustSector : failed during sector crossing
 - AliTRDtrackV1::kSnp : too large bending
 - AliTRDtrackV1::kTrackletInit : fail to initialize tracklet
 - AliTRDtrackV1::kUpdate : fail to attach clusters or fit the tracklet
 - AliTRDtrackV1::kUnknown : anything which is not covered before
   2. By default the status of the track before first TRD update is saved.

 Debug level 2

 Author
   Alexandru Bercuci <A.Bercuci@gsi.de>

Float_t FitRieman(AliTRDseedV1* tracklets, Double_t* chi2, Int_t *const planes = NULL)
 Fits a Riemann-circle to the given points without tilting pad correction.
 The fit is performed using an instance of the class AliRieman (equations
 and transformations see documentation of this class)
 Afterwards all the tracklets are Updated

 Parameters: - Array of tracklets (AliTRDseedV1)
             - Storage for the chi2 values (beginning with direction z)
             - Seeding configuration
 Output:     - The curvature

void FitRieman(AliTRDcluster** clusters, Double_t* chi2)
 Performs a Riemann helix fit using the seedclusters as spacepoints
 Afterwards the chi2 values are calculated and the seeds are updated

 Parameters: - The four seedclusters
             - The tracklet array (AliTRDseedV1)
             - The seeding configuration
             - Chi2 array

 debug level 2

Float_t FitTiltedRiemanConstraint(AliTRDseedV1* tracklets, Double_t zVertex)
 Fits a helix to the clusters. Pad tilting is considered. As constraint it is
 assumed that the vertex position is set to 0.
 This method is very usefull for high-pt particles
 Basis for the fit: (x - x0)^2 + (y - y0)^2 - R^2 = 0
      x0, y0: Center of the circle
 Measured y-position: ymeas = y - tan(phiT)(zc - zt)
      zc: center of the pad row
 Equation which has to be fitted (after transformation):
 a + b * u + e * v + 2*(ymeas + tan(phiT)(z - zVertex))*t = 0
 Transformation:
 t = 1/(x^2 + y^2)
 u = 2 * x * t
 v = 2 * x * tan(phiT) * t
 Parameters in the equation:
    a = -1/y0, b = x0/y0, e = dz/dx

 The Curvature is calculated by the following equation:
               - curv = a/Sqrt(b^2 + 1) = 1/R
 Parameters:   - the 6 tracklets
               - the Vertex constraint
 Output:       - the Chi2 value of the track

 debug level 5

Float_t FitTiltedRieman(AliTRDseedV1* tracklets, Bool_t sigError)
 Performs a Riemann fit taking tilting pad correction into account
 The equation of a Riemann circle, where the y position is substituted by the
 measured y-position taking pad tilting into account, has to be transformed
 into a 4-dimensional hyperplane equation
 Riemann circle: (x-x0)^2 + (y-y0)^2 -R^2 = 0
 Measured y-Position: ymeas = y - tan(phiT)(zc - zt)
          zc: center of the pad row
          zt: z-position of the track
 The z-position of the track is assumed to be linear dependent on the x-position
 Transformed equation: a + b * u + c * t + d * v  + e * w - 2 * (ymeas + tan(phiT) * zc) * t = 0
 Transformation:       u = 2 * x * t
                       v = 2 * tan(phiT) * t
                       w = 2 * tan(phiT) * (x - xref) * t
                       t = 1 / (x^2 + ymeas^2)
 Parameters:           a = -1/y0
                       b = x0/y0
                       c = (R^2 -x0^2 - y0^2)/y0
                       d = offset
                       e = dz/dx
 If the offset respectively the slope in z-position is impossible, the parameters are fixed using
 results from the simple riemann fit. Afterwards the fit is redone.
 The curvature is calculated according to the formula:
                       curv = a/(1 + b^2 + c*a) = 1/R

 Paramters:   - Array of tracklets (connected to the track candidate)
              - Flag selecting the error definition
 Output:      - Chi2 values of the track (in Parameter list)

Double_t FitLine(const AliTRDtrackV1* trk, AliTRDseedV1* tracklets = NULL, Bool_t err = 0, Int_t np = 0, AliTrackPoint* points = NULL)
 Fit track with a staight line
 Fills an AliTrackPoint array with np points
 Function should be used to refit tracks when no magnetic field was on

Double_t FitRiemanTilt(const AliTRDtrackV1* trk, AliTRDseedV1* tracklets = NULL, Bool_t err = 0, Int_t np = 0, AliTrackPoint* points = NULL)
 Performs a Riemann fit taking tilting pad correction into account

 Paramters:   - Array of tracklets (connected to the track candidate)
              - Flag selecting the error definition
 Output:      - Chi2 values of the track (in Parameter list)

 The equations which has to be solved simultaneously are:

R^{2} = (x-x_{0})^{2} + (y^{*}-y_{0})^{2}
 with (x, y, z) the coordinate of the cluster, (x_0, y_0, z_0) the coordinate of the center of the Riemann circle,
 R its radius, x_r a constant refrence radial position in the middle of the TRD stack  and dzdx the slope of the
 track in the x-z plane. Using the following transformations

t = 1 / (x^{2} + y^{2})
 One gets the following linear equation

a + b * u + c * t + d * v  + e * w = 2 * (y + tg(h) * z) * t
 where the coefficients have the following meaning

a = -1/y_{0}
 The error calculation for the free term is thus

#sigma = 2 * #sqrt{#sigma^{2}_{y} + (tilt corr ...) + tg^{2}(h) * #sigma^{2}_{z}} * t

 From this simple model one can compute chi^2 estimates and a rough approximation of pt from the curvature according
 to the formula:

C = 1/R = a/(1 + b^{2} + c*a)

 Authors
   M.Ivanov <M.Ivanov@gsi.de>
   A.Bercuci <A.Bercuci@gsi.de>
   M.Fasel <M.Fasel@gsi.de>
Double_t FitKalman(AliTRDtrackV1* trk, AliTRDseedV1 *const tracklets = NULL, Bool_t up = 0, Int_t np = 0, AliTrackPoint* points = NULL)
   Kalman filter implementation for the TRD.
   It returns the positions of the fit in the array "points"

   Author : A.Bercuci@gsi.de
Float_t CalculateChi2Z(const AliTRDseedV1* tracklets, Double_t offset, Double_t slope, Double_t xref)
 Calculates the chi2-value of the track in z-Direction including tilting pad correction.
 A linear dependence on the x-value serves as a model.
 The parameters are related to the tilted Riemann fit.
 Parameters: - Array of tracklets (AliTRDseedV1) related to the track candidate
             - the offset for the reference x
             - the slope
             - the reference x position
 Output:     - The Chi2 value of the track in z-Direction

Int_t PropagateToX(AliTRDtrackV1& t, Double_t xToGo, Double_t maxStep)
 Starting from current X-position of track <t> this function
 extrapolates the track up to radial position <xToGo> in steps of <maxStep>.
 Returns 1 if track reaches the plane, and 0 otherwise

Bool_t ReadClusters(TTree* in)
 Reads AliTRDclusters from the file.
 The names of the cluster tree and branches
 should match the ones used in AliTRDclusterizer::WriteClusters()

Int_t LoadClusters(TTree* cTree)
 Fills clusters into TRD tracking sectors

Int_t LoadClusters(TClonesArray *const clusters)
 Fills clusters into TRD tracking sectors
 Function for use in the HLT
Int_t BuildTrackingContainers()
 Building tracking containers for clusters
void UnloadClusters()
 Clears the arrays of clusters and tracks. Resets sectors and timebins
 If option "force" is also set the containers are also deleted. This is useful
 in case of HLT
Bool_t AdjustSector(AliTRDtrackV1 *const track)
 Rotates the track when necessary

AliTRDseedV1* GetTracklet(const AliTRDtrackV1 *const trk, Int_t plane, Int_t& idx)
 Find tracklet for TRD track <track>
 Parameters
 - track
 - sector
 - plane
 - index
 Output
 tracklet
 index
 Detailed description

AliTRDseedV1* SetTracklet(const AliTRDseedV1 *const tracklet)
 Add this tracklet to the list of tracklets stored in the tracker

 Parameters
   - tracklet : pointer to the tracklet to be added to the list

 Output
   - the index of the new tracklet in the tracker tracklets list

 Detailed description
 Build the tracklets list if it is not yet created (late initialization)
 and adds the new tracklet to the list.

AliTRDtrackV1* SetTrack(const AliTRDtrackV1 *const track)
 Add this track to the list of tracks stored in the tracker

 Parameters
   - track : pointer to the track to be added to the list

 Output
   - the pointer added

 Detailed description
 Build the tracks list if it is not yet created (late initialization)
 and adds the new track to the list.

Int_t Clusters2TracksSM(Int_t sector, AliESDEvent* esd)
 Steer tracking for one SM.

 Parameters :
   sector  : Array of (SM) propagation layers containing clusters
   esd     : The current ESD event. On output it contains the also
             the ESD (TRD) tracks found in this SM.

 Output :
   Number of tracks found in this TRD supermodule.

 Detailed description

 1. Unpack AliTRDpropagationLayers objects for each stack.
 2. Launch stack tracking.
    See AliTRDtrackerV1::Clusters2TracksStack() for details.
 3. Pack results in the ESD event.

Int_t Clusters2TracksStack(AliTRDtrackingChamber** stack, TClonesArray *const esdTrackList)
 Make tracks in one TRD stack.

 Parameters :
   layer  : Array of stack propagation layers containing clusters
   esdTrackList  : Array of ESD tracks found by the stand alone tracker.
                   On exit the tracks found in this stack are appended.

 Output :
   Number of tracks found in this stack.

 Detailed description

 1. Find the 3 most useful seeding chambers. See BuildSeedingConfigs() for details.
 2. Steer AliTRDtrackerV1::MakeSeeds() for 3 seeding layer configurations.
    See AliTRDtrackerV1::MakeSeeds() for more details.
 3. Arrange track candidates in decreasing order of their quality
 4. Classify tracks in 5 categories according to:
    a) number of layers crossed
    b) track quality
 5. Sign clusters by tracks in decreasing order of track quality
 6. Build AliTRDtrack out of seeding tracklets
 7. Cook MC label
 8. Build ESD track and register it to the output list

Double_t BuildSeedingConfigs(AliTRDtrackingChamber** stack, Int_t* configs)
 Assign probabilities to chambers according to their
 capability of producing seeds.

 Parameters :

   layers : Array of stack propagation layers for all 6 chambers in one stack
   configs : On exit array of configuration indexes (see GetSeedingConfig()
 for details) in the decreasing order of their seeding probabilities.

 Output :

  Return top configuration quality

 Detailed description:

 To each chamber seeding configuration (see GetSeedingConfig() for
 the list of all configurations) one defines 2 quality factors:
  - an apriori topological quality (see GetSeedingConfig() for details) and
  - a data quality based on the uniformity of the distribution of
    clusters over the x range (time bins population). See CookChamberQA() for details.
 The overall chamber quality is given by the product of this 2 contributions.

Int_t MakeSeeds(AliTRDtrackingChamber** stack, AliTRDseedV1 *const sseed, const Int_t *const ipar)
 Seed tracklets and build candidate TRD tracks. The procedure is used during barrel tracking to account for tracks which are
 either missed by TPC prolongation or conversions inside the TRD volume.
 For stand alone tracking the procedure is used to estimate all tracks measured by TRD.

 Parameters :
   layers : Array of stack propagation layers containing clusters
   sseed  : Array of empty tracklet seeds. On exit they are filled.
   ipar   : Control parameters:
       ipar[0] -> seeding chambers configuration
       ipar[1] -> stack index
       ipar[2] -> number of track candidates found so far

 Output :
   Number of tracks candidates found.

 The following steps are performed:
 1. Build seeding layers by collapsing all time bins from each of the four seeding chambers along the
 radial coordinate. See AliTRDtrackingChamber::GetSeedingLayer() for details. The chambers selection for seeding
 is described in AliTRDtrackerV1::Clusters2TracksStack().
 2. Using the seeding clusters from the seeding layer (step 1) build combinatorics using the following algorithm:
 - for each seeding cluster in the lower seeding layer find
 - all seeding clusters in the upper seeding layer inside a road defined by a given phi angle. The angle
   is calculated on the minimum pt of tracks from vertex accesible to the stand alone tracker.
 - for each pair of two extreme seeding clusters select middle upper cluster using roads defined externally by the
   reco params
 - select last seeding cluster as the nearest to the linear approximation of the track described by the first three
   seeding clusters.
   The implementation of road calculation and cluster selection can be found in the functions AliTRDchamberTimeBin::BuildCond()
   and AliTRDchamberTimeBin::GetClusters().
 3. Helix fit of the seeding clusters set. (see AliTRDtrackerFitter::FitRieman(AliTRDcluster**)). No tilt correction is
    performed at this level
 4. Initialize seeding tracklets in the seeding chambers.
 5. *Filter 0* Chi2 cut on the Y and Z directions. The threshold is set externally by the reco params.
 6. Attach (true) clusters to seeding tracklets (see AliTRDseedV1::AttachClusters()) and fit tracklet (see
    AliTRDseedV1::Fit()). The number of used clusters used by current seeds should not exceed ... (25).
 7. *Filter 1* Check if all 4 seeding tracklets are correctly constructed.
 8. Helix fit of the clusters from the seeding tracklets with tilt correction. Refit tracklets using the new
    approximation of the track.
 9. *Filter 2* Calculate likelihood of the track. (See AliTRDtrackerV1::CookLikelihood()). The following quantities are
    checked against the Riemann fit:
      - position resolution in y
      - angular resolution in the bending plane
      - likelihood of the number of clusters attached to the tracklet
 10. Extrapolation of the helix fit to the other 2 chambers *non seeding* chambers:
      - Initialization of extrapolation tracklets with the fit parameters
      - Attach clusters to extrapolated tracklets
      - Helix fit of tracklets
 11. Improve seeding tracklets quality by reassigning clusters based on the last parameters of the track
      See AliTRDtrackerV1::ImproveSeedQuality() for details.
 12. Helix fit of all 6 seeding tracklets and chi2 calculation
 13. Hyperplane fit and track quality calculation. See AliTRDtrackerFitter::FitHyperplane() for details.
 14. Cooking labels for tracklets. Should be done only for MC
 15. Register seeds.

 Authors:
   Marian Ivanov <M.Ivanov@gsi.de>
   Alexandru Bercuci <A.Bercuci@gsi.de>
   Markus Fasel <M.Fasel@gsi.de>
AliTRDtrackV1* MakeTrack(AliTRDseedV1 *const tracklet)
 Build a TRD track out of tracklet candidates

 Parameters :
   seeds  : array of tracklets
   params : array of track parameters as they are estimated by stand alone tracker. 7 elements.
     [0] - radial position of the track at reference point
     [1] - y position of the fit at [0]
     [2] - z position of the fit at [0]
     [3] - snp of the first tracklet
     [4] - tgl of the first tracklet
     [5] - curvature of the Riemann fit - 1/pt
     [6] - sector rotation angle

 Output :
   The TRD track.

 Initialize the TRD track based on the parameters of the fit and a parametric covariance matrix
 (diagonal with constant variance terms TODO - correct parameterization)

 In case of HLT just register the tracklets in the tracker and return values of the Riemann fit. For the
 offline case perform a full Kalman filter on the already found tracklets (see AliTRDtrackerV1::FollowBackProlongation()
 for details). Do also MC label calculation and PID if propagation successfully.
Bool_t ImproveSeedQuality(AliTRDtrackingChamber** stack, AliTRDseedV1* tracklet, Double_t& chi2)
 Sort tracklets according to "quality" and try to "improve" the first 4 worst

 Parameters :
  layers : Array of propagation layers for a stack/supermodule
  cseed  : Array of 6 seeding tracklets which has to be improved

 Output :
   cssed : Improved seeds

 Detailed description

 Iterative procedure in which new clusters are searched for each
 tracklet seed such that the seed quality (see AliTRDseed::GetQuality())
 can be maximized. If some optimization is found the old seeds are replaced.

 debug level: 7

Double_t CalculateTrackLikelihood(Double_t* chi2)
 Calculates the Track Likelihood value. This parameter serves as main quality criterion for
 the track selection
 The likelihood value containes:
    - The chi2 values from the both fitters and the chi2 values in z-direction from a linear fit
    - The Sum of the Parameter  |slope_ref - slope_fit|/Sigma of the tracklets
 For all Parameters an exponential dependency is used

 Parameters: - Array of tracklets (AliTRDseedV1) related to the track candidate
             - Array of chi2 values:
                 * Non-Constrained Tilted Riemann fit
                 * Vertex-Constrained Tilted Riemann fit
                 * z-Direction from Linear fit
 Output:     - The calculated track likelihood

 debug level 2

Double_t CookLikelihood(AliTRDseedV1* cseed, Int_t* planes)
 Calculate the probability of this track candidate.

 Parameters :
   cseeds : array of candidate tracklets
   planes : array of seeding planes (see seeding configuration)
   chi2   : chi2 values (on the Z and Y direction) from the rieman fit of the track.

 Output :
   likelihood value

 Detailed description

 The track quality is estimated based on the following 4 criteria:
  1. precision of the rieman fit on the Y direction (likea)
  2. chi2 on the Y direction (likechi2y)
  3. chi2 on the Z direction (likechi2z)
  4. number of attached clusters compared to a reference value
     (see AliTRDrecoParam::fkFindable) (likeN)

 The distributions for each type of probabilities are given below as of
 (date). They have to be checked to assure consistency of estimation.

void GetSeedingConfig(Int_t iconfig, Int_t* planes)
 Map seeding configurations to detector planes.

 Parameters :
   iconfig : configuration index
   planes  : member planes of this configuration. On input empty.

 Output :
   planes : contains the planes which are defining the configuration

 Detailed description

 Here is the list of seeding planes configurations together with
 their topological classification:

  0 - 5432 TQ 0
  1 - 4321 TQ 0
  2 - 3210 TQ 0
  3 - 5321 TQ 1
  4 - 4210 TQ 1
  5 - 5431 TQ 1
  6 - 4320 TQ 1
  7 - 5430 TQ 2
  8 - 5210 TQ 2
  9 - 5421 TQ 3
 10 - 4310 TQ 3
 11 - 5410 TQ 4
 12 - 5420 TQ 5
 13 - 5320 TQ 5
 14 - 5310 TQ 5

 The topologic quality is modeled as follows:
 1. The general model is define by the equation:
  p(conf) = exp(-conf/2)
 2. According to the topologic classification, configurations from the same
    class are assigned the agerage value over the model values.
 3. Quality values are normalized.

 The topologic quality distribution as function of configuration is given below:


void GetExtrapolationConfig(Int_t iconfig, Int_t* planes)
 Returns the extrapolation planes for a seeding configuration.

 Parameters :
   iconfig : configuration index
   planes  : planes which are not in this configuration. On input empty.

 Output :
   planes : contains the planes which are not in the configuration

 Detailed description

AliCluster* GetCluster(Int_t index) const
AliTRDseedV1* GetTracklet(Int_t index) const
AliKalmanTrack* GetTrack(Int_t index) const
void ResetSeedTB()
 reset buffer for seeding time bin layers. If the time bin
 layers are not allocated this function allocates them
Float_t GetChi2Y(const AliTRDseedV1 *const tracklets) const
	Calculates normalized chi2 in y-direction
 chi2 = Sum chi2 / n_tracklets
Float_t GetChi2Z(const AliTRDseedV1 *const tracklets) const
	Calculates normalized chi2 in z-direction
 chi2 = Sum chi2 / n_tracklets
Float_t GetChi2Phi(const AliTRDseedV1 *const tracklets) const
  Calculates normalized chi2 for angular resolution
 chi2 = Sum chi2 / n_tracklets
Float_t CalculateReferenceX(const AliTRDseedV1 *const tracklets)
 Calculates the reference x-position for the tilted Rieman fit defined as middle
 of the stack (middle between layers 2 and 3). For the calculation all the tracklets
 are taken into account

 Parameters: - Array of tracklets(AliTRDseedV1)

 Output: - The reference x-position(Float_t)
 Only kept for compatibility with the old code

Double_t FitTiltedRiemanV1(AliTRDseedV1* tracklets)
 Track Fitter Function using the new class implementation of
 the Rieman fit

void UnsetTrackletsTrack(const AliTRDtrackV1 *const track)
  Remove tracklets from tracker list attached to "track"
AliTRDtrackerV1(const AliTRDReconstructor* rec = NULL)
AliTRDtrackingSector* GetTrackingSector(Int_t sec)
temporary
{return &fTrSec[sec];}
GetBetheBloch()
{ return fgBB;}
TClonesArray* GetListOfClusters() const
{ return fClusters;}
TClonesArray* GetListOfTracklets() const
{ return fTracklets;}
TClonesArray* GetListOfTracks() const
{ return fTracks;}
Int_t GetNTimeBins()
{ return fgNTimeBins;}
Bool_t IsClustersOwner() const
{ return TestBit(kOwner);}
Bool_t HasRemoveContainers() const
void SetBetheBloch(AliTRDtrackerV1::ETRDtrackerV1BetheBloch bb)
{fgBB = bb;}
void SetClustersOwner(Bool_t own = kTRUE)
{SetBit(kOwner, own); if(!own) fClusters = NULL;}
void SetRemoveContainers(Bool_t rm = kTRUE)
void SetNTimeBins(Int_t nTimeBins)
{fgNTimeBins = nTimeBins; }
void SetReconstructor(const AliTRDReconstructor* rec)
AliTRDLeastSquare& operator=(const AliTRDtrackerV1& tracker)
Float_t GetR4Layer(Int_t ly) const
{ return fR[ly];}