]>
Commit | Line | Data |
---|---|---|
6255180c | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
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 | **************************************************************************/ | |
15 | ||
803d1ab0 | 16 | /* $Id$ */ |
6255180c | 17 | |
18 | #include "AliFastMuonTrackingRes.h" | |
19 | #include "AliMUONFastTracking.h" | |
20 | #include <TRandom.h> | |
21 | #include <TF1.h> | |
22 | ||
23 | ClassImp(AliFastMuonTrackingRes) | |
24 | ||
25 | ||
26 | AliFastMuonTrackingRes::AliFastMuonTrackingRes() : | |
27 | AliFastResponse("Resolution", "Muon Tracking Resolution") | |
28 | { | |
29 | SetBackground(); | |
30 | } | |
31 | ||
32 | void AliFastMuonTrackingRes::Init() | |
33 | { | |
34 | fFastTracking = AliMUONFastTracking::Instance(); | |
35 | fFastTracking->Init(fBackground); | |
36 | } | |
37 | ||
38 | ||
39 | ||
40 | void AliFastMuonTrackingRes::Evaluate(Float_t p, Float_t theta , Float_t phi, | |
41 | Float_t& pS, Float_t& thetaS, Float_t& phiS) | |
42 | { | |
43 | ||
44 | Double_t meanp = fFastTracking->MeanP (p, theta, phi, Int_t(fCharge)); | |
45 | Double_t sigmap = fFastTracking->SigmaP (p, theta, phi, Int_t(fCharge)); | |
46 | Double_t sigma1p = fFastTracking->Sigma1P(p, theta, phi, Int_t(fCharge)); | |
47 | Double_t normg2 = fFastTracking->NormG2 (p, theta, phi, Int_t(fCharge)); | |
48 | Double_t meang2 = fFastTracking->MeanG2 (p, theta, phi, Int_t(fCharge)); | |
49 | Double_t sigmag2 = fFastTracking->SigmaG2(p, theta, phi, Int_t(fCharge)); | |
50 | ||
51 | Int_t ip,itheta,iphi; | |
52 | TF1* fitp = fFastTracking->GetFitP(); | |
53 | ||
54 | fFastTracking->GetIpIthetaIphi(p, theta, phi, Int_t(fCharge), ip, itheta, iphi); | |
55 | if (sigmap == 0) { | |
56 | printf ("WARNING!!! sigmap=0: "); | |
57 | printf ("ip= %d itheta = %d iphi = %d ", ip, itheta, iphi); | |
58 | printf ("p= %f theta = %f phi = %f\n", p, theta, phi); | |
59 | } | |
60 | ||
61 | fitp->SetParameters(meanp,sigmap,sigma1p,normg2,meang2,sigmag2); | |
62 | ||
63 | Double_t meantheta = fFastTracking->MeanTheta (p, theta, phi, Int_t(fCharge)); | |
64 | Double_t sigmatheta = fFastTracking->SigmaTheta(p, theta, phi, Int_t(fCharge)); | |
65 | Double_t meanphi = fFastTracking->MeanPhi (p, theta, phi, Int_t(fCharge)); | |
66 | Double_t sigmaphi = fFastTracking->SigmaPhi (p, theta, phi, Int_t(fCharge)); | |
67 | ||
68 | // Components different from ip=0 have the RMS bigger than mean | |
69 | Float_t ptp[3] = { 1.219576,-0.354764,-0.690117 }; | |
70 | Float_t ptph[3] = { 0.977522, 0.016269, 0.023158 }; | |
71 | Float_t pphp[3] = { 1.303256,-0.464847,-0.869322 }; | |
72 | ||
73 | // Smeared momentum | |
74 | pS = p + fitp->GetRandom(); | |
75 | Float_t dp = pS - p; | |
76 | ||
77 | // Smeared phi | |
78 | if (ip==0) sigmaphi *= pphp[0] + pphp[1] * dp + pphp[2] * dp*dp; | |
79 | phiS = phi + gRandom->Gaus(meanphi, sigmaphi); | |
80 | Float_t dphi = phiS - phi; | |
81 | // Smeared theta | |
82 | if (ip==0) sigmatheta *= ptp[0] + ptp[1] * dp + ptp[2] * dp*dp; | |
83 | if (ip==0) sigmatheta *= ptph[0] + ptph[1] * dphi + ptph[2] * dphi*dphi; | |
84 | thetaS = theta + gRandom->Gaus(meantheta,sigmatheta); | |
85 | } | |
86 | ||
87 | ||
88 | ||
89 | ||
90 | ||
91 |