(no subject)

From: Vu Anh Tuan (vuanh@lal.in2p3.fr)
Date: Fri May 31 2002 - 12:53:23 MEST


Hi,

I've got several questions. They are quite independent:

1. I have two branches named EMS and JET in my tree. Actually they are
two classes with several attributs, in particular they both have
_EMF. My program is like this

JET *myjet;
EMS *myele;

// Tree and branches declarations here
TTree mytree ...

// In the loop I fill myjet and myele attributes
for 
 {
   myjet->_EMF = something;
   ...
   myele->_EMF = something else;
   mytree->Fill();
 }

The problem is that when I open my tree up, I find that in two blocks
EMS and JET I have exactly the same plots for EMF values. When I change
_EMS to _jEMF and _eEMF in JET and EMS class definitions respectively,
it's OK back.

So why it works like this?

2. In the second question I still have the same above structure, with a
little difference: sometimes I do NOT want myele branch to be
filled. The reason is simple: in hadronic colliders you have in data a
lot of jets but not always electrons. I still want to collect data in
the same root-tuple. But when myele attributes are not initialised,
the method myTree->Fill() takes any value to put into EMS branch. I
tried to get around this bug by two ways inside the loop

 - // If I want to fill only JET branch
   mytree->GetBranch("JET")->Fill();

It doesn't work: no entries have been saved.

 - // If I want to fill only JET branch
  mytree->SetBranchStatus("EMS",0);
  mytree->Fill();
  mytree->SetBranchStatus("*",1);
  // If I want to fill all branches
  mytree->Fill();

It fills everything up as usual.

Can someone help me?

Thanks,

Tuan



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:54 MET