Changeset 3832 for trunk/MagicSoft/Mars/macros
- Timestamp:
- 04/26/04 16:44:20 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/macros
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/macros/bootcampstandardanalysis.C
r3796 r3832 71 71 cruns.AddRuns(crun1,crun2,inpath); 72 72 73 MCalibrationCam::PulserColor_t color;74 75 if (crun1 < 20000)76 color = MCalibrationCam::kCT1;77 else78 color = FindColor((MDirIter*)&cruns);79 80 if (color == MCalibrationCam::kNONE)81 {82 TTimer timer("gSystem->ProcessEvents();", 50, kFALSE);83 84 while (1)85 {86 timer.TurnOn();87 TString input = Getline("Could not find the correct colour: Type 'q' to exit, "88 "green, blue, uv or ct1 to go on: ");89 timer.TurnOff();90 91 if (input=="q\n")92 return ;93 94 if (input=="green")95 color = MCalibrationCam::kGREEN;96 if (input=="blue")97 color = MCalibrationCam::kBLUE;98 if (input=="uv")99 color = MCalibrationCam::kUV;100 if (input=="ct1")101 color = MCalibrationCam::kCT1;102 }103 }104 105 73 if (drun2==0) 106 74 druns.AddRun(drun1,inpath); … … 149 117 MCalibrationQECam qecam; 150 118 MJCalibration calloop; 151 calloop.SetColor(color);152 119 calloop.SetInput(&cruns); 153 120 // … … 364 331 } 365 332 366 MCalibrationCam::PulserColor_t FindColor(MDirIter* run)367 {368 369 MCalibrationCam::PulserColor_t col = MCalibrationCam::kNONE;370 371 TString filenames;372 373 while (!(filenames=run->Next()).IsNull())374 {375 376 filenames.ToLower();377 378 if (filenames.Contains("green"))379 if (col == MCalibrationCam::kNONE)380 {381 cout << "Found colour: Green in " << filenames << endl;382 col = MCalibrationCam::kGREEN;383 }384 else if (col != MCalibrationCam::kGREEN)385 {386 cout << "Different colour found in " << filenames << "... abort" << endl;387 return MCalibrationCam::kNONE;388 }389 390 if (filenames.Contains("blue"))391 if (col == MCalibrationCam::kNONE)392 {393 cout << "Found colour: Blue in " << filenames << endl;394 col = MCalibrationCam::kBLUE;395 }396 else if (col != MCalibrationCam::kBLUE)397 {398 cout << "Different colour found in " << filenames << "... abort" << endl;399 return MCalibrationCam::kNONE;400 }401 402 if (filenames.Contains("uv"))403 if (col == MCalibrationCam::kNONE)404 {405 cout << "Found colour: Uv in " << filenames << endl;406 col = MCalibrationCam::kUV;407 }408 else if (col != MCalibrationCam::kUV)409 {410 cout << "Different colour found in " << filenames << "... abort" << endl;411 return MCalibrationCam::kNONE;412 }413 414 if (filenames.Contains("ct1"))415 if (col == MCalibrationCam::kNONE)416 {417 cout << "Found colour: Ct1 in " << filenames << endl;418 col = MCalibrationCam::kCT1;419 }420 else if (col != MCalibrationCam::kCT1)421 {422 cout << "Different colour found in " << filenames << "... abort" << endl;423 return MCalibrationCam::kNONE;424 }425 426 }427 428 429 430 if (col == MCalibrationCam::kNONE)431 cout << "No colour found in filenames of runs: " << ((MRunIter*)run)->GetRunsAsString()432 << "... abort" << endl;433 434 return col;435 } -
trunk/MagicSoft/Mars/macros/calibrate_data.C
r3762 r3832 56 56 } 57 57 58 MCalibrationCam::PulserColor_t color;59 60 if (calruns[0] < 20000)61 color = MCalibrationCam::kCT1;62 else63 color = FindColor((MDirIter*)&cruns);64 65 if (color == MCalibrationCam::kNONE)66 {67 TTimer timer("gSystem->ProcessEvents();", 50, kFALSE);68 69 while (1)70 {71 timer.TurnOn();72 TString input = Getline("Could not find the correct colour: Type 'q' to exit, "73 "green, blue, uv or ct1 to go on: ");74 timer.TurnOff();75 76 if (input=="q\n")77 return ;78 79 if (input=="green")80 color = MCalibrationCam::kGREEN;81 if (input=="blue")82 color = MCalibrationCam::kBLUE;83 if (input=="uv")84 color = MCalibrationCam::kUV;85 if (input=="ct1")86 color = MCalibrationCam::kCT1;87 }88 }89 58 90 59 MStatusDisplay *display = new MStatusDisplay; … … 110 79 // 111 80 // badcam.AsciiRead("badpixels.dat"); 81 112 82 113 83 plist1.AddToList(&pedcam); … … 150 120 MCalibrationQECam qecam; 151 121 MJCalibration calloop; 152 calloop.SetColor(color);153 122 calloop.SetInput(&cruns); 154 123 // calloop.SetFullDisplay(); … … 185 154 if (!calloop.Process(pedcam)) 186 155 return; 156 157 badcam.Print(); 187 158 188 159 MBadPixelsCam &badbad = calloop.GetBadPixels(); 189 160 MCalibrationChargeCam &calcam = calloop.GetCalibrationCam(); 190 161 MCalibrationRelTimeCam &timecam = calloop.GetRelTimeCam(); 162 163 badbad.Print(); 191 164 192 165 /************************************************************************/ … … 414 387 415 388 416 MCalibrationCam::PulserColor_t FindColor(MDirIter* run)417 {418 419 MCalibrationCam::PulserColor_t col = MCalibrationCam::kNONE;420 421 TString filenames;422 423 while (!(filenames=run->Next()).IsNull())424 {425 426 filenames.ToLower();427 428 if (filenames.Contains("green"))429 if (col == MCalibrationCam::kNONE)430 {431 cout << "Found colour: Green in " << filenames << endl;432 col = MCalibrationCam::kGREEN;433 }434 else if (col != MCalibrationCam::kGREEN)435 {436 cout << "Different colour found in " << filenames << "... abort" << endl;437 return MCalibrationCam::kNONE;438 }439 440 if (filenames.Contains("blue"))441 if (col == MCalibrationCam::kNONE)442 {443 cout << "Found colour: Blue in " << filenames << endl;444 col = MCalibrationCam::kBLUE;445 }446 else if (col != MCalibrationCam::kBLUE)447 {448 cout << "Different colour found in " << filenames << "... abort" << endl;449 return MCalibrationCam::kNONE;450 }451 452 if (filenames.Contains("uv"))453 if (col == MCalibrationCam::kNONE)454 {455 cout << "Found colour: Uv in " << filenames << endl;456 col = MCalibrationCam::kUV;457 }458 else if (col != MCalibrationCam::kUV)459 {460 cout << "Different colour found in " << filenames << "... abort" << endl;461 return MCalibrationCam::kNONE;462 }463 464 if (filenames.Contains("ct1"))465 if (col == MCalibrationCam::kNONE)466 {467 cout << "Found colour: Ct1 in " << filenames << endl;468 col = MCalibrationCam::kCT1;469 }470 else if (col != MCalibrationCam::kCT1)471 {472 cout << "Different colour found in " << filenames << "... abort" << endl;473 return MCalibrationCam::kNONE;474 }475 476 }477 478 479 480 if (col == MCalibrationCam::kNONE)481 cout << "No colour found in filenames of runs: " << ((MRunIter*)run)->GetRunsAsString()482 << "... abort" << endl;483 484 return col;485 } -
trunk/MagicSoft/Mars/macros/calibration.C
r3796 r3832 52 52 // 53 53 ///////////////////////////////////////////////////////////////////////////// 54 const TString inpath = "/home/rootdata/ BlindPixel/";55 const Int_t pedrun = 2 0491;56 const Int_t calrun1 = 2 0494;57 const Int_t calrun2 = 2 0496;54 const TString inpath = "/home/rootdata/Calib/2004_04_16/"; 55 const Int_t pedrun = 22265; 56 const Int_t calrun1 = 22299; 57 const Int_t calrun2 = 22300; 58 58 59 59 void calibration(const Int_t prun=pedrun, const Int_t crun1=calrun1, const Int_t crun2=calrun2) … … 70 70 cruns.AddRuns(crun1,crun2,inpath); 71 71 72 MCalibrationCam::PulserColor_t color;73 74 if (crun1 < 20000)75 color = MCalibrationCam::kCT1;76 else77 color = FindColor((MDirIter*)&cruns);78 79 if (color == MCalibrationCam::kNONE)80 return;81 82 72 MCalibrationQECam qecam; 83 73 MBadPixelsCam badcam; … … 88 78 // 89 79 // badcam.AsciiRead("badpixels.dat"); 90 91 for (Int_t i=0;i<badcam.GetSize();i++)92 if (badcam[i].IsBad())93 cout << "Bad Pixel: " << i << endl;94 80 95 81 MStatusDisplay *display = new MStatusDisplay; … … 114 100 // 115 101 MJCalibration calloop; 116 calloop.SetColor(color);102 // calloop.SetColor(color); 117 103 118 104 // … … 136 122 } 137 123 138 MCalibrationCam::PulserColor_t FindColor(MDirIter* run)139 {140 141 MCalibrationCam::PulserColor_t col = MCalibrationCam::kNONE;142 143 TString filenames;144 145 while (!(filenames=run->Next()).IsNull())146 {147 148 filenames.ToLower();149 150 if (filenames.Contains("green"))151 if (col == MCalibrationCam::kNONE)152 {153 cout << "Found colour: Green in " << filenames << endl;154 col = MCalibrationCam::kGREEN;155 }156 else if (col != MCalibrationCam::kGREEN)157 {158 cout << "Different colour found in " << filenames << "... abort" << endl;159 return MCalibrationCam::kNONE;160 }161 162 if (filenames.Contains("blue"))163 if (col == MCalibrationCam::kNONE)164 {165 cout << "Found colour: Blue in " << filenames << endl;166 col = MCalibrationCam::kBLUE;167 }168 else if (col != MCalibrationCam::kBLUE)169 {170 cout << "Different colour found in " << filenames << "... abort" << endl;171 return MCalibrationCam::kNONE;172 }173 174 if (filenames.Contains("uv"))175 if (col == MCalibrationCam::kNONE)176 {177 cout << "Found colour: Uv in " << filenames << endl;178 col = MCalibrationCam::kUV;179 }180 else if (col != MCalibrationCam::kUV)181 {182 cout << "Different colour found in " << filenames << "... abort" << endl;183 return MCalibrationCam::kNONE;184 }185 186 if (filenames.Contains("ct1"))187 if (col == MCalibrationCam::kNONE)188 {189 cout << "Found colour: Ct1 in " << filenames << endl;190 col = MCalibrationCam::kCT1;191 }192 else if (col != MCalibrationCam::kCT1)193 {194 cout << "Different colour found in " << filenames << "... abort" << endl;195 return MCalibrationCam::kNONE;196 }197 198 }199 200 201 202 if (col == MCalibrationCam::kNONE)203 cout << "No colour found in filenames of runs: " << ((MRunIter*)run)->GetRunsAsString()204 << "... abort" << endl;205 206 return col;207 } -
trunk/MagicSoft/Mars/macros/pedphotcalc.C
r3760 r3832 93 93 const Bool_t usedisplay = kTRUE; 94 94 95 static MCalibrationCam::PulserColor_t FindColor(MDirIter* run)96 {97 98 MCalibrationCam::PulserColor_t col = MCalibrationCam::kNONE;99 100 TString filenames;101 102 while (!(filenames=run->Next()).IsNull())103 {104 105 filenames.ToLower();106 107 if (filenames.Contains("green"))108 if (col == MCalibrationCam::kNONE)109 {110 cout << "Found colour: Green in " << filenames << endl;111 col = MCalibrationCam::kGREEN;112 }113 else if (col != MCalibrationCam::kGREEN)114 {115 cout << "Different colour found in " << filenames << "... abort" << endl;116 return MCalibrationCam::kNONE;117 }118 119 if (filenames.Contains("blue"))120 if (col == MCalibrationCam::kNONE)121 {122 cout << "Found colour: Blue in " << filenames << endl;123 col = MCalibrationCam::kBLUE;124 }125 else if (col != MCalibrationCam::kBLUE)126 {127 cout << "Different colour found in " << filenames << "... abort" << endl;128 return MCalibrationCam::kNONE;129 }130 131 if (filenames.Contains("uv"))132 if (col == MCalibrationCam::kNONE)133 {134 cout << "Found colour: Uv in " << filenames << endl;135 col = MCalibrationCam::kUV;136 }137 else if (col != MCalibrationCam::kUV)138 {139 cout << "Different colour found in " << filenames << "... abort" << endl;140 return MCalibrationCam::kNONE;141 }142 143 if (filenames.Contains("ct1"))144 if (col == MCalibrationCam::kNONE)145 {146 cout << "Found colour: Ct1 in " << filenames << endl;147 col = MCalibrationCam::kCT1;148 }149 else if (col != MCalibrationCam::kCT1)150 {151 cout << "Different colour found in " << filenames << "... abort" << endl;152 return MCalibrationCam::kNONE;153 }154 155 }156 157 158 159 if (col == MCalibrationCam::kNONE)160 cout << "No colour found in filenames of runs: " << ((MRunIter*)run)->GetRunsAsString()161 << "... abort" << endl;162 163 return col;164 }165 166 95 167 96 … … 292 221 cruns.AddRuns(crun1,crun2,inpath); 293 222 294 MCalibrationCam::PulserColor_t color;295 296 if (crun1 < 20000)297 color = MCalibrationCam::kCT1;298 else299 color = FindColor((MDirIter*)&cruns);300 301 if (color == MCalibrationCam::kNONE)302 {303 TTimer timer("gSystem->ProcessEvents();", 50, kFALSE);304 305 while (1)306 {307 timer.TurnOn();308 TString input = Getline("Could not find the correct colour: Type 'q' to exit, "309 "green, blue, uv or ct1 to go on: ");310 timer.TurnOff();311 312 if (input=="q\n")313 return ;314 315 if (input=="green")316 color = MCalibrationCam::kGREEN;317 if (input=="blue")318 color = MCalibrationCam::kBLUE;319 if (input=="uv")320 color = MCalibrationCam::kUV;321 if (input=="ct1")322 color = MCalibrationCam::kCT1;323 }324 }325 326 223 // 327 224 // Now setup the tasks and tasklist for the pedestals: … … 365 262 // 366 263 MJCalibration calloop; 367 calloop.SetColor(color);368 264 calloop.SetInput(&cruns); 369 265 //
Note:
See TracChangeset
for help on using the changeset viewer.