Changeset 61 for tools


Ignore:
Timestamp:
06/16/09 14:38:46 (16 years ago)
Author:
ogrimm
Message:
Updated event data format
File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/ddd/Functions.cpp

    r60 r61  
    9292      EventHeaderDisplay->clear();
    9393      break;
    94     default:
     94    default:  // Print event header and trigger cell information from event data
    9595      rewind(Tmpfile);
    9696      QTextStream in(Tmpfile);
    9797      QString text = in.readAll();
     98      text.append("\nTrigger cells: ");
     99      for (unsigned int i=0; i<RD->RHeader->NBoards*RD->RHeader->NChips; i++) {
     100        QString a;
     101        text.append(a.sprintf("%d ", *((int *)RD->Data + i)));
     102      }
    98103      EventHeaderDisplay->setPlainText(text);
     104     
    99105      // Case data in double format required by qwt library
    100106      double* x = new double [RD->RHeader->Samples];
     
    103109      for (unsigned int i=0; i<RD->RHeader->Samples; i++) {
    104110        x[i] = (double) (i/RD->BStruct[BoardNo->value()].NomFreq);
    105         y[i] = (double) RD->Data[BoardNo->value()*RD->RHeader->NChips*RD->RHeader->NChannels *
    106                  RD->RHeader->Samples+ChannelNo->value()*RD->RHeader->Samples+i]*RD->BStruct[BoardNo->value()].ScaleFactor;
     111        y[i] = (double) *((short *) (RD->Data + RD->RHeader->NBoards*RD->RHeader->NChips*sizeof(int)) + BoardNo->value()*RD->RHeader->NChips*RD->RHeader->NChannels *
     112                 RD->RHeader->Samples+ChannelNo->value()*RD->RHeader->Samples+i)*RD->BStruct[BoardNo->value()].ScaleFactor;
    107113      }
    108114      Signal->setData(x, y, RD->RHeader->Samples);
     
    150156              for(int l=StartBin; l<(StopBin+1); l++){
    151157               
    152                 float sample = RD->Data[i*RD->RHeader->NChips*RD->RHeader->NChannels*RD->RHeader->Samples+
     158/*              float sample = RD->Data[i*RD->RHeader->NChips*RD->RHeader->NChannels*RD->RHeader->Samples+
    153159                                        j*RD->RHeader->NChannels*RD->RHeader->Samples+
    154160                                        k*RD->RHeader->Samples+
    155161                                        l]*RD->BStruct[i].ScaleFactor;
     162 */
     163                float sample = *((short *) (RD->Data + RD->RHeader->NBoards*RD->RHeader->NChips*sizeof(int)) +
     164                                        i*RD->RHeader->NChips*RD->RHeader->NChannels*RD->RHeader->Samples+
     165                                        j*RD->RHeader->NChannels*RD->RHeader->Samples+
     166                                        k*RD->RHeader->Samples+
     167                                        l)*RD->BStruct[i].ScaleFactor;
    156168                               
    157169                if (sample > z[binx][biny]) {
Note: See TracChangeset for help on using the changeset viewer.