Not that there is no connection between terrorism and muslim immigration at all, but it won't be very effective either imo, and the connection is hugely exaggerated by right wing politicians and media.
If you look at all the attacks that have happened, the vast majority are second/third generation. Plus you punish millions of people for crimes they have no part in, and fuel tensions between the Christian/western world and Muslims even more.
It's a very complicated topic really, as most are important ones are. Effective police work can prevent a lot of attacks, other than that I believe the best bet is doing as much as possible to combat the social exclusion that is at the background of virtually all attacks. It's a very broad challenge of course, but has a lot of advantages in other areas as well.
Oh, and targeting radicalizing groups, centers & institutions is probably very important. Here of course the police will need both need a legal framework to work with, which doesn't exist in every European country afaik, as well as a real understanding of the issue and how to handle it. Otherwise, many Muslim communities & individuals will be treated and targeted unfairly, which could easily and even understandably lead to even greater distance between them and mainstream society.