Changeset 6935 for trunk/MagicSoft/Mars
- Timestamp:
- 04/13/05 09:29:47 (20 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r6934 r6935 21 21 22 22 -*-*- END OF LINE -*-*- 23 24 2005/04/13 Daniela Dorner 25 26 * datacenter/macros/fillcalib.C: 27 - added update 28 29 * datacenter/scripts/copyscript 30 - fixed bug 31 32 33 23 34 2005/04/12 Daniela Dorner 24 35 -
trunk/MagicSoft/Mars/datacenter/macros/fillcalib.C
r6933 r6935 63 63 #include <TFile.h> 64 64 #include <TSQLResult.h> 65 #include <TSQLRow.h> 65 66 66 67 #include "MSQLServer.h" … … 70 71 71 72 using namespace std; 73 74 // -------------------------------------------------------------------------- 75 // 76 // Checks whether an entry is already existing 77 // 78 Bool_t ExistStr(MSQLServer &serv, const char *column, const char *table, Int_t test) 79 { 80 TString query(Form("SELECT %s FROM %s WHERE %s='%d'", column, table, column, test)); 81 TSQLResult *res = serv.Query(query); 82 if (!res) 83 return kFALSE; 84 85 TSQLRow *row; 86 87 Bool_t rc = kFALSE; 88 while ((row=res->Next())) 89 { 90 if ((*row)[0]) 91 { 92 rc = kTRUE; 93 break; 94 } 95 } 96 97 delete res; 98 99 return rc; 100 } 101 72 102 73 103 int Process(MSQLServer &serv, TString fname, Bool_t dummy) … … 125 155 cout << " Max.Cluster: (i/o) " << Form("%3d", (int)clumax) << endl; // Max Cluster 126 156 157 TString query; 158 if (!ExistStr(serv, "fSequenceFirst", "MyMagic.Calibration", seq)) 159 { 160 161 query = Form("INSERT MyMagic.Calibration SET" 162 " fSequenceFirst=%d," 163 " fUnsuitableInner=%d, " 164 " fUnsuitableOuter=%d, " 165 " fUnreliableInner=%d, " 166 " fUnreliableOuter=%d, " 167 " fIsolatedInner=%d, " 168 " fIsolatedOuter=%d, " 169 " fIsolatedMaxCluster=%d", 170 seq, (int)unsin, (int)unsout, (int)unrin, 171 (int)unrout, (int)isoin, (int)isoout, (int)clumax); 172 } 173 else 174 { 175 query = Form("UPDATE MyMagic.Calibration SET" 176 " fUnsuitableInner=%d, " 177 " fUnsuitableOuter=%d, " 178 " fUnreliableInner=%d, " 179 " fUnreliableOuter=%d, " 180 " fIsolatedInner=%d, " 181 " fIsolatedOuter=%d, " 182 " fIsolatedMaxCluster=%d" 183 " WHERE fSequenceFirst=%d,", 184 (int)unsin, (int)unsout, (int)unrin,(int)unrout, 185 (int)isoin, (int)isoout, (int)clumax, seq); 186 } 187 127 188 if (dummy) 128 189 return 0; 129 130 TString query = Form("INSERT MyMagic.Calibration SET"131 " fSequenceFirst=%d,"132 " fUnsuitableInner=%d, "133 " fUnsuitableOuter=%d, "134 " fUnreliableInner=%d, "135 " fUnreliableOuter=%d, "136 " fIsolatedInner=%d, "137 " fIsolatedOuter=%d, "138 " fIsolatedMaxCluster=%d",139 seq, (int)unsin, (int)unsout, (int)unrin,140 (int)unrout, (int)isoin, (int)isoout, (int)clumax);141 142 190 143 191 TSQLResult *res = serv.Query(query); … … 147 195 return 0; 148 196 } 197 delete res; 149 198 150 199 return 1; -
trunk/MagicSoft/Mars/datacenter/scripts/copyscript
r6934 r6935 226 226 then 227 227 #add file to donelist 228 echo "$file nameprocessed" >> $transdir/.processed228 echo "$file processed" >> $transdir/.processed 229 229 echo $filename" moved and added to .processed" >> $scriptlog 2>&1 230 230 else
Note:
See TracChangeset
for help on using the changeset viewer.