Changeset 3982 for trunk/MagicSoft/Mars/mjobs
- Timestamp:
- 05/05/04 17:26:14 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/mjobs
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mjobs/MJExtractCalibTest.cc
r3862 r3982 48 48 #include "MBadPixelsCam.h" 49 49 #include "MCerPhotEvt.h" 50 #include "MArrivalTime.h" 50 51 #include "MCalibrationChargeCam.h" 52 #include "MCalibrationRelTimeCam.h" 51 53 #include "MCalibrationQECam.h" 52 54 #include "MHCamEvent.h" … … 56 58 #include "MExtractSlidingWindow.h" 57 59 #include "MExtractor.h" 60 #include "MExtractTime.h" 61 #include "MExtractTimeFastSpline.h" 58 62 #include "MFillH.h" 59 63 #include "MCalibrate.h" 64 #include "MCalibrateRelTimes.h" 60 65 #include "MPedPhotCalc.h" 61 66 #include "MWriteRootFile.h" … … 70 75 // Default constructor. 71 76 // 72 // Sets fRuns to 0, fExtractor to NULL 77 // Sets fRuns to 0, fExtractor to NULL, fTimeExtractor to NULL 73 78 // 74 79 MJExtractCalibTest::MJExtractCalibTest(const char *name, const char *title) 75 : fRuns(NULL), fExtractor(NULL) 80 : fRuns(NULL), fExtractor(NULL), fTimeExtractor(NULL) 76 81 { 77 82 fName = name ? name : "MJExtractCalibTest"; … … 151 156 } 152 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 153 166 TString MJExtractCalibTest::GetOutputFileP() const 154 167 { … … 240 253 } 241 254 242 if (TestBit(kEnableGraphicalOutput))255 // if (TestBit(kEnableGraphicalOutput)) 243 256 tlist.AddToList(&fill); 244 257 tlist.AddToList(&photcalc); 245 258 tlist.AddToList(&fillcam); 246 // tlist.AddToList(&write);247 259 248 260 // Create and setup the eventloop … … 267 279 return kTRUE; 268 280 } 281 282 Bool_t MJExtractCalibTest::ProcessT(MPedestalCam &pedcam, MCalibrationRelTimeCam &relcam) 283 { 284 const TString fname = GetOutputFileT(); 285 286 if (gSystem->AccessPathName(fname, kFileExists)) 287 return ProcessFileT(pedcam,relcam); 288 289 return kTRUE; 290 } 291 292 Bool_t MJExtractCalibTest::ProcessFileT(MPedestalCam &pedcam, MCalibrationRelTimeCam &relcam) 293 { 294 295 if (!fRuns) 296 { 297 *fLog << err << "No Runs choosen... abort." << endl; 298 return kFALSE; 299 } 300 if (fRuns->GetNumRuns() != fRuns->GetNumEntries()) 301 { 302 *fLog << err << "Number of files found doesn't match number of runs... abort." << endl; 303 return kFALSE; 304 } 305 306 *fLog << inf; 307 fLog->Separator(GetDescriptor()); 308 *fLog << "Calculate MExtractedSignalCam from Runs " << fRuns->GetRunsAsString() << endl; 309 *fLog << endl; 310 311 MArrivalTime arrtime; 312 313 // Setup Lists 314 MParList plist; 315 plist.AddToList(&pedcam); 316 plist.AddToList(&relcam); 317 plist.AddToList(&arrtime); 318 plist.AddToList(&fTestCam); 319 plist.AddToList(&fBadPixels); 320 321 MTaskList tlist; 322 plist.AddToList(&tlist); 323 324 // Setup Task-lists 325 MReadMarsFile read("Events"); 326 read.DisableAutoScheme(); 327 static_cast<MRead&>(read).AddFiles(*fRuns); 328 329 MGeomApply apply; // Only necessary to craete geometry 330 MExtractTimeFastSpline extract; 331 MCalibrateRelTimes timecalc; 332 333 MHCamEvent evt("ExtTimes"); 334 evt.SetType(0); 335 MFillH fill(&evt, "MArrivalTimeCam"); 336 337 MFillH fillcam("MHCalibrationTestTimeCam", "MArrivalTime"); 338 fillcam.SetNameTab("TestTime"); 339 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 tlist.AddToList(&read); 351 tlist.AddToList(&apply); 352 353 if (fTimeExtractor) 354 tlist.AddToList(fTimeExtractor); 355 else 356 { 357 *fLog << warn << GetDescriptor() 358 << ": No extractor has been chosen, take default MExtractSlidingWindow " << endl; 359 tlist.AddToList(&extract); 360 } 361 362 // if (TestBit(kEnableGraphicalOutput)) 363 tlist.AddToList(&fill); 364 tlist.AddToList(&timecalc); 365 tlist.AddToList(&fillcam); 366 367 // Create and setup the eventloop 368 MEvtLoop evtloop(fName); 369 evtloop.SetParList(&plist); 370 evtloop.SetDisplay(fDisplay); 371 evtloop.SetLogStream(fLog); 372 373 // Execute first analysis 374 if (!evtloop.Eventloop()) 375 { 376 *fLog << err << GetDescriptor() << ": Failed." << endl; 377 return kFALSE; 378 } 379 380 tlist.PrintStatistics(); 381 382 DisplayResult(plist); 383 384 *fLog << inf << GetDescriptor() << ": Done." << endl; 385 386 return kTRUE; 387 } 388 269 389 270 390 Bool_t MJExtractCalibTest::ReadPedPhotCam() -
trunk/MagicSoft/Mars/mjobs/MJExtractCalibTest.h
r3862 r3982 18 18 class MParList; 19 19 class MPedestalCam; 20 class MCalibrationRelTimeCam; 20 21 class MCalibrationChargeCam; 21 22 class MCalibrationQECam; 22 23 class MExtractor; 24 class MExtractTime; 23 25 class MJExtractCalibTest : public MParContainer, public MGCamDisplays 24 26 { … … 27 29 TString fOutputPath; 28 30 29 MRunIter *fRuns; // Data files 30 MExtractor *fExtractor; // Signal extractor 31 MRunIter *fRuns; // Data files 32 MExtractor *fExtractor; // Signal extractor 33 MExtractTime *fTimeExtractor; // Arrival time extractor 31 34 32 35 MBadPixelsCam fBadPixels; … … 40 43 Bool_t ProcessFileD(MPedestalCam &pedcam, MCalibrationChargeCam &calcam, MCalibrationQECam &qecam); 41 44 Bool_t ProcessFileP(MPedestalCam &pedcam, MCalibrationChargeCam &calcam, MCalibrationQECam &qecam); 45 Bool_t ProcessFileT(MPedestalCam &pedcam, MCalibrationRelTimeCam &relcam); 42 46 43 47 public: … … 49 53 TString GetOutputFileP() const; 50 54 TString GetOutputFileD() const; 55 TString GetOutputFileT() const; 51 56 52 57 MHCalibrationTestCam &GetTestCam() { return fTestCam; } … … 55 60 56 61 void SetExtractor(MExtractor* ext) { fExtractor = ext; } 62 void SetTimeExtractor(MExtractTime* ext) { fTimeExtractor = ext; } 57 63 void SetBadPixels(const MBadPixelsCam &bad) { bad.Copy(fBadPixels); } 58 64 59 65 Bool_t ProcessD(MPedestalCam &pedcam, MCalibrationChargeCam &calcam, MCalibrationQECam &qecam); 60 66 Bool_t ProcessP(MPedestalCam &pedcam, MCalibrationChargeCam &calcam, MCalibrationQECam &qecam); 67 Bool_t ProcessT(MPedestalCam &pedcam, MCalibrationRelTimeCam &relcam); 61 68 62 69 ClassDef(MJExtractCalibTest, 0) // Tool to extract, calibrate and test the signal -
trunk/MagicSoft/Mars/mjobs/MJPedestal.cc
r3889 r3982 258 258 MGeomApply geomapl; 259 259 // MBadPixelsMerge merge(&fBadPixels); 260 //MExtractSignal sigcalc;261 260 MPedCalcPedRun pedcalc; 262 261 -
trunk/MagicSoft/Mars/mjobs/Makefile
r3927 r3982 21 21 INCLUDES = -I. -I../mbase -I../mgui -I../mgeom -I../mdata -I../mhbase \ 22 22 -I../mfileio -I../mfilter -I../manalysis -I../mhist -I../mcalib \ 23 -I../mbadpixels -I../msignal -I../mraw -I../mpedestal 23 -I../mbadpixels -I../msignal -I../mraw -I../mpedestal -I../mtools 24 24 25 25 #manalysis: MChisqEval (MParameters)
Note:
See TracChangeset
for help on using the changeset viewer.