Changeset 7777 for trunk/MagicSoft/Mars
- Timestamp:
- 07/05/06 11:41:13 (18 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r7776 r7777 18 18 19 19 -*-*- END OF LINE -*-*- 20 21 2006/07/05 Thomas Bretz 22 23 * datacenter/macros/checkfileavail.C, 24 datacenter/macros/checkstardone.C, 25 datacenter/macros/doexclusions.C, 26 datacenter/macros/filldotraw.C, 27 datacenter/macros/fillganymed.C, 28 datacenter/macros/fillsignal.C, 29 datacenter/macros/fillstar.C, 30 datacenter/macros/setupdb.C: 31 - make sure that 'res' is correctly deleted 32 33 * datacenter/macros/doexclusions.C: 34 - fixed some variable name overrides 35 36 * mhflux/MAlphaFitter.[h,cc]: 37 - added the possibility to DrawResult() 38 39 20 40 21 41 2006/07/04 Daniela Dorner -
trunk/MagicSoft/Mars/datacenter/macros/checkfileavail.C
r7528 r7777 77 77 } 78 78 79 TSQLRow *row=0; 80 while ((row = res->Next())) 81 { 82 // TString entry=(*row)[0]; 83 // if (entry=="1970-01-01 00:00:00") 84 // return ""; 85 return (*row)[0]; 86 } 79 TString rc = (*row)[0]; 87 80 88 return ""; 81 delete res; 82 83 return rc; 89 84 } 90 85 … … 138 133 cout << "run#: " << runno << endl; 139 134 //if one value returns "" (i.e. column is NULL), 0 is returned 140 if (GetStatus(serv, rc, runno, "RunProcessStatus", "fCCFileAvail") ==""141 || GetStatus(serv, rc, runno, "RunProcessStatus", "fCaCoFileAvail") ==""142 || GetStatus(serv, rc, runno, "RunProcessStatus", "fCaCoFileFound") ==""143 || GetStatus(serv, rc, runno, "RunProcessStatus", "fTimingCorrection") ==""135 if (GetStatus(serv, rc, runno, "RunProcessStatus", "fCCFileAvail").IsNull() 136 || GetStatus(serv, rc, runno, "RunProcessStatus", "fCaCoFileAvail").IsNull() 137 || GetStatus(serv, rc, runno, "RunProcessStatus", "fCaCoFileFound").IsNull() 138 || GetStatus(serv, rc, runno, "RunProcessStatus", "fTimingCorrection").IsNull() 144 139 // || GetStatus(serv, rc, runno, "RunProcessStatus", "fTimingCorrection")=="1970-01-01 00:00:00" 145 || GetStatus(serv, rc, runno, "RunProcessStatus", "fRawFileAvail") =="")140 || GetStatus(serv, rc, runno, "RunProcessStatus", "fRawFileAvail").IsNull()) 146 141 return 2; 147 142 } -
trunk/MagicSoft/Mars/datacenter/macros/checkstardone.C
r7528 r7777 74 74 } 75 75 76 TSQLRow *row=0; 77 while ((row = res->Next())) 78 return (*row)[0]; 76 TString rc = (*row)[0]; 79 77 80 return ""; 78 delete res; 79 80 return rc; 81 81 } 82 82 … … 100 100 101 101 //check if fStar not NULL for sequence 102 if (GetStatus(serv, rc, datasetno, "SequenceProcessStatus", "fStar") =="")102 if (GetStatus(serv, rc, datasetno, "SequenceProcessStatus", "fStar").IsNull()) 103 103 return 2; 104 104 -
trunk/MagicSoft/Mars/datacenter/macros/doexclusions.C
r7528 r7777 174 174 //get importance of exclusion-reason from database 175 175 TString query(Form("SELECT fExcludedFDAImportance from ExcludedFDA where fExcludedFDAKEY=%s ", key.Data())); 176 TSQLResult *res = serv.Query(query);177 if (!res )176 TSQLResult *res2 = serv.Query(query); 177 if (!res2) 178 178 { 179 179 cout << "Error - could not get importance." << endl; … … 181 181 } 182 182 183 TSQLRow *row2=res ->Next();183 TSQLRow *row2=res2->Next(); 184 184 Int_t newimp=atoi((*row2)[0]); 185 delete res ;185 delete res2; 186 186 187 187 //get current importance from database … … 210 210 cout << query << endl; 211 211 212 res = serv.Query(query);213 if (!res )212 res2 = serv.Query(query); 213 if (!res2) 214 214 { 215 215 cout << "Error - no runs to exclude" << endl; … … 219 219 //compare new and old importance 220 220 //change or keep the exclusion-reason accordingly 221 while ((row2 = res ->Next()))221 while ((row2 = res2->Next())) 222 222 { 223 223 if (TString((*row2)[1]).IsNull() || atoi((*row2)[1])>newimp) … … 227 227 key.Data(), (*row2)[0])); 228 228 cout << "QU: " << query << endl; 229 TSQLResult *res = serv.Query(query);230 if (!res )229 TSQLResult *res3 = serv.Query(query); 230 if (!res3) 231 231 { 232 232 cout << "Error - could not insert exclusion" << endl; 233 233 return 2; 234 234 } 235 delete res ;235 delete res3; 236 236 continue; 237 237 } … … 239 239 cout << "run#: " << (*row2)[0] << " reason for exclusion is still the same" << endl; 240 240 } 241 delete res ;241 delete res2; 242 242 } 243 243 delete res; -
trunk/MagicSoft/Mars/datacenter/macros/filldotraw.C
r7635 r7777 94 94 } 95 95 96 return atoi((*row)[0]); 96 Int_t rc = atoi((*row)[0]); 97 98 delete res; 99 100 return rc; 97 101 } 98 102 … … 168 172 return 2; 169 173 } 170 174 delete res; 171 175 return 1; 172 176 } -
trunk/MagicSoft/Mars/datacenter/macros/fillganymed.C
r7528 r7777 212 212 return 2; 213 213 } 214 delete res; 214 215 return 1; 215 216 } -
trunk/MagicSoft/Mars/datacenter/macros/fillsignal.C
r7528 r7777 235 235 return 2; 236 236 } 237 237 delete res; 238 238 return 1; 239 239 } -
trunk/MagicSoft/Mars/datacenter/macros/fillstar.C
r7759 r7777 337 337 return 2; 338 338 } 339 delete res; 339 340 340 341 return 1; -
trunk/MagicSoft/Mars/datacenter/macros/setupdb.C
r7761 r7777 140 140 fields += ", "; 141 141 } 142 143 delete res; 142 144 143 145 return fields; -
trunk/MagicSoft/Mars/mhflux/MAlphaFitter.cc
r7741 r7777 330 330 // Assuming that bg and fit2.GetEventsBackground() are rather identical: 331 331 const Double_t sc = er*er / fit.GetEventsBackground(); 332 /* 332 333 333 cout << MMath::SignificanceLiMaSigned(hon.Integral(1, bin), fit.GetEventsBackground()/sc, sc) << " "; 334 334 cout << sc << " "; 335 335 cout << fit.fChiSqBg << endl; 336 */ 336 337 337 return sc; 338 338 } … … 404 404 } 405 405 406 void MAlphaFitter::PaintResult(Float_t x, Float_t y, Float_t size ) const406 void MAlphaFitter::PaintResult(Float_t x, Float_t y, Float_t size, Bool_t draw) const 407 407 { 408 408 const Double_t w = GetGausSigma(); … … 413 413 const TString fmt = Form("\\sigma_{L/M}=%%.1f \\omega=%%.%df\\circ E=%%d B=%%d x<%%.%df \\tilde\\chi_{b}=%%.1f \\tilde\\chi_{s}=%%.1f c=%%.1f f=%%.2f", 414 414 l1<1?1:l1+1, l2<1?1:l2+1); 415 416 TLatex text(x, y, Form(fmt.Data(), fSignificance, w, (int)fEventsExcess, 417 (int)fEventsBackground, m, fChiSqBg, fChiSqSignal, 418 fCoefficients[3], fScaleFactor)); 419 415 const TString txt = Form(fmt.Data(), fSignificance, w, (int)fEventsExcess, 416 (int)fEventsBackground, m, fChiSqBg, fChiSqSignal, 417 fCoefficients[3], fScaleFactor); 418 419 // This is totaly weired but the only way to get both options 420 // working with this nonsense implementation of TLatex 421 TLatex text(x, y, txt); 420 422 text.SetBit(TLatex::kTextNDC); 421 423 text.SetTextSize(size); 422 text.Paint(); 424 if (draw) 425 text.DrawLatex(x, y, txt); 426 else 427 text.Paint(); 423 428 424 429 TLine line; 425 430 line.SetLineColor(14); 426 line.PaintLine(m, gPad->GetUymin(), m, gPad->GetUymax()); 431 if (draw) 432 line.DrawLine(m, gPad->GetUymin(), m, gPad->GetUymax()); 433 else 434 line.PaintLine(m, gPad->GetUymin(), m, gPad->GetUymax()); 427 435 } 428 436 -
trunk/MagicSoft/Mars/mhflux/MAlphaFitter.h
r7720 r7777 237 237 238 238 // Interface to result 239 void PaintResult(Float_t x=0.04, Float_t y=0.94, Float_t size=0.035) const; 239 void PaintResult(Float_t x=0.04, Float_t y=0.94, Float_t size=0.035, Bool_t draw=kFALSE) const; 240 void DrawResult(Float_t x=0.04, Float_t y=0.94, Float_t size=0.035) const { PaintResult(x, y, size, kTRUE); } 240 241 241 242 // MTask
Note:
See TracChangeset
for help on using the changeset viewer.