ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/cbrown/AnalysisFramework/Plotting/Modules/SUSYScan.C
(Generate patch)

Comparing UserCode/cbrown/AnalysisFramework/Plotting/Modules/SUSYScan.C (file contents):
Revision 1.50 by buchmann, Thu Nov 3 10:39:40 2011 UTC vs.
Revision 1.51 by buchmann, Fri Nov 4 10:41:32 2011 UTC

# Line 3 | Line 3
3   #include <sys/stat.h>
4   #include <fstream>
5   #include <pthread.h>
6 + #include <assert.h>
7  
8   #include <TCut.h>
9   #include <TROOT.h>
# Line 77 | Line 78 | void delete_any_cached_scans() {
78  
79   bool initialized_t2=false;
80  
81 + int srmcpretries=0;
82 +
83   void load_scan_sample(int a, int b, int &scanfileindex,bool ismSUGRA) {
84    dout << "Going to load file with Xzone=" << a << " and  Yzone=" << b << endl;
85    stringstream filetoload;
# Line 122 | Line 125 | void load_scan_sample(int a, int b, int
125            delete_any_cached_scans();
126            dout << "Going to download the scan file with the following copy command: " << copyfile.str() << endl;
127            gSystem->Exec(copyfile.str().c_str());
128 <          scansample.AddSample(newfilename.str(),"scansample",1,1,false,true,scanfileindex,kRed);
128 >          if(doesROOTFileExist(newfilename.str())) {
129 >                scansample.AddSample(newfilename.str(),"scansample",1,1,false,true,scanfileindex,kRed);
130 >          } else {
131 >                srmcpretries++;
132 >                if(srmcpretries<5) {
133 >                        dout << "The file could not be loaded correctly - retrying!" << endl;
134 >                        load_scan_sample(a,b,scanfileindex,ismSUGRA);
135 >                } else {
136 >                        dout << "Have tried 5 times to load this sample. Giving up now and failing the program execution" << endl;
137 >                        assert(0);
138 >                        dout << "The command " << copyfile.str() << " failed to copy the file to the local storage (saving it as " << newfilename.str() << ")" << endl;
139 >                }
140 >          }
141          }
142      } else {
143          dout << "Last sample is the same as the current one. Recycling it." << endl;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines