Prostate cancer isn’t considered a cause of ED on its own, but radiation treatments, hormone therapy, and surgery to remove the entire prostate gland can lead to difficulty in getting or keeping an erection. Sometimes erectile dysfunction related to prostate cancer treatment is only temporary, but many guys experience ongoing difficulties that need to be addressed by other means.
Penile blood flow is measured using a Doppler probe and a 2.5 cm blood pressure cuff. Systolic pressures in the right and left corpora cavernosa are measured and the penile–brachial index is calculated taking a ratio of penile systolic pressure to brachial systolic pressure. These measures should be repeated before and after 3 minutes of exercising the pelvic and leg muscles. In normal men, the PBI should be 0.9 or greater. Ratios between 0.7 and 0.9 suggest vascular impotence; a ratio below 0.6 is diagnostic. Pelvic arteriography can be done if revascularization is considered.
The availability of phosphodiesterase-5 (PDE5) inhibitors—sildenafil, vardenafil, tadalafil, and avanafil—has fundamentally altered the medical management of ED. In addition, direct-to-consumer marketing of these agents over the last 15 years has increased the general public’s awareness of ED as a medical condition with underlying causes and effective treatments.
The association between low testosterone and ED is not entirely clear. Although these 2 processes certainly overlap in some instances, they are distinct entities. Some 2-21% of men have both hypogonadism and ED; however, it is unclear to what degree treating the former will improve erectile function.  About 35-40% of men with low testosterone see an improvement in their erections with testosterone replacement; however, almost 65% of these men see no improvement. 
In the short term, alcohol relaxes muscles in the penis, letting blood to flow in (which is a good thing). However, alcohol also prevents other blood vessels from closing and trapping all the extra blood. Erections depend on trapping increased blood flow in the erectile tissue of the penis. If you don’t trap that extra blood, you don’t get an erection. In the long run, excessive alcohol consumption can cause liver scarring, high blood pressure, and can damage your blood vessels resulting in erectile dysfunction.
Don’t give up or blame yourself - you shouldn’t assume that your situation is impossible to improve or that your partner is disappointed in you. Studies show as long as you don’t stop trying to engage your partner sexually, they will still respond positively. If you communicate and stay positive you can work with your partner to get the result you’re looking for.
Surgery: If neither drugs nor the vacuum pump works, your doctor may suggest surgery. With surgery, the doctor can place a device in your penis that will cause enough hardness for intercourse. In a few cases, infections may develop after the operation, and the doctor may have to remove the device. Another operation that may help you is rebuilding the blood vessels in the penis to increase blood flow into the penis or decrease blood flow out of the penis. These procedures can help you to get and maintain an erection.
There have been rare reports of priapism (prolonged and painful erections lasting more than six hours) with the use of PDE5 inhibitors such as sildenafil, vardenafil, and tadalafil. Patients with blood cell diseases such as sickle cell anemia, leukemia, and multiple myeloma have higher than normal risks of developing priapism. Untreated priapism can cause injury to the penis and lead to permanent impotence. Therefore, if your erection lasts four hours, you should seek emergency medical care.
Penile implants: This treatment involves permanent implantation of flexible rods or similar devices into the penis. Simple versions have the disadvantage of giving the user a permanent erection. The latest (and most expensive) device consists of inflatable rods activated by a tiny pump and switch in the scrotum. Squeezing the scrotum stiffens the penis, whether the person is aroused or not. The penis itself remains flaccid, however, so the diameter and length are usually less than a natural erection, and hardness is lacking, although it's sufficient for intercourse.
While pills for ED are convenient, some men sustain stronger erections by injecting medication directly into the penis. Drugs approved for this purpose work by widening the blood vessels, causing the penis to become engorged with blood. Another option is inserting a medicated pellet into the urethra. The pellet can trigger an erection within 10 minutes.