1 /// \file MakeClusterParam.C
2 /// Example macro to build AliTPCClusterParam
3 /// postprocessing the output of the calibration using tracks
4 /// In the future this macro will be part of the Preprocesor
6 void StoreObject(AliTPCClusterParam *param);
8 void MakeClusterParam(const char *fnresolc="Output.root", const char *fnresolg="Output.root"){
9 gSystem->Load("libTPCcalib");
10 TFile fresolc(fnresolc);
11 TFile fresolg(fnresolg);
12 AliTPCcalibTracks *calibtracks = (AliTPCcalibTracks*)fresolc.Get("calibTracks");
13 AliTPCcalibTracksGain *calibtracksGain = (AliTPCcalibTracksGain*)fresolg.Get("calibTracksGain");
15 AliTPCClusterParam clParam;
17 // Make a resolution tree
19 calibtracks->MakeResPlotsQTree(200,"plots");
20 TFile fres("plots/resol.root");
21 TTree *treeres = (TTree*)fres.Get("Resol");
22 // Fit the resolution parameterization
23 clParam.FitResol(treeres);
24 clParam.FitRMS(treeres);
25 clParam.SetInstance(&clParam);
26 TF1 f1z_z("f1z_z","AliTPCClusterParam::SGetError0Par(1,0,x,0)",0,250);
28 // angular effect calibration - usable only with the
31 calibtracksGain->UpdateClusterParam(&clParam);
35 TFile fclparam("TPCClusterParam.root","recreate");
36 clParam->Write("Param");
39 AliTPCClusterParam::SetInstance(&clParam);
42 void StoreObject(AliTPCClusterParam *clParam)
47 char *gCDBpath = "local://$ALICE_ROOT/OCDB";
48 AliCDBMetaData *md1= new AliCDBMetaData();
49 AliCDBId id1("TPC/Calib/ClusterParam", gkDummyRun, gkDummyRun);
50 AliCDBStorage* gStorLoc = 0;
51 AliCDBManager *man = AliCDBManager::Instance();
52 gStorLoc = man->GetStorage(gCDBpath);
54 md1->SetObjectClassName("AliTPCClusterParam");
55 md1->SetResponsible("Marian Ivanov");
56 md1->SetBeamPeriod(1);
57 md1->SetAliRootVersion("v5-08-Release"); //root version
58 md1->SetComment("Calibration data using the MC cosmic");
59 gStorLoc->Put(&clParam, id1, md1);