- Timestamp:
- 05/07/04 18:49:24 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r4009 r4014 20 20 21 21 2004/05/07: Markus Gaug 22 23 * mjobs/MExtractCalibTest.cc 24 - include write-out of the containers in the loop 22 25 23 26 * mjobs/MJCalibration.cc -
trunk/MagicSoft/Mars/mjobs/MJExtractCalibTest.cc
r3982 r4014 148 148 } 149 149 150 TString MJExtractCalibTest::GetOutputFile D() const150 TString MJExtractCalibTest::GetOutputFile() const 151 151 { 152 152 if (!fRuns) 153 153 return ""; 154 154 155 return Form("%s/%s-F3.root", (const char*)fOutputPath, (const char*)fRuns->GetRunsAsFileName()); 156 } 157 158 TString MJExtractCalibTest::GetOutputFileT() const 159 { 160 if (!fRuns) 161 return ""; 162 163 return Form("%s/%s-F4.root", (const char*)fOutputPath, (const char*)fRuns->GetRunsAsFileName()); 164 } 165 166 TString MJExtractCalibTest::GetOutputFileP() const 167 { 168 if (!fRuns) 169 return ""; 170 171 return Form("%s/%s-F2.root", (const char*)fOutputPath, (const char*)fRuns->GetRunsAsFileName()); 172 } 155 return Form("%s/%s-Test.root", (const char*)fOutputPath, (const char*)fRuns->GetRunsAsFileName()); 156 } 157 173 158 174 159 Bool_t MJExtractCalibTest::ProcessD(MPedestalCam &pedcam, MCalibrationChargeCam &calcam, MCalibrationQECam &qecam) 175 160 { 176 const TString fname = GetOutputFile D();161 const TString fname = GetOutputFile(); 177 162 178 163 if (gSystem->AccessPathName(fname, kFileExists)) … … 200 185 *fLog << endl; 201 186 202 MCerPhotEvt 203 187 MCerPhotEvt cerphot; 188 MPedPhotCam pedphot; 204 189 // Setup Lists 205 190 MParList plist; … … 208 193 plist.AddToList(&qecam); 209 194 plist.AddToList(&cerphot); 195 plist.AddToList(&pedphot); 210 196 plist.AddToList(&fTestCam); 211 197 plist.AddToList(&fBadPixels); 212 198 213 199 MTaskList tlist; 214 200 plist.AddToList(&tlist); … … 223 209 MCalibrate photcalc; 224 210 photcalc.SetCalibrationMode(MCalibrate::kFfactor); 211 MPedPhotCalc pedphotcalc; 225 212 226 213 MHCamEvent evt("ExtSignal"); … … 231 218 fillcam.SetNameTab("Test"); 232 219 233 /*234 MWriteRootFile write(GetOutputFileD(), "RECREATE", fRuns->GetRunsAsString(), 2);235 write.AddContainer("MExtractedSignalCam", "Events");236 write.AddContainer("MTime", "Events");237 write.AddContainer("MRawEvtHeader", "Events");238 write.AddContainer("MPedestalCam", "RunHeaders");239 write.AddContainer("MRawRunHeader", "RunHeaders");240 write.AddContainer("MBadPixelsCam", "RunHeaders");241 */242 220 243 221 tlist.AddToList(&read); … … 254 232 255 233 // if (TestBit(kEnableGraphicalOutput)) 256 234 tlist.AddToList(&fill); 257 235 tlist.AddToList(&photcalc); 236 tlist.AddToList(&pedphotcalc); 258 237 tlist.AddToList(&fillcam); 259 238 239 MWriteRootFile write(GetOutputFile(), "RECREATE", fRuns->GetRunsAsString(), 2); 240 write.AddContainer(&pedcam , "RunHeaders" ); 241 write.AddContainer(&pedphot , "RunHeaders" ); 242 write.AddContainer(&calcam , "Events" ); 243 write.AddContainer(&qecam , "Events" ); 244 write.AddContainer(&fBadPixels , "RunHeaders" ); 245 write.AddContainer("MHCalibrationTestCam", "Events" ); 246 // write.AddContainer(&testtime ); 247 tlist.AddToList(&write); 248 260 249 // Create and setup the eventloop 261 250 MEvtLoop evtloop(fName); … … 282 271 Bool_t MJExtractCalibTest::ProcessT(MPedestalCam &pedcam, MCalibrationRelTimeCam &relcam) 283 272 { 284 const TString fname = GetOutputFile T();273 const TString fname = GetOutputFile(); 285 274 286 275 if (gSystem->AccessPathName(fname, kFileExists)) … … 313 302 // Setup Lists 314 303 MParList plist; 315 plist.AddToList(&pedcam);316 304 plist.AddToList(&relcam); 317 305 plist.AddToList(&arrtime); 318 plist.AddToList(&fTest Cam);306 plist.AddToList(&fTestTimeCam); 319 307 plist.AddToList(&fBadPixels); 320 308 … … 338 326 fillcam.SetNameTab("TestTime"); 339 327 340 /*341 MWriteRootFile write(GetOutputFileD(), "RECREATE", fRuns->GetRunsAsString(), 2);342 write.AddContainer("MExtractedSignalCam", "Events");343 write.AddContainer("MTime", "Events");344 write.AddContainer("MRawEvtHeader", "Events");345 write.AddContainer("MPedestalCam", "RunHeaders");346 write.AddContainer("MRawRunHeader", "RunHeaders");347 write.AddContainer("MBadPixelsCam", "RunHeaders");348 */349 350 328 tlist.AddToList(&read); 351 329 tlist.AddToList(&apply); … … 356 334 { 357 335 *fLog << warn << GetDescriptor() 358 << ": No extractor has been chosen, take default MExtract SlidingWindow" << endl;336 << ": No extractor has been chosen, take default MExtractTimeFastSpline " << endl; 359 337 tlist.AddToList(&extract); 360 338 } … … 365 343 tlist.AddToList(&fillcam); 366 344 345 MWriteRootFile write(GetOutputFile(), "UPDATE", fRuns->GetRunsAsString(), 2); 346 write.AddContainer(&relcam , "Events" ); 347 write.AddContainer(&fBadPixels , "RunHeaders" ); 348 write.AddContainer("MHCalibrationTestCam" , "Events" ); 349 write.AddContainer("MHCalibrationTestTimeCam", "Events" ); 350 write.AddContainer("MArrivalTimeCam" , "Events" ); 351 367 352 // Create and setup the eventloop 368 353 MEvtLoop evtloop(fName); … … 390 375 Bool_t MJExtractCalibTest::ReadPedPhotCam() 391 376 { 392 const TString fname = GetOutputFile P();377 const TString fname = GetOutputFile(); 393 378 394 379 if (gSystem->AccessPathName(fname, kFileExists)) … … 424 409 } 425 410 426 Bool_t MJExtractCalibTest::ProcessP(MPedestalCam &pedcam, MCalibrationChargeCam &calcam, MCalibrationQECam &qecam)427 {428 if (!ReadPedPhotCam())429 return ProcessFileP(pedcam, calcam, qecam);430 431 return kTRUE;432 }433 434 Bool_t MJExtractCalibTest::ProcessFileP(MPedestalCam &pedcam, MCalibrationChargeCam &calcam, MCalibrationQECam &qecam)435 {436 if (!fRuns)437 {438 *fLog << err << "No Runs choosen... abort." << endl;439 return kFALSE;440 }441 if (fRuns->GetNumRuns() != fRuns->GetNumEntries())442 {443 *fLog << err << "Number of files found doesn't match number of runs... abort." << endl;444 return kFALSE;445 }446 447 *fLog << inf;448 fLog->Separator(GetDescriptor());449 *fLog << "Calculate MExtractedSignalCam from Runs " << fRuns->GetRunsAsString() << endl;450 *fLog << endl;451 452 MReadMarsFile read("Events");453 read.DisableAutoScheme();454 static_cast<MRead&>(read).AddFiles(*fRuns);455 456 // Setup Tasklist457 MParList plist;458 plist.AddToList(&pedcam);459 plist.AddToList(&calcam);460 plist.AddToList(&fPedPhotCam);461 plist.AddToList(&fBadPixels);462 463 MTaskList tlist;464 plist.AddToList(&tlist);465 466 MGeomApply apply; // Only necessary to craete geometry467 MExtractSlidingWindow extract2;468 MCalibrate calib;469 MPedPhotCalc calc;470 471 MHCamEvent evt1("ExtOffset");472 MHCamEvent evt2("CalOffset");473 evt1.SetType(0);474 evt2.SetType(0);475 MFillH fill1(&evt1, "MExtractedSignalCam", "FillExtractedSignal");476 MFillH fill2(&evt2, "MCerPhotEvt", "FillCerPhotEvt");477 478 tlist.AddToList(&read);479 tlist.AddToList(&apply);480 481 if (fExtractor)482 tlist.AddToList(fExtractor);483 else484 {485 *fLog << warn << GetDescriptor()486 << ": No extractor has been chosen, take default MExtractSlidingWindow " << endl;487 tlist.AddToList(&extract2);488 }489 490 if (TestBit(kEnableGraphicalOutput))491 tlist.AddToList(&fill1);492 tlist.AddToList(&calib);493 tlist.AddToList(&calc);494 if (TestBit(kEnableGraphicalOutput))495 tlist.AddToList(&fill2);496 497 // Create and setup the eventloop498 MEvtLoop evtloop(fName);499 evtloop.SetParList(&plist);500 evtloop.SetDisplay(fDisplay);501 evtloop.SetLogStream(fLog);502 503 // Execute first analysis504 if (!evtloop.Eventloop())505 {506 *fLog << err << GetDescriptor() << ": Failed." << endl;507 return kFALSE;508 }509 510 tlist.PrintStatistics();511 512 DisplayResult(plist);513 514 *fLog << inf << GetDescriptor() << ": Done." << endl;515 516 return kTRUE;517 }518 411 519 412 /* -
trunk/MagicSoft/Mars/mjobs/MJExtractCalibTest.h
r3982 r4014 4 4 #ifndef MARS_MHCalibrationTestCam 5 5 #include "MHCalibrationTestCam.h" 6 #endif 7 #ifndef MARS_MHCalibrationTestTimeCam 8 #include "MHCalibrationTestTimeCam.h" 6 9 #endif 7 10 #ifndef MARS_MPedPhotCam … … 33 36 MExtractTime *fTimeExtractor; // Arrival time extractor 34 37 35 MBadPixelsCam fBadPixels; 36 MHCalibrationTestCam fTestCam; 37 MPedPhotCam fPedPhotCam; 38 MBadPixelsCam fBadPixels; 39 MHCalibrationTestCam fTestCam; 40 MHCalibrationTestTimeCam fTestTimeCam; 41 MPedPhotCam fPedPhotCam; 38 42 39 43 Bool_t ReadPedPhotCam(); … … 51 55 void SetOutputPath(const char *path="."); 52 56 53 TString GetOutputFileP() const; 54 TString GetOutputFileD() const; 55 TString GetOutputFileT() const; 57 TString GetOutputFile() const; 56 58 57 MHCalibrationTestCam &GetTestCam() { return fTestCam; } 59 MHCalibrationTestCam &GetTestCam() { return fTestCam; } 60 MHCalibrationTestTimeCam &GetTestTimeCam() { return fTestTimeCam; } 58 61 MPedPhotCam &GetPedPhotCam() { return fPedPhotCam; } 59 62 const MBadPixelsCam &GetBadPixels() const { return fBadPixels; } … … 64 67 65 68 Bool_t ProcessD(MPedestalCam &pedcam, MCalibrationChargeCam &calcam, MCalibrationQECam &qecam); 66 Bool_t ProcessP(MPedestalCam &pedcam, MCalibrationChargeCam &calcam, MCalibrationQECam &qecam);67 69 Bool_t ProcessT(MPedestalCam &pedcam, MCalibrationRelTimeCam &relcam); 68 70
Note:
See TracChangeset
for help on using the changeset viewer.