Changeset 61
- Timestamp:
- 06/16/09 14:38:46 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/ddd/Functions.cpp
r60 r61 92 92 EventHeaderDisplay->clear(); 93 93 break; 94 default: 94 default: // Print event header and trigger cell information from event data 95 95 rewind(Tmpfile); 96 96 QTextStream in(Tmpfile); 97 97 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 } 98 103 EventHeaderDisplay->setPlainText(text); 104 99 105 // Case data in double format required by qwt library 100 106 double* x = new double [RD->RHeader->Samples]; … … 103 109 for (unsigned int i=0; i<RD->RHeader->Samples; i++) { 104 110 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; 107 113 } 108 114 Signal->setData(x, y, RD->RHeader->Samples); … … 150 156 for(int l=StartBin; l<(StopBin+1); l++){ 151 157 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+ 153 159 j*RD->RHeader->NChannels*RD->RHeader->Samples+ 154 160 k*RD->RHeader->Samples+ 155 161 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; 156 168 157 169 if (sample > z[binx][biny]) {
Note:
See TracChangeset
for help on using the changeset viewer.