An accusatory pleading may charge two or more different offenses connected together in their commission, or different statements of the same offense or two or more different offenses of the same class of crimes or offenses, under separate counts, and if two or more accusatory pleadings are filed in such cases in the same court, the court may order them to be consolidated. The prosecution is not required to elect between the different offenses or counts set forth in the accusatory pleading, but the defendant may be convicted of any number of the offenses charged, and each offense of which the defendant is convicted must be stated in the verdict or the finding of the court; provided, that the court in which a case is triable, in the interests of justice and for good cause shown, may in its discretion order that the different offenses or counts set forth in the accusatory pleading be tried separately or divided into two or more groups and each of said groups tried separately. An acquittal of one or more counts shall not be deemed an acquittal of any other count.
Ca. Pen. Code § 954