and from the sample chamber 107 an orientation flat detector not illustrated for positioning the wafer 100 with reference to the external shape of the wafer 100 an optical microscope 118 for observing the pattern on the wafer 100 and a standard sample piece 119 provided on the stage 6 the detector 20 described in this embodiment has the same structure as that described in fig2 operations of the first embodiment will be explained the complete control unit 110 instructs the operation of each unit in the following procedures an instruction is issued to a loader not illustrated and the loader picks up the wafer 100 from the cassette 114 positions the wafer with reference to the external shape with the orientation flat detector not illustrated loads the wafer 100 to the stage 6 and evacuates the inside of sample chamber 107 upon completion of loading the conditions of the electro optical system 106 and retarding voltage 108 are set and a voltage is applied to the blanking plate 104 to turn off the electron beam 2 next the stage is moved to the standard sample piece 119 to validate the z sensor 113 in order to keep the focal point to the constant area of the detection value offset 112 of the z sensor the deflector 105 is caused to conduct raster scanning the voltage of the blanking plate 104 is turned off in synchronization with the scanning the wafer 100 is irradiated with the electron beam 2 when it is required.