- else if (ldc == 1) {
- name = name2;
- }
- if (fDebug) {
- Info("Raw2Digit","Open the LDC input file %s",name);
- }
- inputFile = new ifstream(name, ios::in | ios::binary);
-
- // Read the LDC header
- byte_p = (unsigned char *) headerLDC;
- inputFile->read(byte_p,kLDCHeaderLength);
-
- if (fDebug > 1) {
- Info("Raw2Digit","LDC header no. %d:",ldc);
- Info("Raw2Digit","\tflag = %d",*byte_p++);
- Info("Raw2Digit","\tldc no = %d",*byte_p++);
- Info("Raw2Digit","\tndet = %d",*byte_p++);
- Info("Raw2Digit","\tempty = %d",*byte_p++);
- Info("Raw2Digit","\tempty = %d",*byte_p++);
- Info("Raw2Digit","\tempty = %d",*byte_p++);
- Info("Raw2Digit","\tempty = %d",*byte_p++);
- Info("Raw2Digit","\tempty = %d",*byte_p++);
- }
-
- // Loop through the subevents
- byte_p = (unsigned char *) headerSubevent;
- while (inputFile->read(byte_p,kSubeventHeaderLength)) {
-
- Int_t flag = *byte_p++;
- Int_t detl = *byte_p++;
- Int_t deth = *byte_p++;
- Int_t det = detl + (deth << 8);
- Int_t nbytel = *byte_p++;
- Int_t nbyteh = *byte_p++;
- nbyte = nbytel + (nbyteh << 8);
- Int_t npadsl = *byte_p++;
- Int_t npadsh = *byte_p++;
- npads = npadsl + (npadsh << 8);
- if (fDebug > 2) {
- Info("Raw2Digit","Subevent header:");
- Info("Raw2Digit","\tflag = %d",flag);
- Info("Raw2Digit","\tdet = %d",det);
- Info("Raw2Digit","\tnbyte = %d",nbyte);
- Info("Raw2Digit","\tnpads = %d",npads);
- Info("Raw2Digit","\tempty = %d",*byte_p++);
- }
-
- // Create the data buffer
- Int_t cham = geo->GetChamber(det);
- Int_t plan = geo->GetPlane(det);
- Int_t sect = geo->GetSector(det);
- Int_t rowMax = par->GetRowMax(plan,cham,sect);
- Int_t colMax = par->GetColMax(plan);
- Int_t timeMax = par->GetTimeMax();
- Int_t bufferMax = rowMax*colMax*timeMax;
- int *buffer = new int[bufferMax];
- byte_p = (unsigned char *) buffer;
- memset(buffer,0,bufferMax*sizeof(int));
-
- // Add a container for the digits of this detector
- digits = fDigitsManager->GetDigits(det);
- // Allocate memory space for the digits buffer
- if (digits->GetNtime() == 0) {
- digits->Allocate(rowMax,colMax,timeMax);
- }