# Failed to get the current signal

**URL:** <https://root-forum.cern.ch/t/failed-to-get-the-current-signal/49814>\
**Category:** Garfield++\
**Created:** [May 2, 2022, 2:02pm UTC](https://root-forum.cern.ch/t/failed-to-get-the-current-signal/49814 "2022-05-02T14:02:48Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![keino](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/k/85f322/32.png) [@keino](https://root-forum.cern.ch/u/keino)\
**Post date:** [May 2, 2022, 2:02pm UTC](https://root-forum.cern.ch/t/failed-to-get-the-current-signal/49814/1 "2022-05-02T14:02:48Z")

</div>

Hello, I simulated a simple cylindrical ionization chamber model and got the weight potential of each plate through the COMSOL software.  
The visualization of particle trajectory, electric field and signal are carried out in my main() function. However, The first two items are realized successfully, but the current signals are all zero(That’s incorrect). These are the outputs of my runs. Can you please help me to see what is wrong with the program I provided?

 ![屏幕截图 2022-05-02 215422](https://root-forum.cern.ch/uploads/default/original/3X/4/0/400f6fec283e2d9bfc20c6dbc4a1cc30437fb944.png)  
 ![image](https://root-forum.cern.ch/uploads/default/original/3X/1/5/1551dded24990c9b7e486971db2e25cb7bae299c.png)  
[Ionization.C](https://root-forum.cern.ch/uploads/short-url/yRVBzFRyQOmxL3OA6tY3DAdZ4Hy.C) (13.5 KB)

---

<div class="post-metadata">

**Author:** ![keino](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/k/85f322/32.png) [@keino](https://root-forum.cern.ch/u/keino)\
**Post date:** [May 2, 2022, 2:15pm UTC](https://root-forum.cern.ch/t/failed-to-get-the-current-signal/49814/2 "2022-05-02T14:15:36Z")

</div>

This is the weight potential of a pole plate exported by the COMSOL software, so as to exclude the main function from calling an empty file.

 ![image](https://root-forum.cern.ch/uploads/default/original/3X/8/f/8fc60bef48aff93dc4ed976ee5e41c5c6607a60c.png)  
Files larger than 3M cannot be sent, so I can only take a screenshot to show.

---

<div class="post-metadata">

**Author:** ![hschindl](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/h/977dab/32.png) [@hschindl](https://root-forum.cern.ch/u/hschindl)\
**Post date:** [May 2, 2022, 3:49pm UTC](https://root-forum.cern.ch/t/failed-to-get-the-current-signal/49814/3 "2022-05-02T15:49:25Z")

</div>

@djjansse do you have time to take a look?

---

<div class="post-metadata">

**Author:** ![djjansse](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/d/8baadc/32.png) [@djjansse](https://root-forum.cern.ch/u/djjansse)\
**Post date:** [May 3, 2022, 2:00pm UTC](https://root-forum.cern.ch/t/failed-to-get-the-current-signal/49814/4 "2022-05-03T14:00:24Z")

</div>

Dear Keino,

Thank you for getting in touch with us.

It seems that you are using the _SetWeightingField_ function to import the weighting potential instead of the intended _SetWeightingPotential_ function. To indicate to the AvalancheMicroscopic class that the weighting potential should be used for the signal calculations instead of of the weighting field, its _UseWeightingPotential_ function can be used.

I hope this helps.

Kind regards,

Djunes

---

<div class="post-metadata">

**Author:** ![keino](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/k/85f322/32.png) [@keino](https://root-forum.cern.ch/u/keino)\
**Post date:** [May 3, 2022, 2:10pm UTC](https://root-forum.cern.ch/t/failed-to-get-the-current-signal/49814/5 "2022-05-03T14:10:15Z")

</div>

Thank you very much for your reply! I’ll try to give it a try.

---

<div class="post-metadata">

**Author:** ![keino](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/k/85f322/32.png) [@keino](https://root-forum.cern.ch/u/keino)\
**Post date:** [May 3, 2022, 2:32pm UTC](https://root-forum.cern.ch/t/failed-to-get-the-current-signal/49814/6 "2022-05-03T14:32:24Z")

</div>

Thank you very much for your reply! I tried, but the result is still the same no pulse signal output, my classmate had run with this code and got the signal successfully.

 ![image](https://root-forum.cern.ch/uploads/default/original/3X/9/e/9e9f2b2a081bc6812b2eba5a0deecb706617ea7b.png)  
I can’t figure out why that is, so I came to ask you for advice.

---

<div class="post-metadata">

**Author:** ![djjansse](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/d/8baadc/32.png) [@djjansse](https://root-forum.cern.ch/u/djjansse)\
**Post date:** [May 4, 2022, 7:45am UTC](https://root-forum.cern.ch/t/failed-to-get-the-current-signal/49814/7 "2022-05-04T07:45:21Z")

</div>

That is strange indeed. Could you provide me with the terminal output when running the script?

---

<div class="post-metadata">

**Author:** ![FlorianBen](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/florianben/32/29534_2.png) [@FlorianBen](https://root-forum.cern.ch/u/FlorianBen)\
**Post date:** [May 4, 2022, 10:02am UTC](https://root-forum.cern.ch/t/failed-to-get-the-current-signal/49814/8 "2022-05-04T10:02:44Z")

</div>

Hello,

Did you try to plot the weighting potential first, to see if it is correctly loaded?

I faced a similar issue recently because of the line 481 in ComponentComsol.cc. For some reason my weighting potential was set to invalid, so it was ignored by garfielpp afterward.

Regards

---

<div class="post-metadata">

**Author:** ![keino](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/k/85f322/32.png) [@keino](https://root-forum.cern.ch/u/keino)\
**Post date:** [May 4, 2022, 11:44am UTC](https://root-forum.cern.ch/t/failed-to-get-the-current-signal/49814/10 "2022-05-04T11:44:39Z")

</div>

Thank you very much for your patience, this is the file output from my terminal.  
[1.txt](https://root-forum.cern.ch/uploads/short-url/1fFF1q2vL6d8ckfyXn7P5zn7E8a.txt) (879.1 KB)  
Is it possible that there is a problem with my software installation?

---

<div class="post-metadata">

**Author:** ![keino](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/k/85f322/32.png) [@keino](https://root-forum.cern.ch/u/keino)\
**Post date:** [May 4, 2022, 12:19pm UTC](https://root-forum.cern.ch/t/failed-to-get-the-current-signal/49814/11 "2022-05-04T12:19:45Z")

</div>

Thank you for your reply, my weight potential distribution is also no image！

---

<div class="post-metadata">

**Author:** ![djjansse](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/d/8baadc/32.png) [@djjansse](https://root-forum.cern.ch/u/djjansse)\
**Post date:** [May 4, 2022, 3:39pm UTC](https://root-forum.cern.ch/t/failed-to-get-the-current-signal/49814/12 "2022-05-04T15:39:15Z")

</div>

Dear Keino,

I see nothing unusual in the terminal readout. The fact that the code can be run successfully on another device could indicate an installation issue. To make sure it is not the code, could you provide me with all the files by sending them to djunes.janssens@cern.ch? This way, I can try and run it myself and take a closer look. I will keep the discussion on this forum so it can be helpful for other users as well.

One small point, the code on lines 178-192 in your script are needed to make the header of COMSOL’s weighting potential map file compatible with the one expected by the import function?

Kind regards,

---

<div class="post-metadata">

**Author:** ![djjansse](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/d/8baadc/32.png) [@djjansse](https://root-forum.cern.ch/u/djjansse)\
**Post date:** [May 4, 2022, 3:41pm UTC](https://root-forum.cern.ch/t/failed-to-get-the-current-signal/49814/13 "2022-05-04T15:41:36Z")

</div>

Dear FlorianBen,

Have you managed to find a solution for the ignoring of the weighting potential?

Kind regards,

---

<div class="post-metadata">

**Author:** ![FlorianBen](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/florianben/32/29534_2.png) [@FlorianBen](https://root-forum.cern.ch/u/FlorianBen)\
**Post date:** [May 4, 2022, 4:19pm UTC](https://root-forum.cern.ch/t/failed-to-get-the-current-signal/49814/14 "2022-05-04T16:19:05Z")

</div>

I simply forced the value to be true in [the source file](https://gitlab.cern.ch/garfield/garfieldpp/-/blob/master/Source/ComponentComsol.cc#L481).

It’s not a nice workaround but otherwise I had the same issue: the weighting potential was correctly loaded by garfield but not used for plotting and signal calculation.

---

<div class="post-metadata">

**Author:** ![keino](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/k/85f322/32.png) [@keino](https://root-forum.cern.ch/u/keino)\
**Post date:** [May 5, 2022, 2:06am UTC](https://root-forum.cern.ch/t/failed-to-get-the-current-signal/49814/15 "2022-05-05T02:06:01Z")

</div>

Thank you again for your reply！  
The explanation of the code in lines 178-192 you understand is correct, because the file exported from COMSOL using parametric scanning will have information about each parameter.  
In addition, when I was looking for installation problems, I found that I have an example (Geant4GarfieldInterface) that runs with an error message like the one below, and I don’t know if this has anything to do with the problem I’m facing.

 ![image](https://root-forum.cern.ch/uploads/default/original/3X/4/2/42e6a33c0aa540672a96c969e92dacb07d230637.png)  
 ![image](https://root-forum.cern.ch/uploads/default/original/3X/6/0/6059633c538fb9977a9b7e26b041007cbae96720.png)  
Will this be relevant? Do I have to solve the problem with this example first?

---

<div class="post-metadata">

**Author:** ![hschindl](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/h/977dab/32.png) [@hschindl](https://root-forum.cern.ch/u/hschindl)\
**Post date:** [May 5, 2022, 6:33am UTC](https://root-forum.cern.ch/t/failed-to-get-the-current-signal/49814/16 "2022-05-05T06:33:19Z")

</div>

This looks like a different problem to me. Is your ROOT installation compatible with the compiler you are using?

---

<div class="post-metadata">

**Author:** ![keino](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/k/85f322/32.png) [@keino](https://root-forum.cern.ch/u/keino)\
**Post date:** [May 5, 2022, 9:20am UTC](https://root-forum.cern.ch/t/failed-to-get-the-current-signal/49814/17 "2022-05-05T09:20:13Z")

</div>

![image](https://root-forum.cern.ch/uploads/default/original/3X/c/d/cd05ef5ab16957016f336d1079dba1603b09d354.png)  
Thank you very much for your patient reply! This image shows the version of the compiler used by my geant4 and root. I do not know much about this, please help me to see if it is compatible  
I am doing this after reading this article. Do I have to update my compiler version （C++17） to be able to run this example? Also, I installed ROOT by downloading the installer and adding environment variables, but it seems that I can’t “Cmake” the compiler to update it this way. Do I have to change the installation method to reinstall ROOT？

> [@Problem in installation](https://root-forum.cern.ch/t/problem-in-installation/45918/4):
>
> The line complaining about the “std::string\_view” being available only “from C++17 onwards” suggests that there is a mismatch in the C++ language standard used by different libraries (i.e. Geant4 and / or Garfield++ and / or ROOT).

Kind regards,

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [May 5, 2022, 11:05am UTC](https://root-forum.cern.ch/t/failed-to-get-the-current-signal/49814/18 "2022-05-05T11:05:10Z")

</div>

GCC 7.5 (on Ubuntu 18.04) does not really support `c++17`. You need to choose `c++14` or `c++11` (the same for all involved packages).

---

<div class="post-metadata">

**Author:** ![keino](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/k/85f322/32.png) [@keino](https://root-forum.cern.ch/u/keino)\
**Post date:** [May 6, 2022, 10:54am UTC](https://root-forum.cern.ch/t/failed-to-get-the-current-signal/49814/19 "2022-05-06T10:54:42Z")

</div>

Thank you for your reply！ I don’t quite understand what you mean, are you trying to say that I need to update the compiler version? Or do I need to reinstall Ubuntu or ROOT? (I’m new to VMs and don’t know much about them, so sorry)  
I would be grateful if your answer！

Kind regards,

---

<div class="post-metadata">

**Author:** ![keino](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/k/85f322/32.png) [@keino](https://root-forum.cern.ch/u/keino)\
**Post date:** [May 6, 2022, 11:07am UTC](https://root-forum.cern.ch/t/failed-to-get-the-current-signal/49814/20 "2022-05-06T11:07:31Z")

</div>

I have sent the file to your email address, did you receive it?

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [May 6, 2022, 11:42am UTC](https://root-forum.cern.ch/t/failed-to-get-the-current-signal/49814/21 "2022-05-06T11:42:25Z")

</div>

[You need to have ROOT, Geant4, and Garfield++ built so that they all use the same C++ standard.](https://root-forum.cern.ch/t/problem-in-installation/45918/12)

[Next page](https://root-forum.cern.ch/t/failed-to-get-the-current-signal/49814.md?page=2)
