Energy cut problem

Hi everyone, I plotted an energy plot (in the macro line 1738, TCanvas c15). Now I need an energy cut, i.e. I want to select just the events that in the lead glass 0 (Calo_EndDep[0] of my root file) have energy in the range 3281 +/- 361 ADC.
So in the line 1923 I built a new TCanvas (TCanvas c25) and I defined the energy cut

TCut cutene22 = TString::Format("TMath::Abs(Calo_EnDep[%d]  - (%f)) < (%d)*(%f) ", e, ene22mean, csig, ene22sigma).Data();

So that I plotted by using conditions

	t->Draw(henea5sub2string, cut && !cut3sub && !cut4sub && cut5sub && cutene22);

Unfortunately I get an empty plot. Was I wrong to define the Tcut?

caloeff.cpp (104.1 KB)

In attachment the macro
Here the root file https://we.tl/t-oaP8GrJ5EV

Thank you


ROOT Version: 5 3436
Platform: Windows
Compiler: Not Provided


Try:

TCut cutene22 = TString::Format("TMath::Abs(Calo_EnDep[%d]  - (%d)) < (%d)*(%d)", e, ene22mean, csig, ene22sigma).Data();

Hi @Wile_E_Coyote you are right, I modified this line

TCut cut5sub = TString::Format("TMath::Abs(Calo_Time[%d] - Calo_Time[%d] - (%f)) < (%d)*(%f) ", a, e, p15sub, csig, p25sub).Data();

then I forgot to change %f to %d given that I defined ene22mean and ene22sigma int variables

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.