1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 ////////////////////////////////////
20 // MUON Raw Data generaton in ALICE-MUON
21 // This class version 3 (further details could be found in Alice-note)
23 // Implemented non-constant buspatch numbers for tracking
24 // with correct DDL id (first guess)
25 // (Ch. Finck, dec 2005)
28 // Generates raw data for MUON tracker and finally for trigger
29 // Using real mapping (inverse) for tracker
30 // For trigger there is no mapping (mapping could be found in AliMUONTriggerCircuit)
32 // Use memcpy instead of assignment elt by elt
33 // Introducing variable DSP numbers, real manu numbers per buspatch for st12
34 // Implemented scaler event for Trigger
37 ////////////////////////////////////
39 #include "AliMUONRawWriter.h"
41 #include "AliBitPacking.h"
42 #include "AliRawReader.h"
45 #include "AliMUONConstants.h"
47 #include "AliMUONDarcHeader.h"
48 #include "AliMUONRegHeader.h"
49 #include "AliMUONLocalStruct.h"
50 #include "AliMUONDspHeader.h"
51 #include "AliMUONBlockHeader.h"
53 #include "AliMUONData.h"
54 #include "AliMUONDigit.h"
55 #include "AliMUONGlobalTrigger.h"
56 #include "AliMUONLocalTrigger.h"
58 #include "AliMpBusPatch.h"
59 #include "AliMpDEManager.h"
61 #include "AliMpPlaneType.h"
62 #include "AliMpSegFactory.h"
63 #include "AliMpStationType.h"
64 #include "AliMpVSegmentation.h"
66 #include "TClonesArray.h"
68 ClassImp(AliMUONRawWriter) // Class implementation in ROOT context
70 Int_t AliMUONRawWriter::fgManuPerBusSwp1B[12] = {1, 27, 53, 79, 105, 131, 157, 183, 201, 214, 224, 232};
71 Int_t AliMUONRawWriter::fgManuPerBusSwp1NB[12] = {1, 27, 53, 79, 105, 131, 157, 183, 201, 214, 225, 233};
73 Int_t AliMUONRawWriter::fgManuPerBusSwp2B[12] = {1, 27, 53, 79, 105, 131, 157, 183, 201, 214, 226, 246};
74 Int_t AliMUONRawWriter::fgManuPerBusSwp2NB[12] = {1, 27, 53, 79, 105, 131, 157, 183, 201, 214, 227, 245};
77 //__________________________________________________________________________
78 AliMUONRawWriter::AliMUONRawWriter(AliMUONData* data)
83 // Standard Constructor
85 AliDebug(1,"Standard ctor");
87 // initialize container
91 fBusArray = new TClonesArray("AliMUONBusStruct",1000);
92 fBusArray->SetOwner(kTRUE);
95 fBlockHeader = new AliMUONBlockHeader();
96 fDspHeader = new AliMUONDspHeader();
97 fBusStruct = new AliMUONBusStruct();
99 fDarcHeader = new AliMUONDarcHeader();
100 fRegHeader = new AliMUONRegHeader();
101 fLocalStruct = new AliMUONLocalStruct();
103 fBusPatchManager = new AliMpBusPatch();
104 fBusPatchManager->ReadBusPatchFile();
106 fSegFactory = new AliMpSegFactory();
108 fTrackerTimer.Start(kTRUE); fTrackerTimer.Stop();
109 fTriggerTimer.Start(kTRUE); fTriggerTimer.Stop();
110 fMappingTimer.Start(kTRUE); fMappingTimer.Stop();
114 //__________________________________________________________________________
115 AliMUONRawWriter::AliMUONRawWriter()
125 fScalerEvent(kFALSE),
129 // Default Constructor
131 AliDebug(1,"Default ctor");
132 fFile[0] = fFile[1] = 0x0;
133 fTrackerTimer.Start(kTRUE); fTrackerTimer.Stop();
134 fTriggerTimer.Start(kTRUE); fTriggerTimer.Stop();
135 fMappingTimer.Start(kTRUE); fMappingTimer.Stop();
138 //_______________________________________________________________________
139 AliMUONRawWriter::AliMUONRawWriter (const AliMUONRawWriter& rhs)
143 // Protected copy constructor
145 AliFatal("Not implemented.");
148 //_______________________________________________________________________
150 AliMUONRawWriter::operator=(const AliMUONRawWriter& rhs)
153 // Protected assignement operator
155 if (this == &rhs) return *this;
157 AliFatal("Not implemented.");
162 //__________________________________________________________________________
163 AliMUONRawWriter::~AliMUONRawWriter(void)
179 delete fBusPatchManager;
183 AliInfo(Form("Execution time for MUON tracker : R:%.2fs C:%.2fs",
184 fTrackerTimer.RealTime(),fTrackerTimer.CpuTime()));
185 AliInfo(Form(" Execution time for MUON tracker (mapping calls part) "
187 fMappingTimer.RealTime(),fMappingTimer.CpuTime()));
188 AliInfo(Form("Execution time for MUON trigger : R:%.2fs C:%.2fs",
189 fTriggerTimer.RealTime(),fTriggerTimer.CpuTime()));
192 //____________________________________________________________________
193 Int_t AliMUONRawWriter::Digits2Raw()
196 // convert digits of the current event to raw data
201 fMUONData->GetLoader()->LoadDigits("READ");
203 fMUONData->SetTreeAddress("D,GLT");
205 fMUONData->ResetDigits();
206 fMUONData->ResetTrigger();
208 // This will get both tracker and trigger digits.
209 fMUONData->GetDigits();
213 for (Int_t ich = 0; ich < AliMUONConstants::NTrackingCh(); ich++)
216 idDDL = ich * 2 + 0x900; // official number for MUON
217 sprintf(name, "MUON_%d.ddl",idDDL);
218 fFile[0] = fopen(name,"w");
220 idDDL = (ich * 2) + 1 + 0x900;
221 sprintf(name, "MUON_%d.ddl",idDDL);
222 fFile[1] = fopen(name,"w");
224 WriteTrackerDDL(ich);
234 idDDL = 0xA00;// official number for MUTR
235 sprintf(name, "MUTR_%d.ddl",idDDL);
236 fFile[0] = fopen(name,"w");
239 sprintf(name, "MUTR_%d.ddl",idDDL);
240 fFile[1] = fopen(name,"w");
248 fMUONData->ResetDigits();
249 fMUONData->ResetTrigger();
250 fMUONData->GetLoader()->UnloadDigits();
255 //____________________________________________________________________
256 Int_t AliMUONRawWriter::WriteTrackerDDL(Int_t iCh)
258 // writing DDL for tracker
259 // used inverse mapping
261 fTrackerTimer.Start(kFALSE);
264 static const Int_t kMAXADC = (1<<12)-1; // We code the charge on a 12 bits ADC.
267 TClonesArray* muonDigits = 0;
280 Int_t headerSize = sizeof(fHeader)/4;
282 // DDL event one per half chamber
287 UChar_t channelId = 0;
289 Int_t busPatchId = 0;
293 Int_t totalBlkLength;
297 Int_t totalDDLLength;
313 const AliMUONDigit* digit;
315 AliDebug(3, Form("WriteDDL chamber %d\n", iCh+1));
317 muonDigits = fMUONData->Digits(iCh);
319 nDigits = muonDigits->GetEntriesFast();
320 AliDebug(3,Form("ndigits = %d\n",nDigits));
323 for (Int_t idig = 0; idig < nDigits; idig++) {
325 digit = (AliMUONDigit*) muonDigits->UncheckedAt(idig);
327 padX = digit->PadX();
328 padY = digit->PadY();
329 charge = digit->ADC();
330 if ( charge > kMAXADC )
332 // This is most probably an error in the digitizer (which should insure
333 // the adc is below kMAXADC), so make it a (non-fatal) error indeed.
334 AliError(Form("adc value %d above %x. Setting to %x",
335 charge,kMAXADC,kMAXADC));
338 cathode = digit->Cathode();
339 detElemId = digit->DetElemId();
342 busPatchId = GetBusPatch(*digit);
343 if (busPatchId<0) continue;
345 if ( digit->ManuId() > 0x7FF || digit->ManuId() < 0 ||
346 digit->ManuChannel() > 0x3F || digit->ManuChannel() < 0 )
348 StdoutToAliError(digit->Print(););
349 AliFatal("ManuId,ManuChannel are invalid for the digit above.");
352 manuId = ( digit->ManuId() & 0x7FF ); // 11 bits
353 channelId = ( digit->ManuChannel() & 0x3F ); // 6 bits
355 AliDebug(3,Form("input IdDE %d busPatchId %d PadX %d PadY %d iCath %d \n",
356 detElemId, busPatchId, padX, padY, cathode));
358 AliDebug(3,Form("busPatchId %d, manuId %d channelId %d\n", busPatchId, manuId, channelId ));
361 AliBitPacking::PackWord((UInt_t)parity,word,29,31);
362 AliBitPacking::PackWord((UInt_t)manuId,word,18,28);
363 AliBitPacking::PackWord((UInt_t)channelId,word,12,17);
364 AliBitPacking::PackWord((UInt_t)charge,word,0,11);
367 fBusStruct->SetLength(0);
368 fBusStruct->AddData(word);
369 fBusStruct->SetBusPatchId(busPatchId);
371 // storing the number of identical buspatches
372 nbInBus[busPatchId]++;
373 AddData(*fBusStruct);
377 // sorting by buspatch
380 // gather datas from same bus patch
381 nEntries = fBusArray->GetEntriesFast();
383 for (Int_t i = 0; i < nEntries; i++) {
384 AliMUONBusStruct* temp = (AliMUONBusStruct*)fBusArray->At(i);
385 busPatchId = temp->GetBusPatchId();
387 // add bus patch header, length and total length managed by subevent class
388 temp->SetTriggerWord(0xdeadbeef);
389 for (Int_t j = 0; j < nbInBus[busPatchId]-1; j++) {
390 AliMUONBusStruct* temp1 = (AliMUONBusStruct*)fBusArray->At(++i);
391 temp->AddData(temp1->GetData(0));
392 fBusArray->RemoveAt(i) ;
395 fBusArray->Compress();
397 if (AliLog::GetGlobalDebugLevel() == 3) {
398 nEntries = fBusArray->GetEntriesFast();
399 for (Int_t i = 0; i < nEntries; i++) {
400 AliMUONBusStruct* temp = (AliMUONBusStruct*)fBusArray->At(i);
401 printf("busPatchid back %d\n",temp->GetBusPatchId());
402 for (Int_t j = 0; j < temp->GetLength(); j++) {
403 printf("manuId back %d, ",temp->GetManuId(j));
404 printf("channelId back %d, ",temp->GetChannelId(j));
405 printf("charge back %d\n",temp->GetCharge(j));
411 // getting info for the number of buspatches
414 Int_t iBusPerDSP[5];//number of bus patches per DSP
415 Int_t iDspMax; //number max of DSP per block
417 fBusPatchManager->GetDspInfo(iCh, iDspMax, iBusPerDSP);
419 TArrayI* vec = fBusPatchManager->GetBusfromDE((iCh+1)*100);
421 Int_t iBus0AtCh = vec->At(0); //get first bus patch id for a given ich
423 AliDebug(3,Form("iBus0AtCh %d", iBus0AtCh));
425 iBusPatch = iBus0AtCh - 1; // starting point for each chamber
427 // nEntries = fBusArray->GetEntriesFast();
428 AliMUONBusStruct* temp = 0x0;
430 // open DDL file, on per 1/2 chamber
431 for (Int_t iDDL = 0; iDDL < 2; iDDL++) {
436 buffer = new Int_t [(2048+24)*50]; // 24 words in average for one buspatch and 2048 manu info at most
442 // two blocks A and B per DDL
443 for (Int_t iBlock = 0; iBlock < 2; iBlock++) {
446 length = fBlockHeader->GetHeaderLength();
447 memcpy(&buffer[index],fBlockHeader->GetHeader(),length*4);
451 // 5 DSP's max per block
452 for (Int_t iDsp = 0; iDsp < iDspMax; iDsp++) {
455 length = fDspHeader->GetHeaderLength();
456 memcpy(&buffer[index],fDspHeader->GetHeader(),length*4);
460 //Â 5 buspatches max per DSP
461 for (Int_t i = 0; i < iBusPerDSP[iDsp]; i++) {
464 if ((fBusPatchManager->GetDDLfromBus(iBusPatch) % 2) == 0) // comparing to DDL file
469 AliDebug(3,Form("iCh %d iDDL %d iBlock %d iDsp %d busPatchId %d", iCh, iDDL, iBlock, iDsp, iBusPatch));
471 nEntries = fBusArray->GetEntriesFast();
473 for (Int_t iEntries = 0; iEntries < nEntries; iEntries++) { // method "bourrique"...
474 temp = (AliMUONBusStruct*)fBusArray->At(iEntries);
475 busPatchId = temp->GetBusPatchId();
476 if (busPatchId == iBusPatch) break;
478 AliDebug(3,Form("busPatchId %d", temp->GetBusPatchId()));
481 // check if buspatchid has digit
482 if (busPatchId != -1) {
483 // add bus patch structure
484 length = temp->GetHeaderLength();
485 memcpy(&buffer[index],temp->GetBusPatchHeader(),length*4);
487 for (Int_t j = 0; j < temp->GetLength(); j++) {
488 buffer[index++] = temp->GetData(j);
489 AliDebug(3,Form("busPatchId %d, manuId %d channelId %d\n", temp->GetBusPatchId(),
490 temp->GetManuId(j), temp->GetChannelId(j) ));
492 // fBusArray->RemoveAt(iEntries);
493 // fBusArray->Compress();
495 // writting anyhow buspatch structure (empty ones)
496 buffer[index++] = 4; // total length
497 buffer[index++] = 0; // raw data length
498 buffer[index++] = iBusPatch; // bus patch
499 buffer[index++] = 0xdeadbeef; // trigger word
503 buffer[indexDsp] = index - indexDsp; // dsp total length
504 buffer[indexDsp+1] = index - indexDsp - fDspHeader->GetHeaderLength();
505 if ((index - indexDsp) % 2 == 0) // event word
506 buffer[indexDsp+7] = 0;
508 buffer[indexDsp+7] = 1;
512 totalBlkLength = index - indexBlk;
513 blkLength = totalBlkLength - fBlockHeader->GetHeaderLength();
514 totalDDLLength += totalBlkLength;
516 buffer[indexBlk] = totalBlkLength; // total block length
517 buffer[indexBlk+1] = blkLength;
519 if ((totalBlkLength % 2) == 1) { //add padding word for 64bits transfert
520 buffer[indexBlk] += 1; // correct length for padding word
521 buffer[indexBlk+1] += 1;
525 Int_t indexCopy = indexBlk + fBlockHeader->GetHeaderLength();
526 Int_t *buf = new Int_t [blkLength];
528 memcpy(&buf[0], &buffer[indexCopy], blkLength*4);// copy in tmp buffer
529 memcpy(&buffer[indexCopy+1], &buf[0], blkLength*4); // re-copy buffer one elt shifted
531 buffer[indexCopy] = 0xDEAD; // mark padding word
532 } // padding condition
538 fHeader.fSize = (totalDDLLength + headerSize) * 4;// total length in bytes
539 fwrite((char*)(&fHeader),headerSize*4,1,fFile[iFile]);
540 fwrite(buffer,sizeof(int),index,fFile[iFile]);
545 fTrackerTimer.Stop();
549 //____________________________________________________________________
550 Int_t AliMUONRawWriter::GetBusPatch(const AliMUONDigit& digit)
553 // Determine the BusPatch this digit belongs to.
555 fMappingTimer.Start(kFALSE);
559 // information from digits
560 Int_t detElemId = digit.DetElemId();
562 AliMpVSegmentation* seg =
563 fSegFactory->CreateMpSegmentationByElectronics(detElemId, digit.ManuId());
565 AliMpPlaneType plane = seg->PlaneType();
567 AliMpStationType stationType = AliMpDEManager::GetStationType(detElemId);
569 if ( stationType == kStation1 || stationType == kStation2 )
571 if (plane == kBendingPlane)
573 ptr = &fgManuPerBusSwp1B[0];
577 ptr = &fgManuPerBusSwp1NB[0];
582 if (plane == kBendingPlane)
584 ptr = &fgManuPerBusSwp2B[0];
588 ptr = &fgManuPerBusSwp2NB[0];
592 // Getting buspatch id
593 TArrayI* vec = fBusPatchManager->GetBusfromDE(detElemId);
596 Int_t m = ( digit.ManuId() & 0x3FF ); // remove bit 10
597 //FIXME : how can we remove that condition
598 // on the 10-th bit ? All the rest need not any knowledge about it,
599 // can't we find a way to get manu<->buspatch transparent to this too ?
601 if ( stationType == kStation1 || stationType == kStation2 )
603 for (Int_t i = 0; i < 12; i++)
605 if (m >= *(ptr + pos++)) break;
610 // offset of 100 in manuId for following bus patch
614 if (pos >(Int_t) vec->GetSize())
616 AliError(Form("pos greater %d than size %d manuId %d detElemId %d \n",
617 pos, (Int_t)vec->GetSize(), digit.ManuId(), detElemId));
618 AliError(Form("Chamber %s Plane %s manuId %d m %d",
619 StationTypeName(stationType).Data(),
620 PlaneTypeName(plane).Data(),
626 Int_t busPatchId = vec->At(pos);
628 fMappingTimer.Stop();
633 //____________________________________________________________________
634 Int_t AliMUONRawWriter::WriteTriggerDDL()
639 fTriggerTimer.Start(kFALSE);
641 // DDL event one per half chamber
643 // stored local id number
644 TArrayI isFired(256);
649 Int_t headerSize = sizeof(AliRawDataHeader)/4;
651 TClonesArray* localTrigger;
652 TClonesArray* globalTrigger;
653 AliMUONGlobalTrigger* gloTrg;
654 AliMUONLocalTrigger* locTrg = 0x0;
656 // global trigger for trigger pattern
657 globalTrigger = fMUONData->GlobalTrigger();
658 gloTrg = (AliMUONGlobalTrigger*)globalTrigger->UncheckedAt(0);
659 Int_t gloTrigPat = gloTrg->GetGlobalPattern();
662 localTrigger = fMUONData->LocalTrigger();
668 Int_t iLocCard, locCard;
669 Char_t locDec, trigY, posY, posX,regOut;
671 Int_t version = 1; // software version
672 Int_t eventType = 1; // trigger type: 1 for physics ?
673 Int_t serialNb = 0xF; // serial nb of card: all bits on for the moment
674 Int_t globalFlag = 1; // set to 2 if global info present in DDL else set to 1
677 eventType = 2; //set to generate scaler events
679 Int_t nEntries = (Int_t) (localTrigger->GetEntries());// 234 local cards
680 // stored the local card id that's fired
681 for (Int_t i = 0; i < nEntries; i++) {
682 locTrg = (AliMUONLocalTrigger*)localTrigger->At(i);
683 isFired[locTrg->LoCircuit()] = 1; // storing local boards with informations
687 AliInfo("No Trigger information available");
690 // [16(local)*51 words + 16 words]*8(reg) + 6 + 12 + 6 words scaler event 6672 words
691 buffer = new Int_t [6680];
693 // [16(local)*6 words + 5 words]*8(reg) + 10 words = 818
694 buffer = new Int_t [818];
697 // open DDL file, on per 1/2 chamber
698 for (Int_t iDDL = 0; iDDL < 2; iDDL++) {
703 // set darc status word
704 AliBitPacking::PackWord((UInt_t)iDDL+1,word,28,31); //see AliMUONDDLTrigger.h for details
705 AliBitPacking::PackWord((UInt_t)serialNb,word,24,27);
706 AliBitPacking::PackWord((UInt_t)version,word,16,23);
707 AliBitPacking::PackWord((UInt_t)eventType,word,12,15);
709 if (iDDL == 0) // suppose global info in DDL one
714 AliBitPacking::PackWord((UInt_t)globalFlag,word,8,11);
715 fDarcHeader->SetWord(word);
716 buffer[index++] = word;
719 fDarcHeader->SetGlobalOutput(gloTrigPat);// no global input for the moment....
721 fDarcHeader->SetGlobalOutput(0);
724 // 6 DARC scaler words
725 memcpy(&buffer[index], fDarcHeader->GetDarcScalers(),fDarcHeader->GetDarcScalerLength()*4);
726 index += fDarcHeader->GetDarcScalerLength();
729 buffer[index++] = fDarcHeader->GetEndOfDarc();
731 // 4 words of global board input + Global board output
732 memcpy(&buffer[index], fDarcHeader->GetGlobalInput(), (fDarcHeader->GetHeaderLength()-1)*4);
733 index += fDarcHeader->GetHeaderLength() - 1; // kind tricky cos scaler info in-between Darc header
736 // 10 Global scaler words
737 memcpy(fDarcHeader->GetGlobalScalers(), &buffer[index], fDarcHeader->GetGlobalScalerLength()*4);
738 index += fDarcHeader->GetGlobalScalerLength();
741 // end of global word
742 buffer[index++] = fDarcHeader->GetEndOfGlobal();
744 // 8 regional cards per DDL
745 for (Int_t iReg = 0; iReg < 8; iReg++) {
747 // Regional card header
750 // set darc status word
751 fRegHeader->SetDarcWord(word);
754 AliBitPacking::PackWord((UInt_t)serialNb,word,24,28); //see AliMUONLocalStruct.h for details
755 AliBitPacking::PackWord((UInt_t)version,word,16,23);
756 AliBitPacking::PackWord((UInt_t)iReg,word,12,15);
757 AliBitPacking::PackWord((UInt_t)regOut,word,0,7); // whenever regional output will be implemented
759 fRegHeader->SetWord(word);
760 memcpy(&buffer[index],fRegHeader->GetHeader(),fRegHeader->GetHeaderLength()*4);
761 index += fRegHeader->GetHeaderLength();
763 // 11 regional scaler word
765 memcpy(&buffer[index], fRegHeader->GetScalers(), fRegHeader->GetScalerLength()*4);
766 index += fRegHeader->GetScalerLength();
769 // end of regional word
770 buffer[index++] = fRegHeader->GetEndOfReg();
772 // 16 local card per regional board
773 for (Int_t iLoc = 0; iLoc < 16; iLoc++) {
775 iLocCard = iLoc + iReg*16 + iDDL*128;
777 if (isFired[iLocCard]) {
778 locTrg = (AliMUONLocalTrigger*)localTrigger->At(iEntries);
779 locCard = locTrg->LoCircuit();
780 locDec = locTrg->GetLoDecision();
782 posY = locTrg->LoStripY();
783 posX = locTrg->LoStripX();
784 devX = locTrg->LoDev();
785 AliDebug(4,Form("loctrg %d, posX %d, posY %d, devX %d\n",
786 locTrg->LoCircuit(),locTrg->LoStripX(),locTrg->LoStripY(),locTrg->LoDev()));
787 } else { //no trigger (see PRR chpt 3.4)
788 locCard = -1; // not possible on 4 bits
798 AliBitPacking::PackWord((UInt_t)(iLocCard % 16),word,19,22); //card id number in crate
799 AliBitPacking::PackWord((UInt_t)locDec,word,15,18);
800 AliBitPacking::PackWord((UInt_t)trigY,word,14,14);
801 AliBitPacking::PackWord((UInt_t)posY,word,10,13);
802 AliBitPacking::PackWord((UInt_t)devX,word,5,9);
803 AliBitPacking::PackWord((UInt_t)posX,word,0,4);
805 if (locCard == iLocCard) {
806 // add local cards structure
807 buffer[index++] = (locTrg->GetX1Pattern() | (locTrg->GetX2Pattern() << 16));
808 buffer[index++] = (locTrg->GetX3Pattern() | (locTrg->GetX4Pattern() << 16));
809 buffer[index++] = (locTrg->GetY1Pattern() | (locTrg->GetY2Pattern() << 16));
810 buffer[index++] = (locTrg->GetY3Pattern() | (locTrg->GetY4Pattern() << 16));
811 buffer[index++] = (Int_t)word; // data word
812 if (iEntries < nEntries-1)
815 buffer[index++] = 0; // 4 words for x1, x2, y1, y2
819 buffer[index++] = (Int_t)word; // data word
822 // 45 regional scaler word
824 memcpy(&buffer[index], fLocalStruct->GetScalers(), fLocalStruct->GetScalerLength()*4);
825 index += fLocalStruct->GetScalerLength();
828 // end of local structure words
829 buffer[index++] = fLocalStruct->GetEndOfLocal();
836 // writting onto disk
838 fHeader.fSize = (index + headerSize) * 4;// total length in bytes
839 fwrite((char*)(&fHeader),headerSize*4,1,fFile[iDDL]);
840 fwrite(buffer,sizeof(int),index,fFile[iDDL]);
845 fTriggerTimer.Stop();