2 /**************************************************************************
3 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * Author: The ALICE Off-line Project. *
6 * Contributors are mentioned in the code where appropriate. *
8 * Permission to use, copy, modify and distribute this software and its *
9 * documentation strictly for non-commercial purposes is hereby granted *
10 * without fee, provided that the above copyright notice appears in all *
11 * copies and that both the copyright notice and this permission notice *
12 * appear in the supporting documentation. The authors make no claims *
13 * about the suitability of this software for any purpose. It is *
14 * provided "as is" without express or implied warranty. *
15 **************************************************************************/
16 //--------------------------------------------------------------------//
18 // AliCFDataGrid Class //
19 // Class to handle observed data and correct them //
21 // -- Author : S.Arcelli //
23 // substantially modified by r. vernet //
25 //--------------------------------------------------------------------//
30 #include "AliCFDataGrid.h"
32 //____________________________________________________________________
33 ClassImp(AliCFDataGrid)
35 //____________________________________________________________________
36 AliCFDataGrid::AliCFDataGrid() :
42 // default constructor
46 //____________________________________________________________________
47 AliCFDataGrid::AliCFDataGrid(const Char_t* name,const Char_t* title) :
48 AliCFGridSparse(name,title),
53 // default constructor
57 //____________________________________________________________________
58 AliCFDataGrid::AliCFDataGrid(const Char_t* name, const Char_t* title, const Int_t nVarIn, const Int_t * nBinIn, const Double_t *binLimitsIn) :
59 AliCFGridSparse(name,title,nVarIn,nBinIn,binLimitsIn),
66 SumW2();// errors saved
68 //____________________________________________________________________
69 AliCFDataGrid::AliCFDataGrid(const Char_t* name, const Char_t* title, const AliCFContainer &c) :
70 AliCFGridSparse(name,title),
78 //assign the container;
82 //____________________________________________________________________
83 AliCFDataGrid::AliCFDataGrid(const AliCFDataGrid& data) : AliCFGridSparse(),
90 ((AliCFDataGrid &)data).Copy(*this);
93 //____________________________________________________________________
94 AliCFDataGrid::~AliCFDataGrid()
100 //____________________________________________________________________
101 AliCFDataGrid &AliCFDataGrid::operator=(const AliCFDataGrid &c)
104 // assigment operator
107 ((AliCFDataGrid &) c).Copy(*this);
110 //____________________________________________________________________
112 void AliCFDataGrid::SetMeasured(Int_t istep)
115 // Deposit observed data over the grid
119 //simply clones the container's data at specified step
120 fData = (THnSparse*) ((AliCFGridSparse*)fContainer->GetGrid(istep))->GetGrid()->Clone();
122 AliInfo(Form("retrieving measured data from Container %s at selection step %i.",fContainer->GetName(),fSelData));
124 //____________________________________________________________________
125 void AliCFDataGrid::ApplyEffCorrection(const AliCFEffGrid &c)
129 // Apply the efficiency correction
131 if(c.GetNVar()!=fNVar){
132 AliInfo("Different number of variables, cannot apply correction");
136 AliInfo(Form("correction applied on data grid %s with efficiency %s.",GetName(),c.GetName()));
138 //____________________________________________________________________
139 void AliCFDataGrid::ApplyBGCorrection(const AliCFDataGrid &c)
143 // Apply correction for background
145 if(c.GetNVar()!=fNVar){
146 AliInfo("Different number of variables, cannot apply correction");
150 AliInfo(Form("background %s subtracted from data %s.",c.GetName(),GetName()));
152 //____________________________________________________________________
153 void AliCFDataGrid::Copy(TObject& c) const
158 AliCFDataGrid& target = (AliCFDataGrid &) c;
159 target.fContainer=fContainer;
160 target.fSelData=fSelData;