Changeset 13780 for fact/tools/rootmacros
- Timestamp:
- 05/18/12 21:20:42 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fact/tools/rootmacros/PulseTemplates/FCalcPulseTemplate.C
r13656 r13780 84 84 //---------------------------------------------------------------------------- 85 85 int FCalcPulseTemplate( 86 TString InRootFileName = " pulseoverlay.root",87 TString InputPath = " /home_nfs/isdc/jbbuss/analysis/FPulseTemplate/20111109_006/Overlay/",88 TString OutputRootFileName = " 20111109_006.pulses.root",89 TString OutPutPath = " /home_nfs/isdc/jbbuss/analysis/FPulseTemplate/20111109_006/Template/",90 bool ProduceGraphic = false,86 TString InRootFileName = "20120309_018.root", 87 TString InputPath = "analysis/FPulseTemplate/20120309_018/Overlay/", 88 TString OutputRootFileName = "test.root", 89 TString OutPutPath = "analysis/FPulseTemplate/20120309_018/", 90 bool ProduceGraphic = true, 91 91 // bool fitdata = false, 92 92 bool stats = false, … … 95 95 int maxPulseOrder = 3, 96 96 // int refresh_rate = 500, //refresh rate for canvases 97 int verbosityLevel = 4, // different verbosity levels can be implemented here97 int verbosityLevel = 5, // different verbosity levels can be implemented here 98 98 int firstpixel = 0, 99 int npixel = -199 int npixel = 2 100 100 ) 101 101 { 102 103 104 InputPath = SetHostsPaths(true, InputPath ); 105 OutPutPath = SetHostsPaths(true, OutPutPath ); 106 102 107 103 108 //---------------------------------------------------------------------------- … … 286 291 verbosityLevel, 287 292 stats, 293 "L", 294 70, ///TODO: get it from the root file 295 230, ///TODO: get it from the root file 296 -1, ///TODO: get it from the root file 297 9, ///TODO: get it from the root file 288 298 inputRootFile 289 299 ); … … 304 314 verbosityLevel, 305 315 stats, 306 outputRootFile,316 "", 307 317 pixel[pixelID]->mPixelOverlayXaxisLeft, 308 318 pixel[pixelID]->mPixelOverlayXaxisRight , 309 319 pixel[pixelID]->mBSLMean , 310 320 pixel[pixelID]->mGainMean , 311 pixel[pixelID]->mOptions321 outputRootFile 312 322 ); 313 323 first_pass = false; … … 374 384 verbosityLevel 375 385 ); 376 386 if (ProduceGraphic) 387 { 377 388 pixel[pixelID]->DrawTemplateHistograms( 378 389 cgpPixelPulses, … … 384 395 PixelCanvasFrameNrs 385 396 ); 386 397 } 387 398 //------------------------------------- 388 399 // Fill Histogramms of Camera 389 400 //------------------------------------- 390 401 cout << "1" << endl; 391 402 wholeCamera->hMaxOverlay[pulse_order]->Add( 392 403 pixel[pixelID]->hMaxOverlay[pulse_order] 393 404 ); 394 405 cout << wholeCamera->hMaxOverlay[pulse_order]->GetName() << endl; 406 cout << "2" << endl; 395 407 wholeCamera->hMaxProfile[pulse_order]->Add( 396 408 pixel[pixelID]->hMaxProfile[pulse_order] 397 409 ); 398 410 cout << "3" << endl; 399 411 wholeCamera->hEdgeOverlay[pulse_order]->Add( 400 412 pixel[pixelID]->hEdgeOverlay[pulse_order] 401 413 ); 402 414 cout << "4" << endl; 403 415 wholeCamera->hEdgeProfile[pulse_order]->Add( 404 416 pixel[pixelID]->hEdgeProfile[pulse_order] 405 417 ); 406 418 cout << "5" << endl; 419 420 if (verbosityLevel > 2) 421 { 422 cout << endl << "...End of pulseorder " 423 << pulse_order 424 << endl; 425 } 407 426 408 427 } … … 436 455 //deleteCurrent Pixel from Heap 437 456 delete pixel[pixelID]; 438 457 pixel[pixelID] = NULL; 439 458 if (verbosityLevel > 2) 440 459 { … … 462 481 } 463 482 483 delete[] pixel; 484 pixel = NULL; 464 485 //------------------------------------- 465 486 // Draw All Pixel Histograms … … 476 497 } 477 498 478 //Calculate Max Prop. Value of each slice479 //-------------------------------------499 // Calculate Max Prop. Value of each slice 500 // ------------------------------------- 480 501 481 502 //from Maximum Overlay … … 511 532 ); 512 533 513 wholeCamera->DrawTemplateHistograms( 514 cgpPixelPulses, 515 PixelCanvasFrameNrs 516 ); 517 518 wholeCamera->DrawEdgeTemplateHistograms( 519 cgpPixelPulses, 520 PixelCanvasFrameNrs 521 ); 522 } 534 // wholeCamera->DrawTemplateHistograms( 535 // cgpPixelPulses, 536 // PixelCanvasFrameNrs 537 // ); 538 539 // wholeCamera->DrawEdgeTemplateHistograms( 540 // cgpPixelPulses, 541 // PixelCanvasFrameNrs 542 // ); 543 } //EOF: Draw All Pixel Histograms 544 545 //------------------------------------- 546 // Save All Pixel Histograms 547 //------------------------------------- 548 523 549 // SaveHistograms( //save histograms of all pixel into output root file 524 550 // OutInRootFileName, … … 541 567 // UpdateCanvases( 542 568 // verbosityLevel, 543 // MAX_PULS_ORDER 569 // MAX_PULS_ORDER, 570 // false 544 571 // ); 545 572 // } 546 573 547 // WriteAllPixelTemplateToCsv(548 // OutPutPath,549 // "PulseTemplate_PointSet",550 // "Maximum",551 // verbosityLevel552 // );553 554 delete pixel;555 574 delete wholeCamera; 556 DeletePixelCanvases( maxPulseOrder ,verbosityLevel ); 575 if (ProduceGraphic) 576 { 577 DeletePixelCanvases( maxPulseOrder ,verbosityLevel ); 578 } 557 579 delete inputRootFile; 558 580 delete outputRootFile; … … 575 597 ) 576 598 { 577 if (verbosityLevel > 2) cout << endl << "...delete pixel Canvases" ; 599 if (verbosityLevel > 2) 600 { 601 cout << endl << "...delete pixel Canvases" << endl; 602 } 578 603 for (int pulse_order = 0; pulse_order < maxPulseOrder; pulse_order++ ) 579 604 { 580 605 delete cgpPixelPulses[pulse_order]; 606 cgpPixelPulses[pulse_order] = NULL; 581 607 delete cgpDistributions[pulse_order]; 608 cgpDistributions[pulse_order] = NULL; 582 609 } 583 610 delete[] cgpPixelPulses; 611 cgpPixelPulses = NULL; 584 612 delete[] cgpDistributions; 613 cgpDistributions = NULL; 585 614 } 586 615
Note:
See TracChangeset
for help on using the changeset viewer.