Definitely no heat if it's been less than 48-72 hours since initial injury. Cold/compression every two hours for twenty minutes for the first 24/48 hours produces incredible results despite obvious inconvenience. Complete rest from a lifting/muscular exertion program for the lower body for at least two days. Flexibility tests to help determine which part of your musculoskeletal system is likely responsible for your problem. Typically hamstring issues originate from a chronic imbalance of strength (quads/hamstrings) or limited flexiblity/tightness in your posterior chain (low back/gluteus/psoas/hip flexors). Identifying the problem and correcting it should be the goal. Cycling is an excellent way to get work in (massive calorie expenditure) while limiting excessive strain on the hamstrings (correct saddle height is critical). One important caveat to this is make sure you do not attach yourself to the pedals (clip in). Because of the involvement of the hammies in everyday living/locomotion, understand this is not going to fix immediately. If there is actual physical deformation, a real doctor with actual knowledge in muscular injuries/biomechanics should be consulted.