/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
-/* $Id$ */
-
#include "AliTracker.h"
#include "TObjArray.h"
-#include "AliBarrelTrack.h"
-
-#include <TNamed.h>
-#include <TH1.h>
class TFile;
+class TTree;
class TParticle;
class TParticlePDG;
class AliTRDparameter;
class AliTRDtrack;
class AliTRDcluster;
-class AliTRDmcTrack;
+class AliBarrelTrack;
+class AliESD;
-const unsigned kMAX_LAYERS_PER_SECTOR = 1000;
-const unsigned kMAX_TIME_BIN_INDEX = 216; // (30 drift + 6 ampl) * 6 planes
-const unsigned kMAX_CLUSTER_PER_TIME_BIN = 7000;
-const unsigned kZONES = 5;
-const Int_t kTRACKING_SECTORS = 18;
+const unsigned kMaxLayersPerSector = 1000;
+const unsigned kMaxTimeBinIndex = 216; // (30 drift + 6 ampl) * 6 planes
+const unsigned kMaxClusterPerTimeBin = 7000;
+const unsigned kZones = 5;
+const Int_t kTrackingSectors = 18;
-class AliTRDtracker : public AliTracker {
+class AliTRDtracker : public AliTracker {
public:
- AliTRDtracker():AliTracker() {}
+ AliTRDtracker();
AliTRDtracker(const TFile *in);
- ~AliTRDtracker();
+ virtual ~AliTRDtracker();
- Int_t Clusters2Tracks(const TFile *in, TFile *out);
- Int_t PropagateBack(const TFile *in, TFile *out);
- Int_t PropagateBack();//Almost empty see .cxx for more comments
- Int_t Clusters2Tracks();//Almost empty see .cxx for more comments
+ Int_t Clusters2Tracks(AliESD* event);
+ Int_t PropagateBack(AliESD* event);
+ Int_t RefitInward(AliESD* event);
- Int_t LoadClusters() {LoadEvent(); return 0;};
- void UnloadClusters() {UnloadEvent();};
- AliCluster *GetCluster(Int_t index) const { return (AliCluster*) fClusters->UncheckedAt(index); };
+ Int_t LoadClusters(TTree *cTree);
+ void UnloadClusters();
+ AliCluster *GetCluster(Int_t index) const { if (index >= fNclusters) return NULL;
+ return (AliCluster*) fClusters->UncheckedAt(index); };
virtual void CookLabel(AliKalmanTrack *t,Float_t wrong) const;
virtual void UseClusters(const AliKalmanTrack *t, Int_t from=0) const;
Double_t GetTiltFactor(const AliTRDcluster* c);
- void ReadClusters(TObjArray *array, const Char_t *filename);
- Int_t CookSectorIndex(Int_t gs) { return kTRACKING_SECTORS - 1 - gs; }
-
+ Int_t ReadClusters(TObjArray *array, TTree *in) const;
+ Int_t CookSectorIndex(Int_t gs) const { return kTrackingSectors - 1 - gs; }
+ AliTRDcluster * GetCluster(AliTRDtrack * track, Int_t plane, Int_t timebin);
+ Int_t GetLastPlane(AliTRDtrack * track); //return last updated plane
Float_t GetSeedGap() const {return fgkSeedGap;}
Int_t GetMaxGap() const {return fMaxGap;}
Float_t GetMaxSeedVertexZ() const {return fgkMaxSeedVertexZ;}
// x <-> timebin conversions useful in analysis macros
- Double_t GetX(Int_t sec, Int_t plane, Int_t local_tb) const;
+ Double_t GetX(Int_t sec, Int_t plane, Int_t localTB) const;
Double_t GetX(Int_t sec, Int_t pl) const {
return fTrSec[sec]->GetLayer(pl)->GetX(); }
- Int_t GetGlobalTimeBin(Int_t sec, Int_t plane, Int_t local_tb) const {
- return fTrSec[sec]->CookTimeBinIndex(plane,local_tb); }
+ Int_t GetGlobalTimeBin(Int_t sec, Int_t plane, Int_t localTB) const {
+ return fTrSec[sec]->CookTimeBinIndex(plane,localTB); }
Double_t GetLayerNumber(Int_t sec, Double_t x) const {
return fTrSec[sec]->GetLayerNumber(x); }
- public:
- class AliTRDpropagationLayer {
+ class AliTRDpropagationLayer {
// ***************** internal class *******************
public:
AliTRDpropagationLayer(Double_t x, Double_t dx, Double_t rho,
- Double_t x0, Int_t tb_index);
+ Double_t x0, Int_t tbIndex);
~AliTRDpropagationLayer() {
if(fTimeBinIndex >= 0) { delete[] fClusters; delete[] fIndex; }
}
- void InsertCluster(AliTRDcluster*, UInt_t);
+ void InsertCluster(AliTRDcluster *c, UInt_t index);
operator Int_t() const {return fN;}
AliTRDcluster* operator[](Int_t i) {return fClusters[i];}
UInt_t GetIndex(Int_t i) const {return fIndex[i];}
void GetPropagationParameters(Double_t y, Double_t z,
Double_t &dx, Double_t &rho, Double_t &x0,
Bool_t &lookForCluster) const;
+ Int_t GetZone( Double_t z) const;
Int_t Find(Double_t y) const;
void SetZmax(Int_t cham, Double_t center, Double_t w)
{ fZc[cham] = center; fZmax[cham] = w; }
- void SetYmax(Double_t w) { fYmax = w; }
+ void SetZ(Double_t* center, Double_t *w, Double_t *wsensitive);
+ void SetHoles(Bool_t* holes);
+ void SetYmax(Double_t w, Double_t wsensitive) { fYmax = w; fYmaxSensitive = wsensitive; }
Double_t GetYmax() const { return fYmax; }
Double_t GetZmax(Int_t c) const { return fZmax[c]; }
Double_t GetZc(Int_t c) const { return fZc[c]; }
Double_t rho = 1.29e-3, Double_t x0 = 36.66,
Double_t Yc = 0, Double_t Zc = 0);
- Bool_t IsSensitive() {return (fTimeBinIndex>=0)? kTRUE: kFALSE;}
+ Bool_t IsSensitive() const {return (fTimeBinIndex>=0)? kTRUE: kFALSE;}
void Clear() {for(Int_t i=0; i<fN; i++) fClusters[i] = NULL; fN = 0;}
-
+ Bool_t IsHole(Int_t zone) const { return fIsHole[zone];}
private:
- Int_t fN;
+ Int_t fN; // this is fN
+ Int_t fSec; // sector mumber
AliTRDcluster **fClusters; // array of pointers to clusters
UInt_t *fIndex; // array of cluster indexes
Double_t fX; // x coordinate of the middle plane
Double_t fRho; // default density of the material
Double_t fX0; // default radiation length
Int_t fTimeBinIndex; // plane * F(local_tb)
- Double_t fZc[kZONES]; // Z position of the center for 5 active areas
- Double_t fZmax[kZONES]; // half of active area length in Z
+ Double_t fZc[kZones]; // Z position of the center for 5 active areas
+ Double_t fZmax[kZones]; // half of active area length in Z
+ Double_t fZmaxSensitive[kZones]; //sensitive area for detection Z
+ Bool_t fIsHole[kZones]; //is hole in given sector
Double_t fYmax; // half of active area length in Y
+ Double_t fYmaxSensitive; // half of active area length in Y
Bool_t fHole; // kTRUE if there is a hole in the layer
Double_t fHoleZc; // Z of the center of the hole
void InsertLayer(AliTRDpropagationLayer* pl);
// AliTRDpropagationLayer* operator[](Int_t i) { return fLayers[i]; }
AliTRDpropagationLayer* GetLayer(Int_t i) { return fLayers[i]; }
- Int_t CookTimeBinIndex(Int_t plane, Int_t local_tb) const;
+ Int_t CookTimeBinIndex(Int_t plane, Int_t localTB) const;
private:
Int_t fN; // total number of layers
- AliTRDgeometry *fGeom;
- AliTRDparameter *fPar;
- AliTRDpropagationLayer *fLayers[kMAX_LAYERS_PER_SECTOR];
- Int_t fTimeBinIndex[kMAX_TIME_BIN_INDEX];
+ AliTRDgeometry *fGeom; // geometry
+ AliTRDparameter *fPar; // parameter
+ AliTRDpropagationLayer *fLayers[kMaxLayersPerSector]; // layers
+ Int_t fTimeBinIndex[kMaxTimeBinIndex]; // time bin index
Float_t fTzeroShift; // T0 shift in cm
Int_t fGeomSector; // sector # in AliTRDgeometry
};
- private:
-
- void LoadEvent();
- void UnloadEvent();
-
- virtual void MakeSeeds(Int_t inner, Int_t outer, Int_t turn);
-
- Int_t FollowProlongation(AliTRDtrack& t, Int_t rf);
- Int_t FollowBackProlongation(AliTRDtrack& t);
- //Int_t FolowRefitInward(AliTRDtrack *seed, AliTPCtrack *track);
-
- Int_t PropagateToTPC(AliTRDtrack& t);
- Int_t PropagateToOuterPlane(AliTRDtrack& t, Double_t x);
-
- Int_t WriteTracks();
- void ReadClusters(TObjArray *array, const TFile *in = 0);
-
- void SetSY2corr(Float_t w) {fSY2corr = w;}
- void SetSZ2corr(Float_t w) {fSZ2corr = w;}
- Double_t ExpectedSigmaY2(Double_t r, Double_t tgl, Double_t pt);
- Double_t ExpectedSigmaZ2(Double_t r, Double_t tgl);
-
-
protected:
AliTRDgeometry *fGeom; // Pointer to TRD geometry
- AliTRDparameter *fPar;
+ AliTRDparameter *fPar; // Pointer to TRD parameter
- AliTRDtrackingSector *fTrSec[kTRACKING_SECTORS];
- // array of tracking sectors;
-
+ AliTRDtrackingSector *fTrSec[kTrackingSectors]; // array of tracking sectors;
Int_t fNclusters; // Number of clusters in TRD
TObjArray *fClusters; // List of clusters for all sectors
// time bin in seeding
// (fraction of all time bins)
- static const Float_t fgkSeedStep; // Step in iterations
- static const Float_t fgkSeedDepth; // Fraction of TRD allocated fgkor seeding
- static const Float_t fgkSkipDepth; // Fraction of TRD which can be skipped
- // in track prolongation
+ static const Float_t fgkSeedStep; // Step in iterations
+ static const Float_t fgkSeedDepth; // Fraction of TRD allocated for seeding
+ static const Float_t fgkSkipDepth; // Fraction of TRD which can be skipped
+ // in track prolongation
Int_t fTimeBinsPerPlane; // number of sensitive timebins per plane
Int_t fMaxGap; // max gap (in time bins) in the track
- // in track prolongation
+ // in track prolongation
- static const Double_t fgkMaxChi2; // max increment in track chi2
-
+ static const Double_t fgkMaxChi2; // max increment in track chi2
+
static const Float_t fgkMinClustersInTrack; // min number of clusters in track
- // out of total timebins
+ // out of total timebins
- static const Float_t fgkMinFractionOfFoundClusters; // min fgkound clusters
- // out of expected
+ static const Float_t fgkMinFractionOfFoundClusters; // min found clusters
+ // out of expected
- static const Float_t fgkMinClustersInSeed; // min fgkraction of clusters in seed
+ static const Float_t fgkMinClustersInSeed; // min fraction of clusters in seed
static const Float_t fgkMaxSeedDeltaZ; // max dZ in MakeSeeds
static const Float_t fgkMaxSeedDeltaZ12; // max abs(z1-z2) in MakeSeeds
static const Float_t fgkMaxSeedC; // max initial curvature in MakeSeeds
static const Double_t fgkSeedErrorSY; // sy parameter in MakeSeeds
static const Double_t fgkSeedErrorSY3; // sy3 parameter in MakeSeeds
static const Double_t fgkSeedErrorSZ; // sz parameter in MakeSeeds
- static const Float_t fgkLabelFraction; // min fgkraction of same label
+ static const Float_t fgkLabelFraction; // min fraction of same label
static const Float_t fgkWideRoad; // max road width in FindProlongation
- Bool_t fVocal;
- Bool_t fAddTRDseeds;
-
- Bool_t fNoTilt;
-
+ Bool_t fVocal; // Whatever...
+ Bool_t fAddTRDseeds; // Something else
+
+ Bool_t fNoTilt; // No tilt, or what?
+ Bool_t fHoles[5][18]; // holes
Bool_t AdjustSector(AliTRDtrack *track);
// Barrel tracks [SR, 03.04.2003]
- static const Int_t kFirstPlane; // Id of the first (innermost) reference plane
- static const Int_t kLastPlane; // Id of the last (outermost) reference plane
+ static const Int_t fgkFirstPlane; // Id of the first (innermost) reference plane
+ static const Int_t fgkLastPlane; // Id of the last (outermost) reference plane
void SetBarrelTree(const char *mode);
void StoreBarrelTrack(AliTRDtrack *ps, Int_t refPlane, Int_t isIn);
- TFile *fBarrelFile;
- TTree *fBarrelTree;
- TClonesArray *fBarrelArray;
- AliBarrelTrack *fBarrelTrack;
+ TFile *fBarrelFile; // Some kind of barrel file
+ TTree *fBarrelTree; // And a barrel tree
+ TClonesArray *fBarrelArray; // Wow, there even an array for that barrel
+ AliBarrelTrack *fBarrelTrack; // And, finally, the track
+
+ private:
+
+ virtual void MakeSeeds(Int_t inner, Int_t outer, Int_t turn);
+ Int_t FollowProlongation(AliTRDtrack& t, Int_t rf);
+ Int_t FollowBackProlongation(AliTRDtrack& t);
+ Int_t Refit(AliTRDtrack& t, Int_t rf);
+
+ Int_t PropagateToTPC(AliTRDtrack& t);
+ Int_t PropagateToOuterPlane(AliTRDtrack& t, Double_t x);
+
+ void SetSY2corr(Float_t w) {fSY2corr = w;}
+ void SetSZ2corr(Float_t w) {fSZ2corr = w;}
+ Double_t ExpectedSigmaY2(Double_t r, Double_t tgl, Double_t pt) const;
+ Double_t ExpectedSigmaZ2(Double_t r, Double_t tgl) const;
ClassDef(AliTRDtracker,1) // manager base class