Changeset 16671
- Timestamp:
- 06/03/13 22:20:46 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Mars/fact/processing/numevents.C
r15530 r16671 1 #include <iostream> 2 3 #include <TCanvas.h> 4 #include <TString.h> 5 #include <TTree.h> 6 #include <TFile.h> 7 #include <TSystem.h> 8 #include <TSQLResult.h> 9 #include <TSQLRow.h> 10 11 #include "MSQLMagic.h" 12 #include "MAlphaFitter.h" 13 #include "MHThetaSq.h" 14 #include "MStatusArray.h" 15 16 1 17 using namespace std; 2 18 … … 16 32 return 0; 17 33 } 34 serv.SetIsDummy(dummy); 18 35 19 36 //select runs, where star finished, format the list nicely … … 40 57 41 58 //allocate variables to use in the loop 42 TString night ;59 TString night2; 43 60 TString runid; 44 61 TString run; … … 59 76 Float_t fNumExcEvts = 0; 60 77 Float_t fNumIslandsMean = 0; 78 Float_t fOnTimeAfterCuts = 0; 61 79 62 80 //loop over the data files 63 81 TSQLRow *row=0; 64 Int_t counter=0;65 82 66 83 /* … … 77 94 { 78 95 //use the results from the query 79 night =(*row)[4];96 night2=(*row)[4]; 80 97 runid=(*row)[5]; 81 98 run=(*row)[0]; … … 88 105 ganymed_fname=inpath+"/ganymed_run/"+year+"/"+month+"/"+day+"/"+run+"-analysis.root"; 89 106 else 90 ganymed_fname=inpath+"/ganymed_night/"+night +"-analysis.root";107 ganymed_fname=inpath+"/ganymed_night/"+night2+"-analysis.root"; 91 108 //cout << "gf => " << ganymed_fname << endl; 92 109 … … 150 167 continue; 151 168 } 169 170 TH1D *vstime = (TH1D*)arr.FindObjectInCanvas("OnTime", "TH1D", "OnTime"); 171 if (!vstime) 172 { 173 cout << "WARNING - Reading of Theta failed." << endl; 174 continue; 175 } 176 fOnTimeAfterCuts = vstime->Integral(); 152 177 153 178 //Get number of events after quality cuts … … 204 229 205 230 //inserting or updating the information in the database 206 vars = Form("fRunID=%s, fNight=%s,", runid.Data(), night .Data());231 vars = Form("fRunID=%s, fNight=%s,", runid.Data(), night2.Data()); 207 232 vars += Form(" fNumEvtsAfterQualCuts=%d, " 208 233 " fNumEvtsAfterBgCuts=%d, " 209 234 " fNumBgEvts=%6.1f, " 210 235 " fNumSigEvts=%6.1f, " 211 " fNumExcEvts=%6.1f ", 236 " fNumExcEvts=%6.1f, " 237 " fOnTimeAfterCuts=%7.2f ", 212 238 fNumEvtsAfterQualCuts, 213 239 fNumEvtsAfterBgCuts, 214 240 fNumBgEvts, 215 241 fNumSigEvts, 216 fNumExcEvts 242 fNumExcEvts, 243 fOnTimeAfterCuts 217 244 ); 218 245 if (!pernight) 219 vars += Form(", fNumIslandsMean=%6.2f ", 220 ", fNumEvtsAfterCleaning=%d ", 246 vars += Form(", fNumIslandsMean=%6.2f, fNumEvtsAfterCleaning=%d ", 221 247 fNumIslandsMean, 222 248 fNumEvtsAfterCleaning … … 225 251 226 252 if (pernight) 227 where = Form("fNight=%s", night .Data());253 where = Form("fNight=%s", night2.Data()); 228 254 else 229 where = Form("fRunID=%s AND fNight=%s", runid.Data(), night .Data());255 where = Form("fRunID=%s AND fNight=%s", runid.Data(), night2.Data()); 230 256 231 257 cout << "vars: " << vars << endl;
Note:
See TracChangeset
for help on using the changeset viewer.