File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff 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;
Original file line number Diff line number Diff line change 8585# -------------------- clean --------------------
8686
8787clean :
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
You can’t perform that action at this time.
0 commit comments