File indexing completed on 2023-03-17 10:55:09
0001 int filechk(string fname)
0002 {
0003
0004 TFile f(fname.c_str());
0005
0006 if (f.IsZombie()){
0007
0008 return -1;
0009 }
0010 else
0011 {
0012 if ( fname.find("_SiStrip_") != string::npos ){
0013 TString rnStr = fname.substr(fname.find("_R") + 2, 9);
0014 TString runDirStr("Run ");
0015 runDirStr += rnStr.Atoi();
0016 TDirectoryFile* runDir = (TDirectoryFile*)f.FindObjectAny(runDirStr);
0017 if ( runDir == 0 )
0018 return 0;
0019
0020 TDirectoryFile* tracking = (TDirectoryFile*)runDir->FindObjectAny("Tracking");
0021 if ( tracking == 0 )
0022 return 0;
0023
0024 TDirectoryFile* sistrip = (TDirectoryFile*)runDir->FindObjectAny("SiStrip");
0025 if ( sistrip == 0 )
0026 return 0;
0027
0028 TDirectoryFile* hist = (TDirectoryFile*)tracking->FindObjectAny("reportSummaryMap");
0029 if ( hist == 0 )
0030 return 0;
0031
0032 hist = (TDirectoryFile*)sistrip->FindObjectAny("reportSummaryMap");
0033 if ( hist == 0 )
0034 return 0;
0035
0036 return 1;
0037 }
0038
0039
0040
0041 TDirectoryFile* hist;
0042
0043 hist = (TDirectoryFile*)f.FindObjectAny("reportSummaryMap");
0044 if (0 == hist)
0045 {
0046 TDirectoryFile* hist2;
0047 hist2 = (TDirectoryFile*)f.FindObjectAny("EventInfo");
0048 if (0 != hist2)
0049 return 1;
0050
0051
0052 return 0;
0053 }
0054 else
0055 {
0056
0057 return 1;
0058 }
0059 }
0060 }