示例#1
0
bool DrawPileupCorr(Str jetAlgo) {
  JetCalibrationTool *theJES = new JetCalibrationTool(jetAlgo,_jesFile,false);
  bool residual = theJES->JetAreaJES();

  TH1D *temp = new TH1D("","",100,-5,5);
  temp->SetXTitle("Jet #eta"); temp->SetYTitle("Jet offset at "+GetConstScale(jetAlgo)+"-scale [GeV]");
  if (residual) temp->SetYTitle("Residual jet offset at "+GetConstScale(jetAlgo)+"-scale [GeV]");
  temp->SetMinimum(-20); temp->SetMaximum(15); temp->SetStats(0);
  if ( residual && theJES->ResidualOffsetCorr_Description() == "" ) return false;
  Can->Clear(); temp->Draw();
  for (int npv=0;npv<9;++npv) {
    double NPV=(npv%3)*10, mu=(npv/3)*10;
    if (NPV==0) NPV=1;
    Graph *g = new Graph();
    FormatGraph(g,npv);
    for (int ieta=-50;ieta<50;++ieta) {
      double eta=0.05 + 0.1*ieta;
      double O = residual ? theJES->GetResidualOffset(eta,mu,NPV)/1000 :
	theJES->GetOffset(eta,mu,NPV)/1000; // convert to GeV
      g->SetPoint(g->GetN(),eta,O);
    }
    if (npv<4) DrawLabel(Form("N_{PV} = %.0f, #LT#mu#GT = %.0f",NPV,mu),0.18,0.35-0.04*npv,npv);
    else DrawLabel(Form("N_{PV} = %.0f, #LT#mu#GT = %.0f",NPV,mu),0.48,0.35-0.04*(npv-4),npv);
    
    g->Draw("P");
  }
  tex->SetNDC(); tex->SetTextAlign(12);
  if (residual)
    tex->DrawLatex(0.18,0.975,theJES->ResidualOffsetCorr_Description());
  else 
    tex->DrawLatex(0.18,0.975,theJES->OffsetCorr_Description());
  tex->DrawLatex(0.18,0.9,GetJetDesc(jetAlgo));
  return true;
}
示例#2
0
void DrawPileupCorrVsMuNPV(Str jetAlgo) {
  JetCalibrationTool *theJES = new JetCalibrationTool(jetAlgo,_jesFile);
  bool residual = theJES->JetAreaJES();

  TH1D *tempNPV = new TH1D("","",12,0,20);
  TH1D *tempmu  = new TH1D("","",15,0,25);
  tempNPV->SetXTitle("Number of vertices, #it{N}_{PV}");
  tempmu->SetXTitle("Average number of interactions, #LT#it{#mu}#GT"); 
  double etaBins[] = {0, 0.3, 0.8, 1.2, 2.1, 2.8, 3.2, 3.6, 4.5};
  Str tit=residual?"Residual jet offset":"Jet offset";
  tempNPV->SetYTitle(tit+" at "+GetConstScale(jetAlgo)+"-scale [GeV]");
  tempmu->SetYTitle(tit+" at "+GetConstScale(jetAlgo)+"-scale [GeV]");
  tempNPV->SetMinimum(-8); tempNPV->SetMaximum(8); tempNPV->SetStats(0); 
  tempNPV->GetYaxis()->SetTitleOffset(1.0); tempNPV->GetXaxis()->SetTitleOffset(1.0);
  tempmu->SetMinimum(-8); tempmu->SetMaximum(8); tempmu->SetStats(0); 
  tempmu->GetYaxis()->SetTitleOffset(1.0); tempmu->GetXaxis()->SetTitleOffset(1.0);
  if (residual && theJES->ResidualOffsetCorr_Description()=="") return;

  Can->Clear(); tempNPV->Draw();
  for (int ei=0;ei<5;++ei) {
    double eta=0.5;
    if (ei==1) eta=1.0;
    if (ei==2) eta=2.0;
    if (ei==3) eta=3.0;
    if (ei==4) eta=4.0;
    Graph *g = new Graph();
    FormatGraph(g,ei);
    for (int npv=1;npv<=20;++npv)
      if (residual)
	g->SetPoint(g->GetN(),npv,theJES->GetResidualOffset(eta,0.0,npv)/1000);
      else
	g->SetPoint(g->GetN(),npv,theJES->GetOffset(eta,0.0,npv)/1000);
    g->Draw("PL");
  }
  DrawLabel("0.3 #leq |#eta| < 0.8",0.7,0.37,0);
  DrawLabel("0.8 #leq |#eta| < 1.2",0.7,0.37-0.05,1);
  DrawLabel("2.1 #leq |#eta| < 2.8",0.7,0.37-0.1,2);
  DrawLabel("2.8 #leq |#eta| < 3.2",0.7,0.37-0.15,3);
  DrawLabel("3.6 #leq |#eta| < 4.5",0.7,0.37-0.2,4);
  tex->SetNDC(); tex->SetTextAlign(12);
  //tex->DrawLatex(0.18,0.975,myJES->OffsetCorr_Description());
  int jetR=jetAlgo.Contains("Kt4")?4:6;
  tex->DrawLatex(0.18,0.9,Form("Anti-k_{t} #it{R} = 0.%d, %s+JES",jetR,GetConstScale(jetAlgo).Data()));
  Can->Print(ps); 
  
  Can->Clear(); tempmu->Draw();
  for (int ei=0;ei<5;++ei) {
    double eta=0.5;
    if (ei==1) eta=1.0;
    if (ei==2) eta=2.0;
    if (ei==3) eta=3.0;
    if (ei==4) eta=4.0;
    Graph *g = new Graph();
      FormatGraph(g,ei);
      for (int mu=0;mu<=25;++mu) 
	if (residual)
	  g->SetPoint(g->GetN(),mu,theJES->GetResidualOffset(eta,mu,1)/1000);
	else
	  g->SetPoint(g->GetN(),mu,theJES->GetOffset(eta,mu,1)/1000);
      g->Draw("PL");
  }
  DrawLabel("0.3 #leq |#eta| < 0.8",0.2,0.37,0);
  DrawLabel("0.8 #leq |#eta| < 1.2",0.2,0.37-0.05,1);
  DrawLabel("2.1 #leq |#eta| < 2.8",0.2,0.37-0.1,2);
  DrawLabel("2.8 #leq |#eta| < 3.2",0.2,0.37-0.15,3);
  DrawLabel("3.6 #leq |#eta| < 4.5",0.2,0.37-0.2,4);
  tex->SetNDC(); tex->SetTextAlign(12);
  //tex->DrawLatex(0.18,0.975,myJES->OffsetCorr_Description());
  tex->DrawLatex(0.18,0.9,Form("Anti-k_{t} #font[52]{R} = 0.%d, %s+JES",jetR,GetConstScale(jetAlgo).Data()));
  Can->Print(ps);
}