Dynamic Causal Structure Discovery and Causal Effect Estimation