Is it right for getting the gas gain?

The key codes are:

  int ElectronNumber=0;
 
    aval.AddElectron(0.3,0.3,0,0,1.); 

  if(!aval.GetElectrons().empty())
    {
      aval.ResumeAvalanche();
     for(const auto& electron:aval.GetElectrons())
      {
        ElectronNumber+=1;
      }     
    }

Dear @newconcept1979,

Instead of aval.AddElectron you should use aval.AvalancheElectron. In addition you can retrieve the resulting avalanche size using aval.GetAvalancheSize.

Kind regards,

Djunes

@djjansse , the electron by code aval.AvalancheElectron was used as a projectile, and the result by aval.GetAvalancheSize(ni,ne) is same as mine.

Hi @newconcept1979,

Then it workings as intended :slight_smile:

Kind regards,

Djunes

The weird gas gain was obtained when revised the example “/Garfield/Examples/DriftTube” with this solution, the results are:


Potential Gain
2730 661
2830 1468
2930 1348
3030 1
3130 820
3230 1
3330 1046
3430 672
3530 1
3630 656


what are the probable reasons?

Dear @newconcept1979
The gain is subject to fluctuations and cannot be evaluated based on a single event. You can only draw conclusions from distributions. So run the simulation 1000 times for each potential point and make a distribution of the gain. What we consider gain at that point is the average or most probable value of that distribution. If in individual cases you see gain is 1 then that means that your electron has been attached. You could have found this out by making an event display yourself.
Kind regards
Piet

@Piet , thank you, i will try!