MC Pulse Merging

The main goal of this section is to merge a MC pulses from CORSIKA and GVD simulation software. The pulses from MC are read by BMCRead and extracted by BExtractMCEventSum which is a class derived from BExtractMCEvent. From the MC simulations we have pulses with following information:

  • charge [p.e.] - you have to be very careful here. For many important reasons the charge of the pulse is not always just its charge. If there is a pulse preceding our pulse in the time less than 20ns, the charge of our pulse is summed with the charge of the previous pulse to mimic triggering in the real detector
  • time [ns]
  • magic number [#] - this number contains information about the origin of the pulse (track, shower, which muon etc.)

According to the time of measurement the pulses which are too close to each other should be merged to one pulse like in the real experiment and their parameters should be combined.

Previous Method (BExtractMCEventSum)

If the two pulses are generated closer than 20 ns than they are merged while the parameters of the new merged pulse are following:

  • time - time of the first pulse
  • charge - sum of all the pulses in 20 ns window
  • amplitude - amplitude of the first pulse only
  • magic number - magic number of the last pulse in the merge

New Method based on Gumpbel function (BExtractMCEventSumGump)

New MC pulse merging is based on the known analytical form of the pulses Gumpbel Function. This method is much more complicated and thus also time consuming, however I would say much more realistic. The width of the peaks was for the first approach taken constant to simplify it. The merging is performed in the following way:

  • We take the pulse and we check if the next pulse is nearer than 21 samples = 105 ns. This time window is defined by the pulse properties shown in the following picture. 21 samples is the total width of the pulse which means that if the two pulses are further than 21 samples they can not be merged. This step is implemented here to reduce time of processing because in the next step ROOT TF1 has to be created and minimum and maximum of this function has to be found.

  • When we know, that the pulses could overlap, we have to find out how much. In the real data extractor, when the signal drops below 4 σ of the pedestal oscillations the pulses are separated. So if the next pulse fulfills the previous condition (105 ns) the TF1 is created from the first pulse and from the second pulse.

f(x) = [0]*exp(-((x-[1])/11 + exp(-(x-[1])/11))) + [2]*exp(-((x-[3])/11 + exp(-(x-[3])/11)))
  • Then the parameters of the TF1 are set. The value 11 was calculated as β = 2.2 * 5. The β which is the width of the peak was found from data and was chosen constant and the number five is there to change pulses from FADC samples to ns. The parameters [1] and [3] are set according to the pulse times and the parameters [0] and [2] are calculated according to the following equation
[0] = 48.77*(pulse charge in p.e.) + 5.095
  • Then the minimum (the TF1 is on the y axis in the amplitude FADC channels) between time of the maximum of the first pulse ([1]) and time of the maximum of the second pulse ([3]) is found and if it is bigger than threshold 5 then the pulses are merged. Why 5? It is based on the analysis of the data. This threshold should mimic the behavior of the real data extractor which starts and ends extraction when the pulse is above or below the 4 σ of the pedestal oscillations. These values are extracted in the BExtractedImpulseTel from the real data and are called fPedRMS. I checked values for the file f0061 and this value is on average σ = 1.2 FADC channels. If you mutiply it by 4 you obtain threshold 5 FADC channels which I have used.

  • If the two pulses fulfill also this condition they are merged and the parameters of the new merged pulse are the following:

The same like in the older method time - time of the first pulse magic number - magic number of the last pulse in the merge * charge - summation of all merged pulses

new * amplitude - in the new TF1 with both pulses the maximum is found and this maximum is translated from amplitude FADC channels to the p.e.

1peShapeAnalyticalSampledGaus

The new merging method is described on the case of two merged pulses however it works even in the case when more than two pulses should be merged. In this case the condition of 105 ns has to be satisfied every time by the last two pulses, but like that the huge amount of pulses can be merged to the one pulse. Than the TF1 from more pulses is created and the minimum of amplitude between the last two pulses is found and has to be higher than 5.

Examples of merging

In the first example we are merging two pulses. The parameters of the first pulse are on the first line. ID = 0, time = 941.9 and charge = 2.4. The parameters of the second pulse are shown on the third line ID = 1, time = 945.1, charge = 5.5. The final TF1 is shown on the next slide and the parameters of the new merged pulse are on the last line

singlePulseExample

In the next example three pulses were merged. You can see the step when just two pulses were merged and then the also the third pulse was found which satisfies the merging conditions and the new TF1 including three pulses was generated and the new pulse is merged from three pulses.

threePulsesExample

Also the pulses merged from four pulses can be found.

fourPulsesExample

And even more.

Comparison of the methods

The first comparison is easy. We compared a number of merged pulses with the previous and new method and also the processing time. Tested file cors_n60x2m_noise_clust2016_texp2.3e5sec.wout.

Parameter Old Method New Method
Number of merged pulses in 100 events [#] 430 476
Number of merged pulses in 1000 events [#] 4063 4529
Speed of processing [No. events/s] 7826.5 1471

So the new method merges about 11.5% more pulses than the previous method however is approximately 5 times slower (TF1 approach).

Also the results from the processed BEvents can be compared:

Parameter Old Method New Method
No. pulses per event [#] 31.37 30.90
Number of merged pulses in 1000 events [#] 4063 4529
Charge [p.e.] 1.68 1.71
Amplitude [p.e.] 1.57 1.66

As was mentioned before, 11.5% more pulses are merged however on the global picture only 12.95% of the pulses is merged which gives change in the number of pulses only 1.48% (from 31.37 -> 30.90).

BARS implementation

The new merging procedure was implemented as a BARS module BExtractMCEventSumGump (it inherits from BExtractMCEventSum) and can be used in the BARS processing. Just replace older BExtractMCEventSum with this new module.

Grigory's reconstruction results

Grigory was so nice that he tried his reconstruction procedure also with the newly developed merging procedure and results show better and nicer agreement of the data with MC results than the results obtained with the previous merging method.

Nhits with old method (black points = data, red histogram = MC)

NHitsBefore

And with new method. The improvement is easily visible

NHitsAfter

Also the distribution of the values of the quality function is now in better agreement with data (red new, black previous)

hQuality

However the angular distribution of reconstructed particles is not significantly different

angularDist