]>
Commit | Line | Data |
---|---|---|
7b54a483 | 1 | /* Copyright(c) 1998-2009, ALICE Experiment at CERN, All rights reserved. * |
2 | * See cxx source for full Copyright notice */ | |
3 | ||
4 | //------------------------------------------------------------------------- | |
5 | // Class AliAnalysisBtoJPSItoEle | |
6 | // Unbinned log-likelihood fit analysis class | |
7 | // | |
8 | // Origin: C.Di Giglio | |
9 | // Contact: Carmelo.Digiglio@ba.infn.it , giuseppe.bruno@ba.infn.it | |
10 | //------------------------------------------------------------------------- | |
11 | class TH1F ; | |
12 | #include "TNtuple.h" | |
13 | #include "TMath.h" | |
14 | ||
15 | #include "AliBtoJPSItoEleCDFfitFCN.h" | |
16 | #include "AliBtoJPSItoEleCDFfitHandler.h" | |
17 | #include "AliAnalysisBtoJPSItoEle.h" | |
18 | #include "AliLog.h" | |
19 | ||
20 | ClassImp(AliAnalysisBtoJPSItoEle) | |
21 | ||
22 | //_______________________________________________________________________________ | |
23 | AliAnalysisBtoJPSItoEle::AliAnalysisBtoJPSItoEle() : | |
24 | fFCNfunction(0), | |
25 | fPtBin(0), | |
26 | fMCtemplate(0) | |
27 | { | |
28 | // | |
29 | // default constructor | |
30 | // | |
31 | } | |
32 | //___________________________________________________________________________________ | |
33 | AliAnalysisBtoJPSItoEle::AliAnalysisBtoJPSItoEle(const AliAnalysisBtoJPSItoEle& source) : | |
34 | TNamed(source), | |
35 | fFCNfunction(source.fFCNfunction), | |
36 | fPtBin(source.fPtBin), | |
37 | fMCtemplate(source.fMCtemplate) | |
38 | { | |
39 | // | |
40 | // copy constructor | |
41 | // | |
42 | } | |
43 | //_________________________________________________________________________________________________ | |
44 | ||
45 | AliAnalysisBtoJPSItoEle &AliAnalysisBtoJPSItoEle::operator=(const AliAnalysisBtoJPSItoEle& source) | |
46 | { | |
47 | // | |
48 | // assignment operator | |
49 | // | |
50 | if(&source == this) return *this; | |
51 | fFCNfunction = source.fFCNfunction; | |
52 | fPtBin = source.fPtBin; | |
53 | fMCtemplate = source.fMCtemplate; | |
54 | ||
55 | return *this; | |
56 | } | |
57 | //_________________________________________________________________________________________________ | |
58 | AliAnalysisBtoJPSItoEle::~AliAnalysisBtoJPSItoEle() | |
59 | { | |
60 | // | |
61 | // destructor | |
62 | // | |
63 | delete fFCNfunction; | |
64 | delete fMCtemplate; | |
65 | } | |
66 | //_________________________________________________________________________________________________ | |
f9fd1412 | 67 | Int_t AliAnalysisBtoJPSItoEle::DoMinimization() |
7b54a483 | 68 | { |
69 | // | |
70 | // performs the minimization | |
71 | // | |
7b54a483 | 72 | Int_t iret=fFCNfunction->DoMinimization(); |
73 | ||
74 | return iret; | |
75 | } | |
76 | //_________________________________________________________________________________________________ | |
7b54a483 | 77 | void AliAnalysisBtoJPSItoEle::ReadCandidates(TNtuple* nt, Double_t* &pseudoproper,Double_t* &invmass, Int_t& ncand) |
78 | { | |
79 | // | |
80 | // Read N-tuple with X and M values | |
81 | // | |
82 | Float_t mJPSI = 0; Float_t x = 0; | |
83 | Int_t nentries = 0; | |
84 | ncand=0; | |
85 | nt->SetBranchAddress("Mass",&mJPSI); | |
86 | nt->SetBranchAddress("Xdecaytime",&x); | |
87 | nentries = (Int_t)nt->GetEntries(); | |
88 | pseudoproper = new Double_t[nentries]; | |
89 | invmass = new Double_t[nentries]; | |
90 | for(Int_t i = 0; i < nentries; i++) { | |
91 | nt->GetEntry(i); | |
92 | ncand++; | |
93 | pseudoproper[i]=(Double_t)(10000*x); | |
94 | invmass[i]=(Double_t)mJPSI; | |
95 | } | |
96 | ||
97 | return; | |
98 | } | |
99 | //_________________________________________________________________________________________________ | |
f9fd1412 | 100 | void AliAnalysisBtoJPSItoEle::SetCsiMC() |
7b54a483 | 101 | { |
102 | // | |
103 | // Sets X distribution used as MC template for JPSI from B | |
104 | // | |
f9fd1412 | 105 | fFCNfunction->LikelihoodPointer()->SetCsiMC(fMCtemplate); |
7b54a483 | 106 | |
107 | return; | |
108 | } | |
109 | //_________________________________________________________________________________________________ | |
f9fd1412 | 110 | void AliAnalysisBtoJPSItoEle::SetFitHandler(Double_t* x /*pseudoproper*/, Double_t* m /*inv mass*/, Int_t ncand /*candidates*/) |
111 | { | |
112 | // | |
113 | // Create the fit handler object to play with different params of the fitting function | |
114 | // | |
115 | ||
116 | fFCNfunction = new AliBtoJPSItoEleCDFfitHandler(x,m,ncand); | |
117 | if(!fFCNfunction) { | |
118 | ||
119 | AliInfo("fFCNfunction not istanziated ---> nothing done"); | |
120 | return; | |
121 | ||
122 | } | |
123 | } |