Setting run number in CDB manager added. GRP now read from default cdb storage instea...
[u/mrichter/AliRoot.git] / CORRFW / AliCFFrame.cxx
1 /* $Id$ */
2 /**************************************************************************
3  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  *                                                                        *
5  * Author: The ALICE Off-line Project.                                    *
6  * Contributors are mentioned in the code where appropriate.              *
7  *                                                                        *
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 //--------------------------------------------------------------------//
17 //                                                                    //
18 // AliCFFrame Class                                                 //
19 // Class to accumulate data on an N-dimensional grid, to be used      //
20 // as input to get corrections for Reconstruction & Trigger efficiency// 
21 //                                                                    //
22 // -- Author : S.Arcelli                                              //
23 // Still to be done:                                                  //
24 // --Implement methods to merge cells                                 //
25 // --Interpolate among bins in a range                                // 
26 //--------------------------------------------------------------------//
27 //
28 //
29
30 #include "TSystem.h"
31 #include "TFile.h"
32 #include "AliLog.h"
33 #include "AliCFFrame.h"
34
35 //____________________________________________________________________
36 ClassImp(AliCFFrame)
37
38 //____________________________________________________________________
39 AliCFFrame::AliCFFrame() : 
40   TNamed()
41 {
42   // default constructor
43 }
44
45 //____________________________________________________________________
46 AliCFFrame::AliCFFrame(const Char_t* name, const Char_t* title) : 
47   TNamed(name,title)
48 {
49   // named constructor
50 }
51
52 //____________________________________________________________________
53 void AliCFFrame::Save(const Char_t *outfile) const
54 {
55   //
56   // Save 'this' to a root file
57   //
58
59   const char *dirname = "./";
60   TString filename = outfile;
61   TFile *file=0x0;
62   if((gSystem->FindFile(dirname,filename))!=NULL){
63     file = new TFile( outfile,"UPDATE");
64   }
65   else{
66     file = new TFile( outfile,"RECREATE");
67   } 
68   file->cd();
69   //write the object to a file
70   this->Write(GetName(),TObject::kSingleKey);
71   file->Close();
72   delete file;
73 }