Changeset 7164 for trunk/MagicSoft/Mars/datacenter/macros/createdataset.C
- Timestamp:
- 06/13/05 18:10:51 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/datacenter/macros/createdataset.C
r7162 r7164 46 46 47 47 int createdataset(Int_t dataset, TString source, TString wobble, 48 TString startdate, TString stopdate, 48 Bool_t cal=kFALSE, 49 TString startdate="0000-00-00 00:00:00", 50 TString stopdate="3000-00-00 00:00:00", 49 51 TString off="none", 50 TString offstartdate=" none",51 TString offstopdate=" none")52 TString offstartdate="0000-00-00 00:00:00", 53 TString offstopdate="3000-00-00 00:00:00") 52 54 { 53 55 TEnv env("sql.rc"); … … 66 68 67 69 TString fname(Form("/magic/datasets/%05d/dataset%08d.txt", dataset/1000, dataset)); 70 TString fhtml="/home/operator/html"; 68 71 Bool_t exist=gSystem->AccessPathName(fname,kFileExists); 69 72 if (exist==0) … … 72 75 return 0; 73 76 } 77 78 ofstream fouthtml(fhtml, ios::app); 79 fouthtml << "<tr><td>" << endl; 80 fouthtml << dataset << endl; 81 fouthtml << "</td><td>" << endl; 82 fouthtml << source << endl; 83 fouthtml << "</td><td>" << endl; 84 if (startdate=="0000-00-00 00:00:00") 85 fouthtml << "all" << endl; 86 else 87 fouthtml << "from " << startdate << " to " << stopdate << endl; 88 if (cal) 89 fouthtml << "only data processed to the imgpar is taken into account" << endl; 90 fouthtml << "</td></tr>" << endl; 91 74 92 ofstream fout(fname, ios::app); 75 93 cout << "writing to file " << fname << endl; 76 94 fout << "AnalysisNumber: " << dataset << endl << endl; 77 95 78 TString query="Select fSequenceFirst from Sequences left join Source on "; 79 query +="Sequences.fSourceKEY=Source.fSourceKEY where fSourceName like '"; 80 query +=Form("%s' and fRunStart between '%s' and '%s'", 96 TString query="Select Sequences.fSequenceFirst from Sequences left join Source on "; 97 query +="Sequences.fSourceKEY=Source.fSourceKEY "; 98 if (cal) 99 query +=" left join SequenceProcessStatus on Sequences.fSequenceFirst=SequenceProcessStatus.fSequenceFirst "; 100 query +=Form(" where fSourceName like '%s%%' and fRunStart between '%s' and '%s'", 81 101 source.Data(), startdate.Data(), stopdate.Data()); 82 query +=" order by fSequenceFirst "; 102 if (cal) 103 query +=" and not IsNull(fStar) "; 104 query +=" order by Sequences.fSequenceFirst "; 83 105 84 106 cout << "Q: " << query << endl; … … 112 134 113 135 cout << "off: " << off << endl; 114 query ="Select fSequenceFirst from Sequences left join Source on "; 115 query +=" Sequences.fSourceKEY=Source.fSourceKEY where fSourceName like '"; 116 query +=Form("%s%%' and fRunStart between '%s' and '%s'", 117 off.Data(), startdate.Data(), stopdate.Data()); 118 query +=" order by fSequenceFirst "; 136 query ="Select Sequences.fSequenceFirst from Sequences left join Source on "; 137 query +="Sequences.fSourceKEY=Source.fSourceKEY "; 138 if (cal) 139 query +=" left join SequenceProcessStatus on Sequences.fSequenceFirst=SequenceProcessStatus.fSequenceFirst "; 140 query +=Form("where fSourceName like '%s%%' and fRunStart between '%s' and '%s'", 141 off.Data(), offstartdate.Data(), offstopdate.Data()); 142 if (cal) 143 query +=" and not IsNull(fStar) "; 144 query +=" order by Sequences.fSequenceFirst "; 119 145 120 146 cout << "Q: " << query << endl;
Note:
See TracChangeset
for help on using the changeset viewer.