]>
Commit | Line | Data |
---|---|---|
c012881c | 1 | // $Id: rec-hlt-tpc.C 36001 2009-10-26 17:08:56Z kaamodt $ |
2 | /* | |
3 | * Example macro to run the HLT Conformal mapping tracker embedded into | |
4 | * AliRoot reconstruction. The reconstruction is done from the TPC raw | |
5 | * data. | |
6 | * | |
7 | * Usage: | |
8 | * <pre> | |
9 | * rm galice.root & aliroot -b -q hwcfCheck.C | tee rec-hlt-tpc.log | |
10 | * rm galice.root & aliroot -b -q hwcfCheck.C'("./")' | tee rec-hlt-tpc.log | |
11 | * </pre> | |
12 | * | |
13 | * The macro asumes raw data to be available in the rawx folders, either | |
14 | * simulated or real data. A different input can be specified as parameter | |
15 | * <pre> | |
16 | * rm galice.root & aliroot -b -q hwcfCheck.C'("./")' | |
17 | * </pre> | |
18 | * | |
19 | * @ingroup alihlt_tpc | |
20 | * @author Matthias.Richter@ift.uib.no | |
21 | */ | |
22 | ||
23 | TString GetFileList( char *basedir, char *filename ) | |
24 | { | |
25 | TString s = ""; | |
26 | int evnt=0; | |
27 | do{ | |
28 | TString dir; | |
29 | dir.Form("%sraw%d",basedir,evnt); | |
30 | if( gSystem->AccessPathName(dir.Data()) ) break; | |
31 | TString add; | |
32 | add.Form(" -datafile %s/%s", dir.Data(), filename); | |
33 | if( evnt>0 ) s+=" -nextevent"; | |
34 | s+=add; | |
35 | evnt++; | |
36 | }while(1); | |
37 | return s; | |
38 | } | |
39 | ||
40 | void hwcfCheck(const char* basedir="./") | |
41 | { | |
42 | ||
43 | if(!gSystem->AccessPathName("galice.root")){ | |
44 | cerr << "please delete the galice.root or run at different place." << endl; | |
45 | return; | |
46 | } | |
47 | ||
48 | if (!basedir) { | |
49 | cerr << "please specify input or run without arguments" << endl; | |
50 | return; | |
51 | } | |
52 | ||
53 | /////////////////////////////////////////////////////////////////////////////////////////////////// | |
54 | // | |
55 | // init the HLT system in order to define the analysis chain below | |
56 | // | |
57 | AliHLTSystem* gHLT=AliHLTPluginBase::GetInstance(); | |
58 | ||
59 | /////////////////////////////////////////////////////////////////////////////////////////////////// | |
60 | // | |
61 | // Setting up which output to give | |
62 | // | |
63 | int clusterFinderType=0; // 0 = v3; 1 = decoder; 2 = packed (offline v1) | |
64 | bool bUseCA=true; // use the CA tracker and merger | |
65 | TString option="libAliHLTUtil.so libAliHLTRCU.so libAliHLTTPC.so loglevel=0x7c chains="; | |
66 | ||
67 | /////////////////////////////////////////////////////////////////////////////////////////////////// | |
68 | // | |
69 | // define the analysis chain to be run | |
70 | // | |
71 | int iMinSlice=0; | |
72 | int iMaxSlice=0; | |
73 | int iMinPart=0; | |
74 | int iMaxPart=0; | |
75 | TString clusters; | |
76 | for (int slice=iMinSlice; slice<=iMaxSlice; slice++) { | |
77 | for (int part=iMinPart; part<=iMaxPart; part++) { | |
78 | ||
79 | int ddlno=768; | |
80 | if (part>1) ddlno+=72+4*slice+(part-2); | |
81 | else ddlno+=2*slice+part; | |
82 | ||
83 | // raw data publisher | |
84 | ||
85 | TString arg, publisher, cf, publisherHW; | |
86 | ||
87 | arg.Form("-minid %d -datatype 'DDL_RAW ' 'TPC ' -dataspec 0x%02x%02x%02x%02x", ddlno, slice, slice, part, part); | |
88 | publisher.Form("DP_%02d_%d", slice, part); | |
89 | AliHLTConfiguration pubconf(publisher.Data(), "AliRawReaderPublisher", NULL , arg.Data()); | |
90 | ||
91 | ||
92 | // FPGA cluster finder emulator | |
93 | ||
94 | cf.Form("CF_%02d_%d", slice, part); | |
95 | AliHLTConfiguration cfconf(cf.Data(), "TPCHWClusterFinderEmulator", publisher.Data(), ""); | |
96 | ||
97 | if(clusters.Length()>0) clusters+=" "; | |
98 | clusters+=cf; | |
99 | ||
100 | TString fname; | |
101 | fname.Form("HWCF_%d.ddl",ddlno); | |
102 | TString flist = GetFileList(basedir,fname.Data()); | |
103 | ||
104 | cout<<"\n\nFileList for FPGA ddl "<<ddlno<<":"<<endl; | |
105 | cout<<flist.Data()<<endl; | |
106 | cout<<endl; | |
107 | ||
108 | arg.Form("-datatype 'HWCLUST1' 'TPC ' %s -dataspec 0x%02x%02x%02x%02x", flist.Data(), slice, slice, part, part); | |
109 | ||
110 | publisherHW.Form("DPHW_%02d_%d", slice, part); | |
111 | AliHLTConfiguration pubconf(publisherHW.Data(), "FilePublisher", "", arg.Data()); | |
112 | ||
113 | if(clusters.Length()>0) clusters+=" "; | |
114 | clusters+=publisherHW; | |
115 | } | |
116 | } | |
117 | ||
118 | ||
119 | AliHLTConfiguration pubconf("ConsistencyControl", "TPCHWCFConsistenyControl", clusters.Data(), ""); | |
120 | ||
121 | option+="ConsistencyControl"; | |
122 | ||
123 | ||
124 | /////////////////////////////////////////////////////////////////////////////////////////////////// | |
125 | // | |
126 | // Init and run the reconstruction | |
127 | // All but HLT reconstructio is switched off | |
128 | // | |
129 | AliReconstruction rec; | |
130 | rec.SetInput(basedir); | |
c5136d39 | 131 | rec.SetRunVertexFinder(0); |
132 | rec.SetRunVertexFinder(0); | |
133 | rec.SetRunVertexFinderTracks(0); | |
134 | rec.SetRunCascadeFinder(0); | |
135 | rec.SetRunMultFinder(0); | |
c012881c | 136 | rec.SetRunReconstruction("HLT"); |
137 | rec.SetLoadAlignFromCDB(0); | |
138 | rec.SetRunQA(":"); | |
139 | rec.SetDefaultStorage("local://$ALICE_ROOT/OCDB"); | |
140 | rec.SetSpecificStorage("GRP/GRP/Data", Form("local://%s",gSystem->pwd())); | |
141 | rec.SetOption("HLT", option); | |
142 | rec.Run(); | |
143 | } |