> Once I move the entry/I (and the corresponding member of the struct) to > the end This is the typical kind of aligment problem that are (explicitly) not handled by this type of branch. Whenever you add a branch which is not of an homegeneous type (i.e. all ints, all doubles), you have to take care of the alignment by yourself. Better yet, when you get to this point you should just move to the Branch type that takes a class. This is straightfoward to do. (Just use a named macro, put the struct outside of the function, call myTree->Branch("myTree","RESULTS", &myResults_ptr); and compile with ACLiC.) Cheers, Philippe. -----Original Message----- From: owner-roottalk@pcroot.cern.ch [mailto:owner-roottalk@pcroot.cern.ch]On Behalf Of Axel Naumann Sent: Wednesday, August 04, 2004 12:39 PM To: Stilianos Kesisoglou Cc: roottalk@pcroot.cern.ch Subject: wingcc buffer problem, was: Re: [ROOT] problem with ROOT on windows Hi, these are two independent problems, one with root win32gcc (that's my diagnosis at least), one with your code. > The first of my problems is that the "Form()" method in lines 41, 42 seem to > fail. When these lines > are included the macro seems to run but with a strange message about the > ".root" file not found > (look inside "test.res"). The output files are not even created. Try the following: TString filename; filename.Form("%i_%i_RandomTracks%s.root", myTime->GetDate(), myTime->GetTime(), nsTYPE.Data()); TString outFILE; outFile.Form("%i_%i_RandomTracks%s.dat", myTime->GetDate(), myTime->GetTime(), nsTYPE.Data()); That should work. > When lines 41 and 42 are omitted the code runs and seemingly everything is > ok. The produced ".dat" > file looks ok but the ".root" is junk. Once I move the entry/I (and the corresponding member of the struct) to the end and set the branch addr to &myResults it's working properly. Which tells me that there might be a size mismatch between the Int_t and the /I somewhere. Someone more knowledgable of the buffer / streamer code might be of help here... Axel.
This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:09 MET