Hi @couet, by using your code I don’t get error, but I’m not sure to get what I need.
I tried first to run the macro without the
&& cut3sub &&cut3sub2
conditions, i.e. by writing
TString heneoss3leadstring = TString::Format("(Calo_EnDep[%d] + Calo_EnDep[%d] + Calo_EnDep[%d] + Calo_EnDep[%d] + Calo_EnDep[%d] + Calo_EnDep[%d] + Calo_EnDep[%d] ) >> htemp(3000., 0., 3000.)", b,c,c2,d,e,f,g);
t->Draw(heneoss3leadstring , (cut && cuteneb && cut4sub && cut5sub && cut6sub && cut7sub));
in this way, in the plot si-500596_eneoss_Sum-0-2-1-12-13-14-15.pdf I get 1899 events.
Later I used your code
String heneoss3leadstring = TString::Format("(Calo_EnDep[%d] + Calo_EnDep[%d] + Calo_EnDep[%d] + Calo_EnDep[%d] + Calo_EnDep[%d] + Calo_EnDep[%d] + Calo_EnDep[%d] ) >> htemp(3000., 0., 3000.)", b,c,c2,d,e,f,g);
TCut cut999 = Form("((%s && %s) ? 1 : 0 )",cut3sub.GetTitle(),cut3sub2.GetTitle());
t->Draw(heneoss3leadstring , cut && cut3sub && cut3sub2 && cuteneb && cut4sub && cut5sub && cut6sub && cut7sub * cut999);
but I got just 12 events, then it means that ROOT deletes the events not fullfilling the
&& cut3sub &&cut3sub2
conditions (instead I want to keep the events not fullfilling these conditions, but to set in the sum energy_i =0 for the i-events not fullfilling these conditions. To check it, I also wrote:
TString heneoss3leadstring = TString::Format("(Calo_EnDep[%d] + Calo_EnDep[%d] + Calo_EnDep[%d] + Calo_EnDep[%d] + Calo_EnDep[%d] + Calo_EnDep[%d] + Calo_EnDep[%d] ) >> htemp(3000., 0., 3000.)", b,c,c2,d,e,f,g);
t->Draw(heneoss3leadstring , (cut && cut3sub && cut3sub2 && cuteneb && cut4sub && cut5sub && cut6sub && cut7sub));
getting 12 events too.