00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062 #include "StDedxPidTraits.h"
00063 #include "StBichsel/Bichsel.h"
00064 #include "TMath.h"
00065 #include "Stiostream.h"
00066 ClassImp(StDedxPidTraits)
00067
00068 static const char rcsid[] = "$Id: StDedxPidTraits.cxx,v 2.16 2012/04/29 22:51:18 fisyak Exp $";
00069
00070 Float_t StDedxPidTraits::mean() const {
00071 #ifdef P03ia
00072 static const Int_t N70 = 6;
00073 static const Double_t T70[N70] = {
00074 -1.55822e+01,
00075 2.15621e+01,
00076 -1.24423e+01,
00077 3.68329e+00,
00078 -5.50226e-01,
00079 3.27863e-02
00080 };
00081 Float_t dEdx = mDedx;
00082 if (method() == kTruncatedMeanId) {
00083 Double_t x = TMath::Log(length());
00084 Double_t Corr = T70[N70-1]; for (int i = N70-2; i >= 0; i--) Corr = Corr*x + T70[i];
00085 dEdx *= TMath::Exp(-Corr);
00086 }
00087 return dEdx;
00088 #else
00089 return mDedx;
00090 #endif
00091 }
00092
00093 float
00094 StDedxPidTraits::errorOnMean() const {
00095 #ifndef P03ia
00096 return mSigma;
00097 #else
00098 static const Int_t N70 = 6;
00099 static const Double_t T70[N70] = {
00100 1.06856e+01,
00101 -1.52626e+01,
00102 8.62097e+00,
00103 -2.37276e+00,
00104 3.17727e-01,
00105 -1.65739e-02,
00106 };
00107 Float_t Sigma;
00108 if (method() == kTruncatedMeanId) {
00109 Double_t x = TMath::Log(length());
00110 Double_t Corr = T70[N70-1]; for (int i = N70-2; i >= 0; i--) Corr = Corr*x + T70[i];
00111 Sigma = Corr;
00112 return Sigma;
00113 }
00114 else return mSigma;
00115 #endif
00116 }
00117
00118 short
00119 StDedxPidTraits::encodedMethod() const { return mMethod; }
00120
00121 StDedxMethod
00122 StDedxPidTraits::method() const
00123 {
00124 switch (mMethod) {
00125 case kTruncatedMeanId:
00126 return kTruncatedMeanId;
00127 break;
00128 case kEnsembleTruncatedMeanId:
00129 return kEnsembleTruncatedMeanId;
00130 break;
00131 case kLikelihoodFitId:
00132 return kLikelihoodFitId;
00133 break;
00134 case kWeightedTruncatedMeanId:
00135 return kWeightedTruncatedMeanId;
00136 break;
00137 case kOtherMethodId:
00138 return kOtherMethodId;
00139 break;
00140 default:
00141 return kUndefinedMethodId;
00142 break;
00143 }
00144 }
00145
00146 void StDedxPidTraits::Print(Option_t *opt) const {
00147 cout << "StDedxPidTraits : \t method" << method()
00148 << "\t encodedMethod : " << encodedMethod()
00149 << "\t numberOfPoints : " << numberOfPoints()
00150 << "\t length : " << length()
00151 << "\t mean : " << mean()
00152 << "\t errorOnMean : " << errorOnMean()
00153 << "\t Log2<dX> : " << log2dX() << endl;
00154
00155 }
00156