]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/AliTOFPIDResponse.cxx
Do not reset a zero pointer to MC info
[u/mrichter/AliRoot.git] / STEER / AliTOFPIDResponse.cxx
CommitLineData
10d100d4 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
16//-----------------------------------------------------------------//
17// //
18// Implementation of the TOF PID class //
19// Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch //
20// //
21//-----------------------------------------------------------------//
22
23#include "TMath.h"
24#include "AliLog.h"
25
26#include "AliTOFPIDResponse.h"
27
28ClassImp(AliTOFPIDResponse)
29
30//_________________________________________________________________________
31AliTOFPIDResponse::AliTOFPIDResponse():
32 fSigma(0),
33 fPmax(0), // zero at 0.5 GeV/c for pp
34 fTime0(0)
35{
36}
37//_________________________________________________________________________
38AliTOFPIDResponse::AliTOFPIDResponse(Double_t *param):
39 fSigma(param[0]),
40 fPmax(0), // zero at 0.5 GeV/c for pp
41 fTime0(0)
42{
43 //
44 // The main constructor
45 //
46 //
47
48 //fPmax=TMath::Exp(-0.5*3*3)/fSigma; // ~3 sigma at 0.5 GeV/c for PbPb
49}
50//_________________________________________________________________________
51Double_t
52AliTOFPIDResponse::GetMismatchProbability(Double_t p, Double_t mass) const {
53 //
54 // Returns the probability of mismatching
55 // assuming 1/(p*beta)^2 scaling
56 //
57 const Double_t km=0.5; // "reference" momentum (GeV/c)
58
59 Double_t ref2=km*km*km*km/(km*km + mass*mass);// "reference" (p*beta)^2
60 Double_t p2beta2=p*p*p*p/(p*p + mass*mass);
61
62 return fPmax*ref2/p2beta2;
63}
64//_________________________________________________________________________
65Double_t AliTOFPIDResponse::GetExpectedSigma(Float_t mom, Float_t time, Float_t mass) const {
66 //
67 // Return the expected sigma of the PID signal for the specified
68 // particle type.
69 // If the operation is not possible, return a negative value.
70 //
71
72 Double_t dpp = 0.01; //mean relative pt resolution;
73 if (mom>0.5) dpp = 0.01*mom;
74
75
76 Double_t sigma = dpp*time/(1.+ mom*mom/(mass*mass));
77
78 return TMath::Sqrt(sigma*sigma + fSigma*fSigma);
79}
80