From 3dcae0cc6c79e22adea4996a5c10c99f4b6431a5 Mon Sep 17 00:00:00 2001 From: richterm Date: Fri, 15 Feb 2008 12:24:53 +0000 Subject: [PATCH] AltroChannelSelector component moved to libAliHLTRCU --- .../AliHLTAltroChannelSelectorComponent.cxx | 5 +- .../AliHLTAltroChannelSelectorComponent.h | 4 +- HLT/RCU/AliHLTRCUAgent.cxx | 2 + .../macros/altro-channel-selection.C | 60 +++++++++++-------- HLT/TPCLib/AliHLTTPCAgent.cxx | 2 - HLT/libAliHLTRCU.pkg | 3 +- HLT/libAliHLTTPC.pkg | 1 - 7 files changed, 43 insertions(+), 34 deletions(-) rename HLT/{TPCLib => RCU}/AliHLTAltroChannelSelectorComponent.cxx (98%) rename HLT/{TPCLib => RCU}/AliHLTAltroChannelSelectorComponent.h (97%) rename HLT/{TPCLib => RCU}/macros/altro-channel-selection.C (63%) diff --git a/HLT/TPCLib/AliHLTAltroChannelSelectorComponent.cxx b/HLT/RCU/AliHLTAltroChannelSelectorComponent.cxx similarity index 98% rename from HLT/TPCLib/AliHLTAltroChannelSelectorComponent.cxx rename to HLT/RCU/AliHLTAltroChannelSelectorComponent.cxx index e7fca5f7540..7f31cad9c2d 100644 --- a/HLT/TPCLib/AliHLTAltroChannelSelectorComponent.cxx +++ b/HLT/RCU/AliHLTAltroChannelSelectorComponent.cxx @@ -19,7 +19,7 @@ /** @file AliHLTAltroChannelSelectorComponent.cxx @author Matthias Richter @date - @brief A filter/selective readout component for TPC Altro data. */ + @brief A filter/selective readout component for Altro data. */ // see header file for class documentation // or @@ -29,8 +29,6 @@ #include #include "AliHLTAltroChannelSelectorComponent.h" -#include "AliHLTTPCTransform.h" -#include "AliHLTTPCDefinitions.h" #include "AliAltroDecoder.h" #include "AliAltroData.h" @@ -188,6 +186,7 @@ int AliHLTAltroChannelSelectorComponent::DoEvent(const AliHLTComponentEventData& if (iResult<0) { // forward the whole block outputBlocks.push_back(*pDesc); + iResult=0; continue; } diff --git a/HLT/TPCLib/AliHLTAltroChannelSelectorComponent.h b/HLT/RCU/AliHLTAltroChannelSelectorComponent.h similarity index 97% rename from HLT/TPCLib/AliHLTAltroChannelSelectorComponent.h rename to HLT/RCU/AliHLTAltroChannelSelectorComponent.h index 03294a65a01..50ad0c74a46 100644 --- a/HLT/TPCLib/AliHLTAltroChannelSelectorComponent.h +++ b/HLT/RCU/AliHLTAltroChannelSelectorComponent.h @@ -10,7 +10,7 @@ /** @file AliHLTAltroChannelSelectorComponent.h @author Matthias Richter @date - @brief Special file writer converting TPC digit input to ASCII. + @brief A filter/selective readout component for Altro data. */ // see below for class documentation @@ -33,7 +33,7 @@ * Altro Raw data. * * Component ID: \b AltroChannelSelector
- * Library: \b libAliHLTTPC + * Library: \b libAliHLTRCU * * Mandatory arguments:
* diff --git a/HLT/RCU/AliHLTRCUAgent.cxx b/HLT/RCU/AliHLTRCUAgent.cxx index 83f60d164fa..0d59618d29b 100644 --- a/HLT/RCU/AliHLTRCUAgent.cxx +++ b/HLT/RCU/AliHLTRCUAgent.cxx @@ -27,6 +27,7 @@ #include "AliHLTConfiguration.h" // header files of library components +#include "AliHLTAltroChannelSelectorComponent.h" /** global instance for agent registration */ AliHLTRCUAgent gAliHLTRCUAgent; @@ -74,5 +75,6 @@ int AliHLTRCUAgent::RegisterComponents(AliHLTComponentHandler* pHandler) const // see header file for class documentation assert(pHandler); if (!pHandler) return -EINVAL; + pHandler->AddComponent(new AliHLTAltroChannelSelectorComponent); return 0; } diff --git a/HLT/TPCLib/macros/altro-channel-selection.C b/HLT/RCU/macros/altro-channel-selection.C similarity index 63% rename from HLT/TPCLib/macros/altro-channel-selection.C rename to HLT/RCU/macros/altro-channel-selection.C index 47f86906fd0..e4c5cfd9db1 100644 --- a/HLT/TPCLib/macros/altro-channel-selection.C +++ b/HLT/RCU/macros/altro-channel-selection.C @@ -1,14 +1,24 @@ // $Id$ -/* +/** * Test macro for the AltroChannelSelector component * * Usage: * aliroot -b -q altro-channel-selection.C | tee altro-channel-selection.C * + * The macro expects simulated TPC raw data in the form TPC_.dll in the + * current directory, you might need to start the macro in one of the raw + * folders. You can easily change the sectors and readout partitions below. + * + * In order to apply the macro on real RCU v1 data (only on trailer word) + * you have to specify the trailer length explicitly, look for the + * * The first version allows to write a fake file with the list of the - * selected pads. Later it will be extended to use the ClusterFinder + * selected channels. Later it will be extended to use the ClusterFinder * or, better, a separate component. * + * Please note that this macro uses also the TPC module, but this does not + * imply dependencies to the libAliHLTTPC. + * * Matthias.Richter@ift.uib.no */ { @@ -22,33 +32,26 @@ // load the component library gHLT.LoadComponentLibraries("libAliHLTTPC.so"); + gHLT.LoadComponentLibraries("libAliHLTRCU.so"); // create a dummy pad selection list - const char* dummySelectionList="/tmp/active-pads.dat"; + const char* dummySelectionList="/tmp/active-channels.dat"; FILE* fp = fopen(dummySelectionList, "w"); if (fp) { - UInt_t row=0; - UInt_t pad=0; + UShort_t channel=5; + fwrite(&channel, sizeof(UShort_t), 1, fp); - row=28, pad=5; - fwrite(&row, sizeof(UInt_t), 1, fp); - fwrite(&pad, sizeof(UInt_t), 1, fp); + UShort_t channel=25; + fwrite(&channel, sizeof(UShort_t), 1, fp); - row=28, pad=6; - fwrite(&row, sizeof(UInt_t), 1, fp); - fwrite(&pad, sizeof(UInt_t), 1, fp); + UShort_t channel=56; + fwrite(&channel, sizeof(UShort_t), 1, fp); - row=28, pad=7; - fwrite(&row, sizeof(UInt_t), 1, fp); - fwrite(&pad, sizeof(UInt_t), 1, fp); + UShort_t channel=78; + fwrite(&channel, sizeof(UShort_t), 1, fp); - row=29, pad=42; - fwrite(&row, sizeof(UInt_t), 1, fp); - fwrite(&pad, sizeof(UInt_t), 1, fp); - - row=29, pad=43; - fwrite(&row, sizeof(UInt_t), 1, fp); - fwrite(&pad, sizeof(UInt_t), 1, fp); + UShort_t channel=100; + fwrite(&channel, sizeof(UShort_t), 1, fp); fclose(fp); } else { @@ -59,6 +62,9 @@ // direct dump switch allows to bypass the selector component bool directDump=false; + // choose if you want to dump to file or translate digits to text file + bool textDump=true; + // the configuration int iMinSlice=0; int iMaxSlice=0; @@ -80,7 +86,7 @@ // publisher for a dummy active pad list activepads.Form("APP_%02d_%d", slice, part); - arg.Form("-datatype 'ACTIVPAD' 'TPC ' -dataspec 0x%02x%02x%02x%02x -datafile %s", slice, slice, part, part, dummySelectionList); + arg.Form("-datatype 'HWADDR16' 'TPC ' -dataspec 0x%02x%02x%02x%02x -datafile %s", slice, slice, part, part, dummySelectionList); AliHLTConfiguration appconf(activepads.Data(), "FilePublisher", NULL , arg.Data()); @@ -90,7 +96,7 @@ // the selector configuration selector.Form("CHANNELSELECT_%02d_%d", slice, part); - AliHLTConfiguration channelselect(selector.Data(), "AltroChannelSelector", selectorInput.Data(), "-rawreadermode 4"); + AliHLTConfiguration channelselect(selector.Data(), "AltroChannelSelector", selectorInput.Data(), ""); // add either the raw file directly to output or the filtered one if (writerInput.Length()>0) writerInput+=" "; @@ -103,8 +109,12 @@ } // the writer configuration - AliHLTConfiguration digitdump("digitdump", "TPCDigitDump" , writerInput.Data(), "-rawreadermode 4 -specfmt=_0x%08x -subdir=out_%d -blcknofmt=_0x%x -idfmt=_0x%08x"); - //AliHLTConfiguration digitdump("digitdump", "FileWriter" , writerInput.Data(), "-specfmt=_0x%08x -subdir=out_%d -blcknofmt=_0x%x -idfmt=_0x%08x"); + if (textDump) + AliHLTConfiguration digitdump("digitdump", "TPCDigitDump" , writerInput.Data(), "-specfmt=_0x%08x -subdir=out_%d -blcknofmt=_0x%x -idfmt=_0x%08x"); + else + AliHLTConfiguration digitdump("digitdump", "FileWriter" , writerInput.Data(), "-specfmt=_0x%08x -subdir=out_%d -blcknofmt=_0x%x -idfmt=_0x%08x"); + + // build the ask list and execute gHLT.BuildTaskList("digitdump"); gHLT.Run(); diff --git a/HLT/TPCLib/AliHLTTPCAgent.cxx b/HLT/TPCLib/AliHLTTPCAgent.cxx index 230b632a1d2..e5fbd45c78d 100644 --- a/HLT/TPCLib/AliHLTTPCAgent.cxx +++ b/HLT/TPCLib/AliHLTTPCAgent.cxx @@ -29,7 +29,6 @@ AliHLTTPCAgent gAliHLTTPCAgent; // component headers -#include "AliHLTAltroChannelSelectorComponent.h" #include "AliHLTTPCDigitDumpComponent.h" #include "AliHLTTPCEsdWriterComponent.h" @@ -119,7 +118,6 @@ int AliHLTTPCAgent::RegisterComponents(AliHLTComponentHandler* pHandler) const { // see header file for class documentation if (!pHandler) return -EINVAL; - pHandler->AddComponent(new AliHLTAltroChannelSelectorComponent); pHandler->AddComponent(new AliHLTTPCDigitDumpComponent); pHandler->AddComponent(new AliHLTTPCEsdWriterComponent::AliWriter); pHandler->AddComponent(new AliHLTTPCEsdWriterComponent::AliConverter); diff --git a/HLT/libAliHLTRCU.pkg b/HLT/libAliHLTRCU.pkg index 0ac8b985934..9bbf4fcf5bf 100644 --- a/HLT/libAliHLTRCU.pkg +++ b/HLT/libAliHLTRCU.pkg @@ -3,7 +3,8 @@ include $(MODDIR)/hlt.conf -CLASS_HDRS:= AliHLTRCUAgent.h +CLASS_HDRS:= AliHLTAltroChannelSelectorComponent.h \ + AliHLTRCUAgent.h MODULE_SRCS= $(CLASS_HDRS:.h=.cxx) diff --git a/HLT/libAliHLTTPC.pkg b/HLT/libAliHLTTPC.pkg index 85a4028e324..5d0fe97917a 100644 --- a/HLT/libAliHLTTPC.pkg +++ b/HLT/libAliHLTTPC.pkg @@ -18,7 +18,6 @@ CLASS_HDRS:= AliHLTTPCTransform.h \ AliHLTTPCDigitReaderRaw.h \ AliHLTTPCDigitReaderDecoder.h \ AliHLTTPCDigitDumpComponent.h \ - AliHLTAltroChannelSelectorComponent.h \ AliHLTTPCZeroSuppressionComponent.h \ AliHLTTPCVertex.h \ AliHLTTPCVertexArray.h \ -- 2.43.0