]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/TPCLib/calibration/macros/calib-from-hltout.C
Update master to aliroot
[u/mrichter/AliRoot.git] / HLT / TPCLib / calibration / macros / calib-from-hltout.C
1 // $Id: $
2 /*
3  * Example macro to run TPC calibration interface embedded into AliRoot reconstruction. 
4  * The input used is unpacked from the HLTOUT of recorded data, in which the merged
5  * tracks, the ESD and the TPC clusters have been added. The seed maker and the calibration 
6  * components follow.
7  *
8  * Usage:
9  * <pre>
10  *   aliroot -b -q calib-from-hltout.C'("raw.root","task"     )'     | tee calib-from-hltout.log
11  *   aliroot -b -q calib-from-hltout.C'("raw.root","calibtime")'     | tee calib-from-hltout.log
12  *   aliroot -b -q calib-from-hltout.C'("raw.root","calibtimegain")' | tee calib-from-hltout.log
13  * </pre>
14  *
15  *
16  * The reconstruction is steered by the AliReconstruction object in the
17  * usual way. Keep in mind that you should use the proper default and
18  * specific storage otherwise the reconstruction will break.
19  *
20  * @ingroup alihlt_tpc
21  * @author Kalliopi.Kanaki@ift.uib.no
22  */
23
24 void calib_from_hltout(const char* input="./", const char* option="task"){
25
26   gSystem->Load("libANALYSIS");
27   gSystem->Load("libTPCcalib");  
28   
29   if(!gSystem->AccessPathName("galice.root")){
30     cerr << "Please delete file galice.root or run at a different place." << endl;
31     return;
32   }
33
34   if (!input) {
35     cerr << "Please specify input or run without arguments." << endl;
36     return;
37   }
38
39   /////////////////////////////////////////////////////////////////////////
40   //
41   // init the HLT system in order to define the analysis chain below
42   //
43  
44   AliHLTSystem *gHLT = AliHLTPluginBase::GetInstance();
45   if(!gHLT){
46     cerr << "fatal error: cannot get HLT instance" << endl;
47   }
48
49   AliHLTConfiguration publisher("hltout", "AliHLTOUTPublisher", NULL, "");
50   
51   AliHLTConfiguration seedconf("seeds", "TPCCalibSeedMaker", "hltout","");
52   
53   TString calibOption = option;
54   if     (calibOption.CompareTo("task")==0)          AliHLTConfiguration calibtimeconf("TPCcalib",      "TPCCalibration",  "hltout seeds" ,"");
55   else if(calibOption.CompareTo("calibtime")==0)     AliHLTConfiguration calibtimeconf("calibTime",     "TPCCalibTime",    "hltout seeds", "");
56   else if(calibOption.CompareTo("calibtimegain")==0) AliHLTConfiguration calibtimeconf("calibTimeGain", "TPCCalibTimeGain","hltout seeds", "");
57   else 
58     {
59       cerr << "\nPlease specify an option for the calibration component you want to run." << endl;
60       return;
61     }
62
63
64   /////////////////////////////////////////////////////////////////////////
65   //
66   // Init and run the reconstruction
67   // All but HLT reconstruction is switched off
68   //
69   AliReconstruction rec;
70   rec.SetInput(input);
71   rec.SetRunVertexFinder(kFALSE);
72   rec.SetRunLocalReconstruction("HLT");
73   rec.SetRunTracking("");
74   rec.SetLoadAlignFromCDB(0);
75   rec.SetRunQA(":");
76   rec.SetDefaultStorage("local://$ALICE_ROOT/OCDB");
77   rec.SetSpecificStorage("GRP/GRP/Data", Form("local://%s",gSystem->pwd()));
78   //rec.SetDefaultStorage("local:///home/kanaki/calibComp/libraryTest/OCDB/");
79   //rec.SetSpecificStorage("GRP/GRP/Data", "local:///home/kanaki/calibComp/libraryTest/OCDB/");
80
81
82   // NOTE: FillESD is a step in the AliReconstruction sequence and has
83   // nothing to do with the fact that this macro writes ESD output
84   // HLT processes the HLTOUT during FillESD and extracts data which
85   // has already been prepared. This step is currently not necessary for
86   // this macro
87   rec.SetFillESD("");
88   
89   if     (calibOption.CompareTo("task")==0)          rec.SetOption("HLT", "libAliHLTUtil.so libAliHLTGlobal.so libAliHLTTPC.so libAliHLTTPCCalibration.so loglevel=0x7c chains=TPCcalib"); 
90   if     (calibOption.CompareTo("calibtime")==0)     rec.SetOption("HLT", "libAliHLTUtil.so libAliHLTGlobal.so libAliHLTTPC.so libAliHLTTPCCalibration.so loglevel=0x7c chains=calibTime"); 
91   else if(calibOption.CompareTo("calibtimegain")==0) rec.SetOption("HLT", "libAliHLTUtil.so libAliHLTGlobal.so libAliHLTTPC.so libAliHLTTPCCalibration.so loglevel=0x7c chains=calibTimeGain");
92   
93   //rec.SetEventRange(0,20);
94   rec.Run();
95 }