]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG3/vertexingHF/AliHFPtSpectrum.h
Adding interface to manipulate with TGeoMatrixes.
[u/mrichter/AliRoot.git] / PWG3 / vertexingHF / AliHFPtSpectrum.h
CommitLineData
65e55bbd 1#ifndef ALIHFPTSPECTRUM_H
2#define ALIHFPTSPECTRUM_H
3
4/* Copyright(c) 1998-2010, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
6
7//***********************************************************************
8// Class AliHFPtSpectrum
9// Base class for feed-down corrections on heavy-flavour decays
10// computes the cross-section via one of the three implemented methods:
11// 0) Consider no feed-down prediction
12// 1) Subtract the feed-down with the "fc" method
13// Yield = Reco * fc; where fc = 1 / ( 1 + (eff_b/eff_c)*(N_b/N_c) ) ;
14// 2) Subtract the feed-down with the "Nb" method
15// Yield = Reco - Feed-down (exact formula on the function implementation)
16//
17// Author: Z.Conesa, zconesa@in2p3.fr
18//***********************************************************************
19
20#include "TNamed.h"
21#include "TH1.h"
22#include "TGraphAsymmErrors.h"
23
24class AliHFPtSpectrum: public TNamed
25{
26
27 public:
28
29 // Constructor
30 AliHFPtSpectrum(const char* name="AliHFPtSpectrum", const char* title="HF feed down correction class", Int_t option=1);
31 // Copy constructor
32 AliHFPtSpectrum(const AliHFPtSpectrum &rhs);
33 // Assignment operator
34 AliHFPtSpectrum& operator=(const AliHFPtSpectrum &source);
35 // Destructor
36 virtual ~AliHFPtSpectrum();
37
38 //
39 // Setters
40 //
41 // Set the theoretical direct & feeddown pt spectrum
42 void SetMCptSpectra(TH1 *hDirect, TH1 *hFeedDown);
43 // Set the theoretical feeddown pt spectrum
44 void SetFeedDownMCptSpectra(TH1 *hFeedDown);
45 // Set the theoretical direct & feeddown pt spectrum upper and lower bounds
46 void SetMCptDistributionsBounds(TH1 *hDirectMax, TH1 *hDirectMin, TH1 *hFeedDownMax, TH1 *hFeedDownMin);
47 // Set the theoretical feeddown pt spectrum upper and lower bounds
48 void SetFeedDownMCptDistributionsBounds(TH1 *hFeedDownMax, TH1 *hFeedDownMin);
49 // Set the acceptance and efficiency corrections for direct
50 void SetDirectAccEffCorrection(TH1 *hDirectEff);
51 // Set the acceptance and efficiency corrections for direct & feeddown
52 void SetAccEffCorrection(TH1 *hDirectEff, TH1 *hFeedDownEff);
53 // Set the reconstructed spectrum
54 void SetReconstructedSpectrum(TH1 *hRec);
55 // Set the calculation option flag for feed-down correction: 0=none, 1=fc , 2=Nb
56 void SetFeedDownCalculationOption(Int_t option){ fFeedDownOption = option; }
57 // Set if the calculation has to consider asymmetric uncertaInt_ties or not
58 void SetComputeAsymmetricUncertainties(bool flag){ fAsymUncertainties = flag; }
59 // Set the luminosity and its uncertainty
60 void SetLuminosity(Double_t luminosity, Double_t unc){
61 fLuminosity[0]=luminosity; fLuminosity[1]=unc;
62 }
63 // Set the trigger efficiency and its uncertainty
64 void SetTriggerEfficiency(Double_t efficiency, Double_t unc){
65 fTrigEfficiency[0]=efficiency; fTrigEfficiency[1]=unc;
66 }
67
68 //
69 // Getters
70 //
71 // Return the TGraphAsymmErrors of the feed-down correction
72 TGraphAsymmErrors * GetFeedDownCorrection_fc() { return (fgFc ? fgFc : NULL); }
73 // Return the histogram of the feed-down correction
74 TH1 * GetHistoFeedDownCorrection_fc() { return (fhFc ? fhFc : NULL); }
75 // Return the histograms of the feed-down correction bounds
76 TH1 * GetHistoUpperLimitFeedDownCorrection_fc() { return (fhFc_max ? fhFc_max : NULL); }
77 TH1 * GetHistoLowerLimitFeedDownCorrection_fc() { return (fhFc_min ? fhFc_min : NULL); }
78 // Return the TGraphAsymmErrors of the yield after feed-down correction
79 TGraphAsymmErrors * GetFeedDownCorrectedSpectrum() { return (fgYieldCorr ? fgYieldCorr : NULL); }
80 // Return the histogram of the yield after feed-down correction
81 TH1 * GetHistoFeedDownCorrectedSpectrum() { return (fhYieldCorr ? fhYieldCorr : NULL); }
82 // Return the histogram of the yield after feed-down correction bounds
83 TH1 * GetHistoUpperLimitFeedDownCorrectedSpectrum() { return (fhYieldCorr_max ? fhYieldCorr_max : NULL); }
84 TH1 * GetHistoLowerLimitFeedDownCorrectedSpectrum() { return (fhYieldCorr_min ? fhYieldCorr_min : NULL); }
85 // Return the equivalent invariant cross-section TGraphAsymmErrors
86 TGraphAsymmErrors * GetCrossSectionFromYieldSpectrum() { return (fgSigmaCorr ? fgSigmaCorr : NULL); }
87 // Return the equivalent invariant cross-section histogram
88 TH1 * GetHistoCrossSectionFromYieldSpectrum() { return (fhSigmaCorr ? fhSigmaCorr : NULL); }
89 // Return the equivalent invariant cross-section histogram bounds
90 TH1 * GetHistoUpperLimitCrossSectionFromYieldSpectrum() { return (fhSigmaCorr_max ? fhSigmaCorr_max : NULL); }
91 TH1 * GetHistoLowerLimitCrossSectionFromYieldSpectrum() { return (fhSigmaCorr_min ? fhSigmaCorr_min : NULL); }
92
93 //
94 // Main function:
95 // Compute the invariant cross-section from the yield (correct it)
96 void ComputeHFPtSpectrum(Double_t delta_y=1.0, Double_t BR_c=1.0, Double_t BR_b_decay=1.0);
97
98 //
99 // Functions to reweight histograms for testing purposes:
100 // to reweight the simulation: hToReweight is reweighted as hReference/hToReweight
101 TH1 * ReweightHisto(TH1 *hToReweight, TH1 *hReference);
102 // to reweight the reco-histos: hRecToReweight is reweighted as hReference/hMCToReweight
103 TH1 * ReweightRecHisto(TH1 *hRecToReweight, TH1 *hMCToReweight, TH1 *hMCReference);
104
105
106 protected:
107
108 // Initialization
109 Bool_t Initialize();
110
111 // Basic functions
112 //
113 // Compute the feed-down correction via fc-method
114 void CalculateFeedDownCorrection_fc();
115 // Correct the yield for feed-down correction via fc-method
116 void CalculateFeedDownCorrectedSpectrum_fc();
117 // Correct the yield for feed-down correction via Nb-method
118 void CalculateFeedDownCorrectedSpectrum_Nb(Float_t delta_y, Double_t BR_b_decay);
119
120 // Check histograms consistency function
121 Bool_t CheckHistosConsistency(TH1 *h1, TH1 *h2);
122
123 //
124 // Input spectra
125 //
126 TH1 *fhDirectMCpt; // Input MC c-->D spectra
127 TH1 *fhFeedDownMCpt; // Input MC b-->D spectra
128 TH1 *fhDirectMCpt_max; // Input MC maximum c-->D spectra
129 TH1 *fhDirectMCpt_min; // Input MC minimum c-->D spectra
130 TH1 *fhFeedDownMCpt_max; // Input MC maximum b-->D spectra
131 TH1 *fhFeedDownMCpt_min; // Input MC minimum b-->D spectra
132 TH1 *fhDirectEffpt; // c-->D Acceptance and efficiency correction
133 TH1 *fhFeedDownEffpt; // b-->D Acceptance and efficiency correction
134 TH1 *fhRECpt; // all reconstructed D
135 //
136 // Normalization factors
137 Double_t fLuminosity[2]; // analyzed luminosity & uncertainty
138 Double_t fTrigEfficiency[2]; // trigger efficiency & uncertainty
139
140 //
141 // Output spectra
142 //
143 TH1 *fhFc; // Correction histo fc = 1 / ( 1 + (eff_b/eff_c)*(N_b/N_c) )
144 TH1 *fhFc_max; // Maximum fc histo
145 TH1 *fhFc_min; // Minimum fc histo
146 TGraphAsymmErrors * fgFc; // Correction as TGraphAsymmErrors
147 TH1 *fhYieldCorr; // Corrected yield
148 TH1 *fhYieldCorr_max; // Maximum corrected yield
149 TH1 *fhYieldCorr_min; // Minimum corrected yield
150 TGraphAsymmErrors * fgYieldCorr; // Corrected yield as TGraphAsymmErrors
151 TH1 *fhSigmaCorr; // Corrected cross-section
152 TH1 *fhSigmaCorr_max; // Maximum corrected cross-section
153 TH1 *fhSigmaCorr_min; // Minimum corrected cross-section
154 TGraphAsymmErrors * fgSigmaCorr; // Corrected cross-section as TGraphAsymmErrors
155
156 //
157 Int_t fFeedDownOption; // feed-down correction flag: 0=none, 1=fc, 2=Nb
158 Bool_t fAsymUncertainties; // flag: asymmetric uncertainties are (1) or not (0) considered
159
160
161 ClassDef(AliHFPtSpectrum,1) // Class for Heavy Flavor spectra corrections
162};
163
164#endif