ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitPhysics/Mods/src/PhotonTreeWriter.cc
(Generate patch)

Comparing UserCode/MitPhysics/Mods/src/PhotonTreeWriter.cc (file contents):
Revision 1.52 by veverka, Sat Aug 31 07:36:37 2013 UTC vs.
Revision 1.53 by bendavid, Mon Sep 2 14:29:47 2013 UTC

# Line 137 | Line 137 | PhotonTreeWriter::~PhotonTreeWriter()
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  
# Line 1164 | Line 1174 | void PhotonTreeWriter::SlaveBegin()
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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines