1) Preheat the oven to 220C/Gas 8. Slice each tomato into 8 wedges and discard the seeds. Put the tomato wedges and garlic into a 23cm by 33cm roasting pan. Drizzle with 1 tbsp of olive oil and sprinkle with salt and a few turns of pepper. Roast in the oven, uncovered, for 40 mins.
2) Drain the beans into a large colander in the sink. Cook the pasta in a saucepan of boiling water according to the directions on the package. Drain the pasta into the colander containing the beans, so the hot pasta water will warm the beans. Return the drained pasta and beans to the pasta saucepan.
3) When the tomatoes are done, pick out the garlic cloves, squeeze the garlic out of the skin into a small bowl and mash with a fork. Pour the roasted tomatoes into the pasta saucepan, add the garlic, the remaining 1 tbsp of olive oil, the basil and additional salt and pepper, to taste. Toss to combine. Serve hot topped with the Parmesan.