Re: enumerated types and rootcint

Maarten Bruinsma (t26@nikhef.nl)
Mon, 23 Jun 1997 13:37:12 +0200 (MET DST)


Dear ROOT,

When I want to determine how many entries in my ntuple
satisfy a certain selection, do I have to give an explicit command that
the selection-string has to be processed? I have tried the following:

// Calculate efficiencies:

Float_t Ptcut,Pcut;
Int_t Nr_Selected;
Int_t Nr_NotSelected;
Char_t Cuts[80];
sprintf(Cuts,"sqrt(Px*Px+Py*Py)>0");
TTreeFormula* Selection = new TTreeFormula("selectionform", Cuts,
muontuple);
Nr_NotSelected= muontuple->GetSelectedRows();

for(Ptcut=0;Ptcut<2;Ptcut+=0.1)
{
for(Pcut=0;Pcut<20;Pcut+=1)
{
sprintf(Cuts," sqrt(Px*Px+Py*Py)> %f && sqrt(Px*Px+Py*Py+Pz*Pz) > %f",
Ptcut, Pcut);
Nr_Selected = muontuple->GetSelectedRows();

Efficiencies->Fill(Nr_Selected,Ptcut,Pcut);

}
}

But somehow the NrSelected is always zero. What should I do?

Thanks,

Maarten

**********************************************************************
* Maarten Bruinsma *
**********************************************************************