GSI Forum
GSI Helmholtzzentrum für Schwerionenforschung

Home » NUSTAR » NUSTAR PRESPEC » PSA-hit Energy
Re: PSA-hit Energy [message #17758 is a reply to message #17694] Wed, 14 January 2015 13:51 Go to previous messageGo to previous message
miree is currently offline  miree
Messages: 71
Registered: June 2014
continuous participant
From: *ikp.physik.tu-darmstadt.de
Hello Riccardo,

sorry for the late reply.
I'm not completely sure what happens there. But I have a guess:

The data written into the root files have the same format as all arrays inside the analysis framework,
Here is an explaination of what I mean:
https://forum.gsi.de/index.php?t=msg&goto=17154&&srch=array# msg_17154

If an array is written to a root file with the same picture in mind.
The root tree gets the following entries:
1) one integer with the number of entries in the array (N)
2) one array with N entries, containing values
3) one array with N entries, containing indices (or channels)

Essentially, the arrays can have different N for each event.
If you are looking at gamma ray data, N is the gamma multiplicity.
if you draw such a leaf with the Draw() function of Root, it assumes that
all arrays in all events have the same length. The old code (new_prespec_Go4)
used a different way of representing the data in root trees, namely a plain
array with as many indices as the maximum expected multiplicity. All
places in the array that were not filled, get a default value.

I guess, to get rid of the spikes in the spectrum, you have to write an event-loop
explicitely:

for (int event = 0; n < Nevents; ++n) // loop over all events
{
  for (int i = 0; i < gamma__energy_length) // loop over all gammas in one event
    hist->Fill(gamma__energy_value[i]);
}

I didn't test that code, that is just a suggestion...




 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: prespec code
Next Topic: MHTDC of the AgataTime crate
Goto Forum:
  


Current Time: Sat Apr 20 03:19:34 CEST 2024

Total time taken to generate the page: 0.01203 seconds