Problem with TSring and hadd :" t:'Collectable string class"

Dear all,

I am using ROOT/5.30.05 and I have the following problem when I try to merge ROOT files with TString :

hadd file_all.root file1.root file2.root
Target file: file_all.root
Source file 1: file1.root
Source file 2: file2.root
Target path: file_all.root:/
Target path: file_all.root:/Lumi_4e
Warning in TFileMerger::MergeRecursive: cannot merge object type (n:’<?xml version="1.0"?>

Overlap of GRLs20overlap of Eg_standard and LumiBlocks_GoodDQ0205071

', t:‘Collectable string class’) - Merge(TCollection *) not implemented

file1.root and file2.root are idientical (for test)

I have some TSring “physics” in a TDirectoryFile Lumi_4e;1 Lumi_4e

<?xml version="1.0"?> Overlap of GRLs20overlap of Eg_standard and LumiBlocks_GoodDQ0205071

In the past this was working fine (I don’t think the xml structure is different now) any idea why it doesn’t work now ? Did I miss something obvious ?

Difficult to understand : " t:‘Collectable string class’) - Merge(TCollection *) not implemented"

Thanks a lot
Cheers
Fabien

Hi Fabien,

What do you get with v5.34?

Philippe.

Hi Philipe,

Sorry for the delay. If I use hadd with ROOT 5.34 I got the same messages. I tried to compile my code with 5.34 to produce new ROOT file to merge but got some error I never saw :

make
g++ -g -c MakeHiggsToZZTo4lD3PDAnalysis.cxx atlasstyle/AtlasUtils.C -g -pthread -m32 -I/afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.00/i686-slc5-gcc43-opt/root/include -IGoodRunsLists -IMuonEfficiencyCorrections -IMuonMomentumCorrections -ITrigMuonEfficiency -IegammaAnalysisUtils -IPileupReweighting -IMuonIsolationCorrection -IHiggsZZ4lUtils -DSTANDALONE
/tmp/tarrade/cccuuqBk.s: Assembler messages:
/tmp/tarrade/cccuuqBk.s:17: Error: suffix or operands invalid for push' /tmp/tarrade/cccuuqBk.s:23: Error: suffix or operands invalid forpop’

Anyway I also manage to merge some other file with TString for which I have the same message to in the merge file have the merge TString. So probably something that I am doing in my code is now causing trouble during the merhing of TSring. Will try to investigate

Thanks
Cheers
Fabien

Maybe you could try: g++ -g -pthread -m32 -DSTANDALONE -I/afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.00/i686-slc5-gcc43-opt/root/include -IGoodRunsLists -IMuonEfficiencyCorrections -IMuonMomentumCorrections -ITrigMuonEfficiency -IegammaAnalysisUtils -IPileupReweighting -IMuonIsolationCorrection -IHiggsZZ4lUtils -c MakeHiggsToZZTo4lD3PDAnalysis.cxx atlasstyle/AtlasUtils.C

Hello,

Just find the issue (still see the WARNING). In fact in my code I was doing the following :

TDirectoryFile* lumidir_4mu= new TDirectoryFile(“Lumi_4mu”,“Lumi_4mu”);
if(do4mu){

overlap_4mu.SetVersion("20"); 
std::string description = "overlap of " + string(grl_4mu.GetName()) + " and " + string(GRL.GetName());
overlap_4mu.AddMetaData("Description",description);

Root::TGoodRunsListWriter* writer = new Root::TGoodRunsListWriter();
writer->SetGoodRunsList(overlap_4mu);
writer->SetFilename("overlap_4mu.xml");
writer->WriteXMLFile();

const TString grlstring = writer->GetXMLString();
TObjString objstr(writer->GetXMLString());

lumidir_4mu->WriteObjectAny(&objstr,"TObjString","physics","overwrite");
//std::cout <<" -- deleting Writer ... "<<std::endl;
//delete writer;

}

std::cout <<" Closing the ROOT file … "<<std::endl;
fout->Close();

and deleting “delete writer;” was the reason of my empty TString when I was merging file.

Cheers
Fabien