]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
print out size of histograms in the list for optimizing memory usage
authorkleinb <kleinb@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 21 Apr 2011 13:50:36 +0000 (13:50 +0000)
committerkleinb <kleinb@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 21 Apr 2011 13:50:36 +0000 (13:50 +0000)
PWG4/JetTasks/AliAnalysisHelperJetTasks.cxx
PWG4/JetTasks/AliAnalysisHelperJetTasks.h

index 51a799a2bd99ef41971df1c3c22a0a591e2f50c3..b96dbae12d49d3501c29f25cbb1feb28d889f361 100644 (file)
@@ -796,12 +796,15 @@ Bool_t AliAnalysisHelperJetTasks::PythiaInfoFromFile(const char* currFile,Float_
   return kTRUE;
 }
 
-Bool_t AliAnalysisHelperJetTasks::PrintDirectorySize(const char* currFile){
+Bool_t AliAnalysisHelperJetTasks::PrintDirectorySize(const char* currFile,Int_t iDetail){
 
   //
   // Print the size on disk and in memory occuppied by a directory 
   //
 
+  TFile *fDummy = 0;
+  if(iDetail>=0)fDummy = TFile::Open("/tmp/dummy.root","RECREATE");
+
   TFile *fIn = TFile::Open(currFile);
   if(!fIn){
     // not a severe condition but inciate that we have no information
@@ -833,6 +836,16 @@ Bool_t AliAnalysisHelperJetTasks::PrintDirectorySize(const char* currFile){
        diskSize +=  (Float_t)jkey->GetNbytes()/1024./1024.;
        if(list){
          Printf("%03d/%03d: %60s %5.2f MB %5.2f MB",i,j,list->GetName(),(Float_t)jkey->GetObjlen()/1024./1024.,(Float_t)jkey->GetNbytes()/1024./1024.);
+         if(iDetail==i){
+           for(int il = 0;il<list->GetEntries();il++){
+             TObject *ob = list->At(il);
+             if(fDummy){
+               fDummy->cd();
+               Int_t nBytesWrite = ob->Write();
+               Printf("%03d/%03d/%03d: %60s  %5.2f kB",i,j,il,ob->GetName(),(Float_t)nBytesWrite/1024.);
+             }
+           }
+         }
        }
        else{
          Printf("%03d/%03d: %60s %5.2f MB %5.2f MB",i,j,jkey->GetName(),(Float_t)jkey->GetObjlen()/1024./1024.,(Float_t)jkey->GetNbytes()/1024./1024.);
index 16f4927d6d3078a9cdc6287e8cc2c57c690b2ce8..bb45a926ceaca86828c8fc13d6fa4f0ad6bc4de1 100644 (file)
@@ -75,7 +75,7 @@ class AliAnalysisHelperJetTasks : public TObject {
 
   static void MergeOutput(char* cFiles, char* cDir = "",char *cList = "",char* cOutFile ="allpt.root",Bool_t bUpdate = false); // Merges the files in the input text file  needs the two histograms fh1PtHard_Trials, fh1Xsec and the name of the input list
   static Bool_t PythiaInfoFromFile(const char* currFile,Float_t &fXsec,Float_t &fTrials);// get the cross section and the trails either from pyxsec.root or from pysec_hists.root
-  static Bool_t PrintDirectorySize(const char* currFile); // print the size of the output on a given file
+  static Bool_t PrintDirectorySize(const char* currFile,Int_t iDetail = -1); // print the size of the output on a given file
   static Bool_t GetEventShapes(TVector3 &n01,const TVector3 * pTrack, Int_t nTracks, Double_t * eventShapes);
 
   static MCProcessType GetPythiaEventProcessType(AliGenEventHeader* aHeader, Bool_t adebug = kFALSE);