9 #include <trg/cdc/modules/unpacker/CDCTriggerUnpackerModule.h>
10 #include <framework/core/ModuleParam.templateDetails.h>
11 #include <trg/cdc/dbobjects/CDCTriggerNeuroConfig.h>
20 using namespace CDCTriggerUnpacker;
33 using dataWord = std::bitset<wordWidth>;
57 unsigned inEventWidth,
unsigned inOffset,
58 int inHeaderSize,
const std::vector<int>& inNodeID,
59 unsigned inNInnerMergers,
int& inDelay,
63 inHeaderSize, inNodeID, inDelay, inCnttrg, inDebugLevel),
65 nInnerMergers(inNInnerMergers) {};
72 void reserve(
int subDetectorId, std::array<int, nFinesse> nWords)
override
74 if (subDetectorId != iNode) {
77 if (nWords[iFinesse] < headerSize) {
80 size_t nClocks = (nWords[iFinesse] - headerSize) / eventWidth;
83 for (
unsigned i = 0; i < nClocks; ++i) {
86 B2DEBUG(20, name <<
": " << nClocks <<
" clocks");
87 }
else if (entries != nClocks) {
88 B2DEBUG(20,
"Number of clocks in " << name <<
" conflicts with others!");
94 std::array<int*, 4> data32tab,
95 std::array<int, 4> nWords)
override
97 if (subDetectorId != iNode) {
100 if (nWords[iFinesse] < headerSize) {
101 B2DEBUG(20,
"The module " << name <<
" does not have enough data (" <<
102 nWords[iFinesse] <<
"). Nothing will be unpacked.");
108 for (
int i = headerSize; i < nWords[iFinesse]; i += eventWidth) {
109 int iclock = (i - headerSize) / eventWidth;
110 auto mergerClock = (*arrayPtr)[iclock];
111 B2DEBUG(100,
"clock " << iclock);
113 for (
unsigned j = offset; j < eventWidth; ++j) {
114 int iMerger = (eventWidth - j - 1) / 8 + nInnerMergers;
115 int pos = (eventWidth - j - 1) % 8;
116 dataWord word(data32tab[iFinesse][i + j]);
118 mergerClock->m_signal[iMerger].set(pos *
wordWidth + k, word[k]);
122 if (debugLevel >= 300) {
123 printBuffer(data32tab[iFinesse] + headerSize, eventWidth);
125 printBuffer(data32tab[iFinesse] + headerSize + eventWidth, eventWidth);
127 for (
int i = 0; i < std::accumulate(nMergers.begin(), nMergers.end(), 0); ++i) {
128 B2DEBUG(99, (*arrayPtr)[0]->m_signal[i].to_string());
138 const std::string& inName,
unsigned inEventWidth,
unsigned inOffset,
139 unsigned inHeaderSize,
const std::vector<int>& inNodeID,
140 unsigned inNumTS,
int& inDelay,
144 inDelay, inCnttrg, inDebugLevel),
145 inputArrayPtr(inArrayPtr), outputArrayPtr(outArrayPtr),
146 iTracker(std::stoul(inName.substr(inName.length() - 1))),
147 numTS(inNumTS), offsetBitWidth(inOffset) {};
168 void reserve(
int subDetectorId, std::array<int, nFinesse> nWords)
override
170 size_t nClocks = (nWords[iFinesse] - headerSize) / eventWidth;
172 if (subDetectorId == iNode) {
174 for (
unsigned i = 0; i < nClocks; ++i) {
178 for (
unsigned j = 0; j < nTrackers; ++j) {
179 for (
unsigned iAxialTSF = 0; iAxialTSF < nAxialTSF; ++iAxialTSF) {
180 inputClock->
m_signal[iAxialTSF][j].fill(zero_val);
182 outputClock->
m_signal[j].fill(zero_val);
185 B2DEBUG(20, name <<
": " << nClocks <<
" clocks");
186 }
else if (entries != nClocks) {
187 B2DEBUG(20,
"Number of clocks in " << name <<
" conflicts with others!");
202 std::array<int*, 4> data32tab,
203 std::array<int, 4> nWords)
override
205 if (subDetectorId != iNode) {
212 using halfDataWord = std::bitset<16>;
213 std::vector<halfDataWord> counters;
214 counters.reserve(inputArrayPtr->
getEntries());
215 for (
int iclock = 0; iclock < inputArrayPtr->
getEntries(); ++iclock) {
216 counters.emplace_back(data32tab[iFinesse]
217 [headerSize + eventWidth * iclock] & 0xffff);
218 B2DEBUG(100,
"iclock " << iclock <<
" --> " << counters.at(iclock).to_ulong() <<
" : " << std::hex << counters.at(iclock));
220 bool counter_correct_error =
false;
221 while (counters.at(1).to_ulong() - counters.at(0).to_ulong() != 4) {
222 std::rotate(counters.begin(), counters.begin() + 1, counters.end());
231 B2DEBUG(90,
"PHYSJG: clock counter rotation over one cycle: " << ccShift);
232 for (
const auto& c : counters) {
233 B2DEBUG(90,
"" << c.to_ulong() <<
" : " << std::hex << c);
235 counter_correct_error =
true;
239 if (counter_correct_error) {
240 B2DEBUG(20,
"PHYSJG: " << name <<
" too many clock counter rotation corrections: " << ccShift <<
" data object skipped.");
244 if (! std::is_sorted(counters.begin(), counters.end(),
245 [](halfDataWord i, halfDataWord j) {
246 return (j.to_ulong() - i.to_ulong() == 4);
248 B2DEBUG(20,
"clock counters are still out of order");
249 for (
const auto& c : counters) {
250 B2DEBUG(90,
"" << c.to_ulong());
255 B2DEBUG(15,
"shifting the first " << ccShift <<
256 " clock(s) to the end for " << name);
262 for (
int i = headerSize; i < nWords[iFinesse]; i += eventWidth) {
263 int iclock = (i - headerSize) / eventWidth - ccShift;
267 auto inputClock = (*inputArrayPtr)[iclock];
268 auto outputClock = (*outputArrayPtr)[iclock];
270 outputClock->m_signal[iTracker].fill(zero_val);
271 B2DEBUG(90,
"unpacker clock " << iclock);
272 if (debugLevel >= 300) {
273 printBuffer(data32tab[iFinesse] + headerSize + eventWidth * iclock,
277 std::array<dataWord, 2> ccword({
278 data32tab[iFinesse][i + 2], data32tab[iFinesse][i + 3]
282 for (
unsigned iTSF = 0; iTSF < nAxialTSF; ++iTSF) {
284 inputClock->m_signal[nAxialTSF - 1 - iTSF][iTracker].fill(zero_val);
286 if (firmwareVersion <
"18012600") {
300 for (
unsigned pos = 0; pos < clockCounterWidth; ++pos) {
301 const int j = (pos + iTSF * clockCounterWidth) /
wordWidth;
302 const int k = (pos + iTSF * clockCounterWidth) %
wordWidth;
319 inputClock->m_signal[nAxialTSF - 1 - iTSF][iTracker][pos] =
324 for (
unsigned pos = 0; pos < numTS * lenTS; ++pos) {
325 const int j = (offsetBitWidth + pos + iTSF * numTS * lenTS) /
wordWidth;
326 const int k = (offsetBitWidth + pos + iTSF * numTS * lenTS) %
wordWidth;
327 dataWord word(data32tab[iFinesse][i + j]);
331 inputClock->m_signal[nAxialTSF - 1 - iTSF][iTracker]
332 [clockCounterWidth + pos] = std_logic(word[
wordWidth - 1 - k]);
348 unsigned TSFWidth = clockCounterWidth + numTS * lenTS;
349 for (
unsigned pos = 0; pos < TSFWidth; ++pos) {
350 const int j = (offsetBitWidth + pos + iTSF * TSFWidth) /
wordWidth;
351 const int k = (offsetBitWidth + pos + iTSF * TSFWidth) %
wordWidth;
352 dataWord word(data32tab[iFinesse][i + j]);
353 inputClock->m_signal[nAxialTSF - 1 - iTSF][iTracker][pos] =
357 if (debugLevel >= 100) {
358 display_hex(inputClock->m_signal[nAxialTSF - 1 - iTSF][iTracker]);
362 if (firmwareVersion <
"18012600") {
367 const int outputOffset = nAxialTSF * numTS * lenTS;
368 const int oldtrackWidth = 6;
369 for (
unsigned pos = 0; pos < 732; ++pos) {
370 const int j = (offsetBitWidth + pos + outputOffset) /
wordWidth;
371 const int k = (offsetBitWidth + pos + outputOffset) %
wordWidth;
372 dataWord word(data32tab[iFinesse][i + j]);
373 outputClock->m_signal[iTracker][clockCounterWidth + oldtrackWidth + pos]
383 const int outputOffset = offsetBitWidth + nAxialTSF * numTS * lenTS + 45;
384 for (
unsigned pos = 0; pos < T2DOutputWidth; ++pos) {
385 const int j = (pos + outputOffset) /
wordWidth;
386 const int k = (pos + outputOffset) %
wordWidth;
387 dataWord word(data32tab[iFinesse][i + j]);
388 outputClock->m_signal[iTracker][clockCounterWidth + pos]
392 if (debugLevel >= 100) {
393 display_hex(outputClock->m_signal[iTracker]);
403 const std::string& inName,
unsigned inEventWidth,
unsigned inOffset,
404 unsigned inHeaderSize,
const std::vector<int>& inNodeID,
int& inDelay,
408 inDelay, inCnttrg, inDebugLevel),
410 iTracker(std::stoul(inName.substr(inName.length() - 1))),
411 offsetBitWidth(inOffset) {};
420 void reserve(
int subDetectorId, std::array<int, nFinesse> nWords)
override
422 size_t nClocks = (nWords[iFinesse] - headerSize) / eventWidth;
424 if (subDetectorId == iNode) {
426 for (
unsigned i = 0; i < nClocks; ++i) {
429 for (
unsigned j = 0; j < nTrackers; ++j) {
430 nnclock->
m_signal[j].fill(zero_val);
433 B2DEBUG(20, name <<
": " << nClocks <<
" clocks");
434 }
else if (entries != nClocks) {
435 B2DEBUG(20,
"Number of clocks in " << name <<
" conflicts with others!");
441 std::array<int*, nFinesse> data32tab,
442 std::array<int, nFinesse> nWords)
override
444 if (subDetectorId != iNode) {
449 for (
int i = headerSize; i < nWords[iFinesse]; i += eventWidth) {
450 int iclock = (i - headerSize) / eventWidth;
451 auto nnclock = (*ArrayPtr)[iclock];
452 B2DEBUG(20,
"clock " << iclock);
453 if (debugLevel >= 300) {
454 printBuffer(data32tab[iFinesse] + headerSize + eventWidth * iclock,
458 for (
unsigned pos = 0; pos < NN_WIDTH; ++pos) {
459 const int j = (offsetBitWidth + pos) /
wordWidth;
460 const int k = (offsetBitWidth + pos) %
wordWidth;
461 std::bitset<wordWidth> word(data32tab[iFinesse][i + j]);
462 nnclock->m_signal[iTracker][pos] = std_logic(word[
wordWidth - 1 - k]);
464 if (debugLevel >= 100) {
465 display_hex(nnclock->m_signal[iTracker]);
481 "whether to unpack merger data (recorded by Merger Reader / TSF)",
false);
483 "whether to unpack 2D tracker data",
false);
485 "whether to unpacker neurotrigger data",
false);
487 "flag to decode 2D finder track",
false);
489 "flag to decode input TS to 2D",
false);
491 "flag to decode neurotrigger data",
false);
501 "list of COPPER and HSLB ID of Merger reader (TSF)", defaultMergerNodeID);
509 "list of COPPER and HSLB ID of 2D tracker", defaultTracker2DNodeID);
517 "list of COPPER and HSLB ID of neurotrigger", defaultNeuroNodeID);
519 "number of words (number of bits / 32) of the B2L header", 3);
521 "Whether to align out-of-sync Belle2Link data between different sub-modules",
true);
523 "Use values stored in the payload of the ConditionsDB."
524 "This affects the output scaling of the Neurotrigger as well as the"
525 "bit configuration of its unpacker. If false, an old unpacker version with fixed scalings and old bit adresses is used.",
528 "Simulate 13 bit drift time by using 2d clock counter value.",
538 m_mergerBits.registerInDataStore(
"CDCTriggerMergerBits");
541 m_bitsTo2D.registerInDataStore(
"CDCTriggerTSFTo2DBits");
542 m_bits2DTo3D.registerInDataStore(
"CDCTrigger2DTo3DBits");
545 m_bitsNN.registerInDataStore(
"CDCTriggerNNBits");
549 m_TSHits.registerInDataStore(
"CDCTriggerSegmentHits");
562 m_NeuroInputs.registerInDataStore(
"CDCTriggerNeuroTracksInput");
570 for (
int iSL = 0; iSL < 9; iSL += 2) {
572 const int nInnerMergers = std::accumulate(
nMergers.begin(),
574 B2DEBUG(20,
"in: " << nInnerMergers);
590 m_n2DTS = m_dbn2DTS->getnTS();
591 int datasize_2D = 64;
594 }
else if (m_n2DTS == 15) {
598 for (
int iTracker = 0; iTracker < 4; ++iTracker) {
602 "Tracker2D" + std::to_string(iTracker), datasize_2D, 82,
m_headerSize,
611 "Neuro" + std::to_string(iTracker), 64, 0,
m_headerSize,
629 m_exp = bevt->getExperiment();
630 m_run = bevt->getRun();
633 B2FATAL(
"CDCTriggerNeuroConfig is not valid.");
635 B2DEBUG(2,
"Load Neurotrigger configuration for network " <<
m_cdctriggerneuroconfig->getNNName() <<
" from database ");
636 B2DEBUG(10, padright(
"Name", 50) << padright(
"start", 10) << padright(
"end", 10) << padright(
"offset", 10));
638 B2DEBUG(10, padright(x.name, 48) <<
": " << padright(std::to_string(x.start), 10) << padright(std::to_string(x.end),
639 10) << padright(std::to_string(x.offset), 10));
648 B2DEBUG(10, padright(
" ", 100));
649 B2DEBUG(10,
"----------------------------------------------------------------------------------------------------");
650 B2DEBUG(10, padright(
" ", 100));
652 std::string experimentstring =
"Experiment " + std::to_string(eventMetaData->getExperiment()) +
" Run " +
653 std::to_string(eventMetaData->getRun()) +
" Event " + std::to_string(eventMetaData->getEvent());
654 B2DEBUG(10, padright(experimentstring, 100));
659 B2DEBUG(20,
"exp<7: skip cdctrg unpacker for DQM");
664 B2DEBUG(99,
m_rawTriggers.getEntries() <<
" COPPERs in RawTRGs");
668 const int subDetectorId = rawTRG.GetNodeID(0);
671 const int nEntriesRawTRG = rawTRG.GetNumEntries();
674 B2DEBUG(99,
"nEntries of rawTRG: " << nEntriesRawTRG);
675 for (
int j = 0; j < nEntriesRawTRG; ++j) {
679 std::array<int, nFinesse> nWords;
680 std::array<int*, nFinesse> data32tab;
683 for (
int iFinesse = 0; iFinesse <
nFinesse; ++iFinesse) {
684 nWords[iFinesse] = rawTRG.GetDetectorNwords(j, iFinesse);
685 if (nWords[iFinesse] == 0) {
688 data32tab[iFinesse] = (
int*)rawTRG.GetDetectorBuffer(j, iFinesse);
693 if (trg->getHeaders(subDetectorId, data32tab, nWords)) {
694 trg->reserve(subDetectorId, nWords);
695 B2DEBUG(99,
"starting to unpack a subTrigger, subDetectorId" << std::hex << subDetectorId);
696 trg->unpack(subDetectorId, data32tab, nWords);
701 B2DEBUG(99,
"looped over entries and filled words " << nEntriesRawTRG);
703 B2DEBUG(99,
"looped over rawTriggers, unpacking 2D ");
707 for (
short iclock = 0; iclock <
m_bits2DTo3D.getEntries(); ++iclock) {
715 B2DEBUG(99,
"unpack 2D Input TS ");
717 std::array<int, 4> clockCounter2D = {0, 0, 0, 0};
718 std::array<int, 4> timeOffset2D = {0, 0, 0, 0};
720 for (
int iTracker = 0; iTracker < nTrackers; ++iTracker) {
725 std::string strInput = slv_to_bin_string(trackerData);
726 clockCounter2D[iTracker] = std::stoi(strInput.substr(0, clockCounterWidth), 0, 2);
727 int clockCounterDiff = clockCounter2D[iTracker] - clockCounter2D[0];
737 if (clockCounterDiff > 1250) {
738 clockCounterDiff -= 1280;
739 }
else if (clockCounterDiff < -1250) {
740 clockCounterDiff += 1280;
742 timeOffset2D[iTracker] = clockCounterDiff;
743 if (clockCounterDiff != 0) {
744 B2DEBUG(100,
"Adding " << clockCounterDiff <<
" clock(s) to 2D" << iTracker <<
" found time");
746 if (std::abs(clockCounterDiff) > 2) {
747 B2DEBUG(20,
"Clock counters between 2D [0," << iTracker <<
"] differ by " << clockCounterDiff <<
" clocks! (" \
748 << clockCounter2D[0] <<
", " << clockCounter2D[iTracker] <<
")");
751 for (
short iclock = 0; iclock <
m_bitsTo2D.getEntries(); ++iclock) {
752 B2DEBUG(30,
"clock " << iclock);
756 B2DEBUG(99,
"now unpack neuro ");
765 B2DEBUG(99,
" all is unpacked ##### ");
Class to hold one clock cycle of raw bit content.
SignalBus m_signal
SignalBus of the Bitstream.
static constexpr std::array< int, 9 > nMergers
data width of a single merger unit
int m_debugLevel
debug level specified in the steering file
StoreArray< RawTRG > m_rawTriggers
array containing the raw trigger data object
DBObjPtr< CDCTriggerNeuroConfig > m_cdctriggerneuroconfig
current neurotrigger config from database; used for unscaling network target
int m_headerSize
number of words (number of bits / 32) of the B2L header
int m_mergerDelay
Belle2Link delay of the merger reader.
bool m_sim13dt
bool value wether to simulate 13 bit drift time by using 2dcc
StoreArray< MergerBits > m_mergerBits
merger output bitstream
StoreArray< CDCTriggerMLPInput > m_NeuroInputs
decoded input vector for neural network
int m_NeuroCnttrg
NN cnttrg.
void initialize() override
Register input and output data.
int m_NeuroDelay
Belle2Link delay of the neurotrigger.
void event() override
convert raw data (in B2L buffer to bitstream)
NodeList m_neuroNodeID
list of (COPPER ID, HSLB ID) of neurotrigger
StoreArray< CDCTriggerUnpacker::T2DOutputBitStream > m_bits2DTo3D
bitstream of 2D output to 3D/Neuro
bool m_decodeNeuro
flag to decode neurotrigger data
void terminate() override
Delete dynamically allocated variables.
int m_2DFinderDelay
Belle2Link delay of the 2D finder.
StoreArray< CDCTriggerSegmentHit > m_TSHits
decoded track segment hit
bool m_alignFoundTime
flag to align found time in different sub-modules
bool m_unpackTracker2D
flag to unpack 2D tracker data
CDCTriggerUnpackerModule()
Constructor: Sets the description, the properties and the parameters of the module.
NodeList m_tracker2DNodeID
list of (COPPER ID, HSLB ID) of 2D tracker
StoreArray< CDCTriggerSegmentHit > m_NNInputTSHitsAll
all decoded stereo track segment hits from the neural network input
StoreArray< CDCTriggerTrack > m_2DFinderTracks
decoded 2D finder track
void beginRun() override
begin Run
bool m_decodeTSHit
flag to decode track segment
StoreArray< CDCTriggerTrack > m_NeuroTracks
decoded Neuro tracks
StoreArray< CDCTriggerTrack > m_NNInput2DFinderTracks
decoded 2D finder tracks from the neural network input
int m_2DFinderCnttrg
2D cnttrg
bool m_decode2DFinderInputTS
flag to decode 2D finder input TS
StoreArray< CDCTriggerUnpacker::NNBitStream > m_bitsNN
bitstream of Neuro input and output (including intermediate results)
NodeList m_mergerNodeID
list of (COPPER ID, HSLB ID) of Merger reader (TSF)
StoreArray< CDCTriggerFinderClone > m_2DFinderClones
additional information of the 2D finder track
StoreArray< CDCTriggerUnpacker::TSFOutputBitStream > m_bitsTo2D
bitstream of TSF output to 2D tracker
StoreArray< CDCTriggerSegmentHit > m_NNInputTSHits
decoded track segment hits from the neural network input
bool m_unpackNeuro
flag to unpack neurotrigger data
std::vector< SubTrigger * > m_subTrigger
vector holding the pointers to all the dynamically allocated SubTriggers
bool m_decode2DFinderTrack
flag to decode 2D finder track
bool m_useDB
bool value for wether to use the conditions database
bool m_unpackMerger
flag to unpack merger data (recorded by Merger Reader / TSF)
int getDebugLevel() const
Returns the configured debug messaging level.
void setDescription(const std::string &description)
Sets the description of the module.
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
void setReturnValue(int value)
Sets the return value for this module as integer.
@ c_ParallelProcessingCertified
This module can be run in parallel processing mode safely (All I/O must be done through the data stor...
LogConfig & getLogConfig()
Returns the log system configuration.
Accessor to arrays stored in the data store.
T * appendNew()
Construct a new T object at the end of the array.
int getEntries() const
Get the number of objects in the array.
Type-safe access to single objects in the data store.
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
static constexpr int wordWidth
width of a single word in the raw int buffer
static constexpr int nFinesse
Number of FINESSE in the copper.
static constexpr int mergerWidth
Merger data width.
std::vector< std::vector< int > > NodeList
Node list.
Abstract base class for different kinds of events.
unpacker for the merger reader (TSF which reads the merger output)
StoreArray< MergerBits > * arrayPtr
pointer to the merger output Bitstream
void reserve(int subDetectorId, std::array< int, nFinesse > nWords) override
reserve enough number of clocks (entries) in the Bitstream StoreArray
unsigned nInnerMergers
number of merger units in the inner super layer than this one
void unpack(int subDetectorId, std::array< int *, 4 > data32tab, std::array< int, 4 > nWords) override
Unpack function.
Merger(StoreArray< MergerBits > *inArrayPtr, const std::string &inName, unsigned inEventWidth, unsigned inOffset, int inHeaderSize, const std::vector< int > &inNodeID, unsigned inNInnerMergers, int &inDelay, int &inCnttrg, int inDebugLevel)
Constructor.
void reserve(int subDetectorId, std::array< int, nFinesse > nWords) override
Calculate the number of clocks in the data, reserve that much of clocks in the Bitstream(s)
StoreArray< NNBitStream > * ArrayPtr
Array pointer for NN.
unsigned offsetBitWidth
Offset bit width.
Neuro(StoreArray< NNBitStream > *arrPtr, const std::string &inName, unsigned inEventWidth, unsigned inOffset, unsigned inHeaderSize, const std::vector< int > &inNodeID, int &inDelay, int &inCnttrg, int inDebugLevel)
Constructor.
unsigned iTracker
Tracker board ID.
void unpack(int subDetectorId, std::array< int *, nFinesse > data32tab, std::array< int, nFinesse > nWords) override
Unpack the Belle2Link data and fill the Bitstream.
enum class SubTriggerType : unsigned char {Merger, TSF, T2D, T3D, Neuro, ETF};
unpacker for the 2D tracker
StoreArray< T2DOutputBitStream > * outputArrayPtr
pointer to the Bitstream of 2D output to 3D/Neuro
void reserve(int subDetectorId, std::array< int, nFinesse > nWords) override
Calculate the number of clocks in the data, reserve that much of clocks in the Bitstream(s)
Tracker2D(StoreArray< TSFOutputBitStream > *inArrayPtr, StoreArray< T2DOutputBitStream > *outArrayPtr, const std::string &inName, unsigned inEventWidth, unsigned inOffset, unsigned inHeaderSize, const std::vector< int > &inNodeID, unsigned inNumTS, int &inDelay, int &inCnttrg, int inDebugLevel)
constructor
void unpack(int subDetectorId, std::array< int *, 4 > data32tab, std::array< int, 4 > nWords) override
Unpack the Belle2Link data and fill the Bitstream.
unsigned offsetBitWidth
starting point of the input data in an Belle2Link event
unsigned iTracker
ID of the 2D tracker (0 to 3)
unsigned numTS
Number of TS sent to 2D (0 to 20)
StoreArray< TSFOutputBitStream > * inputArrayPtr
pointer to the Bitstream of 2D input