28 #include "StHistCollectorMaker.h"
29 #include "TDataSetIter.h"
41 StHistCollectorMaker::~StHistCollectorMaker(){ }
43 Int_t StHistCollectorMaker::Init(){
45 if (fMergedSet)
delete fMergedSet;
47 return StMaker::Init();
52 static const char *datasetName =
"Merged";
56 fMergedSet = GetDataSet(datasetName);
57 if (!fMergedSet) fMergedSet =
new TDataSet(datasetName);
66 TDataSet *StHistCollectorMaker::AddHists()
70 TDataSet *histBranch = GetDataSet(
"hist");
72 LOG_INFO <<
"No hist" << endm;
76 while((donor = nextDonor())) {
77 Bool_t found = kFALSE;
79 const Char_t *newname = donor->GetName();
81 while ( (oldset = nextOld()) && !found) {
93 TList *newList = (TList *)donor->
GetObject();
94 if (newList && newList->GetSize() > 0) {
96 TIter nextDonor(newList);
99 while ( (donorHist = (TH1 *)nextDonor()) ) {
100 if (donorHist->GetEntries() > 0) {
101 donorHist->SetDirectory(0);
104 newList->Remove(donorHist);
107 if (count) donor->
Shunt(rec);
117 if (oldSet && newSet) {
119 TList *newList = (TList *)newSet->
GetObject();
120 TList *oldList = (TList *)oldSet->
GetObject();
121 TIter nextDonor(newList);
122 TIter nextOld(oldList);
125 while ( (donor = (TH1 *)nextDonor()) ) {
126 Bool_t found = kFALSE;
127 if (donor->GetEntries() > 0 ) {
128 const Char_t *newname = donor->GetName();
130 while ( (oldHist = (TH1 *)nextOld()) && !found) {
133 if (!strcmp(oldHist->GetName(),newname)) {
143 newList->Remove(donor);
144 donor->SetDirectory(0);
virtual Bool_t IsThisDir(const char *dirname, int len=-1, int ignorecase=0) const
virtual TObject * GetObject() const
The depricated method (left here for the sake of the backward compatibility)
virtual void Shunt(TDataSet *newParent=0)
virtual TObject * GetObject() const
The depricated method (left here for the sake of the backward compatibility)