]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EMCAL/macros/MakeEMCALPF.C
Set default PF pattern when not set properly in OCDB
[u/mrichter/AliRoot.git] / EMCAL / macros / MakeEMCALPF.C
1 void MakeEMCALPF(){
2   const char* macroname = "MakeEMCALPF.C";
3   TFile *f2 = new TFile("peakfindervectors2.root",  "read" ); 
4
5   //  AliCaloPeakFinderVectors *pfv =  (AliCaloPeakFinderVectors* )f2->GetKey( "AliCaloPeakFinderVectors"); 
6
7   AliCaloPeakFinderVectors pfv =  *((AliCaloPeakFinderVectors* )f2->GetKey( "AliCaloPeakFinderVectors")); 
8
9   f2->Close();
10   {
11     //    TString Storage = "local://home/perthi/aliroot-current/OCDB/";
12     TString Storage = "local://OCDB/";  
13
14     if(!Storage.BeginsWith("local://") && !Storage.BeginsWith("alien://")) {
15       Error(macroname ,"STORAGE variable set to %s is not valid. Exiting\n",Storage.Data());
16       return;
17     }
18     
19     Info(macroname,"Saving PF objects in CDB storage %s",
20          Storage.Data());
21     AliCDBManager* cdb = AliCDBManager::Instance();
22
23
24     AliCDBStorage* storage = cdb->GetStorage(Storage.Data());
25     if(!storage){
26       Error(macroname,"Unable to open storage %s\n",Storage.Data());
27       return;
28     }
29
30     AliCDBMetaData* md = new AliCDBMetaData();
31     md->SetResponsible("Per Thomas Hille");
32     md->SetComment("Peak-Finder vectors for EMCAL");
33     md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
34     AliCDBId id("EMCAL/Config/PeakFinder",0,AliCDBRunRange::Infinity());
35     
36     // if(pfv == 0)
37     //   {
38     //  cout << "  ERROR !!!!!!!!!" << endl;
39     //   }
40  
41     // else
42     
43       {
44         storage->Put( &pfv,id,md);
45       }
46
47     //  delete md;
48   }
49
50   
51   //
52 }
53