Put the beans in a bowl, cover with plenty of water and soak overnight.
Preheat the oven to 160ºC.Drain the beans and put them into a large ovenproof casserole dish with the celery, half the rosemary, the carrots and the quartered onion. Add plenty of pepper and cover with water (enough to cover the beans by about 3-4cm). Bring to the boil on the hob, then cover and transfer to the oven.Bake for 1 hour.
Remove the carrot and celery, then add the rest of the rosemary, the chopped onion and the garlic.
Heat the olive oil in a frying pan and brown the bacon and the pork then add to the casserole dish as well. Stir in the molasses, mustard, sugar, tomato purée and chilli. Season well. Bring to the boil on the hob again, then transfer to the oven, leaving the pan uncovered. Bake for 3 hrs (maybe longer), gently turning the beans over a couple of times and checking the level of the liquid. You want it to reduce so that you are left with a thick mass, not too liquidy, but you don’t want the beans to get too dry.
When the beans have an hour left to cook, taste them and decide whether you want to add the cider vinegar – it cuts the sweetness. In the last hour of cooking, leave the beans so that they get a nice baked crust on top