Nesting TCuts?

Hi,

I am trying to nest TCuts into another but I guess that linking lists is not so eays.
For a cut selection menu I want to create first different sets of TCuts which then are supposed to be stitched together

TCut ACut1("...")
TCut ACut2("...")
TCut ACut3("...")

TCut ACutTotal(ACut1&&ACut2&&ACut3)

Then these cuts are supposed to be combined with some other cuts, either with these cuts or without

 TCut BCut;
 TCut BCutwithoutA("...")

I tried to combne the main cuts either with the previously combined cut or with each cut separately

 TCut BCutwithA("..."&&ACutTotal)

or

 TCut BCutwithA("..."&&ACut1&&ACut2&&ACut3)

and finally to make a selection giving the final BCut

  if(boolSelector)
    {
      BCut = BCutwithA;
    }
  else
    {
     BCut = BCutwithoutA;
    }

but both cases crash (more or less).

TCut BCutwithA("..."&&ACutTotal) dies with a corrupted double linked list :frowning:

[quote]*** glibc detected *** corrupted double-linked list: 0x09680970 ***
[/quote]

and [quote]TCut BCutwithA("…"&&ACut1&&ACut2&&ACut3)[/quote] dies immediately with a segmentation violation :frowning:

So I guess that to much nesting of cuts is not feasible…

Maybe there is a more elegant way for such a cut selection?

Could you provide the shortest possible RUNNING script (and data file) reproducing this problem?

Rene

is there actually a maximum length of characters for a TCut string?!

This cut definition dies when the combined cut “DCuts” is added to another cut

[code]{
TCut D0aCut(“sqrt(pow(D1Kaon_Energy_CMS+D1Pion_Energy_CMS+D2Pion1_Energy_CMS+D2Pion2_Energy_CMS,2.)-pow(D1Kaon_PX_CMS+D1Pion_PX_CMS+D2Pion1_PX_CMS+D2Pion2_PX_CMS,2.)-pow(D1Kaon_PY_CMS+D1Pion_PY_CMS+D2Pion1_PY_CMS+D2Pion2_PY_CMS,2.)-pow(D1Kaon_PZ_CMS+D1Pion_PZ_CMS+D2Pion1_PZ_CMS+D2Pion2_PZ_CMS,2.))<1.845 || sqrt(pow(D1Kaon_Energy_CMS+D1Pion_Energy_CMS+D2Pion1_Energy_CMS+D2Pion2_Energy_CMS,2.)-pow(D1Kaon_PX_CMS+D1Pion_PX_CMS+D2Pion1_PX_CMS+D2Pion2_PX_CMS,2.)-pow(D1Kaon_PY_CMS+D1Pion_PY_CMS+D2Pion1_PY_CMS+D2Pion2_PY_CMS,2.)-pow(D1Kaon_PZ_CMS+D1Pion_PZ_CMS+D2Pion1_PZ_CMS+D2Pion2_PZ_CMS,2.))>1.885”);

TCut DPlusCut(“sqrt(pow(D1Kaon_Energy_CMS+D1Pion_Energy_CMS+D2Pion1_Energy_CMS,2.)-pow(D1Kaon_PX_CMS+D1Pion_PX_CMS+D2Pion1_PX_CMS,2.)-pow(D1Kaon_PY_CMS+D1Pion_PY_CMS+D2Pion1_PY_CMS,2.)-pow(D1Kaon_PZ_CMS+D1Pion_PZ_CMS+D2Pion1_PZ_CMS,2.))<1.845 || sqrt(pow(D1Kaon_Energy_CMS+D1Pion_Energy_CMS+D2Pion1_Energy_CMS,2.)-pow(D1Kaon_PX_CMS+D1Pion_PX_CMS+D2Pion1_PX_CMS,2.)-pow(D1Kaon_PY_CMS+D1Pion_PY_CMS+D2Pion1_PY_CMS,2.)-pow(D1Kaon_PZ_CMS+D1Pion_PZ_CMS+D2Pion1_PZ_CMS,2.))>1.885”);

TCut D0bCut(“sqrt(pow(D1Kaon_Energy_CMS+D2Pion1_Energy_CMS,2.)-pow(D1Kaon_PX_CMS+D2Pion1_PX_CMS,2.)-pow(D1Kaon_PY_CMS+D2Pion1_PY_CMS,2.)-pow(D1Kaon_PZ_CMS+D2Pion1_PZ_CMS,2.))<1.845 || sqrt(pow(D1Kaon_Energy_CMS+D2Pion1_Energy_CMS,2.)-pow(D1Kaon_PX_CMS+D2Pion1_PX_CMS,2.)-pow(D1Kaon_PY_CMS+D2Pion1_PY_CMS,2.)-pow(D1Kaon_PZ_CMS+D2Pion1_PZ_CMS,2.))>1.885”);

TCut DCuts(D0aCut&&DPlusCut&&D0bCut);

TCut D2PionC1;
TCut D2PionC1withDCut("(D2Pion1_Charge!=D2Pion2_Charge) && (D2Pion1_Charge!=D3Proton_Charge) && (D2Pion2_Charge==D3Proton_Charge) && (D1_Charge!=D3Proton_Charge)"&&DCuts);
// root dies with segmentation violation with >> &&DCuts << included in D2PionC1withDCut
TCut D2PionC1withoutDCut("(D2Pion1_Charge!=D2Pion2_Charge) && (D2Pion1_Charge!=D3Proton_Charge) && (D2Pion2_Charge==D3Proton_Charge) && (D1_Charge!=D3Proton_Charge)");

int iDCut = 1;

if(iDCut == 1)
{
D2PionC1 = D2PionC1withDCut;
cout<<"\n — \n with D-Cuts\n — \n \n";
}
else
{
D2PionC1 = D2PionC1withoutDCut;
cout<<"\n === \n without D-Cuts\n";
}
}

ROOT is 5.24/00 trunk@29257
[/code]

Hi,

This is actually a limitation of Cint. Then handling of the operators calls is not completely correct. As a work around compile your code via ACliC (for example).

Cheers,
Philippe.