137 |
|
// Destructor |
138 |
|
// Deal with the temporary file here? |
139 |
|
// fTmpFile->Write(); |
140 |
< |
fTmpFile->Close(); |
141 |
< |
TString shellcmd = TString("rm ") + TString(fTmpFile->GetName()); |
142 |
< |
delete fTmpFile; |
143 |
< |
cout << shellcmd.Data() << endl; |
144 |
< |
gSystem->Exec(shellcmd.Data()); |
140 |
> |
fTmpFile->Close(); |
141 |
> |
// TString shellcmd = TString("rm ") + TString(fTmpFile->GetName()); |
142 |
> |
// delete fTmpFile; |
143 |
> |
// cout << shellcmd.Data() << endl; |
144 |
> |
// gSystem->Exec(shellcmd.Data()); |
145 |
|
|
146 |
|
} |
147 |
|
|
148 |
|
//-------------------------------------------------------------------------------------------------- |
149 |
+ |
void PhotonTreeWriter::SlaveTerminate() |
150 |
+ |
{ |
151 |
+ |
|
152 |
+ |
if (hCiCTuple) fTmpFile->WriteTObject(hCiCTuple,hCiCTuple->GetName()); |
153 |
+ |
if (hCiCTupleSingle) fTmpFile->WriteTObject(hCiCTuple,hCiCTupleSingle->GetName()); |
154 |
+ |
|
155 |
+ |
} |
156 |
+ |
|
157 |
+ |
|
158 |
+ |
//-------------------------------------------------------------------------------------------------- |
159 |
|
void PhotonTreeWriter::Process() |
160 |
|
{ |
161 |
|
|
1174 |
|
if (fWriteDiphotonTree) { |
1175 |
|
hCiCTuple = new TTree(fTupleName.Data(),fTupleName.Data()); |
1176 |
|
hCiCTuple->SetAutoSave(300e9); |
1177 |
+ |
hCiCTuple->SetDirectory(fTmpFile); |
1178 |
|
} |
1179 |
|
TString singlename = fTupleName + TString("Single"); |
1180 |
|
if (fWriteSingleTree) { |
1181 |
|
hCiCTupleSingle = new TTree(singlename,singlename); |
1182 |
|
hCiCTupleSingle->SetAutoSave(300e9); |
1183 |
+ |
hCiCTupleSingle->SetDirectory(fTmpFile); |
1184 |
|
} |
1185 |
|
|
1186 |
|
//make flattish tree from classes so we don't have to rely on dictionaries for reading later |