]>
Commit | Line | Data |
---|---|---|
c4840b75 | 1 | // $Id$ |
2 | /* | |
3 | * Example macro to run the ITS tracker with the TPC reconstruction. | |
4 | * The reconstruction is done from the TPC and ITS raw data. | |
5 | * | |
6 | * Usage: | |
7 | * <pre> | |
8 | * aliroot -b -q rec-tpc-its.C | tee rec-tpc-its.log | |
9 | * aliroot -b -q rec-tpc-its.C'("./","spd")' | tee rec-tpc-its.log | |
10 | * </pre> | |
11 | * | |
12 | * The macro asumes raw data to be available in the rawx folders, either | |
13 | * simulated or real data. A different input can be specified as parameter | |
14 | * <pre> | |
15 | * aliroot -b -q rec-tpc-its.C'("input.root")' | |
16 | * </pre> | |
17 | * | |
18 | * In the second parameter you can change the clusterfinders to run only | |
19 | * SPD, SDD, SSD or All: | |
20 | * - SPD runs only Silicon Pixels | |
21 | * - SDD runs only Silicon Drift | |
22 | * - SSD runs only Silicon Stips | |
23 | * - All will run the full ITS. This is default | |
24 | * | |
25 | * In the first section, an analysis chain is defined. The scale of the | |
26 | * chain can be defined by choosing the range of sectors and partitions. | |
27 | * | |
28 | * The reconstruction is steered by the AliReconstruction object in the | |
29 | * usual way. | |
30 | * | |
31 | * @ingroup alihlt_tpc | |
32 | * @author Gaute.Ovrebekk@ift.uib.no | |
33 | */ | |
34 | void rec_tpc_its(const char* input="./", char* opt="All") | |
35 | { | |
36 | ||
37 | if(!gSystem->AccessPathName("galice.root")){ | |
38 | cerr << "please delete the galice.root or run at different place." << endl; | |
39 | return; | |
40 | } | |
41 | ||
42 | if (!input) { | |
43 | cerr << "please specify input or run without arguments" << endl; | |
44 | return; | |
45 | } | |
46 | /////////////////////////////////////////////////////////////////////////////////////////////////// | |
47 | // | |
48 | // init the HLT system in order to define the analysis chain below | |
49 | // | |
50 | AliHLTSystem* gHLT=AliHLTPluginBase::GetInstance(); | |
51 | ||
52 | /////////////////////////////////////////////////////////////////////////////////////////////////// | |
53 | // | |
54 | // Setting up which output to give | |
55 | // | |
56 | TString option="libAliHLTUtil.so libAliHLTRCU.so libAliHLTTPC.so libAliHLTITS.so libAliHLTGlobal.so loglevel=0x7c chains="; | |
57 | Bool_t runspd=kFALSE, runsdd=kFALSE, runssd=kFALSE; | |
58 | TString allArgs=opt; | |
59 | TString argument; | |
60 | TObjArray* pTokens=allArgs.Tokenize(" "); | |
61 | if (pTokens) { | |
62 | for (int i=0; i<pTokens->GetEntries(); i++) { | |
63 | argument=((TObjString*)pTokens->At(i))->GetString(); | |
64 | if (argument.IsNull()) continue; | |
65 | ||
66 | if (argument.CompareTo("spd", TString::kIgnoreCase)==0) { | |
67 | runspd=kTRUE; | |
68 | continue; | |
69 | } | |
70 | if (argument.CompareTo("sdd", TString::kIgnoreCase)==0) { | |
71 | runsdd=kTRUE; | |
72 | continue; | |
73 | } | |
74 | if (argument.CompareTo("ssd",TString::kIgnoreCase)==0) { | |
75 | runssd=kTRUE; | |
76 | continue; | |
77 | } | |
78 | if (argument.CompareTo("all",TString::kIgnoreCase)==0) { | |
79 | runspd=kTRUE; | |
80 | runsdd=kTRUE; | |
81 | runssd=kTRUE; | |
82 | continue; | |
83 | } | |
84 | else { | |
85 | cerr << "Unknown argument" << endl; | |
86 | break; | |
87 | } | |
88 | } | |
89 | } | |
90 | ||
91 | /////////////////////////////////////////////////////////////////////////////////////////////////// | |
92 | // | |
93 | // define the analysis chain to be run | |
94 | // | |
95 | int minddl=0; //min ddl number for SPD | |
96 | int maxddl=19; //max ddl number for SPD | |
97 | int spec=0x1; //spec for ddl's | |
98 | int ddlno=0; | |
99 | TString cfout=""; | |
100 | ||
101 | if(runspd){ | |
102 | for(ddlno=minddl;ddlno<=maxddl;ddlno++){ | |
103 | TString arg, publisher, cf; | |
104 | ||
105 | arg.Form("-minid %d -datatype 'DDL_RAW ' 'ISPD ' -dataspec 0x%08x -verbose",ddlno, spec); | |
106 | publisher.Form("DP_%d", ddlno); | |
107 | AliHLTConfiguration pubconf(publisher.Data(), "AliRawReaderPublisher", NULL , arg.Data()); | |
108 | ||
109 | cf.Form("CF_%d",ddlno); | |
110 | AliHLTConfiguration cfconf(cf.Data(), "ITSClusterFinderSPD", publisher.Data(), ""); | |
111 | ||
112 | if (cfout.Length()>0) cfout+=" "; | |
113 | cfout+=cf; | |
114 | ||
115 | spec=spec<<1; | |
116 | } | |
117 | } | |
118 | ||
119 | if(runsdd){ | |
120 | minddl=256; //min ddl number for SDD | |
121 | maxddl=279; //max ddl number for SDD | |
122 | spec=0x1; //spec for ddl's | |
123 | ||
124 | for(ddlno=minddl;ddlno<=maxddl;ddlno++){ | |
125 | TString arg, publisher, cf; | |
126 | ||
127 | arg.Form("-minid %d -datatype 'DDL_RAW ' 'ISDD ' -dataspec 0x%08x -verbose",ddlno, spec); | |
128 | publisher.Form("DP_%d", ddlno); | |
129 | AliHLTConfiguration pubconf(publisher.Data(), "AliRawReaderPublisher", NULL , arg.Data()); | |
130 | ||
131 | cf.Form("CF_%d",ddlno); | |
132 | AliHLTConfiguration cfconf(cf.Data(), "ITSClusterFinderSDD", publisher.Data(), ""); | |
133 | ||
134 | if (cfout.Length()>0) cfout+=" "; | |
135 | cfout+=cf; | |
136 | ||
137 | spec=spec<<1; | |
138 | } | |
139 | } | |
140 | ||
141 | if(runssd){ | |
142 | minddl=512; //min ddl number for SSD | |
143 | maxddl=527; //max ddl number for SSD | |
144 | spec=0x1; //spec for ddl's | |
145 | ||
146 | for(ddlno=minddl;ddlno<=maxddl;ddlno++){ | |
147 | TString arg, publisher, cf; | |
148 | ||
149 | arg.Form("-minid %d -datatype 'DDL_RAW ' 'ISSD ' -dataspec 0x%08x -verbose",ddlno, spec); | |
150 | publisher.Form("DP_%d", ddlno); | |
151 | AliHLTConfiguration pubconf(publisher.Data(), "AliRawReaderPublisher", NULL , arg.Data()); | |
152 | ||
153 | cf.Form("CF_%d",ddlno); | |
154 | AliHLTConfiguration cfconf(cf.Data(), "ITSClusterFinderSSD", publisher.Data(), ""); | |
155 | ||
156 | if (cfout.Length()>0) cfout+=" "; | |
157 | cfout+=cf; | |
158 | ||
159 | spec=spec<<1; | |
160 | } | |
161 | } | |
162 | ||
163 | TString ITSinput = "TPC-globalmerger "; | |
164 | ITSinput += cfout; | |
165 | AliHLTConfiguration itstrackerconf("itstracker","ITSTracker",ITSinput.Data(),""); | |
166 | //option+="itstracker"; | |
167 | ||
168 | AliHLTConfiguration globalConverter("globalConverter", "GlobalEsdConverter" , "TPC-globalmerger itstracker", ""); | |
169 | AliHLTConfiguration sink("esdfile", "EsdCollector" , "globalConverter", "-directory hlt-tpc-esd"); | |
170 | option+="esdfile"; | |
171 | ||
172 | /////////////////////////////////////////////////////////////////////////////////////////////////// | |
173 | // | |
174 | // Init and run the reconstruction | |
175 | // All but HLT reconstructio is switched off | |
176 | // | |
177 | AliReconstruction rec; | |
178 | rec.SetInput(input); | |
179 | rec.SetRunVertexFinder(kFALSE); | |
180 | rec.SetRunReconstruction("HLT"); | |
181 | rec.SetLoadAlignFromCDB(0); | |
182 | rec.SetRunQA(":"); | |
183 | rec.SetDefaultStorage("local://$ALICE_ROOT/OCDB"); | |
184 | rec.SetSpecificStorage("GRP/GRP/Data",Form("local://%s",gSystem->pwd())); | |
185 | rec.SetOption("HLT", option); | |
186 | rec.Run(); | |
187 | } |