+ AliFMDDebug(10, ("FMD%d%c[%2d,%3d]-%d-> 0x%x/0x%x/%04d",
+ det, ring, sector, strip, j, ddl, addr, time));
+ if (addr != prevaddr) {
+ // Flush a channel to output
+ AliFMDDebug(5, ("Now hardware address 0x%x from FMD%d%c[%2d,%3d]-%d"
+ "(b: 0x%02x, a: 0x%01x, c: 0x%02x, t: %04d), "
+ "flushing old channel at 0x%x with %d words",
+ addr, det, ring, sector, strip, j,
+ (addr >> 7), (addr >> 4) & 0x7, addr & 0xf,
+ time, prevaddr, nWords));
+ totalWords += nWords;
+ ZeroSuppress(data.fArray, nWords, peds.fArray, noise.fArray, threshold);
+ if (altro)
+ /*nBits+=*/altro->WriteChannel(prevaddr,nWords,data.fArray,threshold);
+ data.Reset(-1);
+ peds.Reset(0);
+ noise.Reset(0);
+ nWords = 0;
+ prevaddr = addr;
+ }
+ if (ddl != prevddl) {
+ AliFMDDebug(10, ("FMD: New DDL, was %d, now %d", prevddl, ddl));
+ // If an altro exists, delete the object, flushing the data to
+ // disk, and closing the file.
+ if (altro) {
+ // When the first argument is false, we write the real
+ // header.
+ AliFMDDebug(15, ("Closing output"));
+ /* nBits += */ altro->Flush();
+ /* nBits += */ altro->WriteDataHeader(kFALSE, kFALSE);
+ delete altro;
+ altro = 0;
+ }
+ prevddl = ddl;
+ // Need to open a new DDL!
+ TString filename(AliDAQ::DdlFileName(fFMD ? fFMD->GetName() : "FMD", ddl));
+ AliFMDDebug(5, ("New altro buffer with DDL file %s", filename.Data()));
+ // Create a new altro buffer - a `1' as the second argument
+ // means `write mode'
+ altro = new AliAltroBufferV3(filename.Data());
+ altro->SetMapping(pars->GetAltroMap());
+ // Write a dummy (first argument is true) header to the DDL
+ // file - later on, when we close the file, we write the real
+ // header
+ altro->WriteDataHeader(kTRUE, kFALSE);
+ }
+
+ // Get the pedestal value
+ peds[time] = pars->GetPedestal(det, ring, sector, strip);
+ noise[time] = pars->GetPedestalWidth(det, ring, sector, strip);
+
+ // Store the counts of the ADC in the channel buffer
+ AliFMDDebug(15, ("Storing FMD%d%c[%02d,%03d]-%d in timebin %d (%d)",
+ det, ring, sector, strip, j, time, preSamples));
+ data[time] = digit->Count(j);