Changeset 4601 for trunk/MagicSoft/Mars/mjobs/MJPedestal.cc
- Timestamp:
- 08/12/04 16:41:37 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mjobs/MJPedestal.cc
r4562 r4601 44 44 #include "MLogManip.h" 45 45 46 #include "MTaskEnv.h" 47 #include "MSequence.h" 46 48 #include "MRunIter.h" 47 49 #include "MParList.h" … … 86 88 // 87 89 MJPedestal::MJPedestal(const char *name, const char *title) 88 : fEnv(0), fRuns(0), f Extractor(NULL), fDisplayType(kNormalDisplay),90 : fEnv(0), fRuns(0), fSequence(0), fExtractor(NULL), fDisplayType(kNormalDisplay), 89 91 fDataCheck(kFALSE) 90 92 { … … 101 103 const char* MJPedestal::GetOutputFile() const 102 104 { 105 if (fSequence) 106 return Form("%s/calped%05d", (const char*)fOutputPath, fSequence->GetSequence()); 107 103 108 if (!fRuns) 104 109 return ""; … … 143 148 } 144 149 145 146 150 void MJPedestal::DisplayResult(MParList &plist) 147 151 { … … 154 158 TString title = fDisplay->GetTitle(); 155 159 title += "-- Pedestal "; 156 if (fRuns) // FIXME: What to do if an environmentfile was used? 157 title += fRuns->GetRunsAsString(); 160 if (fSequence) 161 title += fSequence->GetName(); 162 else 163 if (fRuns) // FIXME: What to do if an environmentfile was used? 164 title += fRuns->GetRunsAsString(); 158 165 title += " --"; 159 166 fDisplay->SetTitle(title); … … 242 249 c3.cd(6); 243 250 gPad->SetBorderMode(0); 244 gPad->SetTicks();245 246 TArrayI inner(1);247 inner[0] = 0;248 249 TArrayI outer(1);250 outer[0] = 1;251 251 252 252 if (geomcam.InheritsFrom("MGeomCamMagic")) 253 253 { 254 TArrayI inner(1); 255 inner[0] = 0; 256 257 TArrayI outer(1); 258 outer[0] = 1; 259 254 260 TArrayI s0(6); 255 261 s0[0] = 6; … … 270 276 s2[2] = 5; 271 277 272 gPad->Clear();273 278 TVirtualPad *pad = gPad; 274 279 pad->Divide(2,1); … … 278 283 inout[1] = disp1.ProjectionS(s0, outer, "Outer"); 279 284 280 inout[0]->SetDirectory(NULL);281 inout[1]->SetDirectory(NULL);282 283 285 for (int i=0; i<2; i++) 284 286 { 285 TLegend *leg2 = new TLegend(0.6,0.2,0.9,0.55);286 leg2->SetHeader(inout[i]->GetName());287 287 pad->cd(i+1); 288 gPad->SetBorderMode(0); 289 gPad->SetTicks(); 290 291 inout[i]->SetDirectory(NULL); 288 292 inout[i]->SetLineColor(kRed+i); 289 293 inout[i]->SetBit(kCanDelete); 290 294 inout[i]->Draw(); 291 inout[i]->Fit("gaus","Q"); 292 leg2->AddEntry(inout[i],inout[i]->GetName(),"l"); 295 inout[i]->Fit("gaus", "Q"); 296 297 TLegend *leg2 = new TLegend(0.6,0.2,0.9,0.55); 298 leg2->SetHeader(inout[i]->GetName()); 299 leg2->AddEntry(inout[i], inout[i]->GetName(), "l"); 293 300 294 301 // … … 310 317 half[j]->SetBit(kCanDelete); 311 318 half[j]->Draw("same"); 312 leg2->AddEntry(half[j], half[j]->GetName(),"l");319 leg2->AddEntry(half[j], half[j]->GetName(), "l"); 313 320 } 314 321 leg2->Draw(); … … 419 426 Bool_t MJPedestal::ProcessFile() 420 427 { 421 if (!fRuns && !fEnv )422 { 423 *fLog << err << "Neither AddRuns was called nor SetEnv was used... abort." << endl;424 return kFALSE; 425 } 426 if ( fRuns && fRuns->GetNumRuns() != fRuns->GetNumEntries())428 if (!fRuns && !fEnv && !fSequence) 429 { 430 *fLog << err << "Neither AddRuns nor SetSequence nor SetEnv was called... abort." << endl; 431 return kFALSE; 432 } 433 if (!fSequence && fRuns && fRuns->GetNumRuns() != fRuns->GetNumEntries()) 427 434 { 428 435 *fLog << err << "Number of files found doesn't match number of runs... abort." << endl; … … 433 440 fLog->Separator(GetDescriptor()); 434 441 *fLog << "Calculate MPedestalCam from Runs "; 435 if (f Runs)436 *fLog << f Runs->GetRunsAsString() << endl;442 if (fSequence) 443 *fLog << fSequence->GetName() << endl; 437 444 else 438 *fLog << "in " << fEnv->GetName() << endl; 445 if (fRuns) 446 *fLog << fRuns->GetRunsAsString() << endl; 447 else 448 *fLog << "in " << fEnv->GetName() << endl; 439 449 *fLog << endl; 440 450 … … 446 456 MRawFileRead rawread(NULL); 447 457 458 MDirIter iter; 459 if (fSequence) 460 fSequence->SetupPedRuns(iter); 461 448 462 if (fDataCheck) 449 463 { 450 if (fRuns )451 rawread.AddFiles( *fRuns);452 464 if (fRuns || fSequence) 465 rawread.AddFiles(fSequence ? iter : *fRuns); 466 tlist.AddToList(&rawread); 453 467 } 454 468 else 455 469 { 456 470 read.DisableAutoScheme(); 457 if (fRuns )458 static_cast<MRead&>(read).AddFiles( *fRuns);471 if (fRuns || fSequence) 472 static_cast<MRead&>(read).AddFiles(fSequence ? iter : *fRuns); 459 473 tlist.AddToList(&read); 460 474 } … … 468 482 MGeomApply geomapl; 469 483 MBadPixelsMerge merge(&fBadPixels); 484 470 485 MPedCalcPedRun pedcalc; 486 487 MTaskEnv taskenv("ExtractPedestal"); 488 taskenv.SetDefault(&pedcalc); 471 489 472 490 if (fExtractor) … … 483 501 tlist.AddToList(&geomapl); 484 502 tlist.AddToList(&merge); 485 tlist.AddToList(& pedcalc);503 tlist.AddToList(&taskenv); 486 504 487 505 //
Note:
See TracChangeset
for help on using the changeset viewer.