2 //**************************************************************************
3 //* This file is property of and copyright by the ALICE HLT Project *
4 //* ALICE Experiment at CERN, All rights reserved. *
6 //* Primary Authors Kenneth Aamodt <kenneth.aamodt@cern.ch> *
7 //* for The ALICE HLT Project. *
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 //**************************************************************************
19 * @file histogramHandlerTest.C
20 * @author Kenneth.Aamodt@cern.ch
22 * @brief Test macro for histogram handler
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...
34 void histogramHandlerTest(const char* input="./"){
37 cerr << "please specify input or run without arguments" << endl;
42 /////////////////////////////////////////////////////////////////////////////////////////////////
44 // init the HLT system in order to define the analysis chain below
46 AliHLTSystem* gHLT=AliHLTPluginBase::GetInstance();
48 ///////////////////////////////////////////////////////////////////////////////////////////////////
50 // define the analysis chain to be run
58 TString histogramHandlerInput1;
59 TString histogramHandlerInput2;
60 TString histogramHandlerOutput1;
61 TString histogramHandlerOutput2;
62 TString rootFileWriterInput1;
63 TString rootFileWriterInput2;
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
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);
80 publisher.Form("DP_%02d_%d", slice, part);
81 AliHLTConfiguration pubconf(publisher.Data(), "AliRawReaderPublisher", NULL , arg.Data());
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;
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;
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;
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;
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;
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;
125 AliHLTConfiguration rootFileWriter1("RootFileWriter1", "ROOTFileWriter", rootFileWriterInput1.Data() , "-datafile histogramHandlerFile1");
127 AliHLTConfiguration rootFileWriter2("RootFileWriter2", "ROOTFileWriter", rootFileWriterInput2.Data() , "-datafile histogramHandlerFile2");
130 ///////////////////////////////////////////////////////////////////////////////////////////////////
132 // Init and run the reconstruction
133 // All but HLT reconstruction is switched off
135 AliReconstruction rec;
137 rec.SetRunVertexFinder(kFALSE);
138 rec.SetRunLocalReconstruction("HLT");
139 rec.SetRunTracking("");
140 rec.SetLoadAlignFromCDB(0);
142 //rec.SetFillESD("HLT");
144 rec.SetFillTriggerESD(false);
145 rec.SetOption("HLT", "libAliHLTUtil.so libAliHLTRCU.so libAliHLTTPC.so loglevel=0x7c chains=RootFileWriter1,RootFileWriter2");