{ gStyle->SetOptStat("emr"); TChain *ch = new TChain("tree"); ch->Add("/home/deepak/Desktop/Xcheck_bin3/macro_aod/sel_BsToPhiMuMu_*.root"); TTree *tr = ch; double Bmass= 0; double Mumumass = 0; double CosThetaK = 0; double CosThetaL = 0; tr->SetBranchStatus("*",0); tr->SetBranchStatus("Bmass" , 1); tr->SetBranchStatus("Q2" , 1); tr->SetBranchStatus("Mumumass" , 1); tr->SetBranchStatus("Mumumasserr" , 1); tr->SetBranchStatus("Triggers" , 1); tr->SetBranchStatus("CosThetaL" ,1); tr->SetBranchStatus("CosThetaL" ,1); /* for (double i=1.0; i<19.00;i+=4.30) { TCut Q2 = Form("Q2 > %g",i); TCut selbm = Q2 ; printf("%s\n",selbm.GetTitle()); TH1D *h_bs0 = new TH1D("h_bs0","B_{s} mass for Bin 0; B_{s} Mass; Events", 80, 4.7,6.0); TCanvas *cv1 = new TCanvas("cv1","",600,600); tr1->Draw("Bmass >> h_bs0",selbm); } */ // int n= 2 //char var [2] = { "Bmass","Mumumass" }; //tr->Draw("var[0]); /* TCut Q0= "Q2> 1.0 && Q2 < 4.30"; TCut selbm0 = Q0; TCut Q1= "Q2> 4.30 && Q2 < 8.68"; TCut selbm1 = Q1; TCut Q2= "Q2> 8.68 && Q2 < 10.09"; TCut selbm2 = Q2; TCut Q3= "Q2> 10.09 && Q2 < 12.86"; TCut selbm3 = Q3; TCut Q4= "Q2> 12.86 && Q2 < 14.18"; TCut selbm4 = Q4; TCut Q5= "Q2> 14.18 && Q2 < 16.0"; TCut selbm5 = Q5; TCut Q6= "Q2> 16.0 && Q2 < 19.0"; TCut selbm6 = Q6; */ /* int n; int m ; string var[n] = {"Bmass","Mumumass"}; string var[m] = {"selbm0","selbm1","selbm2","selbm3","selbm4","selbm5","selbm6"} for (int n = 1; n<3; n++){ for (int m = 1; m<8; m++){ tr->Draw(Form("%s",var[n].c_str())); } }*/ const int n = 2; const int m = 7; TCut Q[7]; TCut Q[0]= "Q2> 1.0 && Q2 < 4.30"; TCut Q[1]= "Q2> 4.30 && Q2 < 8.68"; TCut Q[2]= "Q2> 8.68 && Q2 < 10.09"; TCut Q[3]= "Q2> 10.09 && Q2 < 12.86"; TCut Q[4]= "Q2> 12.86 && Q2 < 14.18"; TCut Q[5]= "Q2> 14.18 && Q2 < 16.0"; TCut Q[6]= "Q2> 16.0 && Q2 < 19.0"; string varmass[n] = {"Bmass","Mumumass"}; // string varsel [m] = {"selbm0","selbm1","selbm2","selbm3","selbm4","selbm5","selbm6"}; for (int i = 0; iDraw(Form("%s",Q[j].c_str())); } } }