Skip to content

Commit 076f40f

Browse files
Added correct CFD for DESCANT
1 parent 1d5e865 commit 076f40f

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

Converter.cc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,21 @@ bool Converter::Run() {
273273
case 8030://red
274274
case 8040://white
275275
case 8050://yellow
276+
{
276277
mnemonic = Form("DSC%02dXN00X", fDetNumber);
278+
// calculate cfd (0 - 8 ns) in 1/256 ns
279+
int cfd = fTime*256e9;
280+
cfd = cfd%1024;//1024 = 256 steps for 0 - 8 ns
281+
// calculate remainder between 8 ns timestamp and 10 ns timestamp
282+
int rem = fTime*1e9;
283+
rem = rem%40;
284+
if(rem < 8) rem = 0;
285+
else if(rem < 16) rem = 8;
286+
else if(rem < 24) rem = 6;
287+
else if(rem < 32) rem = 4;
288+
else rem = 2;
289+
fFragments[address].SetCfd((rem << 22) | cfd);
290+
}
277291
break;
278292
default:
279293
std::cerr<<"Sorry, unknown system ID "<<fSystemID<<std::endl;

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,4 +85,4 @@ tar:
8585
# -------------------- clean --------------------
8686

8787
clean:
88-
rm -f $(NAME) lib$(NAME).so *.o $(NAME)Dictionary.cc $(NAME)Dictionary.h
88+
@rm -f $(NAME) lib$(NAME).so *.o $(NAME)Dictionary.cc $(NAME)Dictionary.h

0 commit comments

Comments
 (0)