- Timestamp:
- 01/19/13 19:59:50 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fact/tools/rootmacros/PulseTemplates/FCalcPulseTemplate.C
r14753 r14781 97 97 int FCalcPulseTemplate( 98 98 TString InRootFileName = "20120309_017.root", 99 // TString InRootFileName = "20120309_032.root", 99 100 TString InputPath = "analysis/analysis/FPulseTemplate/20120309_017/Overlay/", 101 // TString InputPath = "analysis/analysis/FPulseTemplate/20120309_032/Overlay/", 100 102 TString OutputRootFileName = "test.root", 101 103 TString OutPutPath = "analysis/FPulseTemplate/20120309_017/", 102 104 int firstpixel = 0, 103 int npixel = 10 ,105 int npixel = 100, 104 106 int pixelSetSize = 200, 105 int maxPulseOrder = 4,107 int maxPulseOrder = 1, 106 108 // TString histoOptions = "SRM", 107 109 bool ProduceGraphic = true, … … 261 263 TH1D hIntegral[maxPulseOrder]; 262 264 TH1D hAmplitude[maxPulseOrder]; 265 TH1D hRiseTime[maxPulseOrder]; 263 266 264 267 //Lopp over pulse order configure distribution histograms … … 300 303 title.Append(i); 301 304 hIntegral[i].SetNameTitle(title, title); 302 hIntegral[i].SetBins( 400, (i+1)*99.5, (i+1)*499.5);305 hIntegral[i].SetBins(500, (i+1)*-0.5, (i+1)*499.5); 303 306 304 307 //Amplitude … … 307 310 hAmplitude[i].SetNameTitle(title, title); 308 311 hAmplitude[i].SetBins(400, (i+1)*4.95, (i+1)*24.95); 309 } 312 313 //hRiseTime 314 title = "hRiseTime"; 315 title.Append(i); 316 hRiseTime[i].SetNameTitle(title, title); 317 hRiseTime[i].SetBins(20, -0, 10); 318 } 319 320 // Error Histograms 321 322 TH1D hMedianErrors[maxPulseOrder]; 323 TH1D hMeanErrors[maxPulseOrder]; 324 TH1D hMaxErrors[maxPulseOrder]; 325 326 //Lopp over pulse order configure distribution histograms 327 for (int i = 0; i<maxPulseOrder; i++) 328 { 329 //hMedianErrors 330 TString title; 331 title = "hMedianErrors"; 332 title.Append(i); 333 hMedianErrors[i].SetNameTitle(title, title); 334 hMedianErrors[i].SetBins(300, -0.5, 300.5); 335 336 //hMeanErrors 337 title = "hMeanErrors"; 338 title.Append(i); 339 hMeanErrors[i].SetNameTitle(title, title); 340 hMeanErrors[i].SetBins(300, -0.5, 300.5); 341 342 //hMaxErrors 343 title = "hMaxErrors"; 344 title.Append(i); 345 hMaxErrors[i].SetNameTitle(title, title); 346 hMaxErrors[i].SetBins(300, -0.5, 300.5); 347 } 348 310 349 311 350 //----------------------------------------------------------------------------- … … 379 418 380 419 //-------------------------------------------------------------------- 381 // Loop sover every Pixel of a Set of Pixels420 // Loop over every Pixel of a Set of Pixels 382 421 //-------------------------------------------------------------------- 383 422 for ( int pixelID = firstPixelOfSet; … … 492 531 "Maximum", 493 532 pulse_order, 533 10, 494 534 verbosityLevel 495 535 ); … … 505 545 "Edge", 506 546 pulse_order, 547 10, 507 548 verbosityLevel 508 549 ); … … 743 784 Pulse* pulseFits[6]; 744 785 745 pulses.cd(1);786 // pulses.cd(1); 746 787 Pulse maxMaxPulse("maxMaxPulse", pixel[pixelID]->hPixelMax[pulse_order], "Q", 1); 747 788 pulseFits[0] = &maxMaxPulse; 748 789 749 pulses.cd(2);790 // pulses.cd(2); 750 791 Pulse maxMedianPulse("maxMedianPulse", pixel[pixelID]->hPixelMedian[pulse_order], "Q",1); 751 792 pulseFits[1] = &maxMedianPulse; 752 793 753 pulses.cd(3);794 // pulses.cd(3); 754 795 Pulse maxMeanPulse("maxMeanPulse", pixel[pixelID]->hPixelMean[pulse_order], "Q",1); 755 796 pulseFits[2] = &maxMeanPulse; … … 778 819 } 779 820 //------------------------------------- 821 // Fill Error Histogramms 822 //------------------------------------- 823 824 for (int i = pixel[pixelID]->hPixelEdgeMedian[pulse_order]->GetXaxis()->GetFirst(); 825 i <= pixel[pixelID]->hPixelEdgeMedian[pulse_order]->GetXaxis()->GetLast(); 826 i++) 827 { 828 829 hMedianErrors[pulse_order].SetBinContent( 830 i, 831 pixel[pixelID]->hPixelEdgeMedian[pulse_order]->GetBinError(i) 832 ); 833 834 hMeanErrors[pulse_order].SetBinContent( 835 i, 836 pixel[pixelID]->hPixelEdgeMean[pulse_order]->GetBinError(i) 837 ); 838 839 hMaxErrors[pulse_order].SetBinContent( 840 i, 841 pixel[pixelID]->hPixelEdgeMax[pulse_order]->GetBinError(i) 842 ); 843 } 844 845 if (ProduceGraphic && debugPixel) 846 { 847 int current_order = 0; 848 pulses.cd(1); 849 hMaxErrors[current_order].Draw(); 850 851 pulses.cd(2); 852 hMedianErrors[current_order].Draw(); 853 854 pulses.cd(3); 855 hMeanErrors[current_order].Draw(); 856 pulses.Update(); 857 } 858 859 //------------------------------------- 780 860 // Fill Distribution Histogramms 781 861 //------------------------------------- … … 788 868 hIntegral[pulse_order].Fill( edgeMedianPulse.GetIntegral()); 789 869 hAmplitude[pulse_order].Fill( edgeMedianPulse.GetAmplitude()); 870 hRiseTime[pulse_order].Fill( edgeMedianPulse.GetRiseTime()); 790 871 791 872 //------------------------------------- 792 // Fill Distribution Containers873 // Fill Distribution Graphs 793 874 //------------------------------------- 794 875 … … 901 982 TTimer timer("gSystem->ProcessEvents();", 50, kFALSE); 902 983 timer.TurnOn(); 903 TString input = Getline("Type 'q' to exit, <return> to go on: ");984 TString input = Getline("Type 'q' to exit, Type 's' to exit set, <return> to go on: "); 904 985 timer.TurnOff(); 905 986 if (input=="q\n") 906 987 { 907 988 return(0); 989 } 990 if (input=="s\n") 991 { 992 break; 908 993 } 909 994 } … … 979 1064 "Maximum", 980 1065 pulse_order, 1066 10, 981 1067 verbosityLevel 982 1068 ); … … 997 1083 "Edge", 998 1084 pulse_order, 1085 10, 999 1086 verbosityLevel 1000 1087 ); … … 1113 1200 cgpDistributions[i]->cd(7); 1114 1201 hAmplitude[i].Draw(); 1202 cgpDistributions[i]->cd(8); 1203 hRiseTime[i].Draw(); 1115 1204 1116 1205
Note:
See TracChangeset
for help on using the changeset viewer.