Changeset 7010
- Timestamp:
- 05/10/05 14:52:19 (20 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r7007 r7010 21 21 22 22 -*-*- END OF LINE -*-*- 23 24 2005/05/10 Daniela Dorner 25 26 * datacenter/macros/fillcalib.C: 27 - added some parameters (reading from calib*.root and inserting 28 into db) 29 30 * datacenter/macros/setupdb.C: 31 - adapted macro to the new columns in the calibration db 32 33 * datacenter/macros/fillsignal.C: 34 - fixed typo 35 36 37 23 38 2005/05/10 Markus Meyer 24 39 … … 29 44 - commented out the ArcLength and Estimpact (will be not 30 45 calculated for the moment) 46 31 47 32 48 -
trunk/MagicSoft/Mars/datacenter/macros/fillcalib.C
r6935 r7010 61 61 #include <TRegexp.h> 62 62 63 #include <TH1.h> 64 63 65 #include <TFile.h> 64 66 #include <TSQLResult.h> … … 67 69 #include "MSQLServer.h" 68 70 71 #include "MStatusArray.h" 72 #include "MHCamera.h" 69 73 #include "MGeomCamMagic.h" 70 74 #include "MBadPixelsCam.h" … … 143 147 // hist.DrawCopy(); 144 148 149 //Getting values from the status display 150 MStatusArray arr; 151 if (arr.Read()<=0) 152 return 0; 153 154 TH1 *h; 155 156 //getting the mean and rms from the arrival time (inner cam) 157 h = (TH1*)arr.FindObjectInCanvas("HRelTimeHiGainArea0", "TH1F", "Time"); 158 if (!h) 159 { 160 cout << "WARNING - Could not find histogram HRelTimeHiGainArea0." << endl; 161 return 0; 162 } 163 164 Float_t meani = h->GetMean(); 165 Float_t rmsi = h->GetRMS(); 166 meani = TMath::Nint(meani*10)/10.; 167 rmsi = TMath::Nint(rmsi*10)/10.; 168 TString meaninner = Form("%4.1f", meani); 169 TString rmsinner = Form("%4.1f", rmsi); 170 171 cout << "bla: " << meaninner << ", " << rmsinner << endl; 172 cout << "bla: " << meaninner.Data() << ", " << rmsinner.Data() << endl; 173 174 175 //getting the mean and rms from the arrival time (outer cam) 176 h = (TH1*)arr.FindObjectInCanvas("HRelTimeHiGainArea1", "TH1F", "Time"); 177 if (!h) 178 { 179 cout << "WARNING - Could not find histogram HRelTimeHiGainArea1." << endl; 180 return 0; 181 } 182 183 Float_t meano = h->GetMean(); 184 Float_t rmso = h->GetRMS(); 185 meano = TMath::Nint(meano*10)/10.; 186 rmso = TMath::Nint(rmso*10)/10.; 187 TString meanouter = Form("%4.1f", meano); 188 TString rmsouter = Form("%4.1f", rmso); 189 190 191 //Getting conversion factors 192 MHCamera *c = (MHCamera*)arr.FindObjectInCanvas("TotalConv", "MHCamera", "Conversion"); 193 if (!c) 194 { 195 cout << "WARNING - Could not find MHCamera TotalConv." << endl; 196 return 0; 197 } 198 199 TArrayI inner(1), outer(1); 200 inner[0] = 0; 201 outer[0] = 1; 202 203 Int_t s0[] = { 1, 2, 3, 4, 5, 6 }; 204 205 Stat_t meanconvi = c->GetMeanSectors(TArrayI(6, s0), inner); 206 Stat_t meanconvo = c->GetMeanSectors(TArrayI(6, s0), outer); 207 meanconvi = TMath::Nint(meanconvi*10)/10.; 208 meanconvo = TMath::Nint(meanconvo*10)/10.; 209 TString meanconvinner=Form("%4.1f", meanconvi); 210 TString meanconvouter=Form("%4.1f", meanconvo); 211 212 213 //Getting sequ# from filename 145 214 TString sequence = fname(TRegexp("calib[0-9]+[.]root$")); 146 215 if (sequence.IsNull()) 147 return 0; 216 { 217 cout << "WARNING - Could get sequence# from filename: " << fname << endl; 218 return 0; 219 } 148 220 149 221 Int_t seq = atoi(sequence.Data()+5); 150 222 223 151 224 cout << "Sequence #" << seq << endl; 152 cout << " Unsuitable: (i/o) " << Form("%3d %3d", (int)unsin, (int)unsout) << endl; // Unbrauchbar 153 cout << " Unreliable: (i/o) " << Form("%3d %3d", (int)unrin, (int)unrout) << endl; // Unzuverlaessig 154 cout << " Isolated: (i/o) " << Form("%3d %3d", (int)isoin, (int)isoout) << endl; // Isolated (unbrauchbar) 155 cout << " Max.Cluster: (i/o) " << Form("%3d", (int)clumax) << endl; // Max Cluster 225 cout << " Unsuitable: (i/o) " << Form("%3d %3d", (int)unsin, (int)unsout) << endl; // Unbrauchbar 226 cout << " Unreliable: (i/o) " << Form("%3d %3d", (int)unrin, (int)unrout) << endl; // Unzuverlaessig 227 cout << " Isolated: (i/o) " << Form("%3d %3d", (int)isoin, (int)isoout) << endl; // Isolated (unbrauchbar) 228 cout << " Max.Cluster: " << Form("%3d", (int)clumax) << endl; // Max Cluster 229 cout << " Arr Time inner: " << Form("%4.1f +- %4.1f", meani, rmsi) << endl; 230 cout << " Arr Time outer: " << Form("%4.1f +- %4.1f", meano, rmso) << endl; 231 cout << " Mean Conv inner: " << Form("%4.1f", meanconvi) << endl; 232 cout << " Mean Conv outer: " << Form("%4.1f", meanconvo) << endl; 156 233 157 234 TString query; … … 167 244 " fIsolatedInner=%d, " 168 245 " fIsolatedOuter=%d, " 169 " fIsolatedMaxCluster=%d", 246 " fIsolatedMaxCluster=%d, ", 247 " fArrTimeMeanInner=%s, " 248 " fArrTimeRmsInner=%s, " 249 " fArrTimeMeanOuter=%s, " 250 " fArrTimeRmsOuter=%s, " 251 " fConvFactorInner=%s, " 252 " fConvFactorOuter=%s ", 170 253 seq, (int)unsin, (int)unsout, (int)unrin, 171 (int)unrout, (int)isoin, (int)isoout, (int)clumax); 254 (int)unrout, (int)isoin, (int)isoout, 255 (int)clumax, 256 meaninner.Data(), rmsinner.Data(), 257 meanouter.Data(), rmsouter.Data(), 258 meanconvinner.Data(), meanconvouter.Data()); 172 259 } 173 260 else … … 180 267 " fIsolatedInner=%d, " 181 268 " fIsolatedOuter=%d, " 182 " fIsolatedMaxCluster=%d" 183 " WHERE fSequenceFirst=%d,", 269 " fIsolatedMaxCluster=%d, " 270 " fArrTimeMeanInner=%s, " 271 " fArrTimeRmsInner=%s, " 272 " fArrTimeMeanOuter=%s, " 273 " fArrTimeRmsOuter=%s, " 274 " fConvFactorInner=%s, " 275 " fConvFactorOuter=%s " 276 " WHERE fSequenceFirst=%d ", 184 277 (int)unsin, (int)unsout, (int)unrin,(int)unrout, 185 (int)isoin, (int)isoout, (int)clumax, seq); 186 } 278 (int)isoin, (int)isoout, (int)clumax, 279 meaninner.Data(), rmsinner.Data(), 280 meanouter.Data(), rmsouter.Data(), 281 meanconvinner.Data(), meanconvouter.Data(), 282 seq); 283 } 284 285 cout << "q: " << query << endl; 187 286 188 287 if (dummy) -
trunk/MagicSoft/Mars/datacenter/macros/fillsignal.C
r6933 r7010 119 119 120 120 cout << "Sequence #" << seq << endl; 121 cout << " Mean Ped RMS inner [phe] " << Form("%4.1f", meani) << endl; // Unbrauchbar122 cout << " Mean Ped RMS outer [phe] " << Form("%4.1f", meano) << endl; // Unbrauchbar121 cout << " Mean Ped RMS inner [phe] " << Form("%4.1f", meani) << endl; 122 cout << " Mean Ped RMS outer [phe] " << Form("%4.1f", meano) << endl; 123 123 124 124 TString query = Form("UPDATE MyMagic.Calibration SET fMeanPedRmsInner=%s, " -
trunk/MagicSoft/Mars/datacenter/macros/setupdb.C
r6937 r7010 516 516 " fMeanPedRmsInner FLOAT(5,1) NOT NULL," 517 517 " fMeanPedRmsOuter FLOAT(5,1) NOT NULL," 518 " fArrTimeMeanInner FLOAT(5,1) NOT NULL," 519 " fArrTimeRmsInner FLOAT(5,1) NOT NULL," 520 " fArrTimeMeanOuter FLOAT(5,1) NOT NULL," 521 " fArrTimeRmsOuter FLOAT(5,1) NOT NULL," 522 " fConvFactorInner FLOAT(5,1) NOT NULL," 523 " fConvFactorOuter FLOAT(5,1) NOT NULL," 518 524 " fLastUpdate TIMESTAMP" 519 525 ")"));
Note:
See TracChangeset
for help on using the changeset viewer.