@@ -2305,7 +2305,7 @@ void PlotHistCorrFactor(char* infile,
23052305
23062306void PlotHistCorrFactor (char * infile ,
23072307 std ::string text ,
2308- int depth ,
2308+ int depth ,
23092309 std ::string prefixF ,
23102310 double scale = 1.0 ,
23112311 int nmin = 100 ,
@@ -2388,14 +2388,14 @@ void PlotHistCorrFactor(char* infile,
23882388 if (drawStatBox ) {
23892389 TPaveStats * st1 = (TPaveStats * )hists [k ]-> GetListOfFunctions ()-> FindObject ("stats" );
23902390 if (st1 != nullptr ) {
2391- dy = (entries [k ] > nmin ) ? 0.05 : 0.025 ;
2392- st1 -> SetLineColor (colors [k ]);
2393- st1 -> SetTextColor (colors [k ]);
2394- st1 -> SetY1NDC (yh - dy );
2395- st1 -> SetY2NDC (yh );
2396- st1 -> SetX1NDC (0.70 );
2397- st1 -> SetX2NDC (0.90 );
2398- yh -= dy ;
2391+ dy = (entries [k ] > nmin ) ? 0.05 : 0.025 ;
2392+ st1 -> SetLineColor (colors [k ]);
2393+ st1 -> SetTextColor (colors [k ]);
2394+ st1 -> SetY1NDC (yh - dy );
2395+ st1 -> SetY2NDC (yh );
2396+ st1 -> SetX1NDC (0.70 );
2397+ st1 -> SetX2NDC (0.90 );
2398+ yh -= dy ;
23992399 }
24002400 }
24012401 sprintf (name , "Depth %d (%s)" , depth , text .c_str ());
@@ -2640,10 +2640,10 @@ void PlotHistCorrFactors(char* infile1,
26402640 h -> SetMarkerStyle (mtype [j ]);
26412641 h -> SetMarkerSize (0.9 );
26422642 h -> GetXaxis ()-> SetTitle ("i#eta" );
2643- if (nfile > 2 )
2644- sprintf (name , "CF_{%s}/CF_{Set}" , texts [0 ].c_str ());
2645- else
2646- sprintf (name , "CF_{%s}/CF_{%s}" , texts [0 ].c_str (), texts [ih ].c_str ());
2643+ if (nfile > 2 )
2644+ sprintf (name , "CF_{%s}/CF_{Set}" , texts [0 ].c_str ());
2645+ else
2646+ sprintf (name , "CF_{%s}/CF_{%s}" , texts [0 ].c_str (), texts [ih ].c_str ());
26472647 h -> GetYaxis ()-> SetTitle (name );
26482648 h -> GetYaxis ()-> SetLabelOffset (0.005 );
26492649 h -> GetYaxis ()-> SetTitleSize (0.036 );
@@ -2832,80 +2832,82 @@ void PlotHistCorr2Factors(char* infile1,
28322832 int nline (0 );
28332833 if (ratio ) {
28342834 for (int ih = 1 ; ih < nfile ; ++ ih ) {
2835- sprintf (name , "h%dd%d" , ih , depth );
2836- TH1D * h = new TH1D (name , name , nbin , etamin , etamax );
2837- double sumNum (0 ), sumDen (0 );
2838- std ::map < int , cfactors > ::const_iterator ktr = cfacs [ih ].begin ();
2839- for (std ::map < int , cfactors > ::const_iterator itr = cfacs [0 ].begin (); itr != cfacs [0 ].end (); ++ itr , ++ ktr ) {
2840- int dep = (itr -> second ).depth ;
2841- if (dep == depth ) {
2842- int ieta = (itr -> second ).ieta ;
2843- int bin = ieta - etamin + 1 ;
2844- float val = (itr -> second ).corrf / (ktr -> second ).corrf ;
2845- float dvl = val * sqrt ((((itr -> second ).dcorr * (itr -> second ).dcorr ) / ((itr -> second ).corrf * (itr -> second ).corrf )) + (((ktr -> second ).dcorr * (ktr -> second ).dcorr ) / ((ktr -> second ).corrf * (ktr -> second ).corrf )));
2846- h -> SetBinContent (bin , val );
2847- h -> SetBinError (bin , dvl );
2848- sumNum += (val / (dvl * dvl ));
2849- sumDen += (1.0 / (dvl * dvl ));
2835+ sprintf (name , "h%dd%d" , ih , depth );
2836+ TH1D * h = new TH1D (name , name , nbin , etamin , etamax );
2837+ double sumNum (0 ), sumDen (0 );
2838+ std ::map < int , cfactors > ::const_iterator ktr = cfacs [ih ].begin ();
2839+ for (std ::map < int , cfactors > ::const_iterator itr = cfacs [0 ].begin (); itr != cfacs [0 ].end (); ++ itr , ++ ktr ) {
2840+ int dep = (itr -> second ).depth ;
2841+ if (dep == depth ) {
2842+ int ieta = (itr -> second ).ieta ;
2843+ int bin = ieta - etamin + 1 ;
2844+ float val = (itr -> second ).corrf / (ktr -> second ).corrf ;
2845+ float dvl =
2846+ val * sqrt ((((itr -> second ).dcorr * (itr -> second ).dcorr ) / ((itr -> second ).corrf * (itr -> second ).corrf )) +
2847+ (((ktr -> second ).dcorr * (ktr -> second ).dcorr ) / ((ktr -> second ).corrf * (ktr -> second ).corrf )));
2848+ h -> SetBinContent (bin , val );
2849+ h -> SetBinError (bin , dvl );
2850+ sumNum += (val / (dvl * dvl ));
2851+ sumDen += (1.0 / (dvl * dvl ));
28502852 }
2851- }
2852- double fit = (sumDen > 0 ) ? (sumNum / sumDen ) : 1.0 ;
2853- std ::cout << "Fit to Pol0: " << fit << std ::endl ;
2854- h -> SetLineColor (colors [ih ]);
2855- h -> SetMarkerColor (colors [ih ]);
2856- h -> SetMarkerStyle (mtype [depth - 1 ]);
2857- h -> SetMarkerSize (0.9 );
2858- h -> GetXaxis ()-> SetTitle ("i#eta" );
2859- sprintf (name , "CF_{%s}/CF_{%s}" , texts [0 ].c_str (), texts [1 ].c_str ());
2860- h -> GetYaxis ()-> SetTitle (name );
2861- h -> GetYaxis ()-> SetLabelOffset (0.005 );
2862- h -> GetYaxis ()-> SetTitleSize (0.036 );
2863- h -> GetYaxis ()-> SetTitleOffset (1.20 );
2864- h -> GetYaxis ()-> SetRangeUser (0.50 , 1.50 );
2865- hists .push_back (h );
2866- fitr .push_back (fit );
2867- htype .push_back (ih );
2868- ++ nline ;
2853+ }
2854+ double fit = (sumDen > 0 ) ? (sumNum / sumDen ) : 1.0 ;
2855+ std ::cout << "Fit to Pol0: " << fit << std ::endl ;
2856+ h -> SetLineColor (colors [ih ]);
2857+ h -> SetMarkerColor (colors [ih ]);
2858+ h -> SetMarkerStyle (mtype [depth - 1 ]);
2859+ h -> SetMarkerSize (0.9 );
2860+ h -> GetXaxis ()-> SetTitle ("i#eta" );
2861+ sprintf (name , "CF_{%s}/CF_{%s}" , texts [0 ].c_str (), texts [1 ].c_str ());
2862+ h -> GetYaxis ()-> SetTitle (name );
2863+ h -> GetYaxis ()-> SetLabelOffset (0.005 );
2864+ h -> GetYaxis ()-> SetTitleSize (0.036 );
2865+ h -> GetYaxis ()-> SetTitleOffset (1.20 );
2866+ h -> GetYaxis ()-> SetRangeUser (0.50 , 1.50 );
2867+ hists .push_back (h );
2868+ fitr .push_back (fit );
2869+ htype .push_back (ih );
2870+ ++ nline ;
28692871 }
28702872 } else {
28712873 for (int k1 = 0 ; k1 < nfile ; ++ k1 ) {
2872- sprintf (name , "h%dd%d" , k1 , depth );
2873- TH1D * h = new TH1D (name , name , nbin , etamin , etamax );
2874- int nent (0 );
2875- for (std ::map < int , cfactors > ::const_iterator itr = cfacs [k1 ].begin (); itr != cfacs [k1 ].end (); ++ itr ) {
2876- int dep = (itr -> second ).depth ;
2877- if (dep == depth ) {
2878- int ieta = (itr -> second ).ieta ;
2879- int bin = ieta - etamin + 1 ;
2880- float val = (itr -> second ).corrf ;
2881- float dvl = (itr -> second ).dcorr ;
2882- h -> SetBinContent (bin , val );
2883- h -> SetBinError (bin , dvl );
2884- nent ++ ;
2885- }
2886- }
2887- if (nent > nmin ) {
2888- fits ++ ;
2889- if (drawStatBox )
2890- dy += 0.025 ;
2891- sprintf (name , "h%ddf%d" , k1 , depth );
2892- TF1 * func = new TF1 (name , "pol0" , etamin , etamax );
2893- h -> Fit (func , "+QWLR" , "" );
2894- }
2895- h -> SetLineColor (colors [k1 ]);
2896- h -> SetMarkerColor (colors [k1 ]);
2897- h -> SetMarkerStyle (mtype [depth - 1 ]);
2898- h -> SetMarkerSize (0.9 );
2899- h -> GetXaxis ()-> SetTitle ("i#eta" );
2900- h -> GetYaxis ()-> SetTitle ("Correction Factor" );
2901- h -> GetYaxis ()-> SetLabelOffset (0.005 );
2902- h -> GetYaxis ()-> SetTitleOffset (1.20 );
2903- h -> GetYaxis ()-> SetRangeUser (0.5 , 1.5 );
2904- hists .push_back (h );
2905- entries .push_back (nent );
2906- if (drawStatBox )
2907- dy += 0.025 ;
2908- htype .push_back (k1 );
2874+ sprintf (name , "h%dd%d" , k1 , depth );
2875+ TH1D * h = new TH1D (name , name , nbin , etamin , etamax );
2876+ int nent (0 );
2877+ for (std ::map < int , cfactors > ::const_iterator itr = cfacs [k1 ].begin (); itr != cfacs [k1 ].end (); ++ itr ) {
2878+ int dep = (itr -> second ).depth ;
2879+ if (dep == depth ) {
2880+ int ieta = (itr -> second ).ieta ;
2881+ int bin = ieta - etamin + 1 ;
2882+ float val = (itr -> second ).corrf ;
2883+ float dvl = (itr -> second ).dcorr ;
2884+ h -> SetBinContent (bin , val );
2885+ h -> SetBinError (bin , dvl );
2886+ nent ++ ;
2887+ }
2888+ }
2889+ if (nent > nmin ) {
2890+ fits ++ ;
2891+ if (drawStatBox )
2892+ dy += 0.025 ;
2893+ sprintf (name , "h%ddf%d" , k1 , depth );
2894+ TF1 * func = new TF1 (name , "pol0" , etamin , etamax );
2895+ h -> Fit (func , "+QWLR" , "" );
2896+ }
2897+ h -> SetLineColor (colors [k1 ]);
2898+ h -> SetMarkerColor (colors [k1 ]);
2899+ h -> SetMarkerStyle (mtype [depth - 1 ]);
2900+ h -> SetMarkerSize (0.9 );
2901+ h -> GetXaxis ()-> SetTitle ("i#eta" );
2902+ h -> GetYaxis ()-> SetTitle ("Correction Factor" );
2903+ h -> GetYaxis ()-> SetLabelOffset (0.005 );
2904+ h -> GetYaxis ()-> SetTitleOffset (1.20 );
2905+ h -> GetYaxis ()-> SetRangeUser (0.5 , 1.5 );
2906+ hists .push_back (h );
2907+ entries .push_back (nent );
2908+ if (drawStatBox )
2909+ dy += 0.025 ;
2910+ htype .push_back (k1 );
29092911 }
29102912 ++ nline ;
29112913 }
0 commit comments