69 | | == How to run the code |
70 | | |
71 | | How to use the code on the flight. |
72 | | |
73 | | --> Add comment: Same for the NLO. Here some examples. |
74 | | |
75 | | When running the generation of events (./bin/generate_events from the local directory or "launch" via the mg5 interface) |
76 | | you will have two questions. The first one is: |
77 | | {{{ |
78 | | The following switches determine which programs are run: |
79 | | 1 Run the pythia shower/hadronization: pythia=NOT INSTALLED |
80 | | 2 Run PGS as detector simulator: pgs=NOT INSTALLED |
81 | | 3 Run Delphes as detector simulator: delphes=NOT INSTALLED |
82 | | 4 Decay particles with the MadSpin module: madspin=OFF |
83 | | 5 Add weight to events based on coupling parameters: reweight=OFF |
| 67 | == Running the code |
| 68 | |
| 69 | === Running simultaneously with event generation |
| 70 | |
| 71 | When running event generation at LO or NLO (either via ./bin/generate_events from the local directory or "launch" via the mg5 interface). You will be asked two questions. The phrasing/options of those two questions depends if you run at LO or NLO but both follow the same strategy. Here we will take the example of a NLO generation. |
| 72 | In that case, the first question is: |
| 73 | {{{ |
| 74 | The following switches determine which operations are executed: |
| 75 | 1 Perturbative order of the calculation: order=NLO |
| 76 | 2 Fixed order (no event generation and no MC@[N]LO matching): fixed_order=OFF |
| 77 | 3 Shower the generated events: shower=ON |
| 78 | 4 Decay particles with the MadSpin module: madspin=OFF |
| 79 | 5 Add weights to the events based on changing model parameters: reweight=OFF |
87 | | [0, 4, 5, auto, done, madspin=ON, madspin=OFF, madspin, reweight=ON, ... ][60s to answer] |
88 | | > |
89 | | }}} |
90 | | As you can see the reweight options is OFF by default, to set it on you can either type "5" (not adviced if you script) or "reweight=ON". |
91 | | Then you should have: |
92 | | {{{ |
93 | | The following switches determine which programs are run: |
94 | | 1 Run the pythia shower/hadronization: pythia=NOT INSTALLED |
95 | | 2 Run PGS as detector simulator: pgs=NOT INSTALLED |
96 | | 3 Run Delphes as detector simulator: delphes=NOT INSTALLED |
97 | | 4 Decay particles with the MadSpin module: madspin=OFF |
98 | | 5 Add weight to events based on coupling parameters: reweight=ON |
| 83 | [0, 1, 2, 3, 4, 5, auto, done, order=LO, ... ][60s to answer] |
| 84 | }}} |
| 85 | |
| 86 | As you can see, the question presents a series of switch which can take different value (in the example "NLO", "ON", "OFF"). In order to perform the reweighting, you need to put the reweight switch to "ON". |
| 87 | Type |
| 88 | {{{ |
| 89 | reweight=ON |
| 90 | }}} |
| 91 | You can also just type "5" but please avoid to use this mode in scripts. |
| 92 | After pressing enter the question is reasked and you now should have: |
| 93 | {{{ |
| 94 | The following switches determine which operations are executed: |
| 95 | 1 Perturbative order of the calculation: order=NLO |
| 96 | 2 Fixed order (no event generation and no MC@[N]LO matching): fixed_order=OFF |
| 97 | 3 Shower the generated events: shower=ON |
| 98 | 4 Decay particles with the MadSpin module: madspin=OFF |
| 99 | 5 Add weights to the events based on changing model parameters: reweight=ON |
102 | | [0, 4, 5, auto, done, madspin=ON, madspin=OFF, madspin, reweight=ON, ... ][60s to answer] |
103 | | }}} |
104 | | Then the second question is (after that you just press enter on that question): |
105 | | {{{ |
| 103 | [0, 1, 2, 3, 4, 5, auto, done, order=LO, ... ][60s to answer] |
| 104 | }}} |
| 105 | This allow you to change any other switch (note that "fixed_order" needs to stay on OFF). You can type enter when you want to pass to the next question: |
| 106 | {{{ |
115 | | [0, done, 1, param, 2, run, 3, reweight, enter path][60s to answer] |
116 | | }}} |
117 | | You '''HAVE TO define/edit''' the reweight_card.dat, the syntax is explained in the file. |
118 | | The default file is basically empty and will make the re-weighting to crash since both theoretical hypothesis are identical. |
119 | | |
120 | | == How to use the code after the generation of events as been completed. |
121 | | |
122 | | --> Add for the NLO |
123 | | |
124 | | You can also use the madevent interface as explained below: |
125 | | |
126 | | 1. go to the process directory. |
127 | | 2. launch the '''./bin/madevent''' script |
128 | | 3. type '''reweight RUN_NAME''' |
129 | | 4. then you will see the following question: |
130 | | {{{ |
131 | | Do you want to edit one cards (press enter to bypass editing)? |
132 | | 1 / reweight : reweight_card.dat |
133 | | you can also |
134 | | - enter the path to a valid card. |
135 | | [0, done, 1, reweight, enter path][60s to answer] |
136 | | }}} |
137 | | If you didn't define the content of reweight_card.dat already. You need to do it. The syntax is explained inside the file, and you can see example below (validation section). The '''important''' point, is that the first line should be launch, and then you specify which parameter, you want to modify. This is the exact same syntax has for scripting a scan over parameter. |
138 | | 5. exit the file and you are done (the script will run). |
139 | | |
140 | | '''If the file Cards/reweight_card.dat is already defined''', you can launch the script with |
| 117 | - call an external program (ASperGE/MadWidth/...). |
| 118 | Type 'help' for the list of available command |
| 119 | [0, done, 1, param, 2, run, 3, reweight, 4, enter path, ... ][60s to answer] |
| 120 | }}} |
| 121 | |
| 122 | For a NLO accurate reweighting, type |
| 123 | {{{ |
| 124 | set keep_rwgt_info True |
| 125 | }}} |
| 126 | This can also be done via the manual edition of the run_card (by typing 2). With this option on False (the default) the kamikaze reweighting will be performed. |
| 127 | |
| 128 | Then type |
| 129 | {{{ |
| 130 | 3 |
| 131 | }}} |
| 132 | to open an editor (in most system this use vi) where you can edit the content of the reweight_card. The format/options of that file are describe below. |
| 133 | It allows you to specify which model/benchmark you want to use. |
| 134 | When you are done, exit the file and press enter. |
| 135 | |
| 136 | == Running the code after the generation of events as been completed. |
| 137 | |
| 138 | In order to run the reweighting on previously generated samples. You need to go to the associated process directory and run either '''./bin/madevent''' or '''./bin/aMC@NLO'''script for respectively LO/NLO event generation. |
| 139 | You can then type '''reweight RUN_NAME''' (RUN_NAME is typically run_01) and you will be asked the same questions as above. |
| 140 | |
| 141 | Another options is to manually edit the Cards/reweight_card.dat file and then run one of the two following command: |
143 | | }}} |
144 | | The '''-f''' options prevent the question to be asked. |
145 | | |
146 | | == Options of the code: |
| 144 | ./bin/aMC@NLO reweight RUN_NAME -f |
| 145 | }}} |
| 146 | The first sample is available in case of LO event generation, while the second is present in the case of NLO event generation. |
| 147 | |
| 148 | == Content of the reweight_card |
| 149 | |
| 150 | === Description of the cards: |
| 151 | |
| 152 | The cards is compose of two sections: |
| 153 | 1. '''Options'': those are options which change the behaviour of the reweighting. Those line starts by "change" a list of all available options are available in next section. |
| 154 | 2. '''benchmark definition''': starting one benchmark starts with the line |
| 155 | {{{ |
| 156 | launch |
| 157 | }}} |
| 158 | then you can have either a series of "set command" to specify how to edit the param_card from the original one. Are a couple of equivalent options: |
| 159 | {{{ |
| 160 | set mt 150 |
| 161 | set mass 6 150 |
| 162 | }}} |
| 163 | For a scan over parameter, you can use one of the following options (all are equivalent): |
| 164 | {{{ |
| 165 | set mt 6 scan:range(100,200,20) |
| 166 | set mass 6 scan:[100,120,140,160,180] |
| 167 | }}} |
| 168 | instead of using the "set command" you can also specify the path to a (valid) param_card |
| 169 | {{{ |
| 170 | PATH |
| 171 | }}} |
| 172 | |
| 173 | === Options of the code: |