]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TPC/macros/MakeClusterParam.C
doxy: TPC/macros root converted
[u/mrichter/AliRoot.git] / TPC / macros / MakeClusterParam.C
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
5
6 void StoreObject(AliTPCClusterParam *param);
7
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");
14
15   AliTPCClusterParam clParam;
16   //
17   // Make a resolution tree
18   //
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);
27   //
28   // angular effect calibration - usable only with the 
29   // cosmic tracks 
30   //
31   calibtracksGain->UpdateClusterParam(&clParam);
32   //
33   //
34   //
35   TFile fclparam("TPCClusterParam.root","recreate");
36   clParam->Write("Param");
37   fclparam.Close();
38   StoreObject(clParam);
39   AliTPCClusterParam::SetInstance(&clParam);
40 }
41  
42 void StoreObject(AliTPCClusterParam *clParam)
43
44   ///
45
46   Int_t gkDummyRun = 0;
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);
53
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); 
60 }
61
62