Skip to content

Commit

Permalink
Fix for TBranchElement::Fill (Ruben)
Browse files Browse the repository at this point in the history
  • Loading branch information
fprino committed Aug 25, 2017
1 parent a838ad8 commit fa2cb57
Showing 1 changed file with 22 additions and 13 deletions.
35 changes: 22 additions & 13 deletions DataProc/PPass/tag.C
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,15 @@ Bool_t UpdateTag(TString faliroot, TString froot, TString fgeant,
TTree *fTree = (TTree *)f->Get("T");
if (!fTree) { f->Close(); continue; }
fTree->SetBranchAddress("AliTAG",&tag);

//Defining new tag objects
AliRunTag *newTag = 0x0;
TTree ttag("T","A Tree with event tags");
TBranch * btag = ttag.Branch("AliTAG", &newTag);
TString nameTmp = name;
TTimeStamp stp;
printf("%s %d\n",stp.AsString(),stp.GetNanoSec());
nameTmp.ReplaceAll(".root",Form("_%d.root",stp.GetNanoSec()));
TFile* flTmp = TFile::Open(nameTmp.Data(),"recreate");
TTree* ttag = new TTree("T","A Tree with event tags");
TBranch * btag = ttag->Branch("AliTAG", &newTag);
btag->SetCompressionLevel(9);

cout<<">>>>> Found " << fTree->GetEntries() << " entries...." << endl;
Expand All @@ -125,16 +129,21 @@ Bool_t UpdateTag(TString faliroot, TString froot, TString fgeant,
flTag->SetTURL(turl);
flTag->SetGUID(guid);
}
ttag.Fill();

delete tag;
delete newTag;
}//tag file loop

TFile* ftag = TFile::Open(name, "recreate");
ftag->cd();
ttag.Write();
ftag->Close();
ttag->Fill();
break;
}
delete fTree;
f->Close();
delete f;
//
flTmp->cd();
ttag->Write();
delete ttag;
flTmp->Close();
delete flTmp;
delete tag;
delete newTag;
gSystem->Rename(nameTmp,name);

}//pattern check
}//directory loop
Expand Down

0 comments on commit fa2cb57

Please sign in to comment.