bdrum / cern-physics

My analysis workflow
1 stars 1 forks source link

Discrepancies in the data #14

Closed bdrum closed 4 years ago

bdrum commented 4 years ago

In my analysis two the same criteria, but exposed on the different manner gives difference result:

selectOnlyStandard    = data['T_TPCRefit']  * (data['T_TPCNCls'] > 50) * \
            (data['T_ITSNCls'] > 3) * \
            (~newT_ITSsa) * (np.abs(data['T_NumberOfSigmaTPCPion']) < 3)
GoodEventsStandard = np.argwhere(selectOnlyStandard.sum()==4).flatten() # get events with 4 good tracks
GoodEventsStandard = GoodEventsStandard[np.argwhere(data['T_Q'][selectOnlyStandard][GoodEventsStandard].sum()==0).flatten()].flatten()  

pxstd = data['T_Px'][selectOnlyStandard][GoodEventsStandard]
pystd = data['T_Py'][selectOnlyStandard][GoodEventsStandard]

ptstd = np.sqrt(pxstd.sum()**2  + pystd.sum()**2)

fig = plt.figure(figsize=(15, 7))
ax = fig.add_axes([0,0,1,1])
fig.suptitle(f'4pr pt standard criteria', fontsize=32)
plt.style.use(hep.style.ROOT)
counts, bins = np.histogram(ptstd, bins=100, range=(0,2))
_ = ax.hist(ptstd, bins=bins, color='black', histtype='step', label=f'Q = 0;Entries {np.sum(counts)}')
plt.xlabel('Pt, GeV')
plt.ylabel('# events')
ax.legend()

GoodEvents = GetGoodEvents(WithGoodNTpcTracks=4)
counts, bins = np.histogram(GetPt(Draw=False), bins=100, range=(0,2))
_ = ax.hist(GetPt(Draw=False), bins=bins, color='red', histtype='step', label=f'4 TPC tracks;Entries {np.sum(counts)}', linewidth=2)
plt.xlabel('Pt, GeV')
plt.ylabel('# events')
ax.legend()

gives:

First criteria direct combination of second criteria.

Obviously for direct criteria condition to total charge doesn't work:

We can see the sum of zero charge events and non zero:

Picture for the second case, but the meaning is understood

bdrum commented 4 years ago

"Obviously for direct criteria condition to total charge doesn't work" This is wrong.

Everything is fine and top picture is correct.

The reason of discrepancies in such events:

For the second case such event will not pass to histogram, because the number of good tracks is 6, but for the first case it will.

The most interesting that how looks the difference:

So we see, that using of ITS provided additional factor to avoid background events

bdrum commented 4 years ago

The last question is:

Why on the first plot the difference between entries is 2186, but entries number on the last plot is 2381?

The answer is overflowing.