#!/bin/tcsh

foreach theta (2.0 4.0 7.0 10.0 15.0 20.0)
	echo "Processing for theta="$theta

	# Run hdgeant
	cat control.in.tmpl | sed -e s/THETA/$theta/g > control.in
	./hdgeant
	
	# mcsmear
	./mcsmear -n hdgeant_theta${theta}.hddm

	# Run hd_root
	./hd_root --plugin=cdc_hists --plugin=track_hists --plugin=trackeff_hists2 --nthreads=2 -PDEFTAG:DTrackCandidate=THROWN -PTRKFIT:MAX_FIT_ITERATIONS=0 hdgeant_theta${theta}_smeared.hddm -o hd_root_theta${theta}.root

	
end

