Estimating count data models with endogenous switching: Sample selection and endogenous treatment effects