
184 Cal.App.3d 882 (1986)
229 Cal. Rptr. 291
THE PEOPLE, Plaintiff and Appellant,
v.
STEVEN FAY, Defendant and Respondent.
Docket No. A031727.
Court of Appeals of California, First District, Division Four.
August 22, 1986.
*886 COUNSEL
Arlo Smith, District Attorney, and Bernard David Walter, Assistant District Attorney, for Plaintiff and Appellant.
James Larson, under appointment by the Court of Appeal, Tim Brosnan and Larson & Weinberg for Defendant and Respondent.
OPINION
SABRAW, J.
The only issue presented on this appeal by the People from an order of the superior court denying their motion pursuant to Penal Code section 871.5[1] to reinstate the complaint against respondent Steven Fay is whether, as a matter of law, the magistrate who conducted respondent's preliminary examination erred in dismissing the complaint. As will be shown, we conclude that such error did occur and that the order must therefore be reversed.

PROCEDURE AND EVIDENCE
In late January of 1985, members of the San Francisco Police Department Narcotics Bureau were advised by a confidential reliable informant that two individuals were selling heroin out of an apartment located at 462 27th Street. The heroin was of the "tar" variety. Based upon this information, officers monitored a controlled purchase by the informant. The informant purchased and showed to the officers "a plastic-wrapped, larger than peasized, bindle of brown tarry substance" later confirmed to be heroin. The heroin was purchased from "John Doe Henry," who told the informant to "come back anytime for more." The informant observed additional heroin on the premises. (1) (See fn. 2.) This information was presented in affidavit *887 form to a magistrate, who issued a warrant authorizing officers to search the apartment for heroin.[2]
With regard to the pertinent subsequent events, San Francisco Police Inspector Daniel Hance testified at respondent's preliminary examination as follows: On February 5, 1985, he and five other officers went to the 27th Street address to execute the search warrant. They were specifically looking for the "tarry" variety of heroin. Hance had looked at the warrant earlier that day and was "familiar with the facts of the case." He was also aware that there had been "either some arrests or investigations at that address" and that "the two men in our investigation who we suspected lived there had lengthy criminal records ... including narcotics."
Hance testified that after he and the other officers arrived at the apartment "we knocked on the door and announced ourselves as police, and ... stated that we had a search warrant." Receiving no response, the officers waited about a minute and then forced open the door with a sledge hammer. Inside they found a man who appeared to be just waking up.[3] The man was arrested after the officers searched the apartment and found two pills believed to be contraband. No heroin was discovered. Before the search was completed, the apartment building door bell rang. Hance pressed the door release buzzer to open the building's front door. Hance did not know who had rung the bell or whether they were associated with criminal activity.
Inspector Hance further testified that as he heard the persons walk up to the apartment door, he opened the door. He observed Munir Totah standing in front of the door holding keys and "attempting to insert the keys into the lock." Respondent, whom Hance positively identified in court, was standing a few feet behind Totah. Totah saw Hance (who was wearing a "raid jacket" with "San Francisco Police Department" prominently lettered upon it) and appeared to have "the type of look [of] a kid with his hand caught in the cookie jar." Totah immediately reached into a front trouser pocket and discarded two syringes and "some tarry substance that was *888 wrapped in clear plastic."[4] Hance had made "at least 2,000 arrests just relating to heroin" and had seen the tar-like variety of heroin "in cellophane packages ... several hundred times." According to Hance, "heroin, the tarry substance, is commonly packaged in that clear plastic." Based on this experience and his extensive training, Hance strongly believed that the substance discarded by Totah was heroin.
Hance then observed respondent put his hand into one of his front trouser pockets. Hance, who has holding his gun, told respondent to "freeze." Hance did so because of the high incidence of persons involved with heroin who carry guns. Hance thought that respondent reached into his pocket because "either he was going to discard contraband or he had a gun." As respondent pulled his hand out of his pocket, Hance observed "part of a clear plastic package" similar to that discarded by Totah. Hance believed he saw only part of the package, and he did not observe anything inside it. Nevertheless, Hance concluded that respondent possessed contraband by reason of (1) the plastic/cellophane package observed; (2) respondent "was with someone that I suspected of having heroin" and; (3) respondent "was at a place where we did have purchases of heroin made."
Respondent and Totah were ordered up against a wall. As far as Hance was concerned, Totah was under arrest but respondent was only detained. Another officer removed the package from respondent's pocket. The package contained a tarry substance similar to that discarded by Totah which Inspector Hance likewise believed to be heroin. Chemical analysis proved that it was heroin that was discarded by Totah and found on respondent.
As a result of this incident, respondent and Totah were arrested and charged with possessing heroin in violation of Health and Safety Code section 11350. At the preliminary examination conducted on this charge, the magistrate heard the evidence summarized above. Inspector Hance was the sole witness. After all evidence had been received, respondent moved pursuant to section 1538.5 to suppress all evidence derived from his detention on the ground that Hance had no reasonable suspicion to search for and seize the package. The magistrate's ruling was as follows:
"The motion is granted for the following reasons. [¶] I think based upon the officer's testimony that he had [a] sound basis for a pat down search. He said clearly, and I think there were objective circumstances based upon his experience, that Mr. Fay could reasonably have been carrying a gun. That isn't what happened.
*889 "It was a search of his pocket and I would like to make an analogy here. I think there are cases. The California Supreme Court has said that you cannot impute criminal activity from [sic: to] a person from the time of day, from the people he associates with or the particular neighborhood in which he is found. [¶] The mere fact that someone comes to a place where a search warrant is being executed, that standing alone I do not think even given the officer's experience, I think leads to an excellent law enforcement hunch. [¶] You cannot conduct a search based upon a hunch. So the mere fact of that is not sufficient.
"I think if he had seen anything else [sic] in the cellophane package, even if he had been able to say to me that he had seen something dark in the cellophane package, based upon the fact that he had seen a tarry substance in the same cellophane package in Mr. Totah's possession, I could see. But we have nothing about the cellophane at all. [¶] That evidence is suppressed." The complaint against respondent was thereupon ordered dismissed pursuant to section 1385.
The People thereafter moved for reinstatement of the complaint pursuant to section 871.5. With obvious reluctance, the superior court felt compelled by the authorities cited by respondent to deny the motion. This timely appeal followed.[5]

REVIEW

I
Section 871.5, subdivision (b) explicitly states that "the only ground" for a motion to reinstate a complaint "shall be that, as a matter of law, the magistrate erroneously dismissed the action." The nature of the posture of this case and the contentions it has generated implicate two distinct standards of review, one for the suppression motion granted by the magistrate and another for the reinstatement motion denied by the superior court.
With regard to the first, the court in People v. Salzman (1982) 131 Cal. App.3d 676 [182 Cal. Rptr. 748], quoted the familiar two-step process governing review of a suppression motion ruling made by a superior court. (See People v. Leyba (1981) 29 Cal.3d 591, 596-597 [174 Cal. Rptr. 867, 629 P.2d 961].) (2) The Salzman court then held: "These rules of appellate review also apply to motions to reinstate a complaint under section 871.5. *890 Hence, the power to judge the credibility of witnesses, to resolve conflicts, to weigh the evidence, and to draw factual inferences was vested in the magistrate hearing the motion to suppress at the preliminary examination. On review under section 871.5, the superior court is bound by the magistrate's findings if they are supported by substantial evidence. But it is the duty of the superior court, and ours as well, to measure those facts, as found by the magistrate, against the constitutional standard of reasonableness. The constitutional issue is solely a question of law and if the magistrate mistakenly concluded that a search was unconstitutional that conclusion is also erroneous `as a matter of law.'" (People v. Salzman, supra, at p. 684.)
(3) With regard to the second, our Supreme Court recently held: "The character of judicial review ... depends on whether the magistrate has exercised his power to render findings of fact. If he has made findings, those findings are conclusive if supported by substantial evidence. (People v. Salzman (1982) 131 Cal. App.3d 676, 684....) If he has not rendered findings, however, the reviewing court cannot assume that he has resolved factual disputes or passed upon the credibility of witnesses. A dismissal unsupported by findings therefore receives the independent scrutiny appropriate for review of questions of law.... [¶] In summary, ... findings of fact must be sustained if supported by substantial evidence, but a finding of lack of probable cause, unsupported by any factual findings, is reviewed as an issue of law. Absent controlling factual findings, if the magistrate dismisses a charge when the evidence provides a rational ground for believing that defendant is guilty of the offense, his ruling is erroneous as a matter of law, and will not be sustained by the reviewing court." (People v. Slaughter (1984) 35 Cal.3d 629, 638-640 [200 Cal. Rptr. 448, 677 P.2d 854] italics in original.)
The magistrate's ruling at respondent's preliminary examination was quoted in full to demonstrate the application of these standards. The only express factual finding is that Hance did not observe anything in the cellophane package seen in respondent's trouser pocket. This is undisputed. Contrary to respondent's position on this appeal, the ruling does not encompass anything like a finding that Inspector Hance was not a credible witness. Indeed, the magistrate's comments that "I think based upon the officer's testimony that he had [a] sound basis for a pat down search" and "even if he had been able to say to me that he had seen something dark in the cellophane package" are fully consistent with the magistrate concluding that Hance was a credible witness. Apart from these matters, the substance of the magistrate's ruling was her conclusion that Hance had acted on the basis of "an excellent law enforcement hunch" which fell short of probable cause to search. This we now review as an issue of law. (People v. Slaughter, *891 supra, 35 Cal.3d 629, 639; People v. Salzman, supra, 131 Cal. App.3d 676, 684.)

II
This case sends us back to basics. The search of respondent's pocket which resulted in the discovery of the package of heroin was conducted without a warrant. (4) It is thus presumed illegal unless it comes within one of the few exceptions to the general rule that warrantless searches are per se unreasonable. (Mincey v. Arizona (1978) 437 U.S. 385, 390 [57 L.Ed.2d 290, 298-299, 98 S.Ct. 2408].) Inspector Hance expressly testified that respondent had only been detained, not arrested, when he was searched. (5) A law enforcement officer is entitled to conduct a pat down search of a detainee's clothing and remove therefrom objects that might be weapons (Terry v. Ohio (1968) 392 U.S. 1, 29-30 [20 L.Ed.2d 889, 910-911, 88 S.Ct. 1868]), but he may not remove drug-related items whose tactile contours will not support such a threatening possibility. (Sibron v. New York (1968) 392 U.S. 40, 65-66 [20 L.Ed.2d 917, 936-937, 88 S.Ct. 1889].)
(6) There was no evidence that, although Inspector Hance feared the presence of a weapon, a limited pat search was conducted to confirm this suspicion. Had such a search been undertaken, the small lump encased in cellophane could not reasonably convey a connotation of danger. Accordingly, the warrantless removal of the package from respondent's trousers cannot be justified as one properly made while respondent was only detained.
(7) The court in Terry noted that a detention search, "unlike a search without a warrant incident to a lawful arrest, is not justified by any need to prevent the disappearance or destruction of evidence of crime." (Terry v. Ohio, supra, 392 U.S. 1, 29.) (8) A lawful arrest permits the incidental seizure of weapons and evidence either on the arrestee's person or within his immediate reach. (Chimel v. California (1969) 395 U.S. 752, 763 [23 L.Ed.2d 685, 694, 89 S.Ct. 2034].) A search incident to an arrest may in fact precede the arrest. (Rawlings v. Kentucky (1980) 448 U.S. 98, 111 [65 L.Ed.2d 633, 645-646, 100 S.Ct. 2556].) Justice Traynor explained the rationale for this principle more than 30 years ago: "[I]f the officer is entitled to make an arrest on the basis of information available to him before he searches, and as an incident to that arrest is entitled to make a reasonable search of the person arrested and the place where he is arrested, there is nothing unreasonable in his conduct if he makes the search before instead of after the arrest. In fact, if the person searched is innocent and the search convinces the officer that his reasonable belief to the contrary is erroneous, it is to the advantage of the person searched not to be arrested. On the other *892 hand, if he is not innocent or the search does not establish his innocence, the security of his person, house, papers or effects suffers no more from a search preceding his arrest than it would from the same search following it. In either case the important considerations are whether the officer had reasonable cause before the search to make an arrest and whether the search and any seizures incident thereto were or were not more extensive than would reasonably be justified as incident to an arrest." (People v. Simon (1955) 45 Cal.2d 645, 648 [290 P.2d 531].) The crucial point is whether probable cause to arrest existed prior to the search notwithstanding "the fact that the officer does not have the state of mind [i.e., to make an arrest] which is hypothecated by the reasons which provide the legal justification for the officer's action." (Scott v. United States (1978) 436 U.S. 128, 138 [56 L.Ed.2d 168, 178, 98 S.Ct. 1717]; see People v. Le (1985) 169 Cal. App.3d 186, 193-195 [215 Cal. Rptr. 106].)
"In dealing with probable cause, however, as the very name implies, we deal with probabilities. These are not technical; they are the factual and practical considerations of everyday life on which reasonable and prudent men, not legal technicians, act. The standard of proof is accordingly correlative to what must be proved. [¶] (9) `The substance of all the definitions' of probable cause `is a reasonable ground for belief of guilt.' [Citations.] And this `means less than evidence which would justify condemnation' or conviction.... Since Marshall's time, at any rate, it has come to mean more than bare suspicion: Probable cause exists where `the facts and circumstances within their [the officers'] knowledge and of which they had reasonably trustworthy information [are] sufficient in themselves to warrant a man of reasonable caution in the belief that' an offense has been or is being committed." (Brinegar v. United States (1949) 338 U.S. 160, 175-176 [fn. omitted] [93 L.Ed. 1879, 1890-91, 69 S.Ct. 1302].) With all of these standards in mind, we now consider whether the search of respondent's trouser pocket can be sustained on the ground that it was incident to a lawful arrest and supported by probable cause.
(10) It bears emphasis that the officers did not happen to be at the apartment by chance. They were there because they had already met the test of probable cause to the satisfaction of the magistrate who issued the search warrant. The information known to officers from the informant and the controlled purchase furnished reasonable ground to believe that tar heroin packaged in plastic was being sold by two men from a specific apartment. The facts that the search of the apartment uncovered no heroin and that the only person found therein was arrested for an unrelated offense supports two inferences: (1) that the two individuals responsible for the heroin sales were still at large, and (2) that any heroin they possessed was being carried on their persons. Once Totah had entered the apartment building and was *893 seen standing in front of the apartment about to insert keys into the lock, the officers had reasonable grounds to believe that he was a resident of the apartment and therefore one of the two sellers. Totah looking like "a kid with his hand caught in the cookie jar" when he saw Hance, plus his attempt to discard the cellophane package similar to that obtained from the controlled purchase, corroborated the inferences mentioned above. Hance's actual observation of a "tarry substance" of the type being sought in the package provided additional credibility to those inferences. Without question, these circumstances constituted probable cause to arrest Totah.
Respondent apparently entered the apartment building with Totah and stopped with him in front of the apartment. Inspector Hance was thus entitled to draw the fair inference that respondent might be the other individual involved in the heroin sales. From respondent's action in reaching into his pocket in the same manner as Totah and in response to the same stimulus (i.e., sighting Hance), Hance could deem this inference substantiated. (People v. Holloway (1985) 176 Cal. App.3d 150, 156 [221 Cal. Rptr. 394].) Detention of respondent in these circumstances was clearly warranted. (United States v. Hensley (1985) 469 U.S. 221, 227 [83 L.Ed.2d 604, 611, 105 S.Ct. 675]; In re Tony C. (1978) 21 Cal.3d 888, 893 [148 Cal. Rptr. 366, 582 P.2d 957].) During the course of that detention, Hance observed the cellophane package in respondent's trouser pocket. The cellophane or plastic material appeared to be the same as that produced from the controlled purchase and discarded by Totah moments before. Inspector Hance was entitled to rely upon his extensive experience and knowledge of drug-related matters and conclude that the package was substantially identical to the one discarded by Totah which Hance believed contained heroin of the specific type sought. (People v. Lilienthal (1978) 22 Cal.3d 891, 898-899 [150 Cal. Rptr. 910, 587 P.2d 706]; United States v. Thornton (D.C. Cir.1984) 733 F.2d 121, 127-128.)
We believe that the totality of these circumstances constituted probable cause for Inspector Hance to arrest respondent. The search of respondent's pocket is therefore properly treated as one which was incidental to the arrest which it preceded. (Rawlings v. Kentucky, supra, 448 U.S. 98, 111; Scott v. United States, supra, 436 U.S. 128, 138; Chimel v. California, supra, 395 U.S. 752, 763; People v. Simon, supra, 45 Cal.2d 645, 648.) Because the search did not exceed permissible constitutional bounds, the magistrate erred as a matter of law in granting respondent's suppression motion and in dismissing the complaint against him. It follows that the People's motion to reinstate the complaint was well taken and should have been granted by the superior court. (See People v. Slaughter, supra, 35 Cal.3d 629, 638-640; People v. Salzman, supra, 131 Cal. App.3d 676, 684.)
*894 The order is reversed.
Poche, Acting P.J., and Channell, J., concurred.
A petition for a rehearing was denied September 18, 1986, and respondent's petition for review by the Supreme Court was denied October 30, 1986.
NOTES
[1]  Statutory references are to the Penal Code unless otherwise indicated.
[2]  The information recounted in the text is taken from the warrant and supporting affidavit. After the People included some of this information in their opening brief, respondent complained that the People were relying on material outside the record on appeal. Respondent's objection has some force, but it does not prevent use of these materials. The warrant and affidavit were received in evidence at the preliminary examination and were obviously considered by the magistrate. Some of the material was also quoted by the People in their papers supporting their motion to reinstate the complaint. Respondent made no objection in the superior court to this usage. Moreover, the People's papers are a part of the record. Finally, we obtained a certified copy of the warrant and affidavit and now order the record on appeal augmented to include them. (Cal. Rules of Court, rule 10(a).)
[3]  The man was subsequently identified as Henry Totah, an apparent relative of respondent's codefendant Munir Totah.
[4]  Inspector Hance also called the wrapping material discarded by Totah and subsequently seen on respondent as "cellophane."
[5]  The order is appealable. (§§ 871.5, subd. (f), 1238, subd. (a)(9).)
