/[PAMELA software]/PamCut/TrkCuts/TrkDedxHeCut/TrkDedxHeCut.cpp
ViewVC logotype

Annotation of /PamCut/TrkCuts/TrkDedxHeCut/TrkDedxHeCut.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations) (download)
Wed Jun 10 12:37:57 2009 UTC (15 years, 6 months ago) by pam-fi
Branch: MAIN
Added to repository.

1 pam-fi 1.1 /*
2     * TrkDedxHeCut.cpp
3     *
4     * Created on: 19-may-2009
5     * Author: N. Nikonov
6     */
7    
8     /*! @file TrkDedxHeCut.cpp The TrkDedxHeCut class implementation file. */
9    
10     #include "TrkDedxHeCut.h"
11    
12     int TrkDedxHeCut::Check(PamLevel2 *event) {
13    
14     TrkTrack* trk2 = event->GetTrack(0)->GetTrkTrack();
15     Double_t rig = trk2->GetRigidity();
16     Double_t dedxtr = trk2->GetDEDX();
17    
18     #ifdef DEBUGPAMCUT
19     h_dedx_rig_before->Fill(rig, dedxtr);
20     #endif
21    
22     if ( !CutHeDEDXrig(rig,dedxtr,1.15,_cuthededxrig) ||
23     CutHeDEDXrig(rig,dedxtr,0.5,_cuthededxrig)) return 0;
24    
25     #ifdef DEBUGPAMCUT
26     h_dedx_rig_after->Fill(rig, dedxtr);
27     #endif
28    
29     return CUTOK;
30     }
31    
32    
33     TF1* TrkDedxHeCut::BBbetagamma(Float_t m_GeV, Float_t z, Int_t Z, Float_t A, Float_t I_eV, Double_t xmin, Double_t xmax, Float_t C_positive, Float_t a, Float_t m, Float_t x0, Float_t x1, Float_t scale)
34     {
35     TF1* f;
36     if(C_positive != 0.) {
37     // do density correction
38     // x<x_0 ( delta = 0)
39     // I don't need a function in this range
40     // x0<x<x1
41     // I build the function as a string.
42     TString delta2 = "(4.6052*log([1]*x/[0])/log(10)-[5]+[6]*pow(([9]-log([1]*x/[0])/log(10)),[7])) * (([8] <= log([1]*x/[0])) && ( log([1]*x/[0])/log(10) < [9] ) )";
43     // x>x1
44     TString delta3 = "(4.6052*log([1]*x/[0])/log(10)-[5]) * (log([1]*x/[0])/log(10) >= [9])";
45    
46     TString fstring = "[10]*(.3071 * ([2]/[3]) * [1]^2 / ([0]^2/([1]*x)^2+1)^-1 * ( 1./2 * log( (2 * 511e3 * ([1]*x/[0])^2 )^2 ) - log([4]) - ([0]^2/([1]*x)^2+1)^-1 - (";
47     fstring += delta2.Data();
48     fstring += "+";
49     fstring += delta3.Data();
50     fstring += ")/2))";
51     f = new TF1("bethebloch", fstring.Data());
52     }
53     else
54     f = new TF1("bethebloch", ".3071 * ([2]/[3]) * [1]^2 / ([0]^2/([1]*x)^2+1)^-1 * ( 1./2 * log( (2 * 511e3 * ([1]*x/[0])^2 )^2 ) - log([4]) - ([0]^2/([1]*x)^2+1)^-1)");
55     f->SetParameters(m_GeV, z, Z, A, I_eV, C_positive, a, m, x0, x1,scale);
56    
57     return f;
58     }
59    
60    
61     Bool_t TrkDedxHeCut::CutHeDEDXrig(Float_t rig, Float_t dedx,
62     Float_t factor, TF1* _cuthededxrig){
63     if(factor != 1.) dedx = dedx*factor;
64     if(rig < 0.2) return kFALSE;
65     if(dedx > 0.55*_cuthededxrig->Eval(rig)) return kTRUE;
66     else return kFALSE;
67     }

  ViewVC Help
Powered by ViewVC 1.1.23