]> git.uio.no Git - u/mrichter/AliRoot.git/blob - FASTSIM/AliMUONFastTracking.h
fix for bug #66294
[u/mrichter/AliRoot.git] / FASTSIM / AliMUONFastTracking.h
1 #ifndef ALIMUONFASTTRACKING_H
2 #define ALIMUONFASTTRACKING_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /* $Id$ */
7
8 //-------------------------------------------------------------------------
9 //        Class AliMUONFastTracking 
10 //
11 //  Manager for the fast simulation of tracking in the muon spectrometer
12 //  This class reads the lookup tables containing the parameterization 
13 //  of the deltap, deltatheta, deltaphi for different background levels
14 //  and provides the related smeared parameters   
15 //-------------------------------------------------------------------------
16
17 class TF1;
18 class TSpline3;
19 class TFile;
20 class AliMUONFastTrackingEntry;
21
22
23 #include <TObject.h>
24
25 enum LUTClusterType {kOld, kNew};
26
27 class AliMUONFastTracking :  public TObject {
28  public:
29     static  AliMUONFastTracking* Instance();
30     ~AliMUONFastTracking(){;}
31     void Init(Float_t bkg);
32     void ReadLUT(TFile *file);
33     void GetBinning(Int_t &nbinp, Float_t &pmin, Float_t &pmax,
34                     Int_t &nbintheta, Float_t &thetamin, Float_t &thetamax,
35                     Int_t &nbinphi, Float_t &phimin, Float_t &phimax) const;
36     void GetIpIthetaIphi(Float_t p, Float_t theta, Float_t phi, Int_t charge,
37                          Int_t &ip, Int_t &itheta, Int_t &iphi) const;
38     void GetSplit(Int_t ip, Int_t itheta, Int_t &nSplitP, Int_t &nSplitTheta) const;
39     Float_t Efficiency(Float_t p, Float_t theta, Float_t phi, Int_t charge);
40     Float_t Acceptance(Float_t p, Float_t theta, Float_t phi, Int_t charge); 
41     Float_t MeanP(Float_t p, Float_t theta, Float_t phi, Int_t charge)     const;
42     Float_t SigmaP(Float_t p, Float_t theta, Float_t phi, Int_t charge)    const;
43     Float_t Sigma1P(Float_t p, Float_t theta, Float_t phi, Int_t charge)   const;
44     Float_t NormG2(Float_t p, Float_t theta, Float_t phi, Int_t charge)    const;
45     Float_t MeanG2(Float_t p, Float_t theta, Float_t phi, Int_t charge)    const;
46     Float_t SigmaG2(Float_t p, Float_t theta, Float_t phi, Int_t charge)   const;
47     Float_t MeanTheta(Float_t p, Float_t theta, Float_t phi, Int_t charge) const;
48     Float_t SigmaTheta(Float_t p, Float_t theta, Float_t phi, Int_t charge)const;  
49     Float_t MeanPhi(Float_t p, Float_t theta, Float_t phi, Int_t charge)   const;
50     Float_t SigmaPhi(Float_t p, Float_t theta, Float_t phi, Int_t charge);
51
52     void SetSpline();
53     Float_t GetBackground() const {return fBkg;}
54     void SetLUTClusterFinder(LUTClusterType clusterFinder) { fClusterFinder = clusterFinder;}
55     void SetBackground(Float_t bkg);
56     void UseSpline (Int_t splineSwitch=1) {fSpline = splineSwitch;}
57     TF1* GetFitP(Int_t ip, Int_t itheta, Int_t iphi); 
58  protected:
59     Int_t   fNbinp;         // n. of momentum bins in the lookup table 
60     Float_t fPmin;          // min. value of momentum parameterized in LUT
61     Float_t fPmax;          // max. value of momentum parameterized in LUT
62     Float_t fDeltaP;        // momentum bin width 
63     Int_t   fNbintheta;     // n. of theta bins in the lookup table 
64     Float_t fThetamin;      // min. value of theta parameterized in LUT
65     Float_t fThetamax;      // max. value of theta parameterized in LUT
66     Float_t fDeltaTheta;    // theta bin width
67     Int_t   fNbinphi;       // n. of phi bins in the lookup table 
68     Float_t fPhimin;        // min. value of phi parameterized in LUT
69     Float_t fPhimax;        // min. value of phi parameterized in LUT
70     Float_t fDeltaPhi;      // phi bin width
71     Int_t   fPrintLevel;    // level of information printed for debugging
72     Float_t fBkg;           // soft background level  
73     TF1 *fFitp[20][20][20];                    // func for psmear-pgen distr
74     AliMUONFastTrackingEntry *fEntry[20][20][20][4]; // array of LUT parameters
75     AliMUONFastTrackingEntry *fCurrentEntry[20][20][20]; // array of LUT parameters
76     TSpline3 *fSplineEff[200][3];        // spline funcs for efficiency
77     TSpline3 *fSplineAcc[200][3];        // spline funcs for acceptance
78     TSpline3 *fSplineSigmap[200][3];     // spl.funcs for dp distribution width
79     TSpline3 *fSplineSigma1p[200][3];    // spl.funcs for dp distr. width correction (see function FitP)
80     TSpline3 *fSplineSigmatheta[200][3]; // spl.funcs for dtheta distr. width
81     TSpline3 *fSplineSigmaphi[200][3];   // spl.funcs for dphi distr. width
82     Int_t fSpline;                       // switches on/off the use of spline
83     LUTClusterType fClusterFinder;       // type of cluster finder (old/new)
84     static AliMUONFastTracking*    fgMUONFastTracking; //!Pointer to single instance
85     ClassDef(AliMUONFastTracking,1)      // Fast MUON Tracking Data Handler
86  private:
87     AliMUONFastTracking();
88     AliMUONFastTracking(Float_t /*bkg*/);
89     AliMUONFastTracking(const AliMUONFastTracking &ft);
90     void Copy(TObject &) const;
91     AliMUONFastTracking& operator=(const AliMUONFastTracking & rhs);
92 };
93
94 #endif
95