//Test of basic phasing of RF cavities //Check that the RF cavity is phased correctly Configuration PhaseTest { Dimensions 1.0 1.0 600 m PropertyString Material Galactic PropertyDouble G4StepMax 100 mm Substitution $cell_length 75.0 Substitution $us_pos 1 Substitution $ds_pos 2 Module Beam { Position 0.0 0.0 -37.5 cm Volume None PropertyString EnvelopeType Simple PropertyInt Pid -13 PropertyString LongitudinalVariable Energy PropertyDouble Energy 226. PropertyDouble Time 0. PropertyBool UseAsReference true PropertyString EllipseDefinition Penn PropertyDouble Emittance_T 0.01 mm PropertyDouble Emittance_L 0.01 ns PropertyDouble Beta_T @Beta_T mm PropertyDouble Beta_L 5. ns PropertyDouble Alpha_T 0. PropertyDouble Alpha_L 0. PropertyDouble NormalisedAngularMomentum 0. PropertyDouble Bz 0. T PropertyString RootOutput envelope-optimiser.root PropertyString LongTextOutput envelope-optimiser.txt PropertyDouble delta_t 0.001 ns PropertyDouble delta_E 0.1 MeV PropertyDouble delta_x 0.1 mm PropertyDouble delta_Px 0.1 MeV/c PropertyDouble delta_y 0.1 mm PropertyDouble delta_Py 0.1 MeV/c } Module Optimiser { Volume None PropertyString Optimiser Minuit PropertyString Algorithm simplex PropertyInt NumberOfTries 100 PropertyDouble StartError 100. PropertyDouble EndError 1e-3 PropertyBool RebuildSimulation false //set to true to rebuild the field map each time (for e.g. optimising fields) PropertyBool RedoTracking false //set to true to recalculate transfer matrix each time (for e.g. optimising closed orbit) PropertyDouble Parameter1_Start 750. PropertyDouble Parameter1_Min 10. PropertyDouble Parameter1_Max 1200. PropertyDouble Parameter1_Delta 10. PropertyBool Parameter1_Fixed False PropertyString Parameter1_Name @Beta_T PropertyDouble Score1 (@Beta_Up-@Beta_Down)**2 PropertyDouble Score2 ((@Alpha_Up-@Alpha_Down)*100)**2 } Module UpstreamEnvelope { Volume None Position 0.0 0.0 $cell_length*$us_pos cm PropertyString SensitiveDetector Envelope PropertyString IndependentVariable Z PropertyString EnvelopeOut1_Name @Beta_Up PropertyString EnvelopeOut1_Type Bunch_Parameter PropertyString EnvelopeOut1_Variable beta_4d PropertyString EnvelopeOut2_Name @Alpha_Up PropertyString EnvelopeOut2_Type Bunch_Parameter PropertyString EnvelopeOut2_Variable alpha_4d } Module DownstreamEnvelope { Volume None Position 0.0 0.0 $cell_length*$ds_pos cm PropertyString SensitiveDetector Envelope PropertyString IndependentVariable Z PropertyString EnvelopeOut1_Name @Beta_Down PropertyString EnvelopeOut1_Type Bunch_Parameter PropertyString EnvelopeOut1_Variable beta_4d PropertyString EnvelopeOut2_Name @Alpha_Down PropertyString EnvelopeOut2_Type Bunch_Parameter PropertyString EnvelopeOut2_Variable alpha_4d } Module Virtual { Volume None Position 0.0 0.0 -37.5+7.50*@RepeatNumber cm PropertyString SensitiveDetector Virtual PropertyString IndependentVariable Z PropertyBool RepeatModule2 true PropertyInt NumberOfRepeats 40 } Module Coil { Volume None Position 0.0 0.0 -525.0+75.0*@RepeatNumber cm PropertyString FieldType Solenoid PropertyString FileName fs2a_coil.fld PropertyString FieldMapMode Write PropertyDouble CurrentDensity 1. PropertyDouble Length 150. PropertyDouble Thickness 150. PropertyDouble InnerRadius 350. PropertyDouble ScaleFactor 106.66*(-1.)**@RepeatNumber PropertyBool RepeatModule2 true PropertyInt NumberOfRepeats 20 } }