A method of fast-switching operation of a standing wave linear accelerator such that heating in electronic switches (40, 42, 44, 48) located in side cavities (32, 34, 36, 38) of said accelerator is advantageously low, said method comprising: injecting a first set of electrons into a longitudinal passageway of said accelerator, wherein said accelerator comprises a plurality of main cavities (12, 14, 16, 18) and a plurality of side cavities (30, 32, 34, 36, 38), each said side cavity communicating with two neighboring main cavities of said plurality of main cavities, wherein said longitudinal passageway communicates with said plurality of main cavities (12, 14, 16, 18), wherein a first side cavity of said plurality of side cavities comprises a first electronic switch and a second side cavity of said plurality of side cavities comprises a second electronic switch, thereby providing first and second detunable side cavities, wherein said first set of electrons is accelerated in said longitudinal passageway by a standing electromagnetic wave coupled into said accelerator, and wherein said first set of electrons is emitted from said accelerator at a first energy when said first and second electronic switches of said first and second detunable side cavities are activated to a first activation state in which the first and second detunable side cavities dissipate an approximately equal amount of power as one another; activating, substantially simultaneously as one another, said first and second electronic switches of said first and second detunable side cavities to a second activation state that is different from the first activation state and in which the first and second detunable side cavities (32, 34) dissipate an approximately equal amount of power as one another, the second state modifying the standing electromagnetic wave; and injecting a second set of electrons into said longitudinal passageway, wherein said second set of electrons is emitted from said accelerator at a second energy which is different from said first energy. injecting a first set of electrons into a longitudinal passageway of said accelerator, wherein said accelerator comprises a plurality of main cavities (12, 14, 16, 18) and a plurality of side cavities (30, 32, 34, 36, 38), each said side cavity communicating with two neighboring main cavities of said plurality of main cavities, wherein said longitudinal passageway communicates with said plurality of main cavities (12, 14, 16, 18), wherein a first side cavity of said plurality of side cavities comprises a first electronic switch and a second side cavity of said plurality of side cavities comprises a second electronic switch, thereby providing first and second detunable side cavities, wherein said first set of electrons is accelerated in said longitudinal passageway by a standing electromagnetic wave coupled into said accelerator, and wherein said first set of electrons is emitted from said accelerator at a first energy when said first and second electronic switches of said first and second detunable side cavities are activated to a first activation state in which the first and second detunable side cavities dissipate an approximately equal amount of power as one another; activating, substantially simultaneously as one another, said first and second electronic switches of said first and second detunable side cavities to a second activation state that is different from the first activation state and in which the first and second detunable side cavities (32, 34) dissipate an approximately equal amount of power as one another, the second state modifying the standing electromagnetic wave; and injecting a second set of electrons into said longitudinal passageway, wherein said second set of electrons is emitted from said accelerator at a second energy which is different from said first energy.