jdbrice
5/29/2018 - 4:33 AM

Shuai's ccbar scaling code

Shuai's ccbar scaling code




void scale(){

	TFile *f = new TFile( "cc2ee_dimuonAcc_2014BR.root" );

	TH1 * hnParent = (TH1*)f->Get( "nParent" );
	TH2 * hMcAcc = (TH2*)f->Get( "hMCAcc1MvsPtcc2ee" );
	double Ncc = hnParent->GetBinContent(1);

	cout <<"Ncc = " << Ncc << endl;

	double sig_cc = 0.797;
	double sig_mb = 42;
	double bw = 1.0;

	hMcAcc->RebinY(20);
	hMcAcc->Scale( (1.0 / Ncc) * ( sig_cc / sig_mb ) /* ( 1.0 / 1.43)*/ * ( 1.0 / bw ) );

	int b1 = hMcAcc->GetXaxis()->FindBin(2.0);

	TH1 * hMcM = hMcAcc->ProjectionY("m", b1, -1 );
	hMcM->Scale( 1.0, "width" );
	hMcM->Draw();

}