Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <TH1I.h>
- void CompareTwoRuns( int s=0, int run1=4648, int run2=3430 ) {
- char thi[80];
- const int ipOrder[14]={8,9,10,11, 13,12,0,7, 4,1,3,5,6,2};
- if( s%2 == 0) sprintf( thi, "ClustX1_%d", ipOrder[s/2]);
- else sprintf( thi, "ClustY1_%d", ipOrder[s/2]);
- TCanvas *c = new TCanvas("c","canvas",10,10,2200,900);
- gPad->SetRightMargin(0.001);
- gPad->SetLeftMargin(0.04);
- gPad->SetTopMargin(0.01);
- gPad->SetBottomMargin(0.04);
- gPad->SetGridx();
- double Sum[2];
- TFile *hFile= new TFile(Form("bmn_run%d_sidigitthr2all.root", run1));
- TH1I *h= (TH1I*)hFile->Get(thi);
- h->Draw(); Sum[0]=h->Integral();
- hFile= new TFile(Form("bmn_run%d_sigemdigitthr2src.root", run2));
- //sprintf( thi, "ClustY1_%d", ipOrder[24/2]);
- h= (TH1I*)hFile->Get(thi);
- h->SetLineColor(2);
- Sum[1]=h->Integral();
- TH1D *hd= (TH1D*) h->Clone();
- hd->Reset();
- for( int i=1; i<=h->GetNbinsX(); i++) { double y= h->GetBinContent(i); hd->SetBinContent(i,y*Sum[0]/Sum[1]);}
- //hd->Scale(Sum[0]/Sum[1]);
- hd->SetMarkerStyle(20); hd->SetMarkerColor(2);
- hd->Draw("same");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement