1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
16 /// \class AliTPCCombinedTrackfit
17 /// \brief Combine cosmic track pairs (upper, lower) and do track fitting.
23 /// fCombinedTrackfit = new AliTPCCombinedTrackfit(debuglevel, "anystring");
25 /// //order not important; will be internally ordered (potinters modified due to &) such that track0 is the upper one
26 /// //kfit = kTRUE: good fit, kFALSE: bad fit
27 /// const Bool_t kfit = fCombinedTrackfit->CombineESDtracks(esdtrack0, esdtrack1);
29 /// //status = 0 for good fit (i.e. kfit=kTRUE), non-0 for bad fit (i.e. kfit=kFALSE), see "enum CombineStatus" definition in header file
30 /// const Int_t status = fCombinedTrackfit->GetStatus();
32 /// //in Analysis Task write when terminate
33 /// fCombinedTrackfit->GetStreamer()->GetFile()->Write();
39 /// For (debuglevel & 1)==1 && good fit, the following info saved:
43 /// (*fStreamer)<<"TrackProp"<<
44 /// "Tup.="<<fTrackparUp<< //AliExternalTrackParam at uppermost cluster obtained by upward propagation
45 /// "Tlow.="<<fTrackparLow<< //AliExternalTrackParam at lowermost cluster obtained by downward propagation
46 /// "icup.="<<&fInnerClusterUp<< //TVector3 position of the innermost cluster of the upper track
47 /// "iclow.="<<&fInnerClusterLow<<
48 /// "leverarm="<<fLeverArm<<
49 /// "ncl="<<fFitNcls<< //number of clusters used in successful propagation
50 /// "nmiss="<<fMissNcls<< //number of clusters failed in propagation, should always be 0 in this case.
51 /// "chi2="<<fPreChi2<< //chi2/nfit
52 /// "momup="<< momup << //momentum at uppermost cluster with upward propagation
53 /// "momlow="<< momlow << //momentum at lowermost cluster with downward propagation
55 /// "ptlow="<< ptlow <<
59 /// For (debuglevel & 2)==1, debug info in `AliTPCCosmicUtils::FitKernel` saved
64 /// For 2011 Feb. cosmic data nch=2 events, the kfit and status look like:
67 /// kfit,status ( 0, 1): 68939 / 2611959 = 2.639% //kFailGetTPCseeds
68 /// kfit,status ( 0, 2): 14886 / 2611959 = 0.570% //not both tracks have ncl > AliTPCCosmicUtils::fgkNclsMin
69 /// kfit,status ( 0, 3): 53185 / 2611959 = 2.036% //clusters in two tracks should be clearly separated in y, i.e. lowest cluster of upper track higher than highest cluster of lower track; otherwise fail
70 /// kfit,status ( 0, 4): 39841 / 2611959 = 1.525% //fLeverArm<fgkCutLeverArm
71 /// kfit,status ( 0, 6): 12933 / 2611959 = 0.495% //fail in propagation of at least one cluster
72 /// kfit,status ( 0, 7): 19994 / 2611959 = 0.765% //chi2/nfit > fgkMaxChi2
73 /// kfit,status ( 1, 0): 2402181 / 2611959 = 91.969% //i.e. 92% of nch=2 events are successfully fitted.
79 /// For muon momentum small than 20 GeV, energy loss in muon filter is visable when compaing fTrackparUp and fTrackparLow; energy loss estimated as 5 MeV/cm.
80 /// Particle traversing muon filter can be rejected by requiring `fInnerClusterUp.fZ > -40 && fInnerClusterLow.fZ > -40`
81 /// Momentum resolution is estimated by comparing the trackfit result by upward propagation through odd pad rows and that by downward propagation through even pad rows. Number of clusters used in this case is only half of that in normal usage.
82 /// RMS of log10 p = 0.01 at 10 GeV/c, 0.1 at 100 GeV/c, 0.5 at 1 TeV/c.
83 /// Muon filter deteriorates momentum resolution by about +0.01 (absolute value).
85 /// \author Xianguo Lu <lu@physi.uni-heidelberg.de>
89 const Double_t _TPCZMIN = -250;
90 const Double_t _TPCZMAX = 250;
91 const Double_t _TPCINR = 84.8;
92 const Double_t _TPCOUR = 246.6;
95 #ifndef ALITPCCOMBINEDTRACKFIT_H
96 #define ALITPCCOMBINEDTRACKFIT_H
98 class TTreeSRedirector;
100 class AliTPCCombinedTrackfit
103 AliTPCCombinedTrackfit(const Int_t dlev=0, const TString tag="test");
105 ~AliTPCCombinedTrackfit();
107 Bool_t CombineESDtracks(AliESDtrack * &trk0, AliESDtrack *&trk1);
108 Bool_t CombineTPCseeds(AliTPCseed * &seed0, AliTPCseed *&seed1);
110 //--------- getters ------------
112 Int_t GetStatus()const{return fStatus;}
113 Int_t GetFitNcls()const{return fFitNcls;}
114 Int_t GetMissNcls()const{return fMissNcls;}
115 Double_t GetChi2PerCluster()const{return fPreChi2;}
116 Double_t GetLeverArm()const {return fLeverArm;}
117 TVector3 GetInnerClusterUp()const {return fInnerClusterUp;}
118 TVector3 GetInnerClusterLow()const {return fInnerClusterLow;}
119 Double_t ImpactParameter() const;
120 Double_t MinPhi()const;
122 AliExternalTrackParam * GetTrackParamUp() const {return fTrackparUp;}
123 AliExternalTrackParam * GetTrackParamLow() const {return fTrackparLow;}
124 AliTPCseed * GetTPCseedUp() const {return fSeedUp;}
125 AliTPCseed * GetTPCseedLow() const {return fSeedLow;}
127 TTreeSRedirector * GetStreamer() const {return fStreamer;}
140 AliTPCCombinedTrackfit(const AliTPCCombinedTrackfit & p);
141 AliTPCCombinedTrackfit & operator=(const AliTPCCombinedTrackfit & p);
143 void IniCombineESDtracks();
144 Bool_t GetTPCseeds(const AliESDtrack *trk0, const AliESDtrack *trk1);
146 Bool_t CheckLeverArm();
147 Bool_t AnaSeeds(Bool_t &kswap);
149 void CombineTPCseeds(Bool_t &kswap);
152 TTreeSRedirector *fStreamer; //!< debug streamer
153 Int_t fDebugLevel; ///< debug level
155 AliTPCseed * fSeedUp; ///< TPC seed of upper track
156 AliTPCseed * fSeedLow; ///< TPC seed of lower track
157 AliExternalTrackParam * fTrackparUp; ///< track param of upper track
158 AliExternalTrackParam * fTrackparLow; ///< track param of lower track
160 Int_t fStatus; ///< status for CombineESDtracks/CombineTPCseeds: 0-successful, otherwise fail
162 TVector3 fInnerClusterUp; ///< xyz of the inner most TPC trackpoint of the Upper track
163 TVector3 fInnerClusterLow; ///< xyz of the inner most TPC trackpoint of the Lower track
164 Double_t fLeverArm; ///< transverse difference between upper most and lower most clusters
166 Int_t fFitNcls; ///< number of TPC clusters successful in propagation (mean of the two propagation: upwards and downwards)
167 Int_t fMissNcls; ///< number of TPC clusters fail in propagation (sum of the two propagation)
168 Double_t fPreChi2; ///< Predicted chi2/nfit over the two propagation
170 static const Double_t fgkCutLeverArm = 350; ///< minimum lever arm 350 ~ 250 * sqrt(2)
171 static const Double_t fgkMaxChi2 = 10; ///< max. chi2/ncls