Changeset 5657 for trunk/MagicSoft/Mars/mtemp
- Timestamp:
- 12/21/04 16:59:13 (20 years ago)
- Location:
- trunk/MagicSoft/Mars/mtemp/mifae
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mtemp/mifae/Changelog
r5466 r5657 18 18 19 19 -*-*- END OF LINE -*-*- 20 21 2004/12/21 Javier Rico 22 * programs/makeHillas.cc, programs/makehillas.datacard 23 - Include spline extractor and remove possibility of computing 24 pedestals from pedestal runs instead of from low gains 20 25 21 26 2004/11/24 Ester Aliu -
trunk/MagicSoft/Mars/mtemp/mifae/programs/makeHillas.cc
r5295 r5657 25 25 #include "MExtractFixedWindowPeakSearch.h" 26 26 #include "MExtractSlidingWindow.h" 27 #include "MExtractTimeAndChargeSpline.h" 27 28 #include "MPedCalcFromLoGain.h" 28 29 #include "MExtractSignal.h" … … 78 79 MRunIter pedcaliter; 79 80 MRunIter caliter; 80 MRunIter pediter;81 81 MRunIter datiter; 82 82 UInt_t display = 0; … … 156 156 ((MExtractFixedWindowPeakSearch*)extractor)->SetWindows(wsize,wsize,4); 157 157 break; 158 case 3: 159 extractor = new MExtractTimeAndChargeSpline(); 160 ((MExtractTimeAndChargeSpline*)extractor)->SetChargeType(MExtractTimeAndChargeSpline::kIntegral); 161 ((MExtractTimeAndChargeSpline*)extractor)->SetRiseTime((Float_t)wsize*0.25); 162 ((MExtractTimeAndChargeSpline*)extractor)->SetFallTime((Float_t)wsize*0.75); 163 ((MExtractTimeAndChargeSpline*)extractor)->SetTimeType(MExtractTimeAndChargeSpline::kHalfMaximum); 164 break; 158 165 default: 159 166 extractor = new MExtractFixedWindow(); … … 172 179 //badcam.AsciiRead("badpixels.dat"); 173 180 174 MJPedestal pedcalloop; 175 pedcalloop.SetInput(&pedcaliter); 176 pedcalloop.SetExtractor(extractor); 177 // pedloop.SetBadPixels(badcam); 178 //pedcalloop.SetOutputPath(outpath.Data()); 179 180 181 if (!pedcalloop.Process()) 182 return; 181 MJPedestal pedloop1; 182 MJPedestal pedloop2; 183 MJCalibration calloop; 184 185 if(calflag>0) 186 { 187 pedloop1.SetInput(&pedcaliter); 188 pedloop1.SetExtractor(extractor); 189 pedloop1.SetNoStorage(); 190 if (!pedloop1.Process()) 191 return; 192 193 if (extractor->InheritsFrom("MExtractTimeAndCharge")) 194 { 195 196 /***********************************************************/ 197 /* NEEDED FOR SECOND LOOP: EXTRACTOR RESOLUTION COMPUTATION */ 198 /***********************************************************/ 199 pedloop2.SetNoStorage(); 200 pedloop2.SetExtractor(extractor); 201 pedloop2.SetExtractorResolution(); 202 pedloop2.SetPedestals(pedloop1.GetPedestalCam()); 203 pedloop2.SetInput(&pedcaliter); 204 205 if (!pedloop2.Process()) 206 return; 207 208 calloop.SetExtractorCam(pedloop2.GetPedestalCam()); 209 } 210 } 211 212 MPedestalCam pedcammean = pedloop1.GetPedestalCam(); 213 extractor->SetPedestals(&pedcammean); 214 215 MPedestalCam pedcamrms; 183 216 184 217 /*****************************/ … … 186 219 /*****************************/ 187 220 188 MJCalibration calloop;189 190 221 calloop.SetRelTimeCalibration(caltimeflag); 191 222 calloop.SetExtractor(extractor); 192 223 calloop.SetInput(&caliter); 193 calloop.SetBadPixels(ped calloop.GetBadPixels());224 calloop.SetBadPixels(pedloop1.GetBadPixels()); 194 225 if(calflag==2) 195 226 calloop.SetUseBlindPixel(); 196 227 if(calflag>0) 197 if (!calloop.Process(pedca lloop.GetPedestalCam()))228 if (!calloop.Process(pedcammean)) 198 229 return; 199 230 200 // Next loops are different if we take pedestals from data or from pedestal files 201 if(pediter.GetNumRuns()==0) 231 232 /************************************************************************/ 233 /* THIRD (SMALL) LOOP TO GET INITIAl PEDESTALS */ 234 /************************************************************************/ 235 MParList plist3; 236 MTaskList tlist3; 237 238 // containers 239 MGeomCamMagic geomcam; 240 MGeomApply geomapl; 241 242 plist3.AddToList(&tlist3); 243 plist3.AddToList(&geomcam); 244 plist3.AddToList(&pedcammean); 245 246 //tasks 247 MReadMarsFile read3("Events"); 248 static_cast<MRead&>(read3).AddFiles(datiter); 249 read3.DisableAutoScheme(); 250 251 MPedCalcFromLoGain pedlo1; 252 pedlo1.SetPedestalUpdate(kFALSE); 253 const Float_t win = extractor->GetNumHiGainSamples(); 254 pedlo1.SetExtractWindow(15, (UShort_t)TMath::Nint(win)); 255 pedlo1.SetNumEventsDump(500); 256 pedlo1.SetMaxSignalVar(40); 257 pedlo1.SetPedestalsOut(&pedcammean); 258 259 tlist3.AddToList(&read3); 260 tlist3.AddToList(&geomapl); 261 tlist3.AddToList(&pedlo1); 262 263 // Create and setup the eventloop 264 MEvtLoop evtloop3; 265 evtloop3.SetParList(&plist3); 266 if (!evtloop3.Eventloop(500)) 267 return; 268 269 tlist3.PrintStatistics(); 270 271 /************************************************************************/ 272 /* FIFTH LOOP: PEDESTAL+DATA CALIBRATION INTO PHOTONS */ 273 /************************************************************************/ 274 275 MParList plist5; 276 MTaskList tlist5; 277 plist5.AddToList(&tlist5); 278 279 //tasks 280 // MReadMarsFile read5("Events"); 281 MReadReports read5; 282 read5.AddTree("Drive"); 283 read5.AddTree("Events","MTime.",kTRUE); 284 285 read5.AddFiles(datiter); 286 read5.AddToBranchList("MReportDrive.*"); 287 read5.AddToBranchList("MRawEvtData.*"); 288 read5.AddToBranchList("MRawEvtHeader.*"); 289 290 // read5.DisableAutoScheme(); 291 // static_cast<MRead&>(read5).AddFiles(datiter); 292 tlist5.AddToList(&read5); 293 tlist5.AddToList(&geomapl); 294 tlist5.AddToList(&pedlo1); 295 pedlo1.SetPedestalUpdate(kTRUE); 296 297 MCalibrateData::CalibrationMode_t calMode=MCalibrateData::kDefault; 298 if(calflag==0) 299 calMode=MCalibrateData::kNone; 300 if(calflag==-1) 301 calMode=MCalibrateData::kDummy; 302 MCalibrateData photcalc; 303 photcalc.SetCalibrationMode(calMode); 304 photcalc.EnablePedestalType(MCalibrateData::kRun); 305 photcalc.EnablePedestalType(MCalibrateData::kEvent); 306 photcalc.SetPedestalCamMean(&pedcammean); 307 308 if (extractor->InheritsFrom("MExtractTimeAndCharge")) 202 309 { 203 310 /************************************************************************/ 204 /* THIRD (SMALL) LOOP TO GET INITIAl PEDESTALS*/311 /* FOURTH (SMALL) LOOP TO GET INITIAl PEDESTALS RMS */ 205 312 /************************************************************************/ 206 MParList plist3;207 MTaskList tlist3;208 209 // containers210 MPedestalCam pedcamdata;211 MGeomCamMagic geomcam;212 213 plist3.AddToList(&tlist3);214 plist3.AddToList(&geomcam);215 plist3.AddToList(&pedcamdata);216 217 //tasks218 MReadMarsFile read3("Events");219 static_cast<MRead&>(read3).AddFiles(datiter);220 read3.DisableAutoScheme();221 222 MGeomApply geomapl;223 224 MPedCalcFromLoGain peddatacalc;225 peddatacalc.SetPedestalUpdate(kFALSE);226 peddatacalc.SetRange(hifirst,hilast,lofirst,lolast);227 peddatacalc.SetWindowSize(wsize,wsize);228 peddatacalc.SetNumEventsDump(500);229 peddatacalc.SetMaxHiGainVar(40);230 231 tlist3.AddToList(&read3);232 tlist3.AddToList(&geomapl);233 tlist3.AddToList(&peddatacalc);234 235 // Create and setup the eventloop236 MEvtLoop evtloop3;237 evtloop3.SetParList(&plist3);238 if (!evtloop3.Eventloop(500))239 return;240 241 tlist3.PrintStatistics();242 243 /************************************************************************/244 /* FOURTH LOOP: PEDESTAL+DATA CALIBRATION INTO PHOTONS */245 /************************************************************************/246 247 313 MParList plist4; 248 314 MTaskList tlist4; 315 249 316 plist4.AddToList(&tlist4); 250 251 // containers252 MCerPhotEvt nphot;253 MPedPhotCam nphotrms;254 MHillas hillas;255 MNewImagePar newimagepar;256 MSrcPosCam source;257 MRawRunHeader runhead;258 MArrivalTimeCam timecam;259 MReportDrive reportdrive;260 // islands261 MIslands isl;262 MIslands isl2;263 MIslands isl3;264 265 isl.SetName("MIslands");266 isl2.SetName("MIslands2");267 isl3.SetName("MIslands3");268 269 plist4.AddToList(&timecam);270 plist4.AddToList(&isl);271 272 if (islflag == 2)273 plist4.AddToList(&isl2);274 if (islflag == 3)275 plist4.AddToList(&isl3);276 277 317 plist4.AddToList(&geomcam); 278 plist4.AddToList(&pedcamdata);279 plist4.AddToList(&calloop.GetCalibrationCam());280 plist4.AddToList(&calloop.GetQECam());281 plist4.AddToList(&calloop.GetRelTimeCam());282 plist4.AddToList(&calloop.GetBadPixels());283 plist4.AddToList(&nphot);284 plist4.AddToList(&nphotrms);285 plist4.AddToList(&source);286 plist4.AddToList(&hillas);287 plist4.AddToList(&newimagepar);288 plist4.AddToList(&runhead);289 plist4.AddToList(&reportdrive);290 291 // cuts292 MF cut(filter);293 318 294 319 //tasks 295 // MReadMarsFile read4("Events"); 296 MReadReports read4; 297 read4.AddTree("Events","MTime.",kTRUE); 298 read4.AddTree("Drive"); 299 // read4.DisableAutoScheme(); 320 MReadMarsFile read4("Events"); 300 321 static_cast<MRead&>(read4).AddFiles(datiter); 301 302 peddatacalc.SetPedestalUpdate(kTRUE); 303 304 MCalibrateData::CalibrationMode_t calMode=MCalibrateData::kDefault; 305 if(calflag==0) 306 calMode=MCalibrateData::kNone; 307 if(calflag==-1) 308 calMode=MCalibrateData::kDummy; 309 MCalibrateData photcalc; 310 photcalc.SetCalibrationMode(calMode); 311 photcalc.EnablePedestalType(MCalibrateData::kRun); 312 photcalc.EnablePedestalType(MCalibrateData::kEvent); 313 314 MImgCleanStd clean(lcore,ltail); 315 clean.SetCleanRings(lrings); 316 MImgCleanStd::CleaningMethod_t cleanMeth= MImgCleanStd::kStandard; 317 if(cleanflag==2) 318 cleanMeth=MImgCleanStd::kDemocratic; 319 clean.SetMethod(cleanMeth); 320 321 MArrivalTimeCalc2 timecalc; 322 MIslandsCalc island; 323 island.SetOutputName("MIslands"); 324 island.SetAlgorithm(kalgorithm); 325 326 MBadPixelsTreat interpolatebadpixels; 327 interpolatebadpixels.SetUseInterpolation(); 328 interpolatebadpixels.SetProcessPedestal(); 329 330 MIslandsClean islclean(lnew); 331 islclean.SetInputName("MIslands"); 332 islclean.SetMethod(kmethod); 333 334 MIslandsCalc island2; 335 island2.SetOutputName("MIslands2"); 336 island2.SetAlgorithm(kalgorithm); 337 338 MIslandsCalc island3; 339 island3.SetOutputName("MIslands3"); 340 341 342 MHillasCalc hcalc; 343 MHillasSrcCalc csrc1; 344 345 MContinue applycut(&cut); 346 applycut.SetInverted(kTRUE); 347 MWriteRootFile write(outname,"RECREATE"); 348 349 MHillasDisplay* disphillas=NULL; 350 351 write.AddContainer("MHillas" , "Parameters"); 352 write.AddContainer("MHillasSrc" , "Parameters"); 353 write.AddContainer("MHillasExt" , "Parameters"); 354 write.AddContainer("MNewImagePar" , "Parameters"); 355 write.AddContainer("MRawEvtHeader" , "Parameters"); 356 write.AddContainer("MRawRunHeader" , "Parameters"); 357 write.AddContainer("MTime" , "Parameters"); 358 write.AddContainer("MConcentration" , "Parameters"); 359 write.AddContainer("MSrcPosCam" , "Parameters"); 360 write.AddContainer("MIslands" , "Parameters"); 361 write.AddContainer("MReportDrive" , "Parameters"); 362 363 if (islflag == 2) 364 write.AddContainer("MIslands2" , "Parameters"); 365 if (islflag == 3) 366 write.AddContainer("MIslands3" , "Parameters"); 367 368 369 if(display) 370 { 371 disphillas = new MHillasDisplay(&nphot,&geomcam); 372 disphillas->SetIslandsName("MIslands"); 373 if (islflag == 2) 374 disphillas->SetIslandsName("MIslands2"); 375 if (islflag == 3) 376 disphillas->SetIslandsName("MIslands3"); 377 } 322 read4.DisableAutoScheme(); 323 324 MPedCalcFromLoGain pedlo2; 325 pedlo2.SetPedestalUpdate(kFALSE); 326 pedlo2.SetExtractor((MExtractTimeAndCharge*)extractor); 327 pedlo2.SetNumEventsDump(500); 328 pedlo2.SetMaxSignalVar(40); 329 pedlo2.SetPedestalsIn(&pedcammean); 330 pedlo2.SetPedestalsOut(&pedcamrms); 378 331 379 332 tlist4.AddToList(&read4); 380 333 tlist4.AddToList(&geomapl); 381 tlist4.AddToList(&peddatacalc); 382 tlist4.AddToList(extractor); 383 tlist4.AddToList(&timecalc); 384 tlist4.AddToList(&photcalc); 385 if(calflag==11 || calflag==21) 386 tlist4.AddToList(&interpolatebadpixels); 387 tlist4.AddToList(&clean); 388 tlist4.AddToList(&island); 389 334 tlist4.AddToList(&pedlo2); 335 336 // Create and setup the eventloop 337 MEvtLoop evtloop4; 338 evtloop4.SetParList(&plist4); 339 if (!evtloop4.Eventloop(500)) 340 return; 341 342 tlist4.PrintStatistics(); 343 344 tlist5.AddToList(&pedlo2); 345 pedlo2.SetPedestalUpdate(kTRUE); 346 347 photcalc.SetPedestalCamRms(&pedcamrms); 348 } 349 350 // containers 351 MCerPhotEvt nphot; 352 MPedPhotCam nphotrms; 353 MHillas hillas; 354 MNewImagePar newimagepar; 355 MSrcPosCam source; 356 MRawRunHeader runhead; 357 MArrivalTimeCam timecam; 358 MReportDrive reportdrive; 359 // islands 360 MIslands isl; 361 MIslands isl2; 362 MIslands isl3; 363 364 isl.SetName("MIslands"); 365 isl2.SetName("MIslands2"); 366 isl3.SetName("MIslands3"); 367 368 plist5.AddToList(&timecam); 369 plist5.AddToList(&isl); 370 371 if (islflag == 2) 372 plist5.AddToList(&isl2); 373 if (islflag == 3) 374 plist5.AddToList(&isl3); 375 376 plist5.AddToList(&geomcam); 377 plist5.AddToList(&pedcammean); 378 plist5.AddToList(&calloop.GetCalibrationCam()); 379 plist5.AddToList(&calloop.GetQECam()); 380 plist5.AddToList(&calloop.GetRelTimeCam()); 381 plist5.AddToList(&calloop.GetBadPixels()); 382 plist5.AddToList(&nphot); 383 plist5.AddToList(&nphotrms); 384 plist5.AddToList(&source); 385 plist5.AddToList(&hillas); 386 plist5.AddToList(&newimagepar); 387 plist5.AddToList(&runhead); 388 plist5.AddToList(&reportdrive); 389 390 // cuts 391 MF cut(filter); 392 393 MImgCleanStd clean(lcore,ltail); 394 clean.SetCleanRings(lrings); 395 MImgCleanStd::CleaningMethod_t cleanMeth= MImgCleanStd::kStandard; 396 if(cleanflag==2) 397 cleanMeth=MImgCleanStd::kDemocratic; 398 clean.SetMethod(cleanMeth); 399 400 MArrivalTimeCalc2 timecalc; 401 MIslandsCalc island; 402 island.SetOutputName("MIslands"); 403 island.SetAlgorithm(kalgorithm); 404 405 MBadPixelsTreat interpolatebadpixels; 406 interpolatebadpixels.SetUseInterpolation(); 407 interpolatebadpixels.SetProcessPedestal(); 408 409 MIslandsClean islclean(lnew); 410 islclean.SetInputName("MIslands"); 411 islclean.SetMethod(kmethod); 412 413 MIslandsCalc island2; 414 island2.SetOutputName("MIslands2"); 415 island2.SetAlgorithm(kalgorithm); 416 417 MIslandsCalc island3; 418 island3.SetOutputName("MIslands3"); 419 420 421 MHillasCalc hcalc; 422 MHillasSrcCalc csrc1; 423 424 MContinue applycut(&cut); 425 applycut.SetInverted(kTRUE); 426 MWriteRootFile write(outname,"RECREATE"); 427 428 MHillasDisplay* disphillas=NULL; 429 430 write.AddContainer("MHillas" , "Parameters"); 431 write.AddContainer("MHillasSrc" , "Parameters"); 432 write.AddContainer("MHillasExt" , "Parameters"); 433 write.AddContainer("MNewImagePar" , "Parameters"); 434 write.AddContainer("MRawEvtHeader" , "Parameters"); 435 write.AddContainer("MRawRunHeader" , "Parameters"); 436 write.AddContainer("MTime" , "Parameters"); 437 write.AddContainer("MConcentration" , "Parameters"); 438 write.AddContainer("MSrcPosCam" , "Parameters"); 439 write.AddContainer("MIslands" , "Parameters"); 440 write.AddContainer("MReportDrive" , "Parameters"); 441 442 if (islflag == 2) 443 write.AddContainer("MIslands2" , "Parameters"); 444 if (islflag == 3) 445 write.AddContainer("MIslands3" , "Parameters"); 446 447 448 if(display) 449 { 450 disphillas = new MHillasDisplay(&nphot,&geomcam); 451 disphillas->SetIslandsName("MIslands"); 390 452 if (islflag == 2) 391 { 392 tlist4.AddToList(&islclean); 393 tlist4.AddToList(&island2); 394 } 395 453 disphillas->SetIslandsName("MIslands2"); 396 454 if (islflag == 3) 397 { 398 tlist4.AddToList(&islclean); 399 tlist4.AddToList(&island3); 400 } 401 402 tlist4.AddToList(&hcalc); 403 tlist4.AddToList(&csrc1); 404 if(filter.Length()) 405 tlist4.AddToList(&applycut); 406 tlist4.AddToList(&write); 407 if(display) 408 { 409 disphillas->SetPSFile(); 410 disphillas->SetPSFileName(psfilename); 411 if(display==2) 412 disphillas->SetPause(kFALSE); 413 tlist4.AddToList(disphillas); 414 } 415 416 // Create and setup the eventloop 417 MEvtLoop datloop; 418 datloop.SetParList(&plist4); 419 420 cout << "*************************************************************" << endl; 421 cout << "*** COMPUTING DATA USING EXTRACTED SIGNAL (IN PHOTONS) ***" << endl; 422 cout << "*************************************************************" << endl; 423 424 if (!datloop.Eventloop(nmaxevents)) 425 return; 426 427 tlist4.PrintStatistics(); 428 delete extractor; 429 } 430 else 431 { 432 /************************************************************************/ 433 /* THIRD LOOP: PEDESTAL CALIBRATION INTO PHOTONS */ 434 /************************************************************************/ 435 436 // First Compute the pedestals 437 MJPedestal pedloop; 438 pedloop.SetInput(&pediter); 439 440 if (!pedloop.Process()) 441 return; 442 443 MParList plist3; 444 MTaskList tlist3; 445 plist3.AddToList(&tlist3); 446 447 // containers 448 MGeomCamMagic geomcam; 449 MCerPhotEvt nphot; 450 MPedPhotCam nphotrms; 451 MExtractedSignalCam sigcam; 452 453 plist3.AddToList(&geomcam); 454 plist3.AddToList(&pedloop.GetPedestalCam()); 455 plist3.AddToList(&calloop.GetCalibrationCam()); 456 plist3.AddToList(&calloop.GetQECam()); 457 plist3.AddToList(&calloop.GetRelTimeCam()); 458 plist3.AddToList(&calloop.GetBadPixels()); 459 plist3.AddToList(&sigcam); 460 plist3.AddToList(&nphot); 461 plist3.AddToList(&nphotrms); 462 463 464 MCalibrateData::CalibrationMode_t calMode=MCalibrateData::kDefault; 465 if(calflag==0) 466 calMode=MCalibrateData::kNone; 467 if(calflag==-1) 468 calMode=MCalibrateData::kDummy; 469 470 //tasks 471 MReadMarsFile read3("Events"); 472 static_cast<MRead&>(read3).AddFiles(pediter); 473 read3.DisableAutoScheme(); 474 475 MGeomApply geomapl; 476 MPedPhotCalc photrmscalc; 477 MCalibrateData photcalc; 478 photcalc.SetCalibrationMode(calMode); 479 480 tlist3.AddToList(&read3); 481 tlist3.AddToList(&geomapl); 482 tlist3.AddToList(extractor); 483 tlist3.AddToList(&photcalc); 484 tlist3.AddToList(&photrmscalc); 485 486 // Create and setup the eventloop 487 MEvtLoop evtloop3; 488 evtloop3.SetParList(&plist3); 489 if (!evtloop3.Eventloop()) 490 return; 491 492 tlist3.PrintStatistics(); 493 494 /************************************************************************/ 495 /* FOURTH LOOP: DATA CALIBRATION INTO PHOTONS */ 496 /************************************************************************/ 497 498 MParList plist4; 499 MTaskList tlist4; 500 plist4.AddToList(&tlist4); 501 502 // containers 503 MHillas hillas; 504 MNewImagePar newimagepar; 505 MSrcPosCam source; 506 MRawRunHeader runhead; 507 508 MArrivalTimeCam timecam; 509 510 511 // islands 512 MIslands isl; 513 MIslands isl2; 514 MIslands isl3; 515 516 isl.SetName("MIslands"); 517 isl2.SetName("MIslands2"); 518 isl3.SetName("MIslands3"); 519 520 plist4.AddToList(&timecam); 521 plist4.AddToList(&isl); 522 523 if (islflag == 2) 524 plist4.AddToList(&isl2); 525 if (islflag == 3) 526 plist4.AddToList(&isl3); 527 528 plist4.AddToList(&geomcam); 529 plist4.AddToList(&pedloop.GetPedestalCam()); 530 plist4.AddToList(&calloop.GetCalibrationCam()); 531 plist4.AddToList(&calloop.GetQECam()); 532 plist4.AddToList(&calloop.GetRelTimeCam()); 533 plist4.AddToList(&calloop.GetBadPixels()); 534 plist4.AddToList(&nphot); 535 plist4.AddToList(&nphotrms); 536 plist4.AddToList(&source); 537 plist4.AddToList(&hillas); 538 plist4.AddToList(&newimagepar); 539 plist4.AddToList(&runhead); 540 541 // cuts 542 MF cut(filter); 543 544 //tasks 545 // MReadMarsFile read4("Events"); 546 MReadReports read4; 547 read4.AddTree("Events","MTime.",kTRUE); 548 read4.AddTree("Drive"); 549 // read4.DisableAutoScheme(); 550 static_cast<MRead&>(read4).AddFiles(datiter); 551 552 553 554 MImgCleanStd clean(lcore,ltail); 555 clean.SetCleanRings(lrings); 556 MImgCleanStd::CleaningMethod_t cleanMeth= MImgCleanStd::kStandard; 557 if(cleanflag==2) 558 cleanMeth=MImgCleanStd::kDemocratic; 559 clean.SetMethod(cleanMeth); 560 561 MArrivalTimeCalc2 timecalc; 562 MIslandsCalc island; 563 island.SetOutputName("MIslands"); 564 island.SetAlgorithm(kalgorithm); 565 566 MBadPixelsTreat interpolatebadpixels; 567 interpolatebadpixels.SetUseInterpolation(); 568 interpolatebadpixels.SetProcessPedestal(); 569 // interpolatebadpixels.SetSloppyTreatment(); 570 571 MIslandsClean islclean(lnew); 572 islclean.SetInputName("MIslands"); 573 islclean.SetMethod(kmethod); 574 575 MIslandsCalc island2; 576 island2.SetOutputName("MIslands2"); 577 island2.SetAlgorithm(kalgorithm); 578 579 MIslandsCalc island3; 580 island3.SetOutputName("MIslands3"); 581 582 583 MHillasCalc hcalc; 584 MHillasSrcCalc csrc1; 585 586 MContinue applycut(&cut); 587 applycut.SetInverted(kTRUE); 588 MWriteRootFile write(outname,"RECREATE"); 589 590 MHillasDisplay* disphillas=NULL; 591 592 write.AddContainer("MHillas" , "Parameters"); 593 write.AddContainer("MHillasSrc" , "Parameters"); 594 write.AddContainer("MHillasExt" , "Parameters"); 595 write.AddContainer("MNewImagePar" , "Parameters"); 596 write.AddContainer("MRawEvtHeader" , "Parameters"); 597 write.AddContainer("MRawRunHeader" , "Parameters"); 598 write.AddContainer("MTime" , "Parameters"); 599 write.AddContainer("MConcentration" , "Parameters"); 600 write.AddContainer("MSrcPosCam" , "Parameters"); 601 write.AddContainer("MIslands" , "Parameters"); 602 603 if (islflag == 2) 604 write.AddContainer("MIslands2" , "Parameters"); 605 if (islflag == 3) 606 write.AddContainer("MIslands3" , "Parameters"); 607 608 609 if(display) 610 { 611 disphillas = new MHillasDisplay(&nphot,&geomcam); 612 disphillas->SetIslandsName("MIslands"); 613 if (islflag == 2) 614 disphillas->SetIslandsName("MIslands2"); 615 if (islflag == 3) 616 disphillas->SetIslandsName("MIslands3"); 617 } 618 619 tlist4.AddToList(&read4); 620 tlist4.AddToList(&geomapl); 621 tlist4.AddToList(extractor); 622 tlist4.AddToList(&photcalc); 623 if(calflag==11 || calflag==21) 624 tlist4.AddToList(&interpolatebadpixels); 625 tlist4.AddToList(&clean); 626 tlist4.AddToList(&timecalc); 627 tlist4.AddToList(&island); 628 629 if (islflag == 2) 630 { 631 tlist4.AddToList(&islclean); 632 tlist4.AddToList(&island2); 633 } 634 635 if (islflag == 3) 636 { 637 tlist4.AddToList(&islclean); 638 tlist4.AddToList(&island3); 639 } 640 641 tlist4.AddToList(&hcalc); 642 tlist4.AddToList(&csrc1); 643 if(filter.Length()) 644 tlist4.AddToList(&applycut); 645 tlist4.AddToList(&write); 646 if(display) 647 { 648 disphillas->SetPSFile(); 649 disphillas->SetPSFileName(psfilename); 650 if(display==2) 651 disphillas->SetPause(kFALSE); 652 tlist4.AddToList(disphillas); 653 } 654 655 // Create and setup the eventloop 656 MEvtLoop datloop; 657 datloop.SetParList(&plist4); 658 659 cout << "*************************************************************" << endl; 660 cout << "*** COMPUTING DATA USING EXTRACTED SIGNAL (IN PHOTONS) ***" << endl; 661 cout << "*************************************************************" << endl; 662 663 if (!datloop.Eventloop(nmaxevents)) 664 return; 665 666 tlist4.PrintStatistics(); 667 delete extractor; 668 } 455 disphillas->SetIslandsName("MIslands3"); 456 } 457 458 tlist5.AddToList(extractor); 459 tlist5.AddToList(&timecalc); 460 tlist5.AddToList(&photcalc); 461 if(calflag==11 || calflag==21) 462 tlist5.AddToList(&interpolatebadpixels); 463 tlist5.AddToList(&clean); 464 tlist5.AddToList(&island); 465 466 if (islflag == 2) 467 { 468 tlist5.AddToList(&islclean); 469 tlist5.AddToList(&island2); 470 } 471 472 if (islflag == 3) 473 { 474 tlist5.AddToList(&islclean); 475 tlist5.AddToList(&island3); 476 } 477 478 tlist5.AddToList(&hcalc); 479 tlist5.AddToList(&csrc1); 480 if(filter.Length()) 481 tlist5.AddToList(&applycut); 482 tlist5.AddToList(&write); 483 if(display) 484 { 485 disphillas->SetPSFile(); 486 disphillas->SetPSFileName(psfilename); 487 if(display==2) 488 disphillas->SetPause(kFALSE); 489 tlist5.AddToList(disphillas); 490 } 491 492 // Create and setup the eventloop 493 MEvtLoop datloop; 494 datloop.SetParList(&plist5); 495 496 cout << "*************************************************************" << endl; 497 cout << "*** COMPUTING DATA USING EXTRACTED SIGNAL (IN PHOTONS) ***" << endl; 498 cout << "*************************************************************" << endl; 499 500 if (!datloop.Eventloop(nmaxevents)) 501 return; 502 503 tlist5.PrintStatistics(); 504 delete extractor; 669 505 } 670 506 //------------------------------------------------------------------------------- … … 703 539 } 704 540 705 // pedestal runs706 if(strcmp(word.Data(),"PRUNS")==0)707 {708 if(pediter.GetNumRuns())709 cout << "readDataCards Warning: adding pedestal runs to the existing list" << endl;710 ifun >> word;711 if(strcmp(word.Data(),"0")!=0)712 pediter.AddRuns(word.Data(),idirname.Data());713 }714 541 715 542 // pedestal runs for calibration … … 812 639 } 813 640 814 pediter.Reset();815 641 pedcaliter.Reset(); 816 642 caliter.Reset(); … … 828 654 while(!(pfile=caliter.Next()).IsNull()) 829 655 cout << pfile << endl; 830 if(pediter.GetNumRuns()>0) 831 { 832 cout << "Pedestal file (s): " << endl; 833 while(!(pfile=pediter.Next()).IsNull()) 834 cout << pfile << endl; 835 } 836 else 837 cout << "Warning: Pedestals for data will be computed from data themselves" << endl; 656 cout << "Warning: Pedestals for data will be computed from data themselves" << endl; 838 657 cout << "Data file (s): " << endl; 839 658 while(!(pfile=datiter.Next()).IsNull()) … … 865 684 cout << "***********" << endl << endl; 866 685 867 if(!pedcaliter.GetNumEntries() )686 if(!pedcaliter.GetNumEntries() && calflag>0) 868 687 { 869 688 cout << "No pedestal file for calibration specified" << endl; -
trunk/MagicSoft/Mars/mtemp/mifae/programs/makehillas.datacard
r5208 r5657 20 20 PCRUNS 39313 21 21 CRUNS 39315 22 PRUNS 023 22 DRUNS 39261,39262,39264,39265,39269,39271,39273,39274,39276,39277,39279,39280,39282,39283,39285 24 23 //,39286,39288,39290,39292-39294,39296-39299,39301,39302,39304-39306,39308,39309,39311,39318,39319,39321,39322,39324,39325,39327,39328,39330,39331,39333,39334,39336-39338,39340-39342,39344,39348-39350,39352-39355,39357,39358,39360-39362,39364-39366,39368-39370,39372,39373 … … 45 44 46 45 // Signal extractor, higain first, higainlast, logainfirst, logainlast, window size 47 // signal extractors: 0 fixed window, 1 sliding window, 2 peak search 48 EXTRACTOR 2 0 14 2 14 646 // signal extractors: 0 fixed window, 1 sliding window, 2 peak search, 3 spline 47 EXTRACTOR 3 1 11 2 12 2 49 48 50 49 // calibration flag:
Note:
See TracChangeset
for help on using the changeset viewer.