]>
Commit | Line | Data |
---|---|---|
ba15fdfb | 1 | /* Copyright(c) 1998-2009, ALICE Experiment at CERN, All rights reserved. * |
2 | * See cxx source for full Copyright notice */ | |
3 | ||
4 | //------------------------------------------------------------------------- | |
5 | // Class AliDielectronBtoJPSItoEle | |
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 "AliDielectronBtoJPSItoEleCDFfitFCN.h" | |
16 | #include "AliDielectronBtoJPSItoEleCDFfitHandler.h" | |
17 | #include "AliDielectronBtoJPSItoEle.h" | |
18 | #include "AliLog.h" | |
19 | ||
20 | ClassImp(AliDielectronBtoJPSItoEle) | |
21 | ||
22 | //_______________________________________________________________________________ | |
23 | AliDielectronBtoJPSItoEle::AliDielectronBtoJPSItoEle() : | |
24 | fFCNfunction(0), | |
5720c765 | 25 | fMCtemplate(0), |
26 | fResType("FF") | |
ba15fdfb | 27 | { |
28 | // | |
29 | // default constructor | |
30 | // | |
31 | } | |
32 | //___________________________________________________________________________________ | |
33 | AliDielectronBtoJPSItoEle::AliDielectronBtoJPSItoEle(const AliDielectronBtoJPSItoEle& source) : | |
34 | TNamed(source), | |
35 | fFCNfunction(source.fFCNfunction), | |
5720c765 | 36 | fMCtemplate(source.fMCtemplate), |
37 | fResType(source.fResType) | |
ba15fdfb | 38 | { |
39 | // | |
40 | // copy constructor | |
41 | // | |
42 | } | |
43 | //_________________________________________________________________________________________________ | |
44 | ||
45 | AliDielectronBtoJPSItoEle &AliDielectronBtoJPSItoEle::operator=(const AliDielectronBtoJPSItoEle& source) | |
46 | { | |
47 | // | |
48 | // assignment operator | |
49 | // | |
50 | if(&source == this) return *this; | |
51 | fFCNfunction = source.fFCNfunction; | |
ba15fdfb | 52 | fMCtemplate = source.fMCtemplate; |
53 | ||
54 | return *this; | |
55 | } | |
56 | //_________________________________________________________________________________________________ | |
57 | AliDielectronBtoJPSItoEle::~AliDielectronBtoJPSItoEle() | |
58 | { | |
59 | // | |
60 | // destructor | |
61 | // | |
62 | delete fFCNfunction; | |
63 | delete fMCtemplate; | |
64 | } | |
65 | //_________________________________________________________________________________________________ | |
5720c765 | 66 | Int_t AliDielectronBtoJPSItoEle::DoMinimization(Int_t step) |
ba15fdfb | 67 | { |
68 | // | |
69 | // performs the minimization | |
70 | // | |
5720c765 | 71 | Int_t iret=fFCNfunction->DoMinimization(step); |
ba15fdfb | 72 | |
73 | return iret; | |
74 | } | |
75 | //_________________________________________________________________________________________________ | |
bc7a3220 | 76 | void AliDielectronBtoJPSItoEle::ReadCandidates(TNtuple* nt, Double_t* &pseudoproper, Double_t* &invmass, Double_t* &pt, Int_t * &typeCand, Int_t& ncand, Double_t massLow, Double_t massUp, Double_t ptLow, Double_t ptUp) |
ba15fdfb | 77 | { |
78 | // | |
79 | // Read N-tuple with X and M values | |
80 | // | |
bc7a3220 | 81 | Float_t mJPSI = 0; Float_t x = 0; Float_t type = 0; Float_t transvMom = 0.; |
ba15fdfb | 82 | Int_t nentries = 0; |
83 | ncand=0; | |
5720c765 | 84 | TString arrType[] = {"SS","FS","FF"}; |
ba15fdfb | 85 | nt->SetBranchAddress("Mass",&mJPSI); |
86 | nt->SetBranchAddress("Xdecaytime",&x); | |
bc7a3220 | 87 | nt->SetBranchAddress("Pt",&transvMom); |
5720c765 | 88 | // |
89 | if(!nt->GetListOfBranches()->At(2)) {AliInfo("ERROR: branch with candidate type doesn't exist! \n"); return;} | |
90 | nt->SetBranchAddress("Type",&type); | |
91 | // | |
ba15fdfb | 92 | nentries = (Int_t)nt->GetEntries(); |
93 | pseudoproper = new Double_t[nentries]; | |
94 | invmass = new Double_t[nentries]; | |
bc7a3220 | 95 | pt = new Double_t[nentries]; |
5720c765 | 96 | typeCand = new Int_t[nentries]; |
97 | ||
ba15fdfb | 98 | for(Int_t i = 0; i < nentries; i++) { |
99 | nt->GetEntry(i); | |
5720c765 | 100 | if(!fResType.Contains(arrType[(Int_t)type])) continue; |
bc7a3220 | 101 | if(massUp > massLow && massLow > 0) { if(mJPSI < massLow || mJPSI >massUp) continue; } |
102 | if(ptUp > ptLow && ptLow > 0) { if(transvMom < ptLow || transvMom > ptUp) continue; } | |
5720c765 | 103 | pseudoproper[ncand]=(Double_t)x; |
104 | invmass[ncand]=(Double_t)mJPSI; | |
bc7a3220 | 105 | pt[ncand]=(Double_t)transvMom; |
5720c765 | 106 | typeCand[ncand] = (Int_t)type; |
ba15fdfb | 107 | ncand++; |
5720c765 | 108 | } |
ba15fdfb | 109 | return; |
110 | } | |
111 | //_________________________________________________________________________________________________ | |
112 | void AliDielectronBtoJPSItoEle::SetCsiMC() | |
113 | { | |
114 | // | |
115 | // Sets X distribution used as MC template for JPSI from B | |
116 | // | |
117 | fFCNfunction->LikelihoodPointer()->SetCsiMC(fMCtemplate); | |
118 | ||
119 | return; | |
120 | } | |
121 | //_________________________________________________________________________________________________ | |
bc7a3220 | 122 | void AliDielectronBtoJPSItoEle::SetFitHandler(Double_t* x /*pseudoproper*/, Double_t* m /*inv mass*/, Double_t* pt /*pt*/, Int_t* type /*type*/, Int_t ncand /*candidates*/) |
ba15fdfb | 123 | { |
124 | // | |
125 | // Create the fit handler object to play with different params of the fitting function | |
126 | // | |
127 | ||
bc7a3220 | 128 | fFCNfunction = new AliDielectronBtoJPSItoEleCDFfitHandler(x,m,pt,type,ncand); |
ba15fdfb | 129 | if(!fFCNfunction) { |
130 | ||
131 | AliInfo("fFCNfunction not istanziated ---> nothing done"); | |
132 | return; | |
133 | ||
134 | } | |
135 | } |