
239 Cal.App.2d 881 (1966)
THE PEOPLE, Plaintiff and Respondent,
v.
GUSTOV RICHARD SCHALETZKE, Defendant and Appellant.
Crim. No. 10441. 
California Court of Appeals. Second Dist., Div. Three.  
Feb. 3, 1966.
 Burton Marks for Defendant and Appellant.
 Thomas C. Lynch, Attorney General, William E. James, Assistant Attorney General, and Rose-Marie Gruenwald, Deputy Attorney General, for Plaintiff and Respondent.
 DRUCKER, J. pro tem.  [fn. *]
 Defendant bases his appeal from the judgment on the grounds that the court did not *883 fulfill its duty when it sentenced the defendant to state prison instead of committing him to the state hospital pursuant to sections 5512 and 5518 of the Welfare and Institutions Code; and that such commitment to prison without treatment of a mentally disordered sex offender inflicts cruel and unusual punishment and deprives defendant of equal protection and due process of law.
 A plea of guilty to violation of section 288, Penal Code, was entered by defendant. The issue of a prior conviction charged against him was deferred until the time of hearing on probation and sentence. The case was referred to the probation department for investigation and report, and two psychiatrists were appointed to examine the defendant to ascertain if the defendant was a mentally disordered sex offender.
 At the hearing on probation and sentence the trial judge considered the reports of the probation officer and doctors. The probation report raised the issue of eligibility for hospital commitment because of the record of a prior felony conviction.  [fn. 1] Each of the doctors reported defendant to be "a mentally disordered sex offender" and dangerous to the health and safety of others. Following the recommendation of the doctors, the judge found the defendant to be a probable mentally disordered sex offender and ordered him placed at Atascadero State Hospital for observation and diagnosis for a period not to exceed 90 days. The issue of the prior conviction was held in abeyance pending the determination of the issue of sexual psychopathy.
 In due time the trial judge received a report from the superintendent of Atascadero. Criminal proceedings were reinstated, a supplemental probation report was ordered and the matter set down for hearing. In the proceeding that followed, defendant filed a petition for a "writ of audita querela" on the issue of the prior conviction wherein it was alleged that the defendant was previously convicted of violation of 647a with a prior 647a, Penal Code. The defendant sought to be relieved from the consequences of the first conviction of 647a, and hence from the prior, contending, in effect, that he was convicted without a trial. The petition was denied after the court considered evidence in relation thereto, but made no finding on the prior.
 The superintendent of Atascadero certified to the court *884 after a diagnostic study of the defendant: "This patient is a mentally disordered sex offender, but he is not amenable to treatment in a hospital setting. Society still needs to be protected from him. He should be returned to the criminal court for action. We recommend that he be sentenced for the criminal act if sentencing is mandatory, or if he is charged with a felony." The report also contained the following information relating to the defendant: "He was previously arrested on June 9, 1956, for violation of section 647a of the Penal Code when he was involved with a ten year old boy. He was given two years probation. He was again arrested April 11, 1957, charged with violation of section 647a, P.C., with a prior. He was sent to Atascadero State Hospital where he remained three months. He received a year in the county jail and four years probation. ..."
 After considering the reports of the probation officer and hospital superintendent, probation was denied and the defendant was sentenced to state prison. The court stated at that time "... that the denial of probation was not based in any particular on the alleged prior precluding the Court from granting probation. It was based on the entire consideration of the case."
 The essence of appellant's first contention, "that it was the duty of the court to refer the defendant to the Director of Mental Hygiene ... and not to state prison ..." is that it was mandatory for the court to do so. It may also be interpreted to mean that the court abused its discretion in failing to do so. Under either interpretation, the point so raised is not tenable.
 [1] "The Sexual Psychopath Law was passed by the Legislature because experience has shown that sexual psychopaths  [fn. 2] are unable to benefit from ordinary penal confinement and are in need of medical treatment, and because it is necessary to protect society from the activities of such persons." (27 Cal.Jur.2d 452; People v. McCracken, 39 Cal.2d 336, 345 [246 P.2d 913].)
 [2] "The main purpose of the act is to protect society against the activities of sexual psychopaths. The secondary *885 purpose is to rehabilitate the sexual psychopath. [Citations.]" (People v. Levy, 151 Cal.App.2d 460, 468 [311 P. 897].)
 [3] "It is obvious therefore that the primary purpose of the Legislature was to protect society against the activities of sexual psychopaths (People v. Hector, supra, 104 Cal.App.2d 392, 394 [231 P.2d 916]), and that it was not intended to make sexual psychopathy a mitigating circumstance. On the contrary, the sexual psychopath may be removed from society under the Sexual Psychopath Law until he is cured, or until he is no longer considered a menace to the safety of others.  [fn. 3] The court may thereafter resume the criminal proceeding and impose the punishment allowed by law since the confinement as a sexual psychopath is not a substitute for punishment, the entire statutory procedure being civil in nature rather than penal. [Citations.]" (People v. McCracken, supra, 39 Cal.2d 336, 346.)
 [4] Section 5501, subdivision (c), Welfare and Institutions Code, declaring that when a person is convicted of a sex offense involving a child under 14 and it is a felony the court shall adjourn the proceeding or suspend the sentence to determine whether the person is a mentally disordered sex offender, is mandatory, and must be followed. (People v. Hector, 104 Cal.App.2d 392, 394 [231 P.2d 916]; People v. Raquel, 125 Cal.App.2d 384, 386 [270 P.2d 528]), except that it is not applicable to persons sentenced to death or ineligible for probation. (Welf. & Inst. Code,  5500.5.)
 The court is then required to appoint at least two psychiatrists pursuant to section 5504 of the Welfare and Institutions Code to make a personal examination and report in regard to the alleged "mentally disordered sex offender" as provided by section 5505, Welfare and Institutions Code. If, after examination and hearing, it appears there is sufficient cause to believe that the person is a mentally disordered sex offender then the court may  [fn. 4] order such person to be placed in suitable psychiatric facility for observation and diagnosis for a period not to exceed 90 days as provided for in section 5512, Welfare and Institutions Code. *886
 [5] Separate and apart from the question of eligibility for probation the trial court did institute sexual psychopathy proceedings. It conducted the preliminary hearing as required by section 5505 of the Welfare and Institutions Code in which it was determined that the defendant was a probable mentally disordered sex offender. The judge, in the exercise of his discretion ordered the defendant to be placed at Atascadero for diagnosis and observation. It is not now required that a court order such placement unless it can be shown that failure to do so constitutes an abuse of discretion. (People v. Barnett, 27 Cal.2d 649, 656 [166 P.2d 4].)
 [6] The trial court, having availed itself of the diagnostic facilities of the Department of Mental Hygiene, had no duty to commit the defendant to the Director of Mental Hygiene. The failure to do so was not an abuse of discretion in view of the unfavorable diagnostic report that the defendant was a mentally disordered sex offender not amenable to treatment, and the recommendation that he be sentenced for the criminal act. [7] As stated in People v. Bachman, 130 Cal.App.2d 445 at 449-450 [279 P.2d 77]: "When such a report is made, the sexual psychopathy proceedings are at an end and the specific direction of the code  [fn. 5] is that the person is returned to the court in which he was convicted, ... to await further action, not with reference to psychopathy, but with reference to the criminal charge of which he was convicted. The plain purport of the statute in this respect is that the court may not disregard the report of the superintendent of the hospital ..., but must abide by the same, treat the psychopathy proceedings as at an end and proceed in the criminal case."
 If we subscribe to the contention of the defendant that under the facts and circumstances of this case, it was the duty of the trial judge to commit the defendant to the Department of Mental Hygiene, it would mean that a mentally disordered sex offender who commits a sex offense against a child is immune from punishment. [8] Although *887 the Sexual Psychopath Law encourages care and treatment of the mentally disordered sex offender if he is amenable to treatment and otherwise eligible, it "was not intended to make sexual psychopathy a mitigating circumstance" nor was it intended that the law be a substitute for punishment. (People v. McCracken, supra, at p. 346.) The trial judge followed the requirements of the law relating to a felony conviction after the defendant's return from the state hospital.
 [9] Defendant asserts that the refusal to provide care and treatment for him as a mentally disordered sex offender constitutes a denial of due process and equal protection of the law, and that the sentence to state prison for such an "illness" is cruel and unusual punishment prohibited by the Eighth and Fourteenth Amendments to the United States Constitution, and cites Robinson v. California, 370 U.S. 660 [82 S.Ct. 1417, 8 L.Ed.2d 758], in support of such contention.
 We fail to see wherein defendant was denied due process and equal protection of the law. His substantial rights appear to have been amply guarded. The law affords him no right to demand hospitalization as an alternative to a prison sentence when he stands convicted of a felony. In view of the past conduct of the defendant involving sex offenses against children and the opinion of the hospital superintendent that the defendant is not amenable to treatment, the trial judge acted with due and proper consideration for the rights of the defendant, and society. The main purpose of the act relating to the mentally disordered sex offender is to protect society against the activity of such offenders. The secondary purpose is to rehabilitate the mentally disordered sex offender. (People v. Levy, supra, 151 Cal.App.2d 460, 468.)
 In Robinson v. California, supra, the United States Supreme Court held that a law which makes it a criminal offense to be addicted to narcotics was unconstitutional and that imprisonment solely by reason of such addiction inflicts cruel and unusual punishment. Robinson is inapplicable to the instant case. The defendant was imprisoned for having committed a sex offense against a child, not solely because he was a mentally disordered sex offender.
 Judgment affirmed.
 Shinn, P. J., and Ford, J., concurred.
NOTES
[fn. *]  *. Retired judge of the superior court sitting under assignment by the Chairman of the Judicial Council.
[fn. 1]  1. Section 5500.5, Welfare and Institutions Code, provides in part: "This chapter shall not apply to any person ... ineligible for probation under the Penal Code." (Amended Stats. 1963, c. 1913, p. 3907,  4.)
[fn. 2]  2. Section 5500, Welfare and Institutions Code, provides: "As used in this chapter, 'mentally disordered sex offender' means any person who by reason of mental defect, disease, or disorder, is predisposed to the commission of sexual offenses to such a degree that he is dangerous to the health and safety of others. Wherever the term 'sexual psychopath' is used in any code, such term shall be construed to refer to and mean a 'mentally disordered sex offender.' (Added Stats. 1963, c. 1913, p. 3907,  2.)"
[fn. 3]  3. The 1963 amendment of section 5500, Welfare and Institutions Code, and related sections, substituted the words "dangerous to the health and safety of others. ..." in place of "a menace to the health or safety of others, ..."
[fn. 4]  4. Section 5512, Welfare and Institutions Code, was amended in 1961 substituting the word "may" for the word "shall".
[fn. 5]  5. Section 5512, Welfare and Institutions Code, provides in part: "If the superintendent of the hospital or person in charge of the county facility reports to the committing court that the person is a mentally disordered sex offender but will not benefit by care or treatment in a state hospital and is a danger to the health and safety of others, the court shall then cause the person to be returned to the court in which the criminal charge was tried to await further action with reference to such criminal charge. Such court shall resume the proceedings and shall impose sentence or make such other suitable disposition of the case as the court deems necessary."
