Skip to content

Commit aa42bfe

Browse files
author
Cristian Pena
committed
update
1 parent 9e6117f commit aa42bfe

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

DT5742/testBinary.cc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ int main()
4242
float channelCorrected[18][1024];
4343

4444
tree->Branch("event", &event, "event/I");
45-
tree->Branch("raw", raw, "raw[18][1024]/S");
46-
tree->Branch("channel", channel, "channel[18][1024]/S");
45+
tree->Branch("raw", raw, "raw[18][1024]/F");
46+
tree->Branch("channel", channel, "channel[18][1024]/F");
4747
tree->Branch("time", time, "time[2][1024]/F");
4848

4949
int event_size = 73752;
@@ -56,6 +56,7 @@ int main()
5656
event = 0;
5757
for( int ievent = 0; ievent < nevents; ievent++)
5858
{
59+
if ( ievent % 1000 == 0 ) std::cout << "[INFO]: processing event #" << ievent << std::endl;
5960
// copy the file into the buffer:
6061
result = fread (buffer,1,event_size,pFile);
6162
//std::cout << result << " " << ievent << std::endl;
@@ -70,7 +71,7 @@ int main()
7071
{
7172
//channel[j][i] = buffer[i+6+j*1024];
7273
raw[j][i] = buffer[i+6+j*1024];
73-
channel[j][i] = ( raw[j][i] - 2047 )/4096 ;
74+
channel[j][i] = ( raw[j][i] - 2047. )/4096. ;//converting to volts [V]
7475
//std::cout << "i = " << i << " ; j = " << j << " ; raw[j][i] = " << raw[j][i] << " ; channel[j][i] = " << channel[j][i] << std::endl;
7576
}
7677
}

0 commit comments

Comments
 (0)