A partial answer. Infringement is covered in 35 USC § 271 - Infringement of patent. If the product shipped in 2001 it might or might not be qualified as prior art to the 2002 patent application. If the 2000 priority filing was complete enough it would predate the 2001 shipment and therefore that shipment would not be prior art. The burden would be on the applicant to point out where in the priority document the relevant information was presented and that it met the criteria for written description. [my orig. sentence on this topic was in error since I did not take the priority document into consideration]
Obviously person Y can only expect to extract a royalty after the patent is granted in 2007. At the time it issues the patent holder and company can negotiate and mutually agree to a business arrangement covering all aspects of their relationship and past and future shipments.
Or the company could immediate stop shipping eliminating future liability. If the patent owner goes after the company at time T there will be three time periods to discuss. One issue is what the company should pay on things shipped from the granting of the patent to time T. The other is whether or not the company can continue to ship past time T at all and if so with what restrictions and at what royalty or other business arrangement. Third, if the application was published before grant and if the claims in the published application are close enough to the final allowed claims and the company was put on notice, then the patent owner may be entitled to a reasonable "back royalty" for things shipped between the publication of the application and the issuance of the patent. Article about a specific case regarding provisional rights to "back royalties". (not at all related to a provisional application) If there was no publication before the grant in 2007 or the claims were even moderately amended, then when the shipments started is irrelevant. Assuming Shipments stop at time T the only payments due the patent holder would be what shipped from 2007 to time T.
The law requires a judgement that is at least as much as a "reasonable royalty". Often times the argument that there should be a "disgorging of profits" is heard. Then there is the possibility of treble damages for willful infringement.
Numerical royalties are argued about and mutually agreed on by the parties often with horse trading. If they go to court it is most likly set by a jury and will vary by industry, by jury, and by how important the patented aspect was to the motivation of purchasers to buy the item.
If this is resolved between the parties the business relationship might not even involve a royalty. Could be a patent cross-license, lump sum, fixed dollar amount per unit, etc.
However a base and a rate do get argued about. Should a royalty for a car transmission sold in a car be 10% of the value of the transmission or 0.5% of the wholesale price of the car? See this Patently-O post regarding Microsoft and its date picker function.
Caveat - I am a patent agent and not a patent attorney. This question is outside the domain I am licensed/registered to advise people upon in the case of a specific, actual fact pattern of an interested party.