]>
Commit | Line | Data |
---|---|---|
a6a61f43 | 1 | void MakeEMCALPF(){ |
2 | const char* macroname = "MakeEMCALPF.C"; | |
3 | TFile *f2 = new TFile("peakfindervectors2.root", "read" ); | |
4 | // AliCaloPeakFinderVectors *pfv = (AliCaloPeakFinderVectors* )f2->GetKey( "AliCaloPeakFinderVectors"); | |
5 | ||
6 | // AliCaloPeakFinderVectors *pfv = *((AliCaloPeakFinderVectors* )f2->GetKey( "AliCaloPeakFinderVectors")); | |
7 | // AliCaloPeakFinderVectors pfv = *((AliCaloPeakFinderVectors* )f2->GetKey( "AliCaloPeakFinderVectors")); | |
8 | // AliCaloPeakFinderVectors *p = f2->Get("AliCaloPeakFinderVectors"); | |
9 | ||
10 | // AliCaloPeakFinderVectors pfv = *((AliCaloPeakFinderVectors* )f2->GetKey( "AliCaloPeakFinderVectors")); | |
11 | AliCaloPeakFinderVectors *pfv = (f2->Get("AliCaloPeakFinderVectors")); | |
12 | ||
13 | pfv->PrintVectors(); | |
14 | // p->PrintVectors(); | |
15 | ||
16 | f2->Close(); | |
17 | { | |
18 | // TString Storage = "local://home/perthi/aliroot-current/OCDB/"; | |
19 | TString Storage = "local://OCDB/"; | |
20 | ||
21 | if(!Storage.BeginsWith("local://") && !Storage.BeginsWith("alien://")) { | |
22 | Error(macroname ,"STORAGE variable set to %s is not valid. Exiting\n",Storage.Data()); | |
23 | return; | |
24 | } | |
25 | ||
26 | ||
27 | Info(macroname,"Saving PF objects in CDB storage %s", | |
28 | Storage.Data()); | |
29 | AliCDBManager* cdb = AliCDBManager::Instance(); | |
30 | ||
31 | AliCDBStorage* storage = cdb->GetStorage(Storage.Data()); | |
32 | if(!storage) | |
33 | { | |
34 | Error(macroname,"Unable to open storage %s\n",Storage.Data()); | |
35 | return; | |
36 | } | |
37 | ||
38 | AliCDBMetaData* md = new AliCDBMetaData(); | |
39 | md->SetResponsible("Per Thomas Hille"); | |
40 | md->SetComment("Peak-Finder vectors for EMCAL"); | |
41 | md->SetAliRootVersion(gSystem->Getenv("ARVERSION")); | |
42 | AliCDBId id("EMCAL/Calib/PeakFinder",0,AliCDBRunRange::Infinity()); | |
43 | ||
44 | if ( storage != 0 ) | |
45 | { | |
46 | Bool_t ret = storage->Put( pfv,id,md); | |
47 | if(ret == kFALSE ) | |
48 | { | |
49 | cout << __FILE__ << ":" << __LINE__ << ": ERROR !!! storage->Put( pfv,id,md) returned false " << endl; | |
50 | } | |
51 | else | |
52 | { | |
53 | cout << __FILE__ << ":" << __LINE__ << ": INFO !!! storage->Put( pfv,id,md) returned TRUE " << endl; | |
54 | } | |
55 | ||
56 | } | |
57 | } | |
58 | ||
59 | } | |
60 |