]>
Commit | Line | Data |
---|---|---|
fec96a66 | 1 | |
2 | //************************************************************************** | |
3 | //* This file is property of and copyright by the ALICE HLT Project * | |
4 | //* ALICE Experiment at CERN, All rights reserved. * | |
5 | //* * | |
6 | //* Primary Authors Kenneth Aamodt <kenneth.aamodt@cern.ch> * | |
7 | //* for The ALICE HLT Project. * | |
8 | //* * | |
9 | //* Permission to use, copy, modify and distribute this software and its * | |
10 | //* documentation strictly for non-commercial purposes is hereby granted * | |
11 | //* without fee, provided that the above copyright notice appears in all * | |
12 | //* copies and that both the copyright notice and this permission notice * | |
13 | //* appear in the supporting documentation. The authors make no claims * | |
14 | //* about the suitability of this software for any purpose. It is * | |
15 | //* provided "as is" without express or implied warranty. * | |
16 | //************************************************************************** | |
17 | ||
18 | /** | |
19 | * @file histogramHandlerTest.C | |
20 | * @author Kenneth.Aamodt@cern.ch | |
21 | * @date | |
22 | * @brief Test macro for histogram handler | |
23 | * | |
24 | * To test the histogram handler the AliHLTTPCClusterHistoComponent is used as input to the | |
25 | * histogram handler. There are two clusterfinders running, each of these sends its output to | |
26 | * one clusterhisto component each, which again sends its data to 2 histogram handlers. | |
27 | * One of the Histogram handlers get data from one of the cluster histo components, while the | |
28 | * other get the output from both. | |
29 | * The content of the two rootfiles can now be compared to eachother. | |
30 | * The histograms in histogramHandlerFile2... should now have double the amount of entries, and the | |
31 | * height in the y-axis should be 2 times that of the histogramHandlerFile1... | |
32 | */ | |
33 | ||
34 | void histogramHandlerTest(const char* input="./"){ | |
35 | ||
36 | if (!input) { | |
37 | cerr << "please specify input or run without arguments" << endl; | |
38 | return; | |
39 | } | |
40 | ||
41 | ||
42 | ///////////////////////////////////////////////////////////////////////////////////////////////// | |
43 | // | |
44 | // init the HLT system in order to define the analysis chain below | |
45 | // | |
7bf6c76d | 46 | AliHLTSystem* gHLT=AliHLTPluginBase::GetInstance(); |
fec96a66 | 47 | |
48 | /////////////////////////////////////////////////////////////////////////////////////////////////// | |
49 | // | |
50 | // define the analysis chain to be run | |
51 | // | |
52 | ||
53 | int iMinSlice=0; | |
54 | int iMaxSlice=35; | |
55 | int iMinPart=0; | |
56 | int iMaxPart=5; | |
57 | ||
58 | TString histogramHandlerInput1; | |
59 | TString histogramHandlerInput2; | |
60 | TString histogramHandlerOutput1; | |
61 | TString histogramHandlerOutput2; | |
62 | TString rootFileWriterInput1; | |
63 | TString rootFileWriterInput2; | |
64 | ||
65 | for (int slice=iMinSlice; slice<=iMaxSlice; slice++) { | |
66 | for (int part=iMinPart; part<=iMaxPart; part++) { | |
67 | TString clusterFinderOutput1; | |
68 | TString clusterFinderOutput2; | |
69 | TString clusterHistoInput1; | |
70 | TString clusterHistoInput2; | |
71 | TString clusterHistoOutput1; | |
72 | TString clusterHistoOutput2; | |
73 | TString arg, publisher; | |
74 | // digit publisher components | |
75 | int ddlno=768; | |
76 | if (part>1) ddlno+=72+4*slice+(part-2); | |
77 | else ddlno+=2*slice+part; | |
78 | arg.Form("-minid %d -datatype 'DDL_RAW ' 'TPC ' -dataspec 0x%02x%02x%02x%02x", ddlno, slice, slice, part, part); | |
79 | ||
80 | publisher.Form("DP_%02d_%d", slice, part); | |
81 | AliHLTConfiguration pubconf(publisher.Data(), "AliRawReaderPublisher", NULL , arg.Data()); | |
82 | ||
83 | // first clusterfinder | |
84 | clusterFinderOutput1.Form("CF1_%02d_%d", slice, part); | |
85 | AliHLTConfiguration cfconf(clusterFinderOutput1.Data(), "TPCClusterFinderDecoder", publisher.Data(), "-timebins 446");//-timebins set to simulated data | |
86 | if (clusterHistoInput1.Length()>0) clusterHistoInput1+=" "; | |
87 | clusterHistoInput1+=clusterFinderOutput1; | |
88 | ||
89 | // second clusterfinder | |
90 | clusterFinderOutput2.Form("CF2_%02d_%d", slice, part); | |
91 | AliHLTConfiguration cfconf(clusterFinderOutput2.Data(), "TPCClusterFinderDecoder", publisher.Data(), "-timebins 446");//-timebins set to simulated data | |
92 | if (clusterHistoInput2.Length()>0) clusterHistoInput2+=" "; | |
93 | clusterHistoInput2+=clusterFinderOutput2; | |
94 | ||
95 | ||
96 | // first cluster histo component | |
97 | clusterHistoOutput1.Form("CH1_%02d_%d", slice, part); | |
98 | AliHLTConfiguration cfconf(clusterHistoOutput1.Data(), "TPCClusterHisto", clusterHistoInput1.Data(), ""); | |
99 | if (histogramHandlerInput1.Length()>0) histogramHandlerInput1+=" "; | |
100 | histogramHandlerInput1+=clusterHistoOutput1; | |
101 | ||
102 | //second cluster histo component | |
103 | clusterHistoOutput2.Form("CH2_%02d_%d", slice, part); | |
104 | AliHLTConfiguration cfconf(clusterHistoOutput2.Data(), "TPCClusterHisto", clusterHistoInput2.Data(), ""); | |
105 | if (histogramHandlerInput1.Length()>0) histogramHandlerInput1+=" "; | |
106 | histogramHandlerInput1+=clusterHistoOutput2; | |
107 | if (histogramHandlerInput2.Length()>0) histogramHandlerInput2+=" "; | |
108 | histogramHandlerInput2+=clusterHistoOutput2; | |
109 | ||
110 | } | |
111 | } | |
112 | ||
113 | // first histogram handler component | |
114 | histogramHandlerOutput1.Form("HH1_%02d_%d", slice, part); | |
115 | AliHLTConfiguration cfconf(histogramHandlerOutput1.Data(), "TPCHistogramHandler", histogramHandlerInput1.Data(), "-use-general"); | |
116 | if (rootFileWriterInput1.Length()>0) rootFileWriterInput1+=" "; | |
117 | rootFileWriterInput1+=histogramHandlerOutput1; | |
118 | ||
119 | // second histogram handler component | |
120 | histogramHandlerOutput2.Form("HH2_%02d_%d", slice, part); | |
121 | AliHLTConfiguration cfconf(histogramHandlerOutput2.Data(), "TPCHistogramHandler", histogramHandlerInput2.Data(), "-use-general"); | |
122 | if (rootFileWriterInput2.Length()>0) rootFileWriterInput2+=" "; | |
123 | rootFileWriterInput2+=histogramHandlerOutput2; | |
124 | ||
125 | AliHLTConfiguration rootFileWriter1("RootFileWriter1", "ROOTFileWriter", rootFileWriterInput1.Data() , "-datafile histogramHandlerFile1"); | |
126 | ||
127 | AliHLTConfiguration rootFileWriter2("RootFileWriter2", "ROOTFileWriter", rootFileWriterInput2.Data() , "-datafile histogramHandlerFile2"); | |
128 | ||
129 | ||
130 | /////////////////////////////////////////////////////////////////////////////////////////////////// | |
131 | // | |
132 | // Init and run the reconstruction | |
133 | // All but HLT reconstruction is switched off | |
134 | // | |
135 | AliReconstruction rec; | |
136 | rec.SetInput(input); | |
137 | rec.SetRunVertexFinder(kFALSE); | |
138 | rec.SetRunLocalReconstruction("HLT"); | |
139 | rec.SetRunTracking(""); | |
140 | rec.SetLoadAlignFromCDB(0); | |
141 | rec.SetRunQA(":"); | |
fec96a66 | 142 | //rec.SetFillESD("HLT"); |
143 | rec.SetFillESD(""); | |
144 | rec.SetFillTriggerESD(false); | |
145 | rec.SetOption("HLT", "libAliHLTUtil.so libAliHLTRCU.so libAliHLTTPC.so loglevel=0x7c chains=RootFileWriter1,RootFileWriter2"); | |
146 | rec.Run(); | |
147 | } |