Changeset 9225 for trunk/MagicSoft/Mars/datacenter/macros
- Timestamp:
- 01/16/09 14:57:34 (16 years ago)
- Location:
- trunk/MagicSoft/Mars/datacenter/macros
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/datacenter/macros/fillcamera.C
r9216 r9225 235 235 if (impact < 0) 236 236 imax = "NULL"; 237 TString numphe = Form("% 5.1f", runheader3->GetNumPheFromDNSB());237 TString numphe = Form("%7.3f", runheader3->GetNumPheFromDNSB()); 238 238 TString pmin = Form("%5.1f", runheader3->GetShowerPhiMin()); 239 239 TString pmax = Form("%5.1f", runheader3->GetShowerPhiMax()); … … 600 600 "fReflectorVersionKEY=%d, fCameraVersionKEY=%d, " 601 601 "fObservationModeKEY=%d, fMCParticleKEY=%d, " 602 "f SequenceFirst=0, fNumTriggers=%d, fNumSumTriggers=%d, fViewconeAngleInner=%5.2f, fViewconeAngleOuter=%5.2f, "602 "fNumTriggers=%d, fNumSumTriggers=%d, fViewconeAngleInner=%5.2f, fViewconeAngleOuter=%5.2f, " 603 603 "fAtmosphericModelKEY=%d, fAmplFadcKEY=%d, fAddSpotSizeKEY=%d, " 604 604 "fPSFKEY=%d, fViewconeAngleOKEY=%d, fSpectrumKEY=%d, fTriggerFlagKEY=%d ", … … 613 613 614 614 TString vars2 = 615 Form("fRunFilled=Now(), fFileName=\"%s\", fRunNumber=%d ",616 fname.Data(), RunNum );615 Form("fRunFilled=Now(), fFileName=\"%s\", fRunNumber=%d, fPriority=%d ", 616 fname.Data(), RunNum, RunNum); 617 617 618 618 … … 670 670 "fReflectorVersionKEY=%d, fCameraVersionKEY=%d, " 671 671 "fObservationModeKEY=%d, fMCParticleKEY=%d, " 672 "f SequenceFirst=0, fNumTriggers=%d, fNumSumTriggers=%d, fViewconeAngleInner=%5.2f, fViewconeAngleOuter=%5.2f, "672 "fNumTriggers=%d, fNumSumTriggers=%d, fViewconeAngleInner=%5.2f, fViewconeAngleOuter=%5.2f, " 673 673 "fAtmosphericModelKEY=%d, fAmplFadcKEY=%d, fAddSpotSizeKEY=%d, " 674 674 "fPSFKEY=%d, fViewconeAngleOKEY=%d, fSpectrumKEY=%d, fTriggerFlagKEY=%d ", … … 683 683 684 684 TString vars2 = 685 Form("fRunFilled=Now(), fFileName=\"%s\", fRunNumber=%d ",686 fname.Data(), RunNum );685 Form("fRunFilled=Now(), fFileName=\"%s\", fRunNumber=%d, fPriority=%d ", 686 fname.Data(), RunNum, RunNum); 687 687 688 688 -
trunk/MagicSoft/Mars/datacenter/macros/fillmccalib.C
r9221 r9225 61 61 #include <iostream> 62 62 63 #include <TEnv.h>64 63 #include <TRegexp.h> 65 64 … … 141 140 if (!h) 142 141 { 143 cout << " WARNING- Could not find histogram HRelTimeHiGainArea0." << endl;142 cout << "ERROR - Could not find histogram HRelTimeHiGainArea0." << endl; 144 143 return 2; 145 144 } … … 152 151 if (!h) 153 152 { 154 cout << " WARNING- Could not find histogram HRelTimeHiGainArea1." << endl;153 cout << "ERROR - Could not find histogram HRelTimeHiGainArea1." << endl; 155 154 return 2; 156 155 } … … 163 162 if (!c) 164 163 { 165 cout << " WARNING- Could not find MHCamera TotalConv." << endl;164 cout << "ERROR - Could not find MHCamera TotalConv." << endl; 166 165 return 2; 167 166 } … … 264 263 " fConvFactorInner=%s, " 265 264 " fConvFactorOuter=%s, " 266 " fRatioCalEv ents=%s, "265 " fRatioCalEvts=%s, " 267 266 " fRelChargeRmsInner=%s, " 268 267 " fRelChargeRmsOuter=%s, " -
trunk/MagicSoft/Mars/datacenter/macros/fillmcsignal.C
r9221 r9225 60 60 #include <iomanip> 61 61 62 #include <TEnv.h>63 62 #include <TRegexp.h> 64 63 … … 66 65 #include <TGraph.h> 67 66 #include <TSQLResult.h> 67 #include <TSQLRow.h> 68 68 69 69 #include "MSQLServer.h" … … 89 89 } 90 90 91 Float_t meanextpul = -1;92 Float_t rmsextpul = -1;91 TString meanextpulpos("NULL"); 92 TString rmsextpulpos("NULL"); 93 93 94 94 MCalibrationPulseTimeCam *pt; … … 96 96 if (pt) 97 97 { 98 meanextpul = pt->GetAverageArea(0).GetHiGainMean(); 99 rmsextpul = pt->GetAverageArea(0).GetHiGainRms(); 100 101 meanextpul = TMath::Nint(meanextpul*100)/100.; 102 rmsextpul = TMath::Nint(rmsextpul*100)/100.; 103 } 98 Double_t meanextpul = pt->GetAverageArea(0).GetHiGainMean(); 99 Double_t rmsextpul = pt->GetAverageArea(0).GetHiGainRms(); 100 101 if (meanextpul>=0 || rmsextpulpos>=0) 102 { 103 meanextpulpos.Form("%6.2f", meanextpul); 104 rmsextpulpos.Form("%6.2f", rmsextpul); 105 } 106 } 107 104 108 105 109 MStatusArray arr; … … 113 117 if (!cam) 114 118 { 115 cout << " WARNING- Reading of PedRMS;avg failed." << endl;119 cout << "ERROR - Reading of PedRMS;avg failed." << endl; 116 120 return 2; 117 121 } … … 121 125 if (!pul) 122 126 { 123 cout << " WARNING- Reading of PulsePos;avg failed." << endl;127 cout << "ERROR - Reading of PulsePos;avg failed." << endl; 124 128 return 2; 125 129 } … … 136 140 return 2; 137 141 } 138 139 Double_t medoff;140 Double_t devoff;141 142 Double_t medcal;143 Double_t devcal;144 142 145 143 TString medpuloff("NULL"); … … 148 146 TString devhilocal("NULL"); 149 147 150 MHCamera *hilooff = (MHCamera*)arr.FindObjectInCanvas("HiLoOff;avg", "MHCamera", "HiLoOff"); 151 if (!hilooff) 152 { 153 cout << "WARNING - Reading of HiLoOff failed." << endl; 154 return 2; 155 } 156 157 MHCamera *hilocal = (MHCamera*)arr.FindObjectInCanvas("HiLoCal;avg", "MHCamera", "HiLoCal"); 158 if (!hilocal) 159 { 160 cout << "WARNING - Reading of HiLoCal failed." << endl; 161 return 2; 162 } 163 164 medoff = TMath::Nint(hilooff->GetMedian()*10000)/10000.; 165 devoff = TMath::Nint(hilooff->GetDev() *10000)/10000.; 166 167 medcal = TMath::Nint(hilocal->GetMedian()*100)/100.; 168 devcal = TMath::Nint(hilocal->GetDev() *100)/100.; 169 170 medpuloff.Form("%7.4f", medoff); 171 devpuloff.Form("%7.4f", devoff); 172 medhilocal.Form("%6.2f", medcal); 173 devhilocal.Form("%6.2f", devcal); 148 TString query(Form("SELECT MCSequences.fAmplFadcKEY FROM MCSequences LEFT JOIN " 149 "AmplFadc on MCSequences.fAmplFadcKEY=AmplFadc.fAmplFadcKEY " 150 "where fSequenceFirst=%d;",seq.GetSequence())); 151 152 TSQLResult *res = serv.Query(query); 153 if (!res) 154 { 155 cout << "ERROR - Query failed: " << query << endl; 156 return 2; 157 } 158 159 TSQLRow *row = res->Next(); 160 if (!row) 161 { 162 cout << "ERROR - Query failed: " << query << endl; 163 return 2; 164 } 165 TString epochkey = (*row)[0]; 166 Int_t epoch = atoi(epochkey.Data()); 167 168 delete res; 169 170 if (epoch!=1) 171 { 172 MHCamera *hilooff = (MHCamera*)arr.FindObjectInCanvas("HiLoOff;avg", "MHCamera", "HiLoOff"); 173 if (!hilooff) 174 { 175 cout << "ERROR - Reading of HiLoOff failed." << endl; 176 return 2; 177 } 178 179 MHCamera *hilocal = (MHCamera*)arr.FindObjectInCanvas("HiLoCal;avg", "MHCamera", "HiLoCal"); 180 if (!hilocal) 181 { 182 cout << "ERROR - Reading of HiLoCal failed." << endl; 183 return 2; 184 } 185 186 medpuloff.Form("%7.4f", hilooff->GetMedian()); 187 devpuloff.Form("%7.4f", hilooff->GetDev()); 188 medhilocal.Form("%6.2f", hilocal->GetMedian()); 189 devhilocal.Form("%6.2f", hilocal->GetDev()); 190 } 174 191 175 192 TArrayI inner(1); … … 186 203 if (meanrmsi<0 || meanrmso<0) 187 204 { 188 cout << " WARNING- MeanPedRMS inner or outer < 0 " << endl;205 cout << "ERROR - MeanPedRMS inner or outer < 0 " << endl; 189 206 cout << "MeanPedRMS inner " << meanrmsi << endl; 190 207 cout << "MeanPedRMS outer " << meanrmso << endl; … … 192 209 } 193 210 194 meanrmsi = TMath::Nint(meanrmsi*100)/100.;195 meanrmso = TMath::Nint(meanrmso*100)/100.;211 TString meanrmsinner=Form("%6.2f", meanrmsi); 212 TString meanrmsouter=Form("%6.2f", meanrmso); 196 213 197 214 cam = (MHCamera*)arr.FindObjectInCanvas("Interp'd;avg", "MHCamera", "Interp'd"); 198 215 if (!cam) 199 216 { 200 cout << " WARNING- Reading of Interp'd;avg failed." << endl;217 cout << "ERROR - Reading of Interp'd;avg failed." << endl; 201 218 return 2; 202 219 } … … 207 224 if (meansigi<0 || meansigo<0) 208 225 { 209 cout << " WARNING- MeanInterp'd inner or outer < 0 " << endl;226 cout << "ERROR - MeanInterp'd inner or outer < 0 " << endl; 210 227 cout << "MeanInterp'd inner " << meansigi << endl; 211 228 cout << "MeanInterp'd outer " << meansigo << endl; … … 213 230 } 214 231 215 meansigi = TMath::Nint(meansigi*100)/100.;216 meansigo = TMath::Nint(meansigo*100)/100.;232 TString meansiginner =Form("%6.2f", meansigi); 233 TString meansigouter =Form("%6.2f", meansigo); 217 234 218 235 TString calpos = cal ? Form("%5.1f", cal->GetMean()) : "NULL"; 219 236 220 Stat_t meanpul = pul->GetMean(); 221 Stat_t rmspul = pul->GetRMS(); 222 223 if (meanpul<0 || rmspul<0) 224 { 225 cout << "WARNING - PulsePos'd mean or rms < 0 " << endl; 226 cout << "PulsePos'd mean " << meanpul << endl; 227 cout << "PulsePos'd rms " << rmspul << endl; 228 return 2; 229 } 230 231 meanpul = TMath::Nint(meanpul*100)/100.; 232 rmspul = TMath::Nint(rmspul *100)/100.; 237 if (pul->GetMean()<0 || pul->GetRMS()<0) 238 { 239 cout << "ERROR - PulsePos'd mean or rms < 0 " << endl; 240 cout << "PulsePos'd mean " << pul->GetMean() << endl; 241 cout << "PulsePos'd rms " << pul->GetRMS() << endl; 242 return 2; 243 } 244 245 TString meanpulpos = Form("%6.2f", pul->GetMean()); 246 TString rmspulpos = Form("%6.2f", pul->GetRMS()); 233 247 234 248 cam = (MHCamera*)arr.FindObjectInCanvas("Unsuitable;avg", "MHCamera", "Unsuitable"); 235 249 if (!cam) 236 250 { 237 cout << " WARNING- Reading of Unsuitable;avg failed." << endl;251 cout << "ERROR - Reading of Unsuitable;avg failed." << endl; 238 252 return 2; 239 253 } … … 242 256 Int_t unsuitable01 = cam->GetNumBinsAboveThreshold(0.01); 243 257 244 TString meanrmsinner =Form("%6.2f", meanrmsi);245 TString meanrmsouter =Form("%6.2f", meanrmso);246 TString meansiginner =Form("%6.2f", meansigi);247 TString meansigouter =Form("%6.2f", meansigo);248 TString meanpulpos =Form("%6.2f", meanpul);249 TString rmspulpos =Form("%6.2f", rmspul);250 TString meanextpulpos=Form("%6.2f", meanextpul);251 TString rmsextpulpos =Form("%6.2f", rmsextpul);252 253 if (meanextpul<0 && rmsextpul<0)254 {255 meanextpulpos = "NULL";256 rmsextpulpos = "NULL";257 }258 259 258 // ***************************************************** 260 261 // *****************************************************262 263 259 264 260 cout << "Sequence #" << seq.GetSequence() << endl;
Note:
See TracChangeset
for help on using the changeset viewer.