# Charge collection efficiency using DepositionPointCharge in irradiated detector

**URL:** <https://allpix-squared-forum.web.cern.ch/t/charge-collection-efficiency-using-depositionpointcharge-in-irradiated-detector/335>\
**Category:** Uncategorized\
**Created:** [November 22, 2022, 9:15am UTC](https://allpix-squared-forum.web.cern.ch/t/charge-collection-efficiency-using-depositionpointcharge-in-irradiated-detector/335 "2022-11-22T09:15:13Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![mbomben](https://allpix-squared-forum.web.cern.ch/letter_avatar_proxy/v4/letter/m/50afbb/32.png) [@mbomben](https://allpix-squared-forum.web.cern.ch/u/mbomben)\
**Post date:** [November 22, 2022, 9:15am UTC](https://allpix-squared-forum.web.cern.ch/t/charge-collection-efficiency-using-depositionpointcharge-in-irradiated-detector/335/1 "2022-11-22T09:15:14Z")

</div>

Dear all,  
I am observing an unexpected loss in charge collection efficiency (CCE) when simulating an irradiated 100 um thick n-on-p pixel detector.  
My goal is to evaluate the CCE as a function of the depth deposition _z_. So I run several simulations, one per _z_ value using indeed _DepositionPointCharge_.  
I am using v2.3.2.

Here is an example of the [configuration file](https://allpix-squared-forum.web.cern.ch/uploads/short-url/nCPtjQA56LJYbYnyhX6QvKp8Sb7.conf) (1.5 KB) I am using.

To run it:  
allpix -c main.conf -g detector1.sensor\_thickness=100um

It depends on a [planar\_detector.conf](https://allpix-squared-forum.web.cern.ch/uploads/short-url/22upAfTFGL6y6wZuB8i7CbVQ0R3.conf) (77 Bytes) and on an [electric field](https://cernbox.cern.ch/s/mzMcPrGnGsIjLiU) and [Ramo potential](https://cernbox.cern.ch/s/IFqPgUdzVePKSGD) file.  
I scan the deposition position in z, by changing in steps of 2 um from -48 to +48 um.  
The simulation is done in a 2 Tesla magnetic field oriented as _+y_.

I normalize the charge to the deposited value (1000 e), and I get the following result:

 ![compare_k_vs_z_100um_4e15neqcm2_600V](https://allpix-squared-forum.web.cern.ch/uploads/default/original/1X/7eb178493c9b3e47b2f82569f0dffb37bb83ee9b.png)  
The circles are obtained using the mean value of the _cluster\_charge_ histogram in the _DetectorHistogrammer_ folder in the root file.  
The squares and triangles are obtained using the _PixelTotalCharge_ variable, using [this macro](https://cernbox.cern.ch/s/GgcDbngyzaaeQIP) based on one of the examples (the difference between squares and triangles is the following: the former are calculated as the mean of the histogram where all PixelTotalCharges are projected, the latter is done by doing the average not using an histogram; it was a sanity check).

I do not understand the decrease in CCE after z = 20 um, which is very significant when I compare  
_cluster\_charge_ with _PixelTotalCharge_.  
One reason that came into my mind is the coarse (1 um) binning in the implant region but I cannot  
convince myself this is responsible for such a large drop in CCE.

So I have two questions:

1. is there anything wrong in the simulation configuration I am running that explains that drop?
2. Is there a better (more precise) way to calculate _CCE_, please?

Any help will be greatly appreciated 🙂

Many thanks in advance and best regards,  
Marco Bomben and @knakkali

PS the effect seems to be independent of the magnetic field value  
[compare\_cluster\_charge\_cce\_vs\_z\_magnetic\_vs\_no\_magnetic\_irradiated.pdf](https://allpix-squared-forum.web.cern.ch/uploads/short-url/22ZJThVbS46bwfsUs9NDCphm0lH.pdf) (20.0 KB)  
[compare\_cce\_vs\_z\_magnetic\_vs\_no\_magnetic\_irradiated.pdf](https://allpix-squared-forum.web.cern.ch/uploads/short-url/40F798G8DMoKNaHl0hhug45gBlW.pdf) (19.6 KB)

---

<div class="post-metadata">

**Author:** ![simonspa](https://allpix-squared-forum.web.cern.ch/user_avatar/allpix-squared-forum.web.cern.ch/simonspa/32/597_2.png) [@simonspa](https://allpix-squared-forum.web.cern.ch/u/simonspa)\
**Post date:** [November 28, 2022, 10:35am UTC](https://allpix-squared-forum.web.cern.ch/t/charge-collection-efficiency-using-depositionpointcharge-in-irradiated-detector/335/2 "2022-11-28T10:35:28Z")

</div>

Hi @mbomben @knakkali

I had a look at your configuration and didn’t see anything odd.

I ran your config, scanning the `z` position from back- to frontside, juts looking at the total induced charge (sum of all pixels, and without any threshold) - and then I switched off trapping. I get the two curves for `1000e` deposited at the respective `z` position, blue with trapping, orange without. To me it looks like the decrease towards the frontside injection is due to strong trapping of holes on their way to the backside, since without trapping I consistently see 99.5% of the charge induced:

 ![Screenshot from 2022-11-28 11-31-43](https://allpix-squared-forum.web.cern.ch/uploads/default/original/1X/e37de0524a2e45bc6070f0f0bf9dff9f2b896077.png)

Can you confirm this also for your more involved analysis? Maybe sth is still at odds with the trapping model?

Cheers,  
Simon

---

<div class="post-metadata">

**Author:** ![mbomben](https://allpix-squared-forum.web.cern.ch/letter_avatar_proxy/v4/letter/m/50afbb/32.png) [@mbomben](https://allpix-squared-forum.web.cern.ch/u/mbomben)\
**Post date:** [November 29, 2022, 11:44am UTC](https://allpix-squared-forum.web.cern.ch/t/charge-collection-efficiency-using-depositionpointcharge-in-irradiated-detector/335/3 "2022-11-29T11:44:40Z")

</div>

Hello @simonspa ,  
thanks for looking into this.  
Yes, turning trapping off I can get results similar to yours:

 ![compare_k_vs_z_100um_4e15neqcm2_600V](https://allpix-squared-forum.web.cern.ch/uploads/default/original/1X/99339e46fb571aa8bdc544ed38ceae3099c6a57f.png)

For the record, PixelCharge show a peculiar trend with position:

 ![PixelTotalCharge_k_vs_z_100um_4e15neqcm2_600V](https://allpix-squared-forum.web.cern.ch/uploads/default/original/1X/576629945525caf5a60f76fd4e8cf8711b1ec279.png)

Do you see the same trend, please?

Thanks and regards,  
@knakkali and Marco

---

<div class="post-metadata">

**Author:** ![mbomben](https://allpix-squared-forum.web.cern.ch/letter_avatar_proxy/v4/letter/m/50afbb/32.png) [@mbomben](https://allpix-squared-forum.web.cern.ch/u/mbomben)\
**Post date:** [December 1, 2022, 11:48am UTC](https://allpix-squared-forum.web.cern.ch/t/charge-collection-efficiency-using-depositionpointcharge-in-irradiated-detector/335/4 "2022-12-01T11:48:23Z")

</div>

Hello @simonspa ,  
I have rerun the simulations and analysis using the “ljubljana” trapping model.  
Here are the results:

 ![compare_k_vs_z_100um_4e15neqcm2_600V](https://allpix-squared-forum.web.cern.ch/uploads/default/original/1X/0b61a441c9983035199e4a4c9457df91068f7d8f.png)

So the presence of a maximum in CCE somewhere in the bulk is confirmed.

At this point I have two questions:

1. in your reply you mention that you sum the charge of all pixels - would you share the code you used, please?
2. when using the “ljubljana” several simulations give strange results; indeed I have removed them when I have prepared the plot above, so there are several holes in the graph. You can reproduce some of the problems by setting for example injection z position at -48. I attach [the log file of the simulation](https://allpix-squared-forum.web.cern.ch/uploads/short-url/k5Z8FbQVvMC8DK8EgUmCT93aaiF.txt) (209.9 KB) because I don’t see any strange message. Do you understand why this is happening, please?

Many thanks in advance,  
@knakkali and Marco

---

<div class="post-metadata">

**Author:** ![simonspa](https://allpix-squared-forum.web.cern.ch/user_avatar/allpix-squared-forum.web.cern.ch/simonspa/32/597_2.png) [@simonspa](https://allpix-squared-forum.web.cern.ch/u/simonspa)\
**Post date:** [December 2, 2022, 12:58pm UTC](https://allpix-squared-forum.web.cern.ch/t/charge-collection-efficiency-using-depositionpointcharge-in-irradiated-detector/335/5 "2022-12-02T12:58:34Z")

</div>

Hi @mbomben @knakkali

a few remarks I gathered when looking through your configuration files - some of them might be related to the issues you are describing above, others just tiny observations.

- Instead of adding the sensor thickness on the command line with `-g` you can also place it in the geometry file next to where the position of the detector is defined since you don’t seem to change this for now.
- You are storing all objects, especially the `DepositedCharge` and `PropagatedCharge` objects themselves are rarely used. In fact, you load the respective trees in your macro, but you don’t actually need them. The total charge (before front-end) induced in a pixel can be retrieved from `PixelCharge->getCharge()` without looping over the individual connected `PropagatedCharge` objects. (you do this in `pixel_total_charge += pix_charge->getCharge();` already)
- I don’t think the calculation of your `k_factor` is correct. What you are doing right now is to calculate the ration between the _total charge of a pixel_ (from `PixelCharge`) and an individual deposited charge value (from `DepositedCharge`, obtained via `PropagatedCharge`). The latterhas the problem that it is biased in the way you are using it. A propagated charge that does not contribute to your total charge somehow (trapped early on…) would not show up because there is no connection between `PixelCharge <-> DepositedCharge`. I would instead loop over the `DepositedCharge` objects separately and sum them so you are sure to catch all initial depositions.
- To make this easier we could think of adding the total number of deposited charges as a member of the `MCParticle` object, I’ll think about that a bit…
- You are applying a front-end simulation using a default configuration of the `DefaultDigitizer` module. Among other settings, this implies a threshold of `600e` - make sure to take that into account when analyzing your data, only `PixelHit` objects with a charge \> 600e will be generated!
- The log you sent looks fine apart from the fact that all pixels are below threshold - but you are looking at `PixelCharge` before the front-end anyways.
- I personally cheated with my numbers on the total charge, I simply simulated one single event per depth position, and grep’ed the log output for `Total charge induced on all pixels:` 🙂 Sorry for being so cheap…

I hope this helps!

Simon

---

<div class="post-metadata">

**Author:** ![mbomben](https://allpix-squared-forum.web.cern.ch/letter_avatar_proxy/v4/letter/m/50afbb/32.png) [@mbomben](https://allpix-squared-forum.web.cern.ch/u/mbomben)\
**Post date:** [December 5, 2022, 3:13pm UTC](https://allpix-squared-forum.web.cern.ch/t/charge-collection-efficiency-using-depositionpointcharge-in-irradiated-detector/335/6 "2022-12-05T15:13:22Z")

</div>

Hello @simonspa  
thanks a lot for taking the time to look into this! Your comments are all extremely useful!  
Below my comments.

> - Instead of adding the sensor thickness on the command line with `-g` you can also place it in the geometry file next to where the position of the detector is defined since you don’t seem to change this for now.

Right, we have could have thought of that 🙂

> - You are storing all objects, especially the `DepositedCharge` and `PropagatedCharge` objects themselves are rarely used. In fact, you load the respective trees in your macro, but you don’t actually need them. The total charge (before front-end) induced in a pixel can be retrieved from `PixelCharge->getCharge()` without looping over the individual connected `PropagatedCharge` objects. (you do this in `pixel_total_charge += pix_charge->getCharge();` already)

ok, so we can use indeed what we call `PixelTotalCharge`. Thanks!

> - I don’t think the calculation of your `k_factor` is correct. What you are doing right now is to calculate the ration between the _total charge of a pixel_ (from `PixelCharge`) and an individual deposited charge value (from `DepositedCharge`, obtained via `PropagatedCharge`). The latterhas the problem that it is biased in the way you are using it. A propagated charge that does not contribute to your total charge somehow (trapped early on…) would not show up because there is no connection between `PixelCharge <-> DepositedCharge`. I would instead loop over the `DepositedCharge` objects separately and sum them so you are sure to catch all initial depositions.

That was a first trial when we were thinking of tracking each pixel charge to its own deposited one. When we have discovered it was not possible we decided to run one simulation per depth _z_ so we are sure where the charge was deposited. Indeed now we normalize `PixelTotalCharge` to 1000, that is the number of electrons we inject.

> - To make this easier we could think of adding the total number of deposited charges as a member of the `MCParticle` object, I’ll think about that a bit…

Ok, thanks 🙂 But it is true that summing over `PixelCharge` is not too difficult

> - You are applying a front-end simulation using a default configuration of the `DefaultDigitizer` module. Among other settings, this implies a threshold of `600e` - make sure to take that into account when analyzing your data, only `PixelHit` objects with a charge \> 600e will be generated!

Again, thanks. I could have thought of that

> - The log you sent looks fine apart from the fact that all pixels are below threshold - but you are looking at `PixelCharge` before the front-end anyways.
> - I personally cheated with my numbers on the total charge, I simply simulated one single event per depth position, and grep’ed the log output for `Total charge induced on all pixels:` 🙂 Sorry for being so cheap…

That’s very good actually, I can even think of a simpler procedure, although having a tree saved is better 🙂

Thanks a lot for all the help, now we understand things at a much deeper level.

Cheers,  
@knakkali and Marco

---

<div class="post-metadata">

**Author:** ![simonspa](https://allpix-squared-forum.web.cern.ch/user_avatar/allpix-squared-forum.web.cern.ch/simonspa/32/597_2.png) [@simonspa](https://allpix-squared-forum.web.cern.ch/u/simonspa)\
**Post date:** [December 12, 2022, 6:56pm UTC](https://allpix-squared-forum.web.cern.ch/t/charge-collection-efficiency-using-depositionpointcharge-in-irradiated-detector/335/7 "2022-12-12T18:56:35Z")

</div>

@mbomben just have seen this in a presentation by Marco Battaglia:

 ![image](https://allpix-squared-forum.web.cern.ch/uploads/default/original/1X/24675592c689ac2639b525f68ce49638a0e55135.jpeg)

Looks like they are observing a similar behavior with the current ATLAS MC simulation with rad. damage.

(of course just a qualitative comparison…)

/Simon

---

<div class="post-metadata">

**Author:** ![mbomben](https://allpix-squared-forum.web.cern.ch/letter_avatar_proxy/v4/letter/m/50afbb/32.png) [@mbomben](https://allpix-squared-forum.web.cern.ch/u/mbomben)\
**Post date:** [December 12, 2022, 8:36pm UTC](https://allpix-squared-forum.web.cern.ch/t/charge-collection-efficiency-using-depositionpointcharge-in-irradiated-detector/335/8 "2022-12-12T20:36:13Z")

</div>

Yes! Actually your comment gave us (I am working with Marco) insight on the trend in the first bins.  
Thank you!

Cheers,  
Marco Bomben

---

<div class="post-metadata">

**Author:** ![simonspa](https://allpix-squared-forum.web.cern.ch/user_avatar/allpix-squared-forum.web.cern.ch/simonspa/32/597_2.png) [@simonspa](https://allpix-squared-forum.web.cern.ch/u/simonspa)\
**Post date:** [December 12, 2022, 11:53pm UTC](https://allpix-squared-forum.web.cern.ch/t/charge-collection-efficiency-using-depositionpointcharge-in-irradiated-detector/335/9 "2022-12-12T23:53:51Z")

</div>

That’s nice to hear! 🙂

For completeness, here the CMS measurement:

 ![image](https://allpix-squared-forum.web.cern.ch/uploads/default/original/1X/f1f28f1be9af1a8ba221dac76536c1d72ded332f.png)

---

<div class="post-metadata">

**Author:** ![knakkali](https://allpix-squared-forum.web.cern.ch/letter_avatar_proxy/v4/letter/k/3ec8ea/32.png) [@knakkali](https://allpix-squared-forum.web.cern.ch/u/knakkali)\
**Post date:** [March 20, 2023, 8:36pm UTC](https://allpix-squared-forum.web.cern.ch/t/charge-collection-efficiency-using-depositionpointcharge-in-irradiated-detector/335/10 "2023-03-20T20:36:34Z")

</div>

Hello all,  
Following the nice and helpful discussion on CCE vs Z in an irradiated detector in the above thread, we tried to do a couple of more studies to understand if the drop in CCE observed towards the pixel side is due to the strong trapping of holes on their way to the backside. In the first test, we reduced the beta values of the holes to reduce the hole-trapping rate. We observed an improvement in CCE to about 42% as you can see in the plot attached below:

 ![CCEVsZ._fixed_10p025mm_4p825mm_reducedHoleBeta](https://allpix-squared-forum.web.cern.ch/uploads/default/original/1X/36051eb2c584293b9ab3939fcc2911d3f12a1fe6.png)

The hypothesis here was that the reduced E-field close to the pixel implants results in lower mobility for the holes created close to pixel implants thereby increasing the probability of holes getting trapped subsequently resulting in lower CCE. To test the effects of low E-field close to the pixel implants, we tried to fit a pol3 to the Z projection of E-field from AP2 using TCAD E-field excluding the low Efield regions and used this pol3 with the fit parameters to use the custom model for [ElectricFieldReader] in AP2. The custom(pol3) E-Field and CCE vs Z using TCAD E-Field and the custom (pol3) E-Field are shown below:

![customEfield_pol3.pdf](https://allpix-squared-forum.web.cern.ch/uploads/default/original/1X/5bbfcb468e755f481e991471e35395c2801f8711.pdf) ![cceVSz_tcad_pol3_cmstracker.pdf](https://allpix-squared-forum.web.cern.ch/uploads/default/original/1X/397ef51a9a8b38b87797e62d5f6f72899bada33b.pdf)

As you can see from the CCE vs Z plot, the effect of low E-field close to the pixel implants seems very small and this is something that we are not able to completely understand.

For the next test, we tried to look at the CCE vs Z using the ramp potential. The CCE is here estimated by weighing each bin of PropagatedZ position with the corresponding Ramo potential value. The CCE vs Z distributions computed using Ram potential and using Pixel total charge is attached below:

![customEfield_CCE_ramo_pixelCharge.pdf](https://allpix-squared-forum.web.cern.ch/uploads/default/original/1X/54f31e92910b6c4974a9a99d430a211a0312bd63.pdf)

In principle, we were expecting both distributions to show a similar trend. It’d be great if you can possibly help us understand what we are doing wrong here.

Allpix2 version: 2.3.2  
AP2 config for custom E-Field: [main.conf](https://allpix-squared-forum.web.cern.ch/uploads/short-url/g6jbSRe5GWIuj1Nh6UngTrreXhn.conf) (1.4 KB)  
AP2 detector file: [planar\_detector.conf](https://allpix-squared-forum.web.cern.ch/uploads/short-url/Au6p1AJN9mqUBAD8piKxrrrwFz7.conf) (99 Bytes)  
TCAD file: [CERNBox](https://cernbox.cern.ch/s/ZeuOGgyXSsHxybb)  
Macro for CCE calculation using Ramo potential: [CERNBox](https://cernbox.cern.ch/s/CyBdsTDLoxaCEWi)

Thank you so much,  
@mbomben and Keerthi

---

<div class="post-metadata">

**Author:** ![simonspa](https://allpix-squared-forum.web.cern.ch/user_avatar/allpix-squared-forum.web.cern.ch/simonspa/32/597_2.png) [@simonspa](https://allpix-squared-forum.web.cern.ch/u/simonspa)\
**Post date:** [March 21, 2023, 11:37am UTC](https://allpix-squared-forum.web.cern.ch/t/charge-collection-efficiency-using-depositionpointcharge-in-irradiated-detector/335/11 "2023-03-21T11:37:13Z")

</div>

Hi Keerthi,

that looks like some nice piece of work! Somehow some of the plots don;t show up - could you edit your post to rectify this? Thanks!

Simon

---

<div class="post-metadata">

**Author:** ![knakkali](https://allpix-squared-forum.web.cern.ch/letter_avatar_proxy/v4/letter/k/3ec8ea/32.png) [@knakkali](https://allpix-squared-forum.web.cern.ch/u/knakkali)\
**Post date:** [March 22, 2023, 11:19am UTC](https://allpix-squared-forum.web.cern.ch/t/charge-collection-efficiency-using-depositionpointcharge-in-irradiated-detector/335/13 "2023-03-22T11:19:23Z")

</div>

Hello @simonspa,

Sorry I was not able to find the edit option to change the plots in my previous post 😕 . I’ll post the message once again here. Hopefully all the plots can be seen properly now. Apologies for posting twice.

Hello all,  
Following the nice and helpful discussion on CCE vs Z in an irradiated detector in the above thread, we tried to do a couple of more studies to understand if the drop in CCE observed towards the pixel side is due to the strong trapping of holes on their way to the backside. In the first test, we reduced the beta values of the holes to reduce the hole-trapping rate. We observed an improvement in CCE to about 42% as you can see in the plot attached below:

 ![CCEVsZ._fixed_10p025mm_4p825mm_reducedHoleBeta](https://allpix-squared-forum.web.cern.ch/uploads/default/original/1X/36051eb2c584293b9ab3939fcc2911d3f12a1fe6.png)

The hypothesis here was that the reduced E-field close to the pixel implants results in lower mobility for the holes created close to pixel implants thereby increasing the probability of holes getting trapped subsequently resulting in lower CCE. To test the effects of low E-field close to the pixel implants, we tried to fit a pol3 to the Z projection of E-field from AP2 using TCAD E-field excluding the low Efield regions and used this pol3 with the fit parameters to use the custom model for [ElectricFieldReader] in AP2. The custom(pol3) E-Field and CCE vs Z using TCAD E-Field and the custom (pol3) E-Field are shown below:

 ![customEfield_pol3](https://allpix-squared-forum.web.cern.ch/uploads/default/original/1X/c556a15f4b73a3b9833a2ddf80192909a2771d30.jpeg)  
 ![cceVSz_tcad_pol3_cmstracker](https://allpix-squared-forum.web.cern.ch/uploads/default/original/1X/0577035000e6c7ed9407b056cf86a15f5949b2fb.jpeg)

As you can see from the CCE vs Z plot, the effect of low E-field close to the pixel implants seems very small and this is something that we are not able to completely understand.

For the next test, we tried to look at the CCE vs Z using the ramp potential. The CCE is here estimated by weighing each bin of PropagatedZ position with the corresponding Ramo potential value. The CCE vs Z distributions computed using Ram potential and using Pixel total charge is attached below:

 ![customEfield_CCE_ramo_pixelCharge](https://allpix-squared-forum.web.cern.ch/uploads/default/original/1X/824cb44c511a821a0b67e28b9eb32e9703da64f8.jpeg)

In principle, we were expecting both distributions to show a similar trend. It’d be great if you can possibly help us understand what we are doing wrong here.

Thanks a lot,  
@mbomben and Keerthi

---

<div class="post-metadata">

**Author:** ![hdarwish](https://allpix-squared-forum.web.cern.ch/letter_avatar_proxy/v4/letter/h/46a35a/32.png) [@hdarwish](https://allpix-squared-forum.web.cern.ch/u/hdarwish)\
**Post date:** [April 3, 2023, 1:56pm UTC](https://allpix-squared-forum.web.cern.ch/t/charge-collection-efficiency-using-depositionpointcharge-in-irradiated-detector/335/14 "2023-04-03T13:56:19Z")

</div>

Excuse me all for my ignorance. Is there any simple automatic way of doing this scan over the z-axis values?  
I couldn’t manage to do it or to find the relevant document in the list of documents you provided.

Thank you and best regards,

Hasan

---

<div class="post-metadata">

**Author:** ![simonspa](https://allpix-squared-forum.web.cern.ch/user_avatar/allpix-squared-forum.web.cern.ch/simonspa/32/597_2.png) [@simonspa](https://allpix-squared-forum.web.cern.ch/u/simonspa)\
**Post date:** [April 3, 2023, 2:21pm UTC](https://allpix-squared-forum.web.cern.ch/t/charge-collection-efficiency-using-depositionpointcharge-in-irradiated-detector/335/15 "2023-04-03T14:21:08Z")

</div>

Hi @hdarwish

if this is about depositing charges at different depth, you can use the _DepositionPointCharge_ module with its scan function, see [documentation here](https://allpix-squared.docs.cern.ch/docs/08_modules/depositionpointcharge/).

If this is about changing the position of your detector, you can change geometry parameters from the command line, just as any other parameter from the configuration, have a look at [the relevant section of the manual](https://allpix-squared.docs.cern.ch/docs/03_getting_started/05_allpix_executable/).

Essentially this:

```sh
allpix -c myconfig.conf -g mydetector.position="0um 0um 100um"

```

will overwrite the position from the geometry file. With this you can use a simple `bash` script to loop over runs.

Cheers,  
Simon

---

<div class="post-metadata">

**Author:** ![hdarwish](https://allpix-squared-forum.web.cern.ch/letter_avatar_proxy/v4/letter/h/46a35a/32.png) [@hdarwish](https://allpix-squared-forum.web.cern.ch/u/hdarwish)\
**Post date:** [April 3, 2023, 2:58pm UTC](https://allpix-squared-forum.web.cern.ch/t/charge-collection-efficiency-using-depositionpointcharge-in-irradiated-detector/335/16 "2023-04-03T14:58:07Z")

</div>

Thanks @simonspa for your quick reply.  
I want to scan over the depth, so in z.  
He is not using the scan option, yet he was able to scan over z, maybe he used the -g overwriting bash script option you mentioned?  
Because with scan option, it will scan over the whole volume of the pixel, I want to scan only over z.  
However, I can’t put detector1.position=“0um 0um 15um”, because like this it will move the detector 1, while actually I want to move the deposited point charge along z.

Regards,

Hasan

---

<div class="post-metadata">

**Author:** ![simonspa](https://allpix-squared-forum.web.cern.ch/user_avatar/allpix-squared-forum.web.cern.ch/simonspa/32/597_2.png) [@simonspa](https://allpix-squared-forum.web.cern.ch/u/simonspa)\
**Post date:** [April 3, 2023, 3:13pm UTC](https://allpix-squared-forum.web.cern.ch/t/charge-collection-efficiency-using-depositionpointcharge-in-irradiated-detector/335/17 "2023-04-03T15:13:15Z")

</div>

Hi @hdarwish

there is also a `-o` option to allow you chaning module parameters, so just go

```auto
allpix -c config.conf -o DepositionPointCharge.position="..."

```

Cheers,  
Simon

---

<div class="post-metadata">

**Author:** ![simonspa](https://allpix-squared-forum.web.cern.ch/user_avatar/allpix-squared-forum.web.cern.ch/simonspa/32/597_2.png) [@simonspa](https://allpix-squared-forum.web.cern.ch/u/simonspa)\
**Post date:** [April 3, 2023, 3:28pm UTC](https://allpix-squared-forum.web.cern.ch/t/charge-collection-efficiency-using-depositionpointcharge-in-irradiated-detector/335/18 "2023-04-03T15:28:19Z")

</div>

Hi @knakkali and @mbomben

I have been looking into this and I unfortunately don’t have a simple solution for you. I have a couple of questions however:

- You look at “PropagatedZ” positions - but shouldn’t they all be at top or bottom surface after you finished propagation? Is there a non-zero distribution of those on the central sensor region?
- I can’t follow your argument with “weighting with Ramo potential” - the induction happens through _potential differences_, so only when you have a movement, the induced current corresponds to the charge times the _difference_ in weighting potential before and after the step.

Simon

---

<div class="post-metadata">

**Author:** ![mbomben](https://allpix-squared-forum.web.cern.ch/letter_avatar_proxy/v4/letter/m/50afbb/32.png) [@mbomben](https://allpix-squared-forum.web.cern.ch/u/mbomben)\
**Post date:** [April 3, 2023, 5:05pm UTC](https://allpix-squared-forum.web.cern.ch/t/charge-collection-efficiency-using-depositionpointcharge-in-irradiated-detector/335/19 "2023-04-03T17:05:22Z")

</div>

Hello @simonspa,  
thanks for looking into this

> You look at “PropagatedZ” positions - but shouldn’t they all be at top or bottom surface after you finished propagation? Is there a non-zero distribution of those on the central sensor region?

Why should they? They are trapped at different positions according to trapping time distribution.  
Please see below for injection in the mid-plane the final position of electrons:

 ![log_propagatedElectron_injection_at_z_0_um](https://allpix-squared-forum.web.cern.ch/uploads/default/original/1X/9611c5c3d66c9e452d8844a137cdc1cb2ff5ce27.png)  
and the final position for holes:  
 ![log_propagatedHole_injection_at_z_0_um](https://allpix-squared-forum.web.cern.ch/uploads/default/original/1X/1f483c07a3729ec34b979bf4acb0153ec1a2cdff.png)  
As you can see both electrons and holes are “spread” along the bulk; the average value of the histograms gives an idea already on how much electrons travel more than holes.

> I can’t follow your argument with “weighting with Ramo potential” - the induction happens through _potential differences_, so only when you have a movement, the induced current corresponds to the charge times the _difference_ in weighting potential before and after the step.

We are looking at integrated signal to estimate CCE so our reasoning is the following: as the initial position is the same for electrons and holes we can just look at their final positions.  
Suppose you have just one electron-hole pair, produced at z\_inj and let f be the weighting potential.  
Then, if z\_e (z\_h) is the final position - i.e. propagated\_charge-\>getLocalPosition().Z() - reached by the electron (hole), your induced signal q will be:

q = +e(f(z\_e)-f(z\_inj)) -e(f(z\_h)-f(z\_inj)) = +e(f(z\_e)-f(z\_h))

And this is what we are calculating.

By the way, you see that for 100 events in which we inject 1000 charges we get 90000 electron-hole pairs; this is also something we do not undertand 🙂

Again, thanks a lot @simonspa for helping here!

Cheers,  
@knakkali and Marco

---

<div class="post-metadata">

**Author:** ![simonspa](https://allpix-squared-forum.web.cern.ch/user_avatar/allpix-squared-forum.web.cern.ch/simonspa/32/597_2.png) [@simonspa](https://allpix-squared-forum.web.cern.ch/u/simonspa)\
**Post date:** [April 20, 2023, 1:06pm UTC](https://allpix-squared-forum.web.cern.ch/t/charge-collection-efficiency-using-depositionpointcharge-in-irradiated-detector/335/20 "2023-04-20T13:06:02Z")

</div>

Hi @knakkali , @mbomben

I had a chat with @pschutze about the discussion you had with him, and I think I now have a better understanding of the situation.

If I understood correctly your cross-check should be very similar to running `GenericPropagation` and afterwards `InducedTransfer` (see [documentation here](https://allpix-squared.docs.cern.ch/docs/08_modules/inducedtransfer/)) which essentially takes initial and final point for all charge carriers and calculates the total induced current.

Maybe that setup is simpler because you’re not simulating the full transient behavior.

Simon

---

<div class="post-metadata">

**Author:** ![knakkali](https://allpix-squared-forum.web.cern.ch/letter_avatar_proxy/v4/letter/k/3ec8ea/32.png) [@knakkali](https://allpix-squared-forum.web.cern.ch/u/knakkali)\
**Post date:** [April 21, 2023, 2:32pm UTC](https://allpix-squared-forum.web.cern.ch/t/charge-collection-efficiency-using-depositionpointcharge-in-irradiated-detector/335/21 "2023-04-21T14:32:29Z")

</div>

Hello @simonspa,

Thank you so much for your reply. One of @pschutze 's suggestion during our chat last was indeed to use [GenericPropagation] instead of [TransientPropagation]. We tried running AP2 simulations with 3 different configurations:

Test #1: [TransientPropagation] followed by [PulseTransfer]  
Test #2: [GenericPropagation] followed by [InducedTransfer]  
Test #3: [TransientPropagation] followed by [InducedTransfer]

The CCE vs Z distributions we have in the above 3 cases are attached below:

 ![GenPropIndTrans_TransientPropPulseTransf](https://allpix-squared-forum.web.cern.ch/uploads/default/original/1X/4057611e9e4f7e75db888718676a049efda454f4.png). ![Screenshot 2023-04-21 at 10.01.20](https://allpix-squared-forum.web.cern.ch/uploads/default/original/1X/ab0c09cede75533c1f64e39048847782c65d39a6.png)

The plot on the left is the comparison of CCE vs Z when we use [TransientPropagtion] followed by [PulseTransfer] and [GenericPropagtion] followed by [InducedTransfer]. When we use the latter config, the CCE is low by ~0.2% at every Z deposition position.

The plot on right corresponds to test #3 ([TransientPropagation] followed by [InducedTransfer]). We understand that [InducedTransfer] is a module for non-time resolved simulations performed with [GenericPropagation]. We wanted to check and see the results when used in combination with [TransientPropagation]. Our expectation was that the distribution would be similar to what we obtained earlier when we estimated CCE by weighing each bin of PropagatedZ position with the corresponding Ramo potential value. However, based on what we can see in the graph, it appears that using [InducedTransfer] in combination with [TransientPropagation] may not yield desirable outcomes…

Configuration files : [CERNBox](https://cernbox.cern.ch/files/spaces/eos/user/k/knakkali/allpix-squared/kFactorTest_Fixed_16042023_v2p3p3/for_Marco?items-per-page=100&view-mode=resource-table&tiles-size=1&sort-by=mdate&sort-dir=desc)

Thank you so much,  
@mbomben and Keerthi

[Next page](https://allpix-squared-forum.web.cern.ch/t/charge-collection-efficiency-using-depositionpointcharge-in-irradiated-detector/335.md?page=2)
