Can not Fill a Tree

Hi,

I m trying to fill a branch of a tree with data I get from anoter tree. The data are correctly filled from the input tree in a structure looking like:

typedef struct {
Int_t nMC;
Float_t mcE[1000];
Float_t mcPt[1000];
Float_t mcEta[1000];
Float_t mcPhi[1000];
Int_t vidx[1000];
Int_t pidx[1000];
Int_t pdgid[1000];
Int_t parent[1000];
Int_t mcStatus[1000];
} MCPart;

then I create the branches of the ouput tree with :
MCPart theInMCparts;
TTree * treeOUT = new TTree(“GlobalFriend”,“my roottuple”);
treeOUT->Branch(“nMC”, &theInMCparts.nMC , “nMC/I”);
treeOUT->Branch(“mcE”, theInMCparts.mcE , “mcE[nMC]/F”);
treeOUT->Branch(“mcpt”, theInMCparts.mcPt, “mcpt[nMC]/F”);
treeOUT->Branch(“mceta”, theInMCparts.mcEta, “mceta[nMC]/F”);
treeOUT->Branch(“mcphi”, theInMCparts.mcPhi, “mcphi[nMC]/F”);
treeOUT->Branch(“vidx”, theInMCparts.vidx, “vidx[nMC]/I”);
treeOUT->Branch(“pidx”, theInMCparts.pidx, “pidx[nMC]/I”);
treeOUT->Branch(“pdgid”, theInMCparts.pdgid, “pdgid[nMC]/I”);
treeOUT->Branch(“parent”, theInMCparts.parent, “parent[nMC]/I”);
treeOUT->Branch(“mcstatus”, theInMCparts.mcStatus,“mcstatus[nMC]/I”);

and I try to fill treeOUT for each event…
for some event s I get the following error message:
Error in TTree::Fill: Failed filling branch:GlobalFriend.mcE, nbytes=-1
Error in TTree::Fill: Failed filling branch:GlobalFriend.mcpt, nbytes=-1
Error in TTree::Fill: Failed filling branch:GlobalFriend.mceta, nbytes=-1
Error in TTree::Fill: Failed filling branch:GlobalFriend.mcphi, nbytes=-1
Error in TTree::Fill: Failed filling branch:GlobalFriend.vidx, nbytes=-1
Error in TTree::Fill: Failed filling branch:GlobalFriend.pidx, nbytes=-1
Error in TTree::Fill: Failed filling branch:GlobalFriend.pdgid, nbytes=-1
Error in TTree::Fill: Failed filling branch:GlobalFriend.parent, nbytes=-1
Error in TTree::Fill: Failed filling branch:GlobalFriend.mcstatus, nbytes=-1

the only thing I know is that it is not related to the size (700) of the arrays in MCparts.

Do someaone know what can cause this kind of errors ?

           Fabrice

Very likely you did not open an output file before creating the Tree.
TTree::Fill has no place where to store the baskest when they are full.

Rene