Hello! I’m new user to Garfield++. Please tell me, I want to calculate the gas gain for gem, I have a couple of questions and clarifications.
To calculate the gas gain, I run the code that was given on the website (Examples/Gem/gem.C · master · garfield / garfieldpp · GitLab ), here the primary electrons are written as: nEvents, and the sum of the number of electrons formed in the avalanche using: std::cout " " total electron: " " netot " endl; ?
Then I need to change the voltage at the cathode and anode
const double width = 2.;
comp-> AddPlaneY(-width / 2, 0., “Cathode”);
AddPlaneY(width / 2, 1000., “Anode”);
comp->SetMagneticField(0.5, 0., 0);
also on the gem plates above and below, in order to get the dependence of the gas gain on the voltage. Unfortunately, no matter how I change the values at the cathode and anode, the number of electrons does not change from this in any way, maybe I have an error in the code?
Do I understand correctly, in order to change the voltage on the gem top and bottom, also on the cathode and anode, I have to re-download the files from ansys and change the voltage there, or am I wrong?
Yes, you can calculate the gas gain by retrieving the avalanche size (GetAvalancheSize) for each “event” (i. e. primary electron) and filling a histogram. You could also calculate an “effective gain” by counting/histogramming the number of electrons that make it into the induction gap (for practical purposes you can limit the drift area to a few tens of micron below the lower metal).
2./3. If you are using a field map imported from a finite-element field solver, you need to re-run the field solver (e. g. Ansys) for each configuration of voltage settings that you want to simulate. AddPlaneY is a member function of ComponentAnalyticField (which is a class that you can use for calculating the two-dimensional electric field in a detector made of wires, planes and tubes); it does not affect the finite-element field map.