A method of analyzing a sample of material by diffractometry, wherein: ✔ a diffractometer is used which comprises ◆ a source adapted to emit an incident beam with a central axis X, ◆ a detector comprising ∘ a detector material, which, on the near side to the sample of material, presents a plane termed detection plane, ∘ means, termed spectrometry measurement means, adapted to measure an energy released by each photon interaction with the detector material and to establish at least one energy spectrum, denoted S; ◆ a collimator, termed detection collimator, associated with the detector, the detector and the detection collimator being arranged so as to have a detection axis D forming a diffraction angle θ with the central axis X of the incident beam, ✔ the sample is irradiated with the incident beam, ✔ a plurality of energy spectra are established, a combination of which is carried out, characterized in that: ✔ the detector used is a pixelated detector, comprising means for locating an interaction of a photon with the detector material, making it possible to define a partition of the detector in virtual pixels, and making it possible to associate one of said virtual pixels with each photon interaction; ✔ for each virtual pixel (Pi) of the detector, an energy spectrum Si, termed measured spectrum, is established, ✔ the combination relates to spectra measured for different virtual pixels (Pi) of the detector, ✔ before combining, the fulfillment of at least one criterion is verified, that criterion being termed multimaterial criterion, representing the presence of several layers of material, ✔ groups of pixels are formed using results of the preceding verifying step, each group corresponding to a layer of material, different groups corresponding to different layers of material, ✔ the combining step is carried out by group, that is to say that the spectra obtained for the pixels (Pi) of a same group are combined, for each group formed. ✔ a diffractometer is used which comprises ◆ a source adapted to emit an incident beam with a central axis X, ◆ a detector comprising ∘ a detector material, which, on the near side to the sample of material, presents a plane termed detection plane, ∘ means, termed spectrometry measurement means, adapted to measure an energy released by each photon interaction with the detector material and to establish at least one energy spectrum, denoted S; ◆ a collimator, termed detection collimator, associated with the detector, the detector and the detection collimator being arranged so as to have a detection axis D forming a diffraction angle θ with the central axis X of the incident beam, ◆ a source adapted to emit an incident beam with a central axis X, ◆ a detector comprising ∘ a detector material, which, on the near side to the sample of material, presents a plane termed detection plane, ∘ means, termed spectrometry measurement means, adapted to measure an energy released by each photon interaction with the detector material and to establish at least one energy spectrum, denoted S; ∘ a detector material, which, on the near side to the sample of material, presents a plane termed detection plane, ∘ means, termed spectrometry measurement means, adapted to measure an energy released by each photon interaction with the detector material and to establish at least one energy spectrum, denoted S; ◆ a collimator, termed detection collimator, associated with the detector, the detector and the detection collimator being arranged so as to have a detection axis D forming a diffraction angle θ with the central axis X of the incident beam, ✔ the sample is irradiated with the incident beam, ✔ a plurality of energy spectra are established, a combination of which is carried out, ✔ the detector used is a pixelated detector, comprising means for locating an interaction of a photon with the detector material, making it possible to define a partition of the detector in virtual pixels, and making it possible to associate one of said virtual pixels with each photon interaction; ✔ for each virtual pixel (Pi) of the detector, an energy spectrum Si, termed measured spectrum, is established, ✔ the combination relates to spectra measured for different virtual pixels (Pi) of the detector, ✔ before combining, the fulfillment of at least one criterion is verified, that criterion being termed multimaterial criterion, representing the presence of several layers of material, ✔ groups of pixels are formed using results of the preceding verifying step, each group corresponding to a layer of material, different groups corresponding to different layers of material, ✔ the combining step is carried out by group, that is to say that the spectra obtained for the pixels (Pi) of a same group are combined, for each group formed.