]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/TPCLib/macros/activePadsTest.C
Renaming AliHLTReconstructorBase to AliHLTPluginBase to reflect the
[u/mrichter/AliRoot.git] / HLT / TPCLib / macros / activePadsTest.C
CommitLineData
436467f5 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 activePadsTest.C
20 * @author Kenneth.Aamodt@cern.ch
21 * @date
22 * @brief Test macro of the active pad selection
23 *
24 * The macro reads the simulated TPC digits from the RunLoader and
25 * prints the digit info to stout.
26 *
27 * The macro reads ddl data and apply zerosuppression on it. The zerosuppression
28 * component then ships out a list of pads in addition to the zerosuppressed data.
29 * This list of pads is here used in combination with the original raw data to
30 * remove all pads with no data surviving the zerosuppression with the altro
31 * selection component. This is to study undershoot of signals etc. The output of
32 * altro selection component is the NON zerosuppressed data of all the pads which
33 * there should be a signal in. To test this the macro runs in several steps.
34 * Point 3 and 4 has to be done in this way to avoid confusion in what ddl data is
35 * read by the component.
36 * 1. read the data.
37 * 2. dump it to file. (will be compared to the zerosuppressed data later)
38 * 3. apply zerosuppression producing activepads list
39 * 4. apply zerosuppression producing zerosuppressed data.
40 * 5. dump the data from 4. to file
41 * 6. send the active pad list together with the original data to the altro selection component
42 * 7. dump the reduced data to file
43 * 8. again apply zero suppression to this reduced data
44 * 9. dump the result from zero suppression from 8.(on the reduced data)
45 * 10. compare the outputs from 2 and 7 at see that they are different (if not; this is not a good test) (diff dump1/ev.... dump2/ev...)
46 * 11. compare the outputs from 5. and 9. to see that they are alike. (diff dump3/ev... dump4/ev..)
47 *
48 * NB: 10. and 11. must by now be done manually.... will change soon
49 * aliroot -b -q activePadsTest.C
50 *
51 */
52
53void activePadsTest(const char* input="./"){
54
55 if (!input) {
56 cerr << "please specify input or run without arguments" << endl;
57 return;
58 }
59
60
61 /////////////////////////////////////////////////////////////////////////////////////////////////
62 //
63 // init the HLT system in order to define the analysis chain below
64 //
7bf6c76d 65 AliHLTSystem* gHLT=AliHLTPluginBase::GetInstance();
436467f5 66
67// AliCDBManager* pManager=AliCDBManager::Instance(NULL, 0);
68// pManager->SetRun(0);
69
70 ///////////////////////////////////////////////////////////////////////////////////////////////////
71 //
72 // define the analysis chain to be run
73 //
74
75 int iMinSlice=8;
76 int iMaxSlice=8;
77 int iMinPart=2;
78 int iMaxPart=2;
79 TString digitDumpInput_OriginalData;
80 TString digitDumpInput_AfterAPSelection;
81 TString digitDumpInput_ZeroSuppressedOriginalData;
82 TString digitDumpInput_ZerosuppressedAPSelectionData;
83 TString dumpHwAddressInput;
84
85 for (int slice=iMinSlice; slice<=iMaxSlice; slice++) {
86 for (int part=iMinPart; part<=iMaxPart; part++) {
87 TString arg, publisher, inputAltroSelection, zsactivepadlist, zsoriginaldata, altroChannelSelector, zsACSdata, zsACSdataOutput;
88 // digit publisher components
89 int ddlno=768;
90 if (part>1) ddlno+=72+4*slice+(part-2);
91 else ddlno+=2*slice+part;
03df9065 92 arg.Form("-minid %d -datatype 'DDL_RAW ' 'TPC ' -dataspec 0x%02x%02x%02x%02x -verbose", ddlno, slice, slice, part, part);
436467f5 93
94 publisher.Form("DP_%02d_%d", slice, part);
95 AliHLTConfiguration pubconf(publisher.Data(), "AliRawReaderPublisher", NULL , arg.Data());
96 if(digitDumpInput_OriginalData.Length() >0) digitDumpInput_OriginalData += " ";
97 digitDumpInput_OriginalData += publisher;
98 if(inputAltroSelection.Length() >0) inputAltroSelection += " ";
99 inputAltroSelection += publisher;
100
101 // zero suppression component (3.)
102 zsactivepadlist.Form("ZSAP_%02d_%d", slice, part);
103 AliHLTConfiguration cfconf(zsactivepadlist.Data(), "TPCZeroSuppression", publisher.Data(), "signal-threshold 2 start-timebin 70 end-timebin 900 -skip-sending-data -send-hw-list");
104 if (inputAltroSelection.Length()>0) inputAltroSelection+=" ";
105 inputAltroSelection+=zsactivepadlist;
106 if (dumpHwAddressInput.Length()>0) dumpHwAddressInput+=" ";
107 dumpHwAddressInput+=zsactivepadlist;
108
109 // zero suppression component (4.)
110 zsoriginaldata.Form("ZSDDL_%02d_%d", slice, part);
111 AliHLTConfiguration cfconf(zsoriginaldata.Data(), "TPCZeroSuppression", publisher.Data(), "signal-threshold 2 start-timebin 70 end-timebin 900");
112 if(digitDumpInput_ZeroSuppressedOriginalData.Length() >0) digitDumpInput_ZeroSuppressedOriginalData += " ";
113 digitDumpInput_ZeroSuppressedOriginalData += zsoriginaldata;
114
115 //altro channel selector
116 altroChannelSelector.Form("ACS_%02d_%d", slice, part);
117 AliHLTConfiguration cfconf(altroChannelSelector.Data(), "AltroChannelSelector", inputAltroSelection.Data(), "");
118 if(zsACSdata.Length() >0) zsACSdata += " ";
119 zsACSdata+= altroChannelSelector;
120 if(digitDumpInput_AfterAPSelection.Length() >0) digitDumpInput_AfterAPSelection += " ";
121 digitDumpInput_AfterAPSelection += altroChannelSelector;
122
123 // zero suppression component (8.)
124 zsACSdataOutput.Form("ZSACS_%02d_%d", slice, part);
125 AliHLTConfiguration cfconf(zsACSdataOutput.Data(), "TPCZeroSuppression", zsACSdata.Data(), "signal-threshold 2 start-timebin 70 end-timebin 900");
126 if(digitDumpInput_ZerosuppressedAPSelectionData.Length() >0) digitDumpInput_ZerosuppressedAPSelectionData += " ";
127 digitDumpInput_ZerosuppressedAPSelectionData += zsACSdataOutput;
128
129 }
130 }
131 //Dumping data (2.)
fec96a66 132 AliHLTConfiguration dump1("Dump1", "TPCDigitDump", digitDumpInput_OriginalData.Data() , "-digitreader decoder -directory dump1 -unsorted -concatenate-blocks");
436467f5 133 //Dumping data (7.)
fec96a66 134 AliHLTConfiguration dump2("Dump2", "TPCDigitDump", digitDumpInput_AfterAPSelection.Data() , "-digitreader decoder -directory dump2 -unsorted -concatenate-blocks");
436467f5 135 //Dumping data (5.)
fec96a66 136 AliHLTConfiguration dump3("Dump3", "TPCDigitDump", digitDumpInput_ZeroSuppressedOriginalData.Data() , "-digitreader decoder -directory dump3 -unsorted -concatenate-blocks");
436467f5 137 //Dumping data (9.)
fec96a66 138 AliHLTConfiguration dump4("Dump4", "TPCDigitDump", digitDumpInput_ZerosuppressedAPSelectionData.Data() , "-digitreader decoder -directory dump4 -unsorted -concatenate-blocks");
436467f5 139 //Dumping hw lists
140 AliHLTConfiguration dump5("Dump5", "FileWriter", dumpHwAddressInput.Data() , "-directory hwlists");
141
142
143 ///////////////////////////////////////////////////////////////////////////////////////////////////
144 //
145 // Init and run the reconstruction
146 // All but HLT reconstruction is switched off
147 //
148 AliReconstruction rec;
149 rec.SetInput(input);
150 rec.SetRunVertexFinder(kFALSE);
151 rec.SetRunLocalReconstruction("HLT");
152 rec.SetRunTracking("");
153 rec.SetLoadAlignFromCDB(0);
154 rec.SetRunQA(":");
436467f5 155 //rec.SetFillESD("HLT");
156 rec.SetFillESD("");
157 rec.SetFillTriggerESD(false);
158 rec.SetOption("HLT", "libAliHLTUtil.so libAliHLTRCU.so libAliHLTTPC.so loglevel=0x7c chains=Dump1,Dump2,Dump3,Dump4,Dump5");
159 rec.Run();
160}