Accessing PixelPulse from PixelHit

Hi

I am analyzing the ROOT output file from Python and so far so good. I encountered yesterday a problem when trying to access PixelPulse from PixelHit. When i try to run the line

pxhPulse['q'].append(pxh.getPixelPulse()) cppyy.gbl.std.exception: const allpix::PixelPulse* allpix::PixelHit::getPixelPulse() => exception: std::exception
Where pxh if a branch of the object PixelHit

I checked in the ROOT file and under PixelHit object and i can indeed see a PixelPulse item containing a ref but nothing more.

Screenshot from 2024-12-05 10-58-37

I am no expert in allpix or python, is there some extra vectorial command i should do to access PixelPulse from PixelHit (or in general one object from another)?
My final goal was to have a look at the induced charge pulse shape before (which i get from PixelCharge.getPulse() and after the digitization).

Also, to be sure, is the .getGlobalTime() from PixelHit giving the time at which the induced signal gets above the defined threshold?

Full conf file here:

[Allpix]
workers = 2
log_level = "INFO"
log_format = "DEFAULT"
detectors_file = "detector.conf"
number_of_events = 1

[GeometryBuilderGeant4]

world_material = "vacuum"


[DepositionGeant4]

record_all_tracks= true
physics_list = FTFP_BERT_PEN
source_type = "macro"
file_name = "Source_test.mac"
number_of_particles = 1
max_step_length = 0.5um
range_cut = 10.0um


[ElectricFieldReader]
name = "detector1" "detector2" "detector3"
model = "mesh"
field_depth = 600
![Screenshot from 2024-12-05 10-58-37|348x348](upload://b5ZhN4C3EpPWWJiOJb96xj5kwEG.png)
um
file_name = "E_field.init"
field_mapping = "PIXEL_FULL"

#bias_voltage = -200V #negative to collect electrons and positive to collect holes
#output_plots = 1
#output_plots_project = y


[WeightingPotentialReader]

name = "detector1" "detector2" "detector3"
model = "mesh"
file_name = "W_potential.init"
field_mapping = "PIXEL_FULL"
#output_plots = 1



### now we propagate the charges generating the object called PropagatedCharges ###


[TransientPropagation] 

charge_per_step = 10  # Number of charges propagated per step (increase if needed)
distance = 1
timestep = 0.1  # Adjust for precision
integration_time = 300ns
#output_plots = 1
#output_linegraphs = true
#output_plot_align_pixels = true


### Now we collect the propagated charges creating the object PixelCharge ###


[PulseTransfer]
detector = "detector1" "detector2" "detector3"
#output_plots = 1



### now we start with the digitalization to generate PixelHit ###


[DefaultDigitizer] 

threshold = 0e #400e
threshold_smearing = 0
electronics_noise = 0 #100 #standard deviation before amplification and thresholding
gain = 1.0
qdc_resolution = 0 # the actual charge is given in electrons
qdc_smearing = 0
qdc_slope = 0
tdc_resolution = 0 # the simulation returns the actual time of arrival in ns
tdc_smearing = 0
tdc_slope = 0
#output_plots = 1
#output_plots_timescale = 50ns



#[VisualizationGeant4]
[ignore]
mode = "gui"
accumulate = true
display_trajectories = true
draw_hits = true


[ROOTObjectWriter]
file_name = "output.root"
include =  "MCTrack" "MCParticle" "PixelHit" "PixelPulse" "PixelCharge"

#[DetectorHistogrammer]



Bests
Luca

Hi @luca_tero

the DefaultDigitizer module does not at present generate PixelPulse objects and therefore does not add a reference of them to the PixelHit.

If you do want the input to the front-end as time-resolved information, but not the output of the front-end, I would recomment storing PixelCharge objects and accessing their pulse via PixelCharge::getPulse(). This gives you the input current pulse to the front-end.

Cheers,
Simon