Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:57:14

0001 
0002 class Plots{
0003 
0004   public:
0005   Plots();
0006 
0007 };
0008 
0009 void Plots::Plots()
0010 {
0011 gROOT->Reset();
0012 gROOT->Clear();
0013 
0014 //gStyle->SetOptStat(kFALSE);
0015 // gStyle->SetOptFit(0111);
0016 gStyle->SetStatH(0.1); 
0017 gStyle->SetOptFit(1111);
0018 
0019 TCanvas *c1 = new TCanvas("c1","c1",129,17,926,703);
0020 c1->SetBorderSize(2);
0021 c1->SetFrameFillColor(0);
0022 c1->SetLogy(0);
0023 c1->cd(); 
0024 
0025 
0026 TFile *f[5];
0027 TTree *MyTree[5];
0028 
0029 f[2]=new TFile("ValidationMisalignedTracker_zmumu_chiara.root");
0030 MyTree[2]=EffTracks;
0031 
0032 
0033 ////&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
0034 
0035 //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
0036 /// EFFICIENCIES VS ETA ALIGNED
0037 //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
0038 
0039 char histoname[128];
0040 char name[128];
0041 TH1F *mZmu[5];
0042 
0043 Double_t lorentzianPeak(Double_t *x, Double_t *par) {
0044 return (0.5*par[0]*par[1]/TMath::Pi()) /
0045 TMath::Max( 1.e-10,(x[0]-par[2])*(x[0]-par[2]) + .25*par[1]*par[1]);
0046 }
0047 
0048 TF1 *fitFcn = new TF1("fitFcn",lorentzianPeak,70,110,3);
0049 fitFcn->SetParameters(3.,4.,90.);
0050 fitFcn->SetParNames("Ftop","Fwidth","Fmass");
0051 fitFcn->SetLineWidth(2);
0052 
0053  int i=2;
0054 //for(int i=2; i<3; i++){
0055  sprintf(name,"mZmu[%d]",i);
0056  mZmu[i] = new TH1F(name,name,200,0.,200.);
0057  sprintf(histoname,"mZmu[%d]",i);
0058  MyTree[i]->Project(histoname,"recmzmu","eff==1 && recmzmu>0.&& recpt>3. && abs(receta)<2.5");
0059  
0060  cout << "Entries " << mZmu[i]->GetEntries() <<endl;
0061  mZmu[i]->Scale(1/mZmu[i]->GetEntries());
0062  mZmu[i]->SetTitle("Z->#mu#mu mass from Z->#mu#mu");    
0063  mZmu[i]->SetXTitle(" GeV/c2");
0064  mZmu[i]->SetYTitle("arb. units");
0065  
0066  mZmu[i]->SetLineColor(i+2);
0067  // mZmu[i]->SetLineStyle(i+1);
0068  // mZmu[i]->SetLineWidth(i+2);
0069  //if (i==0) mZmu[i]->Draw();
0070  //else mZmu[i]->Draw("same");
0071  
0072  mZmu[i]->Fit("fitFcn","M","",60,120);
0073  //mZmu[i]->Fit("gaus","","",70,110); 
0074  c1->Update();
0075   
0076 
0077 c1->SaveAs("mZ_mu_fitL1.eps");
0078 gROOT->Reset();
0079 gROOT->Clear();
0080 delete c1;
0081 }
0082 
0083