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 activePadsTest.C
20 * @author Kenneth.Aamodt@cern.ch
22 * @brief Test macro of the active pad selection
24 * The macro reads the simulated TPC digits from the RunLoader and
25 * prints the digit info to stout.
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.
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..)
48 * NB: 10. and 11. must by now be done manually.... will change soon
49 * aliroot -b -q activePadsTest.C
53 void activePadsTest(const char* input="./"){
56 cerr << "please specify input or run without arguments" << endl;
61 /////////////////////////////////////////////////////////////////////////////////////////////////
63 // init the HLT system in order to define the analysis chain below
65 gSystem->Load("libHLTrec.so");
66 AliHLTSystem* gHLT=AliHLTReconstructorBase::GetInstance();
68 // AliCDBManager* pManager=AliCDBManager::Instance(NULL, 0);
69 // pManager->SetRun(0);
71 ///////////////////////////////////////////////////////////////////////////////////////////////////
73 // define the analysis chain to be run
80 TString digitDumpInput_OriginalData;
81 TString digitDumpInput_AfterAPSelection;
82 TString digitDumpInput_ZeroSuppressedOriginalData;
83 TString digitDumpInput_ZerosuppressedAPSelectionData;
84 TString dumpHwAddressInput;
86 for (int slice=iMinSlice; slice<=iMaxSlice; slice++) {
87 for (int part=iMinPart; part<=iMaxPart; part++) {
88 TString arg, publisher, inputAltroSelection, zsactivepadlist, zsoriginaldata, altroChannelSelector, zsACSdata, zsACSdataOutput;
89 // digit publisher components
91 if (part>1) ddlno+=72+4*slice+(part-2);
92 else ddlno+=2*slice+part;
93 arg.Form("-minid %d -datatype 'DDL_RAW ' 'TPC ' -dataspec 0x%02x%02x%02x%02x", ddlno, slice, slice, part, part);
95 publisher.Form("DP_%02d_%d", slice, part);
96 AliHLTConfiguration pubconf(publisher.Data(), "AliRawReaderPublisher", NULL , arg.Data());
97 if(digitDumpInput_OriginalData.Length() >0) digitDumpInput_OriginalData += " ";
98 digitDumpInput_OriginalData += publisher;
99 if(inputAltroSelection.Length() >0) inputAltroSelection += " ";
100 inputAltroSelection += publisher;
102 // zero suppression component (3.)
103 zsactivepadlist.Form("ZSAP_%02d_%d", slice, part);
104 AliHLTConfiguration cfconf(zsactivepadlist.Data(), "TPCZeroSuppression", publisher.Data(), "signal-threshold 2 start-timebin 70 end-timebin 900 -skip-sending-data -send-hw-list");
105 if (inputAltroSelection.Length()>0) inputAltroSelection+=" ";
106 inputAltroSelection+=zsactivepadlist;
107 if (dumpHwAddressInput.Length()>0) dumpHwAddressInput+=" ";
108 dumpHwAddressInput+=zsactivepadlist;
110 // zero suppression component (4.)
111 zsoriginaldata.Form("ZSDDL_%02d_%d", slice, part);
112 AliHLTConfiguration cfconf(zsoriginaldata.Data(), "TPCZeroSuppression", publisher.Data(), "signal-threshold 2 start-timebin 70 end-timebin 900");
113 if(digitDumpInput_ZeroSuppressedOriginalData.Length() >0) digitDumpInput_ZeroSuppressedOriginalData += " ";
114 digitDumpInput_ZeroSuppressedOriginalData += zsoriginaldata;
116 //altro channel selector
117 altroChannelSelector.Form("ACS_%02d_%d", slice, part);
118 AliHLTConfiguration cfconf(altroChannelSelector.Data(), "AltroChannelSelector", inputAltroSelection.Data(), "");
119 if(zsACSdata.Length() >0) zsACSdata += " ";
120 zsACSdata+= altroChannelSelector;
121 if(digitDumpInput_AfterAPSelection.Length() >0) digitDumpInput_AfterAPSelection += " ";
122 digitDumpInput_AfterAPSelection += altroChannelSelector;
124 // zero suppression component (8.)
125 zsACSdataOutput.Form("ZSACS_%02d_%d", slice, part);
126 AliHLTConfiguration cfconf(zsACSdataOutput.Data(), "TPCZeroSuppression", zsACSdata.Data(), "signal-threshold 2 start-timebin 70 end-timebin 900");
127 if(digitDumpInput_ZerosuppressedAPSelectionData.Length() >0) digitDumpInput_ZerosuppressedAPSelectionData += " ";
128 digitDumpInput_ZerosuppressedAPSelectionData += zsACSdataOutput;
133 AliHLTConfiguration dump1("Dump1", "TPCDigitDump", digitDumpInput_OriginalData.Data() , "-digitreader decoder -directory dump1 -unsorted -concatenate-blocks");
135 AliHLTConfiguration dump2("Dump2", "TPCDigitDump", digitDumpInput_AfterAPSelection.Data() , "-digitreader decoder -directory dump2 -unsorted -concatenate-blocks");
137 AliHLTConfiguration dump3("Dump3", "TPCDigitDump", digitDumpInput_ZeroSuppressedOriginalData.Data() , "-digitreader decoder -directory dump3 -unsorted -concatenate-blocks");
139 AliHLTConfiguration dump4("Dump4", "TPCDigitDump", digitDumpInput_ZerosuppressedAPSelectionData.Data() , "-digitreader decoder -directory dump4 -unsorted -concatenate-blocks");
141 AliHLTConfiguration dump5("Dump5", "FileWriter", dumpHwAddressInput.Data() , "-directory hwlists");
144 ///////////////////////////////////////////////////////////////////////////////////////////////////
146 // Init and run the reconstruction
147 // All but HLT reconstruction is switched off
149 AliReconstruction rec;
151 rec.SetRunVertexFinder(kFALSE);
152 rec.SetRunLocalReconstruction("HLT");
153 rec.SetRunTracking("");
154 rec.SetLoadAlignFromCDB(0);
156 AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., AliMagFMaps::k5kG);
157 AliTracker::SetFieldMap(field,kTRUE);
158 //rec.SetFillESD("HLT");
160 rec.SetFillTriggerESD(false);
161 rec.SetOption("HLT", "libAliHLTUtil.so libAliHLTRCU.so libAliHLTTPC.so loglevel=0x7c chains=Dump1,Dump2,Dump3,Dump4,Dump5");