]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG3/dielectron/AliDielectronSignalBase.cxx
Changes for background calculations for jet spectrum, setting of track filter bits...
[u/mrichter/AliRoot.git] / PWG3 / dielectron / AliDielectronSignalBase.cxx
CommitLineData
572b0139 1/*************************************************************************
2* Copyright(c) 1998-2009, ALICE Experiment at CERN, All rights reserved. *
3* *
4* Author: The ALICE Off-line Project. *
5* Contributors are mentioned in the code where appropriate. *
6* *
7* Permission to use, copy, modify and distribute this software and its *
8* documentation strictly for non-commercial purposes is hereby granted *
9* without fee, provided that the above copyright notice appears in all *
10* copies and that both the copyright notice and this permission notice *
11* appear in the supporting documentation. The authors make no claims *
12* about the suitability of this software for any purpose. It is *
13* provided "as is" without express or implied warranty. *
14**************************************************************************/
15
16///////////////////////////////////////////////////////////////////////////
17// Dielectron SignalBase //
18// //
19// //
20/*
21Base class for signal extraction from a histogram or an array of histograms
22The histogram is assumed to be an inv. mass spectrum,
23the array of histograms is assumed to be an array with inv. mass histograms
24resulting from single and mixed events, as defined in AliDielectron.cxx
25
26*/
27// //
28///////////////////////////////////////////////////////////////////////////
29
30
31#include "TPaveText.h"
32#include "AliDielectronSignalBase.h"
bc75eeb5 33#include <TH1F.h>
572b0139 34
35ClassImp(AliDielectronSignalBase)
36
37AliDielectronSignalBase::AliDielectronSignalBase() :
38 TNamed(),
bc75eeb5 39 fHistSignal(0),
40 fHistBackground(0),
41 fHistDataPM(0),
42 fHistDataPP(0),
43 fHistDataMM(0),
8df8e382 44 fValues(6),
45 fErrors(6),
bc75eeb5 46 fIntMin(0),
47 fIntMax(0),
48 fFitMin(0),
49 fFitMax(0),
50 fRebin(1),
51 fMethod(kLikeSign),
52 fProcessed(kFALSE)
572b0139 53{
54 //
55 // Default Constructor
56 //
572b0139 57}
58
59//______________________________________________
60AliDielectronSignalBase::AliDielectronSignalBase(const char* name, const char* title) :
61 TNamed(name, title),
bc75eeb5 62 fHistSignal(0),
63 fHistBackground(0),
64 fHistDataPM(0),
65 fHistDataPP(0),
66 fHistDataMM(0),
8df8e382 67 fValues(6),
68 fErrors(6),
bc75eeb5 69 fIntMin(0),
70 fIntMax(0),
71 fFitMin(0),
72 fFitMax(0),
73 fRebin(1),
74 fMethod(kLikeSign),
75 fProcessed(kFALSE)
572b0139 76{
77 //
78 // Named Constructor
79 //
80}
81
82//______________________________________________
83AliDielectronSignalBase::~AliDielectronSignalBase()
84{
85 //
86 // Default Destructor
87 //
bc75eeb5 88 if(fHistSignal) delete fHistSignal;
89 if(fHistBackground) delete fHistBackground;
572b0139 90}
91
92//______________________________________________
93TPaveText* AliDielectronSignalBase::DrawStats(Double_t x1/*=0.*/, Double_t y1/*=0.*/, Double_t x2/*=0.*/, Double_t y2/*=0.*/)
94{
95 //
96 // Draw extracted values in a TPaveText
97 // with the corners x1,y2,x2,y2
98 //
99 if (TMath::Abs(x1)<1e-20&&TMath::Abs(x2)<1e-20){
100 x1=.6;
101 x2=.9;
102 y1=.7;
103 y2=.9;
104 }
105 TPaveText *t=new TPaveText(x1,y1,x2,y2,"brNDC");
106 t->SetFillColor(kWhite);
107 t->SetBorderSize(1);
108 t->SetTextAlign(12);
bc75eeb5 109 t->AddText(Form("Range : %.2f - %.2f GeV/c^{2}", fIntMin, fIntMax));
110 t->AddText(Form("Signal : %.1f #pm %.1f", fValues(0), fErrors(0)));
111 t->AddText(Form("Backgnd: %.1f #pm %.1f", fValues(1), fErrors(1)));
112 t->AddText(Form("Signif.: %.2f #pm %.2f", fValues(2), fErrors(2)));
113 t->AddText(Form("S/B : %.2f #pm %.2f", fValues(3), fErrors(3)));
114 if(fValues(4)>0) {
115 t->AddText(Form("Mass: %.2f #pm %.2f GeV/c^{2}", fValues(4), fErrors(4)));
116 t->AddText(Form("Mass res.: %.1f #pm %.1f MeV/c^{2}", 1000*fValues(5), 1000*fErrors(5)));
8df8e382 117 }
572b0139 118 t->Draw();
119
120 return t;
121}
122
9143d69f 123//______________________________________________
124void AliDielectronSignalBase::Print(Option_t */*option*/) const
125{
126 //
127 // Print the statistics
128 //
bc75eeb5 129 printf("Signal : %.5g #pm %.5g\n",fValues(0), fErrors(0));
130 printf("Backgnd: %.5g #pm %.5g\n",fValues(1), fErrors(1));
131 printf("Signif.: %.5g #pm %.5g\n",fValues(2), fErrors(2));
132 printf("SoB : %.5g #pm %.5g\n",fValues(3), fErrors(3));
133 if(fValues(4)>0){
134 printf("Mass: %.5g #pm %.5g\n", fValues(4), fErrors(4));
135 printf("Mass res.: %.5g #pm %.5g\n", fValues(5), fErrors(5));
9143d69f 136 }
137}