35 |
|
#ifndef TAM_TAModule |
36 |
|
#include "TAModule.h" |
37 |
|
#endif |
38 |
< |
|
38 |
> |
#ifndef TAM_TDirectory |
39 |
> |
#include "TDirectory.h" |
40 |
> |
#endif |
41 |
|
|
42 |
|
////////////////////////////////////////////////////////////////////////// |
43 |
|
// // |
763 |
|
// write all the output objects, flattening the module hierarchy. |
764 |
|
// If the 'TObject::kSingleKey' option is specified, the TAMOutput |
765 |
|
// objects themselves will be written, thus preserving the module hierarchy. |
766 |
< |
|
767 |
< |
if ( (option & TObject::kSingleKey) ) { |
766 |
> |
// If option==-99, the module hierarchy will be preserved, but TDirectories |
767 |
> |
// will be used instead of TAMOutput objects. |
768 |
> |
|
769 |
> |
if (option == -99) { |
770 |
> |
Int_t nbytes = fOutput.Write(name, 0, bsize); |
771 |
> |
TIter nextMod(MakeIterator()); |
772 |
> |
TObject* obj=0; |
773 |
> |
while ( (obj = nextMod()) ) { |
774 |
> |
TDirectory *newdir = gDirectory->mkdir(obj->GetName()); |
775 |
> |
TDirectory::TContext context(newdir); |
776 |
> |
nbytes += obj->Write(name, option, bsize); |
777 |
> |
} |
778 |
> |
return nbytes; |
779 |
> |
} else if ( (option & TObject::kSingleKey) ) { |
780 |
|
// here, the TList write will work just fine since it will actually |
781 |
|
// call the streamer on the module output objects |
782 |
|
// (through TObject::Write) |
783 |
|
return TList::Write(name, option, bsize); |
784 |
|
} else { |
785 |
|
// flatten the module hierarchy and dump all output objects to the file |
786 |
< |
Int_t nbytes = 0; |
773 |
< |
fOutput.Write(name, option, bsize); |
786 |
> |
Int_t nbytes = fOutput.Write(name, option, bsize); |
787 |
|
TIter nextMod(MakeIterator()); |
788 |
|
TObject* obj=0; |
789 |
|
while ( (obj = nextMod()) ) { |
792 |
|
return nbytes; |
793 |
|
} |
794 |
|
} |
782 |
– |
|