I have recorded data from a neuron from different trials. Each trial we show a stimulus to a rat and then we measure the neural activity. I want to measure the PSTH which is peristimulus time histogram. However since each trial has a different duration, I can't just compute the PSTH where it needs to have a fixed trial duration.

If I want to make my question more general it would be stated as follows:
Suppose I have a point process with a defined underlying rate function (which may or may not be homogenous). Now I have different observations from this process, i,e., different trials with different durations.

Say, one time I have data from this process for 2 seconds and another trial for 5 seconds and so on.

How can I compute the underlying the rate function assuming that the underlying rate function doesn't change from one trial to another trial?