]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/TPCLib/macros/rec-hlt-tpc.C
da9ee615dc898b4e25bf48eb486dcbbd3f36b215
[u/mrichter/AliRoot.git] / HLT / TPCLib / macros / rec-hlt-tpc.C
1 // $Id$
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  *   aliroot -b -q rec-hlt-tpc.C | tee rec-hlt-tpc.log
10  * </pre>
11  *
12  * The chain to be run is defined by the macro given to the parameter
13  * 'config='
14  *
15  * The macro asumes raw data to be available in the rawx folders, either
16  * simulated or real data. A different input can be specified as parameter
17  * <pre>
18  *   aliroot -b -q rec-hlt-tpc.C'("input.root")'
19  * </pre>
20  *
21  * By the second parameter the digit reader can be chosen, default is
22  * AliHLTTPCDigitReaderPacked (=false). Set to true to use
23  * AliHLTTPCDigitReaderDecoder
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 Matthias.Richter@ift.uib.no
33  */
34 void rec_hlt_tpc(const char* input="./", bool bUseClusterFinderDecoder=true)
35 {
36   if (!input) {
37     cerr << "please specify input or run without arguments" << endl;
38     return;
39   }
40
41   ///////////////////////////////////////////////////////////////////////////////////////////////////
42   //
43   // init the HLT system in order to define the analysis chain below
44   //
45   gSystem->Load("libHLTrec.so");
46   AliHLTSystem* gHLT=AliHLTReconstructorBase::GetInstance();
47
48   ///////////////////////////////////////////////////////////////////////////////////////////////////
49   //
50   // define the analysis chain to be run
51   //
52   int iMinSlice=0;
53   int iMaxSlice=35;
54   int iMinPart=0;
55   int iMaxPart=5;
56   TString writerInput;
57   TString mergerInput;
58   for (int slice=iMinSlice; slice<=iMaxSlice; slice++) {
59     TString trackerInput;
60     for (int part=iMinPart; part<=iMaxPart; part++) {
61       TString arg, publisher, cf;
62
63       // raw data publisher components
64       int ddlno=768;
65       if (part>1) ddlno+=72+4*slice+(part-2);
66       else ddlno+=2*slice+part;
67       arg.Form("-minid %d -datatype 'DDL_RAW ' 'TPC '  -dataspec 0x%02x%02x%02x%02x", ddlno, slice, slice, part, part);
68       publisher.Form("DP_%02d_%d", slice, part);
69       AliHLTConfiguration pubconf(publisher.Data(), "AliRawReaderPublisher", NULL , arg.Data());
70
71       // cluster finder components
72       cf.Form("CF_%02d_%d", slice, part);
73       if (bUseClusterFinderDecoder) {
74         AliHLTConfiguration cfconf(cf.Data(), "TPCClusterFinderDecoder", publisher.Data(), "-timebins 446");
75       } else {
76         AliHLTConfiguration cfconf(cf.Data(), "TPCClusterFinderPacked", publisher.Data(), "-timebins 446 -sorted");
77       }
78       if (trackerInput.Length()>0) trackerInput+=" ";
79       trackerInput+=cf;
80       if (writerInput.Length()>0) writerInput+=" ";
81       writerInput+=cf;
82     }
83     TString tracker;
84     // tracker finder components
85     tracker.Form("TR_%02d", slice);
86     AliHLTConfiguration trackerconf(tracker.Data(), "TPCSliceTracker", trackerInput.Data(), "-pp-run -bfield 0.5");
87     if (writerInput.Length()>0) writerInput+=" ";
88     writerInput+=tracker;
89     if (mergerInput.Length()>0) mergerInput+=" ";
90     mergerInput+=tracker;
91   }
92
93   // specify whether to write all blocks separately or merge the tracks
94   // and convert to ESD
95   bool writeBlocks=false;
96
97   if (writeBlocks) {
98     // the writer configuration
99     AliHLTConfiguration fwconf("sink1", "FileWriter"   , writerInput.Data(), "-specfmt=_%d -subdir=out_%d -blcknofmt=_0x%x -idfmt=_0x%08x");
100   } else {
101     // GlobalMerger component
102     AliHLTConfiguration mergerconf("globalmerger","TPCGlobalMerger",mergerInput.Data(),"");
103
104     // the esd converter configuration
105     AliHLTConfiguration esdcconf("esd-converter", "TPCEsdConverter"   , "globalmerger", "-tree");
106     
107     // the root file writer configuration
108     AliHLTConfiguration sink("sink1", "EsdCollector"   , "esd-converter", "-directory hlt-tpc-cm");
109   }
110
111   ///////////////////////////////////////////////////////////////////////////////////////////////////
112   //
113   // Init and run the reconstruction
114   // All but HLT reconstructio is switched off
115   //
116   AliReconstruction rec;
117   rec.SetInput(input);
118   rec.SetRunVertexFinder(kFALSE);
119   rec.SetRunLocalReconstruction("HLT");
120   rec.SetRunTracking("");
121   rec.SetLoadAlignFromCDB(0);
122   rec.SetRunQA(":");
123   AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., AliMagFMaps::k5kG);
124   AliTracker::SetFieldMap(field,kTRUE);
125   rec.SetFillESD("HLT");
126   rec.SetOption("HLT", "libAliHLTUtil.so libAliHLTRCU.so libAliHLTTPC.so loglevel=0x7c chains=sink1");
127   rec.Run();
128 }