# RPC example running problem

**URL:** <https://root-forum.cern.ch/t/rpc-example-running-problem/52638>\
**Category:** Garfield++\
**Created:** [December 5, 2022, 9:26am UTC](https://root-forum.cern.ch/t/rpc-example-running-problem/52638 "2022-12-05T09:26:11Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![changjh12](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/c/cc9497/32.png) [@changjh12](https://root-forum.cern.ch/u/changjh12)\
**Post date:** [December 5, 2022, 9:26am UTC](https://root-forum.cern.ch/t/rpc-example-running-problem/52638/1 "2022-12-05T09:26:11Z")

</div>

Hello, I tried to run the example RPC and found that no output signal was generated.

# 1. I looked at the code of the example and found a problem.

This is the code in the **example**

```auto
 // The geometry of the RPC.
  const double gap = 0.2; // [cm]
  const double thickness = 0.2; // [cm]
  const double eps = 8.; // [1]
  const double voltage = -9500; // [V]
  const double sigma = 1e-2; // [S/m]
  
  ComponentParallelPlate* RPC = new ComponentParallelPlate();
  RPC->Setup(gap, thickness, eps, voltage, sigma);

```

The parameter **gap** indicates **the thickness of the air gap**

This is the definition of **ComponentParallelPlate-\>Setup**

```auto
void ComponentParallelPlate::Setup(const int N, std::vector<double> eps,
                                   std::vector<double> d, const double V,
                                   std::vector<int> sigmaIndex) {

```

There is **no definition of the parameter gap** , the parameter **N** is amount of layers in the geometry, this includes the gas gaps`

I don’t know why this is.

# 2. The second question

Is it possible to replace the _ **ComponentParallelPlate** _ function with **COMSOL**?

I checked the code of **ComponentParallelPlate**. I guess the main role of ComponentParallelPlate is to _build the geometric model of the detector, define the material properties and calculate the weighted electric field._

I was wondering if building the geometric model and calculating the weight field could be done in COMSOL if we assume that the weight field is not changing with time.

In other words, the weight field of MRPC is calculated using COMSOL and then imported into Garfield++ for simulation.

Looking forward to your reply.

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [December 5, 2022, 12:28pm UTC](https://root-forum.cern.ch/t/rpc-example-running-problem/52638/2 "2022-12-05T12:28:13Z")

</div>

I think @hschindl can help you.

---

<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:** [December 5, 2022, 4:51pm UTC](https://root-forum.cern.ch/t/rpc-example-running-problem/52638/3 "2022-12-05T16:51:25Z")

</div>

Hi,

1. yes, you are absolutely right, the example needs updating.

2. @djjansse can give you more details, but yes, you can also use Comsol to compute the electrostatic and weighting potentials.

---

<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:** [December 5, 2022, 5:48pm UTC](https://root-forum.cern.ch/t/rpc-example-running-problem/52638/4 "2022-12-05T17:48:28Z")

</div>

Dear,

As @hschindl pointed out, the example needs to be updated to reflect the overhaul the _ComponentParallelPlate_ class has undergone since it was written. Now the _Setup_ function allows for the modelling of an MRPC with _N_ layers (the sum of the gas gaps and the resistive and insulating layers), where the height of each layer is given in vector _d_, their relative permittivities in_eps_ and potential difference between the cathode and anode _V_. The final vector _sigmaIndex_ is a collection of indices of the layers that are resistive. All your final signal calculations will only be done for the prompt component. I hope this will help you advance with your work until the example is up to date.

On the topic of using COMSOL: yes, this is possible using the _ComponentComsol_ class for 3D models. For instructions, I would like to point to the relevant example on the Garfield++ webpage, which outlines step-by-step how to export your solution from COMSOL and import it into Garfield++. If you want an example from COMSOL to get you started, I can send you one if you send me a mail at djunes.janssens@cern.ch.

If you have any other questions, do not hesitate to ask.

Kind regards,

Djunes

---

<div class="post-metadata">

**Author:** ![changjh12](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/c/cc9497/32.png) [@changjh12](https://root-forum.cern.ch/u/changjh12)\
**Post date:** [December 6, 2022, 5:04am UTC](https://root-forum.cern.ch/t/rpc-example-running-problem/52638/5 "2022-12-06T05:04:20Z")

</div>

Thank you for your reply. I have sent you the email.

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [December 20, 2022, 5:04am UTC](https://root-forum.cern.ch/t/rpc-example-running-problem/52638/6 "2022-12-20T05:04:26Z")

</div>

Closed on December 20, 2022, 5:04am UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
