2 // Class AliRsnCutBetheBloch
4 // General implementation of a single cut strategy, which can be:
5 // - a value contained in a given interval [--> IsBetween() ]
6 // - a value equal to a given reference [--> MatchesValue()]
8 // In all cases, the reference value(s) is (are) given as data members
9 // and each kind of cut requires a given value type (Int, UInt, Double),
10 // but the cut check procedure is then automatized and chosen thanks to
11 // an enumeration of the implemented cut types.
12 // At the end, the user (or any other point which uses this object) has
13 // to use the method IsSelected() to check if this cut has been passed.
15 // authors: Martin Vala (martin.vala@cern.ch)
16 // Alberto Pulvirenti (alberto.pulvirenti@ct.infn.it)
21 #include "AliESDtrack.h"
23 #include "AliRsnDaughter.h"
24 #include "AliRsnCutBetheBloch.h"
26 ClassImp(AliRsnCutBetheBloch)
28 //_________________________________________________________________________________________________
29 AliRsnCutBetheBloch::AliRsnCutBetheBloch() :
36 // Default constructor.
39 fConst[0] = fConst[1] = fConst[2] = fConst[3] = fConst[4] = 0.0;
42 //_________________________________________________________________________________________________
43 AliRsnCutBetheBloch::AliRsnCutBetheBloch
44 (const char *name, Double_t fractionRange, Double_t mass, Double_t mip, Bool_t correct) :
45 AliRsnCut(name, -fractionRange, fractionRange),
52 // the cut range is the relative fraction of the value:
53 // BB*(1-fraction) < TPC < BB*(1+fraction)
55 // -fraction < (TPC - BB)/BB < fraction
58 fConst[0] = fConst[1] = fConst[2] = fConst[3] = fConst[4] = 0.0;
61 //_________________________________________________________________________________________________
62 AliRsnCutBetheBloch::AliRsnCutBetheBloch
63 (const char *name, Double_t fractionRange, AliPID::EParticleType type, Double_t mip, Bool_t correct) :
64 AliRsnCut(name, -fractionRange, fractionRange),
71 // the cut range is the relative fraction of the value:
72 // BB*(1-fraction) < TPC < BB*(1+fraction)
74 // -fraction < (TPC - BB)/BB < fraction
78 fConst[0] = fConst[1] = fConst[2] = fConst[3] = fConst[4] = 0.0;
81 //_____________________________________________________________________________
82 Double_t AliRsnCutBetheBloch::BetheBloch(AliRsnDaughter *track)
85 // Computes the theoretical dE/dx according to
86 // a given mass hypothesis, from which betaGamma is computed
88 // This is the empirical ALEPH parameterization of the Bethe-Bloch formula.
89 // It is normalized to 1 at the minimum.
91 // The default values for the kp* parameters are for ALICE TPC.
92 // The value is computed in MIP units, multiplied by 50 to have it in energy.
95 Double_t betaGamma = track->P() / fMass;
96 Double_t beta = betaGamma / TMath::Sqrt(1.0 + betaGamma * betaGamma);
97 Double_t aa = TMath::Power(beta, fConst[3]);
98 Double_t bb = TMath::Power(1.0 / betaGamma, fConst[4]);
100 bb = TMath::Log(fConst[2] + bb);
102 Double_t out = (fConst[1] - aa - bb) * fConst[0] / aa;
106 Double_t kMeanCorr = 0.1;
107 Double_t meanCorr = (1 + (out - 1) * kMeanCorr);
114 //_________________________________________________________________________________________________
115 Bool_t AliRsnCutBetheBloch::IsSelected(ETarget tgt, AliRsnDaughter *track)
122 if (tgt != AliRsnCut::kParticle)
124 AliError(Form("Wrong target. Skipping cut", GetName()));
128 // retrieve the TPC signal
129 AliVParticle *vpart = track->GetRef();
130 AliESDtrack *esd = dynamic_cast<AliESDtrack*>(vpart);
132 AliError("ESD information unavailable");
136 // compute Bethe-Bloch with the given mass hypothesis
137 Double_t bb = BetheBloch(track);
139 // the cut range is the relative fraction of the value:
140 // BB*(1-fraction) < TPC < BB*(1+fraction)
142 // -fraction < (TPC - BB)/BB < fraction
143 // so we must compute the cut value accordingly
144 fCutValueD = (esd->GetTPCsignal() - bb) / bb;
146 // then, this cut is checked inside the range
150 //_________________________________________________________________________________________________
151 Bool_t AliRsnCutBetheBloch::IsSelected(ETarget tgt, AliRsnPairParticle *pair)
157 AliWarning("Cannot apply this cut to pairs");
161 //_________________________________________________________________________________________________
162 Bool_t AliRsnCutBetheBloch::IsSelected(ETarget tgt, AliRsnEvent *event)
168 AliWarning("Cannot apply this cut to events");
172 //_________________________________________________________________________________________________
173 Bool_t AliRsnCutBetheBloch::IsSelected(ETarget tgt, AliRsnEvent *ev1, AliRsnEvent *ev2)
179 AliWarning("Cannot apply this cut to event mixing");